CombinedText
stringlengths
4
3.42M
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- SQL Database Access -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2013, 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 Ada_2012; private with Ada.Finalization; with League.Holders; with League.Strings; private with Matreshka.Internals.SQL_Drivers.Dummy; package SQL.Queries is type SQL_Query is tagged private; procedure Bind_Value (Self : in out SQL_Query'Class; Name : League.Strings.Universal_String; Value : League.Holders.Holder; Direction : Parameter_Directions := In_Parameter); -- Set the placeholder Name to be bound to value Value in the prepared -- statement. -- -- XXX Add description of Direction and how to set value to NULL. function Bound_Value (Self : SQL_Query'Class; Name : League.Strings.Universal_String) return League.Holders.Holder; function Error_Message (Self : SQL_Query'Class) return League.Strings.Universal_String; function Execute (Self : in out SQL_Query'Class) return Boolean; -- Executes a previously prepared SQL query. Returns True if the query -- executed successfully; otherwise returns False. -- -- After the query is executed, the query is positioned on an invalid -- record and must be navigated to a valid record before data values can be -- retrieved. -- -- Note that the last error for this query is reset when Execute is called. procedure Execute (Self : in out SQL_Query'Class); -- Executes a previously prepared SQL query. Raises SQL_Error when query -- is not executed successfully. -- -- After the query is executed, the query is positioned on an invalid -- record and must be navigated to a valid record before data values can be -- retrieved. -- -- Note that the last error for this query is reset when Execute is called. procedure Finish (Self : in out SQL_Query'Class); -- Instruct the database driver that no more data will be fetched from this -- query until it is re-executed. There is normally no need to call this -- function, but it may be helpful in order to free resources such as locks -- or cursors if you intend to re-use the query at a later time. -- -- Sets the query to inactive. Bound values retain their values. function Is_Active (Self : SQL_Query'Class) return Boolean; -- Returns True if the query is active. An active SQL_Query is one that has -- been executed successfully but not yet finished with. When you are -- finished with an active query, you can make make the query inactive by -- calling Finish, or you can delete the SQL_Query instance. -- -- Note: Of particular interest is an active query that is a SELECT -- statement. For some databases that support transactions, an active query -- that is a SELECT statement can cause a Commit or a Rollback to fail, so -- before committing or rolling back, you should make your active SELECT -- statement query inactive using one of the ways listed above. function Is_Valid (Self : SQL_Query'Class) return Boolean; -- Returns True if the query is currently positioned on a valid record; -- otherwise returns false. function Next (Self : in out SQL_Query'Class) return Boolean; function Prepare (Self : in out SQL_Query'Class; Query : League.Strings.Universal_String) return Boolean; -- Prepares the SQL query query for execution. Returns True if the query is -- prepared successfully; otherwise returns False. -- -- The query may contain placeholders for binding values. Both Oracle style -- colon-name (e.g., :surname), and ODBC style (?) placeholders are -- supported; but they cannot be mixed in the same query. -- -- Portability note: Some databases choose to delay preparing a query until -- it is executed the first time. In this case, preparing a syntactically -- wrong query succeeds, but every consecutive Execute will fail. procedure Prepare (Self : in out SQL_Query'Class; Query : League.Strings.Universal_String); -- Prepares the SQL query query for execution. Raises SQL_Error if query is -- not prepared successfully. -- -- The query may contain placeholders for binding values. Both Oracle style -- colon-name (e.g., :surname), and ODBC style (?) placeholders are -- supported; but they cannot be mixed in the same query. -- -- Portability note: Some databases choose to delay preparing a query until -- it is executed the first time. In this case, preparing a syntactically -- wrong query succeeds, but every consecutive Execute will fail. -- function Previous (Self : in out SQL_Query'Class) return Boolean; -- procedure Previous (Self : in out SQL_Query'Class); function Value (Self : SQL_Query'Class; Index : Positive) return League.Holders.Holder; private type SQL_Query is new Ada.Finalization.Controlled with record Data : Matreshka.Internals.SQL_Drivers.Query_Access := Matreshka.Internals.SQL_Drivers.Dummy.Empty_Query'Access; end record; overriding procedure Adjust (Self : in out SQL_Query); overriding procedure Finalize (Self : in out SQL_Query); end SQL.Queries;
with Ahven, float_Math.Algebra.linear.d2; with Ada.Text_IO; use Ada.Text_IO; package body math_Tests.linear_Algebra_2d is use Ahven, float_Math; function almost_Equal (Left, Right : in Real) return Boolean is Tolerance : constant := 0.000_000_1; begin return abs (Left - Right) <= Tolerance; end almost_Equal; procedure translation_Matrix_Test is use float_Math, float_Math.Algebra.linear.d2; From : Vector_2 := (0.0, 0.0); To : Vector_2; begin To := From * to_translation_Transform ((1.0, 0.0)); assert (To (1) = 1.0, Image (To) & " translation () failed !"); assert (To (2) = 0.0, Image (To) & " translation () failed !"); To := From * to_translation_Transform ((0.0, 1.0)); assert (To (1) = 0.0, Image (To) & " translation () failed !"); assert (To (2) = 1.0, Image (To) & " translation () failed !"); To := From * to_translation_Transform ((-1.0, 0.0)); assert (To (1) = -1.0, Image (To) & " translation () failed !"); assert (To (2) = 0.0, Image (To) & " translation () failed !"); To := From * to_translation_Transform ((0.0, -1.0)); assert (To (1) = 0.0, Image (To) & " translation () failed !"); assert (To (2) = -1.0, Image (To) & " translation () failed !"); To := From * to_translation_Transform ((1.0, 1.0)); assert (To (1) = 1.0, Image (To) & " translation () failed !"); assert (To (2) = 1.0, Image (To) & " translation () failed !"); To := From * to_translation_Transform ((-1.0, -1.0)); assert (To (1) = -1.0, Image (To) & " translation () failed !"); assert (To (2) = -1.0, Image (To) & " translation () failed !"); end translation_Matrix_Test; procedure rotation_Matrix_Test is use float_Math, float_Math.Algebra.linear.d2; From : Vector_2 := (1.0, 0.0); To : Vector_2; begin To := From * to_rotation_Matrix (to_Radians (90.0)); assert (almost_Equal (To (1), 0.0), Image (To, 16) & " rotation (90a) failed !"); assert (almost_Equal (To (2), 1.0), Image (To, 16) & " rotation (90b) failed !"); To := From * to_rotation_Matrix (to_Radians (-90.0)); assert (almost_Equal (To (1), 0.0), Image (To, 16) & " rotation (-90a) failed !"); assert (almost_Equal (To (2), -1.0), Image (To, 16) & " rotation (-90b) failed !"); To := From * to_rotation_Matrix (to_Radians (180.0)); assert (almost_Equal (To (1), -1.0), Image (To, 16) & " rotation (180a) failed !"); assert (almost_Equal (To (2), 0.0), Image (To, 16) & " rotation (180b) failed !"); To := From * to_rotation_Matrix (to_Radians (-180.0)); assert (almost_Equal (To (1), -1.0), Image (To, 16) & " rotation (-180a) failed !"); assert (almost_Equal (To (2), 0.0), Image (To, 16) & " rotation (-180b) failed !"); To := From * to_rotation_Matrix (to_Radians (270.0)); assert (almost_Equal (To (1), 0.0), Image (To, 16) & " rotation (270a) failed !"); assert (almost_Equal (To (2), -1.0), Image (To, 16) & " rotation (270b) failed !"); To := From * to_rotation_Matrix (to_Radians (-270.0)); assert (almost_Equal (To (1), 0.0), Image (To, 16) & " rotation (-270) failed !"); assert (almost_Equal (To (2), 1.0), Image (To, 16) & " rotation (-270) failed !"); end rotation_Matrix_Test; procedure transform_Test is use float_Math, float_Math.Algebra.linear.d2; From : Vector_2 := (1.0, 0.0); To : Vector_2; Transform : Transform_2d := to_Transform_2d (rotation => to_Radians (90.0), translation => (0.0, 0.0)); begin To := From * Transform; assert (almost_Equal (To (1), 0.0), Image (To, 16) & " transform (a) failed !"); assert (almost_Equal (To (2), 1.0), Image (To, 16) & " transform (b) failed !"); Transform.Translation := (1.0, 0.0); To := From * Transform; assert (almost_Equal (To (1), 1.0), Image (To, 16) & " transform (c) failed !"); assert (almost_Equal (To (2), 1.0), Image (To, 16) & " transform (d) failed !"); end transform_Test; procedure Initialize (T : in out Test) is begin T.set_Name ("Linear Algebra (2D) Tests"); Framework.add_test_Routine (T, translation_Matrix_Test'Access, "translation_Matrix_Test"); Framework.add_test_Routine (T, rotation_Matrix_Test'Access, "rotation_Matrix_Test"); Framework.add_test_Routine (T, transform_Test'Access, "transform_Test"); end Initialize; end math_Tests.linear_Algebra_2d;
-- Copyright 2004, 2007, 2008, 2009, 2010, 2011 -- 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; procedure Fixed_Points is ------------ -- Test 1 -- ------------ -- Fixed point subtypes type Base_Fixed_Point_Type is delta 1.0 / 16.0 range (System.Min_Int / 2) * 1.0 / 16.0 .. (System.Max_Int / 2) * 1.0 / 16.0; subtype Fixed_Point_Subtype is Base_Fixed_Point_Type range -50.0 .. 50.0; type New_Fixed_Point_Type is new Base_Fixed_Point_Type range -50.0 .. 50.0; Base_Object : Base_Fixed_Point_Type := -50.0; Subtype_Object : Fixed_Point_Subtype := -50.0; New_Type_Object : New_Fixed_Point_Type := -50.0; ------------ -- Test 2 -- ------------ -- Overprecise delta Overprecise_Delta : constant := 0.135791357913579; -- delta whose significant figures cannot be stored into a long. type Overprecise_Fixed_Point is delta Overprecise_Delta range 0.0 .. 200.0; for Overprecise_Fixed_Point'Small use Overprecise_Delta; Overprecise_Object : Overprecise_Fixed_Point := Overprecise_Fixed_Point'Small; begin Base_Object := 1.0/16.0; -- Set breakpoint here Subtype_Object := 1.0/16.0; New_Type_Object := 1.0/16.0; Overprecise_Object := Overprecise_Fixed_Point'Small * 2; end Fixed_Points;
----------------------------------------------------------------------- -- util-properties-form-tests -- Test reading JSON file into properties -- Copyright (C) 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 Util.Test_Caller; with Util.Files; package body Util.Properties.Form.Tests is package Caller is new Util.Test_Caller (Test, "Properties.Properties.Form"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Properties.Form.Parse_Form", Test_Parse_Form'Access); end Add_Tests; -- Test loading a JSON file into a properties object. procedure Test_Parse_Form (T : in out Test) is procedure Check (Name : in String; Value : in String); P : Util.Properties.Manager; procedure Check (Name : in String; Value : in String) is begin T.Assert (P.Exists (Name), "Missing property: " & Name); Util.Tests.Assert_Equals (T, Value, String '(P.Get (Name)), "Invalid property: " & Name); end Check; Path : constant String := Util.Tests.Get_Test_Path ("regtests/files/test-1.form"); S : Ada.Strings.Unbounded.Unbounded_String; begin Util.Files.Read_File (Path, S); Util.Properties.Form.Parse_Form (P, Ada.Strings.Unbounded.To_String (S)); Check ("access_token", "97356"); Check ("token_type", "bearer"); Check ("refresh_token_expires_in", "15724800"); Check ("refresh_token", "r1.714b6"); Check ("scope", ""); Check ("scope", ""); end Test_Parse_Form; end Util.Properties.Form.Tests;
with freeType_C.FT_Face, freeType_C.FT_Size; package freetype.face_Size -- -- The face_Size class provides an abstraction layer for the Freetype Size type. -- is type Item is tagged private; type View is access all Item'Class; --------- --- Forge -- procedure destruct (Self : in out Item) is null; -------------- --- Attributes -- function CharSize (Self : access Item; Face : in freeType_C.FT_Face.item; point_Size : in Natural; x_Resolution, y_Resolution : in Natural) return Boolean; -- -- Sets the char size for the current face. -- -- This doesn't guarantee that the size was set correctly. Clients should call 'check Error' for -- more information if this function returns false. If an error does occur the size object isn't modified. -- -- Face: Parent face for this size object. -- point_Size: The face size in points (1/72 inch). -- x_Resolution: The horizontal resolution of the target device. -- y_Resolution: The vertical resolution of the target device. -- -- Returns true if the size has been set. function CharSize (Self : in Item) return Natural; -- Returns the char size in points. -- -- Get the char size for the current face. function Ascender (Self : in Item) return Float; -- Returns the Ascender height. -- -- Gets the global ascender height for the face in pixels. function Descender (Self : in Item) return Float; -- Returns the Descender height. -- -- Gets the global descender height for the face in pixels. function Height (Self : in Item) return Float; -- Returns the height in pixels. -- -- Gets the global face height for the face. -- -- If the face is scalable this returns the height of the global -- bounding box which ensures that any glyph will be less than or -- equal to this height. If the font isn't scalable there is no -- guarantee that glyphs will not be taller than this value. function Width (Self : in Item) return Float; -- Returns the width in pixels. -- -- Gets the global face width for the face. -- -- If the face is scalable this returns the width of the global -- bounding box which ensures that any glyph will be less than or -- equal to this width. If the font isn't scalable this value is -- the max_advance for the face. function Underline (Self : in Item) return Float; -- Returns the underline position in pixels. -- -- Gets the underline position for the face. function Error (Self : in Item) return freeType_C.FT_Error; -- Returns the current error code. -- -- Queries for errors. private type Item is tagged record ftFace : freeType_C.FT_Face.item; -- The current Freetype face that this FTSize object relates to. ftSize : freeType_C.FT_Size.item; -- The freetype Size. Size : Natural := 0; -- The size in points. xResolution, -- The horizontal resolution. yResolution : Natural := 0; -- The vertical resolution. Err : freeType_C.FT_Error := 0; -- Current error code. Zero means no error. end record; end freetype.face_Size;
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with bits_struct_mutex_h; with bits_thread_shared_types_h; with bits_struct_rwlock_h; package bits_pthreadtypes_h is -- Declaration of common pthread types for all architectures. -- Copyright (C) 2017-2021 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- The GNU C 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 -- Lesser General Public License for more details. -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, see -- <https://www.gnu.org/licenses/>. -- For internal mutex and condition variable definitions. -- Thread identifiers. The structure of the attribute type is not -- exposed on purpose. subtype pthread_t is unsigned_long; -- /usr/include/bits/pthreadtypes.h:27 -- Data structures for mutex handling. The structure of the attribute -- type is not exposed on purpose. -- skipped anonymous struct anon_8 subtype pthread_mutexattr_t_array1001 is Interfaces.C.char_array (0 .. 3); type pthread_mutexattr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_mutexattr_t_array1001; -- /usr/include/bits/pthreadtypes.h:34 when others => uu_align : aliased int; -- /usr/include/bits/pthreadtypes.h:35 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:36 -- Data structure for condition variable handling. The structure of -- the attribute type is not exposed on purpose. -- skipped anonymous struct anon_9 subtype pthread_condattr_t_array1001 is Interfaces.C.char_array (0 .. 3); type pthread_condattr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_condattr_t_array1001; -- /usr/include/bits/pthreadtypes.h:43 when others => uu_align : aliased int; -- /usr/include/bits/pthreadtypes.h:44 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:45 -- Keys for thread-specific data subtype pthread_key_t is unsigned; -- /usr/include/bits/pthreadtypes.h:49 -- Once-only execution subtype pthread_once_t is int; -- /usr/include/bits/pthreadtypes.h:53 subtype pthread_attr_t_array1009 is Interfaces.C.char_array (0 .. 55); type pthread_attr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_attr_t_array1009; -- /usr/include/bits/pthreadtypes.h:58 when others => uu_align : aliased long; -- /usr/include/bits/pthreadtypes.h:59 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:56 -- skipped anonymous struct anon_10 subtype pthread_mutex_t_array1014 is Interfaces.C.char_array (0 .. 39); type pthread_mutex_t (discr : unsigned := 0) is record case discr is when 0 => uu_data : aliased bits_struct_mutex_h.uu_pthread_mutex_s; -- /usr/include/bits/pthreadtypes.h:69 when 1 => uu_size : aliased pthread_mutex_t_array1014; -- /usr/include/bits/pthreadtypes.h:70 when others => uu_align : aliased long; -- /usr/include/bits/pthreadtypes.h:71 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:72 -- skipped anonymous struct anon_11 subtype pthread_cond_t_array1018 is Interfaces.C.char_array (0 .. 47); type pthread_cond_t (discr : unsigned := 0) is record case discr is when 0 => uu_data : aliased bits_thread_shared_types_h.uu_pthread_cond_s; -- /usr/include/bits/pthreadtypes.h:77 when 1 => uu_size : aliased pthread_cond_t_array1018; -- /usr/include/bits/pthreadtypes.h:78 when others => uu_align : aliased Long_Long_Integer; -- /usr/include/bits/pthreadtypes.h:79 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:80 -- Data structure for reader-writer lock variable handling. The -- structure of the attribute type is deliberately not exposed. -- skipped anonymous struct anon_12 subtype pthread_rwlock_t_array1009 is Interfaces.C.char_array (0 .. 55); type pthread_rwlock_t (discr : unsigned := 0) is record case discr is when 0 => uu_data : aliased bits_struct_rwlock_h.uu_pthread_rwlock_arch_t; -- /usr/include/bits/pthreadtypes.h:88 when 1 => uu_size : aliased pthread_rwlock_t_array1009; -- /usr/include/bits/pthreadtypes.h:89 when others => uu_align : aliased long; -- /usr/include/bits/pthreadtypes.h:90 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:91 -- skipped anonymous struct anon_13 subtype pthread_rwlockattr_t_array1024 is Interfaces.C.char_array (0 .. 7); type pthread_rwlockattr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_rwlockattr_t_array1024; -- /usr/include/bits/pthreadtypes.h:95 when others => uu_align : aliased long; -- /usr/include/bits/pthreadtypes.h:96 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:97 -- POSIX spinlock data type. subtype pthread_spinlock_t is int; -- /usr/include/bits/pthreadtypes.h:103 -- POSIX barriers data type. The structure of the type is -- deliberately not exposed. -- skipped anonymous struct anon_14 subtype pthread_barrier_t_array1030 is Interfaces.C.char_array (0 .. 31); type pthread_barrier_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_barrier_t_array1030; -- /usr/include/bits/pthreadtypes.h:110 when others => uu_align : aliased long; -- /usr/include/bits/pthreadtypes.h:111 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:112 -- skipped anonymous struct anon_15 subtype pthread_barrierattr_t_array1001 is Interfaces.C.char_array (0 .. 3); type pthread_barrierattr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_barrierattr_t_array1001; -- /usr/include/bits/pthreadtypes.h:116 when others => uu_align : aliased int; -- /usr/include/bits/pthreadtypes.h:117 end case; end record with Convention => C_Pass_By_Copy, Unchecked_Union => True; -- /usr/include/bits/pthreadtypes.h:118 end bits_pthreadtypes_h;
with System; package Init3 is type Small is mod 2**2; for Small'Size use 2; type Count is mod 2**9; for Count'Size use 9; type Nested1 is record C1 : Count; C2 : Count; C3 : Count; end record; pragma Pack (Nested1); for Nested1'Size use 27; for Nested1'Bit_Order use System.Low_Order_First; for Nested1'Scalar_Storage_Order use System.Low_Order_First; type R1 is record S1 : Small; I : Integer; S2 : Small; N : Nested1; B : Boolean; end record; for R1'Bit_Order use System.Low_Order_First; for R1'Scalar_Storage_Order use System.Low_Order_First; for R1 use record S1 at 0 range 0 .. 1; I at 0 range 2 .. 33; S2 at 0 range 34 .. 35; N at 0 range 36 .. 62; B at 0 range 63 .. 63; end record; for R1'Size use 64; type Nested2 is record C1 : Count; C2 : Count; C3 : Count; end record; pragma Pack (Nested2); for Nested2'Size use 27; for Nested2'Bit_Order use System.High_Order_First; for Nested2'Scalar_Storage_Order use System.High_Order_First; type R2 is record S1 : Small; I : Integer; S2 : Small; N : Nested2; B : Boolean; end record; for R2'Bit_Order use System.High_Order_First; for R2'Scalar_Storage_Order use System.High_Order_First; for R2 use record S1 at 0 range 0 .. 1; I at 0 range 2 .. 33; S2 at 0 range 34 .. 35; N at 0 range 36 .. 62; B at 0 range 63 .. 63; end record; for R2'Size use 64; My_R1 : constant R1 := (S1 => 2, I => 16#12345678#, S2 => 1, N => (16#AB#, 16#CD#, 16#EF#), B => True); My_R2 : constant R2 := (S1 => 2, I => 16#12345678#, S2 => 1, N => (16#AB#, 16#CD#, 16#EF#), B => True); end Init3;
<?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/> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>relu_1</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>2</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>data_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>data.V</originalName> <rtlName/> <coreName>RAM</coreName> </Obj> <bitwidth>14</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>6728</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>res_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>res.V</originalName> <rtlName/> <coreName>RAM</coreName> </Obj> <bitwidth>13</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>6728</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>15</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>3</id> <name/> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>76</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</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>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>76</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>23</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.76</m_delay> <m_topoIndex>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>5</id> <name>ii</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ii</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>25</item> <item>26</item> <item>27</item> <item>28</item> </oprand_edges> <opcode>phi</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>2</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>6</id> <name>tmp</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>76</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>76</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_fu_55_p2</rtlName> <coreName/> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>29</item> <item>31</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>2.09</m_delay> <m_topoIndex>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>8</id> <name>ii_2</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>76</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>76</second> </item> </second> </item> </inlineStackInfo> <originalName>ii</originalName> <rtlName>ii_2_fu_61_p2</rtlName> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>32</item> <item>34</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.67</m_delay> <m_topoIndex>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>9</id> <name/> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>76</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>76</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>35</item> <item>36</item> <item>37</item> </oprand_edges> <opcode>br</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>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>11</id> <name>tmp_s</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>80</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>80</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_s_fu_67_p1</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>38</item> </oprand_edges> <opcode>zext</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>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>12</id> <name>data_V_addr</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>80</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>80</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>39</item> <item>41</item> <item>42</item> </oprand_edges> <opcode>getelementptr</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>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>13</id> <name>datareg_V</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>80</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>80</second> </item> </second> </item> </inlineStackInfo> <originalName>datareg.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>14</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>43</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>14</id> <name>tmp_16</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>80</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>80</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_16_fu_72_p1</rtlName> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>44</item> </oprand_edges> <opcode>trunc</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>10</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>15</id> <name>tmp_2</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>81</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>81</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_2_fu_76_p2</rtlName> <coreName/> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>45</item> <item>47</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>2.20</m_delay> <m_topoIndex>11</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>16</id> <name>res_V_addr</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>81</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>81</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>48</item> <item>49</item> <item>50</item> </oprand_edges> <opcode>getelementptr</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>13</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>17</id> <name>datareg_V_2</name> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>81</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>81</second> </item> </second> </item> </inlineStackInfo> <originalName>datareg.V</originalName> <rtlName>datareg_V_2_fu_81_p3</rtlName> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>51</item> <item>52</item> <item>53</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.69</m_delay> <m_topoIndex>12</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>18</id> <name/> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>81</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>81</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>54</item> <item>55</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>14</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>19</id> <name/> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>76</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>76</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>56</item> </oprand_edges> <opcode>br</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>15</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>21</id> <name/> <fileName>firmware/nnet_utils/nnet_activation.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>84</lineNumber> <contextFuncName>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_activation.h</first> <second>relu&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, relu_config5&amp;gt;</second> </first> <second>84</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </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>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_18"> <Value> <Obj> <type>2</type> <id>24</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_19"> <Value> <Obj> <type>2</type> <id>30</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <const_type>0</const_type> <content>6728</content> </item> <item class_id_reference="16" object_id="_20"> <Value> <Obj> <type>2</type> <id>33</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>13</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_21"> <Value> <Obj> <type>2</type> <id>40</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_22"> <Value> <Obj> <type>2</type> <id>46</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>14</bitwidth> </Value> <const_type>0</const_type> <content>0</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="_23"> <Obj> <type>3</type> <id>4</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>3</item> </node_objs> </item> <item class_id_reference="18" object_id="_24"> <Obj> <type>3</type> <id>10</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>5</item> <item>6</item> <item>8</item> <item>9</item> </node_objs> </item> <item class_id_reference="18" object_id="_25"> <Obj> <type>3</type> <id>20</id> <name>_ZgtILi14ELi2ELb1EL9ap_q_mode0EL9ap_o_mode0ELi0EEbRK13ap_fixed_baseIXT_EXT0_EXT1_EXT2_EXT3_EXT4_EEi.exit</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>9</count> <item_version>0</item_version> <item>11</item> <item>12</item> <item>13</item> <item>14</item> <item>15</item> <item>16</item> <item>17</item> <item>18</item> <item>19</item> </node_objs> </item> <item class_id_reference="18" object_id="_26"> <Obj> <type>3</type> <id>22</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>21</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>33</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_27"> <id>23</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>3</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_28"> <id>25</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_29"> <id>26</id> <edge_type>2</edge_type> <source_obj>4</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_30"> <id>27</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>5</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_31"> <id>28</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>5</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_32"> <id>29</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>6</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_33"> <id>31</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>6</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_34"> <id>32</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_35"> <id>34</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_36"> <id>35</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_37"> <id>36</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_38"> <id>37</id> <edge_type>2</edge_type> <source_obj>22</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_39"> <id>38</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>11</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_40"> <id>39</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_41"> <id>41</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_42"> <id>42</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_43"> <id>43</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>13</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_44"> <id>44</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>14</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_45"> <id>45</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_46"> <id>47</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_47"> <id>48</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_48"> <id>49</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_49"> <id>50</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_50"> <id>51</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_51"> <id>52</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_52"> <id>53</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_53"> <id>54</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_54"> <id>55</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_55"> <id>56</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>19</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_56"> <id>63</id> <edge_type>2</edge_type> <source_obj>4</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_57"> <id>64</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_58"> <id>65</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>20</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_59"> <id>66</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>10</sink_obj> <is_back_edge>1</is_back_edge> </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="_60"> <mId>1</mId> <mTag>relu.1</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>26913</mMinLatency> <mMaxLatency>26913</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_61"> <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>4</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"/> </item> <item class_id_reference="22" object_id="_62"> <mId>3</mId> <mTag>Loop 1</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>10</item> <item>20</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>6728</mMinTripCount> <mMaxTripCount>6728</mMaxTripCount> <mMinLatency>26912</mMinLatency> <mMaxLatency>26912</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_63"> <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>22</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"/> </item> </cdfg_regions> <fsm class_id="24" tracking_level="1" version="0" object_id="_64"> <states class_id="25" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_65"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_66"> <id>3</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_67"> <id>2</id> <operations> <count>9</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_68"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_69"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_70"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_71"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_72"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_73"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_74"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_75"> <id>13</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_76"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_77"> <id>3</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_78"> <id>13</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_79"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_80"> <id>4</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_81"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_82"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_83"> <id>5</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_84"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_85"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_86"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_87"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>-1</id> <sop 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"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_88"> <inState>2</inState> <outState>3</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item class_id="34" tracking_level="0" version="0"> <first class_id="35" tracking_level="0" version="0"> <first>6</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_89"> <inState>3</inState> <outState>4</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_90"> <inState>4</inState> <outState>5</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_91"> <inState>5</inState> <outState>2</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="36" tracking_level="1" version="0" object_id="_92"> <dp_component_resource class_id="37" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_component_resource> <dp_expression_resource> <count>5</count> <item_version>0</item_version> <item class_id="38" tracking_level="0" version="0"> <first>ap_block_state1 ( or ) </first> <second class_id="39" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="40" tracking_level="0" version="0"> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>datareg_V_2_fu_81_p3 ( select ) </first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>13</second> </item> <item> <first>(2P2)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>13</second> </item> </second> </item> <item> <first>ii_2_fu_61_p2 ( + ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>13</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>17</second> </item> </second> </item> <item> <first>tmp_2_fu_76_p2 ( icmp ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>14</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>13</second> </item> </second> </item> <item> <first>tmp_fu_55_p2 ( icmp ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>13</second> </item> <item> <first>(1P1)</first> <second>12</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>13</second> </item> </second> </item> </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>3</count> <item_version>0</item_version> <item> <first>ap_NS_fsm</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>6</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>6</second> </item> <item> <first>LUT</first> <second>33</second> </item> </second> </item> <item> <first>ap_done</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ii_reg_44</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>13</second> </item> <item> <first>(2Count)</first> <second>26</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> </dp_multiplexer_resource> <dp_register_resource> <count>8</count> <item_version>0</item_version> <item> <first>ap_CS_fsm</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>5</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> </second> </item> <item> <first>ap_done_reg</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>datareg_V_2_reg_116</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>13</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>13</second> </item> </second> </item> <item> <first>datareg_V_reg_106</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>14</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>14</second> </item> </second> </item> <item> <first>ii_2_reg_91</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>13</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>13</second> </item> </second> </item> <item> <first>ii_reg_44</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>13</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>13</second> </item> </second> </item> <item> <first>tmp_16_reg_111</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>13</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>13</second> </item> </second> </item> <item> <first>tmp_s_reg_96</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>64</second> </item> <item> <first>(Consts)</first> <second>51</second> </item> <item> <first>FF</first> <second>13</second> </item> </second> </item> </dp_register_resource> <dp_dsp_resource> <count>0</count> <item_version>0</item_version> </dp_dsp_resource> <dp_component_map class_id="41" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_component_map> <dp_expression_map> <count>4</count> <item_version>0</item_version> <item class_id="42" tracking_level="0" version="0"> <first>datareg_V_2_fu_81_p3 ( select ) </first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>ii_2_fu_61_p2 ( + ) </first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>tmp_2_fu_76_p2 ( icmp ) </first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>tmp_fu_55_p2 ( icmp ) </first> <second> <count>1</count> <item_version>0</item_version> <item>6</item> </second> </item> </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="43" tracking_level="0" version="0"> <count>15</count> <item_version>0</item_version> <item class_id="44" tracking_level="0" version="0"> <first>3</first> <second class_id="45" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>5</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>6</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>8</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>9</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>13</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>14</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>1</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="46" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="47" tracking_level="0" version="0"> <first>4</first> <second class_id="48" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>10</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>20</first> <second> <first>1</first> <second>4</second> </second> </item> <item> <first>22</first> <second> <first>1</first> <second>1</second> </second> </item> </bblk_ent_exit> <regions class_id="49" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </regions> <dp_fu_nodes class_id="50" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="51" tracking_level="0" version="0"> <first>18</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>25</first> <second> <count>2</count> <item_version>0</item_version> <item>13</item> <item>13</item> </second> </item> <item> <first>31</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>38</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>48</first> <second> <count>1</count> <item_version>0</item_version> <item>5</item> </second> </item> <item> <first>55</first> <second> <count>1</count> <item_version>0</item_version> <item>6</item> </second> </item> <item> <first>61</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>67</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>72</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>76</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>81</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="53" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="54" tracking_level="0" version="0"> <first>data_V_addr_gep_fu_18</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>datareg_V_2_fu_81</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>ii_2_fu_61</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>ii_phi_fu_48</first> <second> <count>1</count> <item_version>0</item_version> <item>5</item> </second> </item> <item> <first>res_V_addr_gep_fu_31</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>tmp_16_fu_72</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>tmp_2_fu_76</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>tmp_fu_55</first> <second> <count>1</count> <item_version>0</item_version> <item>6</item> </second> </item> <item> <first>tmp_s_fu_67</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> </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="55" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="56" tracking_level="0" version="0"> <first class_id="57" tracking_level="0" version="0"> <first>data_V</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>13</item> <item>13</item> </second> </item> <item> <first> <first>res_V</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> </dp_mem_port_nodes> <dp_reg_nodes> <count>7</count> <item_version>0</item_version> <item> <first>44</first> <second> <count>1</count> <item_version>0</item_version> <item>5</item> </second> </item> <item> <first>91</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>96</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>101</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>106</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>111</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>116</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>7</count> <item_version>0</item_version> <item> <first>data_V_addr_reg_101</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>datareg_V_2_reg_116</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>datareg_V_reg_106</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>ii_2_reg_91</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>ii_reg_44</first> <second> <count>1</count> <item_version>0</item_version> <item>5</item> </second> </item> <item> <first>tmp_16_reg_111</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>tmp_s_reg_96</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>1</count> <item_version>0</item_version> <item> <first>44</first> <second> <count>1</count> <item_version>0</item_version> <item>5</item> </second> </item> </dp_reg_phi> <dp_regname_phi> <count>1</count> <item_version>0</item_version> <item> <first>ii_reg_44</first> <second> <count>1</count> <item_version>0</item_version> <item>5</item> </second> </item> </dp_regname_phi> <dp_port_io_nodes class_id="58" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="59" tracking_level="0" version="0"> <first>data_V(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>load</first> <second> <count>2</count> <item_version>0</item_version> <item>13</item> <item>13</item> </second> </item> </second> </item> <item> <first>res_V(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="60" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="61" tracking_level="0" version="0"> <first>1</first> <second>RAM</second> </item> <item> <first>2</first> <second>RAM</second> </item> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
with Interfaces.C.Strings, System; use type Interfaces.C.Strings.chars_ptr, System.Address; package body FLTK.Widgets.Inputs.Float is procedure float_input_set_draw_hook (W, D : in System.Address); pragma Import (C, float_input_set_draw_hook, "float_input_set_draw_hook"); pragma Inline (float_input_set_draw_hook); procedure float_input_set_handle_hook (W, H : in System.Address); pragma Import (C, float_input_set_handle_hook, "float_input_set_handle_hook"); pragma Inline (float_input_set_handle_hook); function new_fl_float_input (X, Y, W, H : in Interfaces.C.int; Text : in Interfaces.C.char_array) return System.Address; pragma Import (C, new_fl_float_input, "new_fl_float_input"); pragma Inline (new_fl_float_input); procedure free_fl_float_input (F : in System.Address); pragma Import (C, free_fl_float_input, "free_fl_float_input"); pragma Inline (free_fl_float_input); procedure fl_float_input_draw (W : in System.Address); pragma Import (C, fl_float_input_draw, "fl_float_input_draw"); pragma Inline (fl_float_input_draw); function fl_float_input_handle (W : in System.Address; E : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_float_input_handle, "fl_float_input_handle"); pragma Inline (fl_float_input_handle); procedure Finalize (This : in out Float_Input) is begin if This.Void_Ptr /= System.Null_Address and then This in Float_Input'Class then free_fl_float_input (This.Void_Ptr); This.Void_Ptr := System.Null_Address; end if; Finalize (Input (This)); end Finalize; package body Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Float_Input is begin return This : Float_Input do This.Void_Ptr := new_fl_float_input (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)); float_input_set_draw_hook (This.Void_Ptr, Draw_Hook'Address); float_input_set_handle_hook (This.Void_Ptr, Handle_Hook'Address); end return; end Create; end Forge; function Get_Value (This : in Float_Input) return Standard.Float is Ptr : Interfaces.C.Strings.chars_ptr := fl_input_get_value (This.Void_Ptr); begin if Ptr = Interfaces.C.Strings.Null_Ptr then return 0.0; else return Standard.Float'Value (Interfaces.C.Strings.Value (Ptr)); end if; end Get_Value; procedure Draw (This : in out Float_Input) is begin fl_float_input_draw (This.Void_Ptr); end Draw; function Handle (This : in out Float_Input; Event : in Event_Kind) return Event_Outcome is begin return Event_Outcome'Val (fl_float_input_handle (This.Void_Ptr, Event_Kind'Pos (Event))); end Handle; end FLTK.Widgets.Inputs.Float;
-- -- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- 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 system; package soc.dwt with spark_mode => on is pragma assertion_policy (pre => IGNORE, post => IGNORE, assert => IGNORE); ----------------------------------------------------- -- SPARK ghost functions and procedures ----------------------------------------------------- function init_is_done return boolean; function check_32bits_overflow return boolean with ghost; -------------------------------------------------- -- The Data Watchpoint and Trace unit (DWT) -- -- (Cf. ARMv7-M Arch. Ref. Manual, C1.8, p.779) -- -------------------------------------------------- -- Reset the DWT-based timer procedure reset_timer with pre => not init_is_done; -- Start the DWT timer. The register is counting the number of CPU cycles procedure start_timer with pre => not init_is_done; -- Stop the DWT timer procedure stop_timer with pre => init_is_done; -- Periodically check the DWT CYCCNT register for overflow. This permit -- to detect each time an overflow happends and increment the -- overflow counter to keep a valid 64 bit time value -- precondition check that the package has been initialized and that -- dwt_loop doesn't overflow procedure ovf_manage with --pre => check_32bits_overflow, inline_always; -- Initialize the DWT module procedure init with pre => not init_is_done; -- Get the DWT timer (without overflow support, keep a 32bit value) procedure get_cycles_32(cycles : out unsigned_32) with inline, pre => init_is_done; -- Get the DWT timer with overflow support. permits linear measurement -- on 64 bits cycles time window (approx. 1270857 days) procedure get_cycles (cycles : out unsigned_64) with pre => init_is_done; procedure get_microseconds (micros : out unsigned_64) with inline, pre => init_is_done; procedure get_milliseconds (milli : out unsigned_64) with inline, pre => init_is_done; private -- -- Control register -- type t_DWT_CTRL is record CYCCNTENA : boolean; -- Enables CYCCNT POSTPRESET : bits_4; POSTINIT : bits_4; CYCTAP : bit; SYNCTAP : bits_2; PCSAMPLENA : bit; reserved_13_15 : bits_3; EXCTRCENA : bit; CPIEVTENA : bit; EXCEVTENA : bit; SLEEPEVTENA : bit; LSUEVTENA : bit; FOLDEVTENA : bit; CYCEVTENA : bit; reserved_23 : bit; NOPRFCNT : bit; NOCYCCNT : bit; NOEXTTRIG : bit; NOTRCPKT : bit; NUMCOMP : bits_4; end record with size => 32; for t_DWT_CTRL use record CYCCNTENA at 0 range 0 .. 0; POSTPRESET at 0 range 1 .. 4; POSTINIT at 0 range 5 .. 8; CYCTAP at 0 range 9 .. 9; SYNCTAP at 0 range 10 .. 11; PCSAMPLENA at 0 range 12 .. 12; reserved_13_15 at 0 range 13 .. 15; EXCTRCENA at 0 range 16 .. 16; CPIEVTENA at 0 range 17 .. 17; EXCEVTENA at 0 range 18 .. 18; SLEEPEVTENA at 0 range 19 .. 19; LSUEVTENA at 0 range 20 .. 20; FOLDEVTENA at 0 range 21 .. 21; CYCEVTENA at 0 range 22 .. 22; reserved_23 at 0 range 23 .. 23; NOPRFCNT at 0 range 24 .. 24; NOCYCCNT at 0 range 25 .. 25; NOEXTTRIG at 0 range 26 .. 26; NOTRCPKT at 0 range 27 .. 27; NUMCOMP at 0 range 28 .. 31; end record; DWT_CONTROL : t_DWT_CTRL with import, volatile, address => system'to_address (16#E000_1000#); -- -- CYCCNT register -- subtype t_DWT_CYCCNT is unsigned_32; DWT_CYCCNT : t_DWT_CYCCNT with import, volatile, address => system'to_address (16#E000_1004#); -- Specify the package state. Set to true by init(). init_done : boolean := false; -- -- DWT CYCCNT register overflow counting -- This permit to support incremental getcycle -- with a time window of 64bits length (instead of 32bits) -- dwt_loops : unsigned_64; -- -- Last measured DWT CYCCNT. Compared with current measurement, -- we can detect if the register has generated an overflow or not -- last_dwt : unsigned_32; -------------------------------------------------- -- CoreSight Software Lock registers -- -- Ref.: -- -- - ARMv7-M Arch. Ref. Manual, D1.1, p.826) -- -- - CoreSight Arch. Spec. B2.5.9, p.48 -- -------------------------------------------------- -- -- Lock Access Register (LAR) -- LAR : unsigned_32 with import, volatile, address => system'to_address (16#E000_1FB0#); LAR_ENABLE_WRITE_KEY : constant := 16#C5AC_CE55#; --------------------------------------------------------- -- Debug Exception and Monitor Control Register, DEMCR -- -- (Cf. ARMv7-M Arch. Ref. Manual, C1.6.5, p.765) -- --------------------------------------------------------- type t_DEMCR is record VC_CORERESET : boolean; -- Reset Vector Catch enabled reserved_1_3 : bits_3; VC_MMERR : boolean; -- Debug trap on a MemManage exception VC_NOCPERR : boolean; -- Debug trap on a UsageFault exception caused by an access to a -- Coprocessor VC_CHKERR : boolean; -- Debug trap on a UsageFault exception caused by a checking error VC_STATERR : boolean; -- Debug trap on a UsageFault exception caused by a state information -- error VC_BUSERR : boolean; -- Debug trap on a BusFault exception VC_INTERR : boolean; -- Debug trap on a fault occurring during exception entry or exception -- return VC_HARDERR : boolean; -- Debug trap on a HardFault exception reserved_11_15 : bits_5; MON_EN : boolean; -- DebugMonitor exception enabled MON_PEND : boolean; -- Sets or clears the pending state of the -- DebugMonitor exception MON_STEP : boolean; -- Step the processor MON_REQ : boolean; -- DebugMonitor semaphore bit reserved_20_23 : bits_4; TRCENA : boolean; -- DWT and ITM units enabled end record with size => 32; for t_DEMCR use record VC_CORERESET at 0 range 0 .. 0; reserved_1_3 at 0 range 1 .. 3; VC_MMERR at 0 range 4 .. 4; VC_NOCPERR at 0 range 5 .. 5; VC_CHKERR at 0 range 6 .. 6; VC_STATERR at 0 range 7 .. 7; VC_BUSERR at 0 range 8 .. 8; VC_INTERR at 0 range 9 .. 9; VC_HARDERR at 0 range 10 .. 10; reserved_11_15 at 0 range 11 .. 15; MON_EN at 0 range 16 .. 16; MON_PEND at 0 range 17 .. 17; MON_STEP at 0 range 18 .. 18; MON_REQ at 0 range 19 .. 19; reserved_20_23 at 0 range 20 .. 23; TRCENA at 0 range 24 .. 24; end record; DEMCR : t_DEMCR with import, volatile, address => system'to_address (16#E000_EDFC#); end soc.dwt;
with Ada.Text_IO; package body Problem_66 is package IO renames Ada.Text_IO; procedure Solve is begin IO.Put_Line("The Answer"); end Solve; end Problem_66;
------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ -- Purpose: -- Process AST to fix simplified parsing. -- Populate AST with easy calculable attributes. package Asis.Gela.Normalizer is procedure Run (Unit : Asis.Compilation_Unit); procedure Normalize_Pragma (Element : Asis.Pragma_Element; Unit : Asis.Compilation_Unit); private type State_Information is record Parent : Asis.Element; Unit : Asis.Compilation_Unit; end record; end Asis.Gela.Normalizer; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, Maxim Reznik -- 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 Maxim Reznik, 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 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. ------------------------------------------------------------------------------
with Ada.Text_Io; use Ada.Text_Io; procedure Sierpinski_Carpet is subtype Index_Type is Integer range 1..81; type Pattern_Array is array(Index_Type range <>, Index_Type range <>) of Boolean; Pattern : Pattern_Array(1..81,1..81) := (Others =>(others => true)); procedure Clear_Center(P : in out Pattern_Array; X1 : Index_Type; X2 : Index_Type; Y1 : Index_Type; Y2 : Index_Type) is Xfirst : Index_Type; Xlast : Index_Type; Yfirst : Index_Type; Ylast : Index_Type; Diff : Integer; begin Xfirst :=(X2 - X1 + 1) / 3 + X1; Diff := Xfirst - X1; Xlast := Xfirst + Diff; Yfirst := (Y2 - Y1) / 3 + Y1; YLast := YFirst + Diff; for I in XFirst..XLast loop for J in YFirst..YLast loop P(I, J) := False; end loop; end loop; end Clear_Center; procedure Print(P : Pattern_Array) is begin for I in P'range(1) loop for J in P'range(2) loop if P(I,J) then Put('*'); else Put(' '); end if; end loop; New_Line; end loop; end Print; procedure Divide_Square(P : in out Pattern_Array; Order : Positive) is Factor : Natural := 0; X1, X2 : Index_Type; Y1, Y2 : Index_Type; Division : Index_Type; Num_Sections : Index_Type; begin while Factor < Order loop Num_Sections := 3**Factor; Factor := Factor + 1; X1 := P'First; Division := P'Last / Num_Sections; X2 := Division; Y1 := X1; Y2 := X2; loop loop Clear_Center(P, X1, X2, Y1, Y2); exit when X2 = P'Last; X1 := X2; X2 := X2 + Division; end loop; exit when Y2 = P'Last; Y1 := Y2; Y2 := Y2 + Division; X1 := P'First; X2 := Division; end loop; end loop; end Divide_Square; begin Divide_Square(Pattern, 3); Print(Pattern); end Sierpinski_Carpet;
-- Copyright 2006-2014 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 Watch is procedure Foo (X : in out Integer) is begin -- Reference X in a way that does not change its value. Do_Nothing (X'Address); -- BREAK1 end Foo; X : Integer := 1; begin Foo (X); X := 2; -- BREAK2 end Watch;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- A D A . C A L E N D A R . D E L A Y S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-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. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This package implements Calendar.Time delays using protected objects -- Note: the compiler generates direct calls to this interface, in the -- processing of time types. package Ada.Calendar.Delays is procedure Delay_For (D : Duration); -- Delay until an interval of length (at least) D seconds has passed, or -- the task is aborted to at least the current ATC nesting level. This is -- an abort completion point. The body of this procedure must perform all -- the processing required for an abort point. procedure Delay_Until (T : Time); -- Delay until Clock has reached (at least) time T, or the task is aborted -- to at least the current ATC nesting level. The body of this procedure -- must perform all the processing required for an abort point. function To_Duration (T : Time) return Duration; -- Convert Time to Duration end Ada.Calendar.Delays;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.RED_BLACK_TREES.GENERIC_KEYS -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-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/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -- Tree_Type is used to implement ordered containers. This package declares -- the tree operations that depend on keys. with Ada.Containers.Red_Black_Trees.Generic_Operations; generic with package Tree_Operations is new Generic_Operations (<>); use Tree_Operations.Tree_Types, Tree_Operations.Tree_Types.Implementation; type Key_Type (<>) is limited private; with function Is_Less_Key_Node (L : Key_Type; R : Node_Access) return Boolean; with function Is_Greater_Key_Node (L : Key_Type; R : Node_Access) return Boolean; package Ada.Containers.Red_Black_Trees.Generic_Keys is pragma Pure; generic with function New_Node return Node_Access; procedure Generic_Insert_Post (Tree : in out Tree_Type; Y : Node_Access; Before : Boolean; Z : out Node_Access); -- Completes an insertion after the insertion position has been -- determined. On output Z contains a pointer to the newly inserted -- node, allocated using New_Node. If Tree is busy then -- Program_Error is raised. If Y is null, then Tree must be empty. -- Otherwise Y denotes the insertion position, and Before specifies -- whether the new node is Y's left (True) or right (False) child. generic with procedure Insert_Post (T : in out Tree_Type; Y : Node_Access; B : Boolean; Z : out Node_Access); procedure Generic_Conditional_Insert (Tree : in out Tree_Type; Key : Key_Type; Node : out Node_Access; Inserted : out Boolean); -- Inserts a new node in Tree, but only if the tree does not already -- contain Key. Generic_Conditional_Insert first searches for a key -- equivalent to Key in Tree. If an equivalent key is found, then on -- output Node designates the node with that key and Inserted is -- False; there is no allocation and Tree is not modified. Otherwise -- Node designates a new node allocated using Insert_Post, and -- Inserted is True. generic with procedure Insert_Post (T : in out Tree_Type; Y : Node_Access; B : Boolean; Z : out Node_Access); procedure Generic_Unconditional_Insert (Tree : in out Tree_Type; Key : Key_Type; Node : out Node_Access); -- Inserts a new node in Tree. On output Node designates the new -- node, which is allocated using Insert_Post. The node is inserted -- immediately after already-existing equivalent keys. generic with procedure Insert_Post (T : in out Tree_Type; Y : Node_Access; B : Boolean; Z : out Node_Access); with procedure Unconditional_Insert_Sans_Hint (Tree : in out Tree_Type; Key : Key_Type; Node : out Node_Access); procedure Generic_Unconditional_Insert_With_Hint (Tree : in out Tree_Type; Hint : Node_Access; Key : Key_Type; Node : out Node_Access); -- Inserts a new node in Tree near position Hint, to avoid having to -- search from the root for the insertion position. If Hint is null -- then Generic_Unconditional_Insert_With_Hint attempts to insert -- the new node after Tree.Last. If Hint is non-null then if Key is -- less than Hint, it attempts to insert the new node immediately -- prior to Hint. Otherwise it attempts to insert the node -- immediately following Hint. We say "attempts" above to emphasize -- that insertions always preserve invariants with respect to key -- order, even when there's a hint. So if Key can't be inserted -- immediately near Hint, then the new node is inserted in the -- normal way, by searching for the correct position starting from -- the root. generic with procedure Insert_Post (T : in out Tree_Type; Y : Node_Access; B : Boolean; Z : out Node_Access); with procedure Conditional_Insert_Sans_Hint (Tree : in out Tree_Type; Key : Key_Type; Node : out Node_Access; Inserted : out Boolean); procedure Generic_Conditional_Insert_With_Hint (Tree : in out Tree_Type; Position : Node_Access; -- the hint Key : Key_Type; Node : out Node_Access; Inserted : out Boolean); -- Inserts a new node in Tree if the tree does not already contain -- Key, using Position as a hint about where to insert the new node. -- See Generic_Unconditional_Insert_With_Hint for more details about -- hint semantics. function Find (Tree : Tree_Type; Key : Key_Type) return Node_Access; -- Searches Tree for the smallest node equivalent to Key function Ceiling (Tree : Tree_Type; Key : Key_Type) return Node_Access; -- Searches Tree for the smallest node equal to or greater than Key function Floor (Tree : Tree_Type; Key : Key_Type) return Node_Access; -- Searches Tree for the largest node less than or equal to Key function Upper_Bound (Tree : Tree_Type; Key : Key_Type) return Node_Access; -- Searches Tree for the smallest node greater than Key generic with procedure Process (Node : Node_Access); procedure Generic_Iteration (Tree : Tree_Type; Key : Key_Type); -- Calls Process for each node in Tree equivalent to Key, in order -- from earliest in range to latest. generic with procedure Process (Node : Node_Access); procedure Generic_Reverse_Iteration (Tree : Tree_Type; Key : Key_Type); -- Calls Process for each node in Tree equivalent to Key, but in -- order from largest in range to earliest. end Ada.Containers.Red_Black_Trees.Generic_Keys;
----------------------------------------------------------------------- -- applications -- Ada Web Application -- Copyright (C) 2009, 2010, 2011, 2012, 2017, 2018 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.Basic; with Util.Locales; with EL.Objects; with EL.Contexts; with EL.Functions; with EL.Functions.Default; with EL.Expressions; with EL.Variables.Default; with Ada.Strings.Unbounded; with ASF.Locales; with ASF.Factory; with ASF.Converters; with ASF.Validators; with ASF.Contexts.Faces; with ASF.Contexts.Exceptions; with ASF.Lifecycles; with ASF.Applications.Views; with ASF.Navigations; with ASF.Beans; with ASF.Requests; with ASF.Responses; with ASF.Servlets; with ASF.Events.Faces.Actions; with Security.Policies; use Security; with Security.OAuth.Servers; package ASF.Applications.Main is use ASF.Beans; -- ------------------------------ -- Factory for creation of lifecycle, view handler -- ------------------------------ type Application_Factory is tagged limited private; -- Create the lifecycle handler. The lifecycle handler is created during -- the initialization phase of the application. The default implementation -- creates an <b>ASF.Lifecycles.Default.Default_Lifecycle</b> object. -- It can be overriden to change the behavior of the ASF request lifecycle. function Create_Lifecycle_Handler (App : in Application_Factory) return ASF.Lifecycles.Lifecycle_Access; -- Create the view handler. The view handler is created during -- the initialization phase of the application. The default implementation -- creates an <b>ASF.Applications.Views.View_Handler</b> object. -- It can be overriden to change the views associated with the application. function Create_View_Handler (App : in Application_Factory) return ASF.Applications.Views.View_Handler_Access; -- Create the navigation handler. The navigation handler is created during -- the initialization phase of the application. The default implementation -- creates an <b>ASF.Navigations.Navigation_Handler</b> object. -- It can be overriden to change the navigations associated with the application. function Create_Navigation_Handler (App : in Application_Factory) return ASF.Navigations.Navigation_Handler_Access; -- Create the security policy manager. The security policy manager is created during -- the initialization phase of the application. The default implementation -- creates a <b>Security.Policies.Policy_Manager</b> object. function Create_Security_Manager (App : in Application_Factory) return Security.Policies.Policy_Manager_Access; -- Create the OAuth application manager. The OAuth application manager is created -- during the initialization phase of the application. The default implementation -- creates a <b>Security.OAuth.Servers.Auth_Manager</b> object. function Create_OAuth_Manager (App : in Application_Factory) return Security.OAuth.Servers.Auth_Manager_Access; -- Create the exception handler. The exception handler is created during -- the initialization phase of the application. The default implementation -- creates a <b>ASF.Contexts.Exceptions.Exception_Handler</b> object. function Create_Exception_Handler (App : in Application_Factory) return ASF.Contexts.Exceptions.Exception_Handler_Access; -- ------------------------------ -- Application -- ------------------------------ type Application is new ASF.Servlets.Servlet_Registry and ASF.Events.Faces.Actions.Action_Listener with private; type Application_Access is access all Application'Class; -- Get the application view handler. function Get_View_Handler (App : access Application) return access Views.View_Handler'Class; -- Get the lifecycle handler. function Get_Lifecycle_Handler (App : in Application) return ASF.Lifecycles.Lifecycle_Access; -- Get the navigation handler. function Get_Navigation_Handler (App : in Application) return ASF.Navigations.Navigation_Handler_Access; -- Get the permission manager associated with this application. function Get_Security_Manager (App : in Application) return Security.Policies.Policy_Manager_Access; -- Get the OAuth application manager associated with this application. function Get_OAuth_Manager (App : in Application) return Security.OAuth.Servers.Auth_Manager_Access; -- Get the action event listener responsible for processing action -- events and triggering the navigation to the next view using the -- navigation handler. function Get_Action_Listener (App : in Application) return ASF.Events.Faces.Actions.Action_Listener_Access; -- Get the exception handler configured for this application. function Get_Exception_Handler (App : in Application) return ASF.Contexts.Exceptions.Exception_Handler_Access; -- Process the action associated with the action event. The action returns -- and outcome which is then passed to the navigation handler to navigate to -- the next view. overriding procedure Process_Action (Listener : in Application; Event : in ASF.Events.Faces.Actions.Action_Event'Class; Context : in out Contexts.Faces.Faces_Context'Class); -- Execute the action method. The action returns and outcome which is then passed -- to the navigation handler to navigate to the next view. procedure Process_Action (Listener : in Application; Method : in EL.Expressions.Method_Info; Context : in out Contexts.Faces.Faces_Context'Class); -- Initialize the application procedure Initialize (App : in out Application; Conf : in Config; Factory : in out Application_Factory'Class); -- Initialize the ASF components provided by the application. -- This procedure is called by <b>Initialize</b>. -- It should register the component factories used by the application. procedure Initialize_Components (App : in out Application); -- Initialize the application configuration properties. Properties defined in <b>Conf</b> -- are expanded by using the EL expression resolver. procedure Initialize_Config (App : in out Application; Conf : in out Config); -- Initialize the servlets provided by the application. -- This procedure is called by <b>Initialize</b>. -- It should register the application servlets. procedure Initialize_Servlets (App : in out Application); -- Initialize the filters provided by the application. -- This procedure is called by <b>Initialize</b>. -- It should register the application filters. procedure Initialize_Filters (App : in out Application); -- Finalizes the application, freeing the memory. overriding procedure Finalize (App : in out Application); -- Get the configuration parameter; function Get_Config (App : Application; Param : Config_Param) return String; -- Set a global variable in the global EL contexts. procedure Set_Global (App : in out Application; Name : in String; Value : in String); procedure Set_Global (App : in out Application; Name : in String; Value : in EL.Objects.Object); -- Resolve a global variable and return its value. -- Raises the <b>EL.Functions.No_Variable</b> exception if the variable does not exist. function Get_Global (App : in Application; Name : in Ada.Strings.Unbounded.Unbounded_String; Context : in EL.Contexts.ELContext'Class) return EL.Objects.Object; -- Get the list of supported locales for this application. function Get_Supported_Locales (App : in Application) return Util.Locales.Locale_Array; -- Add the locale to the list of supported locales. procedure Add_Supported_Locale (App : in out Application; Locale : in Util.Locales.Locale); -- Get the default locale defined by the application. function Get_Default_Locale (App : in Application) return Util.Locales.Locale; -- Set the default locale defined by the application. procedure Set_Default_Locale (App : in out Application; Locale : in Util.Locales.Locale); -- Compute the locale that must be used according to the <b>Accept-Language</b> request -- header and the application supported locales. function Calculate_Locale (Handler : in Application; Context : in ASF.Contexts.Faces.Faces_Context'Class) return Util.Locales.Locale; -- Register a bundle and bind it to a facelet variable. procedure Register (App : in out Application; Name : in String; Bundle : in String); -- 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 (App : in out Application; Name : in String; Class : in String; Params : in Parameter_Bean_Ref.Ref; Scope : in Scope_Type := REQUEST_SCOPE); -- Register under the name identified by <b>Name</b> the class instance <b>Class</b>. procedure Register_Class (App : in out Application; Name : in String; Class : in ASF.Beans.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 (App : in out Application; Name : in String; Handler : in ASF.Beans.Create_Bean_Access); -- Create a bean by using the create operation registered for the name procedure Create (App : in Application; 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); -- Add a converter in the application. The converter is referenced by -- the specified name in the XHTML files. procedure Add_Converter (App : in out Application; Name : in String; Converter : in ASF.Converters.Converter_Access); -- Register a binding library in the factory. procedure Add_Components (App : in out Application; Bindings : in ASF.Factory.Factory_Bindings_Access); -- Closes the application procedure Close (App : in out Application); -- Set the current faces context before processing a view. procedure Set_Context (App : in out Application; Context : in ASF.Contexts.Faces.Faces_Context_Access); -- Execute the lifecycle phases on the faces context. procedure Execute_Lifecycle (App : in Application; Context : in out ASF.Contexts.Faces.Faces_Context'Class); -- Dispatch the request received on a page. procedure Dispatch (App : in out Application; Page : in String; Request : in out ASF.Requests.Request'Class; Response : in out ASF.Responses.Response'Class); -- Dispatch a bean action request. -- 1. Find the bean object identified by <b>Name</b>, create it if necessary. -- 2. Resolve the bean method identified by <b>Operation</b>. -- 3. If the method is an action method (see ASF.Events.Actions), call that method. -- 4. Using the outcome action result, decide using the navigation handler what -- is the result view. -- 5. Render the result view resolved by the navigation handler. procedure Dispatch (App : in out Application; Name : in String; Operation : in String; Request : in out ASF.Requests.Request'Class; Response : in out ASF.Responses.Response'Class; Prepare : access procedure (Bean : access Util.Beans.Basic.Bean'Class)); -- Find the converter instance that was registered under the given name. -- Returns null if no such converter exist. function Find (App : in Application; Name : in EL.Objects.Object) return ASF.Converters.Converter_Access; -- Find the validator instance that was registered under the given name. -- Returns null if no such validator exist. function Find_Validator (App : in Application; Name : in EL.Objects.Object) return ASF.Validators.Validator_Access; -- Register some functions generic with procedure Set_Functions (Mapper : in out EL.Functions.Function_Mapper'Class); procedure Register_Functions (App : in out Application'Class); -- Register some bean definitions. generic with procedure Set_Beans (Factory : in out ASF.Beans.Bean_Factory); procedure Register_Beans (App : in out Application'Class); -- Load the resource bundle identified by the <b>Name</b> and for the given -- <b>Locale</b>. procedure Load_Bundle (App : in out Application; Name : in String; Locale : in String; Bundle : out ASF.Locales.Bundle); private type Application_Factory is tagged limited null record; type Application is new ASF.Servlets.Servlet_Registry and ASF.Events.Faces.Actions.Action_Listener with record View : aliased ASF.Applications.Views.View_Handler; Lifecycle : ASF.Lifecycles.Lifecycle_Access; Factory : aliased ASF.Beans.Bean_Factory; Locales : ASF.Locales.Factory; Globals : aliased EL.Variables.Default.Default_Variable_Mapper; Functions : aliased EL.Functions.Default.Default_Function_Mapper; -- The component factory Components : aliased ASF.Factory.Component_Factory; -- The action listener. Action_Listener : ASF.Events.Faces.Actions.Action_Listener_Access; -- The navigation handler. Navigation : ASF.Navigations.Navigation_Handler_Access; -- The permission manager. Permissions : Security.Policies.Policy_Manager_Access; -- The OAuth application manager. OAuth : Security.OAuth.Servers.Auth_Manager_Access; -- Exception handler Exceptions : ASF.Contexts.Exceptions.Exception_Handler_Access; end record; end ASF.Applications.Main;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . S T R I N G _ O P S _ C O N C A T _ 5 -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2000, 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, 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. -- -- -- -- 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 function for concatenating five strings package System.String_Ops_Concat_5 is pragma Pure (String_Ops_Concat_5); function Str_Concat_5 (S1, S2, S3, S4, S5 : String) return String; -- Concatenate two strings and return resulting string end System.String_Ops_Concat_5;
-- Copyright 2007-2016 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/>. procedure Foo is begin begin raise Constraint_Error; -- SPOT1 exception when others => null; end; begin raise Program_Error; -- SPOT2 exception when others => null; end; begin pragma Assert (False); -- SPOT3 null; exception when others => null; end; raise Constraint_Error; -- SPOT4 end Foo;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . E X C E P T I O N _ T A B L E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1996-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 implements the interface used to maintain a table of -- registered exception names, for the implementation of the mapping -- of names to exceptions (used for exception streams and attributes) pragma Compiler_Unit_Warning; with System.Standard_Library; package System.Exception_Table is pragma Elaborate_Body; package SSL renames System.Standard_Library; procedure Register_Exception (X : SSL.Exception_Data_Ptr); pragma Inline (Register_Exception); -- Register an exception in the hash table mapping. This function is -- called during elaboration of library packages. For exceptions that -- are declared within subprograms, the registration occurs the first -- time that an exception is elaborated during a call of the subprogram. -- -- Note: all calls to Register_Exception other than those to register the -- predefined exceptions are suppressed if the application is compiled -- with pragma Restrictions (No_Exception_Registration). function Internal_Exception (X : String; Create_If_Not_Exist : Boolean := True) return SSL.Exception_Data_Ptr; -- Given an exception_name X, returns a pointer to the actual internal -- exception data. A new entry is created in the table if X does not -- exist yet and Create_If_Not_Exist is True. If it is false and X -- does not exist yet, null is returned. function Registered_Exceptions_Count return Natural; -- Return the number of currently registered exceptions type Exception_Data_Array is array (Natural range <>) of SSL.Exception_Data_Ptr; procedure Get_Registered_Exceptions (List : out Exception_Data_Array; Last : out Integer); -- Return the list of registered exceptions end System.Exception_Table;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- A D A . I N T E R R U P T S . N A M E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1991-2015, 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 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/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the DragonFly BSD THREADS version of this package with System.OS_Interface; package Ada.Interrupts.Names is -- All identifiers in this unit are implementation defined pragma Implementation_Defined; -- Beware that the mapping of names to signals may be many-to-one. There -- may be aliases. Also, for all signal names that are not supported on -- the current system the value of the corresponding constant will be zero. SIGHUP : constant Interrupt_ID := System.OS_Interface.SIGHUP; -- hangup SIGINT : constant Interrupt_ID := System.OS_Interface.SIGINT; -- interrupt (rubout) SIGQUIT : constant Interrupt_ID := System.OS_Interface.SIGQUIT; -- quit (ASCD FS) SIGILL : constant Interrupt_ID := System.OS_Interface.SIGILL; -- illegal instruction (not reset) SIGTRAP : constant Interrupt_ID := System.OS_Interface.SIGTRAP; -- trace trap (not reset) SIGIOT : constant Interrupt_ID := System.OS_Interface.SIGIOT; -- IOT instruction SIGABRT : constant Interrupt_ID := -- used by abort, System.OS_Interface.SIGABRT; -- replace SIGIOT in the future SIGFPE : constant Interrupt_ID := System.OS_Interface.SIGFPE; -- floating point exception SIGKILL : constant Interrupt_ID := System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored) SIGBUS : constant Interrupt_ID := System.OS_Interface.SIGBUS; -- bus error SIGSEGV : constant Interrupt_ID := System.OS_Interface.SIGSEGV; -- segmentation violation SIGPIPE : constant Interrupt_ID := -- write on a pipe with System.OS_Interface.SIGPIPE; -- no one to read it SIGALRM : constant Interrupt_ID := System.OS_Interface.SIGALRM; -- alarm clock SIGTERM : constant Interrupt_ID := System.OS_Interface.SIGTERM; -- software termination signal from kill SIGURG : constant Interrupt_ID := System.OS_Interface.SIGURG; -- urgent condition on IO channel SIGSTOP : constant Interrupt_ID := System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored) SIGTSTP : constant Interrupt_ID := System.OS_Interface.SIGTSTP; -- user stop requested from tty SIGCONT : constant Interrupt_ID := System.OS_Interface.SIGCONT; -- stopped process has been continued SIGCHLD : constant Interrupt_ID := System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD SIGCLD : constant Interrupt_ID := System.OS_Interface.SIGCLD; -- child status change SIGTTIN : constant Interrupt_ID := System.OS_Interface.SIGTTIN; -- background tty read attempted SIGTTOU : constant Interrupt_ID := System.OS_Interface.SIGTTOU; -- background tty write attempted SIGIO : constant Interrupt_ID := -- input/output possible, System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris) SIGXCPU : constant Interrupt_ID := System.OS_Interface.SIGXCPU; -- CPU time limit exceeded SIGXFSZ : constant Interrupt_ID := System.OS_Interface.SIGXFSZ; -- filesize limit exceeded SIGVTALRM : constant Interrupt_ID := System.OS_Interface.SIGVTALRM; -- virtual timer expired SIGPROF : constant Interrupt_ID := System.OS_Interface.SIGPROF; -- profiling timer expired SIGWINCH : constant Interrupt_ID := System.OS_Interface.SIGWINCH; -- window size change SIGUSR1 : constant Interrupt_ID := System.OS_Interface.SIGUSR1; -- user defined signal 1 SIGUSR2 : constant Interrupt_ID := System.OS_Interface.SIGUSR2; -- user defined signal 2 end Ada.Interrupts.Names;
with Ada.Text_IO; use Ada.Text_IO; procedure Overflow is generic type T is Range <>; Name_Of_T: String; procedure Print_Bounds; -- first instantiate this with T, Name -- then call the instantiation procedure Print_Bounds is begin Put_Line(" " & Name_Of_T & " " & T'Image(T'First) & " .." & T'Image(T'Last)); end Print_Bounds; procedure P_Int is new Print_Bounds(Integer, "Integer "); procedure P_Nat is new Print_Bounds(Natural, "Natural "); procedure P_Pos is new Print_Bounds(Positive, "Positive"); procedure P_Long is new Print_Bounds(Long_Integer, "Long "); type Unsigned_Byte is range 0 .. 255; type Signed_Byte is range -128 .. 127; type Unsigned_Word is range 0 .. 2**32-1; type Thousand is range 0 .. 999; type Signed_Double is range - 2**63 .. 2**63-1; type Crazy is range -11 .. -3; procedure P_UB is new Print_Bounds(Unsigned_Byte, "U 8 "); procedure P_SB is new Print_Bounds(Signed_Byte, "S 8 "); procedure P_UW is new Print_Bounds(Unsigned_Word, "U 32 "); procedure P_Th is new Print_Bounds(Thousand, "Thous"); procedure P_SD is new Print_Bounds(Signed_Double, "S 64 "); procedure P_Cr is new Print_Bounds(Crazy, "Crazy"); A: Crazy := Crazy'First; begin Put_Line("Predefined Types:"); P_Int; P_Nat; P_Pos; P_Long; New_Line; Put_Line("Types defined by the user:"); P_UB; P_SB; P_UW; P_Th; P_SD; P_Cr; New_Line; Put_Line("Forcing a variable of type Crazy to overflow:"); loop -- endless loop Put(" " & Crazy'Image(A) & "+1"); A := A + 1; -- line 49 -- this will later raise a CONSTRAINT_ERROR end loop; end Overflow;
with Ada.Numerics.Discrete_Random; with Ada.Text_IO; procedure Guess_Number_Feedback is procedure Guess_Number (Lower_Limit : Integer; Upper_Limit : Integer) is subtype Number is Integer range Lower_Limit .. Upper_Limit; package Number_IO is new Ada.Text_IO.Integer_IO (Number); package Number_RNG is new Ada.Numerics.Discrete_Random (Number); Generator : Number_RNG.Generator; My_Number : Number; Your_Guess : Number; begin Number_RNG.Reset (Generator); My_Number := Number_RNG.Random (Generator); Ada.Text_IO.Put_Line ("Guess my number!"); loop Ada.Text_IO.Put ("Your guess: "); Number_IO.Get (Your_Guess); exit when Your_Guess = My_Number; if Your_Guess > My_Number then Ada.Text_IO.Put_Line ("Wrong, too high!"); else Ada.Text_IO.Put_Line ("Wrong, too low!"); end if; end loop; Ada.Text_IO.Put_Line ("Well guessed!"); end Guess_Number; package Int_IO is new Ada.Text_IO.Integer_IO (Integer); Lower_Limit : Integer; Upper_Limit : Integer; begin loop Ada.Text_IO.Put ("Lower Limit: "); Int_IO.Get (Lower_Limit); Ada.Text_IO.Put ("Upper Limit: "); Int_IO.Get (Upper_Limit); exit when Lower_Limit < Upper_Limit; Ada.Text_IO.Put_Line ("Lower limit must be lower!"); end loop; Guess_Number (Lower_Limit, Upper_Limit); end Guess_Number_Feedback;
------------------------------------------------------------------------------ -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with Interfaces; use Interfaces; package Ethdrv is procedure Eth_Init; -- Initialize ethernet procedure Eth_Rcv_Wait (Maxtime : Unsigned_32 := 16#ffffffff#); -- Wait until a packet is received or until Maxtime is expired procedure Eth_Send_Init; -- Init Packet_Off for sending a frame procedure Eth_Send_Packet; -- Send a frame end Ethdrv;
with MSP430_SVD; use MSP430_SVD; with MSPGD.Board; use MSPGD.Board; with MSPGD.GPIO; use MSPGD.GPIO; with MSPGD.GPIO.Pin; with Drivers.Text_IO; with Drivers.NRF24; procedure Main is pragma Preelaborate; package CE is new MSPGD.GPIO.Pin (Port => 2, Pin => 0, Direction => Output); package IRQ is new MSPGD.GPIO.Pin (Port => 2, Pin => 2); package Text_IO is new Drivers.Text_IO (USART => UART); package Radio is new Drivers.NRF24 (SPI => SPI, Chip_Select => SSEL, Chip_Enable => CE, IRQ => IRQ, Clock => Clock); procedure Print_Registers is new Radio.Print_Registers(Put_Line => Text_IO.Put_Line); Broadcast_Address : constant Radio.Address_Type := (16#00#, 16#F0#, 16#F0#, 16#F0#, 16#F0#); procedure TX_Test is TX_Data : constant Radio.Packet_Type := (16#00#, 16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#55#); Input : String (1 .. 16); Len : Natural; begin Radio.TX_Mode; Radio.TX (TX_Data); Print_Registers; loop Text_IO.Get_Line (Input, Len); Radio.TX (TX_Data); end loop; end TX_Test; begin Init; LED_RED.Init; LED_RED.Clear; SPI.Init; SCLK.Init; MISO.Init; MOSI.Init; SSEL.Init; CE.Init; IRQ.Init; SSEL.Set; Text_IO.Put_Line ("NRF24 sender starting..."); Radio.Init; Radio.Set_Channel (70); Radio.Set_TX_Address (Broadcast_Address); Print_Registers; TX_Test; end Main;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-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 Motor is procedure Initialize; ----------------------- -- Current_Direction -- ----------------------- function Current_Direction return Direction is begin case Current_Counter_Mode (Encoder_Timer) is when Up => return Forward; when Down => return Backward; when others => raise Program_Error; end case; end Current_Direction; ------------------- -- Encoder_Count -- ------------------- function Encoder_Count return UInt32 is begin return Current_Counter (Encoder_Timer); end Encoder_Count; ---------------- -- Initialize -- ---------------- procedure Initialize is begin Enable_Clock (Encoder_Tach0); Enable_Clock (Encoder_Tach1); Enable_Clock (Encoder_Timer); Configure_IO (Encoder_Tach0 & Encoder_Tach1, (Mode => Mode_AF, AF => Encoder_AF, Resistors => Pull_Up, AF_Output_Type => Push_Pull, AF_Speed => Speed_100MHz)); Configure_Encoder_Interface (Encoder_Timer, Mode => Encoder_Mode_TI1_TI2, IC1_Polarity => Rising, IC2_Polarity => Rising); Configure (Encoder_Timer, Prescaler => 0, Period => UInt32 (UInt16'Last), Clock_Divisor => Div1, Counter_Mode => Up); Configure_Channel_Input (Encoder_Timer, Channel => Channel_1, Polarity => Rising, Selection => Direct_TI, Prescaler => Div1, Filter => 0); Configure_Channel_Input (Encoder_Timer, Channel => Channel_2, Polarity => Rising, Selection => Direct_TI, Prescaler => Div1, Filter => 0); Enable_Channel (Encoder_Timer, Channel_1); Enable_Channel (Encoder_Timer, Channel_2); Set_Counter (Encoder_Timer, UInt16'(0)); Enable (Encoder_Timer); end Initialize; begin Initialize; end Motor;
-- Copyright (c) 2020 Raspberry Pi (Trading) Ltd. -- -- SPDX-License-Identifier: BSD-3-Clause -- This spec has been automatically generated from rp2040.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; -- Single-cycle IO block\n -- Provides core-local and inter-core hardware for the two processors, -- with single-cycle access. package RP_SVD.SIO is pragma Preelaborate; --------------- -- Registers -- --------------- subtype GPIO_IN_GPIO_IN_Field is HAL.UInt30; -- Input value for GPIO pins type GPIO_IN_Register is record -- Read-only. Input value for GPIO0...29 GPIO_IN : GPIO_IN_GPIO_IN_Field; -- unspecified Reserved_30_31 : HAL.UInt2; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_IN_Register use record GPIO_IN at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_HI_IN_GPIO_HI_IN_Field is HAL.UInt6; -- Input value for QSPI pins type GPIO_HI_IN_Register is record -- Read-only. Input value on QSPI IO in order 0..5: SCLK, SSn, SD0, SD1, -- SD2, SD3 GPIO_HI_IN : GPIO_HI_IN_GPIO_HI_IN_Field; -- unspecified Reserved_6_31 : HAL.UInt26; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_IN_Register use record GPIO_HI_IN at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; subtype GPIO_OUT_GPIO_OUT_Field is HAL.UInt30; -- GPIO output value type GPIO_OUT_Register is record -- Set output level (1/0 -> high/low) for GPIO0...29.\n Reading back -- gives the last value written, NOT the input value from the pins.\n If -- core 0 and core 1 both write to GPIO_OUT simultaneously (or to a -- SET/CLR/XOR alias),\n the result is as though the write from core 0 -- took place first,\n and the write from core 1 was then applied to -- that intermediate result. GPIO_OUT : GPIO_OUT_GPIO_OUT_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_OUT_Register use record GPIO_OUT at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_OUT_SET_GPIO_OUT_SET_Field is HAL.UInt30; -- GPIO output value set type GPIO_OUT_SET_Register is record -- Perform an atomic bit-set on GPIO_OUT, i.e. `GPIO_OUT |= wdata` GPIO_OUT_SET : GPIO_OUT_SET_GPIO_OUT_SET_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_OUT_SET_Register use record GPIO_OUT_SET at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_OUT_CLR_GPIO_OUT_CLR_Field is HAL.UInt30; -- GPIO output value clear type GPIO_OUT_CLR_Register is record -- Perform an atomic bit-clear on GPIO_OUT, i.e. `GPIO_OUT &= ~wdata` GPIO_OUT_CLR : GPIO_OUT_CLR_GPIO_OUT_CLR_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_OUT_CLR_Register use record GPIO_OUT_CLR at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_OUT_XOR_GPIO_OUT_XOR_Field is HAL.UInt30; -- GPIO output value XOR type GPIO_OUT_XOR_Register is record -- Perform an atomic bitwise XOR on GPIO_OUT, i.e. `GPIO_OUT ^= wdata` GPIO_OUT_XOR : GPIO_OUT_XOR_GPIO_OUT_XOR_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_OUT_XOR_Register use record GPIO_OUT_XOR at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_OE_GPIO_OE_Field is HAL.UInt30; -- GPIO output enable type GPIO_OE_Register is record -- Set output enable (1/0 -> output/input) for GPIO0...29.\n Reading -- back gives the last value written.\n If core 0 and core 1 both write -- to GPIO_OE simultaneously (or to a SET/CLR/XOR alias),\n the result -- is as though the write from core 0 took place first,\n and the write -- from core 1 was then applied to that intermediate result. GPIO_OE : GPIO_OE_GPIO_OE_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_OE_Register use record GPIO_OE at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_OE_SET_GPIO_OE_SET_Field is HAL.UInt30; -- GPIO output enable set type GPIO_OE_SET_Register is record -- Perform an atomic bit-set on GPIO_OE, i.e. `GPIO_OE |= wdata` GPIO_OE_SET : GPIO_OE_SET_GPIO_OE_SET_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_OE_SET_Register use record GPIO_OE_SET at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_OE_CLR_GPIO_OE_CLR_Field is HAL.UInt30; -- GPIO output enable clear type GPIO_OE_CLR_Register is record -- Perform an atomic bit-clear on GPIO_OE, i.e. `GPIO_OE &= ~wdata` GPIO_OE_CLR : GPIO_OE_CLR_GPIO_OE_CLR_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_OE_CLR_Register use record GPIO_OE_CLR at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_OE_XOR_GPIO_OE_XOR_Field is HAL.UInt30; -- GPIO output enable XOR type GPIO_OE_XOR_Register is record -- Perform an atomic bitwise XOR on GPIO_OE, i.e. `GPIO_OE ^= wdata` GPIO_OE_XOR : GPIO_OE_XOR_GPIO_OE_XOR_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_OE_XOR_Register use record GPIO_OE_XOR at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype GPIO_HI_OUT_GPIO_HI_OUT_Field is HAL.UInt6; -- QSPI output value type GPIO_HI_OUT_Register is record -- Set output level (1/0 -> high/low) for QSPI IO0...5.\n Reading back -- gives the last value written, NOT the input value from the pins.\n If -- core 0 and core 1 both write to GPIO_HI_OUT simultaneously (or to a -- SET/CLR/XOR alias),\n the result is as though the write from core 0 -- took place first,\n and the write from core 1 was then applied to -- that intermediate result. GPIO_HI_OUT : GPIO_HI_OUT_GPIO_HI_OUT_Field := 16#0#; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_OUT_Register use record GPIO_HI_OUT at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; subtype GPIO_HI_OUT_SET_GPIO_HI_OUT_SET_Field is HAL.UInt6; -- QSPI output value set type GPIO_HI_OUT_SET_Register is record -- Perform an atomic bit-set on GPIO_HI_OUT, i.e. `GPIO_HI_OUT |= wdata` GPIO_HI_OUT_SET : GPIO_HI_OUT_SET_GPIO_HI_OUT_SET_Field := 16#0#; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_OUT_SET_Register use record GPIO_HI_OUT_SET at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; subtype GPIO_HI_OUT_CLR_GPIO_HI_OUT_CLR_Field is HAL.UInt6; -- QSPI output value clear type GPIO_HI_OUT_CLR_Register is record -- Perform an atomic bit-clear on GPIO_HI_OUT, i.e. `GPIO_HI_OUT &= -- ~wdata` GPIO_HI_OUT_CLR : GPIO_HI_OUT_CLR_GPIO_HI_OUT_CLR_Field := 16#0#; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_OUT_CLR_Register use record GPIO_HI_OUT_CLR at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; subtype GPIO_HI_OUT_XOR_GPIO_HI_OUT_XOR_Field is HAL.UInt6; -- QSPI output value XOR type GPIO_HI_OUT_XOR_Register is record -- Perform an atomic bitwise XOR on GPIO_HI_OUT, i.e. `GPIO_HI_OUT ^= -- wdata` GPIO_HI_OUT_XOR : GPIO_HI_OUT_XOR_GPIO_HI_OUT_XOR_Field := 16#0#; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_OUT_XOR_Register use record GPIO_HI_OUT_XOR at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; subtype GPIO_HI_OE_GPIO_HI_OE_Field is HAL.UInt6; -- QSPI output enable type GPIO_HI_OE_Register is record -- Set output enable (1/0 -> output/input) for QSPI IO0...5.\n Reading -- back gives the last value written.\n If core 0 and core 1 both write -- to GPIO_HI_OE simultaneously (or to a SET/CLR/XOR alias),\n the -- result is as though the write from core 0 took place first,\n and the -- write from core 1 was then applied to that intermediate result. GPIO_HI_OE : GPIO_HI_OE_GPIO_HI_OE_Field := 16#0#; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_OE_Register use record GPIO_HI_OE at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; subtype GPIO_HI_OE_SET_GPIO_HI_OE_SET_Field is HAL.UInt6; -- QSPI output enable set type GPIO_HI_OE_SET_Register is record -- Perform an atomic bit-set on GPIO_HI_OE, i.e. `GPIO_HI_OE |= wdata` GPIO_HI_OE_SET : GPIO_HI_OE_SET_GPIO_HI_OE_SET_Field := 16#0#; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_OE_SET_Register use record GPIO_HI_OE_SET at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; subtype GPIO_HI_OE_CLR_GPIO_HI_OE_CLR_Field is HAL.UInt6; -- QSPI output enable clear type GPIO_HI_OE_CLR_Register is record -- Perform an atomic bit-clear on GPIO_HI_OE, i.e. `GPIO_HI_OE &= -- ~wdata` GPIO_HI_OE_CLR : GPIO_HI_OE_CLR_GPIO_HI_OE_CLR_Field := 16#0#; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_OE_CLR_Register use record GPIO_HI_OE_CLR at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; subtype GPIO_HI_OE_XOR_GPIO_HI_OE_XOR_Field is HAL.UInt6; -- QSPI output enable XOR type GPIO_HI_OE_XOR_Register is record -- Perform an atomic bitwise XOR on GPIO_HI_OE, i.e. `GPIO_HI_OE ^= -- wdata` GPIO_HI_OE_XOR : GPIO_HI_OE_XOR_GPIO_HI_OE_XOR_Field := 16#0#; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for GPIO_HI_OE_XOR_Register use record GPIO_HI_OE_XOR at 0 range 0 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; -- Status register for inter-core FIFOs (mailboxes).\n There is one FIFO in -- the core 0 -> core 1 direction, and one core 1 -> core 0. Both are 32 -- bits wide and 8 words deep.\n Core 0 can see the read side of the 1->0 -- FIFO (RX), and the write side of 0->1 FIFO (TX).\n Core 1 can see the -- read side of the 0->1 FIFO (RX), and the write side of 1->0 FIFO (TX).\n -- The SIO IRQ for each core is the logical OR of the VLD, WOF and ROE -- fields of its FIFO_ST register. type FIFO_ST_Register is record -- Read-only. Value is 1 if this core's RX FIFO is not empty (i.e. if -- FIFO_RD is valid) VLD : Boolean := False; -- Read-only. Value is 1 if this core's TX FIFO is not full (i.e. if -- FIFO_WR is ready for more data) RDY : Boolean := True; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. Sticky flag indicating the TX FIFO was written when -- full. This write was ignored by the FIFO. WOF : Boolean := False; -- Write data bit of one shall clear (set to zero) the corresponding bit -- in the field. Sticky flag indicating the RX FIFO was read when empty. -- This read was ignored by the FIFO. ROE : Boolean := False; -- unspecified Reserved_4_31 : HAL.UInt28 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for FIFO_ST_Register use record VLD at 0 range 0 .. 0; RDY at 0 range 1 .. 1; WOF at 0 range 2 .. 2; ROE at 0 range 3 .. 3; Reserved_4_31 at 0 range 4 .. 31; end record; -- Control and status register for divider. type DIV_CSR_Register is record -- Read-only. Reads as 0 when a calculation is in progress, 1 -- otherwise.\n Writing an operand (xDIVIDEND, xDIVISOR) will -- immediately start a new calculation, no\n matter if one is already in -- progress.\n Writing to a result register will immediately terminate -- any in-progress calculation\n and set the READY and DIRTY flags. READY : Boolean; -- Read-only. Changes to 1 when any register is written, and back to 0 -- when QUOTIENT is read.\n Software can use this flag to make -- save/restore more efficient (skip if not DIRTY).\n If the flag is -- used in this way, it's recommended to either read QUOTIENT only,\n or -- REMAINDER and then QUOTIENT, to prevent data loss on context switch. DIRTY : Boolean; -- unspecified Reserved_2_31 : HAL.UInt30; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DIV_CSR_Register use record READY at 0 range 0 .. 0; DIRTY at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; subtype INTERP0_CTRL_LANE0_SHIFT_Field is HAL.UInt5; subtype INTERP0_CTRL_LANE0_MASK_LSB_Field is HAL.UInt5; subtype INTERP0_CTRL_LANE0_MASK_MSB_Field is HAL.UInt5; subtype INTERP0_CTRL_LANE0_FORCE_MSB_Field is HAL.UInt2; -- INTERP0_CTRL_LANE0_OVERF array type INTERP0_CTRL_LANE0_OVERF_Field_Array is array (0 .. 2) of Boolean with Component_Size => 1, Size => 3; -- Type definition for INTERP0_CTRL_LANE0_OVERF type INTERP0_CTRL_LANE0_OVERF_Field (As_Array : Boolean := False) is record case As_Array is when False => -- OVERF as a value Val : HAL.UInt3; when True => -- OVERF as an array Arr : INTERP0_CTRL_LANE0_OVERF_Field_Array; end case; end record with Unchecked_Union, Size => 3; for INTERP0_CTRL_LANE0_OVERF_Field use record Val at 0 range 0 .. 2; Arr at 0 range 0 .. 2; end record; -- Control register for lane 0 type INTERP0_CTRL_LANE0_Register is record -- Logical right-shift applied to accumulator before masking SHIFT : INTERP0_CTRL_LANE0_SHIFT_Field := 16#0#; -- The least-significant bit allowed to pass by the mask (inclusive) MASK_LSB : INTERP0_CTRL_LANE0_MASK_LSB_Field := 16#0#; -- The most-significant bit allowed to pass by the mask (inclusive)\n -- Setting MSB < LSB may cause chip to turn inside-out MASK_MSB : INTERP0_CTRL_LANE0_MASK_MSB_Field := 16#0#; -- If SIGNED is set, the shifted and masked accumulator value is -- sign-extended to 32 bits\n before adding to BASE0, and LANE0 PEEK/POP -- appear extended to 32 bits when read by processor. SIGNED : Boolean := False; -- If 1, feed the opposite lane's accumulator into this lane's shift + -- mask hardware.\n Takes effect even if ADD_RAW is set (the CROSS_INPUT -- mux is before the shift+mask bypass) CROSS_INPUT : Boolean := False; -- If 1, feed the opposite lane's result into this lane's accumulator on -- POP. CROSS_RESULT : Boolean := False; -- If 1, mask + shift is bypassed for LANE0 result. This does not affect -- FULL result. ADD_RAW : Boolean := False; -- ORed into bits 29:28 of the lane result presented to the processor on -- the bus.\n No effect on the internal 32-bit datapath. Handy for using -- a lane to generate sequence\n of pointers into flash or SRAM. FORCE_MSB : INTERP0_CTRL_LANE0_FORCE_MSB_Field := 16#0#; -- Only present on INTERP0 on each core. If BLEND mode is enabled:\n - -- LANE1 result is a linear interpolation between BASE0 and BASE1, -- controlled\n by the 8 LSBs of lane 1 shift and mask value (a -- fractional number between\n 0 and 255/256ths)\n - LANE0 result does -- not have BASE0 added (yields only the 8 LSBs of lane 1 shift+mask -- value)\n - FULL result does not have lane 1 shift+mask value added -- (BASE2 + lane 0 shift+mask)\n LANE1 SIGNED flag controls whether the -- interpolation is signed or unsigned. BLEND : Boolean := False; -- unspecified Reserved_22_22 : HAL.Bit := 16#0#; -- Read-only. Indicates if any masked-off MSBs in ACCUM0 are set. OVERF : INTERP0_CTRL_LANE0_OVERF_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_26_31 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTERP0_CTRL_LANE0_Register use record SHIFT at 0 range 0 .. 4; MASK_LSB at 0 range 5 .. 9; MASK_MSB at 0 range 10 .. 14; SIGNED at 0 range 15 .. 15; CROSS_INPUT at 0 range 16 .. 16; CROSS_RESULT at 0 range 17 .. 17; ADD_RAW at 0 range 18 .. 18; FORCE_MSB at 0 range 19 .. 20; BLEND at 0 range 21 .. 21; Reserved_22_22 at 0 range 22 .. 22; OVERF at 0 range 23 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype INTERP0_CTRL_LANE1_SHIFT_Field is HAL.UInt5; subtype INTERP0_CTRL_LANE1_MASK_LSB_Field is HAL.UInt5; subtype INTERP0_CTRL_LANE1_MASK_MSB_Field is HAL.UInt5; subtype INTERP0_CTRL_LANE1_FORCE_MSB_Field is HAL.UInt2; -- Control register for lane 1 type INTERP0_CTRL_LANE1_Register is record -- Logical right-shift applied to accumulator before masking SHIFT : INTERP0_CTRL_LANE1_SHIFT_Field := 16#0#; -- The least-significant bit allowed to pass by the mask (inclusive) MASK_LSB : INTERP0_CTRL_LANE1_MASK_LSB_Field := 16#0#; -- The most-significant bit allowed to pass by the mask (inclusive)\n -- Setting MSB < LSB may cause chip to turn inside-out MASK_MSB : INTERP0_CTRL_LANE1_MASK_MSB_Field := 16#0#; -- If SIGNED is set, the shifted and masked accumulator value is -- sign-extended to 32 bits\n before adding to BASE1, and LANE1 PEEK/POP -- appear extended to 32 bits when read by processor. SIGNED : Boolean := False; -- If 1, feed the opposite lane's accumulator into this lane's shift + -- mask hardware.\n Takes effect even if ADD_RAW is set (the CROSS_INPUT -- mux is before the shift+mask bypass) CROSS_INPUT : Boolean := False; -- If 1, feed the opposite lane's result into this lane's accumulator on -- POP. CROSS_RESULT : Boolean := False; -- If 1, mask + shift is bypassed for LANE1 result. This does not affect -- FULL result. ADD_RAW : Boolean := False; -- ORed into bits 29:28 of the lane result presented to the processor on -- the bus.\n No effect on the internal 32-bit datapath. Handy for using -- a lane to generate sequence\n of pointers into flash or SRAM. FORCE_MSB : INTERP0_CTRL_LANE1_FORCE_MSB_Field := 16#0#; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTERP0_CTRL_LANE1_Register use record SHIFT at 0 range 0 .. 4; MASK_LSB at 0 range 5 .. 9; MASK_MSB at 0 range 10 .. 14; SIGNED at 0 range 15 .. 15; CROSS_INPUT at 0 range 16 .. 16; CROSS_RESULT at 0 range 17 .. 17; ADD_RAW at 0 range 18 .. 18; FORCE_MSB at 0 range 19 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; subtype INTERP0_ACCUM0_ADD_INTERP0_ACCUM0_ADD_Field is HAL.UInt24; -- Values written here are atomically added to ACCUM0\n Reading yields lane -- 0's raw shift and mask value (BASE0 not added). type INTERP0_ACCUM0_ADD_Register is record INTERP0_ACCUM0_ADD : INTERP0_ACCUM0_ADD_INTERP0_ACCUM0_ADD_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTERP0_ACCUM0_ADD_Register use record INTERP0_ACCUM0_ADD at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype INTERP0_ACCUM1_ADD_INTERP0_ACCUM1_ADD_Field is HAL.UInt24; -- Values written here are atomically added to ACCUM1\n Reading yields lane -- 1's raw shift and mask value (BASE1 not added). type INTERP0_ACCUM1_ADD_Register is record INTERP0_ACCUM1_ADD : INTERP0_ACCUM1_ADD_INTERP0_ACCUM1_ADD_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTERP0_ACCUM1_ADD_Register use record INTERP0_ACCUM1_ADD at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype INTERP1_CTRL_LANE0_SHIFT_Field is HAL.UInt5; subtype INTERP1_CTRL_LANE0_MASK_LSB_Field is HAL.UInt5; subtype INTERP1_CTRL_LANE0_MASK_MSB_Field is HAL.UInt5; subtype INTERP1_CTRL_LANE0_FORCE_MSB_Field is HAL.UInt2; -- INTERP1_CTRL_LANE0_OVERF array type INTERP1_CTRL_LANE0_OVERF_Field_Array is array (0 .. 2) of Boolean with Component_Size => 1, Size => 3; -- Type definition for INTERP1_CTRL_LANE0_OVERF type INTERP1_CTRL_LANE0_OVERF_Field (As_Array : Boolean := False) is record case As_Array is when False => -- OVERF as a value Val : HAL.UInt3; when True => -- OVERF as an array Arr : INTERP1_CTRL_LANE0_OVERF_Field_Array; end case; end record with Unchecked_Union, Size => 3; for INTERP1_CTRL_LANE0_OVERF_Field use record Val at 0 range 0 .. 2; Arr at 0 range 0 .. 2; end record; -- Control register for lane 0 type INTERP1_CTRL_LANE0_Register is record -- Logical right-shift applied to accumulator before masking SHIFT : INTERP1_CTRL_LANE0_SHIFT_Field := 16#0#; -- The least-significant bit allowed to pass by the mask (inclusive) MASK_LSB : INTERP1_CTRL_LANE0_MASK_LSB_Field := 16#0#; -- The most-significant bit allowed to pass by the mask (inclusive)\n -- Setting MSB < LSB may cause chip to turn inside-out MASK_MSB : INTERP1_CTRL_LANE0_MASK_MSB_Field := 16#0#; -- If SIGNED is set, the shifted and masked accumulator value is -- sign-extended to 32 bits\n before adding to BASE0, and LANE0 PEEK/POP -- appear extended to 32 bits when read by processor. SIGNED : Boolean := False; -- If 1, feed the opposite lane's accumulator into this lane's shift + -- mask hardware.\n Takes effect even if ADD_RAW is set (the CROSS_INPUT -- mux is before the shift+mask bypass) CROSS_INPUT : Boolean := False; -- If 1, feed the opposite lane's result into this lane's accumulator on -- POP. CROSS_RESULT : Boolean := False; -- If 1, mask + shift is bypassed for LANE0 result. This does not affect -- FULL result. ADD_RAW : Boolean := False; -- ORed into bits 29:28 of the lane result presented to the processor on -- the bus.\n No effect on the internal 32-bit datapath. Handy for using -- a lane to generate sequence\n of pointers into flash or SRAM. FORCE_MSB : INTERP1_CTRL_LANE0_FORCE_MSB_Field := 16#0#; -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Only present on INTERP1 on each core. If CLAMP mode is enabled:\n - -- LANE0 result is shifted and masked ACCUM0, clamped by a lower bound -- of\n BASE0 and an upper bound of BASE1.\n - Signedness of these -- comparisons is determined by LANE0_CTRL_SIGNED CLAMP : Boolean := False; -- Read-only. Indicates if any masked-off MSBs in ACCUM0 are set. OVERF : INTERP1_CTRL_LANE0_OVERF_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_26_31 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTERP1_CTRL_LANE0_Register use record SHIFT at 0 range 0 .. 4; MASK_LSB at 0 range 5 .. 9; MASK_MSB at 0 range 10 .. 14; SIGNED at 0 range 15 .. 15; CROSS_INPUT at 0 range 16 .. 16; CROSS_RESULT at 0 range 17 .. 17; ADD_RAW at 0 range 18 .. 18; FORCE_MSB at 0 range 19 .. 20; Reserved_21_21 at 0 range 21 .. 21; CLAMP at 0 range 22 .. 22; OVERF at 0 range 23 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype INTERP1_CTRL_LANE1_SHIFT_Field is HAL.UInt5; subtype INTERP1_CTRL_LANE1_MASK_LSB_Field is HAL.UInt5; subtype INTERP1_CTRL_LANE1_MASK_MSB_Field is HAL.UInt5; subtype INTERP1_CTRL_LANE1_FORCE_MSB_Field is HAL.UInt2; -- Control register for lane 1 type INTERP1_CTRL_LANE1_Register is record -- Logical right-shift applied to accumulator before masking SHIFT : INTERP1_CTRL_LANE1_SHIFT_Field := 16#0#; -- The least-significant bit allowed to pass by the mask (inclusive) MASK_LSB : INTERP1_CTRL_LANE1_MASK_LSB_Field := 16#0#; -- The most-significant bit allowed to pass by the mask (inclusive)\n -- Setting MSB < LSB may cause chip to turn inside-out MASK_MSB : INTERP1_CTRL_LANE1_MASK_MSB_Field := 16#0#; -- If SIGNED is set, the shifted and masked accumulator value is -- sign-extended to 32 bits\n before adding to BASE1, and LANE1 PEEK/POP -- appear extended to 32 bits when read by processor. SIGNED : Boolean := False; -- If 1, feed the opposite lane's accumulator into this lane's shift + -- mask hardware.\n Takes effect even if ADD_RAW is set (the CROSS_INPUT -- mux is before the shift+mask bypass) CROSS_INPUT : Boolean := False; -- If 1, feed the opposite lane's result into this lane's accumulator on -- POP. CROSS_RESULT : Boolean := False; -- If 1, mask + shift is bypassed for LANE1 result. This does not affect -- FULL result. ADD_RAW : Boolean := False; -- ORed into bits 29:28 of the lane result presented to the processor on -- the bus.\n No effect on the internal 32-bit datapath. Handy for using -- a lane to generate sequence\n of pointers into flash or SRAM. FORCE_MSB : INTERP1_CTRL_LANE1_FORCE_MSB_Field := 16#0#; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTERP1_CTRL_LANE1_Register use record SHIFT at 0 range 0 .. 4; MASK_LSB at 0 range 5 .. 9; MASK_MSB at 0 range 10 .. 14; SIGNED at 0 range 15 .. 15; CROSS_INPUT at 0 range 16 .. 16; CROSS_RESULT at 0 range 17 .. 17; ADD_RAW at 0 range 18 .. 18; FORCE_MSB at 0 range 19 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; subtype INTERP1_ACCUM0_ADD_INTERP1_ACCUM0_ADD_Field is HAL.UInt24; -- Values written here are atomically added to ACCUM0\n Reading yields lane -- 0's raw shift and mask value (BASE0 not added). type INTERP1_ACCUM0_ADD_Register is record INTERP1_ACCUM0_ADD : INTERP1_ACCUM0_ADD_INTERP1_ACCUM0_ADD_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTERP1_ACCUM0_ADD_Register use record INTERP1_ACCUM0_ADD at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype INTERP1_ACCUM1_ADD_INTERP1_ACCUM1_ADD_Field is HAL.UInt24; -- Values written here are atomically added to ACCUM1\n Reading yields lane -- 1's raw shift and mask value (BASE1 not added). type INTERP1_ACCUM1_ADD_Register is record INTERP1_ACCUM1_ADD : INTERP1_ACCUM1_ADD_INTERP1_ACCUM1_ADD_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for INTERP1_ACCUM1_ADD_Register use record INTERP1_ACCUM1_ADD at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Single-cycle IO block\n Provides core-local and inter-core hardware for -- the two processors, with single-cycle access. type SIO_Peripheral is record -- Processor core identifier\n Value is 0 when read from processor core -- 0, and 1 when read from processor core 1. CPUID : aliased HAL.UInt32; -- Input value for GPIO pins GPIO_IN : aliased GPIO_IN_Register; -- Input value for QSPI pins GPIO_HI_IN : aliased GPIO_HI_IN_Register; -- GPIO output value GPIO_OUT : aliased GPIO_OUT_Register; -- GPIO output value set GPIO_OUT_SET : aliased GPIO_OUT_SET_Register; -- GPIO output value clear GPIO_OUT_CLR : aliased GPIO_OUT_CLR_Register; -- GPIO output value XOR GPIO_OUT_XOR : aliased GPIO_OUT_XOR_Register; -- GPIO output enable GPIO_OE : aliased GPIO_OE_Register; -- GPIO output enable set GPIO_OE_SET : aliased GPIO_OE_SET_Register; -- GPIO output enable clear GPIO_OE_CLR : aliased GPIO_OE_CLR_Register; -- GPIO output enable XOR GPIO_OE_XOR : aliased GPIO_OE_XOR_Register; -- QSPI output value GPIO_HI_OUT : aliased GPIO_HI_OUT_Register; -- QSPI output value set GPIO_HI_OUT_SET : aliased GPIO_HI_OUT_SET_Register; -- QSPI output value clear GPIO_HI_OUT_CLR : aliased GPIO_HI_OUT_CLR_Register; -- QSPI output value XOR GPIO_HI_OUT_XOR : aliased GPIO_HI_OUT_XOR_Register; -- QSPI output enable GPIO_HI_OE : aliased GPIO_HI_OE_Register; -- QSPI output enable set GPIO_HI_OE_SET : aliased GPIO_HI_OE_SET_Register; -- QSPI output enable clear GPIO_HI_OE_CLR : aliased GPIO_HI_OE_CLR_Register; -- QSPI output enable XOR GPIO_HI_OE_XOR : aliased GPIO_HI_OE_XOR_Register; -- Status register for inter-core FIFOs (mailboxes).\n There is one FIFO -- in the core 0 -> core 1 direction, and one core 1 -> core 0. Both are -- 32 bits wide and 8 words deep.\n Core 0 can see the read side of the -- 1->0 FIFO (RX), and the write side of 0->1 FIFO (TX).\n Core 1 can -- see the read side of the 0->1 FIFO (RX), and the write side of 1->0 -- FIFO (TX).\n The SIO IRQ for each core is the logical OR of the VLD, -- WOF and ROE fields of its FIFO_ST register. FIFO_ST : aliased FIFO_ST_Register; -- Write access to this core's TX FIFO FIFO_WR : aliased HAL.UInt32; -- Read access to this core's RX FIFO FIFO_RD : aliased HAL.UInt32; -- Spinlock state\n A bitmap containing the state of all 32 spinlocks -- (1=locked).\n Mainly intended for debugging. SPINLOCK_ST : aliased HAL.UInt32; -- Divider unsigned dividend\n Write to the DIVIDEND operand of the -- divider, i.e. the p in `p / q`.\n Any operand write starts a new -- calculation. The results appear in QUOTIENT, REMAINDER.\n -- UDIVIDEND/SDIVIDEND are aliases of the same internal register. The U -- alias starts an\n unsigned calculation, and the S alias starts a -- signed calculation. DIV_UDIVIDEND : aliased HAL.UInt32; -- Divider unsigned divisor\n Write to the DIVISOR operand of the -- divider, i.e. the q in `p / q`.\n Any operand write starts a new -- calculation. The results appear in QUOTIENT, REMAINDER.\n -- UDIVIDEND/SDIVIDEND are aliases of the same internal register. The U -- alias starts an\n unsigned calculation, and the S alias starts a -- signed calculation. DIV_UDIVISOR : aliased HAL.UInt32; -- Divider signed dividend\n The same as UDIVIDEND, but starts a signed -- calculation, rather than unsigned. DIV_SDIVIDEND : aliased HAL.UInt32; -- Divider signed divisor\n The same as UDIVISOR, but starts a signed -- calculation, rather than unsigned. DIV_SDIVISOR : aliased HAL.UInt32; -- Divider result quotient\n The result of `DIVIDEND / DIVISOR` -- (division). Contents undefined while CSR_READY is low.\n For signed -- calculations, QUOTIENT is negative when the signs of DIVIDEND and -- DIVISOR differ.\n This register can be written to directly, for -- context save/restore purposes. This halts any\n in-progress -- calculation and sets the CSR_READY and CSR_DIRTY flags.\n Reading -- from QUOTIENT clears the CSR_DIRTY flag, so should read results in -- the order\n REMAINDER, QUOTIENT if CSR_DIRTY is used. DIV_QUOTIENT : aliased HAL.UInt32; -- Divider result remainder\n The result of `DIVIDEND % DIVISOR` -- (modulo). Contents undefined while CSR_READY is low.\n For signed -- calculations, REMAINDER is negative only when DIVIDEND is negative.\n -- This register can be written to directly, for context save/restore -- purposes. This halts any\n in-progress calculation and sets the -- CSR_READY and CSR_DIRTY flags. DIV_REMAINDER : aliased HAL.UInt32; -- Control and status register for divider. DIV_CSR : aliased DIV_CSR_Register; -- Read/write access to accumulator 0 INTERP0_ACCUM0 : aliased HAL.UInt32; -- Read/write access to accumulator 1 INTERP0_ACCUM1 : aliased HAL.UInt32; -- Read/write access to BASE0 register. INTERP0_BASE0 : aliased HAL.UInt32; -- Read/write access to BASE1 register. INTERP0_BASE1 : aliased HAL.UInt32; -- Read/write access to BASE2 register. INTERP0_BASE2 : aliased HAL.UInt32; -- Read LANE0 result, and simultaneously write lane results to both -- accumulators (POP). INTERP0_POP_LANE0 : aliased HAL.UInt32; -- Read LANE1 result, and simultaneously write lane results to both -- accumulators (POP). INTERP0_POP_LANE1 : aliased HAL.UInt32; -- Read FULL result, and simultaneously write lane results to both -- accumulators (POP). INTERP0_POP_FULL : aliased HAL.UInt32; -- Read LANE0 result, without altering any internal state (PEEK). INTERP0_PEEK_LANE0 : aliased HAL.UInt32; -- Read LANE1 result, without altering any internal state (PEEK). INTERP0_PEEK_LANE1 : aliased HAL.UInt32; -- Read FULL result, without altering any internal state (PEEK). INTERP0_PEEK_FULL : aliased HAL.UInt32; -- Control register for lane 0 INTERP0_CTRL_LANE0 : aliased INTERP0_CTRL_LANE0_Register; -- Control register for lane 1 INTERP0_CTRL_LANE1 : aliased INTERP0_CTRL_LANE1_Register; -- Values written here are atomically added to ACCUM0\n Reading yields -- lane 0's raw shift and mask value (BASE0 not added). INTERP0_ACCUM0_ADD : aliased INTERP0_ACCUM0_ADD_Register; -- Values written here are atomically added to ACCUM1\n Reading yields -- lane 1's raw shift and mask value (BASE1 not added). INTERP0_ACCUM1_ADD : aliased INTERP0_ACCUM1_ADD_Register; -- On write, the lower 16 bits go to BASE0, upper bits to BASE1 -- simultaneously.\n Each half is sign-extended to 32 bits if that -- lane's SIGNED flag is set. INTERP0_BASE_1AND0 : aliased HAL.UInt32; -- Read/write access to accumulator 0 INTERP1_ACCUM0 : aliased HAL.UInt32; -- Read/write access to accumulator 1 INTERP1_ACCUM1 : aliased HAL.UInt32; -- Read/write access to BASE0 register. INTERP1_BASE0 : aliased HAL.UInt32; -- Read/write access to BASE1 register. INTERP1_BASE1 : aliased HAL.UInt32; -- Read/write access to BASE2 register. INTERP1_BASE2 : aliased HAL.UInt32; -- Read LANE0 result, and simultaneously write lane results to both -- accumulators (POP). INTERP1_POP_LANE0 : aliased HAL.UInt32; -- Read LANE1 result, and simultaneously write lane results to both -- accumulators (POP). INTERP1_POP_LANE1 : aliased HAL.UInt32; -- Read FULL result, and simultaneously write lane results to both -- accumulators (POP). INTERP1_POP_FULL : aliased HAL.UInt32; -- Read LANE0 result, without altering any internal state (PEEK). INTERP1_PEEK_LANE0 : aliased HAL.UInt32; -- Read LANE1 result, without altering any internal state (PEEK). INTERP1_PEEK_LANE1 : aliased HAL.UInt32; -- Read FULL result, without altering any internal state (PEEK). INTERP1_PEEK_FULL : aliased HAL.UInt32; -- Control register for lane 0 INTERP1_CTRL_LANE0 : aliased INTERP1_CTRL_LANE0_Register; -- Control register for lane 1 INTERP1_CTRL_LANE1 : aliased INTERP1_CTRL_LANE1_Register; -- Values written here are atomically added to ACCUM0\n Reading yields -- lane 0's raw shift and mask value (BASE0 not added). INTERP1_ACCUM0_ADD : aliased INTERP1_ACCUM0_ADD_Register; -- Values written here are atomically added to ACCUM1\n Reading yields -- lane 1's raw shift and mask value (BASE1 not added). INTERP1_ACCUM1_ADD : aliased INTERP1_ACCUM1_ADD_Register; -- On write, the lower 16 bits go to BASE0, upper bits to BASE1 -- simultaneously.\n Each half is sign-extended to 32 bits if that -- lane's SIGNED flag is set. INTERP1_BASE_1AND0 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK0 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK1 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK2 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK3 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK4 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK5 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK6 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK7 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK8 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK9 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK10 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK11 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK12 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK13 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK14 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK15 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK16 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK17 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK18 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK19 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK20 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK21 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK22 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK23 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK24 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK25 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK26 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK27 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK28 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK29 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK30 : aliased HAL.UInt32; -- Reading from a spinlock address will:\n - Return 0 if lock is already -- locked\n - Otherwise return nonzero, and simultaneously claim the -- lock\n\n Writing (any value) releases the lock.\n If core 0 and core -- 1 attempt to claim the same lock simultaneously, core 0 wins.\n The -- value returned on success is 0x1 << lock number. SPINLOCK31 : aliased HAL.UInt32; end record with Volatile; for SIO_Peripheral use record CPUID at 16#0# range 0 .. 31; GPIO_IN at 16#4# range 0 .. 31; GPIO_HI_IN at 16#8# range 0 .. 31; GPIO_OUT at 16#10# range 0 .. 31; GPIO_OUT_SET at 16#14# range 0 .. 31; GPIO_OUT_CLR at 16#18# range 0 .. 31; GPIO_OUT_XOR at 16#1C# range 0 .. 31; GPIO_OE at 16#20# range 0 .. 31; GPIO_OE_SET at 16#24# range 0 .. 31; GPIO_OE_CLR at 16#28# range 0 .. 31; GPIO_OE_XOR at 16#2C# range 0 .. 31; GPIO_HI_OUT at 16#30# range 0 .. 31; GPIO_HI_OUT_SET at 16#34# range 0 .. 31; GPIO_HI_OUT_CLR at 16#38# range 0 .. 31; GPIO_HI_OUT_XOR at 16#3C# range 0 .. 31; GPIO_HI_OE at 16#40# range 0 .. 31; GPIO_HI_OE_SET at 16#44# range 0 .. 31; GPIO_HI_OE_CLR at 16#48# range 0 .. 31; GPIO_HI_OE_XOR at 16#4C# range 0 .. 31; FIFO_ST at 16#50# range 0 .. 31; FIFO_WR at 16#54# range 0 .. 31; FIFO_RD at 16#58# range 0 .. 31; SPINLOCK_ST at 16#5C# range 0 .. 31; DIV_UDIVIDEND at 16#60# range 0 .. 31; DIV_UDIVISOR at 16#64# range 0 .. 31; DIV_SDIVIDEND at 16#68# range 0 .. 31; DIV_SDIVISOR at 16#6C# range 0 .. 31; DIV_QUOTIENT at 16#70# range 0 .. 31; DIV_REMAINDER at 16#74# range 0 .. 31; DIV_CSR at 16#78# range 0 .. 31; INTERP0_ACCUM0 at 16#80# range 0 .. 31; INTERP0_ACCUM1 at 16#84# range 0 .. 31; INTERP0_BASE0 at 16#88# range 0 .. 31; INTERP0_BASE1 at 16#8C# range 0 .. 31; INTERP0_BASE2 at 16#90# range 0 .. 31; INTERP0_POP_LANE0 at 16#94# range 0 .. 31; INTERP0_POP_LANE1 at 16#98# range 0 .. 31; INTERP0_POP_FULL at 16#9C# range 0 .. 31; INTERP0_PEEK_LANE0 at 16#A0# range 0 .. 31; INTERP0_PEEK_LANE1 at 16#A4# range 0 .. 31; INTERP0_PEEK_FULL at 16#A8# range 0 .. 31; INTERP0_CTRL_LANE0 at 16#AC# range 0 .. 31; INTERP0_CTRL_LANE1 at 16#B0# range 0 .. 31; INTERP0_ACCUM0_ADD at 16#B4# range 0 .. 31; INTERP0_ACCUM1_ADD at 16#B8# range 0 .. 31; INTERP0_BASE_1AND0 at 16#BC# range 0 .. 31; INTERP1_ACCUM0 at 16#C0# range 0 .. 31; INTERP1_ACCUM1 at 16#C4# range 0 .. 31; INTERP1_BASE0 at 16#C8# range 0 .. 31; INTERP1_BASE1 at 16#CC# range 0 .. 31; INTERP1_BASE2 at 16#D0# range 0 .. 31; INTERP1_POP_LANE0 at 16#D4# range 0 .. 31; INTERP1_POP_LANE1 at 16#D8# range 0 .. 31; INTERP1_POP_FULL at 16#DC# range 0 .. 31; INTERP1_PEEK_LANE0 at 16#E0# range 0 .. 31; INTERP1_PEEK_LANE1 at 16#E4# range 0 .. 31; INTERP1_PEEK_FULL at 16#E8# range 0 .. 31; INTERP1_CTRL_LANE0 at 16#EC# range 0 .. 31; INTERP1_CTRL_LANE1 at 16#F0# range 0 .. 31; INTERP1_ACCUM0_ADD at 16#F4# range 0 .. 31; INTERP1_ACCUM1_ADD at 16#F8# range 0 .. 31; INTERP1_BASE_1AND0 at 16#FC# range 0 .. 31; SPINLOCK0 at 16#100# range 0 .. 31; SPINLOCK1 at 16#104# range 0 .. 31; SPINLOCK2 at 16#108# range 0 .. 31; SPINLOCK3 at 16#10C# range 0 .. 31; SPINLOCK4 at 16#110# range 0 .. 31; SPINLOCK5 at 16#114# range 0 .. 31; SPINLOCK6 at 16#118# range 0 .. 31; SPINLOCK7 at 16#11C# range 0 .. 31; SPINLOCK8 at 16#120# range 0 .. 31; SPINLOCK9 at 16#124# range 0 .. 31; SPINLOCK10 at 16#128# range 0 .. 31; SPINLOCK11 at 16#12C# range 0 .. 31; SPINLOCK12 at 16#130# range 0 .. 31; SPINLOCK13 at 16#134# range 0 .. 31; SPINLOCK14 at 16#138# range 0 .. 31; SPINLOCK15 at 16#13C# range 0 .. 31; SPINLOCK16 at 16#140# range 0 .. 31; SPINLOCK17 at 16#144# range 0 .. 31; SPINLOCK18 at 16#148# range 0 .. 31; SPINLOCK19 at 16#14C# range 0 .. 31; SPINLOCK20 at 16#150# range 0 .. 31; SPINLOCK21 at 16#154# range 0 .. 31; SPINLOCK22 at 16#158# range 0 .. 31; SPINLOCK23 at 16#15C# range 0 .. 31; SPINLOCK24 at 16#160# range 0 .. 31; SPINLOCK25 at 16#164# range 0 .. 31; SPINLOCK26 at 16#168# range 0 .. 31; SPINLOCK27 at 16#16C# range 0 .. 31; SPINLOCK28 at 16#170# range 0 .. 31; SPINLOCK29 at 16#174# range 0 .. 31; SPINLOCK30 at 16#178# range 0 .. 31; SPINLOCK31 at 16#17C# range 0 .. 31; end record; -- Single-cycle IO block\n Provides core-local and inter-core hardware for -- the two processors, with single-cycle access. SIO_Periph : aliased SIO_Peripheral with Import, Address => SIO_Base; end RP_SVD.SIO;
-- Copyright 2014-2019 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 Result1 : Data_Type; GGG1 : GADataType'Class := GADataType'Class (Result1); begin Do_Nothing (GGG1'Address); -- BREAK end Foo;
-- The MIT License (MIT) -- Copyright (c) 2015 Pavel Zhukov <landgraf@fedoraproject.org> -- 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 Nanomsg.Domains; with Nanomsg.Reqrep; with Aunit.Assertions; with Nanomsg.Messages; package body Nanomsg.Test_Req_Rep is procedure Run_Test (T : in out TC) is use Aunit.Assertions; Address : constant String := "tcp://127.0.0.1:5555"; Request : constant String := "Calculate : 2 + 2"; Reply : constant String := "Answer: 4"; Req_Send : Nanomsg.Messages.Message_T; Req_Rcv : Nanomsg.Messages.Message_T := Nanomsg.Messages.Empty_Message; Rep_Send : Nanomsg.Messages.Message_T; Rep_Rcv : Nanomsg.Messages.Message_T := Nanomsg.Messages.Empty_Message; begin Nanomsg.Messages.From_String (Req_Send, Request); Nanomsg.Messages.From_String (Rep_Send, Reply); Nanomsg.Socket.Init (T.Socket1, Nanomsg.Domains.Af_Sp, Nanomsg.Reqrep.Nn_REQ); Nanomsg.Socket.Init (T.Socket2, Nanomsg.Domains.Af_Sp, Nanomsg.Reqrep.Nn_REP); Assert (Condition => not T.Socket1.Is_Null, Message => "Failed to initialize socket1"); Assert (Condition => not T.Socket2.Is_Null, Message => "Failed to initialize socket2"); Assert (Condition => T.Socket1.Get_Fd /= T.Socket2.Get_Fd, Message => "Descriptors collision!"); Nanomsg.Socket.Bind (T.Socket2, "tcp://*:5555"); Nanomsg.Socket.Connect (T.Socket1, Address); T.Socket1.Send (Req_Send); T.Socket2.Receive (Req_Rcv); Assert (Condition => Req_Rcv.Text = Request, Message => "Request damaged in tranmission"); T.Socket2.Send (Rep_Send); T.Socket1.Receive (Rep_Rcv); Assert (Condition => Rep_Rcv.Text = Reply, Message => "Reply damaged in tranmission"); end Run_Test; function Name (T : TC) return Message_String is begin return Aunit.Format ("Test case name : Request/Reply pattern test"); end Name; procedure Tear_Down (T : in out Tc) is begin if T.Socket1.Get_Fd >= 0 then T.Socket1.Close; end if; if T.Socket2.Get_Fd >= 0 then T.Socket2.Close; end if; end Tear_Down; end Nanomsg.Test_Req_Rep;
-- TODO: how to deal with virusscanners? -- Performance can be limited by speed of virus scanner ;-( -- running in a single thread... with Ada.Containers; use Ada.Containers; with Ada.Containers.Indefinite_Ordered_Maps; with Ada.Directories; use Ada.Directories; with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; -- with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Interfaces.C; use Interfaces.C; with Langkit_Support.Text; use Langkit_Support.Text; with Libadalang.Analysis; use Libadalang.Analysis; with Libadalang.Common; use Libadalang.Common; with Rejuvenation; use Rejuvenation; with Rejuvenation.File_Utils; use Rejuvenation.File_Utils; with Rejuvenation.Finder; use Rejuvenation.Finder; with Rejuvenation.Find_And_Replacer; use Rejuvenation.Find_And_Replacer; with Rejuvenation.Node_Locations; use Rejuvenation.Node_Locations; with Rejuvenation.Patterns; use Rejuvenation.Patterns; with Rejuvenation.Pretty_Print; use Rejuvenation.Pretty_Print; with Rejuvenation.Simple_Factory; use Rejuvenation.Simple_Factory; -- use Rejuvenation.Simple_Factory.Unbounded_Strings; with Rejuvenation.Text_Rewrites; use Rejuvenation.Text_Rewrites; -- with Rejuvenation.Utils; use Rejuvenation.Utils; with Rewriters; use Rewriters; with Rewriters_Find_And_Replace; use Rewriters_Find_And_Replace; with Predefined_Rewriters; use Predefined_Rewriters; procedure Code_Reviewer is Error_Count : Natural := 0; package Name_To_Rewriter_Maps is new Indefinite_Ordered_Maps (Key_Type => String, Element_Type => Rewriter_Find_And_Replace); type Version_Control_Kind is (GIT, SVN); Source_Version_Control : constant Version_Control_Kind := GIT; Source_Directory : constant String := "C:\path\to\Renaissance-Ada"; -- Example to review the code within Renaissance-Ada Project_Filename : constant String := Source_Directory & "\src\libraries\Rejuvenation_Lib\rejuvenation_lib.gpr"; -- Example to review the rejuvenation_lib project -- TODO: when aggregate projects are supported review all projects! Invocation_Exception : exception; procedure Execute_Command (Command : String); procedure Execute_Command (Command : String) is function Sys (Arg : char_array) return Integer; pragma Import (C, Sys, "system"); Ret_Val : Integer; begin Ret_Val := Sys (To_C (Command)); if Ret_Val /= 0 then raise Invocation_Exception with Ret_Val'Image & " for '" & Command & "'"; end if; end Execute_Command; procedure Revert_SVN; procedure Revert_SVN is begin Execute_Command ("svn revert --recursive " & Source_Directory); end Revert_SVN; procedure Restore_GIT; procedure Restore_GIT is begin Execute_Command ("cd """ & Source_Directory & """ & git restore *"); end Restore_GIT; procedure Rewind_Not_Committed_Changes; procedure Rewind_Not_Committed_Changes is begin case Source_Version_Control is when SVN => Revert_SVN; when GIT => Restore_GIT; end case; end Rewind_Not_Committed_Changes; procedure Diff_SVN (File_Name : String); procedure Diff_SVN (File_Name : String) is begin Execute_Command ("svn diff " & Source_Directory & " > " & File_Name); end Diff_SVN; procedure Diff_GIT (File_Name : String); procedure Diff_GIT (File_Name : String) is begin Execute_Command ("cd " & Source_Directory & "& git diff > " & File_Name); end Diff_GIT; procedure Create_Patch (patch : String); procedure Create_Patch (patch : String) is File_Name : constant String := Compose ("C:\path\to\patches", -- Note: path must exist -- Path is NOT created by this program! patch, "patch"); begin case Source_Version_Control is when SVN => Diff_SVN (File_Name); when GIT => Diff_GIT (File_Name); end case; end Create_Patch; procedure Change_Files (Units : Analysis_Units.Vector; R : Rewriter'Class); procedure Change_Files (Units : Analysis_Units.Vector; R : Rewriter'Class) is begin for Unit of Units loop declare File : constant String := Unit.Get_Filename; Original_Content : constant String := Encode (Unit.Text, Unit.Get_Charset); begin declare TR : Text_Rewrite_Unit := Make_Text_Rewrite_Unit (Unit); Content : constant String := R.Rewrite (Unit.Root); begin TR.Replace (Unit.Root, Content, Trivia_On_Same_Line, Trivia_On_Same_Line, Unit.Get_Charset); if TR.ApplyToString /= Original_Content then Put_Line ("Changed " & File); Turn_Pretty_Printing_Initially_Off (TR); TR.Apply; Pretty_Print_Sections (File, Standard_Options_Project); Remove_Pretty_Print_Flags (File); end if; exception when Error : others => declare Error_File_Name : constant String := "c:\Temp\error" & Trim (Error_Count'Image, Both) & ".adx"; begin Put_Line ("Error in Change_Files - " & File & " " & Exception_Message (Error)); Execute_Command ("move " & File & " " & Error_File_Name); Put_Line ("See " & Error_File_Name); Write_String_To_File (Original_Content, File); Error_Count := Error_Count + 1; end; end; exception when Error : Parse_Exception => Put_Line ("Not an Ada file - " & File & " " & Exception_Message (Error)); end; end loop; end Change_Files; procedure Create_Patches (Units : Analysis_Units.Vector; Map : Name_To_Rewriter_Maps.Map); procedure Create_Patches (Units : Analysis_Units.Vector; Map : Name_To_Rewriter_Maps.Map) is begin for KE in Map.Iterate loop declare Rewriter_Name : constant String := Name_To_Rewriter_Maps.Key (KE); begin Put_Line ("==== " & Rewriter_Name & " ===="); Change_Files (Units, Name_To_Rewriter_Maps.Element (KE)); Create_Patch (Rewriter_Name); Rewind_Not_Committed_Changes; end; end loop; end Create_Patches; procedure Report_Count_Instances (Units : Analysis_Units.Vector; Map : Name_To_Rewriter_Maps.Map); procedure Report_Count_Instances (Units : Analysis_Units.Vector; Map : Name_To_Rewriter_Maps.Map) is begin for KE in Map.Iterate loop declare Rewriter_Name : constant String := Name_To_Rewriter_Maps.Key (KE); Element : constant Rewriter_Find_And_Replace := Name_To_Rewriter_Maps.Element (KE); F_P : constant Pattern := Element.Find_Pattern; A_M : constant Match_Accepter := Element.Accept_Match; NrOf_Find : Natural := 0; NrOf_Accept : Natural := 0; begin for Unit of Units loop declare Matches : constant Match_Pattern_List.Vector := (if F_P.As_Ada_Node.Kind in Ada_Ada_List then Find_Sub_List (Unit.Root, F_P) else Find_Full (Unit.Root, F_P)); begin NrOf_Find := NrOf_Find + Natural (Matches.Length); for Match of Matches loop -- Put_Line -- (Image -- (Match.Get_Nodes.First_Element.Full_Sloc_Image)); -- Put_Line -- (Raw_Signature -- (Match.Get_Nodes.First_Element, -- Match.Get_Nodes.Last_Element)); if A_M (Match) then NrOf_Accept := NrOf_Accept + 1; end if; end loop; end; end loop; Put_Line (Rewriter_Name & " : " & NrOf_Accept'Image & " (" & NrOf_Find'Image & ")"); end; end loop; end Report_Count_Instances; function Get_Units return Analysis_Units.Vector; function Get_Units return Analysis_Units.Vector is begin return Analyze_Project (Project_Filename); end Get_Units; -- function Get_Units return Analysis_Units.Vector is -- UFiles : constant Unbounded_Strings.Vector := -- Get_Ada_Source_Files_From_Directory (Source_Directory); -- Units : Analysis_Units.Vector; -- begin -- for UFile of UFiles loop -- begin -- declare -- File : constant String := To_String (UFile); -- Unit : constant Analysis_Unit := Analyze_File (File); -- begin -- Units.Append (Unit); -- end; -- exception -- when Parse_Exception => -- null; -- end; -- end loop; -- return Units; -- end Get_Units; function Get_Map return Name_To_Rewriter_Maps.Map; function Get_Map return Name_To_Rewriter_Maps.Map is Name_To_Rewriter_Map : Name_To_Rewriter_Maps.Map; begin -- Name_To_Rewriter_Map.Include -- ("Minimal_Parentheses", RMP); Name_To_Rewriter_Map.Include ("Definition_Equal", Rewriter_Definition_Equal); Name_To_Rewriter_Map.Include ("Definition_Different", Rewriter_Definition_Different); Name_To_Rewriter_Map.Include ("Definition_Minus", Rewriter_Definition_Minus); Name_To_Rewriter_Map.Include ("Definition_Divide", Rewriter_Definition_Divide); Name_To_Rewriter_Map.Include ("Definition_Modulo", Rewriter_Definition_Modulo); Name_To_Rewriter_Map.Include ("Definition_Remainder", Rewriter_Definition_Remainder); Name_To_Rewriter_Map.Include ("Idempotence_And", Rewriter_Idempotence_And); Name_To_Rewriter_Map.Include ("Idempotence_Or", Rewriter_Idempotence_Or); Name_To_Rewriter_Map.Include ("Complementation_And", Rewriter_Complementation_And); Name_To_Rewriter_Map.Include ("Complementation_Or", Rewriter_Complementation_Or); Name_To_Rewriter_Map.Include ("Not_Not", Rewriter_Not_Not); Name_To_Rewriter_Map.Include ("Not_Equal", Rewriter_Not_Equal); Name_To_Rewriter_Map.Include ("Not_Different", Rewriter_Not_Different); Name_To_Rewriter_Map.Include ("Not_Greater_Than", Rewriter_Not_Greater_Than); Name_To_Rewriter_Map.Include ("Not_Greater_Equal", Rewriter_Not_Greater_Equal); Name_To_Rewriter_Map.Include ("Not_Less_Than", Rewriter_Not_Less_Than); Name_To_Rewriter_Map.Include ("Not_Less_Equal", Rewriter_Not_Less_Equal); Name_To_Rewriter_Map.Include ("Not_In", Rewriter_Not_In); Name_To_Rewriter_Map.Include ("Not_Not_In", Rewriter_Not_Not_In); Name_To_Rewriter_Map.Include ("And_Then", Rewriter_And_Then); Name_To_Rewriter_Map.Include ("Or_Else", Rewriter_Or_Else); Name_To_Rewriter_Map.Include ("Equal_True", Rewriter_Equal_True); Name_To_Rewriter_Map.Include ("Equal_False", Rewriter_Equal_False); Name_To_Rewriter_Map.Include ("Different_True", Rewriter_Different_True); Name_To_Rewriter_Map.Include ("Different_False", Rewriter_Different_False); Name_To_Rewriter_Map.Include ("De_Morgan_Not_And", Rewrite_De_Morgan_Not_And); Name_To_Rewriter_Map.Include ("De_Morgan_Not_Or", Rewrite_De_Morgan_Not_Or); Name_To_Rewriter_Map.Include ("De_Morgan_Not_All_Range", Rewrite_De_Morgan_Not_All_Range); Name_To_Rewriter_Map.Include ("De_Morgan_Not_All_Elements", Rewrite_De_Morgan_Not_All_Elements); Name_To_Rewriter_Map.Include ("De_Morgan_Not_Some_Range", Rewrite_De_Morgan_Not_Some_Range); Name_To_Rewriter_Map.Include ("De_Morgan_Not_Some_Elements", Rewrite_De_Morgan_Not_Some_Elements); Name_To_Rewriter_Map.Include ("If_True_Expression", Rewriter_If_True_Expression); Name_To_Rewriter_Map.Include ("If_False_Expression", Rewriter_If_False_Expression); Name_To_Rewriter_Map.Include ("If_Identical_Expression", Rewriter_If_Identical_Expression); Name_To_Rewriter_Map.Include ("If_Different_Expression", Rewriter_If_Different_Expression); Name_To_Rewriter_Map.Include ("If_Not_Condition_Expression", Rewriter_If_Not_Condition_Expression); Name_To_Rewriter_Map.Include ("If_Not_In_Expression", Rewriter_If_Not_In_Expression); Name_To_Rewriter_Map.Include ("Boolean_If_Condition_Expression", Rewriter_Boolean_If_Condition_Expression); Name_To_Rewriter_Map.Include ("Boolean_If_Not_Condition_Expression", Rewriter_Boolean_If_Not_Condition_Expression); Name_To_Rewriter_Map.Include ("Integer_Max_Greater_Than", Rewriter_Integer_Max_Greater_Than); Name_To_Rewriter_Map.Include ("Integer_Max_Greater_Equal", Rewriter_Integer_Max_Greater_Equal); Name_To_Rewriter_Map.Include ("Integer_Max_Less_Than", Rewriter_Integer_Max_Less_Than); Name_To_Rewriter_Map.Include ("Integer_Max_Less_Equal", Rewriter_Integer_Max_Less_Equal); Name_To_Rewriter_Map.Include ("Integer_Min_Greater_Than", Rewriter_Integer_Min_Greater_Than); Name_To_Rewriter_Map.Include ("Integer_Min_Greater_Equal", Rewriter_Integer_Min_Greater_Equal); Name_To_Rewriter_Map.Include ("Integer_Min_Less_Than", Rewriter_Integer_Min_Less_Than); Name_To_Rewriter_Map.Include ("Integer_Min_Less_Equal", Rewriter_Integer_Min_Less_Equal); Name_To_Rewriter_Map.Include ("Concat_Before_If_Expression", Rewriter_Concat_Before_If_Expression); Name_To_Rewriter_Map.Include ("Concat_After_If_Expression", Rewriter_Concat_After_If_Expression); Name_To_Rewriter_Map.Include ("Plus_Before_If_Expression", Rewriter_Plus_Before_If_Expression); Name_To_Rewriter_Map.Include ("Plus_After_If_Expression", Rewriter_Plus_After_If_Expression); Name_To_Rewriter_Map.Include ("Case_Expression_Binary_With_Others", Rewriter_Case_Expression_Binary_With_Others); Name_To_Rewriter_Map.Include ("Double", Rewriter_Double); Name_To_Rewriter_Map.Include ("Equals_To_In_Range", Rewriter_Equals_To_In_Range); Name_To_Rewriter_Map.Include ("Combine_In_Range_And_Equal", Rewriter_Combine_In_Range_And_Equal); Name_To_Rewriter_Map.Include ("Combine_In_Ranges", Rewriter_Combine_In_Ranges); Name_To_Rewriter_Map.Include ("Differents_To_Not_In_Range", Rewriter_Differents_To_Not_In_Range); Name_To_Rewriter_Map.Include ("Combine_Not_In_Range_And_Different", Rewriter_Combine_Not_In_Range_And_Different); Name_To_Rewriter_Map.Include ("Combine_In_Ranges", Rewriter_Combine_In_Ranges); Name_To_Rewriter_Map.Include ("Unnecessary_Null_Stmt", Rewriter_Unnecessary_Null_Stmt); Name_To_Rewriter_Map.Include ("If_True_Stmt", Rewriter_If_True_Stmt); Name_To_Rewriter_Map.Include ("If_False_Stmt", Rewriter_If_False_Stmt); Name_To_Rewriter_Map.Include ("If_Different_Stmt", Rewriter_If_Different_Stmt); Name_To_Rewriter_Map.Include ("If_Not_Condition_Stmt", Rewriter_If_Not_Condition_Stmt); Name_To_Rewriter_Map.Include ("If_Not_In_Stmt", Rewriter_If_Not_In_Stmt); Name_To_Rewriter_Map.Include ("Use_Elsif", Rewriter_Use_Elsif); Name_To_Rewriter_Map.Include ("Null_Then_Branch", Rewriter_Null_Then_Branch); Name_To_Rewriter_Map.Include ("Null_Else_Branch", Rewriter_Null_Else_Branch); Name_To_Rewriter_Map.Include ("If_Identical_Branches_Stmt", Rewriter_If_Identical_Branches_Stmt); Name_To_Rewriter_Map.Include ("If_Identical_Tails_Stmt", Rewriter_If_Identical_Tails_Stmt); Name_To_Rewriter_Map.Include ("If_Argument_Stmt", Rewriter_If_Argument_Stmt); Name_To_Rewriter_Map.Include ("If_Assignment_Stmt", Rewriter_If_Assignment_Stmt); Name_To_Rewriter_Map.Include ("If_Return_Stmt", Rewriter_If_Return_Stmt); Name_To_Rewriter_Map.Include ("If_Return_Stmts", Rewriter_If_Return_Stmts); Name_To_Rewriter_Map.Include ("Case_Single", Rewriter_Case_Single); Name_To_Rewriter_Map.Include ("Case_Binary_With_Others", Rewriter_Case_Binary_With_Others); Name_To_Rewriter_Map.Include ("Case_Identical_Branches", Rewriter_Case_Identical_Branches); Name_To_Rewriter_Map.Include ("Return_Expression", Rewriter_Return_Expression); Name_To_Rewriter_Map.Include ("Declare_And_Overwrite", Rewriter_Declare_And_Overwrite); Name_To_Rewriter_Map.Include ("For_All_Range_And_Then", Rewriter_For_All_Range_And_Then); Name_To_Rewriter_Map.Include ("For_All_Elements_And_Then", Rewriter_For_All_Elements_And_Then); Name_To_Rewriter_Map.Include ("For_Some_Range_Or_Else", Rewriter_For_Some_Range_Or_Else); Name_To_Rewriter_Map.Include ("For_Some_Elements_Or_Else", Rewriter_For_Some_Elements_Or_Else); Name_To_Rewriter_Map.Include ("For_All_Range_Exit", Rewriter_For_All_Range_Exit); Name_To_Rewriter_Map.Include ("For_All_Elements_Exit", Rewriter_For_All_Elements_Exit); Name_To_Rewriter_Map.Include ("For_Some_Range_Exit", Rewriter_For_Some_Range_Exit); Name_To_Rewriter_Map.Include ("For_Some_Elements_Exit", Rewriter_For_Some_Elements_Exit); Name_To_Rewriter_Map.Include ("For_All_Range_Return", Rewriter_For_All_Range_Return); Name_To_Rewriter_Map.Include ("For_All_Elements_Return", Rewriter_For_All_Elements_Return); Name_To_Rewriter_Map.Include ("For_Some_Range_Return", Rewriter_For_Some_Range_Return); Name_To_Rewriter_Map.Include ("For_Some_Elements_Return", Rewriter_For_Some_Elements_Return); Name_To_Rewriter_Map.Include ("For_All_Range_All", Rewriter_For_All_Range_All); Name_To_Rewriter_Map.Include ("For_All_Elements_All", Rewriter_For_All_Elements_All); Name_To_Rewriter_Map.Include ("For_Some_Range_All", Rewriter_For_Some_Range_All); Name_To_Rewriter_Map.Include ("For_Some_Elements_All", Rewriter_For_Some_Elements_All); Name_To_Rewriter_Map.Include ("Append_To_Unbounded_String", Rewriter_Append_To_Unbounded_String); Name_To_Rewriter_Map.Include ("Append", Rewriter_Append); Name_To_Rewriter_Map.Include ("Declarations_Combine", Rewriter_Declarations_Combine); Name_To_Rewriter_Map.Include ("For_Attribute_Use", Rewriter_For_Attribute_Use); Name_To_Rewriter_Map.Include ("For_Attribute_Use_Aliased", Rewriter_For_Attribute_Use_Aliased); Name_To_Rewriter_Map.Include ("For_Attribute_Use_Array", Rewriter_For_Attribute_Use_Array); Name_To_Rewriter_Map.Include ("For_Attribute_Use_Pragma_Var", Rewriter_For_Attribute_Use_Pragma_Var); Name_To_Rewriter_Map.Include ("For_Attribute_Use_Pragma_All", Rewriter_For_Attribute_Use_Pragma_All); return Name_To_Rewriter_Map; end Get_Map; Units : constant Analysis_Units.Vector := Get_Units; Name_To_Rewriter_Map : constant Name_To_Rewriter_Maps.Map := Get_Map; begin Rewind_Not_Committed_Changes; Report_Count_Instances (Units, Name_To_Rewriter_Map); Create_Patches (Units, Name_To_Rewriter_Map); end Code_Reviewer;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- B I N D E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-1997 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 contains the routines to determine elaboration order with ALI; use ALI; with Table; with Types; use Types; package Binde is -- The following table records the chosen elaboration order. It is used -- by Gen_Elab_Call to generate the sequence of elaboration calls. Note -- that units are included in this table even if they have no elaboration -- routine, since the table is also used to drive the generation of object -- files in the binder output. Gen_Elab_Call skips any units that have no -- elaboration routine. package Elab_Order is new Table.Table ( Table_Component_Type => Unit_Id, Table_Index_Type => Nat, Table_Low_Bound => 1, Table_Initial => 500, Table_Increment => 200, Table_Name => "Elab_Order"); procedure Find_Elab_Order; -- Determine elaboration order end Binde;
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- 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. -- * The name of the copyright holder 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 HOLDER 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 Keccak.Types; -- @summary -- Implements an optimized Keccak-f permutation based on SIMD instruction sets -- such as SSE, NEON, and AVX. -- -- @description -- This package provides a basis for parallel implementations of Keccak -- for processing N separate permutations in parallel, where N is the number -- of vector components in the SIMD instruction set used. -- -- When instantiating this package, subprograms and types are provided as -- formal generic parameters which implement each of the required operations -- for the target instruction set. -- -- @group Parallel Keccak-f generic Lane_Size_Log : in Positive; -- The binary logarithm of the lane size. -- -- This determines the Keccak-f state size. Allowed values are: -- * Lane_Size_Log = 3 => 8-bit lanes, Keccak-f[200] -- * Lane_Size_Log = 4 => 16-bit lanes, Keccak-f[400] -- * Lane_Size_Log = 5 => 32-bit lanes, Keccak-f[800] -- * Lane_Size_Log = 6 => 64-bit lanes, Keccak-f[1600] type Lane_Type is mod <>; -- Lane type e.g. Unsigned_64. type VXXI_Index is range <>; -- Index type into the vector component. type VXXI is private; -- Vector type. type VXXI_View is array (VXXI_Index) of Lane_Type; -- A view of the vector type, permitting individual access to each vector -- component. Vector_Width : Positive; -- Number of vector to components to actually use. -- -- Usually, this would be set to the actual number of vector components -- (e.g. 4 for a 4x 32-bit vector). However, you may use a smaller number -- if you don't want to use the full vector width. For example, you could -- set Vector_Width to 2 with a 4x 32-bit vector type, to obtain 2x -- parallelism (the upper 2 vector components would not be used). with function Load (X : in VXXI_View) return VXXI; with function Store (X : in VXXI) return VXXI_View; with function "xor" (A, State_Size_Bits : in VXXI) return VXXI; -- Calculates A xor State_Size_Bits per vector component. with function Rotate_Left (A : in VXXI; Amount : in Natural) return VXXI; -- Calculates Rotate_Left(A) per vector component. with function And_Not (A, State_Size_Bits : in VXXI) return VXXI; -- Calculates State_Size_Bits and (not A) per vector component. with function Shift_Left (A : in Lane_Type; Amount : in Natural) return Lane_Type; with function Shift_Right (A : in Lane_Type; Amount : in Natural) return Lane_Type; package Keccak.Generic_Parallel_KeccakF is Lane_Size_Bits : constant Positive := 2**Lane_Size_Log; -- Lane size (in bits, i.e. 8, 16, 32, or 64) State_Size_Bits : constant Positive := Lane_Size_Bits * 25; -- Keccak-f state size (in bits). Num_Parallel_Instances : constant Positive := Vector_Width; pragma Assert (Lane_Size_Bits mod 8 = 0, "Generic_Parallel_KeccakF only supports Lane_Size_Log in 3 .. 6"); pragma Assert (Vector_Width in 1 .. VXXI_View'Length, "Vector_Width exceeds vector type's width"); type Parallel_State is private; Initialized_State : constant Parallel_State; type Round_Index is range 0 .. 23; subtype Round_Count is Positive range 1 .. 24; procedure Init (S : out Parallel_State) with Global => null; -- Initialise the Keccak state to all zeroes. generic First_Round : Round_Index := 0; Num_Rounds : Round_Count := 24; procedure Permute_All (S : in out Parallel_State) with Global => null; -- Applies the Keccak-f permutation function to all N parallel states. -- -- This generic function is a Keccak-p permutation which is -- instantiated, with the number rounds, into a Keccak-f instance. procedure XOR_Bits_Into_State_Separate (S : in out Parallel_State; Data : in Types.Byte_Array; Data_Offset : in Natural; Bit_Len : in Natural) with Global => null, Pre => (Data'Length / Vector_Width <= Natural'Last / 8 and then Data'Length mod Vector_Width = 0 and then Data_Offset <= (Data'Length / Vector_Width) and then Bit_Len <= ((Data'Length / Vector_Width) - Data_Offset) * 8 and then Bit_Len <= State_Size_Bits); -- XOR separate data into each parallel Keccak instance. -- -- The @Data@ array contains the data to be XORed into all parallel -- instances. The bytes in @Data@ are split into equal chunks depending on -- the number of parallel instances. For example, for Keccak-f[1600]�2 the -- @Data@ array is split into 2 chunks as shown below: -- -- . DO BL DO BL -- |--->|<---->| |--->|<---->| -- +-----------------------------------------+ -- | | | Data -- +-----------------------------------------+ -- . | | | | -- . | XOR | | XOR | -- . | v | | v | -- . +-----------+ +-----------+ -- . | state 0 | | state 1 | -- . +-----------+ +-----------+ -- -- Where DO = Data_Offset and BL = Bit_Len -- -- The @Data_Offset@ determines the offset within each chunk to start -- reading data. @Bit_Len@ determines the number of bits to read from each -- chunk. -- -- The data is always XORed starting at the beginning of the Keccak state. -- -- @param S The parallel Keccak state to where the bits are XORed. -- -- @param Data The array containing the data to XOR into the parallel state. -- The size of this array must be a multiple of the number of parallel -- instances. For Example, for Keccak-f[1600]�4 then Data'Length -- must be a multiple of 4. -- -- @param Data_Offset Offset of the first byte(s) to read from the @Data@ -- array. -- -- @param Bit_Len The number of bits to XOR into each state. procedure XOR_Bits_Into_State_All (S : in out Parallel_State; Data : in Types.Byte_Array; Bit_Len : in Natural) with Global => null, Depends => (S =>+ (Data, Bit_Len)), Pre => (Data'Length <= Natural'Last / 8 and then Bit_Len <= Data'Length * 8 and then Bit_Len <= State_Size_Bits); -- XOR the same data into all parallel Keccak instances. -- -- The @Data@ array contains the data to be XORed into all parallel -- instances. For example, for Keccak-f[1600]�2 this would be as follows: -- -- . BL -- . |<--------->| -- . +----------------+ -- . | | Data -- . +----------------+ -- . /\ -- . XOR / \ XOR -- . v / \ v -- +-----------+-----------+ -- | state 0 | state 1 | -- +-----------+-----------+ -- -- Where BL = Bit_Len -- -- The data is always XORed starting at the beginning of the Keccak state. -- -- @param S The parallel Keccak state to where the bits are XORed. -- -- @param Data The array containing the data to XOR into each parallel state. -- -- @param Bit_Len The length of the data, in bits. procedure Extract_Bytes (S : in Parallel_State; Data : in out Types.Byte_Array; Data_Offset : in Natural; Byte_Len : in Natural) with Global => null, Pre => (Data'Length mod Vector_Width = 0 and then Data_Offset <= Data'Length / Vector_Width and then Byte_Len <= (Data'Length / Vector_Width) - Data_Offset and then Byte_Len <= State_Size_Bits / 8); -- Extract bytes from the Keccak state. -- -- The @Data@ array is split into N equal sized chunks, where N is the -- number of parallel instances. The bytes extracted from each Keccak -- state is then copied into the each chunk, offset by @Data_Offset@. -- An example is shown below for Keccak-f[1600]�2 (i.e. 2 parallel -- instances): -- -- . DO BL DO BL -- |--->|<---->| |--->|<---->| -- +-----------------------------------------+ -- | | | Data -- +-----------------------------------------+ -- . | ^ | | ^ | -- . | Read | | Read | -- . | | | | -- . +-----------+ +-----------+ -- . | state 0 | | state 1 | -- . +-----------+ +-----------+ -- -- The bytes are always read from the beginning of the Keccak state. -- -- @param S The Keccak state to read bytes from. -- -- @param Data Bytes extracted from the Keccak state are copied to this -- array, offset according to @Data_Offset@. -- -- @param Data_Offset The offset in the @Data@ array to mark the position -- of the first byte in each chunk. -- -- @param Byte_Len The number of bytes to read from each chunk. private type X_Coord is mod 5; type Y_Coord is mod 5; type Parallel_State is array (X_Coord, Y_Coord) of VXXI_View; Initialized_State : constant Parallel_State := (others => (others => (others => 0))); end Keccak.Generic_Parallel_KeccakF;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-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 Interfaces; use Interfaces; package HAL.Audio is pragma Preelaborate; type Audio_Buffer is array (Natural range <>) of Integer_16 with Component_Size => 16, Alignment => 2; type Audio_Volume is new Natural range 0 .. 100; type Audio_Frequency is (Audio_Freq_8kHz, Audio_Freq_11kHz, Audio_Freq_16kHz, Audio_Freq_22kHz, Audio_Freq_32kHz, Audio_Freq_44kHz, Audio_Freq_48kHz, Audio_Freq_96kHz) with Size => 32; for Audio_Frequency use (Audio_Freq_8kHz => 8_000, Audio_Freq_11kHz => 11_025, Audio_Freq_16kHz => 16_000, Audio_Freq_22kHz => 22_050, Audio_Freq_32kHz => 32_000, Audio_Freq_44kHz => 44_100, Audio_Freq_48kHz => 48_000, Audio_Freq_96kHz => 96_000); type Audio_Stream is limited interface; procedure Set_Frequency (This : in out Audio_Stream; Frequency : Audio_Frequency) is abstract; procedure Transmit (This : in out Audio_Stream; Data : Audio_Buffer) is abstract; procedure Receive (This : in out Audio_Stream; Data : out Audio_Buffer) is abstract; end HAL.Audio;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- SQL Database Access -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2013, 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 package is low level bindings to SQLite3 library. ------------------------------------------------------------------------------ with Interfaces.C; with Matreshka.Internals.Strings.C; with Matreshka.Internals.Utf16; package Matreshka.Internals.SQL_Drivers.SQLite3 is pragma Preelaborate; ---------------- -- Data types -- ---------------- type sqlite3 is limited private; type sqlite3_Access is access all sqlite3; pragma Convention (C, sqlite3_Access); type sqlite3_stmt is limited private; type sqlite3_stmt_Access is access all sqlite3_stmt; pragma Convention (C, sqlite3_stmt_Access); type Utf16_Code_Unit_Access_Destructor is access procedure (Text : Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access); pragma Convention (C, Utf16_Code_Unit_Access_Destructor); --------------- -- Constants -- --------------- SQLITE_OK : constant := 0; -- Successful result --#define SQLITE_ERROR 1 /* SQL error or missing database */ --#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */ --#define SQLITE_PERM 3 /* Access permission denied */ --#define SQLITE_ABORT 4 /* Callback routine requested an abort */ --#define SQLITE_BUSY 5 /* The database file is locked */ --#define SQLITE_LOCKED 6 /* A table in the database is locked */ --#define SQLITE_NOMEM 7 /* A malloc() failed */ --#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ --#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/ --#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ --#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ --#define SQLITE_NOTFOUND 12 /* Unknown opcode in sqlite3_file_control() */ --#define SQLITE_FULL 13 /* Insertion failed because database is full */ --#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ --#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ --#define SQLITE_EMPTY 16 /* Database is empty */ --#define SQLITE_SCHEMA 17 /* The database schema changed */ --#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ --#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */ --#define SQLITE_MISMATCH 20 /* Data type mismatch */ --#define SQLITE_MISUSE 21 /* Library used incorrectly */ --#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ --#define SQLITE_AUTH 23 /* Authorization denied */ --#define SQLITE_FORMAT 24 /* Auxiliary database format error */ --#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */ --#define SQLITE_NOTADB 26 /* File opened that is not a database file */ SQLITE_ROW : constant := 100; -- sqlite3_step() has another row -- ready SQLITE_DONE : constant := 101; -- sqlite3_step() has finished -- executing SQLITE_CONFIG_SINGLETHREAD : constant := 1; -- nil SQLITE_CONFIG_MULTITHREAD : constant := 2; -- nil SQLITE_CONFIG_SERIALIZED : constant := 3; -- nil --#define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */ --#define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */ --#define SQLITE_CONFIG_SCRATCH 6 /* void*, int sz, int N */ --#define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ --#define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ --#define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ --#define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ --#define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ --/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ --#define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ --#define SQLITE_CONFIG_PCACHE 14 /* sqlite3_pcache_methods* */ --#define SQLITE_CONFIG_GETPCACHE 15 /* sqlite3_pcache_methods* */ --#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ SQLITE_INTEGER : constant := 1; SQLITE_FLOAT : constant := 2; SQLITE_TEXT : constant := 3; SQLITE_BLOB : constant := 4; SQLITE_NULL : constant := 5; --------------- -- Functions -- --------------- function sqlite3_bind_double (Handle : sqlite3_stmt_Access; Index : Interfaces.C.int; Value : Interfaces.C.double) return Interfaces.C.int; pragma Import (C, sqlite3_bind_double); function sqlite3_bind_int64 (Handle : sqlite3_stmt_Access; Index : Interfaces.C.int; Value : Interfaces.Integer_64) return Interfaces.C.int; pragma Import (C, sqlite3_bind_int64); function sqlite3_bind_null (Handle : sqlite3_stmt_Access; Index : Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sqlite3_bind_null); function sqlite3_bind_parameter_count (Handle : sqlite3_stmt_Access) return Interfaces.C.int; pragma Import (C, sqlite3_bind_parameter_count); function sqlite3_bind_parameter_index (Handle : sqlite3_stmt_Access; Name : Interfaces.C.char_array) return Interfaces.C.int; pragma Import (C, sqlite3_bind_parameter_index); function sqlite3_bind_text16 (Handle : sqlite3_stmt_Access; Index : Interfaces.C.int; Text : Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access; nBytes : Interfaces.C.int; Destructor : Utf16_Code_Unit_Access_Destructor) return Interfaces.C.int; pragma Import (C, sqlite3_bind_text16); function sqlite3_close (Handle : sqlite3_Access) return Interfaces.C.int; pragma Import (C, sqlite3_close); function sqlite3_column_bytes16 (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sqlite3_column_bytes16); function sqlite3_column_double (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Interfaces.C.double; pragma Import (C, sqlite3_column_double); function sqlite3_column_int64 (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Interfaces.Integer_64; pragma Import (C, sqlite3_column_int64); function sqlite3_column_text16 (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access; pragma Import (C, sqlite3_column_text16); function sqlite3_column_type (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sqlite3_column_type); function sqlite3_config (Option : Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sqlite3_config); function sqlite3_errmsg16 (db : sqlite3_Access) return Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access; pragma Import (C, sqlite3_errmsg16); function sqlite3_finalize (Handle : sqlite3_stmt_Access) return Interfaces.C.int; pragma Import (C, sqlite3_finalize); function sqlite3_last_insert_rowid (Handle : sqlite3_Access) return Interfaces.Integer_64; pragma Import (C, sqlite3_last_insert_rowid); function sqlite3_open16 (File_Name : Matreshka.Internals.Utf16.Utf16_String; -- Handle : out sqlite3_Access) return Interfaces.C.int; Handle : not null access sqlite3_Access) return Interfaces.C.int; pragma Import (C, sqlite3_open16); function sqlite3_prepare16_v2 (db : sqlite3_Access; zSql : Matreshka.Internals.Utf16.Utf16_String; nByte : Interfaces.C.int; -- ppStmt : out sqlite3_stmt_Access; -- pzTail : out Utf16_Code_Unit_Access) return Interfaces.C.int; ppStmt : not null access sqlite3_stmt_Access; pzTail : not null access Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access) return Interfaces.C.int; pragma Import (C, sqlite3_prepare16_v2); function sqlite3_reset (pStmt : sqlite3_stmt_Access) return Interfaces.C.int; pragma Import (C, sqlite3_reset); function sqlite3_step (Handle : sqlite3_stmt_Access) return Interfaces.C.int; pragma Import (C, sqlite3_step); private type sqlite3 is limited null record; type sqlite3_stmt is limited null record; end Matreshka.Internals.SQL_Drivers.SQLite3;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P A R . C H 1 1 -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-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. -- -- -- ------------------------------------------------------------------------------ pragma Style_Checks (All_Checks); -- Turn off subprogram body ordering check. Subprograms are in order -- by RM section rather than alphabetical with Sinfo.CN; use Sinfo.CN; separate (Par) package body Ch11 is -- Local functions, used only in this chapter function P_Exception_Handler return Node_Id; function P_Exception_Choice return Node_Id; --------------------------------- -- 11.1 Exception Declaration -- --------------------------------- -- Parsed by P_Identifier_Declaration (3.3.1) ------------------------------------------ -- 11.2 Handled Sequence Of Statements -- ------------------------------------------ -- HANDLED_SEQUENCE_OF_STATEMENTS ::= -- SEQUENCE_OF_STATEMENTS -- [exception -- EXCEPTION_HANDLER -- {EXCEPTION_HANDLER}] -- Error_Recovery : Cannot raise Error_Resync function P_Handled_Sequence_Of_Statements return Node_Id is Handled_Stmt_Seq_Node : Node_Id; begin Handled_Stmt_Seq_Node := New_Node (N_Handled_Sequence_Of_Statements, Token_Ptr); Set_Statements (Handled_Stmt_Seq_Node, P_Sequence_Of_Statements (SS_Extm_Sreq)); if Token = Tok_Exception then Scan; -- past EXCEPTION Set_Exception_Handlers (Handled_Stmt_Seq_Node, Parse_Exception_Handlers); end if; return Handled_Stmt_Seq_Node; end P_Handled_Sequence_Of_Statements; ----------------------------- -- 11.2 Exception Handler -- ----------------------------- -- EXCEPTION_HANDLER ::= -- when [CHOICE_PARAMETER_SPECIFICATION :] -- EXCEPTION_CHOICE {| EXCEPTION_CHOICE} => -- SEQUENCE_OF_STATEMENTS -- CHOICE_PARAMETER_SPECIFICATION ::= DEFINING_IDENTIFIER -- Error recovery: cannot raise Error_Resync function P_Exception_Handler return Node_Id is Scan_State : Saved_Scan_State; Handler_Node : Node_Id; Choice_Param_Node : Node_Id; begin Handler_Node := New_Node (N_Exception_Handler, Token_Ptr); T_When; -- Test for possible choice parameter present if Token = Tok_Identifier then Choice_Param_Node := Token_Node; Save_Scan_State (Scan_State); -- at identifier Scan; -- past identifier if Token = Tok_Colon then if Ada_Version = Ada_83 then Error_Msg_SP ("(Ada 83) choice parameter not allowed!"); end if; Scan; -- past : Change_Identifier_To_Defining_Identifier (Choice_Param_Node); Set_Choice_Parameter (Handler_Node, Choice_Param_Node); elsif Token = Tok_Others then Error_Msg_AP ("missing "":"""); Change_Identifier_To_Defining_Identifier (Choice_Param_Node); Set_Choice_Parameter (Handler_Node, Choice_Param_Node); else Restore_Scan_State (Scan_State); -- to identifier end if; end if; -- Loop through exception choices Set_Exception_Choices (Handler_Node, New_List); loop Append (P_Exception_Choice, Exception_Choices (Handler_Node)); exit when Token /= Tok_Vertical_Bar; Scan; -- past vertical bar end loop; TF_Arrow; Set_Statements (Handler_Node, P_Sequence_Of_Statements (SS_Sreq_Whtm)); return Handler_Node; end P_Exception_Handler; ------------------------------------------ -- 11.2 Choice Parameter Specification -- ------------------------------------------ -- Parsed by P_Exception_Handler (11.2) ---------------------------- -- 11.2 Exception Choice -- ---------------------------- -- EXCEPTION_CHOICE ::= exception_NAME | others -- Error recovery: cannot raise Error_Resync. If an error occurs, then the -- scan pointer is advanced to the next arrow or vertical bar or semicolon. function P_Exception_Choice return Node_Id is begin if Token = Tok_Others then Scan; -- past OTHERS return New_Node (N_Others_Choice, Prev_Token_Ptr); else return P_Name; -- exception name end if; exception when Error_Resync => Resync_Choice; return Error; end P_Exception_Choice; --------------------------- -- 11.3 Raise Statement -- --------------------------- -- RAISE_STATEMENT ::= raise [exception_NAME]; -- The caller has verified that the initial token is RAISE -- Error recovery: can raise Error_Resync function P_Raise_Statement return Node_Id is Raise_Node : Node_Id; begin Raise_Node := New_Node (N_Raise_Statement, Token_Ptr); Scan; -- past RAISE if Token /= Tok_Semicolon then Set_Name (Raise_Node, P_Name); end if; if Token = Tok_With then if Ada_Version < Ada_05 then Error_Msg_SC ("string expression in raise is Ada 2005 extension"); Error_Msg_SC ("\unit must be compiled with -gnat05 switch"); end if; Scan; -- past WITH Set_Expression (Raise_Node, P_Expression); end if; TF_Semicolon; return Raise_Node; end P_Raise_Statement; ------------------------------ -- Parse_Exception_Handlers -- ------------------------------ -- This routine scans out a list of exception handlers appearing in a -- construct as: -- exception -- EXCEPTION_HANDLER {EXCEPTION_HANDLER} -- The caller has scanned out the EXCEPTION keyword -- Control returns after scanning the last exception handler, presumably -- at the keyword END, but this is not checked in this routine. -- Error recovery: cannot raise Error_Resync function Parse_Exception_Handlers return List_Id is Handler : Node_Id; Handlers_List : List_Id; begin Handlers_List := New_List; P_Pragmas_Opt (Handlers_List); if Token = Tok_End then Error_Msg_SC ("must have at least one exception handler!"); else loop Handler := P_Exception_Handler; Append (Handler, Handlers_List); -- Note: no need to check for pragmas here. Although the -- syntax officially allows them in this position, they -- will have been swallowed up as part of the statement -- sequence of the handler we just scanned out. exit when Token /= Tok_When; end loop; end if; return Handlers_List; end Parse_Exception_Handlers; end Ch11;
----------------------------------------------------------------------- -- AWA.Workspaces.Models -- AWA.Workspaces.Models ----------------------------------------------------------------------- -- File generated by ada-gen DO NOT MODIFY -- Template used: templates/model/package-body.xhtml -- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095 ----------------------------------------------------------------------- -- 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.Unchecked_Deallocation; with Util.Beans.Objects.Time; with ASF.Events.Faces.Actions; package body AWA.Workspaces.Models is use type ADO.Objects.Object_Record_Access; use type ADO.Objects.Object_Ref; pragma Warnings (Off, "formal parameter * is not referenced"); function Workspace_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => WORKSPACE_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Workspace_Key; function Workspace_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => WORKSPACE_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Workspace_Key; function "=" (Left, Right : Workspace_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Workspace_Ref'Class; Impl : out Workspace_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Workspace_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Workspace_Ref) is Impl : Workspace_Access; begin Impl := new Workspace_Impl; Impl.Version := 0; Impl.Create_Date := ADO.DEFAULT_TIME; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Workspace -- ---------------------------------------- procedure Set_Id (Object : in out Workspace_Ref; Value : in ADO.Identifier) is Impl : Workspace_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value); end Set_Id; function Get_Id (Object : in Workspace_Ref) return ADO.Identifier is Impl : constant Workspace_Access := Workspace_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_Id; function Get_Version (Object : in Workspace_Ref) return Integer is Impl : constant Workspace_Access := Workspace_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Version; end Get_Version; procedure Set_Create_Date (Object : in out Workspace_Ref; Value : in Ada.Calendar.Time) is Impl : Workspace_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Time (Impl.all, 3, Impl.Create_Date, Value); end Set_Create_Date; function Get_Create_Date (Object : in Workspace_Ref) return Ada.Calendar.Time is Impl : constant Workspace_Access := Workspace_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Create_Date; end Get_Create_Date; procedure Set_Owner (Object : in out Workspace_Ref; Value : in AWA.Users.Models.User_Ref'Class) is Impl : Workspace_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 4, Impl.Owner, Value); end Set_Owner; function Get_Owner (Object : in Workspace_Ref) return AWA.Users.Models.User_Ref'Class is Impl : constant Workspace_Access := Workspace_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Owner; end Get_Owner; -- Copy of the object. procedure Copy (Object : in Workspace_Ref; Into : in out Workspace_Ref) is Result : Workspace_Ref; begin if not Object.Is_Null then declare Impl : constant Workspace_Access := Workspace_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Workspace_Access := new Workspace_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Version := Impl.Version; Copy.Create_Date := Impl.Create_Date; Copy.Owner := Impl.Owner; end; end if; Into := Result; end Copy; procedure Find (Object : in out Workspace_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Workspace_Access := new Workspace_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Workspace_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Workspace_Access := new Workspace_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Workspace_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Workspace_Access := new Workspace_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Workspace_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Workspace_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Workspace_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Workspace_Impl) is type Workspace_Impl_Ptr is access all Workspace_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Workspace_Impl, Workspace_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Workspace_Impl_Ptr := Workspace_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Workspace_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, WORKSPACE_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Workspace_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Workspace_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (WORKSPACE_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_1_NAME, -- id Value => Object.Get_Key); Object.Clear_Modified (1); end if; if Object.Is_Modified (3) then Stmt.Save_Field (Name => COL_2_1_NAME, -- create_date Value => Object.Create_Date); Object.Clear_Modified (3); end if; if Object.Is_Modified (4) then Stmt.Save_Field (Name => COL_3_1_NAME, -- owner_id Value => Object.Owner); Object.Clear_Modified (4); end if; if Stmt.Has_Save_Fields then Object.Version := Object.Version + 1; Stmt.Save_Field (Name => "version", Value => Object.Version); Stmt.Set_Filter (Filter => "id = ? and version = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Add_Param (Value => Object.Version - 1); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; else raise ADO.Objects.LAZY_LOCK; end if; end if; end; end if; end Save; procedure Create (Object : in out Workspace_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (WORKSPACE_DEF'Access); Result : Integer; begin Object.Version := 1; Session.Allocate (Id => Object); Query.Save_Field (Name => COL_0_1_NAME, -- id Value => Object.Get_Key); Query.Save_Field (Name => COL_1_1_NAME, -- version Value => Object.Version); Query.Save_Field (Name => COL_2_1_NAME, -- create_date Value => Object.Create_Date); Query.Save_Field (Name => COL_3_1_NAME, -- owner_id Value => Object.Owner); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Workspace_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (WORKSPACE_DEF'Access); begin Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Workspace_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Workspace_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Workspace_Impl (Obj.all)'Access; if Name = "id" then return ADO.Objects.To_Object (Impl.Get_Key); elsif Name = "create_date" then return Util.Beans.Objects.Time.To_Object (Impl.Create_Date); end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Workspace_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Set_Key_Value (Stmt.Get_Identifier (0)); Object.Create_Date := Stmt.Get_Time (2); if not Stmt.Is_Null (3) then Object.Owner.Set_Key_Value (Stmt.Get_Identifier (3), Session); end if; Object.Version := Stmt.Get_Integer (1); ADO.Objects.Set_Created (Object); end Load; function Workspace_Member_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => WORKSPACE_MEMBER_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Workspace_Member_Key; function Workspace_Member_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => WORKSPACE_MEMBER_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Workspace_Member_Key; function "=" (Left, Right : Workspace_Member_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Workspace_Member_Ref'Class; Impl : out Workspace_Member_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Workspace_Member_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Workspace_Member_Ref) is Impl : Workspace_Member_Access; begin Impl := new Workspace_Member_Impl; Impl.Join_Date.Is_Null := True; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Workspace_Member -- ---------------------------------------- procedure Set_Id (Object : in out Workspace_Member_Ref; Value : in ADO.Identifier) is Impl : Workspace_Member_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value); end Set_Id; function Get_Id (Object : in Workspace_Member_Ref) return ADO.Identifier is Impl : constant Workspace_Member_Access := Workspace_Member_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_Id; procedure Set_Join_Date (Object : in out Workspace_Member_Ref; Value : in ADO.Nullable_Time) is Impl : Workspace_Member_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Time (Impl.all, 2, Impl.Join_Date, Value); end Set_Join_Date; function Get_Join_Date (Object : in Workspace_Member_Ref) return ADO.Nullable_Time is Impl : constant Workspace_Member_Access := Workspace_Member_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Join_Date; end Get_Join_Date; procedure Set_Role (Object : in out Workspace_Member_Ref; Value : in String) is Impl : Workspace_Member_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Role, Value); end Set_Role; procedure Set_Role (Object : in out Workspace_Member_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Workspace_Member_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Role, Value); end Set_Role; function Get_Role (Object : in Workspace_Member_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Role); end Get_Role; function Get_Role (Object : in Workspace_Member_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Workspace_Member_Access := Workspace_Member_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Role; end Get_Role; procedure Set_Member (Object : in out Workspace_Member_Ref; Value : in AWA.Users.Models.User_Ref'Class) is Impl : Workspace_Member_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 4, Impl.Member, Value); end Set_Member; function Get_Member (Object : in Workspace_Member_Ref) return AWA.Users.Models.User_Ref'Class is Impl : constant Workspace_Member_Access := Workspace_Member_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Member; end Get_Member; procedure Set_Workspace (Object : in out Workspace_Member_Ref; Value : in AWA.Workspaces.Models.Workspace_Ref'Class) is Impl : Workspace_Member_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 5, Impl.Workspace, Value); end Set_Workspace; function Get_Workspace (Object : in Workspace_Member_Ref) return AWA.Workspaces.Models.Workspace_Ref'Class is Impl : constant Workspace_Member_Access := Workspace_Member_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Workspace; end Get_Workspace; -- Copy of the object. procedure Copy (Object : in Workspace_Member_Ref; Into : in out Workspace_Member_Ref) is Result : Workspace_Member_Ref; begin if not Object.Is_Null then declare Impl : constant Workspace_Member_Access := Workspace_Member_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Workspace_Member_Access := new Workspace_Member_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Join_Date := Impl.Join_Date; Copy.Role := Impl.Role; Copy.Member := Impl.Member; Copy.Workspace := Impl.Workspace; end; end if; Into := Result; end Copy; procedure Find (Object : in out Workspace_Member_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Workspace_Member_Access := new Workspace_Member_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Workspace_Member_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Workspace_Member_Access := new Workspace_Member_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Workspace_Member_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Workspace_Member_Access := new Workspace_Member_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Workspace_Member_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Workspace_Member_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Workspace_Member_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Workspace_Member_Impl) is type Workspace_Member_Impl_Ptr is access all Workspace_Member_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Workspace_Member_Impl, Workspace_Member_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Workspace_Member_Impl_Ptr := Workspace_Member_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Workspace_Member_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, WORKSPACE_MEMBER_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Workspace_Member_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Workspace_Member_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (WORKSPACE_MEMBER_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_2_NAME, -- id Value => Object.Get_Key); Object.Clear_Modified (1); end if; if Object.Is_Modified (2) then Stmt.Save_Field (Name => COL_1_2_NAME, -- join_date Value => Object.Join_Date); Object.Clear_Modified (2); end if; if Object.Is_Modified (3) then Stmt.Save_Field (Name => COL_2_2_NAME, -- role Value => Object.Role); Object.Clear_Modified (3); end if; if Object.Is_Modified (4) then Stmt.Save_Field (Name => COL_3_2_NAME, -- member_id Value => Object.Member); Object.Clear_Modified (4); end if; if Object.Is_Modified (5) then Stmt.Save_Field (Name => COL_4_2_NAME, -- workspace_id Value => Object.Workspace); Object.Clear_Modified (5); end if; if Stmt.Has_Save_Fields then Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; end if; end if; end; end if; end Save; procedure Create (Object : in out Workspace_Member_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (WORKSPACE_MEMBER_DEF'Access); Result : Integer; begin Session.Allocate (Id => Object); Query.Save_Field (Name => COL_0_2_NAME, -- id Value => Object.Get_Key); Query.Save_Field (Name => COL_1_2_NAME, -- join_date Value => Object.Join_Date); Query.Save_Field (Name => COL_2_2_NAME, -- role Value => Object.Role); Query.Save_Field (Name => COL_3_2_NAME, -- member_id Value => Object.Member); Query.Save_Field (Name => COL_4_2_NAME, -- workspace_id Value => Object.Workspace); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Workspace_Member_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (WORKSPACE_MEMBER_DEF'Access); begin Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Workspace_Member_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Workspace_Member_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Workspace_Member_Impl (Obj.all)'Access; if Name = "id" then return ADO.Objects.To_Object (Impl.Get_Key); elsif Name = "join_date" then if Impl.Join_Date.Is_Null then return Util.Beans.Objects.Null_Object; else return Util.Beans.Objects.Time.To_Object (Impl.Join_Date.Value); end if; elsif Name = "role" then return Util.Beans.Objects.To_Object (Impl.Role); end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Workspace_Member_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Set_Key_Value (Stmt.Get_Identifier (0)); Object.Join_Date := Stmt.Get_Nullable_Time (1); Object.Role := Stmt.Get_Unbounded_String (2); if not Stmt.Is_Null (3) then Object.Member.Set_Key_Value (Stmt.Get_Identifier (3), Session); end if; if not Stmt.Is_Null (4) then Object.Workspace.Set_Key_Value (Stmt.Get_Identifier (4), Session); end if; ADO.Objects.Set_Created (Object); end Load; function Invitation_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => INVITATION_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Invitation_Key; function Invitation_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => INVITATION_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Invitation_Key; function "=" (Left, Right : Invitation_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Invitation_Ref'Class; Impl : out Invitation_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Invitation_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Invitation_Ref) is Impl : Invitation_Access; begin Impl := new Invitation_Impl; Impl.Version := 0; Impl.Create_Date := ADO.DEFAULT_TIME; Impl.Acceptance_Date.Is_Null := True; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Invitation -- ---------------------------------------- procedure Set_Id (Object : in out Invitation_Ref; Value : in ADO.Identifier) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value); end Set_Id; function Get_Id (Object : in Invitation_Ref) return ADO.Identifier is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_Id; function Get_Version (Object : in Invitation_Ref) return Integer is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Version; end Get_Version; procedure Set_Create_Date (Object : in out Invitation_Ref; Value : in Ada.Calendar.Time) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Time (Impl.all, 3, Impl.Create_Date, Value); end Set_Create_Date; function Get_Create_Date (Object : in Invitation_Ref) return Ada.Calendar.Time is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Create_Date; end Get_Create_Date; procedure Set_Email (Object : in out Invitation_Ref; Value : in String) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 4, Impl.Email, Value); end Set_Email; procedure Set_Email (Object : in out Invitation_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 4, Impl.Email, Value); end Set_Email; function Get_Email (Object : in Invitation_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Email); end Get_Email; function Get_Email (Object : in Invitation_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Email; end Get_Email; procedure Set_Message (Object : in out Invitation_Ref; Value : in String) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_String (Impl.all, 5, Impl.Message, Value); end Set_Message; procedure Set_Message (Object : in out Invitation_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Unbounded_String (Impl.all, 5, Impl.Message, Value); end Set_Message; function Get_Message (Object : in Invitation_Ref) return String is begin return Ada.Strings.Unbounded.To_String (Object.Get_Message); end Get_Message; function Get_Message (Object : in Invitation_Ref) return Ada.Strings.Unbounded.Unbounded_String is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Message; end Get_Message; procedure Set_Acceptance_Date (Object : in out Invitation_Ref; Value : in ADO.Nullable_Time) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Time (Impl.all, 6, Impl.Acceptance_Date, Value); end Set_Acceptance_Date; function Get_Acceptance_Date (Object : in Invitation_Ref) return ADO.Nullable_Time is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Acceptance_Date; end Get_Acceptance_Date; procedure Set_Workspace (Object : in out Invitation_Ref; Value : in AWA.Workspaces.Models.Workspace_Ref'Class) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 7, Impl.Workspace, Value); end Set_Workspace; function Get_Workspace (Object : in Invitation_Ref) return AWA.Workspaces.Models.Workspace_Ref'Class is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Workspace; end Get_Workspace; procedure Set_Access_Key (Object : in out Invitation_Ref; Value : in AWA.Users.Models.Access_Key_Ref'Class) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 8, Impl.Access_Key, Value); end Set_Access_Key; function Get_Access_Key (Object : in Invitation_Ref) return AWA.Users.Models.Access_Key_Ref'Class is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Access_Key; end Get_Access_Key; procedure Set_Invitee (Object : in out Invitation_Ref; Value : in AWA.Users.Models.User_Ref'Class) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 9, Impl.Invitee, Value); end Set_Invitee; function Get_Invitee (Object : in Invitation_Ref) return AWA.Users.Models.User_Ref'Class is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Invitee; end Get_Invitee; procedure Set_Inviter (Object : in out Invitation_Ref; Value : in AWA.Users.Models.User_Ref'Class) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 10, Impl.Inviter, Value); end Set_Inviter; function Get_Inviter (Object : in Invitation_Ref) return AWA.Users.Models.User_Ref'Class is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Inviter; end Get_Inviter; procedure Set_Member (Object : in out Invitation_Ref; Value : in AWA.Workspaces.Models.Workspace_Member_Ref'Class) is Impl : Invitation_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 11, Impl.Member, Value); end Set_Member; function Get_Member (Object : in Invitation_Ref) return AWA.Workspaces.Models.Workspace_Member_Ref'Class is Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Member; end Get_Member; -- Copy of the object. procedure Copy (Object : in Invitation_Ref; Into : in out Invitation_Ref) is Result : Invitation_Ref; begin if not Object.Is_Null then declare Impl : constant Invitation_Access := Invitation_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Invitation_Access := new Invitation_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Version := Impl.Version; Copy.Create_Date := Impl.Create_Date; Copy.Email := Impl.Email; Copy.Message := Impl.Message; Copy.Acceptance_Date := Impl.Acceptance_Date; Copy.Workspace := Impl.Workspace; Copy.Access_Key := Impl.Access_Key; Copy.Invitee := Impl.Invitee; Copy.Inviter := Impl.Inviter; Copy.Member := Impl.Member; end; end if; Into := Result; end Copy; procedure Find (Object : in out Invitation_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Invitation_Access := new Invitation_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Invitation_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Invitation_Access := new Invitation_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Invitation_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Invitation_Access := new Invitation_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Invitation_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Invitation_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Invitation_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Invitation_Impl) is type Invitation_Impl_Ptr is access all Invitation_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Invitation_Impl, Invitation_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Invitation_Impl_Ptr := Invitation_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Invitation_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, INVITATION_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Invitation_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Invitation_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (INVITATION_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_3_NAME, -- id Value => Object.Get_Key); Object.Clear_Modified (1); end if; if Object.Is_Modified (3) then Stmt.Save_Field (Name => COL_2_3_NAME, -- create_date Value => Object.Create_Date); Object.Clear_Modified (3); end if; if Object.Is_Modified (4) then Stmt.Save_Field (Name => COL_3_3_NAME, -- email Value => Object.Email); Object.Clear_Modified (4); end if; if Object.Is_Modified (5) then Stmt.Save_Field (Name => COL_4_3_NAME, -- message Value => Object.Message); Object.Clear_Modified (5); end if; if Object.Is_Modified (6) then Stmt.Save_Field (Name => COL_5_3_NAME, -- acceptance_date Value => Object.Acceptance_Date); Object.Clear_Modified (6); end if; if Object.Is_Modified (7) then Stmt.Save_Field (Name => COL_6_3_NAME, -- workspace_id Value => Object.Workspace); Object.Clear_Modified (7); end if; if Object.Is_Modified (8) then Stmt.Save_Field (Name => COL_7_3_NAME, -- access_key_id Value => Object.Access_Key); Object.Clear_Modified (8); end if; if Object.Is_Modified (9) then Stmt.Save_Field (Name => COL_8_3_NAME, -- invitee_id Value => Object.Invitee); Object.Clear_Modified (9); end if; if Object.Is_Modified (10) then Stmt.Save_Field (Name => COL_9_3_NAME, -- inviter_id Value => Object.Inviter); Object.Clear_Modified (10); end if; if Object.Is_Modified (11) then Stmt.Save_Field (Name => COL_10_3_NAME, -- member_id Value => Object.Member); Object.Clear_Modified (11); end if; if Stmt.Has_Save_Fields then Object.Version := Object.Version + 1; Stmt.Save_Field (Name => "version", Value => Object.Version); Stmt.Set_Filter (Filter => "id = ? and version = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Add_Param (Value => Object.Version - 1); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; else raise ADO.Objects.LAZY_LOCK; end if; end if; end; end if; end Save; procedure Create (Object : in out Invitation_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (INVITATION_DEF'Access); Result : Integer; begin Object.Version := 1; Session.Allocate (Id => Object); Query.Save_Field (Name => COL_0_3_NAME, -- id Value => Object.Get_Key); Query.Save_Field (Name => COL_1_3_NAME, -- version Value => Object.Version); Query.Save_Field (Name => COL_2_3_NAME, -- create_date Value => Object.Create_Date); Query.Save_Field (Name => COL_3_3_NAME, -- email Value => Object.Email); Query.Save_Field (Name => COL_4_3_NAME, -- message Value => Object.Message); Query.Save_Field (Name => COL_5_3_NAME, -- acceptance_date Value => Object.Acceptance_Date); Query.Save_Field (Name => COL_6_3_NAME, -- workspace_id Value => Object.Workspace); Query.Save_Field (Name => COL_7_3_NAME, -- access_key_id Value => Object.Access_Key); Query.Save_Field (Name => COL_8_3_NAME, -- invitee_id Value => Object.Invitee); Query.Save_Field (Name => COL_9_3_NAME, -- inviter_id Value => Object.Inviter); Query.Save_Field (Name => COL_10_3_NAME, -- member_id Value => Object.Member); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Invitation_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (INVITATION_DEF'Access); begin Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Invitation_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Invitation_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Invitation_Impl (Obj.all)'Access; if Name = "id" then return ADO.Objects.To_Object (Impl.Get_Key); elsif Name = "create_date" then return Util.Beans.Objects.Time.To_Object (Impl.Create_Date); elsif Name = "email" then return Util.Beans.Objects.To_Object (Impl.Email); elsif Name = "message" then return Util.Beans.Objects.To_Object (Impl.Message); elsif Name = "acceptance_date" then if Impl.Acceptance_Date.Is_Null then return Util.Beans.Objects.Null_Object; else return Util.Beans.Objects.Time.To_Object (Impl.Acceptance_Date.Value); end if; end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Invitation_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Set_Key_Value (Stmt.Get_Identifier (0)); Object.Create_Date := Stmt.Get_Time (2); Object.Email := Stmt.Get_Unbounded_String (3); Object.Message := Stmt.Get_Unbounded_String (4); Object.Acceptance_Date := Stmt.Get_Nullable_Time (5); if not Stmt.Is_Null (6) then Object.Workspace.Set_Key_Value (Stmt.Get_Identifier (6), Session); end if; if not Stmt.Is_Null (7) then Object.Access_Key.Set_Key_Value (Stmt.Get_Identifier (7), Session); end if; if not Stmt.Is_Null (8) then Object.Invitee.Set_Key_Value (Stmt.Get_Identifier (8), Session); end if; if not Stmt.Is_Null (9) then Object.Inviter.Set_Key_Value (Stmt.Get_Identifier (9), Session); end if; if not Stmt.Is_Null (10) then Object.Member.Set_Key_Value (Stmt.Get_Identifier (10), Session); end if; Object.Version := Stmt.Get_Integer (1); ADO.Objects.Set_Created (Object); end Load; function Workspace_Feature_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => WORKSPACE_FEATURE_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Workspace_Feature_Key; function Workspace_Feature_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => WORKSPACE_FEATURE_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Workspace_Feature_Key; function "=" (Left, Right : Workspace_Feature_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Workspace_Feature_Ref'Class; Impl : out Workspace_Feature_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Workspace_Feature_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Workspace_Feature_Ref) is Impl : Workspace_Feature_Access; begin Impl := new Workspace_Feature_Impl; Impl.Limit := 0; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Workspace_Feature -- ---------------------------------------- procedure Set_Id (Object : in out Workspace_Feature_Ref; Value : in ADO.Identifier) is Impl : Workspace_Feature_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value); end Set_Id; function Get_Id (Object : in Workspace_Feature_Ref) return ADO.Identifier is Impl : constant Workspace_Feature_Access := Workspace_Feature_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_Id; procedure Set_Limit (Object : in out Workspace_Feature_Ref; Value : in Integer) is Impl : Workspace_Feature_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Integer (Impl.all, 2, Impl.Limit, Value); end Set_Limit; function Get_Limit (Object : in Workspace_Feature_Ref) return Integer is Impl : constant Workspace_Feature_Access := Workspace_Feature_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Limit; end Get_Limit; procedure Set_Workspace (Object : in out Workspace_Feature_Ref; Value : in AWA.Workspaces.Models.Workspace_Ref'Class) is Impl : Workspace_Feature_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 3, Impl.Workspace, Value); end Set_Workspace; function Get_Workspace (Object : in Workspace_Feature_Ref) return AWA.Workspaces.Models.Workspace_Ref'Class is Impl : constant Workspace_Feature_Access := Workspace_Feature_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Workspace; end Get_Workspace; -- Copy of the object. procedure Copy (Object : in Workspace_Feature_Ref; Into : in out Workspace_Feature_Ref) is Result : Workspace_Feature_Ref; begin if not Object.Is_Null then declare Impl : constant Workspace_Feature_Access := Workspace_Feature_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Workspace_Feature_Access := new Workspace_Feature_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Limit := Impl.Limit; Copy.Workspace := Impl.Workspace; end; end if; Into := Result; end Copy; procedure Find (Object : in out Workspace_Feature_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Workspace_Feature_Access := new Workspace_Feature_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Workspace_Feature_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Workspace_Feature_Access := new Workspace_Feature_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Workspace_Feature_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Workspace_Feature_Access := new Workspace_Feature_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Workspace_Feature_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Workspace_Feature_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Workspace_Feature_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Workspace_Feature_Impl) is type Workspace_Feature_Impl_Ptr is access all Workspace_Feature_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Workspace_Feature_Impl, Workspace_Feature_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Workspace_Feature_Impl_Ptr := Workspace_Feature_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Workspace_Feature_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, WORKSPACE_FEATURE_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Workspace_Feature_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Workspace_Feature_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (WORKSPACE_FEATURE_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_4_NAME, -- id Value => Object.Get_Key); Object.Clear_Modified (1); end if; if Object.Is_Modified (2) then Stmt.Save_Field (Name => COL_1_4_NAME, -- limit Value => Object.Limit); Object.Clear_Modified (2); end if; if Object.Is_Modified (3) then Stmt.Save_Field (Name => COL_2_4_NAME, -- workspace_id Value => Object.Workspace); Object.Clear_Modified (3); end if; if Stmt.Has_Save_Fields then Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; end if; end if; end; end if; end Save; procedure Create (Object : in out Workspace_Feature_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (WORKSPACE_FEATURE_DEF'Access); Result : Integer; begin Session.Allocate (Id => Object); Query.Save_Field (Name => COL_0_4_NAME, -- id Value => Object.Get_Key); Query.Save_Field (Name => COL_1_4_NAME, -- limit Value => Object.Limit); Query.Save_Field (Name => COL_2_4_NAME, -- workspace_id Value => Object.Workspace); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Workspace_Feature_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (WORKSPACE_FEATURE_DEF'Access); begin Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Workspace_Feature_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Workspace_Feature_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Workspace_Feature_Impl (Obj.all)'Access; if Name = "id" then return ADO.Objects.To_Object (Impl.Get_Key); elsif Name = "limit" then return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Limit)); end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Workspace_Feature_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Set_Key_Value (Stmt.Get_Identifier (0)); Object.Limit := Stmt.Get_Integer (1); if not Stmt.Is_Null (2) then Object.Workspace.Set_Key_Value (Stmt.Get_Identifier (2), Session); end if; ADO.Objects.Set_Created (Object); end Load; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Member_Info; Name : in String) return Util.Beans.Objects.Object is begin if Name = "id" then return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id)); elsif Name = "user_id" then return Util.Beans.Objects.To_Object (Long_Long_Integer (From.User_Id)); elsif Name = "name" then return Util.Beans.Objects.To_Object (From.Name); elsif Name = "email" then return Util.Beans.Objects.To_Object (From.Email); elsif Name = "role" then return Util.Beans.Objects.To_Object (From.Role); elsif Name = "join_date" then if From.Join_Date.Is_Null then return Util.Beans.Objects.Null_Object; else return Util.Beans.Objects.Time.To_Object (From.Join_Date.Value); end if; elsif Name = "invite_date" then if From.Invite_Date.Is_Null then return Util.Beans.Objects.Null_Object; else return Util.Beans.Objects.Time.To_Object (From.Invite_Date.Value); end if; end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Set the value identified by the name -- ------------------------------ overriding procedure Set_Value (Item : in out Member_Info; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "id" then Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value)); elsif Name = "user_id" then Item.User_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value)); elsif Name = "name" then Item.Name := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "email" then Item.Email := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "role" then Item.Role := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "join_date" then Item.Join_Date.Is_Null := Util.Beans.Objects.Is_Null (Value); if not Item.Join_Date.Is_Null then Item.Join_Date.Value := Util.Beans.Objects.Time.To_Time (Value); end if; elsif Name = "invite_date" then Item.Invite_Date.Is_Null := Util.Beans.Objects.Is_Null (Value); if not Item.Invite_Date.Is_Null then Item.Invite_Date.Value := Util.Beans.Objects.Time.To_Time (Value); end if; end if; end Set_Value; -- -------------------- -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. -- -------------------- procedure List (Object : in out Member_Info_List_Bean'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class) is begin List (Object.List, Session, Context); end List; -- -------------------- -- The Member_Info describes a member of the workspace. -- -------------------- procedure List (Object : in out Member_Info_Vector; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class) is procedure Read (Into : in out Member_Info); Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Context); Pos : Positive := 1; procedure Read (Into : in out Member_Info) is begin Into.Id := Stmt.Get_Identifier (0); Into.User_Id := Stmt.Get_Identifier (1); Into.Name := Stmt.Get_Unbounded_String (2); Into.Email := Stmt.Get_Unbounded_String (3); Into.Role := Stmt.Get_Unbounded_String (4); Into.Join_Date := Stmt.Get_Nullable_Time (5); Into.Invite_Date := Stmt.Get_Nullable_Time (6); end Read; begin Stmt.Execute; Member_Info_Vectors.Clear (Object); while Stmt.Has_Elements loop Object.Insert_Space (Before => Pos); Object.Update_Element (Index => Pos, Process => Read'Access); Pos := Pos + 1; Stmt.Next; end loop; end List; procedure Op_Load (Bean : in out Invitation_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Load (Bean : in out Invitation_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Invitation_Bean'Class (Bean).Load (Outcome); end Op_Load; package Binding_Invitation_Bean_1 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Invitation_Bean, Method => Op_Load, Name => "load"); procedure Op_Accept_Invitation (Bean : in out Invitation_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Accept_Invitation (Bean : in out Invitation_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Invitation_Bean'Class (Bean).Accept_Invitation (Outcome); end Op_Accept_Invitation; package Binding_Invitation_Bean_2 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Invitation_Bean, Method => Op_Accept_Invitation, Name => "accept_invitation"); procedure Op_Send (Bean : in out Invitation_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Send (Bean : in out Invitation_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Invitation_Bean'Class (Bean).Send (Outcome); end Op_Send; package Binding_Invitation_Bean_3 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Invitation_Bean, Method => Op_Send, Name => "send"); Binding_Invitation_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array := (1 => Binding_Invitation_Bean_1.Proxy'Access, 2 => Binding_Invitation_Bean_2.Proxy'Access, 3 => Binding_Invitation_Bean_3.Proxy'Access ); -- ------------------------------ -- This bean provides some methods that can be used in a Method_Expression. -- ------------------------------ overriding function Get_Method_Bindings (From : in Invitation_Bean) return Util.Beans.Methods.Method_Binding_Array_Access is pragma Unreferenced (From); begin return Binding_Invitation_Bean_Array'Access; end Get_Method_Bindings; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Invitation_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "key" then return Util.Beans.Objects.To_Object (From.Key); end if; return Awa.Workspaces.Models.Invitation_Ref (From).Get_Value (Name); end Get_Value; -- ------------------------------ -- Set the value identified by the name -- ------------------------------ overriding procedure Set_Value (Item : in out Invitation_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "key" then Item.Key := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "create_date" then Item.Set_Create_Date (Util.Beans.Objects.Time.To_Time (Value)); elsif Name = "email" then Item.Set_Email (Util.Beans.Objects.To_String (Value)); elsif Name = "message" then Item.Set_Message (Util.Beans.Objects.To_String (Value)); elsif Name = "acceptance_date" then if Util.Beans.Objects.Is_Null (Value) then Item.Set_Acceptance_Date (ADO.Nullable_Time '(Is_Null => True, others => <>)); else Item.Set_Acceptance_Date (ADO.Nullable_Time '(Is_Null => False, Value => Util.Beans.Objects.Time.To_Time (Value))); end if; end if; end Set_Value; procedure Op_Load (Bean : in out Member_List_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Load (Bean : in out Member_List_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Member_List_Bean'Class (Bean).Load (Outcome); end Op_Load; package Binding_Member_List_Bean_1 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Member_List_Bean, Method => Op_Load, Name => "load"); Binding_Member_List_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array := (1 => Binding_Member_List_Bean_1.Proxy'Access ); -- ------------------------------ -- This bean provides some methods that can be used in a Method_Expression. -- ------------------------------ overriding function Get_Method_Bindings (From : in Member_List_Bean) return Util.Beans.Methods.Method_Binding_Array_Access is pragma Unreferenced (From); begin return Binding_Member_List_Bean_Array'Access; end Get_Method_Bindings; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Member_List_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "page_size" then return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Size)); elsif Name = "count" then return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Count)); elsif Name = "page" then return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page)); end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Set the value identified by the name -- ------------------------------ overriding procedure Set_Value (Item : in out Member_List_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "page_size" then Item.Page_Size := Util.Beans.Objects.To_Integer (Value); elsif Name = "count" then Item.Count := Util.Beans.Objects.To_Integer (Value); elsif Name = "page" then Item.Page := Util.Beans.Objects.To_Integer (Value); end if; end Set_Value; procedure Op_Load (Bean : in out Member_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Load (Bean : in out Member_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Member_Bean'Class (Bean).Load (Outcome); end Op_Load; package Binding_Member_Bean_1 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Member_Bean, Method => Op_Load, Name => "load"); procedure Op_Delete (Bean : in out Member_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Delete (Bean : in out Member_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Member_Bean'Class (Bean).Delete (Outcome); end Op_Delete; package Binding_Member_Bean_2 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Member_Bean, Method => Op_Delete, Name => "delete"); Binding_Member_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array := (1 => Binding_Member_Bean_1.Proxy'Access, 2 => Binding_Member_Bean_2.Proxy'Access ); -- ------------------------------ -- This bean provides some methods that can be used in a Method_Expression. -- ------------------------------ overriding function Get_Method_Bindings (From : in Member_Bean) return Util.Beans.Methods.Method_Binding_Array_Access is pragma Unreferenced (From); begin return Binding_Member_Bean_Array'Access; end Get_Method_Bindings; -- ------------------------------ -- Set the value identified by the name -- ------------------------------ overriding procedure Set_Value (Item : in out Member_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "join_date" then if Util.Beans.Objects.Is_Null (Value) then Item.Set_Join_Date (ADO.Nullable_Time '(Is_Null => True, others => <>)); else Item.Set_Join_Date (ADO.Nullable_Time '(Is_Null => False, Value => Util.Beans.Objects.Time.To_Time (Value))); end if; elsif Name = "role" then Item.Set_Role (Util.Beans.Objects.To_String (Value)); end if; end Set_Value; end AWA.Workspaces.Models;
-- C35502P.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. --* -- OBJECTIVE: -- FOR AN ENUMERATION TYPE OTHER THAN BOOLEAN OR CHARACTER TYPE, -- CHECK THAT THE RESULTS AND TYPE PRODUCED BY THE ATTRIBUTES -- ARE CORRECT. -- CHECK THAT 'FIRST AND 'LAST YIELD CORRECT RESULTS WHEN THE -- PREFIX DENOTES A NULL SUBTYPE. -- HISTORY: -- RJW 05/05/86 CREATED ORIGINAL TEST. -- CJJ 06/09/87 CHANGED "=" COMPARISONS IN GENERIC -- PROCEDURE Q TO "/=". WITH REPORT; USE REPORT; PROCEDURE C35502P IS BEGIN TEST( "C35502P" , "CHECK THAT THE ATTRIBUTES 'FIRST' AND " & "'LAST' YIELD THE CORRECT RESULTS WHEN THE " & "PREFIX IS A GENERIC FORMAL DISCRETE TYPE " & "WHOSE ACTUAL PARAMETER IS AN ENUMERATION " & "TYPE OTHER THAN A CHARACTER OR A BOOLEAN " & "TYPE" ); DECLARE -- FOR THESE DECLARATIONS, 'FIRST AND 'LAST REFER TO THE -- SUBTYPE VALUES, BUT 'VAL AND 'POS ARE INHERITED FROM THE -- BASE TYPE. TYPE ENUM IS (A, BC, ABC, A_B_C, ABCD); SUBTYPE SUBENUM IS ENUM RANGE A .. ABC; TYPE NEWENUM IS NEW ENUM RANGE BC .. A_B_C; TYPE NONEWENUM IS NEW ENUM RANGE ABCD .. A; GENERIC TYPE E IS (<>); F, L : E; PROCEDURE P (STR : STRING); PROCEDURE P (STR : STRING) IS SUBTYPE NOENUM IS E RANGE E'VAL (IDENT_INT(2)) .. E'VAL (IDENT_INT(1)); BEGIN IF E'FIRST /= F THEN FAILED ( "INCORRECT E'FIRST FOR " & STR ); END IF; IF NOENUM'FIRST /= E'VAL (2) THEN FAILED ( "INCORRECT NOENUM'FIRST FOR " & STR ); END IF; IF E'LAST /= L THEN FAILED ( "INCORRECT E'LAST FOR " & STR ); END IF; IF NOENUM'LAST /= E'VAL (1) THEN FAILED ( "INCORRECT NOENUM'LAST FOR " & STR ); END IF; END P; GENERIC TYPE E IS (<>); PROCEDURE Q; PROCEDURE Q IS SUBTYPE NOENUM IS E RANGE E'VAL (IDENT_INT(2)) .. E'VAL (IDENT_INT(1)); BEGIN IF E'FIRST /= E'VAL (IDENT_INT(4)) THEN FAILED ( "INCORRECT E'FIRST FOR NONEWENUM" ); END IF; IF NOENUM'FIRST /= E'VAL (2) THEN FAILED ( "INCORRECT NOENUM'FIRST FOR NONEWENUM"); END IF; IF E'LAST /= E'VAL (IDENT_INT(0)) THEN FAILED ( "INCORRECT E'LAST FOR NONEWENUM"); END IF; IF NOENUM'LAST /= E'VAL (1) THEN FAILED ( "INCORRECT NOENUM'LAST FOR NONEWENUM"); END IF; END Q; PROCEDURE PROC1 IS NEW P (ENUM, A, ABCD); PROCEDURE PROC2 IS NEW P (SUBENUM, A, ABC); PROCEDURE PROC3 IS NEW P (NEWENUM, BC, A_B_C); PROCEDURE PROC4 IS NEW Q (NONEWENUM); BEGIN PROC1 ( "ENUM" ); PROC2 ( "SUBENUM" ); PROC3 ( "NEWENUM" ); PROC4; END; RESULT; END C35502P;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . W W D _ W C H A R -- -- -- -- B o d y -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with Interfaces; use Interfaces; with System.WWd_Char; package body System.Wwd_WChar is ------------------------------------ -- Wide_Wide_Width_Wide_Character -- ------------------------------------ -- This is the case where we are talking about the Wide_Wide_Image of -- a Wide_Character, which is always the same character sequence as the -- Wide_Image of the same Wide_Character. function Wide_Wide_Width_Wide_Character (Lo, Hi : Wide_Character) return Natural is begin return Wide_Width_Wide_Character (Lo, Hi); end Wide_Wide_Width_Wide_Character; ------------------------------------ -- Wide_Wide_Width_Wide_Wide_Char -- ------------------------------------ function Wide_Wide_Width_Wide_Wide_Char (Lo, Hi : Wide_Wide_Character) return Natural is LV : constant Unsigned_32 := Wide_Wide_Character'Pos (Lo); HV : constant Unsigned_32 := Wide_Wide_Character'Pos (Hi); begin -- Return zero if empty range if LV > HV then return 0; -- Return max value (12) for wide character (Hex_hhhhhhhh) elsif HV > 255 then return 12; -- If any characters in normal character range, then use normal -- Wide_Wide_Width attribute on this range to find out a starting point. -- Otherwise start with zero. else return System.WWd_Char.Wide_Wide_Width_Character (Lo => Character'Val (LV), Hi => Character'Val (Unsigned_32'Min (255, HV))); end if; end Wide_Wide_Width_Wide_Wide_Char; ------------------------------- -- Wide_Width_Wide_Character -- ------------------------------- function Wide_Width_Wide_Character (Lo, Hi : Wide_Character) return Natural is LV : constant Unsigned_32 := Wide_Character'Pos (Lo); HV : constant Unsigned_32 := Wide_Character'Pos (Hi); begin -- Return zero if empty range if LV > HV then return 0; -- Return max value (12) for wide character (Hex_hhhhhhhh) elsif HV > 255 then return 12; -- If any characters in normal character range, then use normal -- Wide_Wide_Width attribute on this range to find out a starting point. -- Otherwise start with zero. else return System.WWd_Char.Wide_Width_Character (Lo => Character'Val (LV), Hi => Character'Val (Unsigned_32'Min (255, HV))); end if; end Wide_Width_Wide_Character; ------------------------------------ -- Wide_Width_Wide_Wide_Character -- ------------------------------------ function Wide_Width_Wide_Wide_Character (Lo, Hi : Wide_Wide_Character) return Natural is begin return Wide_Wide_Width_Wide_Wide_Char (Lo, Hi); end Wide_Width_Wide_Wide_Character; end System.Wwd_WChar;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K I N G . U T I L I T I E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-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. -- -- -- -- -- -- -- -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides RTS Internal Declarations. -- These declarations are not part of the GNARLI with Unchecked_Conversion; package System.Tasking.Utilities is function ATCB_To_Address is new Unchecked_Conversion (Task_Id, System.Address); --------------------------------- -- Task_Stage Related routines -- --------------------------------- procedure Make_Independent; -- Move the current task to the outermost level (level 2) of the master -- hierarchy of the environment task. That is one level further out -- than normal tasks defined in library-level packages (level 3). The -- environment task will wait for level 3 tasks to terminate normally, -- then it will abort all the level 2 tasks. See Finalize_Global_Tasks -- procedure for more information. -- -- This is a dangerous operation, and should only be used on nested tasks -- or tasks that depend on any objects that might be finalized earlier than -- the termination of the environment task. It is for internal use by the -- GNARL, to prevent such internal server tasks from preventing a partition -- from terminating. -- -- Also note that the run time assumes that the parent of an independent -- task is the environment task. If this is not the case, Make_Independent -- will change the task's parent. This assumption is particularly -- important for master level completion and for the computation of -- Independent_Task_Count. Independent_Task_Count : Natural := 0; -- Number of independent task. This counter is incremented each time -- Make_Independent is called. Note that if a server task terminates, -- this counter will not be decremented. Since Make_Independent locks -- the environment task (because every independent task depends on it), -- this counter is protected by the environment task's lock. --------------------------------- -- Task Abort Related Routines -- --------------------------------- procedure Cancel_Queued_Entry_Calls (T : Task_Id); -- Cancel any entry calls queued on target task. -- Call this while holding T's lock (or RTS_Lock in Single_Lock mode). procedure Exit_One_ATC_Level (Self_ID : Task_Id); pragma Inline (Exit_One_ATC_Level); -- Call only with abort deferred and holding lock of Self_ID. -- This is a bit of common code for all entry calls. -- The effect is to exit one level of ATC nesting. procedure Abort_One_Task (Self_ID : Task_Id; T : Task_Id); -- Similar to Locked_Abort_To_Level (Self_ID, T, 0), but: -- (1) caller should be holding no locks -- (2) may be called for tasks that have not yet been activated -- (3) always aborts whole task procedure Abort_Tasks (Tasks : Task_List); -- Abort_Tasks is called to initiate abort, however, the actual -- aborti is done by aborted task by means of Abort_Handler procedure Make_Passive (Self_ID : Task_Id; Task_Completed : Boolean); -- Update counts to indicate current task is either terminated or -- accepting on a terminate alternative. Call holding no locks except -- Global_Task_Lock when calling from Terminate_Task, and RTS_Lock when -- Single_Lock is True. end System.Tasking.Utilities;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 5 3 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-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. -- -- -- ------------------------------------------------------------------------------ -- Handling of packed arrays with Component_Size = 53 package System.Pack_53 is pragma Preelaborate; Bits : constant := 53; type Bits_53 is mod 2 ** Bits; for Bits_53'Size use Bits; -- In all subprograms below, Rev_SSO is set True if the array has the -- non-default scalar storage order. function Get_53 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_53 with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. procedure Set_53 (Arr : System.Address; N : Natural; E : Bits_53; Rev_SSO : Boolean) with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. end System.Pack_53;
-- CE3604A.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. --* -- OBJECTIVE: -- CHECK THAT GET_LINE MAY BE CALLED TO RETURN AN ENTIRE LINE. ALSO -- CHECK THAT GET_LINE MAY BE CALLED TO RETURN THE REMAINDER OF A -- PARTLY READ LINE. ALSO CHECK THAT GET_LINE RETURNS IN THE -- PARAMETER LAST, THE INDEX VALUE OF THE LAST CHARACTER READ. -- WHEN NO CHARACTERS ARE READ, LAST IS ONE LESS THAN ITEM'S LOWER -- BOUND. -- APPLICABILITY CRITERIA: -- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT -- TEXT FILES. -- HISTORY: -- JLH 09/25/87 COMPLETELY REVISED TEST. WITH REPORT; USE REPORT; WITH TEXT_IO; USE TEXT_IO; PROCEDURE CE3604A IS BEGIN TEST ("CE3604A", "CHECK THAT GET_LINE READS LINES APPROPRIATELY " & "AND CHECK THAT LAST RETURNS THE CORRECT INDEX " & "VALUE"); DECLARE FILE : FILE_TYPE; STR : STRING (1 .. 25); LAST : NATURAL; ITEM1 : STRING (2 .. 6); ITEM2 : STRING (3 .. 6); CH : CHARACTER; INCOMPLETE : EXCEPTION; BEGIN BEGIN CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " & "WITH OUT_FILE MODE"); RAISE INCOMPLETE; WHEN NAME_ERROR => NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " & "CREATE WITH OUT_FILE MODE"); RAISE INCOMPLETE; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT " & "CREATE"); RAISE INCOMPLETE; END; PUT (FILE, "FIRST LINE OF INPUT"); NEW_LINE (FILE); PUT (FILE, "SECOND LINE OF INPUT"); NEW_LINE (FILE); PUT (FILE, "THIRD LINE OF INPUT"); NEW_LINE (FILE); NEW_LINE (FILE); CLOSE (FILE); BEGIN OPEN (FILE, IN_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN " & "WITH IN_FILE MODE"); RAISE INCOMPLETE; END; GET_LINE (FILE, STR, LAST); BEGIN IF STR(1..LAST) /= "FIRST LINE OF INPUT" THEN FAILED ("GET_LINE - RETURN OF ENTIRE LINE"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => FAILED ("CONSTRAINT_ERROR RAISED AFTER " & "GET_LINE - 1"); END; GET (FILE, ITEM1); GET_LINE (FILE, STR, LAST); BEGIN IF STR(1..LAST) /= "D LINE OF INPUT" THEN FAILED ("GET_LINE - REMAINDER OF PARTLY READ LINE"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => FAILED ("CONSTRAINT_ERROR RAISED AFTER " & "GET_LINE - 2"); END; GET_LINE (FILE, ITEM1, LAST); IF LAST /= 6 THEN FAILED ("INCORRECT VALUE FOR LAST PARAMETER - 1"); END IF; WHILE NOT END_OF_LINE (FILE) LOOP GET (FILE, CH); END LOOP; GET_LINE (FILE, ITEM1, LAST); IF LAST /= 1 THEN FAILED ("INCORRECT VALUE FOR LAST PARAMETER - 2"); END IF; IF NOT END_OF_LINE (FILE) THEN FAILED ("END_OF_LINE NOT TRUE"); END IF; GET_LINE (FILE, ITEM2, LAST); IF LAST /= 2 THEN FAILED ("INCORRECT VALUE FOR LAST PARAMETER - 3"); END IF; BEGIN DELETE (FILE); EXCEPTION WHEN USE_ERROR => NULL; END; EXCEPTION WHEN INCOMPLETE => NULL; END; RESULT; END CE3604A;
-- This package is intended to set up and tear down the test environment. -- Once created by GNATtest, this package will never be overwritten -- automatically. Contents of this package can be modified in any way -- except for sections surrounded by a 'read only' marker. package body Game.Test_Data.Tests.Positive_Container.Test_Data is procedure Set_Up(Gnattest_T: in out Test) is pragma Unreferenced(Gnattest_T); begin null; end Set_Up; procedure Tear_Down(Gnattest_T: in out Test) is pragma Unreferenced(Gnattest_T); begin null; end Tear_Down; procedure User_Set_Up(Gnattest_T: in out New_Test) is pragma Unreferenced(Gnattest_T); begin null; end User_Set_Up; procedure User_Tear_Down(Gnattest_T: in out New_Test) is pragma Unreferenced(Gnattest_T); begin null; end User_Tear_Down; end Game.Test_Data.Tests.Positive_Container.Test_Data;
------------------------------------------------------------------------------- -- This file is part of libsparkcrypto. -- -- Copyright (C) 2010, Alexander Senier -- Copyright (C) 2010, secunet Security Networks AG -- 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 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 LSC.Internal.Ops32 is function Bytes_To_Word (Byte0 : Types.Byte; Byte1 : Types.Byte; Byte2 : Types.Byte; Byte3 : Types.Byte) return Types.Word32 is begin return Types.Byte_Array32_To_Word32 (Types.Byte_Array32_Type'(Byte3, Byte2, Byte1, Byte0)); end Bytes_To_Word; ---------------------------------------------------------------------------- function ByteX (Value : Types.Word32; Position : Types.Byte_Array32_Index) return Types.Byte is Temp : Types.Byte_Array32_Type; begin Temp := Types.Word32_To_Byte_Array32 (Value); return Temp (Position); end ByteX; ---------------------------------------------------------------------------- function Byte0 (Value : Types.Word32) return Types.Byte is begin return ByteX (Value, 3); end Byte0; ---------------------------------------------------------------------------- function Byte1 (Value : Types.Word32) return Types.Byte is begin return ByteX (Value, 2); end Byte1; ---------------------------------------------------------------------------- function Byte2 (Value : Types.Word32) return Types.Byte is begin return ByteX (Value, 1); end Byte2; ---------------------------------------------------------------------------- function Byte3 (Value : Types.Word32) return Types.Byte is begin return ByteX (Value, 0); end Byte3; ---------------------------------------------------------------------------- function XOR2 (V0, V1 : Types.Word32) return Types.Word32 is begin return V0 xor V1; end XOR2; ---------------------------------------------------------------------------- function XOR3 (V0, V1, V2 : Types.Word32) return Types.Word32 is begin return V0 xor V1 xor V2; end XOR3; ---------------------------------------------------------------------------- function XOR4 (V0, V1, V2, V3 : Types.Word32) return Types.Word32 is begin return V0 xor V1 xor V2 xor V3; end XOR4; ---------------------------------------------------------------------------- function XOR5 (V0, V1, V2, V3, V4 : Types.Word32) return Types.Word32 is begin return V0 xor V1 xor V2 xor V3 xor V4; end XOR5; ---------------------------------------------------------------------------- procedure Block_XOR (Left : in Types.Word32_Array_Type; Right : in Types.Word32_Array_Type; Result : out Types.Word32_Array_Type) is begin for I in Types.Index range Result'First .. Result'Last loop Result (I) := XOR2 (Left (I), Right (I)); pragma Loop_Invariant (for all Pos in Types.Index range Result'First .. I => (Result (Pos) = XOR2 (Left (Pos), Right (Pos)))); end loop; end Block_XOR; pragma Annotate (GNATprove, False_Positive, """Result"" might not be initialized", "Initialized in complete loop"); ---------------------------------------------------------------------------- procedure Block_Copy (Source : in Types.Word32_Array_Type; Dest : in out Types.Word32_Array_Type) is begin for I in Types.Index range Source'First .. Source'Last loop Dest (I) := Source (I); pragma Loop_Invariant (for all P in Types.Index range Source'First .. I => (Dest (P) = Source (P))); end loop; end Block_Copy; end LSC.Internal.Ops32;
with Interfaces; use Interfaces; package body STM32.F4.GPIO.Ports is package body GPIO_Port_Boolean is procedure Set(Value: Boolean) is begin Register.BSRR := ( BR => 2**Bit, BS => 2**Bit * Boolean'Pos(Value) ); end; function Value return Boolean is begin return (Register.IDR and 2**Bit) /= 0; end; end GPIO_Port_Boolean; package body GPIO_Port_Modular is Size: constant Positive := 1 + Last_Bit - First_Bit; Mask: constant Unsigned_16 := 2**(Last_Bit + 1) - 2**First_Bit; procedure Set(Value: Value_Type) is begin Register.BSRR := ( BR => Mask, BS => 2**First_Bit * Unsigned_16(Value) ); end; function Value return Value_Type is begin return Value_Type((Register.IDR / 2**First_Bit) and (2**Size - 1)); end; end GPIO_Port_Modular; end STM32.F4.GPIO.Ports;
-- This spec has been automatically generated from STM32F103.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.RCC is pragma Preelaborate; --------------- -- Registers -- --------------- subtype CR_HSITRIM_Field is HAL.UInt5; subtype CR_HSICAL_Field is HAL.UInt8; -- Clock control register type CR_Register is record -- Internal High Speed clock enable HSION : Boolean := True; -- Read-only. Internal High Speed clock ready flag HSIRDY : Boolean := True; -- unspecified Reserved_2_2 : HAL.Bit := 16#0#; -- Internal High Speed clock trimming HSITRIM : CR_HSITRIM_Field := 16#10#; -- Read-only. Internal High Speed clock Calibration HSICAL : CR_HSICAL_Field := 16#0#; -- External High Speed clock enable HSEON : Boolean := False; -- Read-only. External High Speed clock ready flag HSERDY : Boolean := False; -- External High Speed clock Bypass HSEBYP : Boolean := False; -- Clock Security System enable CSSON : Boolean := False; -- unspecified Reserved_20_23 : HAL.UInt4 := 16#0#; -- PLL enable PLLON : Boolean := False; -- Read-only. PLL clock ready flag PLLRDY : Boolean := False; -- unspecified Reserved_26_31 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CR_Register use record HSION at 0 range 0 .. 0; HSIRDY at 0 range 1 .. 1; Reserved_2_2 at 0 range 2 .. 2; HSITRIM at 0 range 3 .. 7; HSICAL at 0 range 8 .. 15; HSEON at 0 range 16 .. 16; HSERDY at 0 range 17 .. 17; HSEBYP at 0 range 18 .. 18; CSSON at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; PLLON at 0 range 24 .. 24; PLLRDY at 0 range 25 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype CFGR_SW_Field is HAL.UInt2; subtype CFGR_SWS_Field is HAL.UInt2; subtype CFGR_HPRE_Field is HAL.UInt4; -- CFGR_PPRE array element subtype CFGR_PPRE_Element is HAL.UInt3; -- CFGR_PPRE array type CFGR_PPRE_Field_Array is array (1 .. 2) of CFGR_PPRE_Element with Component_Size => 3, Size => 6; -- Type definition for CFGR_PPRE type CFGR_PPRE_Field (As_Array : Boolean := False) is record case As_Array is when False => -- PPRE as a value Val : HAL.UInt6; when True => -- PPRE as an array Arr : CFGR_PPRE_Field_Array; end case; end record with Unchecked_Union, Size => 6; for CFGR_PPRE_Field use record Val at 0 range 0 .. 5; Arr at 0 range 0 .. 5; end record; subtype CFGR_ADCPRE_Field is HAL.UInt2; subtype CFGR_PLLMUL_Field is HAL.UInt4; subtype CFGR_MCO_Field is HAL.UInt3; -- Clock configuration register (RCC_CFGR) type CFGR_Register is record -- System clock Switch SW : CFGR_SW_Field := 16#0#; -- Read-only. System Clock Switch Status SWS : CFGR_SWS_Field := 16#0#; -- AHB prescaler HPRE : CFGR_HPRE_Field := 16#0#; -- APB Low speed prescaler (APB1) PPRE : CFGR_PPRE_Field := (As_Array => False, Val => 16#0#); -- ADC prescaler ADCPRE : CFGR_ADCPRE_Field := 16#0#; -- PLL entry clock source PLLSRC : Boolean := False; -- HSE divider for PLL entry PLLXTPRE : Boolean := False; -- PLL Multiplication Factor PLLMUL : CFGR_PLLMUL_Field := 16#0#; -- USB OTG FS prescaler OTGFSPRE : Boolean := False; -- unspecified Reserved_23_23 : HAL.Bit := 16#0#; -- Microcontroller clock output MCO : CFGR_MCO_Field := 16#0#; -- unspecified Reserved_27_31 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CFGR_Register use record SW at 0 range 0 .. 1; SWS at 0 range 2 .. 3; HPRE at 0 range 4 .. 7; PPRE at 0 range 8 .. 13; ADCPRE at 0 range 14 .. 15; PLLSRC at 0 range 16 .. 16; PLLXTPRE at 0 range 17 .. 17; PLLMUL at 0 range 18 .. 21; OTGFSPRE at 0 range 22 .. 22; Reserved_23_23 at 0 range 23 .. 23; MCO at 0 range 24 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- Clock interrupt register (RCC_CIR) type CIR_Register is record -- Read-only. LSI Ready Interrupt flag LSIRDYF : Boolean := False; -- Read-only. LSE Ready Interrupt flag LSERDYF : Boolean := False; -- Read-only. HSI Ready Interrupt flag HSIRDYF : Boolean := False; -- Read-only. HSE Ready Interrupt flag HSERDYF : Boolean := False; -- Read-only. PLL Ready Interrupt flag PLLRDYF : Boolean := False; -- unspecified Reserved_5_6 : HAL.UInt2 := 16#0#; -- Read-only. Clock Security System Interrupt flag CSSF : Boolean := False; -- LSI Ready Interrupt Enable LSIRDYIE : Boolean := False; -- LSE Ready Interrupt Enable LSERDYIE : Boolean := False; -- HSI Ready Interrupt Enable HSIRDYIE : Boolean := False; -- HSE Ready Interrupt Enable HSERDYIE : Boolean := False; -- PLL Ready Interrupt Enable PLLRDYIE : Boolean := False; -- unspecified Reserved_13_15 : HAL.UInt3 := 16#0#; -- Write-only. LSI Ready Interrupt Clear LSIRDYC : Boolean := False; -- Write-only. LSE Ready Interrupt Clear LSERDYC : Boolean := False; -- Write-only. HSI Ready Interrupt Clear HSIRDYC : Boolean := False; -- Write-only. HSE Ready Interrupt Clear HSERDYC : Boolean := False; -- Write-only. PLL Ready Interrupt Clear PLLRDYC : Boolean := False; -- unspecified Reserved_21_22 : HAL.UInt2 := 16#0#; -- Write-only. Clock security system interrupt clear CSSC : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CIR_Register use record LSIRDYF at 0 range 0 .. 0; LSERDYF at 0 range 1 .. 1; HSIRDYF at 0 range 2 .. 2; HSERDYF at 0 range 3 .. 3; PLLRDYF at 0 range 4 .. 4; Reserved_5_6 at 0 range 5 .. 6; CSSF at 0 range 7 .. 7; LSIRDYIE at 0 range 8 .. 8; LSERDYIE at 0 range 9 .. 9; HSIRDYIE at 0 range 10 .. 10; HSERDYIE at 0 range 11 .. 11; PLLRDYIE at 0 range 12 .. 12; Reserved_13_15 at 0 range 13 .. 15; LSIRDYC at 0 range 16 .. 16; LSERDYC at 0 range 17 .. 17; HSIRDYC at 0 range 18 .. 18; HSERDYC at 0 range 19 .. 19; PLLRDYC at 0 range 20 .. 20; Reserved_21_22 at 0 range 21 .. 22; CSSC at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- APB2 peripheral reset register (RCC_APB2RSTR) type APB2RSTR_Register is record -- Alternate function I/O reset AFIORST : Boolean := False; -- unspecified Reserved_1_1 : HAL.Bit := 16#0#; -- IO port A reset IOPARST : Boolean := False; -- IO port B reset IOPBRST : Boolean := False; -- IO port C reset IOPCRST : Boolean := False; -- IO port D reset IOPDRST : Boolean := False; -- IO port E reset IOPERST : Boolean := False; -- IO port F reset IOPFRST : Boolean := False; -- IO port G reset IOPGRST : Boolean := False; -- ADC 1 interface reset ADC1RST : Boolean := False; -- ADC 2 interface reset ADC2RST : Boolean := False; -- TIM1 timer reset TIM1RST : Boolean := False; -- SPI 1 reset SPI1RST : Boolean := False; -- TIM8 timer reset TIM8RST : Boolean := False; -- USART1 reset USART1RST : Boolean := False; -- ADC 3 interface reset ADC3RST : Boolean := False; -- unspecified Reserved_16_18 : HAL.UInt3 := 16#0#; -- TIM9 timer reset TIM9RST : Boolean := False; -- TIM10 timer reset TIM10RST : Boolean := False; -- TIM11 timer reset TIM11RST : Boolean := False; -- unspecified Reserved_22_31 : HAL.UInt10 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for APB2RSTR_Register use record AFIORST at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; IOPARST at 0 range 2 .. 2; IOPBRST at 0 range 3 .. 3; IOPCRST at 0 range 4 .. 4; IOPDRST at 0 range 5 .. 5; IOPERST at 0 range 6 .. 6; IOPFRST at 0 range 7 .. 7; IOPGRST at 0 range 8 .. 8; ADC1RST at 0 range 9 .. 9; ADC2RST at 0 range 10 .. 10; TIM1RST at 0 range 11 .. 11; SPI1RST at 0 range 12 .. 12; TIM8RST at 0 range 13 .. 13; USART1RST at 0 range 14 .. 14; ADC3RST at 0 range 15 .. 15; Reserved_16_18 at 0 range 16 .. 18; TIM9RST at 0 range 19 .. 19; TIM10RST at 0 range 20 .. 20; TIM11RST at 0 range 21 .. 21; Reserved_22_31 at 0 range 22 .. 31; end record; -- APB1 peripheral reset register (RCC_APB1RSTR) type APB1RSTR_Register is record -- Timer 2 reset TIM2RST : Boolean := False; -- Timer 3 reset TIM3RST : Boolean := False; -- Timer 4 reset TIM4RST : Boolean := False; -- Timer 5 reset TIM5RST : Boolean := False; -- Timer 6 reset TIM6RST : Boolean := False; -- Timer 7 reset TIM7RST : Boolean := False; -- Timer 12 reset TIM12RST : Boolean := False; -- Timer 13 reset TIM13RST : Boolean := False; -- Timer 14 reset TIM14RST : Boolean := False; -- unspecified Reserved_9_10 : HAL.UInt2 := 16#0#; -- Window watchdog reset WWDGRST : Boolean := False; -- unspecified Reserved_12_13 : HAL.UInt2 := 16#0#; -- SPI2 reset SPI2RST : Boolean := False; -- SPI3 reset SPI3RST : Boolean := False; -- unspecified Reserved_16_16 : HAL.Bit := 16#0#; -- USART 2 reset USART2RST : Boolean := False; -- USART 3 reset USART3RST : Boolean := False; -- UART 4 reset UART4RST : Boolean := False; -- UART 5 reset UART5RST : Boolean := False; -- I2C1 reset I2C1RST : Boolean := False; -- I2C2 reset I2C2RST : Boolean := False; -- USB reset USBRST : Boolean := False; -- unspecified Reserved_24_24 : HAL.Bit := 16#0#; -- CAN reset CANRST : Boolean := False; -- unspecified Reserved_26_26 : HAL.Bit := 16#0#; -- Backup interface reset BKPRST : Boolean := False; -- Power interface reset PWRRST : Boolean := False; -- DAC interface reset DACRST : Boolean := False; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for APB1RSTR_Register use record TIM2RST at 0 range 0 .. 0; TIM3RST at 0 range 1 .. 1; TIM4RST at 0 range 2 .. 2; TIM5RST at 0 range 3 .. 3; TIM6RST at 0 range 4 .. 4; TIM7RST at 0 range 5 .. 5; TIM12RST at 0 range 6 .. 6; TIM13RST at 0 range 7 .. 7; TIM14RST at 0 range 8 .. 8; Reserved_9_10 at 0 range 9 .. 10; WWDGRST at 0 range 11 .. 11; Reserved_12_13 at 0 range 12 .. 13; SPI2RST at 0 range 14 .. 14; SPI3RST at 0 range 15 .. 15; Reserved_16_16 at 0 range 16 .. 16; USART2RST at 0 range 17 .. 17; USART3RST at 0 range 18 .. 18; UART4RST at 0 range 19 .. 19; UART5RST at 0 range 20 .. 20; I2C1RST at 0 range 21 .. 21; I2C2RST at 0 range 22 .. 22; USBRST at 0 range 23 .. 23; Reserved_24_24 at 0 range 24 .. 24; CANRST at 0 range 25 .. 25; Reserved_26_26 at 0 range 26 .. 26; BKPRST at 0 range 27 .. 27; PWRRST at 0 range 28 .. 28; DACRST at 0 range 29 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- AHB Peripheral Clock enable register (RCC_AHBENR) type AHBENR_Register is record -- DMA1 clock enable DMA1EN : Boolean := False; -- DMA2 clock enable DMA2EN : Boolean := False; -- SRAM interface clock enable SRAMEN : Boolean := True; -- unspecified Reserved_3_3 : HAL.Bit := 16#0#; -- FLITF clock enable FLITFEN : Boolean := True; -- unspecified Reserved_5_5 : HAL.Bit := 16#0#; -- CRC clock enable CRCEN : Boolean := False; -- unspecified Reserved_7_7 : HAL.Bit := 16#0#; -- FSMC clock enable FSMCEN : Boolean := False; -- unspecified Reserved_9_9 : HAL.Bit := 16#0#; -- SDIO clock enable SDIOEN : Boolean := False; -- unspecified Reserved_11_31 : HAL.UInt21 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for AHBENR_Register use record DMA1EN at 0 range 0 .. 0; DMA2EN at 0 range 1 .. 1; SRAMEN at 0 range 2 .. 2; Reserved_3_3 at 0 range 3 .. 3; FLITFEN at 0 range 4 .. 4; Reserved_5_5 at 0 range 5 .. 5; CRCEN at 0 range 6 .. 6; Reserved_7_7 at 0 range 7 .. 7; FSMCEN at 0 range 8 .. 8; Reserved_9_9 at 0 range 9 .. 9; SDIOEN at 0 range 10 .. 10; Reserved_11_31 at 0 range 11 .. 31; end record; -- APB2 peripheral clock enable register (RCC_APB2ENR) type APB2ENR_Register is record -- Alternate function I/O clock enable AFIOEN : Boolean := False; -- unspecified Reserved_1_1 : HAL.Bit := 16#0#; -- I/O port A clock enable IOPAEN : Boolean := False; -- I/O port B clock enable IOPBEN : Boolean := False; -- I/O port C clock enable IOPCEN : Boolean := False; -- I/O port D clock enable IOPDEN : Boolean := False; -- I/O port E clock enable IOPEEN : Boolean := False; -- I/O port F clock enable IOPFEN : Boolean := False; -- I/O port G clock enable IOPGEN : Boolean := False; -- ADC 1 interface clock enable ADC1EN : Boolean := False; -- ADC 2 interface clock enable ADC2EN : Boolean := False; -- TIM1 Timer clock enable TIM1EN : Boolean := False; -- SPI 1 clock enable SPI1EN : Boolean := False; -- TIM8 Timer clock enable TIM8EN : Boolean := False; -- USART1 clock enable USART1EN : Boolean := False; -- ADC3 interface clock enable ADC3EN : Boolean := False; -- unspecified Reserved_16_18 : HAL.UInt3 := 16#0#; -- TIM9 Timer clock enable TIM9EN : Boolean := False; -- TIM10 Timer clock enable TIM10EN : Boolean := False; -- TIM11 Timer clock enable TIM11EN : Boolean := False; -- unspecified Reserved_22_31 : HAL.UInt10 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for APB2ENR_Register use record AFIOEN at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; IOPAEN at 0 range 2 .. 2; IOPBEN at 0 range 3 .. 3; IOPCEN at 0 range 4 .. 4; IOPDEN at 0 range 5 .. 5; IOPEEN at 0 range 6 .. 6; IOPFEN at 0 range 7 .. 7; IOPGEN at 0 range 8 .. 8; ADC1EN at 0 range 9 .. 9; ADC2EN at 0 range 10 .. 10; TIM1EN at 0 range 11 .. 11; SPI1EN at 0 range 12 .. 12; TIM8EN at 0 range 13 .. 13; USART1EN at 0 range 14 .. 14; ADC3EN at 0 range 15 .. 15; Reserved_16_18 at 0 range 16 .. 18; TIM9EN at 0 range 19 .. 19; TIM10EN at 0 range 20 .. 20; TIM11EN at 0 range 21 .. 21; Reserved_22_31 at 0 range 22 .. 31; end record; -- APB1 peripheral clock enable register (RCC_APB1ENR) type APB1ENR_Register is record -- Timer 2 clock enable TIM2EN : Boolean := False; -- Timer 3 clock enable TIM3EN : Boolean := False; -- Timer 4 clock enable TIM4EN : Boolean := False; -- Timer 5 clock enable TIM5EN : Boolean := False; -- Timer 6 clock enable TIM6EN : Boolean := False; -- Timer 7 clock enable TIM7EN : Boolean := False; -- Timer 12 clock enable TIM12EN : Boolean := False; -- Timer 13 clock enable TIM13EN : Boolean := False; -- Timer 14 clock enable TIM14EN : Boolean := False; -- unspecified Reserved_9_10 : HAL.UInt2 := 16#0#; -- Window watchdog clock enable WWDGEN : Boolean := False; -- unspecified Reserved_12_13 : HAL.UInt2 := 16#0#; -- SPI 2 clock enable SPI2EN : Boolean := False; -- SPI 3 clock enable SPI3EN : Boolean := False; -- unspecified Reserved_16_16 : HAL.Bit := 16#0#; -- USART 2 clock enable USART2EN : Boolean := False; -- USART 3 clock enable USART3EN : Boolean := False; -- UART 4 clock enable UART4EN : Boolean := False; -- UART 5 clock enable UART5EN : Boolean := False; -- I2C 1 clock enable I2C1EN : Boolean := False; -- I2C 2 clock enable I2C2EN : Boolean := False; -- USB clock enable USBEN : Boolean := False; -- unspecified Reserved_24_24 : HAL.Bit := 16#0#; -- CAN clock enable CANEN : Boolean := False; -- unspecified Reserved_26_26 : HAL.Bit := 16#0#; -- Backup interface clock enable BKPEN : Boolean := False; -- Power interface clock enable PWREN : Boolean := False; -- DAC interface clock enable DACEN : Boolean := False; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for APB1ENR_Register use record TIM2EN at 0 range 0 .. 0; TIM3EN at 0 range 1 .. 1; TIM4EN at 0 range 2 .. 2; TIM5EN at 0 range 3 .. 3; TIM6EN at 0 range 4 .. 4; TIM7EN at 0 range 5 .. 5; TIM12EN at 0 range 6 .. 6; TIM13EN at 0 range 7 .. 7; TIM14EN at 0 range 8 .. 8; Reserved_9_10 at 0 range 9 .. 10; WWDGEN at 0 range 11 .. 11; Reserved_12_13 at 0 range 12 .. 13; SPI2EN at 0 range 14 .. 14; SPI3EN at 0 range 15 .. 15; Reserved_16_16 at 0 range 16 .. 16; USART2EN at 0 range 17 .. 17; USART3EN at 0 range 18 .. 18; UART4EN at 0 range 19 .. 19; UART5EN at 0 range 20 .. 20; I2C1EN at 0 range 21 .. 21; I2C2EN at 0 range 22 .. 22; USBEN at 0 range 23 .. 23; Reserved_24_24 at 0 range 24 .. 24; CANEN at 0 range 25 .. 25; Reserved_26_26 at 0 range 26 .. 26; BKPEN at 0 range 27 .. 27; PWREN at 0 range 28 .. 28; DACEN at 0 range 29 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype BDCR_RTCSEL_Field is HAL.UInt2; -- Backup domain control register (RCC_BDCR) type BDCR_Register is record -- External Low Speed oscillator enable LSEON : Boolean := False; -- Read-only. External Low Speed oscillator ready LSERDY : Boolean := False; -- External Low Speed oscillator bypass LSEBYP : Boolean := False; -- unspecified Reserved_3_7 : HAL.UInt5 := 16#0#; -- RTC clock source selection RTCSEL : BDCR_RTCSEL_Field := 16#0#; -- unspecified Reserved_10_14 : HAL.UInt5 := 16#0#; -- RTC clock enable RTCEN : Boolean := False; -- Backup domain software reset BDRST : 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 BDCR_Register use record LSEON at 0 range 0 .. 0; LSERDY at 0 range 1 .. 1; LSEBYP at 0 range 2 .. 2; Reserved_3_7 at 0 range 3 .. 7; RTCSEL at 0 range 8 .. 9; Reserved_10_14 at 0 range 10 .. 14; RTCEN at 0 range 15 .. 15; BDRST at 0 range 16 .. 16; Reserved_17_31 at 0 range 17 .. 31; end record; -- Control/status register (RCC_CSR) type CSR_Register is record -- Internal low speed oscillator enable LSION : Boolean := False; -- Read-only. Internal low speed oscillator ready LSIRDY : Boolean := False; -- unspecified Reserved_2_23 : HAL.UInt22 := 16#0#; -- Remove reset flag RMVF : Boolean := False; -- unspecified Reserved_25_25 : HAL.Bit := 16#0#; -- PIN reset flag PINRSTF : Boolean := True; -- POR/PDR reset flag PORRSTF : Boolean := True; -- Software reset flag SFTRSTF : Boolean := False; -- Independent watchdog reset flag IWDGRSTF : Boolean := False; -- Window watchdog reset flag WWDGRSTF : Boolean := False; -- Low-power reset flag LPWRRSTF : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CSR_Register use record LSION at 0 range 0 .. 0; LSIRDY at 0 range 1 .. 1; Reserved_2_23 at 0 range 2 .. 23; RMVF at 0 range 24 .. 24; Reserved_25_25 at 0 range 25 .. 25; PINRSTF at 0 range 26 .. 26; PORRSTF at 0 range 27 .. 27; SFTRSTF at 0 range 28 .. 28; IWDGRSTF at 0 range 29 .. 29; WWDGRSTF at 0 range 30 .. 30; LPWRRSTF at 0 range 31 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Reset and clock control type RCC_Peripheral is record -- Clock control register CR : aliased CR_Register; -- Clock configuration register (RCC_CFGR) CFGR : aliased CFGR_Register; -- Clock interrupt register (RCC_CIR) CIR : aliased CIR_Register; -- APB2 peripheral reset register (RCC_APB2RSTR) APB2RSTR : aliased APB2RSTR_Register; -- APB1 peripheral reset register (RCC_APB1RSTR) APB1RSTR : aliased APB1RSTR_Register; -- AHB Peripheral Clock enable register (RCC_AHBENR) AHBENR : aliased AHBENR_Register; -- APB2 peripheral clock enable register (RCC_APB2ENR) APB2ENR : aliased APB2ENR_Register; -- APB1 peripheral clock enable register (RCC_APB1ENR) APB1ENR : aliased APB1ENR_Register; -- Backup domain control register (RCC_BDCR) BDCR : aliased BDCR_Register; -- Control/status register (RCC_CSR) CSR : aliased CSR_Register; end record with Volatile; for RCC_Peripheral use record CR at 16#0# range 0 .. 31; CFGR at 16#4# range 0 .. 31; CIR at 16#8# range 0 .. 31; APB2RSTR at 16#C# range 0 .. 31; APB1RSTR at 16#10# range 0 .. 31; AHBENR at 16#14# range 0 .. 31; APB2ENR at 16#18# range 0 .. 31; APB1ENR at 16#1C# range 0 .. 31; BDCR at 16#20# range 0 .. 31; CSR at 16#24# range 0 .. 31; end record; -- Reset and clock control RCC_Periph : aliased RCC_Peripheral with Import, Address => System'To_Address (16#40021000#); end STM32_SVD.RCC;
pragma Style_Checks (Off); -- This spec has been automatically generated from ATSAMD51G19A.svd pragma Restrictions (No_Elaboration_Code); with HAL; with System; package SAM_SVD.PCC is pragma Preelaborate; --------------- -- Registers -- --------------- subtype PCC_MR_DSIZE_Field is HAL.UInt2; subtype PCC_MR_ISIZE_Field is HAL.UInt3; subtype PCC_MR_CID_Field is HAL.UInt2; -- Mode Register type PCC_MR_Register is record -- Parallel Capture Enable PCEN : Boolean := False; -- unspecified Reserved_1_3 : HAL.UInt3 := 16#0#; -- Data size DSIZE : PCC_MR_DSIZE_Field := 16#0#; -- unspecified Reserved_6_7 : HAL.UInt2 := 16#0#; -- Scale data SCALE : Boolean := False; -- Always Sampling ALWYS : Boolean := False; -- Half Sampling HALFS : Boolean := False; -- First sample FRSTS : Boolean := False; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Input Data Size ISIZE : PCC_MR_ISIZE_Field := 16#0#; -- unspecified Reserved_19_29 : HAL.UInt11 := 16#0#; -- Clear If Disabled CID : PCC_MR_CID_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PCC_MR_Register use record PCEN at 0 range 0 .. 0; Reserved_1_3 at 0 range 1 .. 3; DSIZE at 0 range 4 .. 5; Reserved_6_7 at 0 range 6 .. 7; SCALE at 0 range 8 .. 8; ALWYS at 0 range 9 .. 9; HALFS at 0 range 10 .. 10; FRSTS at 0 range 11 .. 11; Reserved_12_15 at 0 range 12 .. 15; ISIZE at 0 range 16 .. 18; Reserved_19_29 at 0 range 19 .. 29; CID at 0 range 30 .. 31; end record; -- Interrupt Enable Register type PCC_IER_Register is record -- Write-only. Data Ready Interrupt Enable DRDY : Boolean := False; -- Write-only. Overrun Error Interrupt Enable OVRE : Boolean := False; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PCC_IER_Register use record DRDY at 0 range 0 .. 0; OVRE at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- Interrupt Disable Register type PCC_IDR_Register is record -- Write-only. Data Ready Interrupt Disable DRDY : Boolean := False; -- Write-only. Overrun Error Interrupt Disable OVRE : Boolean := False; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PCC_IDR_Register use record DRDY at 0 range 0 .. 0; OVRE at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- Interrupt Mask Register type PCC_IMR_Register is record -- Read-only. Data Ready Interrupt Mask DRDY : Boolean; -- Read-only. Overrun Error Interrupt Mask OVRE : Boolean; -- unspecified Reserved_2_31 : HAL.UInt30; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PCC_IMR_Register use record DRDY at 0 range 0 .. 0; OVRE at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- Interrupt Status Register type PCC_ISR_Register is record -- Read-only. Data Ready Interrupt Status DRDY : Boolean; -- Read-only. Overrun Error Interrupt Status OVRE : Boolean; -- unspecified Reserved_2_31 : HAL.UInt30; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PCC_ISR_Register use record DRDY at 0 range 0 .. 0; OVRE at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; subtype PCC_WPMR_WPKEY_Field is HAL.UInt24; -- Write Protection Mode Register type PCC_WPMR_Register is record -- Write Protection Enable WPEN : Boolean := False; -- unspecified Reserved_1_7 : HAL.UInt7 := 16#0#; -- Write Protection Key WPKEY : PCC_WPMR_WPKEY_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PCC_WPMR_Register use record WPEN at 0 range 0 .. 0; Reserved_1_7 at 0 range 1 .. 7; WPKEY at 0 range 8 .. 31; end record; subtype PCC_WPSR_WPVSRC_Field is HAL.UInt16; -- Write Protection Status Register type PCC_WPSR_Register is record -- Read-only. Write Protection Violation Source WPVS : Boolean; -- unspecified Reserved_1_7 : HAL.UInt7; -- Read-only. Write Protection Violation Status WPVSRC : PCC_WPSR_WPVSRC_Field; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PCC_WPSR_Register use record WPVS at 0 range 0 .. 0; Reserved_1_7 at 0 range 1 .. 7; WPVSRC at 0 range 8 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Parallel Capture Controller type PCC_Peripheral is record -- Mode Register MR : aliased PCC_MR_Register; -- Interrupt Enable Register IER : aliased PCC_IER_Register; -- Interrupt Disable Register IDR : aliased PCC_IDR_Register; -- Interrupt Mask Register IMR : aliased PCC_IMR_Register; -- Interrupt Status Register ISR : aliased PCC_ISR_Register; -- Reception Holding Register RHR : aliased HAL.UInt32; -- Write Protection Mode Register WPMR : aliased PCC_WPMR_Register; -- Write Protection Status Register WPSR : aliased PCC_WPSR_Register; end record with Volatile; for PCC_Peripheral use record MR at 16#0# range 0 .. 31; IER at 16#4# range 0 .. 31; IDR at 16#8# range 0 .. 31; IMR at 16#C# range 0 .. 31; ISR at 16#10# range 0 .. 31; RHR at 16#14# range 0 .. 31; WPMR at 16#E0# range 0 .. 31; WPSR at 16#E4# range 0 .. 31; end record; -- Parallel Capture Controller PCC_Periph : aliased PCC_Peripheral with Import, Address => PCC_Base; end SAM_SVD.PCC;
------------------------------------------------------------------------------ -- -- -- 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. ------------------------------------------------------------------------------ -- Shows the internal structure of a StructuredClassifier. Also see Annex A. ------------------------------------------------------------------------------ with AMF.UMLDI.UML_Class_Or_Composite_Structure_Diagrams; package AMF.UMLDI.UML_Composite_Structure_Diagrams is pragma Preelaborate; type UMLDI_UML_Composite_Structure_Diagram is limited interface and AMF.UMLDI.UML_Class_Or_Composite_Structure_Diagrams.UMLDI_UML_Class_Or_Composite_Structure_Diagram; type UMLDI_UML_Composite_Structure_Diagram_Access is access all UMLDI_UML_Composite_Structure_Diagram'Class; for UMLDI_UML_Composite_Structure_Diagram_Access'Storage_Size use 0; end AMF.UMLDI.UML_Composite_Structure_Diagrams;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . B B . M C U _ P A R A M E T E R S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2016, 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 defines MCU parameters for the SAMG55 family package System.BB.MCU_Parameters is pragma Preelaborate; Number_Of_Interrupts : constant := 92; Has_FPU : constant Boolean := True; end System.BB.MCU_Parameters;
------------------------------------------------------------------------------ -- -- -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T . -- -- O P E R A T I O N S -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1991-2000 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). -- -- -- ------------------------------------------------------------------------------ -- This is a OpenVMS/Alpha version of this package. with System.OS_Interface; -- used for various type, constant, and operations with System.Tasking; with System.Tasking.Initialization; with System.Task_Primitives.Operations; with System.Task_Primitives.Operations.DEC; with Unchecked_Conversion; package body System.Interrupt_Management.Operations is use System.OS_Interface; use System.Tasking; use type unsigned_short; function To_Address is new Unchecked_Conversion (Task_ID, System.Address); function To_Task_ID is new Unchecked_Conversion (System.Address, Task_ID); package POP renames System.Task_Primitives.Operations; ---------------------------- -- Thread_Block_Interrupt -- ---------------------------- procedure Thread_Block_Interrupt (Interrupt : Interrupt_ID) is begin null; end Thread_Block_Interrupt; ------------------------------ -- Thread_Unblock_Interrupt -- ------------------------------ procedure Thread_Unblock_Interrupt (Interrupt : Interrupt_ID) is begin null; end Thread_Unblock_Interrupt; ------------------------ -- Set_Interrupt_Mask -- ------------------------ procedure Set_Interrupt_Mask (Mask : access Interrupt_Mask) is begin null; end Set_Interrupt_Mask; procedure Set_Interrupt_Mask (Mask : access Interrupt_Mask; OMask : access Interrupt_Mask) is begin null; end Set_Interrupt_Mask; ------------------------ -- Get_Interrupt_Mask -- ------------------------ procedure Get_Interrupt_Mask (Mask : access Interrupt_Mask) is begin null; end Get_Interrupt_Mask; -------------------- -- Interrupt_Wait -- -------------------- function To_unsigned_long is new Unchecked_Conversion (System.Address, unsigned_long); function Interrupt_Wait (Mask : access Interrupt_Mask) return Interrupt_ID is Self_ID : Task_ID := Self; Iosb : IO_Status_Block_Type := (0, 0, 0); Status : Cond_Value_Type; begin -- A QIO read is registered. The system call returns immediately -- after scheduling an AST to be fired when the operation -- completes. Sys_QIO (Status => Status, Chan => Rcv_Interrupt_Chan, Func => IO_READVBLK, Iosb => Iosb, Astadr => POP.DEC.Interrupt_AST_Handler'Access, Astprm => To_Address (Self_ID), P1 => To_unsigned_long (Interrupt_Mailbox'Address), P2 => Interrupt_ID'Size / 8); pragma Assert ((Status and 1) = 1); loop -- Wait to be woken up. Could be that the AST has fired, -- in which case the Iosb.Status variable will be non-zero, -- or maybe the wait is being aborted. POP.Sleep (Self_ID, System.Tasking.Interrupt_Server_Blocked_On_Event_Flag); if Iosb.Status /= 0 then if (Iosb.Status and 1) = 1 and then Mask (Signal (Interrupt_Mailbox)) then return Interrupt_Mailbox; else return 0; end if; else POP.Unlock (Self_ID); System.Tasking.Initialization.Undefer_Abort (Self_ID); System.Tasking.Initialization.Defer_Abort (Self_ID); POP.Write_Lock (Self_ID); end if; end loop; end Interrupt_Wait; ---------------------------- -- Install_Default_Action -- ---------------------------- procedure Install_Default_Action (Interrupt : Interrupt_ID) is begin null; end Install_Default_Action; --------------------------- -- Install_Ignore_Action -- --------------------------- procedure Install_Ignore_Action (Interrupt : Interrupt_ID) is begin null; end Install_Ignore_Action; ------------------------- -- Fill_Interrupt_Mask -- ------------------------- procedure Fill_Interrupt_Mask (Mask : access Interrupt_Mask) is begin Mask.all := (others => True); end Fill_Interrupt_Mask; -------------------------- -- Empty_Interrupt_Mask -- -------------------------- procedure Empty_Interrupt_Mask (Mask : access Interrupt_Mask) is begin Mask.all := (others => False); end Empty_Interrupt_Mask; --------------------------- -- Add_To_Interrupt_Mask -- --------------------------- procedure Add_To_Interrupt_Mask (Mask : access Interrupt_Mask; Interrupt : Interrupt_ID) is begin Mask (Signal (Interrupt)) := True; end Add_To_Interrupt_Mask; -------------------------------- -- Delete_From_Interrupt_Mask -- -------------------------------- procedure Delete_From_Interrupt_Mask (Mask : access Interrupt_Mask; Interrupt : Interrupt_ID) is begin Mask (Signal (Interrupt)) := False; end Delete_From_Interrupt_Mask; --------------- -- Is_Member -- --------------- function Is_Member (Mask : access Interrupt_Mask; Interrupt : Interrupt_ID) return Boolean is begin return Mask (Signal (Interrupt)); end Is_Member; ------------------------- -- Copy_Interrupt_Mask -- ------------------------- procedure Copy_Interrupt_Mask (X : out Interrupt_Mask; Y : Interrupt_Mask) is begin X := Y; end Copy_Interrupt_Mask; ------------------------- -- Interrupt_Self_Process -- ------------------------- procedure Interrupt_Self_Process (Interrupt : Interrupt_ID) is Status : Cond_Value_Type; begin Sys_QIO (Status => Status, Chan => Snd_Interrupt_Chan, Func => IO_WRITEVBLK, P1 => To_unsigned_long (Interrupt'Address), P2 => Interrupt_ID'Size / 8); pragma Assert ((Status and 1) = 1); end Interrupt_Self_Process; begin Environment_Mask := (others => False); All_Tasks_Mask := (others => True); for I in Interrupt_ID loop if Keep_Unmasked (I) then Environment_Mask (Signal (I)) := True; All_Tasks_Mask (Signal (I)) := False; end if; end loop; end System.Interrupt_Management.Operations;
with Ada.Calendar; with Ada.Strings.Unbounded; package Utils is type Local_Time is new Ada.Calendar.Time; Timezone : Ada.Strings.Unbounded.Unbounded_String; function Shift (S : String) return String; function Unescape (S : String) return String; procedure Warn (Text : String); function Clean_Text (Source : String) return String; function To_Time (Source : String) return Ada.Calendar.Time; function To_String (N : Natural) return String; function UTC_To_Local (T : Ada.Calendar.Time) return Local_Time; function Get_Timezone return String; end Utils;
-------------------------------------------------------- -- E n c o d i n g s -- -- -- -- Tools for convertion strings between Unicode and -- -- national/vendor character sets. -- -- - - - - - - - - - -- -- Read copyright and license at the end of this file -- -------------------------------------------------------- -- Procedure to write Ada package Encodings.Maps.* -- The package can be used to link through -- Encodings.Maps.Linked procedure Encodings.Read.Write (Object : Mapping; Map : Encoding); ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, Maxim Reznik -- 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 Maxim Reznik, 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 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. ------------------------------------------------------------------------------
package openGL.Model.polygon -- -- Provides an abstract class for polygon models. -- is type Item is abstract new Model.item with null record; end openGL.Model.polygon;
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" package body GL.API.Mac_OS_X is OpenGLFramework_Cached : CFBundleRef; function OpenGLFramework return CFBundleRef is use type System.Address; begin if OpenGLFramework_Cached = System.Null_Address then declare OpenGLFramework_ID : constant CFStringRef := CFStringCreateWithCString (System.Null_Address, IFC.To_C ("com.apple.opengl"), kCFStringEncodingASCII); begin OpenGLFramework_Cached := CFBundleGetBundleWithIdentifier (OpenGLFramework_ID); end; end if; return OpenGLFramework_Cached; end OpenGLFramework; end GL.API.Mac_OS_X;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-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. -- -- -- ------------------------------------------------------------------------------ -- Generic driver for the FT5336 touch panel with HAL; use HAL; with HAL.I2C; use HAL.I2C; with HAL.Touch_Panel; use HAL.Touch_Panel; package FT5336 is type FT5336_Device (Port : not null Any_I2C_Port; I2C_Addr : I2C_Address) is limited new Touch_Panel_Device with private; function Check_Id (This : in out FT5336_Device) return Boolean; -- Checks the ID of the touch panel controller, returns false if not found -- or invalid. procedure TP_Set_Use_Interrupts (This : in out FT5336_Device; Enabled : Boolean); -- Whether the data is retrieved upon interrupt or by polling by the -- software. overriding procedure Set_Bounds (This : in out FT5336_Device; Width : Natural; Height : Natural; Swap : HAL.Touch_Panel.Swap_State); -- Set screen bounds. Touch_State must should stay within screen bounds overriding function Active_Touch_Points (This : in out FT5336_Device) return HAL.Touch_Panel.Touch_Identifier; -- Retrieve the number of active touch points overriding function Get_Touch_Point (This : in out FT5336_Device; Touch_Id : HAL.Touch_Panel.Touch_Identifier) return HAL.Touch_Panel.TP_Touch_State; -- Retrieves the position and pressure information of the specified -- touch overriding function Get_All_Touch_Points (This : in out FT5336_Device) return HAL.Touch_Panel.TP_State; -- Retrieves the position and pressure information of every active touch -- points private type FT5336_Device (Port : not null Any_I2C_Port; I2C_Addr : I2C_Address) is limited new HAL.Touch_Panel.Touch_Panel_Device with record LCD_Natural_Width : Natural := 0; LCD_Natural_Height : Natural := 0; Swap : Swap_State := 0; end record; function I2C_Read (This : in out FT5336_Device; Reg : UInt8; Status : out Boolean) return UInt8; procedure I2C_Write (This : in out FT5336_Device; Reg : UInt8; Data : UInt8; Status : out Boolean); end FT5336;
package body System.Native_Time is use type C.signed_int; pragma Warnings (Off, "is not referenced"); function To_tv_nsec (X : Nanosecond_Number) return C.signed_long with Convention => Intrinsic; -- Darwin, FreeBSD, or Linux (32/64bit) function To_tv_nsec (X : Nanosecond_Number) return C.signed_long_long with Convention => Intrinsic; -- Linux (x32) pragma Inline_Always (To_tv_nsec); pragma Warnings (On, "is not referenced"); function To_tv_nsec (X : Nanosecond_Number) return C.signed_long is begin return C.signed_long (X); end To_tv_nsec; function To_tv_nsec (X : Nanosecond_Number) return C.signed_long_long is begin return C.signed_long_long (X); end To_tv_nsec; -- implementation function To_timespec (D : C.sys.time.struct_timeval) return C.time.struct_timespec is begin return ( tv_sec => D.tv_sec, tv_nsec => To_tv_nsec (Nanosecond_Number (D.tv_usec) * 1_000)); end To_timespec; function To_timespec (D : Duration) return C.time.struct_timespec is Nanosecond : constant Nanosecond_Number := Nanosecond_Number'Integer_Value (D); Sub_Second : constant Nanosecond_Number := Nanosecond mod 1_000_000_000; begin return ( tv_sec => C.sys.types.time_t ((Nanosecond - Sub_Second) / 1_000_000_000), tv_nsec => To_tv_nsec (Sub_Second)); end To_timespec; function To_Duration (D : C.time.struct_timespec) return Duration is begin return Duration'Fixed_Value ( Nanosecond_Number'Integer_Value (To_Duration (D.tv_sec)) + Nanosecond_Number (D.tv_nsec)); end To_Duration; function To_Duration (D : C.sys.types.time_t) return Duration is begin return Duration'Fixed_Value ( (Nanosecond_Number (D)) * 1_000_000_000); end To_Duration; procedure Simple_Delay_For (D : Duration) is Req_T : aliased C.time.struct_timespec := To_timespec (D); begin loop declare Rem_T : aliased C.time.struct_timespec; R : C.signed_int; begin R := C.time.nanosleep (Req_T'Access, Rem_T'Access); exit when not (R < 0); Req_T := Rem_T; end; end loop; end Simple_Delay_For; procedure Delay_For (D : Duration) is begin if D >= 0.0 then Delay_For_Hook.all (D); end if; end Delay_For; end System.Native_Time;
----------------------------------------------------------------------- -- ado.schemas.mysql -- Mysql Database Schemas -- Copyright (C) 2009, 2010, 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 ADO.Connections; package ADO.Schemas.Mysql is -- Load the database schema procedure Load_Schema (C : in ADO.Connections.Database_Connection'Class; Schema : out Schema_Definition); end ADO.Schemas.Mysql;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- N M A K E -- -- -- -- S p e c -- -- -- -- Generated by xnmake revision 1.2 using -- -- sinfo.ads revision 1.6 -- -- nmake.adt revision 1.1 -- -- -- -- Copyright (C) 1992-2001 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, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ pragma Style_Checks (All_Checks); -- Turn off subprogram order checking, since the routines here are -- generated automatically in order. with Nlists; use Nlists; with Types; use Types; with Uintp; use Uintp; with Urealp; use Urealp; package Nmake is -- This package contains a set of routines used to construct tree nodes -- using a functional style. There is one routine for each node type defined -- in Sinfo with the general interface: -- function Make_xxx (Sloc : Source_Ptr, -- Field_Name_1 : Field_Name_1_Type [:= default] -- Field_Name_2 : Field_Name_2_Type [:= default] -- ...) -- return Node_Id -- Only syntactic fields are included (i.e. fields marked as "-Sem" or "-Lib" -- in the Sinfo spec are excluded). In addition, the following four syntactic -- fields are excluded: -- Prev_Ids -- More_Ids -- Comes_From_Source -- Paren_Count -- since they are very rarely set in expanded code. If they need to be set, -- to other than the default values (False, False, False, zero), then the -- appropriate Set_xxx procedures must be used on the returned value. -- Default values are provided only for flag fields (where the default is -- False), and for optional fields. An optional field is one where the -- comment line describing the field contains the string "(set to xxx if". -- For such fields, a default value of xxx is provided." -- Warning: since calls to Make_xxx routines are normal function calls, the -- arguments can be evaluated in any order. This means that at most one such -- argument can have side effects (e.g. be a call to a parse routine). function Make_Unused_At_Start (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Unused_At_Start); function Make_Unused_At_End (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Unused_At_End); function Make_Identifier (Sloc : Source_Ptr; Chars : Name_Id) return Node_Id; pragma Inline (Make_Identifier); function Make_Integer_Literal (Sloc : Source_Ptr; Intval : Uint) return Node_Id; pragma Inline (Make_Integer_Literal); function Make_Real_Literal (Sloc : Source_Ptr; Realval : Ureal) return Node_Id; pragma Inline (Make_Real_Literal); function Make_Character_Literal (Sloc : Source_Ptr; Chars : Name_Id; Char_Literal_Value : Char_Code) return Node_Id; pragma Inline (Make_Character_Literal); function Make_String_Literal (Sloc : Source_Ptr; Strval : String_Id) return Node_Id; pragma Inline (Make_String_Literal); function Make_Pragma (Sloc : Source_Ptr; Chars : Name_Id; Pragma_Argument_Associations : List_Id := No_List; Debug_Statement : Node_Id := Empty) return Node_Id; pragma Inline (Make_Pragma); function Make_Pragma_Argument_Association (Sloc : Source_Ptr; Chars : Name_Id := No_Name; Expression : Node_Id) return Node_Id; pragma Inline (Make_Pragma_Argument_Association); function Make_Defining_Identifier (Sloc : Source_Ptr; Chars : Name_Id) return Node_Id; pragma Inline (Make_Defining_Identifier); function Make_Full_Type_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discriminant_Specifications : List_Id := No_List; Type_Definition : Node_Id) return Node_Id; pragma Inline (Make_Full_Type_Declaration); function Make_Subtype_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Subtype_Indication : Node_Id) return Node_Id; pragma Inline (Make_Subtype_Declaration); function Make_Subtype_Indication (Sloc : Source_Ptr; Subtype_Mark : Node_Id; Constraint : Node_Id) return Node_Id; pragma Inline (Make_Subtype_Indication); function Make_Object_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Aliased_Present : Boolean := False; Constant_Present : Boolean := False; Object_Definition : Node_Id; Expression : Node_Id := Empty) return Node_Id; pragma Inline (Make_Object_Declaration); function Make_Number_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_Number_Declaration); function Make_Derived_Type_Definition (Sloc : Source_Ptr; Abstract_Present : Boolean := False; Subtype_Indication : Node_Id; Record_Extension_Part : Node_Id := Empty) return Node_Id; pragma Inline (Make_Derived_Type_Definition); function Make_Range_Constraint (Sloc : Source_Ptr; Range_Expression : Node_Id) return Node_Id; pragma Inline (Make_Range_Constraint); function Make_Range (Sloc : Source_Ptr; Low_Bound : Node_Id; High_Bound : Node_Id; Includes_Infinities : Boolean := False) return Node_Id; pragma Inline (Make_Range); function Make_Enumeration_Type_Definition (Sloc : Source_Ptr; Literals : List_Id) return Node_Id; pragma Inline (Make_Enumeration_Type_Definition); function Make_Defining_Character_Literal (Sloc : Source_Ptr; Chars : Name_Id) return Node_Id; pragma Inline (Make_Defining_Character_Literal); function Make_Signed_Integer_Type_Definition (Sloc : Source_Ptr; Low_Bound : Node_Id; High_Bound : Node_Id) return Node_Id; pragma Inline (Make_Signed_Integer_Type_Definition); function Make_Modular_Type_Definition (Sloc : Source_Ptr; Expression : Node_Id) return Node_Id; pragma Inline (Make_Modular_Type_Definition); function Make_Floating_Point_Definition (Sloc : Source_Ptr; Digits_Expression : Node_Id; Real_Range_Specification : Node_Id := Empty) return Node_Id; pragma Inline (Make_Floating_Point_Definition); function Make_Real_Range_Specification (Sloc : Source_Ptr; Low_Bound : Node_Id; High_Bound : Node_Id) return Node_Id; pragma Inline (Make_Real_Range_Specification); function Make_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr; Delta_Expression : Node_Id; Real_Range_Specification : Node_Id) return Node_Id; pragma Inline (Make_Ordinary_Fixed_Point_Definition); function Make_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr; Delta_Expression : Node_Id; Digits_Expression : Node_Id; Real_Range_Specification : Node_Id := Empty) return Node_Id; pragma Inline (Make_Decimal_Fixed_Point_Definition); function Make_Digits_Constraint (Sloc : Source_Ptr; Digits_Expression : Node_Id; Range_Constraint : Node_Id := Empty) return Node_Id; pragma Inline (Make_Digits_Constraint); function Make_Unconstrained_Array_Definition (Sloc : Source_Ptr; Subtype_Marks : List_Id; Aliased_Present : Boolean := False; Subtype_Indication : Node_Id) return Node_Id; pragma Inline (Make_Unconstrained_Array_Definition); function Make_Constrained_Array_Definition (Sloc : Source_Ptr; Discrete_Subtype_Definitions : List_Id; Aliased_Present : Boolean := False; Subtype_Indication : Node_Id) return Node_Id; pragma Inline (Make_Constrained_Array_Definition); function Make_Discriminant_Specification (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discriminant_Type : Node_Id; Expression : Node_Id := Empty) return Node_Id; pragma Inline (Make_Discriminant_Specification); function Make_Index_Or_Discriminant_Constraint (Sloc : Source_Ptr; Constraints : List_Id) return Node_Id; pragma Inline (Make_Index_Or_Discriminant_Constraint); function Make_Discriminant_Association (Sloc : Source_Ptr; Selector_Names : List_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_Discriminant_Association); function Make_Record_Definition (Sloc : Source_Ptr; End_Label : Node_Id := Empty; Abstract_Present : Boolean := False; Tagged_Present : Boolean := False; Limited_Present : Boolean := False; Component_List : Node_Id; Null_Present : Boolean := False) return Node_Id; pragma Inline (Make_Record_Definition); function Make_Component_List (Sloc : Source_Ptr; Component_Items : List_Id; Variant_Part : Node_Id := Empty; Null_Present : Boolean := False) return Node_Id; pragma Inline (Make_Component_List); function Make_Component_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Aliased_Present : Boolean := False; Subtype_Indication : Node_Id; Expression : Node_Id := Empty) return Node_Id; pragma Inline (Make_Component_Declaration); function Make_Variant_Part (Sloc : Source_Ptr; Name : Node_Id; Variants : List_Id) return Node_Id; pragma Inline (Make_Variant_Part); function Make_Variant (Sloc : Source_Ptr; Discrete_Choices : List_Id; Component_List : Node_Id) return Node_Id; pragma Inline (Make_Variant); function Make_Others_Choice (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Others_Choice); function Make_Access_To_Object_Definition (Sloc : Source_Ptr; All_Present : Boolean := False; Subtype_Indication : Node_Id; Constant_Present : Boolean := False) return Node_Id; pragma Inline (Make_Access_To_Object_Definition); function Make_Access_Function_Definition (Sloc : Source_Ptr; Protected_Present : Boolean := False; Parameter_Specifications : List_Id := No_List; Subtype_Mark : Node_Id) return Node_Id; pragma Inline (Make_Access_Function_Definition); function Make_Access_Procedure_Definition (Sloc : Source_Ptr; Protected_Present : Boolean := False; Parameter_Specifications : List_Id := No_List) return Node_Id; pragma Inline (Make_Access_Procedure_Definition); function Make_Access_Definition (Sloc : Source_Ptr; Subtype_Mark : Node_Id) return Node_Id; pragma Inline (Make_Access_Definition); function Make_Incomplete_Type_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discriminant_Specifications : List_Id := No_List; Unknown_Discriminants_Present : Boolean := False) return Node_Id; pragma Inline (Make_Incomplete_Type_Declaration); function Make_Explicit_Dereference (Sloc : Source_Ptr; Prefix : Node_Id) return Node_Id; pragma Inline (Make_Explicit_Dereference); function Make_Indexed_Component (Sloc : Source_Ptr; Prefix : Node_Id; Expressions : List_Id) return Node_Id; pragma Inline (Make_Indexed_Component); function Make_Slice (Sloc : Source_Ptr; Prefix : Node_Id; Discrete_Range : Node_Id) return Node_Id; pragma Inline (Make_Slice); function Make_Selected_Component (Sloc : Source_Ptr; Prefix : Node_Id; Selector_Name : Node_Id) return Node_Id; pragma Inline (Make_Selected_Component); function Make_Attribute_Reference (Sloc : Source_Ptr; Prefix : Node_Id; Attribute_Name : Name_Id; Expressions : List_Id := No_List) return Node_Id; pragma Inline (Make_Attribute_Reference); function Make_Aggregate (Sloc : Source_Ptr; Expressions : List_Id := No_List; Component_Associations : List_Id := No_List; Null_Record_Present : Boolean := False) return Node_Id; pragma Inline (Make_Aggregate); function Make_Component_Association (Sloc : Source_Ptr; Choices : List_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_Component_Association); function Make_Extension_Aggregate (Sloc : Source_Ptr; Ancestor_Part : Node_Id; Expressions : List_Id := No_List; Component_Associations : List_Id := No_List; Null_Record_Present : Boolean := False) return Node_Id; pragma Inline (Make_Extension_Aggregate); function Make_Null (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Null); function Make_And_Then (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_And_Then); function Make_Or_Else (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Or_Else); function Make_In (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_In); function Make_Not_In (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Not_In); function Make_Op_And (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_And); function Make_Op_Or (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Or); function Make_Op_Xor (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Xor); function Make_Op_Eq (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Eq); function Make_Op_Ne (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Ne); function Make_Op_Lt (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Lt); function Make_Op_Le (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Le); function Make_Op_Gt (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Gt); function Make_Op_Ge (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Ge); function Make_Op_Add (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Add); function Make_Op_Subtract (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Subtract); function Make_Op_Concat (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Concat); function Make_Op_Multiply (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Multiply); function Make_Op_Divide (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Divide); function Make_Op_Mod (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Mod); function Make_Op_Rem (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Rem); function Make_Op_Expon (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Expon); function Make_Op_Plus (Sloc : Source_Ptr; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Plus); function Make_Op_Minus (Sloc : Source_Ptr; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Minus); function Make_Op_Abs (Sloc : Source_Ptr; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Abs); function Make_Op_Not (Sloc : Source_Ptr; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Not); function Make_Type_Conversion (Sloc : Source_Ptr; Subtype_Mark : Node_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_Type_Conversion); function Make_Qualified_Expression (Sloc : Source_Ptr; Subtype_Mark : Node_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_Qualified_Expression); function Make_Allocator (Sloc : Source_Ptr; Expression : Node_Id) return Node_Id; pragma Inline (Make_Allocator); function Make_Null_Statement (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Null_Statement); function Make_Label (Sloc : Source_Ptr; Identifier : Node_Id) return Node_Id; pragma Inline (Make_Label); function Make_Assignment_Statement (Sloc : Source_Ptr; Name : Node_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_Assignment_Statement); function Make_If_Statement (Sloc : Source_Ptr; Condition : Node_Id; Then_Statements : List_Id; Elsif_Parts : List_Id := No_List; Else_Statements : List_Id := No_List; End_Span : Uint := No_Uint) return Node_Id; pragma Inline (Make_If_Statement); function Make_Elsif_Part (Sloc : Source_Ptr; Condition : Node_Id; Then_Statements : List_Id) return Node_Id; pragma Inline (Make_Elsif_Part); function Make_Case_Statement (Sloc : Source_Ptr; Expression : Node_Id; Alternatives : List_Id; End_Span : Uint := No_Uint) return Node_Id; pragma Inline (Make_Case_Statement); function Make_Case_Statement_Alternative (Sloc : Source_Ptr; Discrete_Choices : List_Id; Statements : List_Id) return Node_Id; pragma Inline (Make_Case_Statement_Alternative); function Make_Loop_Statement (Sloc : Source_Ptr; Identifier : Node_Id := Empty; Iteration_Scheme : Node_Id := Empty; Statements : List_Id; End_Label : Node_Id; Has_Created_Identifier : Boolean := False) return Node_Id; pragma Inline (Make_Loop_Statement); function Make_Iteration_Scheme (Sloc : Source_Ptr; Condition : Node_Id := Empty; Loop_Parameter_Specification : Node_Id := Empty) return Node_Id; pragma Inline (Make_Iteration_Scheme); function Make_Loop_Parameter_Specification (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Reverse_Present : Boolean := False; Discrete_Subtype_Definition : Node_Id) return Node_Id; pragma Inline (Make_Loop_Parameter_Specification); function Make_Block_Statement (Sloc : Source_Ptr; Identifier : Node_Id := Empty; Declarations : List_Id := No_List; Handled_Statement_Sequence : Node_Id; Has_Created_Identifier : Boolean := False; Is_Task_Allocation_Block : Boolean := False; Is_Asynchronous_Call_Block : Boolean := False) return Node_Id; pragma Inline (Make_Block_Statement); function Make_Exit_Statement (Sloc : Source_Ptr; Name : Node_Id := Empty; Condition : Node_Id := Empty) return Node_Id; pragma Inline (Make_Exit_Statement); function Make_Goto_Statement (Sloc : Source_Ptr; Name : Node_Id) return Node_Id; pragma Inline (Make_Goto_Statement); function Make_Subprogram_Declaration (Sloc : Source_Ptr; Specification : Node_Id) return Node_Id; pragma Inline (Make_Subprogram_Declaration); function Make_Abstract_Subprogram_Declaration (Sloc : Source_Ptr; Specification : Node_Id) return Node_Id; pragma Inline (Make_Abstract_Subprogram_Declaration); function Make_Function_Specification (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Parameter_Specifications : List_Id := No_List; Subtype_Mark : Node_Id) return Node_Id; pragma Inline (Make_Function_Specification); function Make_Procedure_Specification (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Parameter_Specifications : List_Id := No_List) return Node_Id; pragma Inline (Make_Procedure_Specification); function Make_Designator (Sloc : Source_Ptr; Name : Node_Id; Identifier : Node_Id) return Node_Id; pragma Inline (Make_Designator); function Make_Defining_Program_Unit_Name (Sloc : Source_Ptr; Name : Node_Id; Defining_Identifier : Node_Id) return Node_Id; pragma Inline (Make_Defining_Program_Unit_Name); function Make_Operator_Symbol (Sloc : Source_Ptr; Chars : Name_Id; Strval : String_Id) return Node_Id; pragma Inline (Make_Operator_Symbol); function Make_Defining_Operator_Symbol (Sloc : Source_Ptr; Chars : Name_Id) return Node_Id; pragma Inline (Make_Defining_Operator_Symbol); function Make_Parameter_Specification (Sloc : Source_Ptr; Defining_Identifier : Node_Id; In_Present : Boolean := False; Out_Present : Boolean := False; Parameter_Type : Node_Id; Expression : Node_Id := Empty) return Node_Id; pragma Inline (Make_Parameter_Specification); function Make_Subprogram_Body (Sloc : Source_Ptr; Specification : Node_Id; Declarations : List_Id; Handled_Statement_Sequence : Node_Id; Bad_Is_Detected : Boolean := False) return Node_Id; pragma Inline (Make_Subprogram_Body); function Make_Procedure_Call_Statement (Sloc : Source_Ptr; Name : Node_Id; Parameter_Associations : List_Id := No_List) return Node_Id; pragma Inline (Make_Procedure_Call_Statement); function Make_Function_Call (Sloc : Source_Ptr; Name : Node_Id; Parameter_Associations : List_Id := No_List) return Node_Id; pragma Inline (Make_Function_Call); function Make_Parameter_Association (Sloc : Source_Ptr; Selector_Name : Node_Id; Explicit_Actual_Parameter : Node_Id) return Node_Id; pragma Inline (Make_Parameter_Association); function Make_Return_Statement (Sloc : Source_Ptr; Expression : Node_Id := Empty) return Node_Id; pragma Inline (Make_Return_Statement); function Make_Package_Declaration (Sloc : Source_Ptr; Specification : Node_Id) return Node_Id; pragma Inline (Make_Package_Declaration); function Make_Package_Specification (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Visible_Declarations : List_Id; Private_Declarations : List_Id := No_List; End_Label : Node_Id) return Node_Id; pragma Inline (Make_Package_Specification); function Make_Package_Body (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Declarations : List_Id; Handled_Statement_Sequence : Node_Id := Empty) return Node_Id; pragma Inline (Make_Package_Body); function Make_Private_Type_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discriminant_Specifications : List_Id := No_List; Unknown_Discriminants_Present : Boolean := False; Abstract_Present : Boolean := False; Tagged_Present : Boolean := False; Limited_Present : Boolean := False) return Node_Id; pragma Inline (Make_Private_Type_Declaration); function Make_Private_Extension_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discriminant_Specifications : List_Id := No_List; Unknown_Discriminants_Present : Boolean := False; Abstract_Present : Boolean := False; Subtype_Indication : Node_Id) return Node_Id; pragma Inline (Make_Private_Extension_Declaration); function Make_Use_Package_Clause (Sloc : Source_Ptr; Names : List_Id) return Node_Id; pragma Inline (Make_Use_Package_Clause); function Make_Use_Type_Clause (Sloc : Source_Ptr; Subtype_Marks : List_Id) return Node_Id; pragma Inline (Make_Use_Type_Clause); function Make_Object_Renaming_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Subtype_Mark : Node_Id; Name : Node_Id) return Node_Id; pragma Inline (Make_Object_Renaming_Declaration); function Make_Exception_Renaming_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Name : Node_Id) return Node_Id; pragma Inline (Make_Exception_Renaming_Declaration); function Make_Package_Renaming_Declaration (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Name : Node_Id) return Node_Id; pragma Inline (Make_Package_Renaming_Declaration); function Make_Subprogram_Renaming_Declaration (Sloc : Source_Ptr; Specification : Node_Id; Name : Node_Id) return Node_Id; pragma Inline (Make_Subprogram_Renaming_Declaration); function Make_Generic_Package_Renaming_Declaration (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Name : Node_Id) return Node_Id; pragma Inline (Make_Generic_Package_Renaming_Declaration); function Make_Generic_Procedure_Renaming_Declaration (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Name : Node_Id) return Node_Id; pragma Inline (Make_Generic_Procedure_Renaming_Declaration); function Make_Generic_Function_Renaming_Declaration (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Name : Node_Id) return Node_Id; pragma Inline (Make_Generic_Function_Renaming_Declaration); function Make_Task_Type_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discriminant_Specifications : List_Id := No_List; Task_Definition : Node_Id := Empty) return Node_Id; pragma Inline (Make_Task_Type_Declaration); function Make_Single_Task_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Task_Definition : Node_Id := Empty) return Node_Id; pragma Inline (Make_Single_Task_Declaration); function Make_Task_Definition (Sloc : Source_Ptr; Visible_Declarations : List_Id; Private_Declarations : List_Id := No_List; End_Label : Node_Id) return Node_Id; pragma Inline (Make_Task_Definition); function Make_Task_Body (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Declarations : List_Id; Handled_Statement_Sequence : Node_Id) return Node_Id; pragma Inline (Make_Task_Body); function Make_Protected_Type_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discriminant_Specifications : List_Id := No_List; Protected_Definition : Node_Id) return Node_Id; pragma Inline (Make_Protected_Type_Declaration); function Make_Single_Protected_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Protected_Definition : Node_Id) return Node_Id; pragma Inline (Make_Single_Protected_Declaration); function Make_Protected_Definition (Sloc : Source_Ptr; Visible_Declarations : List_Id; Private_Declarations : List_Id := No_List; End_Label : Node_Id) return Node_Id; pragma Inline (Make_Protected_Definition); function Make_Protected_Body (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Declarations : List_Id; End_Label : Node_Id) return Node_Id; pragma Inline (Make_Protected_Body); function Make_Entry_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discrete_Subtype_Definition : Node_Id := Empty; Parameter_Specifications : List_Id := No_List) return Node_Id; pragma Inline (Make_Entry_Declaration); function Make_Accept_Statement (Sloc : Source_Ptr; Entry_Direct_Name : Node_Id; Entry_Index : Node_Id := Empty; Parameter_Specifications : List_Id := No_List; Handled_Statement_Sequence : Node_Id; Declarations : List_Id := No_List) return Node_Id; pragma Inline (Make_Accept_Statement); function Make_Entry_Body (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Entry_Body_Formal_Part : Node_Id; Declarations : List_Id; Handled_Statement_Sequence : Node_Id) return Node_Id; pragma Inline (Make_Entry_Body); function Make_Entry_Body_Formal_Part (Sloc : Source_Ptr; Entry_Index_Specification : Node_Id := Empty; Parameter_Specifications : List_Id := No_List; Condition : Node_Id) return Node_Id; pragma Inline (Make_Entry_Body_Formal_Part); function Make_Entry_Index_Specification (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Discrete_Subtype_Definition : Node_Id) return Node_Id; pragma Inline (Make_Entry_Index_Specification); function Make_Entry_Call_Statement (Sloc : Source_Ptr; Name : Node_Id; Parameter_Associations : List_Id := No_List) return Node_Id; pragma Inline (Make_Entry_Call_Statement); function Make_Requeue_Statement (Sloc : Source_Ptr; Name : Node_Id; Abort_Present : Boolean := False) return Node_Id; pragma Inline (Make_Requeue_Statement); function Make_Delay_Until_Statement (Sloc : Source_Ptr; Expression : Node_Id) return Node_Id; pragma Inline (Make_Delay_Until_Statement); function Make_Delay_Relative_Statement (Sloc : Source_Ptr; Expression : Node_Id) return Node_Id; pragma Inline (Make_Delay_Relative_Statement); function Make_Selective_Accept (Sloc : Source_Ptr; Select_Alternatives : List_Id; Else_Statements : List_Id := No_List) return Node_Id; pragma Inline (Make_Selective_Accept); function Make_Accept_Alternative (Sloc : Source_Ptr; Accept_Statement : Node_Id; Condition : Node_Id := Empty; Statements : List_Id := Empty_List; Pragmas_Before : List_Id := No_List) return Node_Id; pragma Inline (Make_Accept_Alternative); function Make_Delay_Alternative (Sloc : Source_Ptr; Delay_Statement : Node_Id; Condition : Node_Id := Empty; Statements : List_Id := Empty_List; Pragmas_Before : List_Id := No_List) return Node_Id; pragma Inline (Make_Delay_Alternative); function Make_Terminate_Alternative (Sloc : Source_Ptr; Condition : Node_Id := Empty; Pragmas_Before : List_Id := No_List; Pragmas_After : List_Id := No_List) return Node_Id; pragma Inline (Make_Terminate_Alternative); function Make_Timed_Entry_Call (Sloc : Source_Ptr; Entry_Call_Alternative : Node_Id; Delay_Alternative : Node_Id) return Node_Id; pragma Inline (Make_Timed_Entry_Call); function Make_Entry_Call_Alternative (Sloc : Source_Ptr; Entry_Call_Statement : Node_Id; Statements : List_Id := Empty_List; Pragmas_Before : List_Id := No_List) return Node_Id; pragma Inline (Make_Entry_Call_Alternative); function Make_Conditional_Entry_Call (Sloc : Source_Ptr; Entry_Call_Alternative : Node_Id; Else_Statements : List_Id) return Node_Id; pragma Inline (Make_Conditional_Entry_Call); function Make_Asynchronous_Select (Sloc : Source_Ptr; Triggering_Alternative : Node_Id; Abortable_Part : Node_Id) return Node_Id; pragma Inline (Make_Asynchronous_Select); function Make_Triggering_Alternative (Sloc : Source_Ptr; Triggering_Statement : Node_Id; Statements : List_Id := Empty_List; Pragmas_Before : List_Id := No_List) return Node_Id; pragma Inline (Make_Triggering_Alternative); function Make_Abortable_Part (Sloc : Source_Ptr; Statements : List_Id) return Node_Id; pragma Inline (Make_Abortable_Part); function Make_Abort_Statement (Sloc : Source_Ptr; Names : List_Id) return Node_Id; pragma Inline (Make_Abort_Statement); function Make_Compilation_Unit (Sloc : Source_Ptr; Context_Items : List_Id; Private_Present : Boolean := False; Unit : Node_Id; Aux_Decls_Node : Node_Id) return Node_Id; pragma Inline (Make_Compilation_Unit); function Make_Compilation_Unit_Aux (Sloc : Source_Ptr; Declarations : List_Id := No_List; Actions : List_Id := No_List; Pragmas_After : List_Id := No_List) return Node_Id; pragma Inline (Make_Compilation_Unit_Aux); function Make_With_Clause (Sloc : Source_Ptr; Name : Node_Id; First_Name : Boolean := True; Last_Name : Boolean := True) return Node_Id; pragma Inline (Make_With_Clause); function Make_With_Type_Clause (Sloc : Source_Ptr; Name : Node_Id; Tagged_Present : Boolean := False) return Node_Id; pragma Inline (Make_With_Type_Clause); function Make_Subprogram_Body_Stub (Sloc : Source_Ptr; Specification : Node_Id) return Node_Id; pragma Inline (Make_Subprogram_Body_Stub); function Make_Package_Body_Stub (Sloc : Source_Ptr; Defining_Identifier : Node_Id) return Node_Id; pragma Inline (Make_Package_Body_Stub); function Make_Task_Body_Stub (Sloc : Source_Ptr; Defining_Identifier : Node_Id) return Node_Id; pragma Inline (Make_Task_Body_Stub); function Make_Protected_Body_Stub (Sloc : Source_Ptr; Defining_Identifier : Node_Id) return Node_Id; pragma Inline (Make_Protected_Body_Stub); function Make_Subunit (Sloc : Source_Ptr; Name : Node_Id; Proper_Body : Node_Id) return Node_Id; pragma Inline (Make_Subunit); function Make_Exception_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id) return Node_Id; pragma Inline (Make_Exception_Declaration); function Make_Handled_Sequence_Of_Statements (Sloc : Source_Ptr; Statements : List_Id; End_Label : Node_Id := Empty; Exception_Handlers : List_Id := No_List; At_End_Proc : Node_Id := Empty) return Node_Id; pragma Inline (Make_Handled_Sequence_Of_Statements); function Make_Exception_Handler (Sloc : Source_Ptr; Choice_Parameter : Node_Id := Empty; Exception_Choices : List_Id; Statements : List_Id) return Node_Id; pragma Inline (Make_Exception_Handler); function Make_Raise_Statement (Sloc : Source_Ptr; Name : Node_Id := Empty) return Node_Id; pragma Inline (Make_Raise_Statement); function Make_Generic_Subprogram_Declaration (Sloc : Source_Ptr; Specification : Node_Id; Generic_Formal_Declarations : List_Id) return Node_Id; pragma Inline (Make_Generic_Subprogram_Declaration); function Make_Generic_Package_Declaration (Sloc : Source_Ptr; Specification : Node_Id; Generic_Formal_Declarations : List_Id) return Node_Id; pragma Inline (Make_Generic_Package_Declaration); function Make_Package_Instantiation (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Name : Node_Id; Generic_Associations : List_Id := No_List) return Node_Id; pragma Inline (Make_Package_Instantiation); function Make_Procedure_Instantiation (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Name : Node_Id; Generic_Associations : List_Id := No_List) return Node_Id; pragma Inline (Make_Procedure_Instantiation); function Make_Function_Instantiation (Sloc : Source_Ptr; Defining_Unit_Name : Node_Id; Name : Node_Id; Generic_Associations : List_Id := No_List) return Node_Id; pragma Inline (Make_Function_Instantiation); function Make_Generic_Association (Sloc : Source_Ptr; Selector_Name : Node_Id := Empty; Explicit_Generic_Actual_Parameter : Node_Id) return Node_Id; pragma Inline (Make_Generic_Association); function Make_Formal_Object_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; In_Present : Boolean := False; Out_Present : Boolean := False; Subtype_Mark : Node_Id; Expression : Node_Id := Empty) return Node_Id; pragma Inline (Make_Formal_Object_Declaration); function Make_Formal_Type_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Formal_Type_Definition : Node_Id; Discriminant_Specifications : List_Id := No_List; Unknown_Discriminants_Present : Boolean := False) return Node_Id; pragma Inline (Make_Formal_Type_Declaration); function Make_Formal_Private_Type_Definition (Sloc : Source_Ptr; Abstract_Present : Boolean := False; Tagged_Present : Boolean := False; Limited_Present : Boolean := False) return Node_Id; pragma Inline (Make_Formal_Private_Type_Definition); function Make_Formal_Derived_Type_Definition (Sloc : Source_Ptr; Subtype_Mark : Node_Id; Private_Present : Boolean := False; Abstract_Present : Boolean := False) return Node_Id; pragma Inline (Make_Formal_Derived_Type_Definition); function Make_Formal_Discrete_Type_Definition (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Formal_Discrete_Type_Definition); function Make_Formal_Signed_Integer_Type_Definition (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Formal_Signed_Integer_Type_Definition); function Make_Formal_Modular_Type_Definition (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Formal_Modular_Type_Definition); function Make_Formal_Floating_Point_Definition (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Formal_Floating_Point_Definition); function Make_Formal_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Formal_Ordinary_Fixed_Point_Definition); function Make_Formal_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Formal_Decimal_Fixed_Point_Definition); function Make_Formal_Subprogram_Declaration (Sloc : Source_Ptr; Specification : Node_Id; Default_Name : Node_Id := Empty; Box_Present : Boolean := False) return Node_Id; pragma Inline (Make_Formal_Subprogram_Declaration); function Make_Formal_Package_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id; Name : Node_Id; Generic_Associations : List_Id := No_List; Box_Present : Boolean := False) return Node_Id; pragma Inline (Make_Formal_Package_Declaration); function Make_Attribute_Definition_Clause (Sloc : Source_Ptr; Name : Node_Id; Chars : Name_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_Attribute_Definition_Clause); function Make_Enumeration_Representation_Clause (Sloc : Source_Ptr; Identifier : Node_Id; Array_Aggregate : Node_Id) return Node_Id; pragma Inline (Make_Enumeration_Representation_Clause); function Make_Record_Representation_Clause (Sloc : Source_Ptr; Identifier : Node_Id; Mod_Clause : Node_Id := Empty; Component_Clauses : List_Id) return Node_Id; pragma Inline (Make_Record_Representation_Clause); function Make_Component_Clause (Sloc : Source_Ptr; Component_Name : Node_Id; Position : Node_Id; First_Bit : Node_Id; Last_Bit : Node_Id) return Node_Id; pragma Inline (Make_Component_Clause); function Make_Code_Statement (Sloc : Source_Ptr; Expression : Node_Id) return Node_Id; pragma Inline (Make_Code_Statement); function Make_Op_Rotate_Left (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Rotate_Left); function Make_Op_Rotate_Right (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Rotate_Right); function Make_Op_Shift_Left (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Shift_Left); function Make_Op_Shift_Right_Arithmetic (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Shift_Right_Arithmetic); function Make_Op_Shift_Right (Sloc : Source_Ptr; Left_Opnd : Node_Id; Right_Opnd : Node_Id) return Node_Id; pragma Inline (Make_Op_Shift_Right); function Make_Delta_Constraint (Sloc : Source_Ptr; Delta_Expression : Node_Id; Range_Constraint : Node_Id := Empty) return Node_Id; pragma Inline (Make_Delta_Constraint); function Make_At_Clause (Sloc : Source_Ptr; Identifier : Node_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_At_Clause); function Make_Mod_Clause (Sloc : Source_Ptr; Expression : Node_Id; Pragmas_Before : List_Id) return Node_Id; pragma Inline (Make_Mod_Clause); function Make_Conditional_Expression (Sloc : Source_Ptr; Expressions : List_Id) return Node_Id; pragma Inline (Make_Conditional_Expression); function Make_Expanded_Name (Sloc : Source_Ptr; Chars : Name_Id; Prefix : Node_Id; Selector_Name : Node_Id) return Node_Id; pragma Inline (Make_Expanded_Name); function Make_Free_Statement (Sloc : Source_Ptr; Expression : Node_Id) return Node_Id; pragma Inline (Make_Free_Statement); function Make_Freeze_Entity (Sloc : Source_Ptr; Actions : List_Id := No_List) return Node_Id; pragma Inline (Make_Freeze_Entity); function Make_Implicit_Label_Declaration (Sloc : Source_Ptr; Defining_Identifier : Node_Id) return Node_Id; pragma Inline (Make_Implicit_Label_Declaration); function Make_Itype_Reference (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Itype_Reference); function Make_Raise_Constraint_Error (Sloc : Source_Ptr; Condition : Node_Id := Empty) return Node_Id; pragma Inline (Make_Raise_Constraint_Error); function Make_Raise_Program_Error (Sloc : Source_Ptr; Condition : Node_Id := Empty) return Node_Id; pragma Inline (Make_Raise_Program_Error); function Make_Raise_Storage_Error (Sloc : Source_Ptr; Condition : Node_Id := Empty) return Node_Id; pragma Inline (Make_Raise_Storage_Error); function Make_Reference (Sloc : Source_Ptr; Prefix : Node_Id) return Node_Id; pragma Inline (Make_Reference); function Make_Subprogram_Info (Sloc : Source_Ptr; Identifier : Node_Id) return Node_Id; pragma Inline (Make_Subprogram_Info); function Make_Unchecked_Expression (Sloc : Source_Ptr; Expression : Node_Id) return Node_Id; pragma Inline (Make_Unchecked_Expression); function Make_Unchecked_Type_Conversion (Sloc : Source_Ptr; Subtype_Mark : Node_Id; Expression : Node_Id) return Node_Id; pragma Inline (Make_Unchecked_Type_Conversion); function Make_Validate_Unchecked_Conversion (Sloc : Source_Ptr) return Node_Id; pragma Inline (Make_Validate_Unchecked_Conversion); end Nmake;
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Elements.Subtype_Indications; with Program.Elements.Object_Access_Types; with Program.Element_Visitors; package Program.Nodes.Object_Access_Types is pragma Preelaborate; type Object_Access_Type is new Program.Nodes.Node and Program.Elements.Object_Access_Types.Object_Access_Type and Program.Elements.Object_Access_Types.Object_Access_Type_Text with private; function Create (Not_Token : Program.Lexical_Elements.Lexical_Element_Access; Null_Token : Program.Lexical_Elements.Lexical_Element_Access; Access_Token : not null Program.Lexical_Elements .Lexical_Element_Access; All_Token : Program.Lexical_Elements.Lexical_Element_Access; Constant_Token : Program.Lexical_Elements.Lexical_Element_Access; Subtype_Indication : not null Program.Elements.Subtype_Indications .Subtype_Indication_Access) return Object_Access_Type; type Implicit_Object_Access_Type is new Program.Nodes.Node and Program.Elements.Object_Access_Types.Object_Access_Type with private; function Create (Subtype_Indication : not null Program.Elements.Subtype_Indications .Subtype_Indication_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Not_Null : Boolean := False; Has_All : Boolean := False; Has_Constant : Boolean := False) return Implicit_Object_Access_Type with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Object_Access_Type is abstract new Program.Nodes.Node and Program.Elements.Object_Access_Types.Object_Access_Type with record Subtype_Indication : not null Program.Elements.Subtype_Indications .Subtype_Indication_Access; end record; procedure Initialize (Self : aliased in out Base_Object_Access_Type'Class); overriding procedure Visit (Self : not null access Base_Object_Access_Type; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Subtype_Indication (Self : Base_Object_Access_Type) return not null Program.Elements.Subtype_Indications .Subtype_Indication_Access; overriding function Is_Object_Access_Type_Element (Self : Base_Object_Access_Type) return Boolean; overriding function Is_Access_Type_Element (Self : Base_Object_Access_Type) return Boolean; overriding function Is_Type_Definition_Element (Self : Base_Object_Access_Type) return Boolean; overriding function Is_Definition_Element (Self : Base_Object_Access_Type) return Boolean; type Object_Access_Type is new Base_Object_Access_Type and Program.Elements.Object_Access_Types.Object_Access_Type_Text with record Not_Token : Program.Lexical_Elements.Lexical_Element_Access; Null_Token : Program.Lexical_Elements.Lexical_Element_Access; Access_Token : not null Program.Lexical_Elements .Lexical_Element_Access; All_Token : Program.Lexical_Elements.Lexical_Element_Access; Constant_Token : Program.Lexical_Elements.Lexical_Element_Access; end record; overriding function To_Object_Access_Type_Text (Self : aliased in out Object_Access_Type) return Program.Elements.Object_Access_Types .Object_Access_Type_Text_Access; overriding function Not_Token (Self : Object_Access_Type) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Null_Token (Self : Object_Access_Type) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Access_Token (Self : Object_Access_Type) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function All_Token (Self : Object_Access_Type) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Constant_Token (Self : Object_Access_Type) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Has_Not_Null (Self : Object_Access_Type) return Boolean; overriding function Has_All (Self : Object_Access_Type) return Boolean; overriding function Has_Constant (Self : Object_Access_Type) return Boolean; type Implicit_Object_Access_Type is new Base_Object_Access_Type with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; Has_Not_Null : Boolean; Has_All : Boolean; Has_Constant : Boolean; end record; overriding function To_Object_Access_Type_Text (Self : aliased in out Implicit_Object_Access_Type) return Program.Elements.Object_Access_Types .Object_Access_Type_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Object_Access_Type) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Object_Access_Type) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Object_Access_Type) return Boolean; overriding function Has_Not_Null (Self : Implicit_Object_Access_Type) return Boolean; overriding function Has_All (Self : Implicit_Object_Access_Type) return Boolean; overriding function Has_Constant (Self : Implicit_Object_Access_Type) return Boolean; end Program.Nodes.Object_Access_Types;
-- 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.Strings.Wide_Maps; package Ada.Strings.Wide_Bounded is pragma Preelaborate (Wide_Bounded); generic Max : Positive; -- Maximum length of a Bounded_Wide_String package Generic_Bounded_Length is Max_Length : constant Positive := Max; type Bounded_Wide_String is private; Null_Bounded_Wide_String : constant Bounded_Wide_String; subtype Length_Range is Natural range 0 .. Max_Length; function Length (Source : in Bounded_Wide_String) return Length_Range; -- Conversion, Concatenation, and Selection functions function To_Bounded_Wide_String (Source : in Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; function To_Wide_String (Source : in Bounded_Wide_String) return Wide_String; procedure Set_Bounded_Wide_String (Target : out Bounded_Wide_String; Source : in Wide_String; Drop : in Truncation := Error); function Append (Left, Right : in Bounded_Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; function Append (Left : in Bounded_Wide_String; Right : in Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; function Append (Left : in Wide_String; Right : in Bounded_Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; function Append (Left : in Bounded_Wide_String; Right : in Wide_Character; Drop : in Truncation := Error) return Bounded_Wide_String; function Append (Left : in Wide_Character; Right : in Bounded_Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; procedure Append (Source : in out Bounded_Wide_String; New_Item : in Bounded_Wide_String; Drop : in Truncation := Error); procedure Append (Source : in out Bounded_Wide_String; New_Item : in Wide_String; Drop : in Truncation := Error); procedure Append (Source : in out Bounded_Wide_String; New_Item : in Wide_Character; Drop : in Truncation := Error); function "&" (Left, Right : in Bounded_Wide_String) return Bounded_Wide_String; function "&" (Left : in Bounded_Wide_String; Right : in Wide_String) return Bounded_Wide_String; function "&" (Left : in Wide_String; Right : in Bounded_Wide_String) return Bounded_Wide_String; function "&" (Left : in Bounded_Wide_String; Right : in Wide_Character) return Bounded_Wide_String; function "&" (Left : in Wide_Character; Right : in Bounded_Wide_String) return Bounded_Wide_String; function Element (Source : in Bounded_Wide_String; Index : in Positive) return Wide_Character; procedure Replace_Element (Source : in out Bounded_Wide_String; Index : in Positive; By : in Wide_Character); function Slice (Source : in Bounded_Wide_String; Low : in Positive; High : in Natural) return Wide_String; function Bounded_Slice (Source : in Bounded_Wide_String; Low : in Positive; High : in Natural) return Bounded_Wide_String; procedure Bounded_Slice (Source : in Bounded_Wide_String; Target : out Bounded_Wide_String; Low : in Positive; High : in Natural); function "=" (Left, Right : in Bounded_Wide_String) return Boolean; function "=" (Left : in Bounded_Wide_String; Right : in Wide_String) return Boolean; function "=" (Left : in Wide_String; Right : in Bounded_Wide_String) return Boolean; function "<" (Left, Right : in Bounded_Wide_String) return Boolean; function "<" (Left : in Bounded_Wide_String; Right : in Wide_String) return Boolean; function "<" (Left : in Wide_String; Right : in Bounded_Wide_String) return Boolean; function "<=" (Left, Right : in Bounded_Wide_String) return Boolean; function "<=" (Left : in Bounded_Wide_String; Right : in Wide_String) return Boolean; function "<=" (Left : in Wide_String; Right : in Bounded_Wide_String) return Boolean; function ">" (Left, Right : in Bounded_Wide_String) return Boolean; function ">" (Left : in Bounded_Wide_String; Right : in Wide_String) return Boolean; function ">" (Left : in Wide_String; Right : in Bounded_Wide_String) return Boolean; function ">=" (Left, Right : in Bounded_Wide_String) return Boolean; function ">=" (Left : in Bounded_Wide_String; Right : in Wide_String) return Boolean; function ">=" (Left : in Wide_String; Right : in Bounded_Wide_String) return Boolean; -- Search subprograms function Index (Source : in Bounded_Wide_String; Pattern : in Wide_String; From : in Positive; Going : in Direction := Forward; Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural; function Index (Source : in Bounded_Wide_String; Pattern : in Wide_String; From : in Positive; Going : in Direction := Forward; Mapping : in Wide_Maps.Wide_Character_Mapping_Function) return Natural; function Index (Source : in Bounded_Wide_String; Pattern : in Wide_String; Going : in Direction := Forward; Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural; function Index (Source : in Bounded_Wide_String; Pattern : in Wide_String; Going : in Direction := Forward; Mapping : in Wide_Maps.Wide_Character_Mapping_Function) return Natural; function Index (Source : in Bounded_Wide_String; Set : in Wide_Maps.Wide_Character_Set; From : in Positive; Test : in Membership := Inside; Going : in Direction := Forward) return Natural; function Index (Source : in Bounded_Wide_String; Set : in Wide_Maps.Wide_Character_Set; Test : in Membership := Inside; Going : in Direction := Forward) return Natural; function Index_Non_Blank (Source : in Bounded_Wide_String; From : in Positive; Going : in Direction := Forward) return Natural; function Index_Non_Blank (Source : in Bounded_Wide_String; Going : in Direction := Forward) return Natural; function Count (Source : in Bounded_Wide_String; Pattern : in Wide_String; Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural; function Count (Source : in Bounded_Wide_String; Pattern : in Wide_String; Mapping : in Wide_Maps.Wide_Character_Mapping_Function) return Natural; function Count (Source : in Bounded_Wide_String; Set : in Wide_Maps.Wide_Character_Set) return Natural; procedure Find_Token (Source : in Bounded_Wide_String; Set : in Wide_Maps.Wide_Character_Set; Test : in Membership; First : out Positive; Last : out Natural); -- Wide_String translation subprograms function Translate (Source : in Bounded_Wide_String; Mapping : in Wide_Maps.Wide_Character_Mapping) return Bounded_Wide_String; procedure Translate (Source : in out Bounded_Wide_String; Mapping : in Wide_Maps.Wide_Character_Mapping); function Translate (Source : in Bounded_Wide_String; Mapping : in Wide_Maps.Wide_Character_Mapping_Function) return Bounded_Wide_String; procedure Translate (Source : in out Bounded_Wide_String; Mapping : in Wide_Maps.Wide_Character_Mapping_Function); -- Wide_String transformation subprograms function Replace_Slice (Source : in Bounded_Wide_String; Low : in Positive; High : in Natural; By : in Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; procedure Replace_Slice (Source : in out Bounded_Wide_String; Low : in Positive; High : in Natural; By : in Wide_String; Drop : in Truncation := Error); function Insert (Source : in Bounded_Wide_String; Before : in Positive; New_Item : in Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; procedure Insert (Source : in out Bounded_Wide_String; Before : in Positive; New_Item : in Wide_String; Drop : in Truncation := Error); function Overwrite (Source : in Bounded_Wide_String; Position : in Positive; New_Item : in Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; procedure Overwrite (Source : in out Bounded_Wide_String; Position : in Positive; New_Item : in Wide_String; Drop : in Truncation := Error); function Delete (Source : in Bounded_Wide_String; From : in Positive; Through : in Natural) return Bounded_Wide_String; procedure Delete (Source : in out Bounded_Wide_String; From : in Positive; Through : in Natural); --Wide_String selector subprograms function Trim (Source : in Bounded_Wide_String; Side : in Trim_End) return Bounded_Wide_String; procedure Trim (Source : in out Bounded_Wide_String; Side : in Trim_End); function Trim (Source : in Bounded_Wide_String; Left : in Wide_Maps.Wide_Character_Set; Right : in Wide_Maps.Wide_Character_Set) return Bounded_Wide_String; procedure Trim (Source : in out Bounded_Wide_String; Left : in Wide_Maps.Wide_Character_Set; Right : in Wide_Maps.Wide_Character_Set); function Head (Source : in Bounded_Wide_String; Count : in Natural; Pad : in Wide_Character := Wide_Space; Drop : in Truncation := Error) return Bounded_Wide_String; procedure Head (Source : in out Bounded_Wide_String; Count : in Natural; Pad : in Wide_Character := Wide_Space; Drop : in Truncation := Error); function Tail (Source : in Bounded_Wide_String; Count : in Natural; Pad : in Wide_Character := Wide_Space; Drop : in Truncation := Error) return Bounded_Wide_String; procedure Tail (Source : in out Bounded_Wide_String; Count : in Natural; Pad : in Wide_Character := Wide_Space; Drop : in Truncation := Error); --Wide_String constructor subprograms function "*" (Left : in Natural; Right : in Wide_Character) return Bounded_Wide_String; function "*" (Left : in Natural; Right : in Wide_String) return Bounded_Wide_String; function "*" (Left : in Natural; Right : in Bounded_Wide_String) return Bounded_Wide_String; function Replicate (Count : in Natural; Item : in Wide_Character; Drop : in Truncation := Error) return Bounded_Wide_String; function Replicate (Count : in Natural; Item : in Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; function Replicate (Count : in Natural; Item : in Bounded_Wide_String; Drop : in Truncation := Error) return Bounded_Wide_String; private type Bounded_Wide_String is null record; Null_Bounded_Wide_String : constant Bounded_Wide_String := (null record); end Generic_Bounded_Length; end Ada.Strings.Wide_Bounded;
<?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>gry2rgb</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>2</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>input_mat_data_V</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>input_mat.data.V</originalName> <rtlName></rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>1</bitwidth> </Value> <direction>0</direction> <if_type>3</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>output_mat_data_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>output_mat.data.V</originalName> <rtlName></rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>17</bitwidth> </Value> <direction>1</direction> <if_type>3</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>11</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>5</id> <name></name> <fileName>hls_video_block.cpp</fileName> <fileDirectory>C:\Users\parkerh\Documents\2d_filter_xfopencv</fileDirectory> <lineNumber>145</lineNumber> <contextFuncName>gry2rgb</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>C:\Users\parkerh\Documents\2d_filter_xfopencv</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>hls_video_block.cpp</first> <second>gry2rgb</second> </first> <second>145</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>23</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.65</m_delay> <m_topoIndex>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>7</id> <name>indvar_flatten</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>20</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>25</item> <item>26</item> <item>27</item> <item>28</item> </oprand_edges> <opcode>phi</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>2</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>8</id> <name>exitcond_flatten</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>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>29</item> <item>31</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.07</m_delay> <m_topoIndex>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>9</id> <name>indvar_flatten_next</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>20</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>32</item> <item>34</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.89</m_delay> <m_topoIndex>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>10</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> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>35</item> <item>36</item> <item>37</item> </oprand_edges> <opcode>br</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>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>14</id> <name>input_mat_data_V_rea</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>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>39</item> <item>40</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.83</m_delay> <m_topoIndex>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>15</id> <name>input_pixel_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>input_pixel.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>41</item> <item>43</item> <item>45</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.17</m_delay> <m_topoIndex>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>16</id> <name>tmp</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>17</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>47</item> <item>48</item> <item>49</item> <item>50</item> </oprand_edges> <opcode>bitconcatenate</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>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>17</id> <name></name> <fileName>hls_video_block.cpp</fileName> <fileDirectory>C:\Users\parkerh\Documents\2d_filter_xfopencv</fileDirectory> <lineNumber>152</lineNumber> <contextFuncName>gry2rgb</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\parkerh\Documents\2d_filter_xfopencv</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_video_block.cpp</first> <second>gry2rgb</second> </first> <second>152</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>52</item> <item>53</item> <item>54</item> </oprand_edges> <opcode>write</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.83</m_delay> <m_topoIndex>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>19</id> <name></name> <fileName>hls_video_block.cpp</fileName> <fileDirectory>C:\Users\parkerh\Documents\2d_filter_xfopencv</fileDirectory> <lineNumber>146</lineNumber> <contextFuncName>gry2rgb</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\parkerh\Documents\2d_filter_xfopencv</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_video_block.cpp</first> <second>gry2rgb</second> </first> <second>146</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>55</item> </oprand_edges> <opcode>br</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>10</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>21</id> <name></name> <fileName>hls_video_block.cpp</fileName> <fileDirectory>C:\Users\parkerh\Documents\2d_filter_xfopencv</fileDirectory> <lineNumber>155</lineNumber> <contextFuncName>gry2rgb</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\parkerh\Documents\2d_filter_xfopencv</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_video_block.cpp</first> <second>gry2rgb</second> </first> <second>155</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> <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>11</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_14"> <Value> <Obj> <type>2</type> <id>24</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>20</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_15"> <Value> <Obj> <type>2</type> <id>30</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>20</bitwidth> </Value> <const_type>0</const_type> <content>921600</content> </item> <item class_id_reference="16" object_id="_16"> <Value> <Obj> <type>2</type> <id>33</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>20</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_17"> <Value> <Obj> <type>2</type> <id>42</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>8</bitwidth> </Value> <const_type>0</const_type> <content>255</content> </item> <item class_id_reference="16" object_id="_18"> <Value> <Obj> <type>2</type> <id>44</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>8</bitwidth> </Value> <const_type>0</const_type> <content>0</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="_19"> <Obj> <type>3</type> <id>6</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>5</item> </node_objs> </item> <item class_id_reference="18" object_id="_20"> <Obj> <type>3</type> <id>11</id> <name>.preheader</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>7</item> <item>8</item> <item>9</item> <item>10</item> </node_objs> </item> <item class_id_reference="18" object_id="_21"> <Obj> <type>3</type> <id>20</id> <name>.preheader.preheader</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>5</count> <item_version>0</item_version> <item>14</item> <item>15</item> <item>16</item> <item>17</item> <item>19</item> </node_objs> </item> <item class_id_reference="18" object_id="_22"> <Obj> <type>3</type> <id>22</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>21</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>26</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_23"> <id>23</id> <edge_type>2</edge_type> <source_obj>11</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_24"> <id>25</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>7</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_25"> <id>26</id> <edge_type>2</edge_type> <source_obj>6</source_obj> <sink_obj>7</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_26"> <id>27</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>7</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_27"> <id>28</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>7</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_28"> <id>29</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_29"> <id>31</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_30"> <id>32</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_31"> <id>34</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_32"> <id>35</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_33"> <id>36</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_34"> <id>37</id> <edge_type>2</edge_type> <source_obj>22</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_35"> <id>40</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>14</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_36"> <id>41</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_37"> <id>43</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_38"> <id>45</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_39"> <id>48</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_40"> <id>49</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_41"> <id>50</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_42"> <id>53</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_43"> <id>54</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_44"> <id>55</id> <edge_type>2</edge_type> <source_obj>11</source_obj> <sink_obj>19</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_45"> <id>113</id> <edge_type>2</edge_type> <source_obj>6</source_obj> <sink_obj>11</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_46"> <id>114</id> <edge_type>2</edge_type> <source_obj>11</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_47"> <id>115</id> <edge_type>2</edge_type> <source_obj>11</source_obj> <sink_obj>20</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_48"> <id>116</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>11</sink_obj> <is_back_edge>1</is_back_edge> </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="_49"> <mId>1</mId> <mTag>gry2rgb</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>921602</mMinLatency> <mMaxLatency>921602</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_50"> <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>6</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> <item class_id_reference="22" object_id="_51"> <mId>3</mId> <mTag>Loop 1</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>11</item> <item>20</item> </basic_blocks> <mII>1</mII> <mDepth>2</mDepth> <mMinTripCount>921600</mMinTripCount> <mMaxTripCount>921600</mMaxTripCount> <mMinLatency>921600</mMinLatency> <mMaxLatency>921600</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_52"> <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>22</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="24" tracking_level="1" version="0" object_id="_53"> <states class_id="25" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_54"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_55"> <id>3</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_56"> <id>4</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_57"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_58"> <id>2</id> <operations> <count>4</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_59"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_60"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_61"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_62"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_63"> <id>3</id> <operations> <count>8</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_64"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_65"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_66"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_67"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_68"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_69"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_70"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_71"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_72"> <id>4</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_73"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_74"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>-1</id> <sop 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"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_75"> <inState>3</inState> <outState>2</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_76"> <inState>2</inState> <outState>4</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item class_id="34" tracking_level="0" version="0"> <first class_id="35" tracking_level="0" version="0"> <first>8</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_77"> <inState>2</inState> <outState>3</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>8</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="-1"></res> <node_label_latency class_id="37" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="38" tracking_level="0" version="0"> <first>5</first> <second class_id="39" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>7</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>8</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>9</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>10</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>14</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>3</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="40" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="41" tracking_level="0" version="0"> <first>6</first> <second class_id="42" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>20</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>22</first> <second> <first>2</first> <second>2</second> </second> </item> </bblk_ent_exit> <regions class_id="43" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="44" tracking_level="1" version="0" object_id="_78"> <region_name>Loop 1</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>11</item> <item>20</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>2</pipe_depth> </item> </regions> <dp_fu_nodes class_id="45" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>44</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>50</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>61</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> <item> <first>68</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>74</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>80</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>88</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="48" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="49" tracking_level="0" version="0"> <first>exitcond_flatten_fu_68</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>indvar_flatten_next_fu_74</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>indvar_flatten_phi_fu_61</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> <item> <first>input_pixel_V_fu_80</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>tmp_fu_88</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> </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>2</count> <item_version>0</item_version> <item> <first>StgValue_17_write_fu_50</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>input_mat_data_V_rea_read_fu_44</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="50" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>3</count> <item_version>0</item_version> <item> <first>57</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> <item> <first>99</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>103</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>3</count> <item_version>0</item_version> <item> <first>exitcond_flatten_reg_99</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>indvar_flatten_next_reg_103</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>indvar_flatten_reg_57</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>1</count> <item_version>0</item_version> <item> <first>57</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> </dp_reg_phi> <dp_regname_phi> <count>1</count> <item_version>0</item_version> <item> <first>indvar_flatten_reg_57</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> </dp_regname_phi> <dp_port_io_nodes class_id="51" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>input_mat_data_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> </second> </item> <item> <first>output_mat_data_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>write</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="53" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="54" tracking_level="0" version="0"> <first>1</first> <second>FIFO_SRL</second> </item> <item> <first>2</first> <second>FIFO_SRL</second> </item> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- A D A . C O N T A I N E R S . R E D _ B L A C K _ T R E E S . -- -- G E N E R I C _ S E T _ O P E R A T I O N S -- -- -- -- S p e c -- -- -- -- This specification is adapted from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ with Ada.Containers.Red_Black_Trees.Generic_Operations; generic with package Tree_Operations is new Generic_Operations (<>); use Tree_Operations.Tree_Types; with procedure Insert_With_Hint (Dst_Tree : in out Tree_Type; Dst_Hint : Node_Access; Src_Node : Node_Access; Dst_Node : out Node_Access); with function Copy_Tree (Source_Root : Node_Access) return Node_Access; with procedure Delete_Tree (X : in out Node_Access); with function Is_Less (Left, Right : Node_Access) return Boolean; with procedure Free (X : in out Node_Access); package Ada.Containers.Red_Black_Trees.Generic_Set_Operations is pragma Pure; procedure Union (Target : in out Tree_Type; Source : Tree_Type); function Union (Left, Right : Tree_Type) return Tree_Type; procedure Intersection (Target : in out Tree_Type; Source : Tree_Type); function Intersection (Left, Right : Tree_Type) return Tree_Type; procedure Difference (Target : in out Tree_Type; Source : Tree_Type); function Difference (Left, Right : Tree_Type) return Tree_Type; procedure Symmetric_Difference (Target : in out Tree_Type; Source : Tree_Type); function Symmetric_Difference (Left, Right : Tree_Type) return Tree_Type; function Is_Subset (Subset : Tree_Type; Of_Set : Tree_Type) return Boolean; function Overlap (Left, Right : Tree_Type) return Boolean; end Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S T Y L E G -- -- -- -- 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This version of the Style package implements the standard GNAT style -- checking rules. For documentation of these rules, see comments on the -- individual procedures. with Casing; use Casing; with Csets; use Csets; with Err_Vars; use Err_Vars; with Opt; use Opt; with Scans; use Scans; with Sinput; use Sinput; with Stylesw; use Stylesw; package body Styleg is use ASCII; Blank_Lines : Nat := 0; -- Counts number of empty lines seen. Reset to zero if a non-empty line -- is encountered. Used to check for trailing blank lines in Check_EOF, -- and for multiple blank lines. Blank_Line_Location : Source_Ptr; -- Remembers location of first blank line in a series. Used to issue an -- appropriate diagnostic if subsequent blank lines or the end of file -- is encountered. ----------------------- -- Local Subprograms -- ----------------------- procedure Check_No_Space_After; -- Checks that there is a non-white space character after the current -- token, or white space followed by a comment, or the end of line. -- Issue error message if not. procedure Check_No_Space_Before; -- Check that token is first token on line, or else is not preceded -- by white space. Signal error of space not allowed if not. function Determine_Token_Casing return Casing_Type; procedure Error_Space_Not_Allowed (S : Source_Ptr); -- Posts an error message indicating that a space is not allowed -- at the given source location. procedure Error_Space_Required (S : Source_Ptr); -- Posts an error message indicating that a space is required at -- the given source location. function Is_White_Space (C : Character) return Boolean; pragma Inline (Is_White_Space); -- Returns True for space, HT, VT or FF, False otherwise procedure Require_Following_Space; pragma Inline (Require_Following_Space); -- Require token to be followed by white space. Used only if in GNAT -- style checking mode. procedure Require_Preceding_Space; pragma Inline (Require_Preceding_Space); -- Require token to be preceded by white space. Used only if in GNAT -- style checking mode. ---------------------- -- Check_Abs_Or_Not -- ---------------------- -- In check tokens mode (-gnatyt), ABS/NOT must be followed by a space procedure Check_Abs_Not is begin if Style_Check_Tokens then if Source (Scan_Ptr) > ' ' then Error_Space_Required (Scan_Ptr); end if; end if; end Check_Abs_Not; ---------------------- -- Check_Apostrophe -- ---------------------- -- Do not allow space before or after apostrophe procedure Check_Apostrophe is begin if Style_Check_Tokens then Check_No_Space_After; end if; end Check_Apostrophe; ----------------- -- Check_Arrow -- ----------------- -- In check tokens mode (-gnatys), arrow must be surrounded by spaces procedure Check_Arrow is begin if Style_Check_Tokens then Require_Preceding_Space; Require_Following_Space; end if; end Check_Arrow; -------------------------- -- Check_Attribute_Name -- -------------------------- -- In check attribute casing mode (-gnatya), attribute names must be -- mixed case, i.e. start with an upper case letter, and otherwise -- lower case, except after an underline character. procedure Check_Attribute_Name (Reserved : Boolean) is pragma Warnings (Off, Reserved); begin if Style_Check_Attribute_Casing then if Determine_Token_Casing /= Mixed_Case then Error_Msg_SC ("(style) bad capitalization, mixed case required"); end if; end if; end Check_Attribute_Name; --------------------------- -- Check_Binary_Operator -- --------------------------- -- In check token mode (-gnatyt), binary operators other than the special -- case of exponentiation require surrounding space characters. procedure Check_Binary_Operator is begin if Style_Check_Tokens then Require_Preceding_Space; Require_Following_Space; end if; end Check_Binary_Operator; --------------- -- Check_Box -- --------------- -- In check token mode (-gnatyt), box must be preceded by a space or by -- a left parenthesis. Spacing checking on the surrounding tokens takes -- care of the remaining checks. procedure Check_Box is begin if Style_Check_Tokens then if Prev_Token /= Tok_Left_Paren then Require_Preceding_Space; end if; end if; end Check_Box; ----------------- -- Check_Colon -- ----------------- -- In check token mode (-gnatyt), colon must be surrounded by spaces procedure Check_Colon is begin if Style_Check_Tokens then Require_Preceding_Space; Require_Following_Space; end if; end Check_Colon; ----------------------- -- Check_Colon_Equal -- ----------------------- -- In check token mode (-gnatyt), := must be surrounded by spaces procedure Check_Colon_Equal is begin if Style_Check_Tokens then Require_Preceding_Space; Require_Following_Space; end if; end Check_Colon_Equal; ----------------- -- Check_Comma -- ----------------- -- In check token mode (-gnatyt), comma must be either the first -- token on a line, or be preceded by a non-blank character. -- It must also always be followed by a blank. procedure Check_Comma is begin if Style_Check_Tokens then Check_No_Space_Before; if Source (Scan_Ptr) > ' ' then Error_Space_Required (Scan_Ptr); end if; end if; end Check_Comma; ------------------- -- Check_Comment -- ------------------- -- In check comment mode (-gnatyc) there are several requirements on the -- format of comments. The following are permissible comment formats: -- 1. Any comment that is not at the start of a line, i.e. where the -- initial minuses are not the first non-blank characters on the -- line must have at least one blank after the second minus. -- 2. A row of all minuses of any length is permitted (see procedure -- box above in the source of this routine). -- 3. A comment line starting with two minuses and a space, and ending -- with a space and two minuses. Again see the procedure title box -- immediately above in the source. -- 4. A full line comment where two spaces follow the two minus signs. -- This is the normal comment format in GNAT style, as typified by -- the comments you are reading now. -- 5. A full line comment where the first character after the second -- minus is a special character, i.e. a character in the ASCII -- range 16#21#..16#2F# or 16#3A#..16#3F#. This allows special -- comments, such as those generated by gnatprep, or those that -- appear in the SPARK annotation language to be accepted. -- -- Note: for GNAT internal files (-gnatg switch set on for the -- compilation), the only special sequence recognized and allowed -- is --! as generated by gnatprep. procedure Check_Comment is S : Source_Ptr; C : Character; function Is_Box_Comment return Boolean; -- Returns True if the last two characters on the line are -- which -- characterizes a box comment (as for example follows this spec). -------------------- -- Is_Box_Comment -- -------------------- function Is_Box_Comment return Boolean is S : Source_Ptr; begin -- Do we need to worry about UTF_32 line terminators here ??? S := Scan_Ptr + 3; while Source (S) not in Line_Terminator loop S := S + 1; end loop; return Source (S - 1) = '-' and then Source (S - 2) = '-'; end Is_Box_Comment; -- Start of processing for Check_Comment begin -- Can never have a non-blank character preceding the first minus if Style_Check_Comments then if Scan_Ptr > Source_First (Current_Source_File) and then Source (Scan_Ptr - 1) > ' ' then Error_Msg_S ("(style) space required"); end if; end if; -- For a comment that is not at the start of the line, the only -- requirement is that we cannot have a non-blank character after -- the second minus sign. if Scan_Ptr /= First_Non_Blank_Location then if Style_Check_Comments then if Source (Scan_Ptr + 2) > ' ' then Error_Msg ("(style) space required", Scan_Ptr + 2); end if; end if; return; -- Case of a comment that is at the start of a line else -- First check, must be in appropriately indented column if Style_Check_Indentation /= 0 then if Start_Column rem Style_Check_Indentation /= 0 then Error_Msg_S ("(style) bad column"); return; end if; end if; -- If we are not checking comments, nothing to do if not Style_Check_Comments then return; end if; -- Case of not followed by a blank. Usually wrong, but there are -- some exceptions that we permit. if Source (Scan_Ptr + 2) /= ' ' then C := Source (Scan_Ptr + 2); -- Case of -- all on its own on a line is OK if C < ' ' then return; end if; -- Case of --x, x special character is OK (gnatprep/SPARK/etc.) -- This is not permitted in internal GNAT implementation units -- except for the case of --! as used by gnatprep output. if GNAT_Mode then if C = '!' then return; end if; else if Character'Pos (C) in 16#21# .. 16#2F# or else Character'Pos (C) in 16#3A# .. 16#3F# then return; end if; end if; -- The only other case in which we allow a character after -- the -- other than a space is when we have a row of minus -- signs (case of header lines for a box comment for example). S := Scan_Ptr + 2; while Source (S) >= ' ' loop if Source (S) /= '-' then if Is_Box_Comment then Error_Space_Required (Scan_Ptr + 2); else Error_Msg ("(style) two spaces required", Scan_Ptr + 2); end if; return; end if; S := S + 1; end loop; -- If we are followed by a blank, then the comment is OK if the -- character following this blank is another blank or a format -- effector. elsif Source (Scan_Ptr + 3) <= ' ' then return; -- Here is the case where we only have one blank after the two -- minus signs, which is an error unless the line ends with two -- minus signs, the case of a box comment. elsif not Is_Box_Comment then Error_Space_Required (Scan_Ptr + 3); end if; end if; end Check_Comment; ------------------- -- Check_Dot_Dot -- ------------------- -- In check token mode (-gnatyt), colon must be surrounded by spaces procedure Check_Dot_Dot is begin if Style_Check_Tokens then Require_Preceding_Space; Require_Following_Space; end if; end Check_Dot_Dot; --------------- -- Check_EOF -- --------------- -- In check blanks at end mode, check no blank lines precede the EOF procedure Check_EOF is begin if Style_Check_Blank_Lines then -- We expect one blank line, from the EOF, but no more than one if Blank_Lines = 2 then Error_Msg ("(style) blank line not allowed at end of file", Blank_Line_Location); elsif Blank_Lines >= 3 then Error_Msg ("(style) blank lines not allowed at end of file", Blank_Line_Location); end if; end if; end Check_EOF; ----------------------------------- -- Check_Exponentiation_Operator -- ----------------------------------- -- No spaces are required for the ** operator in GNAT style check mode procedure Check_Exponentiation_Operator is begin null; end Check_Exponentiation_Operator; -------------- -- Check_HT -- -------------- -- In check horizontal tab mode (-gnatyh), tab characters are not allowed procedure Check_HT is begin if Style_Check_Horizontal_Tabs then Error_Msg_S ("(style) horizontal tab not allowed"); end if; end Check_HT; ----------------------- -- Check_Indentation -- ----------------------- -- In check indentation mode (-gnatyn for n a digit), a new statement or -- declaration is required to start in a column that is a multiple of the -- indentiation amount. procedure Check_Indentation is begin if Style_Check_Indentation /= 0 then if Token_Ptr = First_Non_Blank_Location and then Start_Column rem Style_Check_Indentation /= 0 then Error_Msg_SC ("(style) bad indentation"); end if; end if; end Check_Indentation; ---------------------- -- Check_Left_Paren -- ---------------------- -- In tone check mode (-gnatyt), left paren must not be preceded by an -- identifier character or digit (a separating space is required) and -- may never be followed by a space. procedure Check_Left_Paren is begin if Style_Check_Tokens then if Token_Ptr > Source_First (Current_Source_File) and then Identifier_Char (Source (Token_Ptr - 1)) then Error_Space_Required (Token_Ptr); end if; Check_No_Space_After; end if; end Check_Left_Paren; --------------------------- -- Check_Line_Max_Length -- --------------------------- -- In check max line length mode (-gnatym), the line length must -- not exceed the permitted maximum value. procedure Check_Line_Max_Length (Len : Int) is begin if Style_Check_Max_Line_Length then if Len > Style_Max_Line_Length then Error_Msg ("(style) this line is too long", Current_Line_Start + Source_Ptr (Style_Max_Line_Length)); end if; end if; end Check_Line_Max_Length; --------------------------- -- Check_Line_Terminator -- --------------------------- -- In check blanks at end mode (-gnatyb), lines may not end with a -- trailing space. -- In check form feeds mode (-gnatyf), the line terminator may not -- be either of the characters FF or VT. -- In check DOS line terminators node (-gnatyd), the line terminator -- must be a single LF, without a following CR. procedure Check_Line_Terminator (Len : Int) is S : Source_Ptr; L : Int := Len; -- Length of line (adjusted down for blanks at end of line) begin -- Reset count of blank lines if first line if Get_Logical_Line_Number (Scan_Ptr) = 1 then Blank_Lines := 0; end if; -- Check FF/VT terminators if Style_Check_Form_Feeds then if Source (Scan_Ptr) = ASCII.FF then Error_Msg_S ("(style) form feed not allowed"); elsif Source (Scan_Ptr) = ASCII.VT then Error_Msg_S ("(style) vertical tab not allowed"); end if; end if; -- Check DOS line terminator (ignore EOF, since we only get called -- with an EOF if it is the last character in the buffer, and was -- therefore not present in the sources if Style_Check_DOS_Line_Terminator then if Source (Scan_Ptr) = EOF then null; elsif Source (Scan_Ptr) /= LF or else Source (Scan_Ptr + 1) = CR then Error_Msg_S ("(style) incorrect line terminator"); end if; end if; -- Remove trailing spaces S := Scan_Ptr; while L > 0 and then Is_White_Space (Source (S - 1)) loop S := S - 1; L := L - 1; end loop; -- Issue message for blanks at end of line if option enabled if Style_Check_Blanks_At_End and then L < Len then Error_Msg ("(style) trailing spaces not permitted", S); end if; -- Deal with empty (blank) line if L = 0 then -- Increment blank line count Blank_Lines := Blank_Lines + 1; -- If first blank line, record location for later error message if Blank_Lines = 1 then Blank_Line_Location := Scan_Ptr; end if; -- Non-blank line, check for previous multiple blank lines else if Style_Check_Blank_Lines and then Blank_Lines > 1 then Error_Msg ("(style) multiple blank lines", Blank_Line_Location); end if; -- And reset blank line count Blank_Lines := 0; end if; end Check_Line_Terminator; -------------------------- -- Check_No_Space_After -- -------------------------- procedure Check_No_Space_After is S : Source_Ptr; begin if Is_White_Space (Source (Scan_Ptr)) then -- Allow one or more spaces if followed by comment S := Scan_Ptr + 1; loop if Source (S) = '-' and then Source (S + 1) = '-' then return; elsif Is_White_Space (Source (S)) then S := S + 1; else exit; end if; end loop; Error_Space_Not_Allowed (Scan_Ptr); end if; end Check_No_Space_After; --------------------------- -- Check_No_Space_Before -- --------------------------- procedure Check_No_Space_Before is begin if Token_Ptr > First_Non_Blank_Location and then Source (Token_Ptr - 1) <= ' ' then Error_Space_Not_Allowed (Token_Ptr - 1); end if; end Check_No_Space_Before; ----------------------- -- Check_Pragma_Name -- ----------------------- -- In check pragma casing mode (-gnatyp), pragma names must be mixed -- case, i.e. start with an upper case letter, and otherwise lower case, -- except after an underline character. procedure Check_Pragma_Name is begin if Style_Check_Pragma_Casing then if Determine_Token_Casing /= Mixed_Case then Error_Msg_SC ("(style) bad capitalization, mixed case required"); end if; end if; end Check_Pragma_Name; ----------------------- -- Check_Right_Paren -- ----------------------- -- In check tokens mode (-gnatyt), right paren must never be preceded by -- a space unless it is the initial non-blank character on the line. procedure Check_Right_Paren is begin if Style_Check_Tokens then Check_No_Space_Before; end if; end Check_Right_Paren; --------------------- -- Check_Semicolon -- --------------------- -- In check tokens mode (-gnatyt), semicolon does not permit a preceding -- space and a following space is required. procedure Check_Semicolon is begin if Style_Check_Tokens then Check_No_Space_Before; if Source (Scan_Ptr) > ' ' then Error_Space_Required (Scan_Ptr); end if; end if; end Check_Semicolon; ---------------- -- Check_Then -- ---------------- -- In check if then layout mode (-gnatyi), we expect a THEN keyword -- to appear either on the same line as the IF, or on a separate line -- after multiple conditions. In any case, it may not appear on the -- line immediately following the line with the IF. procedure Check_Then (If_Loc : Source_Ptr) is begin if Style_Check_If_Then_Layout then if Get_Physical_Line_Number (Token_Ptr) = Get_Physical_Line_Number (If_Loc) + 1 then Error_Msg_SC ("(style) misplaced THEN"); end if; end if; end Check_Then; ------------------------------- -- Check_Unary_Plus_Or_Minus -- ------------------------------- -- In check tokem mode (-gnatyt), unary plus or minus must not be -- followed by a space. procedure Check_Unary_Plus_Or_Minus is begin if Style_Check_Tokens then Check_No_Space_After; end if; end Check_Unary_Plus_Or_Minus; ------------------------ -- Check_Vertical_Bar -- ------------------------ -- In check token mode (-gnatyt), vertical bar must be surrounded by spaces procedure Check_Vertical_Bar is begin if Style_Check_Tokens then Require_Preceding_Space; Require_Following_Space; end if; end Check_Vertical_Bar; ----------------------- -- Check_Xtra_Parens -- ----------------------- procedure Check_Xtra_Parens (Loc : Source_Ptr) is begin if Style_Check_Xtra_Parens then Error_Msg ("redundant parentheses?", Loc); end if; end Check_Xtra_Parens; ---------------------------- -- Determine_Token_Casing -- ---------------------------- function Determine_Token_Casing return Casing_Type is begin return Determine_Casing (Source (Token_Ptr .. Scan_Ptr - 1)); end Determine_Token_Casing; ----------------------------- -- Error_Space_Not_Allowed -- ----------------------------- procedure Error_Space_Not_Allowed (S : Source_Ptr) is begin Error_Msg ("(style) space not allowed", S); end Error_Space_Not_Allowed; -------------------------- -- Error_Space_Required -- -------------------------- procedure Error_Space_Required (S : Source_Ptr) is begin Error_Msg ("(style) space required", S); end Error_Space_Required; -------------------- -- Is_White_Space -- -------------------- function Is_White_Space (C : Character) return Boolean is begin return C = ' ' or else C = HT; end Is_White_Space; ------------------- -- Mode_In_Check -- ------------------- function Mode_In_Check return Boolean is begin return Style_Check and Style_Check_Mode_In; end Mode_In_Check; ----------------- -- No_End_Name -- ----------------- -- In check end/exit labels mode (-gnatye), always require the name of -- a subprogram or package to be present on the END, so this is an error. procedure No_End_Name (Name : Node_Id) is begin if Style_Check_End_Labels then Error_Msg_Node_1 := Name; Error_Msg_SP ("(style) `END &` required"); end if; end No_End_Name; ------------------ -- No_Exit_Name -- ------------------ -- In check end/exit labels mode (-gnatye), always require the name of -- the loop to be present on the EXIT when exiting a named loop. procedure No_Exit_Name (Name : Node_Id) is begin if Style_Check_End_Labels then Error_Msg_Node_1 := Name; Error_Msg_SP ("(style) `EXIT &` required"); end if; end No_Exit_Name; ---------------------------- -- Non_Lower_Case_Keyword -- ---------------------------- -- In check casing mode (-gnatyk), reserved keywords must be be spelled -- in all lower case (excluding keywords range, access, delta and digits -- used as attribute designators). procedure Non_Lower_Case_Keyword is begin if Style_Check_Keyword_Casing then Error_Msg_SC ("(style) reserved words must be all lower case"); end if; end Non_Lower_Case_Keyword; ----------------------------- -- Require_Following_Space -- ----------------------------- procedure Require_Following_Space is begin if Source (Scan_Ptr) > ' ' then Error_Space_Required (Scan_Ptr); end if; end Require_Following_Space; ----------------------------- -- Require_Preceding_Space -- ----------------------------- procedure Require_Preceding_Space is begin if Token_Ptr > Source_First (Current_Source_File) and then Source (Token_Ptr - 1) > ' ' then Error_Space_Required (Token_Ptr); end if; end Require_Preceding_Space; --------------------- -- RM_Column_Check -- --------------------- function RM_Column_Check return Boolean is begin return Style_Check and Style_Check_Layout; end RM_Column_Check; end Styleg;
-- Copyright 2007-2021 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/>. package Defs is type Struct1 is limited record X : Integer := 13; Y : Integer := 19; end record; function F1 (S : Struct1) return Integer; S1 : Struct1; end Defs;
-- Copyright 2017-2021 Bartek thindil Jasicki -- -- This file is part of Steam Sky. -- -- Steam Sky 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. -- -- Steam Sky 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 Steam Sky. If not, see <http://www.gnu.org/licenses/>. -- ****h* Ships/SUpgrade -- FUNCTION -- Provided code for upgrade player ship modules -- SOURCE package Ships.Upgrade is -- **** -- ****e* SUpgrade/SUpgrade.Ship_Upgrade_Error -- FUNCTION -- Raised when player can't start upgrading module -- SOURCE Ship_Upgrade_Error: exception; -- **** -- ****f* SUpgrade/SUpgrade.StartUpgrading -- FUNCTION -- Set upgrading order -- PARAMETERS -- ModuleIndex - Player ship index of module to upgrade -- UpgradeType - Type of upgrade to start -- SOURCE procedure StartUpgrading (ModuleIndex: Modules_Container.Extended_Index; UpgradeType: Positive) with Pre => (ModuleIndex in Player_Ship.Modules.First_Index .. Player_Ship.Modules.Last_Index and UpgradeType < 5), Test_Case => (Name => "Test_StartUpgrading", Mode => Nominal); -- **** -- ****f* SUpgrade/SUpgrade.UpgradeShip -- FUNCTION -- Upgrade selected module on ship -- PARAMETERS -- Minutes - Amount of passed in-game minutes -- SOURCE procedure UpgradeShip(Minutes: Positive) with Test_Case => (Name => "Test_UpgradeShip", Mode => Robustness); -- **** end Ships.Upgrade;
----------------------------------------------------------------------- -- security-random -- Random numbers for nonce, secret keys, token generation -- Copyright (C) 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.Streams; with Ada.Finalization; with Interfaces; with Util.Encoders.AES; private with Ada.Numerics.Discrete_Random; -- == Random Generator == -- The <tt>Security.Random</tt> package defines the <tt>Generator</tt> tagged type -- which provides operations to generate random tokens intended to be used for -- a nonce, access token, salt or other purposes. The generator is intended to be -- used in multi-task environments as it implements the low level random generation -- within a protected type. The generator defines a <tt>Generate</tt> operation -- that returns either a binary random array or the base64url encoding of the -- binary array. package Keystore.Random is type Generator is limited new Ada.Finalization.Limited_Controlled with private; -- Initialize the random generator. overriding procedure Initialize (Gen : in out Generator); -- Fill the array with pseudo-random numbers. procedure Generate (Gen : in out Generator; Into : out Ada.Streams.Stream_Element_Array); -- Fill the secret with pseudo-random numbers. procedure Generate (Gen : in out Generator; Into : out Secret_Key); procedure Generate (Gen : in out Generator; Into : out UUID_Type); -- Generate a random sequence of bits and convert the result -- into a string in base64url. function Generate (Gen : in out Generator'Class; Bits : in Positive) return String; function Generate (Gen : in out Generator'Class) return Interfaces.Unsigned_32; private package Id_Random is new Ada.Numerics.Discrete_Random (Interfaces.Unsigned_32); -- Protected type to allow using the random generator by several tasks. protected type Raw_Generator is procedure Generate (Into : out Ada.Streams.Stream_Element_Array); procedure Generate (Value : out Interfaces.Unsigned_32); procedure Reset; private -- Random number generator used for ID generation. Rand : Id_Random.Generator; end Raw_Generator; type Generator is limited new Ada.Finalization.Limited_Controlled with record Rand : Raw_Generator; end record; end Keystore.Random;
----------------------------------------------------------------------------- -- -- -- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS -- -- -- -- I n t e r f a c e s . C . S Y S T E M _ C o n s t a n t s -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- Copyright (c) 1991,1992,1993,1994, FSU, All Rights Reserved -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU Library General Public License as published by the -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. GNARL is distributed in the hope that it will be use- -- -- ful, but but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gen- -- -- eral Library Public License for more details. You should have received -- -- a copy of the GNU Library General Public License along with GNARL; see -- -- file COPYING.LIB. If not, write to the Free Software Foundation, 675 -- -- Mass Ave, Cambridge, MA 02139, USA. -- -- -- ----------------------------------------------------------------------------- package Interfaces.C.System_Constants is pthread_t_size : constant Integer := 1; pthread_attr_t_size : constant Integer := 13; pthread_mutexattr_t_size : constant Integer := 3; pthread_mutex_t_size : constant Integer := 8; pthread_condattr_t_size : constant Integer := 1; pthread_cond_t_size : constant Integer := 5; pthread_key_t_size : constant Integer := 1; jmp_buf_size : constant Integer := 12; sigjmp_buf_size : constant Integer := 19; sigset_t_size : constant Integer := 4; SIG_BLOCK : constant := 1; SIG_UNBLOCK : constant := 2; SIG_SETMASK : constant := 3; SA_NOCLDSTOP : constant := 131072; SA_SIGINFO : constant := 8; SIG_ERR : constant := -1; SIG_DFL : constant := 0; SIG_IGN : constant := 1; SIGNULL : constant := 0; SIGHUP : constant := 1; SIGINT : constant := 2; SIGQUIT : constant := 3; SIGILL : constant := 4; SIGABRT : constant := 6; SIGFPE : constant := 8; SIGKILL : constant := 9; SIGSEGV : constant := 11; SIGPIPE : constant := 13; SIGALRM : constant := 14; SIGTERM : constant := 15; SIGSTOP : constant := 23; SIGTSTP : constant := 24; SIGCONT : constant := 25; SIGCHLD : constant := 18; SIGTTIN : constant := 26; SIGTTOU : constant := 27; SIGUSR1 : constant := 16; SIGUSR2 : constant := 17; NSIG : constant := 44; -- OS specific signals represented as an array type Sig_Array is array (positive range <>) of integer; OS_Specific_Sync_Sigs : Sig_Array := (NSIG, 5, 7, 10); OS_Specific_Async_Sigs : Sig_Array := (NSIG, 12, 21, 22, 30, 31, 28, 29, 20); -- End of OS specific signals representation EPERM : constant := 1; ENOENT : constant := 2; ESRCH : constant := 3; EINTR : constant := 4; EIO : constant := 5; ENXIO : constant := 6; E2BIG : constant := 7; ENOEXEC : constant := 8; EBADF : constant := 9; ECHILD : constant := 10; EAGAIN : constant := 11; ENOMEM : constant := 12; EACCES : constant := 13; EFAULT : constant := 14; ENOTBLK : constant := 15; EBUSY : constant := 16; EEXIST : constant := 17; EXDEV : constant := 18; ENODEV : constant := 19; ENOTDIR : constant := 20; EISDIR : constant := 21; EINVAL : constant := 22; ENFILE : constant := 23; EMFILE : constant := 24; ENOTTY : constant := 25; ETXTBSY : constant := 26; EFBIG : constant := 27; ENOSPC : constant := 28; ESPIPE : constant := 29; EROFS : constant := 30; EMLINK : constant := 31; EPIPE : constant := 32; ENAMETOOLONG : constant := 78; ENOTEMPTY : constant := 93; EDEADLK : constant := 45; ENOLCK : constant := 46; ENOSYS : constant := 89; ENOTSUP : constant := 48; NO_PRIO_INHERIT : constant := 0; PRIO_INHERIT : constant := 1; PRIO_PROTECT : constant := 2; Add_Prio : constant Integer := 2; end Interfaces.C.System_Constants;
with Ada.Text_IO; with Trendy_Terminal.Environments; with Trendy_Terminal.IO; with Trendy_Terminal.Platform; with Trendy_Terminal.Example.Input; use Trendy_Terminal.Example.Input; procedure Trendy_Terminal_Example is Env : Trendy_Terminal.Environments.Environment; begin if not Env.Is_Available then Ada.Text_IO.Put_Line ("Unable to initialize Trendy Terminal."); return; end if; Trendy_Terminal.Platform.Set (Trendy_Terminal.Platform.Echo, False); Trendy_Terminal.Platform.Set (Trendy_Terminal.Platform.Line_Input, False); Trendy_Terminal.Platform.Set (Trendy_Terminal.Platform.Escape_Sequences, True); Trendy_Terminal.Platform.Set (Trendy_Terminal.Platform.Signals_As_Input, True); Trendy_Terminal.IO.Put_Line ("Hello, world."); Trendy_Terminal.IO.Put_Line ("Columns"); Trendy_Terminal.IO.Put_Line ("12345678901234567890123456789012345678901234567890"); Trendy_Terminal.IO.Put ("Move to column: "); Trendy_Terminal.IO.Set_Col (20); Trendy_Terminal.IO.Put_Line ("At column 20"); Trendy_Terminal.Example.Input.Run_Print_Input; end Trendy_Terminal_Example;
-- Auteurs : -- Equipe : -- Mini-projet 1 : Le jeu du devin with Ada.Text_Io; use Ada.Text_Io; with Ada.Integer_Text_Io; use Ada.Integer_Text_Io; -- Deviner le nombre de l'utilisateur en interagissant avec lui. procedure Deviner_Nombre is --! declarations des variables du programme principal BorneMin: Integer; -- la borne minimale. BorneMax: Integer; -- la borne maximale. Nombre: Integer; -- le nombre que l'ordinateur devine Essaies: Integer; -- le nombre d'essaies Choix: Character; -- le choix de l'utilisateur begin -- Demander à l'utilisateur de deviner le nombre. loop Put("Avez-vous choisi un nombre compris entre 1 et 999 (o/n) ? "); Get(Choix); if Choix = 'n' then Put_Line("J'attends..."); end if; exit when Choix = 'o'; end loop; -- Initialiser les variables BorneMin := 1; BorneMax := 999; Nombre := 500; Essaies := 0; -- Chercher le nombre deviné loop -- Mettre à jour les variables if Choix = 'g' then BorneMax := Nombre - 1; elsif Choix = 'p' then BorneMin := Nombre + 1; end if; -- Verifier si l'utilisateur ne triche pas if BorneMax < BorneMin then Put_Line("Vous trichez. J'arrête cette partie."); return; end if; -- Calculer le nombre Nombre := (BorneMin + BorneMax)/2; -- Valeur médiane -- Incrementer les essaies Essaies := Essaies + 1; -- Afficher la proposition Put ("Je propose "); Put (Item => Nombre, Width => 1); Put_Line(""); -- Saisir l'indice loop Put("Votre indice (t/p/g) ? "); Get(Choix); exit when Choix = 't' or Choix = 'p' or Choix = 'g'; end loop; exit when Choix = 't'; end loop; -- Afficher le nombre trouvé Put ("J'ai trouvé "); Put (Item => Nombre, Width => 1); Put(" en "); Put (Item => Essaies, Width => 1); Put(" essai(s)."); end Deviner_Nombre;
------------------------------------------------------------------------------ -- -- -- ASIS-for-GNAT IMPLEMENTATION COMPONENTS -- -- -- -- A S I S . I T E R A T O R -- -- -- -- B o d y -- -- -- -- Copyright (C) 1995-2010, Free Software Foundation, Inc. -- -- -- -- ASIS-for-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 -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. ASIS-for-GNAT is distributed in the hope that it will be use- -- -- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- -- -- CHANTABILITY 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 ASIS-for-GNAT; see file -- -- COPYING. If not, write to the Free Software Foundation, 51 Franklin -- -- Street, Fifth Floor, Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the -- -- Software Engineering Laboratory of the Swiss Federal Institute of -- -- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the -- -- Scientific Research Computer Center of Moscow State University (SRCC -- -- MSU), Russia, with funding partially provided by grants from the Swiss -- -- National Science Foundation and the Swiss Academy of Engineering -- -- Sciences. ASIS-for-GNAT is now maintained by AdaCore -- -- (http://www.adacore.com). -- -- -- ------------------------------------------------------------------------------ with Asis.Elements; with Asis.Exceptions; use Asis.Exceptions; with A4G.Vcheck; use A4G.Vcheck; with A4G.Queries; use A4G.Queries; ----------------------------------------------------------------- -- -- -- Process_Children is the function that gets all the children -- -- and calls Recursive_Traversal on them. To get the children -- -- it uses a function that takes an element and returns all -- -- the queries that can obtain children from this element. -- -- (see asis_elements-queries.ads) -- -- -- -- This way, the generic body to instanciate doesn't contain -- -- the procedures that obtain the children, the code is not -- -- duplicated, and so we have a gain in performance (time & -- -- memory). -- -- -- -- Concerning the Control, all Pre and Post-conditions have -- -- been put at the begining and end of the procedures and -- -- blocks that deal with them. -- -- -- -- The (Control = Terminate_Immediatly) has been handled by -- -- returning from all the recursive calls ... -- -- -- ----------------------------------------------------------------- package body Asis.Iterator is procedure Traverse_Element (Element : Asis.Element; Control : in out Traverse_Control; State : in out State_Information) is procedure Recursive_Traversal (Element : Asis.Element; Control : in out Traverse_Control); -- This procedure does the main job procedure Traverse_Children (Element : Asis.Element; Control : in out Traverse_Control); -- Traverses children of a given construct ------------------------------------------------------ -- Pre-condition: any value of Control is possible -- ------------------------------------------------------ procedure Traverse_Children (Element : Asis.Element; Control : in out Traverse_Control) is -- The value of Control has been set by Pre_Operation -- Child access is an array containing access to the functions -- needed to access element's children Child_Access : constant Query_Array := Appropriate_Queries (Element); function Do_Return return Boolean; -- Check and reset the Control value on return from the traverse. -- the boolean returned says wether or not the program should -- return function Do_Return return Boolean is begin -------------------------------------------------------- -- Post-condition: Control = Continue -- -- or Control = Abandon_Siblings -- -- or Control = Terminate_Immediately -- -------------------------------------------------------- case Control is when Terminate_Immediately => return True; when Continue => return False; when Abandon_Siblings => Control := Continue; -- to continue the traversal of the parent -- of the Each_Child (that is, Element) with -- its Post_Operation return True; -- to prevent traversal of Each_Child siblings when Abandon_Children => -- this choice could never been chosen!!! return False; end case; --------------------------------------------------------------- -- Post-Condition : Control = Continue (True or False) -- -- or Control = Terminate_Immediately (True) -- --------------------------------------------------------------- end Do_Return; begin -- Traverse_Children -- Validity Check has already been done ------------------------------------------ -- Pre-condition: Control = Continue -- ------------------------------------------ -- Classify the Element using the various kinds queries. -- Query for all children of the Element in left-to-right order. -- Perform a depth-first traversal on each child. -- The only possibility for Control is to be equal to Continue here! -- If the current Element has no children, Control remains to be -- equal to Continue for Each_Query in Child_Access'Range loop case Child_Access (Each_Query).Query_Kind is when Bug => raise Internal_Implementation_Error; when Single_Element_Query => declare Child : constant Asis.Element := Child_Access (Each_Query).Func_Simple (Element); begin if Asis.Elements.Element_Kind (Child) /= Not_An_Element then Recursive_Traversal (Child, Control); if Do_Return then return; end if; end if; end; when Element_List_Query => declare Child_List : constant Asis.Element_List := Child_Access (Each_Query).Func_List (Element); begin -- If the list is empty, it's ok ... nothing is processed for Each_Element in Child_List'Range loop Recursive_Traversal (Child_List (Each_Element), Control); if Do_Return then return; end if; end loop; end; when Element_List_Query_With_Boolean => declare Child_List : constant Asis.Element_List := Child_Access (Each_Query).Func_List_Boolean (Element, Child_Access (Each_Query).Bool); begin -- If the list is empty, it's ok ... nothing is processed for Each_Element in Child_List'Range loop Recursive_Traversal (Child_List (Each_Element), Control); if Do_Return then return; end if; end loop; end; end case; end loop; ------------------------------------------- -- Post-condition: Control = Continue -- ------------------------------------------- -- if Terminate_Immediately was set, we -- -- just do not entry this procedure ... -- ------------------------------------------- end Traverse_Children; -------------------------------------------------------- -- Post-condition: any value of Control is possible, -- -------------------------------------------------------- ------------------------- -- Recursive_Traversal -- ------------------------- ---------------------------------------- -- Pre-condition: Control = Continue -- ---------------------------------------- procedure Recursive_Traversal (Element : Asis.Element; Control : in out Traverse_Control) is begin ---------------------------------------- -- Pre-condition: Control = Continue -- ---------------------------------------- begin Pre_Operation (Element, Control, State); -- Visit the Element. exception when ASIS_Inappropriate_Context | ASIS_Inappropriate_Container | ASIS_Inappropriate_Compilation_Unit | ASIS_Inappropriate_Element | ASIS_Inappropriate_Line | ASIS_Inappropriate_Line_Number | ASIS_Failed => Add_Call_Information ( Argument => Element, Outer_Call => "Actual procedure for Pre_Operation"); raise; end; -------------------------------------------------------- -- Post-condition: any value of Control is possible -- -------------------------------------------------------- if Control = Continue then Traverse_Children (Element, Control); end if; -------------------------------------------------------- -- Pre-condition: any value of Control is possible, -- -------------------------------------------------------- case Control is when Terminate_Immediately => return; when Continue => begin -- Revisit the Element Post_Operation (Element, Control, State); exception when ASIS_Inappropriate_Context | ASIS_Inappropriate_Container | ASIS_Inappropriate_Compilation_Unit | ASIS_Inappropriate_Element | ASIS_Inappropriate_Line | ASIS_Inappropriate_Line_Number | ASIS_Failed => Add_Call_Information ( Argument => Element, Outer_Call => "Actual procedure for Post_Operation"); raise; end; -- reset the Control set by Post_Operation: case Control is when Terminate_Immediately => return; when Continue => null; when Abandon_Children => Control := Continue; -- the current Element has no children to traverse -- anymore! when Abandon_Siblings => null; end case; when Abandon_Children => -- OK, we abandonned the children, now we go up and continue Control := Continue; when Abandon_Siblings => null; end case; --------------------------------------------------------- -- Post-condition: Control = Continue -- -- or Control = Abandon_Siblings -- -- or Control = Terminate_Immediately -- --------------------------------------------------------- end Recursive_Traversal; --------------------------------------------------------- -- Post-condition: Control = Continue -- -- or Control = Abandon_Siblings -- -- or Control = Terminate_Immediately -- --------------------------------------------------------- --------------------------------- -- Traversal_Element Main body -- --------------------------------- begin Check_Validity (Element, "Asis.Elements.Traverse_Element"); if Asis.Elements.Is_Nil (Element) then Raise_ASIS_Inappropriate_Element ("Asis.Iterator.Traverse_Element", Wrong_Kind => Not_An_Element); elsif Control /= Continue then return; end if; ---------------------------------------- -- Pre-condition: Control = Continue -- ---------------------------------------- Recursive_Traversal (Element => Element, Control => Control); exception when ASIS_Inappropriate_Element | ASIS_Inappropriate_Context | ASIS_Inappropriate_Container | ASIS_Inappropriate_Compilation_Unit | ASIS_Inappropriate_Line | ASIS_Inappropriate_Line_Number | ASIS_Failed => Add_Call_Information (Argument => Element, Outer_Call => "Asis.Iterator.Traverse_Element"); raise; -- when others => -- Actual Pre- and Postoperations can raise whatever they want, and -- at the level of Traverse_Element we can (and should) do nothing -- with this. So we just let this exception go ahead -- raise; end Traverse_Element; end Asis.Iterator;
-- Copyright 2017 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local json = require("json") name = "ZoomEye" type = "api" function start() setratelimit(3) end function check() local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c ~= nil and c.username ~= nil and c.password ~= nil and c.username ~= "" and c.password ~= "") then return true end return false end function vertical(ctx, domain) local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c == nil or c.username == nil or c.username == "" or c.password == nil or c.password == "") then return end local token = bearer_token(c.username, c.password) if token == "" then return end local resp local vurl = buildurl(domain) -- Check if the response data is in the graph database if (cfg.ttl ~= nil and cfg.ttl > 0) then resp = obtain_response(domain, cfg.ttl) end if (resp == nil or resp == "") then local err resp, err = request({ url=vurl, headers={ ['Content-Type']="application/json", ['Authorization']="JWT " .. token, }, }) if (err ~= nil and err ~= "") then log(ctx, err .. ": " .. resp) return end if (cfg.ttl ~= nil and cfg.ttl > 0) then cache_response(domain, resp) end end local d = json.decode(resp) if (d == nil or d.total == 0 or d.available == 0 or #(d.matches) == 0) then return end for i, host in pairs(d.matches) do sendnames(ctx, host.rdns) sendnames(ctx, host['rdns_new']) newaddr(ctx, domain, host.ip) end -- Just in case sendnames(ctx, resp) end function buildurl(domain) return "https://api.zoomeye.org/host/search?query=hostname:*." .. domain end function bearer_token(username, password) local body, err = json.encode({ username=username, password=password, }) if (err ~= nil and err ~= "") then return "" end resp, err = request({ method="POST", data=body, url="https://api.zoomeye.org/user/login", headers={['Content-Type']="application/json"}, }) if (err ~= nil and err ~= "") then return "" end local d = json.decode(resp) if (d == nil or d.access_token == nil or d.access_token == "") then return "" end return d.access_token end function sendnames(ctx, content) local names = find(content, subdomainre) if names == nil then return end local found = {} for i, v in pairs(names) do if found[v] == nil then newname(ctx, v) found[v] = true end end end
pragma Style_Checks (Off); -- This spec has been automatically generated from STM32H743x.svd pragma Restrictions (No_Elaboration_Code); with HAL; with System; package STM32_SVD.ADC is pragma Preelaborate; --------------- -- Registers -- --------------- -- ISR_AWD array type ISR_AWD_Field_Array is array (1 .. 3) of Boolean with Component_Size => 1, Size => 3; -- Type definition for ISR_AWD type ISR_AWD_Field (As_Array : Boolean := False) is record case As_Array is when False => -- AWD as a value Val : HAL.UInt3; when True => -- AWD as an array Arr : ISR_AWD_Field_Array; end case; end record with Unchecked_Union, Size => 3; for ISR_AWD_Field use record Val at 0 range 0 .. 2; Arr at 0 range 0 .. 2; end record; -- ADC interrupt and status register type ISR_Register is record -- ADC ready flag ADRDY : Boolean := False; -- ADC group regular end of sampling flag EOSMP : Boolean := False; -- ADC group regular end of unitary conversion flag EOC : Boolean := False; -- ADC group regular end of sequence conversions flag EOS : Boolean := False; -- ADC group regular overrun flag OVR : Boolean := False; -- ADC group injected end of unitary conversion flag JEOC : Boolean := False; -- ADC group injected end of sequence conversions flag JEOS : Boolean := False; -- ADC analog watchdog 1 flag AWD : ISR_AWD_Field := (As_Array => False, Val => 16#0#); -- ADC group injected contexts queue overflow flag JQOVF : Boolean := False; -- unspecified Reserved_11_11 : HAL.Bit := 16#0#; -- ADC LDO output voltage ready flag LDORDY : Boolean := False; -- unspecified Reserved_13_31 : HAL.UInt19 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for ISR_Register use record ADRDY at 0 range 0 .. 0; EOSMP at 0 range 1 .. 1; EOC at 0 range 2 .. 2; EOS at 0 range 3 .. 3; OVR at 0 range 4 .. 4; JEOC at 0 range 5 .. 5; JEOS at 0 range 6 .. 6; AWD at 0 range 7 .. 9; JQOVF at 0 range 10 .. 10; Reserved_11_11 at 0 range 11 .. 11; LDORDY at 0 range 12 .. 12; Reserved_13_31 at 0 range 13 .. 31; end record; -- ADC interrupt enable register type IER_Register is record -- ADC ready interrupt ADRDYIE : Boolean := False; -- ADC group regular end of sampling interrupt EOSMPIE : Boolean := False; -- ADC group regular end of unitary conversion interrupt EOCIE : Boolean := False; -- ADC group regular end of sequence conversions interrupt EOSIE : Boolean := False; -- ADC group regular overrun interrupt OVRIE : Boolean := False; -- ADC group injected end of unitary conversion interrupt JEOCIE : Boolean := False; -- ADC group injected end of sequence conversions interrupt JEOSIE : Boolean := False; -- ADC analog watchdog 1 interrupt AWD1IE : Boolean := False; -- ADC analog watchdog 2 interrupt AWD2IE : Boolean := False; -- ADC analog watchdog 3 interrupt AWD3IE : Boolean := False; -- ADC group injected contexts queue overflow interrupt JQOVFIE : Boolean := False; -- unspecified Reserved_11_31 : HAL.UInt21 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IER_Register use record ADRDYIE at 0 range 0 .. 0; EOSMPIE at 0 range 1 .. 1; EOCIE at 0 range 2 .. 2; EOSIE at 0 range 3 .. 3; OVRIE at 0 range 4 .. 4; JEOCIE at 0 range 5 .. 5; JEOSIE at 0 range 6 .. 6; AWD1IE at 0 range 7 .. 7; AWD2IE at 0 range 8 .. 8; AWD3IE at 0 range 9 .. 9; JQOVFIE at 0 range 10 .. 10; Reserved_11_31 at 0 range 11 .. 31; end record; -- CR_LINCALRDYW array type CR_LINCALRDYW_Field_Array is array (1 .. 6) of Boolean with Component_Size => 1, Size => 6; -- Type definition for CR_LINCALRDYW type CR_LINCALRDYW_Field (As_Array : Boolean := False) is record case As_Array is when False => -- LINCALRDYW as a value Val : HAL.UInt6; when True => -- LINCALRDYW as an array Arr : CR_LINCALRDYW_Field_Array; end case; end record with Unchecked_Union, Size => 6; for CR_LINCALRDYW_Field use record Val at 0 range 0 .. 5; Arr at 0 range 0 .. 5; end record; -- ADC control register type CR_Register is record -- ADC enable ADEN : Boolean := False; -- ADC disable ADDIS : Boolean := False; -- ADC group regular conversion start ADSTART : Boolean := False; -- ADC group injected conversion start JADSTART : Boolean := False; -- ADC group regular conversion stop ADSTP : Boolean := False; -- ADC group injected conversion stop JADSTP : Boolean := False; -- unspecified Reserved_6_7 : HAL.UInt2 := 16#0#; -- Boost mode control BOOST : Boolean := False; -- unspecified Reserved_9_15 : HAL.UInt7 := 16#0#; -- Linearity calibration ADCALLIN : Boolean := False; -- unspecified Reserved_17_21 : HAL.UInt5 := 16#0#; -- Linearity calibration ready Word 1 LINCALRDYW : CR_LINCALRDYW_Field := (As_Array => False, Val => 16#0#); -- ADC voltage regulator enable ADVREGEN : Boolean := False; -- ADC deep power down enable DEEPPWD : Boolean := False; -- ADC differential mode for calibration ADCALDIF : Boolean := False; -- ADC calibration ADCAL : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CR_Register use record ADEN at 0 range 0 .. 0; ADDIS at 0 range 1 .. 1; ADSTART at 0 range 2 .. 2; JADSTART at 0 range 3 .. 3; ADSTP at 0 range 4 .. 4; JADSTP at 0 range 5 .. 5; Reserved_6_7 at 0 range 6 .. 7; BOOST at 0 range 8 .. 8; Reserved_9_15 at 0 range 9 .. 15; ADCALLIN at 0 range 16 .. 16; Reserved_17_21 at 0 range 17 .. 21; LINCALRDYW at 0 range 22 .. 27; ADVREGEN at 0 range 28 .. 28; DEEPPWD at 0 range 29 .. 29; ADCALDIF at 0 range 30 .. 30; ADCAL at 0 range 31 .. 31; end record; subtype CFGR_DMNGT_Field is HAL.UInt2; subtype CFGR_RES_Field is HAL.UInt3; subtype CFGR_EXTSEL_Field is HAL.UInt5; subtype CFGR_EXTEN_Field is HAL.UInt2; subtype CFGR_DISCNUM_Field is HAL.UInt3; subtype CFGR_AWD1CH_Field is HAL.UInt5; -- ADC configuration register 1 type CFGR_Register is record -- ADC DMA transfer enable DMNGT : CFGR_DMNGT_Field := 16#0#; -- ADC data resolution RES : CFGR_RES_Field := 16#0#; -- ADC group regular external trigger source EXTSEL : CFGR_EXTSEL_Field := 16#0#; -- ADC group regular external trigger polarity EXTEN : CFGR_EXTEN_Field := 16#0#; -- ADC group regular overrun configuration OVRMOD : Boolean := False; -- ADC group regular continuous conversion mode CONT : Boolean := False; -- ADC low power auto wait AUTDLY : Boolean := False; -- unspecified Reserved_15_15 : HAL.Bit := 16#0#; -- ADC group regular sequencer discontinuous mode DISCEN : Boolean := False; -- ADC group regular sequencer discontinuous number of ranks DISCNUM : CFGR_DISCNUM_Field := 16#0#; -- ADC group injected sequencer discontinuous mode JDISCEN : Boolean := False; -- ADC group injected contexts queue mode JQM : Boolean := False; -- ADC analog watchdog 1 monitoring a single channel or all channels AWD1SGL : Boolean := False; -- ADC analog watchdog 1 enable on scope ADC group regular AWD1EN : Boolean := False; -- ADC analog watchdog 1 enable on scope ADC group injected JAWD1EN : Boolean := False; -- ADC group injected automatic trigger mode JAUTO : Boolean := False; -- ADC analog watchdog 1 monitored channel selection AWD1CH : CFGR_AWD1CH_Field := 16#0#; -- ADC group injected contexts queue disable JQDIS : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CFGR_Register use record DMNGT at 0 range 0 .. 1; RES at 0 range 2 .. 4; EXTSEL at 0 range 5 .. 9; EXTEN at 0 range 10 .. 11; OVRMOD at 0 range 12 .. 12; CONT at 0 range 13 .. 13; AUTDLY at 0 range 14 .. 14; Reserved_15_15 at 0 range 15 .. 15; DISCEN at 0 range 16 .. 16; DISCNUM at 0 range 17 .. 19; JDISCEN at 0 range 20 .. 20; JQM at 0 range 21 .. 21; AWD1SGL at 0 range 22 .. 22; AWD1EN at 0 range 23 .. 23; JAWD1EN at 0 range 24 .. 24; JAUTO at 0 range 25 .. 25; AWD1CH at 0 range 26 .. 30; JQDIS at 0 range 31 .. 31; end record; subtype CFGR2_OVSS_Field is HAL.UInt4; -- CFGR2_RSHIFT array type CFGR2_RSHIFT_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for CFGR2_RSHIFT type CFGR2_RSHIFT_Field (As_Array : Boolean := False) is record case As_Array is when False => -- RSHIFT as a value Val : HAL.UInt4; when True => -- RSHIFT as an array Arr : CFGR2_RSHIFT_Field_Array; end case; end record with Unchecked_Union, Size => 4; for CFGR2_RSHIFT_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; subtype CFGR2_OSR_Field is HAL.UInt10; subtype CFGR2_LSHIFT_Field is HAL.UInt4; -- ADC configuration register 2 type CFGR2_Register is record -- ADC oversampler enable on scope ADC group regular ROVSE : Boolean := False; -- ADC oversampler enable on scope ADC group injected JOVSE : Boolean := False; -- unspecified Reserved_2_4 : HAL.UInt3 := 16#0#; -- ADC oversampling shift OVSS : CFGR2_OVSS_Field := 16#0#; -- ADC oversampling discontinuous mode (triggered mode) for ADC group -- regular TROVS : Boolean := False; -- Regular Oversampling mode ROVSM : Boolean := False; -- Right-shift data after Offset 1 correction RSHIFT : CFGR2_RSHIFT_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_15_15 : HAL.Bit := 16#0#; -- Oversampling ratio OSR : CFGR2_OSR_Field := 16#0#; -- unspecified Reserved_26_27 : HAL.UInt2 := 16#0#; -- Left shift factor LSHIFT : CFGR2_LSHIFT_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CFGR2_Register use record ROVSE at 0 range 0 .. 0; JOVSE at 0 range 1 .. 1; Reserved_2_4 at 0 range 2 .. 4; OVSS at 0 range 5 .. 8; TROVS at 0 range 9 .. 9; ROVSM at 0 range 10 .. 10; RSHIFT at 0 range 11 .. 14; Reserved_15_15 at 0 range 15 .. 15; OSR at 0 range 16 .. 25; Reserved_26_27 at 0 range 26 .. 27; LSHIFT at 0 range 28 .. 31; end record; -- SMPR1_SMP array element subtype SMPR1_SMP_Element is HAL.UInt3; -- SMPR1_SMP array type SMPR1_SMP_Field_Array is array (1 .. 9) of SMPR1_SMP_Element with Component_Size => 3, Size => 27; -- Type definition for SMPR1_SMP type SMPR1_SMP_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SMP as a value Val : HAL.UInt27; when True => -- SMP as an array Arr : SMPR1_SMP_Field_Array; end case; end record with Unchecked_Union, Size => 27; for SMPR1_SMP_Field use record Val at 0 range 0 .. 26; Arr at 0 range 0 .. 26; end record; -- ADC sampling time register 1 type SMPR1_Register is record -- unspecified Reserved_0_2 : HAL.UInt3 := 16#0#; -- ADC channel 1 sampling time selection SMP : SMPR1_SMP_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SMPR1_Register use record Reserved_0_2 at 0 range 0 .. 2; SMP at 0 range 3 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- SMPR2_SMP array element subtype SMPR2_SMP_Element is HAL.UInt3; -- SMPR2_SMP array type SMPR2_SMP_Field_Array is array (10 .. 19) of SMPR2_SMP_Element with Component_Size => 3, Size => 30; -- Type definition for SMPR2_SMP type SMPR2_SMP_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SMP as a value Val : HAL.UInt30; when True => -- SMP as an array Arr : SMPR2_SMP_Field_Array; end case; end record with Unchecked_Union, Size => 30; for SMPR2_SMP_Field use record Val at 0 range 0 .. 29; Arr at 0 range 0 .. 29; end record; -- ADC sampling time register 2 type SMPR2_Register is record -- ADC channel 10 sampling time selection SMP : SMPR2_SMP_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SMPR2_Register use record SMP at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; subtype PCSEL_PCSEL_Field is HAL.UInt20; -- ADC pre channel selection register type PCSEL_Register is record -- Channel x (VINP[i]) pre selection PCSEL : PCSEL_PCSEL_Field := 16#0#; -- unspecified Reserved_20_31 : HAL.UInt12 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PCSEL_Register use record PCSEL at 0 range 0 .. 19; Reserved_20_31 at 0 range 20 .. 31; end record; subtype LTR1_LTR1_Field is HAL.UInt26; -- ADC analog watchdog 1 threshold register type LTR1_Register is record -- ADC analog watchdog 1 threshold low LTR1 : LTR1_LTR1_Field := 16#3FF0000#; -- unspecified Reserved_26_31 : HAL.UInt6 := 16#3#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for LTR1_Register use record LTR1 at 0 range 0 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype HTR1_HTR1_Field is HAL.UInt26; -- ADC analog watchdog 1 threshold register type HTR1_Register is record -- ADC analog watchdog 1 threshold low HTR1 : HTR1_HTR1_Field := 16#3FF0000#; -- unspecified Reserved_26_31 : HAL.UInt6 := 16#3#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HTR1_Register use record HTR1 at 0 range 0 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype SQR1_L_Field is HAL.UInt4; subtype SQR1_SQ1_Field is HAL.UInt5; subtype SQR1_SQ2_Field is HAL.UInt5; subtype SQR1_SQ3_Field is HAL.UInt5; subtype SQR1_SQ4_Field is HAL.UInt5; -- ADC group regular sequencer ranks register 1 type SQR1_Register is record -- L L : SQR1_L_Field := 16#0#; -- unspecified Reserved_4_5 : HAL.UInt2 := 16#0#; -- ADC group regular sequencer rank 1 SQ1 : SQR1_SQ1_Field := 16#0#; -- unspecified Reserved_11_11 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 2 SQ2 : SQR1_SQ2_Field := 16#0#; -- unspecified Reserved_17_17 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 3 SQ3 : SQR1_SQ3_Field := 16#0#; -- unspecified Reserved_23_23 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 4 SQ4 : SQR1_SQ4_Field := 16#0#; -- unspecified Reserved_29_31 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SQR1_Register use record L at 0 range 0 .. 3; Reserved_4_5 at 0 range 4 .. 5; SQ1 at 0 range 6 .. 10; Reserved_11_11 at 0 range 11 .. 11; SQ2 at 0 range 12 .. 16; Reserved_17_17 at 0 range 17 .. 17; SQ3 at 0 range 18 .. 22; Reserved_23_23 at 0 range 23 .. 23; SQ4 at 0 range 24 .. 28; Reserved_29_31 at 0 range 29 .. 31; end record; subtype SQR2_SQ5_Field is HAL.UInt5; subtype SQR2_SQ6_Field is HAL.UInt5; subtype SQR2_SQ7_Field is HAL.UInt5; subtype SQR2_SQ8_Field is HAL.UInt5; subtype SQR2_SQ9_Field is HAL.UInt5; -- ADC group regular sequencer ranks register 2 type SQR2_Register is record -- ADC group regular sequencer rank 5 SQ5 : SQR2_SQ5_Field := 16#0#; -- unspecified Reserved_5_5 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 6 SQ6 : SQR2_SQ6_Field := 16#0#; -- unspecified Reserved_11_11 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 7 SQ7 : SQR2_SQ7_Field := 16#0#; -- unspecified Reserved_17_17 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 8 SQ8 : SQR2_SQ8_Field := 16#0#; -- unspecified Reserved_23_23 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 9 SQ9 : SQR2_SQ9_Field := 16#0#; -- unspecified Reserved_29_31 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SQR2_Register use record SQ5 at 0 range 0 .. 4; Reserved_5_5 at 0 range 5 .. 5; SQ6 at 0 range 6 .. 10; Reserved_11_11 at 0 range 11 .. 11; SQ7 at 0 range 12 .. 16; Reserved_17_17 at 0 range 17 .. 17; SQ8 at 0 range 18 .. 22; Reserved_23_23 at 0 range 23 .. 23; SQ9 at 0 range 24 .. 28; Reserved_29_31 at 0 range 29 .. 31; end record; subtype SQR3_SQ10_Field is HAL.UInt5; subtype SQR3_SQ11_Field is HAL.UInt5; subtype SQR3_SQ12_Field is HAL.UInt5; subtype SQR3_SQ13_Field is HAL.UInt5; subtype SQR3_SQ14_Field is HAL.UInt5; -- ADC group regular sequencer ranks register 3 type SQR3_Register is record -- ADC group regular sequencer rank 10 SQ10 : SQR3_SQ10_Field := 16#0#; -- unspecified Reserved_5_5 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 11 SQ11 : SQR3_SQ11_Field := 16#0#; -- unspecified Reserved_11_11 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 12 SQ12 : SQR3_SQ12_Field := 16#0#; -- unspecified Reserved_17_17 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 13 SQ13 : SQR3_SQ13_Field := 16#0#; -- unspecified Reserved_23_23 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 14 SQ14 : SQR3_SQ14_Field := 16#0#; -- unspecified Reserved_29_31 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SQR3_Register use record SQ10 at 0 range 0 .. 4; Reserved_5_5 at 0 range 5 .. 5; SQ11 at 0 range 6 .. 10; Reserved_11_11 at 0 range 11 .. 11; SQ12 at 0 range 12 .. 16; Reserved_17_17 at 0 range 17 .. 17; SQ13 at 0 range 18 .. 22; Reserved_23_23 at 0 range 23 .. 23; SQ14 at 0 range 24 .. 28; Reserved_29_31 at 0 range 29 .. 31; end record; subtype SQR4_SQ15_Field is HAL.UInt5; subtype SQR4_SQ16_Field is HAL.UInt5; -- ADC group regular sequencer ranks register 4 type SQR4_Register is record -- ADC group regular sequencer rank 15 SQ15 : SQR4_SQ15_Field := 16#0#; -- unspecified Reserved_5_5 : HAL.Bit := 16#0#; -- ADC group regular sequencer rank 16 SQ16 : SQR4_SQ16_Field := 16#0#; -- unspecified Reserved_11_31 : HAL.UInt21 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SQR4_Register use record SQ15 at 0 range 0 .. 4; Reserved_5_5 at 0 range 5 .. 5; SQ16 at 0 range 6 .. 10; Reserved_11_31 at 0 range 11 .. 31; end record; subtype JSQR_JL_Field is HAL.UInt2; subtype JSQR_JEXTSEL_Field is HAL.UInt5; subtype JSQR_JEXTEN_Field is HAL.UInt2; subtype JSQR_JSQ1_Field is HAL.UInt5; subtype JSQR_JSQ2_Field is HAL.UInt5; subtype JSQR_JSQ3_Field is HAL.UInt5; subtype JSQR_JSQ4_Field is HAL.UInt5; -- ADC group injected sequencer register type JSQR_Register is record -- ADC group injected sequencer scan length JL : JSQR_JL_Field := 16#0#; -- ADC group injected external trigger source JEXTSEL : JSQR_JEXTSEL_Field := 16#0#; -- ADC group injected external trigger polarity JEXTEN : JSQR_JEXTEN_Field := 16#0#; -- ADC group injected sequencer rank 1 JSQ1 : JSQR_JSQ1_Field := 16#0#; -- unspecified Reserved_14_14 : HAL.Bit := 16#0#; -- ADC group injected sequencer rank 2 JSQ2 : JSQR_JSQ2_Field := 16#0#; -- unspecified Reserved_20_20 : HAL.Bit := 16#0#; -- ADC group injected sequencer rank 3 JSQ3 : JSQR_JSQ3_Field := 16#0#; -- unspecified Reserved_26_26 : HAL.Bit := 16#0#; -- ADC group injected sequencer rank 4 JSQ4 : JSQR_JSQ4_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for JSQR_Register use record JL at 0 range 0 .. 1; JEXTSEL at 0 range 2 .. 6; JEXTEN at 0 range 7 .. 8; JSQ1 at 0 range 9 .. 13; Reserved_14_14 at 0 range 14 .. 14; JSQ2 at 0 range 15 .. 19; Reserved_20_20 at 0 range 20 .. 20; JSQ3 at 0 range 21 .. 25; Reserved_26_26 at 0 range 26 .. 26; JSQ4 at 0 range 27 .. 31; end record; subtype OFR1_OFFSET1_Field is HAL.UInt26; subtype OFR1_OFFSET1_CH_Field is HAL.UInt5; -- ADC offset number 1 register type OFR1_Register is record -- ADC offset number 1 offset level OFFSET1 : OFR1_OFFSET1_Field := 16#0#; -- ADC offset number 1 channel selection OFFSET1_CH : OFR1_OFFSET1_CH_Field := 16#0#; -- ADC offset number 1 enable SSATE : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for OFR1_Register use record OFFSET1 at 0 range 0 .. 25; OFFSET1_CH at 0 range 26 .. 30; SSATE at 0 range 31 .. 31; end record; subtype OFR2_OFFSET2_Field is HAL.UInt26; subtype OFR2_OFFSET2_CH_Field is HAL.UInt5; -- ADC offset number 2 register type OFR2_Register is record -- ADC offset number 1 offset level OFFSET2 : OFR2_OFFSET2_Field := 16#0#; -- ADC offset number 1 channel selection OFFSET2_CH : OFR2_OFFSET2_CH_Field := 16#0#; -- ADC offset number 1 enable SSATE : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for OFR2_Register use record OFFSET2 at 0 range 0 .. 25; OFFSET2_CH at 0 range 26 .. 30; SSATE at 0 range 31 .. 31; end record; subtype OFR3_OFFSET3_Field is HAL.UInt26; subtype OFR3_OFFSET3_CH_Field is HAL.UInt5; -- ADC offset number 3 register type OFR3_Register is record -- ADC offset number 1 offset level OFFSET3 : OFR3_OFFSET3_Field := 16#0#; -- ADC offset number 1 channel selection OFFSET3_CH : OFR3_OFFSET3_CH_Field := 16#0#; -- ADC offset number 1 enable SSATE : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for OFR3_Register use record OFFSET3 at 0 range 0 .. 25; OFFSET3_CH at 0 range 26 .. 30; SSATE at 0 range 31 .. 31; end record; subtype OFR4_OFFSET4_Field is HAL.UInt26; subtype OFR4_OFFSET4_CH_Field is HAL.UInt5; -- ADC offset number 4 register type OFR4_Register is record -- ADC offset number 1 offset level OFFSET4 : OFR4_OFFSET4_Field := 16#0#; -- ADC offset number 1 channel selection OFFSET4_CH : OFR4_OFFSET4_CH_Field := 16#0#; -- ADC offset number 1 enable SSATE : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for OFR4_Register use record OFFSET4 at 0 range 0 .. 25; OFFSET4_CH at 0 range 26 .. 30; SSATE at 0 range 31 .. 31; end record; subtype AWD2CR_AWD2CH_Field is HAL.UInt20; -- ADC analog watchdog 2 configuration register type AWD2CR_Register is record -- ADC analog watchdog 2 monitored channel selection AWD2CH : AWD2CR_AWD2CH_Field := 16#0#; -- unspecified Reserved_20_31 : HAL.UInt12 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AWD2CR_Register use record AWD2CH at 0 range 0 .. 19; Reserved_20_31 at 0 range 20 .. 31; end record; subtype AWD3CR_AWD3CH_Field is HAL.UInt20; -- ADC analog watchdog 3 configuration register type AWD3CR_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- ADC analog watchdog 3 monitored channel selection AWD3CH : AWD3CR_AWD3CH_Field := 16#0#; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AWD3CR_Register use record Reserved_0_0 at 0 range 0 .. 0; AWD3CH at 0 range 1 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; subtype LTR2_LTR2_Field is HAL.UInt26; -- ADC watchdog lower threshold register 2 type LTR2_Register is record -- Analog watchdog 2 lower threshold LTR2 : LTR2_LTR2_Field := 16#0#; -- unspecified Reserved_26_31 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for LTR2_Register use record LTR2 at 0 range 0 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype HTR2_HTR2_Field is HAL.UInt26; -- ADC watchdog higher threshold register 2 type HTR2_Register is record -- Analog watchdog 2 higher threshold HTR2 : HTR2_HTR2_Field := 16#0#; -- unspecified Reserved_26_31 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HTR2_Register use record HTR2 at 0 range 0 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype LTR3_LTR3_Field is HAL.UInt26; -- ADC watchdog lower threshold register 3 type LTR3_Register is record -- Analog watchdog 3 lower threshold LTR3 : LTR3_LTR3_Field := 16#0#; -- unspecified Reserved_26_31 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for LTR3_Register use record LTR3 at 0 range 0 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype HTR3_HTR3_Field is HAL.UInt26; -- ADC watchdog higher threshold register 3 type HTR3_Register is record -- Analog watchdog 3 higher threshold HTR3 : HTR3_HTR3_Field := 16#0#; -- unspecified Reserved_26_31 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HTR3_Register use record HTR3 at 0 range 0 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; subtype DIFSEL_DIFSEL_Field is HAL.UInt20; -- ADC channel differential or single-ended mode selection register type DIFSEL_Register is record -- ADC channel differential or single-ended mode for channel DIFSEL : DIFSEL_DIFSEL_Field := 16#0#; -- unspecified Reserved_20_31 : HAL.UInt12 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for DIFSEL_Register use record DIFSEL at 0 range 0 .. 19; Reserved_20_31 at 0 range 20 .. 31; end record; subtype CALFACT_CALFACT_S_Field is HAL.UInt11; subtype CALFACT_CALFACT_D_Field is HAL.UInt11; -- ADC calibration factors register type CALFACT_Register is record -- ADC calibration factor in single-ended mode CALFACT_S : CALFACT_CALFACT_S_Field := 16#0#; -- unspecified Reserved_11_15 : HAL.UInt5 := 16#0#; -- ADC calibration factor in differential mode CALFACT_D : CALFACT_CALFACT_D_Field := 16#0#; -- unspecified Reserved_27_31 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CALFACT_Register use record CALFACT_S at 0 range 0 .. 10; Reserved_11_15 at 0 range 11 .. 15; CALFACT_D at 0 range 16 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; subtype CALFACT2_LINCALFACT_Field is HAL.UInt30; -- ADC Calibration Factor register 2 type CALFACT2_Register is record -- Linearity Calibration Factor LINCALFACT : CALFACT2_LINCALFACT_Field := 16#0#; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CALFACT2_Register use record LINCALFACT at 0 range 0 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- ADC Common status register type CSR_Register is record -- Read-only. Master ADC ready ADRDY_MST : Boolean; -- Read-only. End of Sampling phase flag of the master ADC EOSMP_MST : Boolean; -- Read-only. End of regular conversion of the master ADC EOC_MST : Boolean; -- Read-only. End of regular sequence flag of the master ADC EOS_MST : Boolean; -- Read-only. Overrun flag of the master ADC OVR_MST : Boolean; -- Read-only. End of injected conversion flag of the master ADC JEOC_MST : Boolean; -- Read-only. End of injected sequence flag of the master ADC JEOS_MST : Boolean; -- Read-only. Analog watchdog 1 flag of the master ADC AWD1_MST : Boolean; -- Read-only. Analog watchdog 2 flag of the master ADC AWD2_MST : Boolean; -- Read-only. Analog watchdog 3 flag of the master ADC AWD3_MST : Boolean; -- Read-only. Injected Context Queue Overflow flag of the master ADC JQOVF_MST : Boolean; -- unspecified Reserved_11_15 : HAL.UInt5; -- Read-only. Slave ADC ready ADRDY_SLV : Boolean; -- Read-only. End of Sampling phase flag of the slave ADC EOSMP_SLV : Boolean; -- Read-only. End of regular conversion of the slave ADC EOC_SLV : Boolean; -- Read-only. End of regular sequence flag of the slave ADC EOS_SLV : Boolean; -- Read-only. Overrun flag of the slave ADC OVR_SLV : Boolean; -- Read-only. End of injected conversion flag of the slave ADC JEOC_SLV : Boolean; -- Read-only. End of injected sequence flag of the slave ADC JEOS_SLV : Boolean; -- Read-only. Analog watchdog 1 flag of the slave ADC AWD1_SLV : Boolean; -- Read-only. Analog watchdog 2 flag of the slave ADC AWD2_SLV : Boolean; -- Read-only. Analog watchdog 3 flag of the slave ADC AWD3_SLV : Boolean; -- Read-only. Injected Context Queue Overflow flag of the slave ADC JQOVF_SLV : Boolean; -- unspecified Reserved_27_31 : HAL.UInt5; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CSR_Register use record ADRDY_MST at 0 range 0 .. 0; EOSMP_MST at 0 range 1 .. 1; EOC_MST at 0 range 2 .. 2; EOS_MST at 0 range 3 .. 3; OVR_MST at 0 range 4 .. 4; JEOC_MST at 0 range 5 .. 5; JEOS_MST at 0 range 6 .. 6; AWD1_MST at 0 range 7 .. 7; AWD2_MST at 0 range 8 .. 8; AWD3_MST at 0 range 9 .. 9; JQOVF_MST at 0 range 10 .. 10; Reserved_11_15 at 0 range 11 .. 15; ADRDY_SLV at 0 range 16 .. 16; EOSMP_SLV at 0 range 17 .. 17; EOC_SLV at 0 range 18 .. 18; EOS_SLV at 0 range 19 .. 19; OVR_SLV at 0 range 20 .. 20; JEOC_SLV at 0 range 21 .. 21; JEOS_SLV at 0 range 22 .. 22; AWD1_SLV at 0 range 23 .. 23; AWD2_SLV at 0 range 24 .. 24; AWD3_SLV at 0 range 25 .. 25; JQOVF_SLV at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; subtype CCR_DUAL_Field is HAL.UInt5; subtype CCR_DELAY_Field is HAL.UInt4; subtype CCR_DAMDF_Field is HAL.UInt2; subtype CCR_CKMODE_Field is HAL.UInt2; subtype CCR_PRESC_Field is HAL.UInt4; -- ADC common control register type CCR_Register is record -- Dual ADC mode selection DUAL : CCR_DUAL_Field := 16#0#; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; -- Delay between 2 sampling phases DELAY_k : CCR_DELAY_Field := 16#0#; -- unspecified Reserved_12_13 : HAL.UInt2 := 16#0#; -- Dual ADC Mode Data Format DAMDF : CCR_DAMDF_Field := 16#0#; -- ADC clock mode CKMODE : CCR_CKMODE_Field := 16#0#; -- ADC prescaler PRESC : CCR_PRESC_Field := 16#0#; -- VREFINT enable VREFEN : Boolean := False; -- Temperature sensor enable TSEN : Boolean := False; -- VBAT enable VBATEN : Boolean := False; -- unspecified Reserved_25_31 : HAL.UInt7 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CCR_Register use record DUAL at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; DELAY_k at 0 range 8 .. 11; Reserved_12_13 at 0 range 12 .. 13; DAMDF at 0 range 14 .. 15; CKMODE at 0 range 16 .. 17; PRESC at 0 range 18 .. 21; VREFEN at 0 range 22 .. 22; TSEN at 0 range 23 .. 23; VBATEN at 0 range 24 .. 24; Reserved_25_31 at 0 range 25 .. 31; end record; subtype CDR_RDATA_MST_Field is HAL.UInt16; subtype CDR_RDATA_SLV_Field is HAL.UInt16; -- ADC common regular data register for dual and triple modes type CDR_Register is record -- Read-only. Regular data of the master ADC RDATA_MST : CDR_RDATA_MST_Field; -- Read-only. Regular data of the slave ADC RDATA_SLV : CDR_RDATA_SLV_Field; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CDR_Register use record RDATA_MST at 0 range 0 .. 15; RDATA_SLV at 0 range 16 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Analog to Digital Converter type ADC1_Peripheral is record -- ADC interrupt and status register ISR : aliased ISR_Register; -- ADC interrupt enable register IER : aliased IER_Register; -- ADC control register CR : aliased CR_Register; -- ADC configuration register 1 CFGR : aliased CFGR_Register; -- ADC configuration register 2 CFGR2 : aliased CFGR2_Register; -- ADC sampling time register 1 SMPR1 : aliased SMPR1_Register; -- ADC sampling time register 2 SMPR2 : aliased SMPR2_Register; -- ADC pre channel selection register PCSEL : aliased PCSEL_Register; -- ADC analog watchdog 1 threshold register LTR1 : aliased LTR1_Register; -- ADC analog watchdog 1 threshold register HTR1 : aliased HTR1_Register; -- ADC group regular sequencer ranks register 1 SQR1 : aliased SQR1_Register; -- ADC group regular sequencer ranks register 2 SQR2 : aliased SQR2_Register; -- ADC group regular sequencer ranks register 3 SQR3 : aliased SQR3_Register; -- ADC group regular sequencer ranks register 4 SQR4 : aliased SQR4_Register; -- ADC group regular conversion data register DR : aliased HAL.UInt32; -- ADC group injected sequencer register JSQR : aliased JSQR_Register; -- ADC offset number 1 register OFR1 : aliased OFR1_Register; -- ADC offset number 2 register OFR2 : aliased OFR2_Register; -- ADC offset number 3 register OFR3 : aliased OFR3_Register; -- ADC offset number 4 register OFR4 : aliased OFR4_Register; -- ADC group injected sequencer rank 1 register JDR1 : aliased HAL.UInt32; -- ADC group injected sequencer rank 2 register JDR2 : aliased HAL.UInt32; -- ADC group injected sequencer rank 3 register JDR3 : aliased HAL.UInt32; -- ADC group injected sequencer rank 4 register JDR4 : aliased HAL.UInt32; -- ADC analog watchdog 2 configuration register AWD2CR : aliased AWD2CR_Register; -- ADC analog watchdog 3 configuration register AWD3CR : aliased AWD3CR_Register; -- ADC watchdog lower threshold register 2 LTR2 : aliased LTR2_Register; -- ADC watchdog higher threshold register 2 HTR2 : aliased HTR2_Register; -- ADC watchdog lower threshold register 3 LTR3 : aliased LTR3_Register; -- ADC watchdog higher threshold register 3 HTR3 : aliased HTR3_Register; -- ADC channel differential or single-ended mode selection register DIFSEL : aliased DIFSEL_Register; -- ADC calibration factors register CALFACT : aliased CALFACT_Register; -- ADC Calibration Factor register 2 CALFACT2 : aliased CALFACT2_Register; end record with Volatile; for ADC1_Peripheral use record ISR at 16#0# range 0 .. 31; IER at 16#4# range 0 .. 31; CR at 16#8# range 0 .. 31; CFGR at 16#C# range 0 .. 31; CFGR2 at 16#10# range 0 .. 31; SMPR1 at 16#14# range 0 .. 31; SMPR2 at 16#18# range 0 .. 31; PCSEL at 16#1C# range 0 .. 31; LTR1 at 16#20# range 0 .. 31; HTR1 at 16#24# range 0 .. 31; SQR1 at 16#30# range 0 .. 31; SQR2 at 16#34# range 0 .. 31; SQR3 at 16#38# range 0 .. 31; SQR4 at 16#3C# range 0 .. 31; DR at 16#40# range 0 .. 31; JSQR at 16#4C# range 0 .. 31; OFR1 at 16#60# range 0 .. 31; OFR2 at 16#64# range 0 .. 31; OFR3 at 16#68# range 0 .. 31; OFR4 at 16#6C# range 0 .. 31; JDR1 at 16#80# range 0 .. 31; JDR2 at 16#84# range 0 .. 31; JDR3 at 16#88# range 0 .. 31; JDR4 at 16#8C# range 0 .. 31; AWD2CR at 16#A0# range 0 .. 31; AWD3CR at 16#A4# range 0 .. 31; LTR2 at 16#B0# range 0 .. 31; HTR2 at 16#B4# range 0 .. 31; LTR3 at 16#B8# range 0 .. 31; HTR3 at 16#BC# range 0 .. 31; DIFSEL at 16#C0# range 0 .. 31; CALFACT at 16#C4# range 0 .. 31; CALFACT2 at 16#C8# range 0 .. 31; end record; -- Analog to Digital Converter ADC1_Periph : aliased ADC1_Peripheral with Import, Address => ADC1_Base; -- Analog to Digital Converter ADC2_Periph : aliased ADC1_Peripheral with Import, Address => ADC2_Base; -- Analog to Digital Converter ADC3_Periph : aliased ADC1_Peripheral with Import, Address => ADC3_Base; -- Analog-to-Digital Converter type ADC12_Common_Peripheral is record -- ADC Common status register CSR : aliased CSR_Register; -- ADC common control register CCR : aliased CCR_Register; -- ADC common regular data register for dual and triple modes CDR : aliased CDR_Register; -- ADC x common regular data register for 32-bit dual mode CDR2 : aliased HAL.UInt32; end record with Volatile; for ADC12_Common_Peripheral use record CSR at 16#0# range 0 .. 31; CCR at 16#8# range 0 .. 31; CDR at 16#C# range 0 .. 31; CDR2 at 16#10# range 0 .. 31; end record; -- Analog-to-Digital Converter ADC12_Common_Periph : aliased ADC12_Common_Peripheral with Import, Address => ADC12_Common_Base; -- Analog-to-Digital Converter ADC3_Common_Periph : aliased ADC12_Common_Peripheral with Import, Address => ADC3_Common_Base; end STM32_SVD.ADC;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- B A C K _ E N D -- -- -- -- 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. 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 COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the version of the Back_End package for GCC back ends with Atree; use Atree; with Debug; use Debug; with Elists; use Elists; with Errout; use Errout; with Lib; use Lib; with Osint; use Osint; with Opt; use Opt; with Osint.C; use Osint.C; with Namet; use Namet; with Nlists; use Nlists; with Stand; use Stand; with Sinput; use Sinput; with Stringt; use Stringt; with Switch; use Switch; with Switch.C; use Switch.C; with System; use System; with Types; use Types; with System.OS_Lib; use System.OS_Lib; package body Back_End is type Arg_Array is array (Nat) of Big_String_Ptr; type Arg_Array_Ptr is access Arg_Array; -- Types to access compiler arguments flag_stack_check : Int; pragma Import (C, flag_stack_check); -- Indicates if stack checking is enabled, imported from misc.c save_argc : Nat; pragma Import (C, save_argc); -- Saved value of argc (number of arguments), imported from misc.c save_argv : Arg_Array_Ptr; pragma Import (C, save_argv); -- Saved value of argv (argument pointers), imported from misc.c function Len_Arg (Arg : Pos) return Nat; -- Determine length of argument number Arg on original gnat1 command line ------------------- -- Call_Back_End -- ------------------- procedure Call_Back_End (Mode : Back_End_Mode_Type) is -- The Source_File_Record type has a lot of components that are -- meaningless to the back end, so a new record type is created -- here to contain the needed information for each file. type File_Info_Type is record File_Name : File_Name_Type; Instance : Instance_Id; Num_Source_Lines : Nat; end record; File_Info_Array : array (1 .. Last_Source_File) of File_Info_Type; procedure gigi (gnat_root : Int; max_gnat_node : Int; number_name : Nat; nodes_ptr : Address; flags_ptr : Address; next_node_ptr : Address; prev_node_ptr : Address; elists_ptr : Address; elmts_ptr : Address; strings_ptr : Address; string_chars_ptr : Address; list_headers_ptr : Address; number_file : Nat; file_info_ptr : Address; gigi_standard_boolean : Entity_Id; gigi_standard_integer : Entity_Id; gigi_standard_character : Entity_Id; gigi_standard_long_long_float : Entity_Id; gigi_standard_exception_type : Entity_Id; gigi_operating_mode : Back_End_Mode_Type); pragma Import (C, gigi); begin -- Skip call if in -gnatdH mode if Debug_Flag_HH then return; end if; -- The back end needs to know the maximum line number that can appear -- in a Sloc, in other words the maximum logical line number. for J in 1 .. Last_Source_File loop File_Info_Array (J).File_Name := Full_Debug_Name (J); File_Info_Array (J).Instance := Instance (J); File_Info_Array (J).Num_Source_Lines := Nat (Physical_To_Logical (Last_Source_Line (J), J)); end loop; -- Deal with case of generating SCIL, we should not be here unless -- debugging CodePeer mode in GNAT. if Generate_SCIL then Error_Msg_N ("'S'C'I'L generation not available", Cunit (Main_Unit)); if CodePeer_Mode or else (Mode /= Generate_Object and then not Back_Annotate_Rep_Info) then return; end if; end if; -- We should be here in GNATprove mode only when debugging GNAT. Do not -- call gigi in that case, as it is not prepared to handle the special -- form of the tree obtained in GNATprove mode. if GNATprove_Mode then return; end if; -- The actual call to the back end gigi (gnat_root => Int (Cunit (Main_Unit)), max_gnat_node => Int (Last_Node_Id - First_Node_Id + 1), number_name => Name_Entries_Count, nodes_ptr => Nodes_Address, flags_ptr => Flags_Address, next_node_ptr => Next_Node_Address, prev_node_ptr => Prev_Node_Address, elists_ptr => Elists_Address, elmts_ptr => Elmts_Address, strings_ptr => Strings_Address, string_chars_ptr => String_Chars_Address, list_headers_ptr => Lists_Address, number_file => Num_Source_Files, file_info_ptr => File_Info_Array'Address, gigi_standard_boolean => Standard_Boolean, gigi_standard_integer => Standard_Integer, gigi_standard_character => Standard_Character, gigi_standard_long_long_float => Standard_Long_Long_Float, gigi_standard_exception_type => Standard_Exception_Type, gigi_operating_mode => Mode); end Call_Back_End; ------------------------------- -- Gen_Or_Update_Object_File -- ------------------------------- procedure Gen_Or_Update_Object_File is begin null; end Gen_Or_Update_Object_File; ------------- -- Len_Arg -- ------------- function Len_Arg (Arg : Pos) return Nat is begin for J in 1 .. Nat'Last loop if save_argv (Arg).all (Natural (J)) = ASCII.NUL then return J - 1; end if; end loop; raise Program_Error; end Len_Arg; ----------------------------- -- Scan_Compiler_Arguments -- ----------------------------- procedure Scan_Compiler_Arguments is Next_Arg : Positive; -- Next argument to be scanned Arg_Count : constant Natural := Natural (save_argc - 1); Args : Argument_List (1 .. Arg_Count); Output_File_Name_Seen : Boolean := False; -- Set to True after having scanned file_name for switch "-gnatO file" procedure Scan_Back_End_Switches (Switch_Chars : String); -- Procedure to scan out switches stored in Switch_Chars. The first -- character is known to be a valid switch character, and there are no -- blanks or other switch terminator characters in the string, so the -- entire string should consist of valid switch characters, except that -- an optional terminating NUL character is allowed. -- -- Back end switches have already been checked and processed by GCC in -- toplev.c, so no errors can occur and control will always return. The -- switches must still be scanned to skip "-o" or internal GCC switches -- with their argument. ---------------------------- -- Scan_Back_End_Switches -- ---------------------------- procedure Scan_Back_End_Switches (Switch_Chars : String) is First : constant Positive := Switch_Chars'First + 1; Last : constant Natural := Switch_Last (Switch_Chars); begin -- Skip -o or internal GCC switches together with their argument if Switch_Chars (First .. Last) = "o" or else Is_Internal_GCC_Switch (Switch_Chars) then Next_Arg := Next_Arg + 1; -- Store -G xxx as -Gxxx and go directly to the next argument elsif Switch_Chars (First .. Last) = "G" then Next_Arg := Next_Arg + 1; -- Should never get there with -G not followed by an argument, -- but use defensive code nonetheless. Store as -Gxxx to avoid -- storing parameters in ALI files that might create confusion. if Next_Arg <= Args'Last then Store_Compilation_Switch (Switch_Chars & Args (Next_Arg).all); end if; -- Do not record -quiet switch elsif Switch_Chars (First .. Last) = "quiet" then null; -- Store any other GCC switches. Also do special processing for some -- specific switches that the Ada front-end knows about. else Store_Compilation_Switch (Switch_Chars); -- For gcc back ends, -fno-inline disables Inline pragmas only, -- not Inline_Always to remain consistent with the always_inline -- attribute behavior. if Switch_Chars (First .. Last) = "fno-inline" then Opt.Disable_FE_Inline := True; -- Back end switch -fpreserve-control-flow also sets the front end -- flag that inhibits improper control flow transformations. elsif Switch_Chars (First .. Last) = "fpreserve-control-flow" then Opt.Suppress_Control_Flow_Optimizations := True; -- Back end switch -fdump-scos, which exists primarily for C, is -- also accepted for Ada as a synonym of -gnateS. elsif Switch_Chars (First .. Last) = "fdump-scos" then Opt.Generate_SCO := True; Opt.Generate_SCO_Instance_Table := True; elsif Switch_Chars (First) = 'g' then Debugger_Level := 2; if First < Last then case Switch_Chars (First + 1) is when '0' => Debugger_Level := 0; when '1' => Debugger_Level := 1; when '2' => Debugger_Level := 2; when '3' => Debugger_Level := 3; when others => null; end case; end if; end if; end if; end Scan_Back_End_Switches; -- Start of processing for Scan_Compiler_Arguments begin -- Acquire stack checking mode directly from GCC. The reason we do this -- is to make sure that the indication of stack checking being enabled -- is the same in the front end and the back end. This status obtained -- from gcc is affected by more than just the switch -fstack-check. Opt.Stack_Checking_Enabled := (flag_stack_check /= 0); -- Put the arguments in Args for Arg in Pos range 1 .. save_argc - 1 loop declare Argv_Ptr : constant Big_String_Ptr := save_argv (Arg); Argv_Len : constant Nat := Len_Arg (Arg); Argv : constant String := Argv_Ptr (1 .. Natural (Argv_Len)); begin Args (Positive (Arg)) := new String'(Argv); end; end loop; -- Loop through command line arguments, storing them for later access Next_Arg := 1; while Next_Arg <= Args'Last loop Look_At_Arg : declare Argv : constant String := Args (Next_Arg).all; begin -- If the previous switch has set the Output_File_Name_Present -- flag (that is we have seen a -gnatO), then the next argument -- is the name of the output object file. if Output_File_Name_Present and then not Output_File_Name_Seen then if Is_Switch (Argv) then Fail ("Object file name missing after -gnatO"); else Set_Output_Object_File_Name (Argv); Output_File_Name_Seen := True; end if; -- If the previous switch has set the Search_Directory_Present -- flag (that is if we have just seen -I), then the next argument -- is a search directory path. elsif Search_Directory_Present then if Is_Switch (Argv) then Fail ("search directory missing after -I"); else Add_Src_Search_Dir (Argv); Search_Directory_Present := False; end if; -- If not a switch, must be a file name elsif not Is_Switch (Argv) then Add_File (Argv); -- We must recognize -nostdinc to suppress visibility on the -- standard GNAT RTL sources. This is also a gcc switch. elsif Argv (Argv'First + 1 .. Argv'Last) = "nostdinc" then Opt.No_Stdinc := True; Scan_Back_End_Switches (Argv); -- We must recognize -nostdlib to suppress visibility on the -- standard GNAT RTL objects. elsif Argv (Argv'First + 1 .. Argv'Last) = "nostdlib" then Opt.No_Stdlib := True; elsif Is_Front_End_Switch (Argv) then Scan_Front_End_Switches (Argv, Args, Next_Arg); -- All non-front-end switches are back-end switches else Scan_Back_End_Switches (Argv); end if; end Look_At_Arg; Next_Arg := Next_Arg + 1; end loop; end Scan_Compiler_Arguments; end Back_End;
-- A95001C.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 IF THE BOUNDS OF THE DISCRETE RANGE OF AN ENTRY FAMILY -- ARE INTEGER LITERALS, NAMED NUMBERS, OR ATTRIBUTES HAVING TYPE -- UNIVERSAL_INTEGER, BUT NOT EXPRESSIONS OF TYPE UNIVERSAL_INTEGER, -- THE INDEX (IN AN ENTRY NAME OR ACCEPT STATEMENT) IS OF THE -- PREDEFINED TYPE INTEGER. -- WEI 3/4/82 -- RJK 2/1/84 ADDED TO ACVC -- TBN 1/7/86 RENAMED FROM B950DHA-B.ADA. ADDED NAMED CONSTANTS -- AND ATTRIBUTES AS KINDS OF BOUNDS, AND MADE TEST -- EXECUTABLE. -- RJW 4/11/86 RENAMED FROM C95001C-B.ADA. WITH REPORT; USE REPORT; PROCEDURE A95001C IS SUBTYPE T IS INTEGER RANGE 1 .. 10; I : INTEGER := 1; NAMED_INT1 : CONSTANT := 1; NAMED_INT2 : CONSTANT := 2; TASK T1 IS ENTRY E1 (1 .. 2); ENTRY E2 (NAMED_INT1 .. NAMED_INT2); ENTRY E3 (T'POS(1) .. T'POS(2)); END T1; TASK BODY T1 IS I_INT : INTEGER := 1; I_POS : INTEGER := 2; BEGIN ACCEPT E1 (I_INT); ACCEPT E2 (I_POS); ACCEPT E3 (T'SUCC(1)); END T1; BEGIN TEST ("A95001C", "CHECK THAT IF THE BOUNDS OF THE DISCRETE " & "RANGE OF AN ENTRY FAMILY ARE INTEGER " & "LITERALS, NAMED NUMBERS, OR " & "(UNIVERSAL_INTEGER) ATTRIBUTES, THE INDEX " & "IS OF THE PREDEFINED TYPE INTEGER"); T1.E1 (I); T1.E2 (NAMED_INT2); T1.E3 (T'SUCC(I)); RESULT; END A95001C;
with Solitaire_Operations.Text_Representation; with Ada.Text_IO; use Ada; procedure Null_Key is Deck : Solitaire_Operations.Deck_List := Solitaire_Operations.Standard_Deck; begin -- Null_Key Output : for I in Deck'range loop Text_IO.Put (Item => Solitaire_Operations.Text_Representation.Short_Card_Name (Deck (I) ) ); end loop Output; Text_IO.New_Line; end Null_Key;
------------------------------------------------------------------------------ -- Copyright (c) 2021, Lev Kujawski. -- -- 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 sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so. -- -- 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. -- -- SPDX-License-Identifier: MIT-0 -- -- File: csioopnu.adb (Ada Separate Procedure) -- Language: Ada (1987) [1] -- Author: Lev Kujawski -- Description: C Standard Input/Output (stdio.h) interface for Ada -- -- References: -- [1] Programming languages - Ada, ISO/IEC 8652:1987, 15 Jun. 1987. ------------------------------------------------------------------------------ separate (C_Standard_IO) procedure Open_Null (File : in out File_T) is begin -- Access NUL via the Win32 device namespace Open_File (File, "\\.\NUL", Write); end Open_Null;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . A S S E R T I O N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-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. -- -- -- ------------------------------------------------------------------------------ pragma Compiler_Unit_Warning; with Ada.Exceptions; with System.Exceptions_Debug; package body System.Assertions is -------------------------- -- Raise_Assert_Failure -- -------------------------- procedure Raise_Assert_Failure (Msg : String) is begin System.Exceptions_Debug.Debug_Raise_Assert_Failure; Ada.Exceptions.Raise_Exception (Assert_Failure'Identity, Msg); end Raise_Assert_Failure; end System.Assertions;
-- C45220A.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 '=' AND '/=' PRODUCE CORRECT RESULTS ON -- BOOLEAN-TYPE OPERANDS (IN PARTICULAR, FOR OPERANDS HAVING -- DIFFERENT SUBTYPES). -- THIS TEST IS DERIVED FROM C45201A.ADA . -- RM 27 OCTOBER 1980 -- JWC 7/8/85 RENAMED TO -AB WITH REPORT ; PROCEDURE C45220A IS USE REPORT; SUBTYPE T1 IS BOOLEAN RANGE FALSE..FALSE ; SUBTYPE T2 IS BOOLEAN RANGE TRUE..TRUE ; SUBTYPE T3 IS BOOLEAN RANGE FALSE..TRUE ; SUBTYPE T4 IS T3 RANGE TRUE..TRUE ; FVAR1 : T1 := FALSE ; TVAR1 : T2 := TRUE ; FVAR2 : T3 := FALSE ; TVAR2 : T4 := TRUE ; ERROR_COUNT : INTEGER := 0 ; -- INITIAL VALUE ESSENTIAL PROCEDURE BUMP IS BEGIN ERROR_COUNT := ERROR_COUNT + 1 ; END BUMP ; BEGIN TEST( "C45220A" , "CHECK THAT '=' AND '/=' PRODUCE CORRECT" & " RESULTS ON BOOLEAN-TYPE OPERANDS" ) ; -- 32 CASES ( 2 * 2 ORDERED PAIRS OF OPERAND VALUES, -- 2 OPERATORS : '=' , '/=' , -- 4 VARIABLE/LITERAL FOR LEFT OPERAND, -- VARIABLE/LITERAL FOR RIGHT OPERAND. -- 'BUMP' MEANS 'BUMP THE ERROR COUNT' FVAR1 := IDENT_BOOL( FALSE ) ; TVAR1 := IDENT_BOOL( TRUE ) ; FVAR2 := IDENT_BOOL( FALSE ) ; TVAR2 := IDENT_BOOL( TRUE ) ; IF FALSE = FALSE THEN NULL ; ELSE BUMP ; END IF; IF FVAR1 = FALSE THEN NULL ; ELSE BUMP ; END IF; IF FALSE = FVAR2 THEN NULL ; ELSE BUMP ; END IF; IF FVAR2 = FVAR1 THEN NULL ; ELSE BUMP ; END IF; IF FALSE = TRUE THEN BUMP ; END IF; IF FVAR1 = TRUE THEN BUMP ; END IF; IF FALSE = TVAR2 THEN BUMP ; END IF; IF FVAR2 = TVAR1 THEN BUMP ; END IF; IF TRUE = FALSE THEN BUMP ; END IF; IF TRUE = FVAR1 THEN BUMP ; END IF; IF TVAR2 = FALSE THEN BUMP ; END IF; IF TVAR1 = FVAR2 THEN BUMP ; END IF; IF TRUE = TRUE THEN NULL ; ELSE BUMP ; END IF; IF TVAR1 = TRUE THEN NULL ; ELSE BUMP ; END IF; IF TRUE = TVAR2 THEN NULL ; ELSE BUMP ; END IF; IF TVAR2 = TVAR1 THEN NULL ; ELSE BUMP ; END IF; IF FALSE /= FALSE THEN BUMP ; END IF; IF FVAR1 /= FALSE THEN BUMP ; END IF; IF FALSE /= FVAR2 THEN BUMP ; END IF; IF FVAR2 /= FVAR1 THEN BUMP ; END IF; IF FALSE /= TRUE THEN NULL ; ELSE BUMP ; END IF; IF FVAR1 /= TRUE THEN NULL ; ELSE BUMP ; END IF; IF FALSE /= TVAR2 THEN NULL ; ELSE BUMP ; END IF; IF FVAR2 /= TVAR1 THEN NULL ; ELSE BUMP ; END IF; IF TRUE /= FALSE THEN NULL ; ELSE BUMP ; END IF; IF TRUE /= FVAR1 THEN NULL ; ELSE BUMP ; END IF; IF TVAR2 /= FALSE THEN NULL ; ELSE BUMP ; END IF; IF TVAR1 /= FVAR2 THEN NULL ; ELSE BUMP ; END IF; IF TRUE /= TRUE THEN BUMP ; END IF; IF TVAR1 /= TRUE THEN BUMP ; END IF; IF TRUE /= TVAR2 THEN BUMP ; END IF; IF TVAR2 /= TVAR1 THEN BUMP ; END IF; IF ERROR_COUNT /=0 THEN FAILED( "(IN)EQUALITY OF BOOLEAN VALUES - FAILURE1" ); END IF; RESULT ; END C45220A;
-- This file is generated by SWIG. Please do not modify by hand. -- with xcb.Pointers; with Interfaces.C; with Interfaces.C.Pointers; package xcb.pointer_Pointers is -- xcb_connection_t_Pointer_Pointer -- package C_xcb_connection_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_connection_t_Pointer, Element_Array => xcb.Pointers.xcb_connection_t_Pointer_Array, Default_Terminator => null); subtype xcb_connection_t_Pointer_Pointer is C_xcb_connection_t_Pointer_Pointers.Pointer; -- xcb_special_event_t_Pointer_Pointer -- package C_xcb_special_event_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_special_event_t_Pointer, Element_Array => xcb.Pointers.xcb_special_event_t_Pointer_Array, Default_Terminator => null); subtype xcb_special_event_t_Pointer_Pointer is C_xcb_special_event_t_Pointer_Pointers.Pointer; -- xcb_window_t_Pointer_Pointer -- package C_xcb_window_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_window_t_Pointer, Element_Array => xcb.Pointers.xcb_window_t_Pointer_Array, Default_Terminator => null); subtype xcb_window_t_Pointer_Pointer is C_xcb_window_t_Pointer_Pointers.Pointer; -- xcb_pixmap_t_Pointer_Pointer -- package C_xcb_pixmap_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_pixmap_t_Pointer, Element_Array => xcb.Pointers.xcb_pixmap_t_Pointer_Array, Default_Terminator => null); subtype xcb_pixmap_t_Pointer_Pointer is C_xcb_pixmap_t_Pointer_Pointers.Pointer; -- xcb_cursor_t_Pointer_Pointer -- package C_xcb_cursor_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_cursor_t_Pointer, Element_Array => xcb.Pointers.xcb_cursor_t_Pointer_Array, Default_Terminator => null); subtype xcb_cursor_t_Pointer_Pointer is C_xcb_cursor_t_Pointer_Pointers.Pointer; -- xcb_font_t_Pointer_Pointer -- package C_xcb_font_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_font_t_Pointer, Element_Array => xcb.Pointers.xcb_font_t_Pointer_Array, Default_Terminator => null); subtype xcb_font_t_Pointer_Pointer is C_xcb_font_t_Pointer_Pointers.Pointer; -- xcb_gcontext_t_Pointer_Pointer -- package C_xcb_gcontext_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_gcontext_t_Pointer, Element_Array => xcb.Pointers.xcb_gcontext_t_Pointer_Array, Default_Terminator => null); subtype xcb_gcontext_t_Pointer_Pointer is C_xcb_gcontext_t_Pointer_Pointers.Pointer; -- xcb_colormap_t_Pointer_Pointer -- package C_xcb_colormap_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_colormap_t_Pointer, Element_Array => xcb.Pointers.xcb_colormap_t_Pointer_Array, Default_Terminator => null); subtype xcb_colormap_t_Pointer_Pointer is C_xcb_colormap_t_Pointer_Pointers.Pointer; -- xcb_atom_t_Pointer_Pointer -- package C_xcb_atom_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_atom_t_Pointer, Element_Array => xcb.Pointers.xcb_atom_t_Pointer_Array, Default_Terminator => null); subtype xcb_atom_t_Pointer_Pointer is C_xcb_atom_t_Pointer_Pointers.Pointer; -- xcb_drawable_t_Pointer_Pointer -- package C_xcb_drawable_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_drawable_t_Pointer, Element_Array => xcb.Pointers.xcb_drawable_t_Pointer_Array, Default_Terminator => null); subtype xcb_drawable_t_Pointer_Pointer is C_xcb_drawable_t_Pointer_Pointers.Pointer; -- xcb_fontable_t_Pointer_Pointer -- package C_xcb_fontable_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_fontable_t_Pointer, Element_Array => xcb.Pointers.xcb_fontable_t_Pointer_Array, Default_Terminator => null); subtype xcb_fontable_t_Pointer_Pointer is C_xcb_fontable_t_Pointer_Pointers.Pointer; -- xcb_bool32_t_Pointer_Pointer -- package C_xcb_bool32_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_bool32_t_Pointer, Element_Array => xcb.Pointers.xcb_bool32_t_Pointer_Array, Default_Terminator => null); subtype xcb_bool32_t_Pointer_Pointer is C_xcb_bool32_t_Pointer_Pointers.Pointer; -- xcb_visualid_t_Pointer_Pointer -- package C_xcb_visualid_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_visualid_t_Pointer, Element_Array => xcb.Pointers.xcb_visualid_t_Pointer_Array, Default_Terminator => null); subtype xcb_visualid_t_Pointer_Pointer is C_xcb_visualid_t_Pointer_Pointers.Pointer; -- xcb_timestamp_t_Pointer_Pointer -- package C_xcb_timestamp_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_timestamp_t_Pointer, Element_Array => xcb.Pointers.xcb_timestamp_t_Pointer_Array, Default_Terminator => null); subtype xcb_timestamp_t_Pointer_Pointer is C_xcb_timestamp_t_Pointer_Pointers.Pointer; -- xcb_keysym_t_Pointer_Pointer -- package C_xcb_keysym_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_keysym_t_Pointer, Element_Array => xcb.Pointers.xcb_keysym_t_Pointer_Array, Default_Terminator => null); subtype xcb_keysym_t_Pointer_Pointer is C_xcb_keysym_t_Pointer_Pointers.Pointer; -- xcb_keycode_t_Pointer_Pointer -- package C_xcb_keycode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_keycode_t_Pointer, Element_Array => xcb.Pointers.xcb_keycode_t_Pointer_Array, Default_Terminator => null); subtype xcb_keycode_t_Pointer_Pointer is C_xcb_keycode_t_Pointer_Pointers.Pointer; -- xcb_keycode32_t_Pointer_Pointer -- package C_xcb_keycode32_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_keycode32_t_Pointer, Element_Array => xcb.Pointers.xcb_keycode32_t_Pointer_Array, Default_Terminator => null); subtype xcb_keycode32_t_Pointer_Pointer is C_xcb_keycode32_t_Pointer_Pointers.Pointer; -- xcb_button_t_Pointer_Pointer -- package C_xcb_button_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_button_t_Pointer, Element_Array => xcb.Pointers.xcb_button_t_Pointer_Array, Default_Terminator => null); subtype xcb_button_t_Pointer_Pointer is C_xcb_button_t_Pointer_Pointers.Pointer; -- xcb_visual_class_t_Pointer_Pointer -- package C_xcb_visual_class_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_visual_class_t_Pointer, Element_Array => xcb.Pointers.xcb_visual_class_t_Pointer_Array, Default_Terminator => null); subtype xcb_visual_class_t_Pointer_Pointer is C_xcb_visual_class_t_Pointer_Pointers.Pointer; -- xcb_event_mask_t_Pointer_Pointer -- package C_xcb_event_mask_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_event_mask_t_Pointer, Element_Array => xcb.Pointers.xcb_event_mask_t_Pointer_Array, Default_Terminator => null); subtype xcb_event_mask_t_Pointer_Pointer is C_xcb_event_mask_t_Pointer_Pointers.Pointer; -- xcb_backing_store_t_Pointer_Pointer -- package C_xcb_backing_store_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_backing_store_t_Pointer, Element_Array => xcb.Pointers.xcb_backing_store_t_Pointer_Array, Default_Terminator => null); subtype xcb_backing_store_t_Pointer_Pointer is C_xcb_backing_store_t_Pointer_Pointers.Pointer; -- xcb_image_order_t_Pointer_Pointer -- package C_xcb_image_order_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_image_order_t_Pointer, Element_Array => xcb.Pointers.xcb_image_order_t_Pointer_Array, Default_Terminator => null); subtype xcb_image_order_t_Pointer_Pointer is C_xcb_image_order_t_Pointer_Pointers.Pointer; -- xcb_mod_mask_t_Pointer_Pointer -- package C_xcb_mod_mask_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_mod_mask_t_Pointer, Element_Array => xcb.Pointers.xcb_mod_mask_t_Pointer_Array, Default_Terminator => null); subtype xcb_mod_mask_t_Pointer_Pointer is C_xcb_mod_mask_t_Pointer_Pointers.Pointer; -- xcb_key_but_mask_t_Pointer_Pointer -- package C_xcb_key_but_mask_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_key_but_mask_t_Pointer, Element_Array => xcb.Pointers.xcb_key_but_mask_t_Pointer_Array, Default_Terminator => null); subtype xcb_key_but_mask_t_Pointer_Pointer is C_xcb_key_but_mask_t_Pointer_Pointers.Pointer; -- xcb_window_enum_t_Pointer_Pointer -- package C_xcb_window_enum_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_window_enum_t_Pointer, Element_Array => xcb.Pointers.xcb_window_enum_t_Pointer_Array, Default_Terminator => null); subtype xcb_window_enum_t_Pointer_Pointer is C_xcb_window_enum_t_Pointer_Pointers.Pointer; -- xcb_button_mask_t_Pointer_Pointer -- package C_xcb_button_mask_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_button_mask_t_Pointer, Element_Array => xcb.Pointers.xcb_button_mask_t_Pointer_Array, Default_Terminator => null); subtype xcb_button_mask_t_Pointer_Pointer is C_xcb_button_mask_t_Pointer_Pointers.Pointer; -- xcb_motion_t_Pointer_Pointer -- package C_xcb_motion_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_motion_t_Pointer, Element_Array => xcb.Pointers.xcb_motion_t_Pointer_Array, Default_Terminator => null); subtype xcb_motion_t_Pointer_Pointer is C_xcb_motion_t_Pointer_Pointers.Pointer; -- xcb_notify_detail_t_Pointer_Pointer -- package C_xcb_notify_detail_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_notify_detail_t_Pointer, Element_Array => xcb.Pointers.xcb_notify_detail_t_Pointer_Array, Default_Terminator => null); subtype xcb_notify_detail_t_Pointer_Pointer is C_xcb_notify_detail_t_Pointer_Pointers.Pointer; -- xcb_notify_mode_t_Pointer_Pointer -- package C_xcb_notify_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_notify_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_notify_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_notify_mode_t_Pointer_Pointer is C_xcb_notify_mode_t_Pointer_Pointers.Pointer; -- xcb_visibility_t_Pointer_Pointer -- package C_xcb_visibility_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_visibility_t_Pointer, Element_Array => xcb.Pointers.xcb_visibility_t_Pointer_Array, Default_Terminator => null); subtype xcb_visibility_t_Pointer_Pointer is C_xcb_visibility_t_Pointer_Pointers.Pointer; -- xcb_place_t_Pointer_Pointer -- package C_xcb_place_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_place_t_Pointer, Element_Array => xcb.Pointers.xcb_place_t_Pointer_Array, Default_Terminator => null); subtype xcb_place_t_Pointer_Pointer is C_xcb_place_t_Pointer_Pointers.Pointer; -- xcb_property_t_Pointer_Pointer -- package C_xcb_property_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_property_t_Pointer, Element_Array => xcb.Pointers.xcb_property_t_Pointer_Array, Default_Terminator => null); subtype xcb_property_t_Pointer_Pointer is C_xcb_property_t_Pointer_Pointers.Pointer; -- xcb_time_t_Pointer_Pointer -- package C_xcb_time_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_time_t_Pointer, Element_Array => xcb.Pointers.xcb_time_t_Pointer_Array, Default_Terminator => null); subtype xcb_time_t_Pointer_Pointer is C_xcb_time_t_Pointer_Pointers.Pointer; -- xcb_atom_enum_t_Pointer_Pointer -- package C_xcb_atom_enum_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_atom_enum_t_Pointer, Element_Array => xcb.Pointers.xcb_atom_enum_t_Pointer_Array, Default_Terminator => null); subtype xcb_atom_enum_t_Pointer_Pointer is C_xcb_atom_enum_t_Pointer_Pointers.Pointer; -- xcb_colormap_state_t_Pointer_Pointer -- package C_xcb_colormap_state_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_colormap_state_t_Pointer, Element_Array => xcb.Pointers.xcb_colormap_state_t_Pointer_Array, Default_Terminator => null); subtype xcb_colormap_state_t_Pointer_Pointer is C_xcb_colormap_state_t_Pointer_Pointers.Pointer; -- xcb_colormap_enum_t_Pointer_Pointer -- package C_xcb_colormap_enum_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_colormap_enum_t_Pointer, Element_Array => xcb.Pointers.xcb_colormap_enum_t_Pointer_Array, Default_Terminator => null); subtype xcb_colormap_enum_t_Pointer_Pointer is C_xcb_colormap_enum_t_Pointer_Pointers.Pointer; -- xcb_mapping_t_Pointer_Pointer -- package C_xcb_mapping_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_mapping_t_Pointer, Element_Array => xcb.Pointers.xcb_mapping_t_Pointer_Array, Default_Terminator => null); subtype xcb_mapping_t_Pointer_Pointer is C_xcb_mapping_t_Pointer_Pointers.Pointer; -- xcb_window_class_t_Pointer_Pointer -- package C_xcb_window_class_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_window_class_t_Pointer, Element_Array => xcb.Pointers.xcb_window_class_t_Pointer_Array, Default_Terminator => null); subtype xcb_window_class_t_Pointer_Pointer is C_xcb_window_class_t_Pointer_Pointers.Pointer; -- xcb_cw_t_Pointer_Pointer -- package C_xcb_cw_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_cw_t_Pointer, Element_Array => xcb.Pointers.xcb_cw_t_Pointer_Array, Default_Terminator => null); subtype xcb_cw_t_Pointer_Pointer is C_xcb_cw_t_Pointer_Pointers.Pointer; -- xcb_back_pixmap_t_Pointer_Pointer -- package C_xcb_back_pixmap_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_back_pixmap_t_Pointer, Element_Array => xcb.Pointers.xcb_back_pixmap_t_Pointer_Array, Default_Terminator => null); subtype xcb_back_pixmap_t_Pointer_Pointer is C_xcb_back_pixmap_t_Pointer_Pointers.Pointer; -- xcb_gravity_t_Pointer_Pointer -- package C_xcb_gravity_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_gravity_t_Pointer, Element_Array => xcb.Pointers.xcb_gravity_t_Pointer_Array, Default_Terminator => null); subtype xcb_gravity_t_Pointer_Pointer is C_xcb_gravity_t_Pointer_Pointers.Pointer; -- xcb_map_state_t_Pointer_Pointer -- package C_xcb_map_state_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_map_state_t_Pointer, Element_Array => xcb.Pointers.xcb_map_state_t_Pointer_Array, Default_Terminator => null); subtype xcb_map_state_t_Pointer_Pointer is C_xcb_map_state_t_Pointer_Pointers.Pointer; -- xcb_set_mode_t_Pointer_Pointer -- package C_xcb_set_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_set_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_set_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_set_mode_t_Pointer_Pointer is C_xcb_set_mode_t_Pointer_Pointers.Pointer; -- xcb_config_window_t_Pointer_Pointer -- package C_xcb_config_window_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_config_window_t_Pointer, Element_Array => xcb.Pointers.xcb_config_window_t_Pointer_Array, Default_Terminator => null); subtype xcb_config_window_t_Pointer_Pointer is C_xcb_config_window_t_Pointer_Pointers.Pointer; -- xcb_stack_mode_t_Pointer_Pointer -- package C_xcb_stack_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_stack_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_stack_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_stack_mode_t_Pointer_Pointer is C_xcb_stack_mode_t_Pointer_Pointers.Pointer; -- xcb_circulate_t_Pointer_Pointer -- package C_xcb_circulate_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_circulate_t_Pointer, Element_Array => xcb.Pointers.xcb_circulate_t_Pointer_Array, Default_Terminator => null); subtype xcb_circulate_t_Pointer_Pointer is C_xcb_circulate_t_Pointer_Pointers.Pointer; -- xcb_prop_mode_t_Pointer_Pointer -- package C_xcb_prop_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_prop_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_prop_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_prop_mode_t_Pointer_Pointer is C_xcb_prop_mode_t_Pointer_Pointers.Pointer; -- xcb_get_property_type_t_Pointer_Pointer -- package C_xcb_get_property_type_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_get_property_type_t_Pointer, Element_Array => xcb.Pointers.xcb_get_property_type_t_Pointer_Array, Default_Terminator => null); subtype xcb_get_property_type_t_Pointer_Pointer is C_xcb_get_property_type_t_Pointer_Pointers.Pointer; -- xcb_send_event_dest_t_Pointer_Pointer -- package C_xcb_send_event_dest_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_send_event_dest_t_Pointer, Element_Array => xcb.Pointers.xcb_send_event_dest_t_Pointer_Array, Default_Terminator => null); subtype xcb_send_event_dest_t_Pointer_Pointer is C_xcb_send_event_dest_t_Pointer_Pointers.Pointer; -- xcb_grab_mode_t_Pointer_Pointer -- package C_xcb_grab_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_grab_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_grab_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_grab_mode_t_Pointer_Pointer is C_xcb_grab_mode_t_Pointer_Pointers.Pointer; -- xcb_grab_status_t_Pointer_Pointer -- package C_xcb_grab_status_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_grab_status_t_Pointer, Element_Array => xcb.Pointers.xcb_grab_status_t_Pointer_Array, Default_Terminator => null); subtype xcb_grab_status_t_Pointer_Pointer is C_xcb_grab_status_t_Pointer_Pointers.Pointer; -- xcb_cursor_enum_t_Pointer_Pointer -- package C_xcb_cursor_enum_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_cursor_enum_t_Pointer, Element_Array => xcb.Pointers.xcb_cursor_enum_t_Pointer_Array, Default_Terminator => null); subtype xcb_cursor_enum_t_Pointer_Pointer is C_xcb_cursor_enum_t_Pointer_Pointers.Pointer; -- xcb_button_index_t_Pointer_Pointer -- package C_xcb_button_index_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_button_index_t_Pointer, Element_Array => xcb.Pointers.xcb_button_index_t_Pointer_Array, Default_Terminator => null); subtype xcb_button_index_t_Pointer_Pointer is C_xcb_button_index_t_Pointer_Pointers.Pointer; -- xcb_grab_t_Pointer_Pointer -- package C_xcb_grab_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_grab_t_Pointer, Element_Array => xcb.Pointers.xcb_grab_t_Pointer_Array, Default_Terminator => null); subtype xcb_grab_t_Pointer_Pointer is C_xcb_grab_t_Pointer_Pointers.Pointer; -- xcb_allow_t_Pointer_Pointer -- package C_xcb_allow_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_allow_t_Pointer, Element_Array => xcb.Pointers.xcb_allow_t_Pointer_Array, Default_Terminator => null); subtype xcb_allow_t_Pointer_Pointer is C_xcb_allow_t_Pointer_Pointers.Pointer; -- xcb_input_focus_t_Pointer_Pointer -- package C_xcb_input_focus_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_input_focus_t_Pointer, Element_Array => xcb.Pointers.xcb_input_focus_t_Pointer_Array, Default_Terminator => null); subtype xcb_input_focus_t_Pointer_Pointer is C_xcb_input_focus_t_Pointer_Pointers.Pointer; -- xcb_font_draw_t_Pointer_Pointer -- package C_xcb_font_draw_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_font_draw_t_Pointer, Element_Array => xcb.Pointers.xcb_font_draw_t_Pointer_Array, Default_Terminator => null); subtype xcb_font_draw_t_Pointer_Pointer is C_xcb_font_draw_t_Pointer_Pointers.Pointer; -- xcb_gc_t_Pointer_Pointer -- package C_xcb_gc_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_gc_t_Pointer, Element_Array => xcb.Pointers.xcb_gc_t_Pointer_Array, Default_Terminator => null); subtype xcb_gc_t_Pointer_Pointer is C_xcb_gc_t_Pointer_Pointers.Pointer; -- xcb_gx_t_Pointer_Pointer -- package C_xcb_gx_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_gx_t_Pointer, Element_Array => xcb.Pointers.xcb_gx_t_Pointer_Array, Default_Terminator => null); subtype xcb_gx_t_Pointer_Pointer is C_xcb_gx_t_Pointer_Pointers.Pointer; -- xcb_line_style_t_Pointer_Pointer -- package C_xcb_line_style_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_line_style_t_Pointer, Element_Array => xcb.Pointers.xcb_line_style_t_Pointer_Array, Default_Terminator => null); subtype xcb_line_style_t_Pointer_Pointer is C_xcb_line_style_t_Pointer_Pointers.Pointer; -- xcb_cap_style_t_Pointer_Pointer -- package C_xcb_cap_style_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_cap_style_t_Pointer, Element_Array => xcb.Pointers.xcb_cap_style_t_Pointer_Array, Default_Terminator => null); subtype xcb_cap_style_t_Pointer_Pointer is C_xcb_cap_style_t_Pointer_Pointers.Pointer; -- xcb_join_style_t_Pointer_Pointer -- package C_xcb_join_style_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_join_style_t_Pointer, Element_Array => xcb.Pointers.xcb_join_style_t_Pointer_Array, Default_Terminator => null); subtype xcb_join_style_t_Pointer_Pointer is C_xcb_join_style_t_Pointer_Pointers.Pointer; -- xcb_fill_style_t_Pointer_Pointer -- package C_xcb_fill_style_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_fill_style_t_Pointer, Element_Array => xcb.Pointers.xcb_fill_style_t_Pointer_Array, Default_Terminator => null); subtype xcb_fill_style_t_Pointer_Pointer is C_xcb_fill_style_t_Pointer_Pointers.Pointer; -- xcb_fill_rule_t_Pointer_Pointer -- package C_xcb_fill_rule_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_fill_rule_t_Pointer, Element_Array => xcb.Pointers.xcb_fill_rule_t_Pointer_Array, Default_Terminator => null); subtype xcb_fill_rule_t_Pointer_Pointer is C_xcb_fill_rule_t_Pointer_Pointers.Pointer; -- xcb_subwindow_mode_t_Pointer_Pointer -- package C_xcb_subwindow_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_subwindow_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_subwindow_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_subwindow_mode_t_Pointer_Pointer is C_xcb_subwindow_mode_t_Pointer_Pointers.Pointer; -- xcb_arc_mode_t_Pointer_Pointer -- package C_xcb_arc_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_arc_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_arc_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_arc_mode_t_Pointer_Pointer is C_xcb_arc_mode_t_Pointer_Pointers.Pointer; -- xcb_clip_ordering_t_Pointer_Pointer -- package C_xcb_clip_ordering_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_clip_ordering_t_Pointer, Element_Array => xcb.Pointers.xcb_clip_ordering_t_Pointer_Array, Default_Terminator => null); subtype xcb_clip_ordering_t_Pointer_Pointer is C_xcb_clip_ordering_t_Pointer_Pointers.Pointer; -- xcb_coord_mode_t_Pointer_Pointer -- package C_xcb_coord_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_coord_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_coord_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_coord_mode_t_Pointer_Pointer is C_xcb_coord_mode_t_Pointer_Pointers.Pointer; -- xcb_poly_shape_t_Pointer_Pointer -- package C_xcb_poly_shape_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_poly_shape_t_Pointer, Element_Array => xcb.Pointers.xcb_poly_shape_t_Pointer_Array, Default_Terminator => null); subtype xcb_poly_shape_t_Pointer_Pointer is C_xcb_poly_shape_t_Pointer_Pointers.Pointer; -- xcb_image_format_t_Pointer_Pointer -- package C_xcb_image_format_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_image_format_t_Pointer, Element_Array => xcb.Pointers.xcb_image_format_t_Pointer_Array, Default_Terminator => null); subtype xcb_image_format_t_Pointer_Pointer is C_xcb_image_format_t_Pointer_Pointers.Pointer; -- xcb_colormap_alloc_t_Pointer_Pointer -- package C_xcb_colormap_alloc_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_colormap_alloc_t_Pointer, Element_Array => xcb.Pointers.xcb_colormap_alloc_t_Pointer_Array, Default_Terminator => null); subtype xcb_colormap_alloc_t_Pointer_Pointer is C_xcb_colormap_alloc_t_Pointer_Pointers.Pointer; -- xcb_color_flag_t_Pointer_Pointer -- package C_xcb_color_flag_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_color_flag_t_Pointer, Element_Array => xcb.Pointers.xcb_color_flag_t_Pointer_Array, Default_Terminator => null); subtype xcb_color_flag_t_Pointer_Pointer is C_xcb_color_flag_t_Pointer_Pointers.Pointer; -- xcb_pixmap_enum_t_Pointer_Pointer -- package C_xcb_pixmap_enum_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_pixmap_enum_t_Pointer, Element_Array => xcb.Pointers.xcb_pixmap_enum_t_Pointer_Array, Default_Terminator => null); subtype xcb_pixmap_enum_t_Pointer_Pointer is C_xcb_pixmap_enum_t_Pointer_Pointers.Pointer; -- xcb_font_enum_t_Pointer_Pointer -- package C_xcb_font_enum_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_font_enum_t_Pointer, Element_Array => xcb.Pointers.xcb_font_enum_t_Pointer_Array, Default_Terminator => null); subtype xcb_font_enum_t_Pointer_Pointer is C_xcb_font_enum_t_Pointer_Pointers.Pointer; -- xcb_query_shape_of_t_Pointer_Pointer -- package C_xcb_query_shape_of_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_query_shape_of_t_Pointer, Element_Array => xcb.Pointers.xcb_query_shape_of_t_Pointer_Array, Default_Terminator => null); subtype xcb_query_shape_of_t_Pointer_Pointer is C_xcb_query_shape_of_t_Pointer_Pointers.Pointer; -- xcb_kb_t_Pointer_Pointer -- package C_xcb_kb_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_kb_t_Pointer, Element_Array => xcb.Pointers.xcb_kb_t_Pointer_Array, Default_Terminator => null); subtype xcb_kb_t_Pointer_Pointer is C_xcb_kb_t_Pointer_Pointers.Pointer; -- xcb_led_mode_t_Pointer_Pointer -- package C_xcb_led_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_led_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_led_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_led_mode_t_Pointer_Pointer is C_xcb_led_mode_t_Pointer_Pointers.Pointer; -- xcb_auto_repeat_mode_t_Pointer_Pointer -- package C_xcb_auto_repeat_mode_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_auto_repeat_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_auto_repeat_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_auto_repeat_mode_t_Pointer_Pointer is C_xcb_auto_repeat_mode_t_Pointer_Pointers.Pointer; -- xcb_blanking_t_Pointer_Pointer -- package C_xcb_blanking_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_blanking_t_Pointer, Element_Array => xcb.Pointers.xcb_blanking_t_Pointer_Array, Default_Terminator => null); subtype xcb_blanking_t_Pointer_Pointer is C_xcb_blanking_t_Pointer_Pointers.Pointer; -- xcb_exposures_t_Pointer_Pointer -- package C_xcb_exposures_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_exposures_t_Pointer, Element_Array => xcb.Pointers.xcb_exposures_t_Pointer_Array, Default_Terminator => null); subtype xcb_exposures_t_Pointer_Pointer is C_xcb_exposures_t_Pointer_Pointers.Pointer; -- xcb_host_mode_t_Pointer_Pointer -- package C_xcb_host_mode_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_host_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_host_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_host_mode_t_Pointer_Pointer is C_xcb_host_mode_t_Pointer_Pointers.Pointer; -- xcb_family_t_Pointer_Pointer -- package C_xcb_family_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_family_t_Pointer, Element_Array => xcb.Pointers.xcb_family_t_Pointer_Array, Default_Terminator => null); subtype xcb_family_t_Pointer_Pointer is C_xcb_family_t_Pointer_Pointers.Pointer; -- xcb_access_control_t_Pointer_Pointer -- package C_xcb_access_control_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_access_control_t_Pointer, Element_Array => xcb.Pointers.xcb_access_control_t_Pointer_Array, Default_Terminator => null); subtype xcb_access_control_t_Pointer_Pointer is C_xcb_access_control_t_Pointer_Pointers.Pointer; -- xcb_close_down_t_Pointer_Pointer -- package C_xcb_close_down_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_close_down_t_Pointer, Element_Array => xcb.Pointers.xcb_close_down_t_Pointer_Array, Default_Terminator => null); subtype xcb_close_down_t_Pointer_Pointer is C_xcb_close_down_t_Pointer_Pointers.Pointer; -- xcb_kill_t_Pointer_Pointer -- package C_xcb_kill_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_kill_t_Pointer, Element_Array => xcb.Pointers.xcb_kill_t_Pointer_Array, Default_Terminator => null); subtype xcb_kill_t_Pointer_Pointer is C_xcb_kill_t_Pointer_Pointers.Pointer; -- xcb_screen_saver_t_Pointer_Pointer -- package C_xcb_screen_saver_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_screen_saver_t_Pointer, Element_Array => xcb.Pointers.xcb_screen_saver_t_Pointer_Array, Default_Terminator => null); subtype xcb_screen_saver_t_Pointer_Pointer is C_xcb_screen_saver_t_Pointer_Pointers.Pointer; -- xcb_mapping_status_t_Pointer_Pointer -- package C_xcb_mapping_status_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_mapping_status_t_Pointer, Element_Array => xcb.Pointers.xcb_mapping_status_t_Pointer_Array, Default_Terminator => null); subtype xcb_mapping_status_t_Pointer_Pointer is C_xcb_mapping_status_t_Pointer_Pointers.Pointer; -- xcb_map_index_t_Pointer_Pointer -- package C_xcb_map_index_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_map_index_t_Pointer, Element_Array => xcb.Pointers.xcb_map_index_t_Pointer_Array, Default_Terminator => null); subtype xcb_map_index_t_Pointer_Pointer is C_xcb_map_index_t_Pointer_Pointers.Pointer; -- xcb_render_pict_type_t_Pointer_Pointer -- package C_xcb_render_pict_type_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_pict_type_t_Pointer, Element_Array => xcb.Pointers.xcb_render_pict_type_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_pict_type_t_Pointer_Pointer is C_xcb_render_pict_type_t_Pointer_Pointers.Pointer; -- xcb_render_picture_enum_t_Pointer_Pointer -- package C_xcb_render_picture_enum_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_picture_enum_t_Pointer, Element_Array => xcb.Pointers.xcb_render_picture_enum_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_picture_enum_t_Pointer_Pointer is C_xcb_render_picture_enum_t_Pointer_Pointers.Pointer; -- xcb_render_pict_op_t_Pointer_Pointer -- package C_xcb_render_pict_op_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_pict_op_t_Pointer, Element_Array => xcb.Pointers.xcb_render_pict_op_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_pict_op_t_Pointer_Pointer is C_xcb_render_pict_op_t_Pointer_Pointers.Pointer; -- xcb_render_poly_edge_t_Pointer_Pointer -- package C_xcb_render_poly_edge_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_poly_edge_t_Pointer, Element_Array => xcb.Pointers.xcb_render_poly_edge_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_poly_edge_t_Pointer_Pointer is C_xcb_render_poly_edge_t_Pointer_Pointers.Pointer; -- xcb_render_poly_mode_t_Pointer_Pointer -- package C_xcb_render_poly_mode_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_poly_mode_t_Pointer, Element_Array => xcb.Pointers.xcb_render_poly_mode_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_poly_mode_t_Pointer_Pointer is C_xcb_render_poly_mode_t_Pointer_Pointers.Pointer; -- xcb_render_cp_t_Pointer_Pointer -- package C_xcb_render_cp_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_cp_t_Pointer, Element_Array => xcb.Pointers.xcb_render_cp_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_cp_t_Pointer_Pointer is C_xcb_render_cp_t_Pointer_Pointers.Pointer; -- xcb_render_sub_pixel_t_Pointer_Pointer -- package C_xcb_render_sub_pixel_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_sub_pixel_t_Pointer, Element_Array => xcb.Pointers.xcb_render_sub_pixel_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_sub_pixel_t_Pointer_Pointer is C_xcb_render_sub_pixel_t_Pointer_Pointers.Pointer; -- xcb_render_repeat_t_Pointer_Pointer -- package C_xcb_render_repeat_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_repeat_t_Pointer, Element_Array => xcb.Pointers.xcb_render_repeat_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_repeat_t_Pointer_Pointer is C_xcb_render_repeat_t_Pointer_Pointers.Pointer; -- xcb_render_glyph_t_Pointer_Pointer -- package C_xcb_render_glyph_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_glyph_t_Pointer, Element_Array => xcb.Pointers.xcb_render_glyph_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_glyph_t_Pointer_Pointer is C_xcb_render_glyph_t_Pointer_Pointers.Pointer; -- xcb_render_glyphset_t_Pointer_Pointer -- package C_xcb_render_glyphset_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_glyphset_t_Pointer, Element_Array => xcb.Pointers.xcb_render_glyphset_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_glyphset_t_Pointer_Pointer is C_xcb_render_glyphset_t_Pointer_Pointers.Pointer; -- xcb_render_picture_t_Pointer_Pointer -- package C_xcb_render_picture_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_picture_t_Pointer, Element_Array => xcb.Pointers.xcb_render_picture_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_picture_t_Pointer_Pointer is C_xcb_render_picture_t_Pointer_Pointers.Pointer; -- xcb_render_pictformat_t_Pointer_Pointer -- package C_xcb_render_pictformat_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_pictformat_t_Pointer, Element_Array => xcb.Pointers.xcb_render_pictformat_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_pictformat_t_Pointer_Pointer is C_xcb_render_pictformat_t_Pointer_Pointers.Pointer; -- xcb_render_fixed_t_Pointer_Pointer -- package C_xcb_render_fixed_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_fixed_t_Pointer, Element_Array => xcb.Pointers.xcb_render_fixed_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_fixed_t_Pointer_Pointer is C_xcb_render_fixed_t_Pointer_Pointers.Pointer; -- iovec_Pointer_Pointer -- package C_iovec_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.iovec_Pointer, Element_Array => xcb.Pointers.iovec_Pointer_Array, Default_Terminator => null); subtype iovec_Pointer_Pointer is C_iovec_Pointer_Pointers.Pointer; -- xcb_send_request_flags_t_Pointer_Pointer -- package C_xcb_send_request_flags_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_send_request_flags_t_Pointer, Element_Array => xcb.Pointers.xcb_send_request_flags_t_Pointer_Array, Default_Terminator => null); subtype xcb_send_request_flags_t_Pointer_Pointer is C_xcb_send_request_flags_t_Pointer_Pointers.Pointer; -- xcb_pict_format_t_Pointer_Pointer -- package C_xcb_pict_format_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_pict_format_t_Pointer, Element_Array => xcb.Pointers.xcb_pict_format_t_Pointer_Array, Default_Terminator => null); subtype xcb_pict_format_t_Pointer_Pointer is C_xcb_pict_format_t_Pointer_Pointers.Pointer; -- xcb_pict_standard_t_Pointer_Pointer -- package C_xcb_pict_standard_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_pict_standard_t_Pointer, Element_Array => xcb.Pointers.xcb_pict_standard_t_Pointer_Array, Default_Terminator => null); subtype xcb_pict_standard_t_Pointer_Pointer is C_xcb_pict_standard_t_Pointer_Pointers.Pointer; -- xcb_render_util_composite_text_stream_t_Pointer_Pointer -- package C_xcb_render_util_composite_text_stream_t_Pointer_Pointers is new Interfaces .C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_render_util_composite_text_stream_t_Pointer, Element_Array => xcb.Pointers.xcb_render_util_composite_text_stream_t_Pointer_Array, Default_Terminator => null); subtype xcb_render_util_composite_text_stream_t_Pointer_Pointer is C_xcb_render_util_composite_text_stream_t_Pointer_Pointers.Pointer; -- xcb_glx_pixmap_t_Pointer_Pointer -- package C_xcb_glx_pixmap_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_pixmap_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_pixmap_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_pixmap_t_Pointer_Pointer is C_xcb_glx_pixmap_t_Pointer_Pointers.Pointer; -- xcb_glx_context_t_Pointer_Pointer -- package C_xcb_glx_context_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_context_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_context_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_context_t_Pointer_Pointer is C_xcb_glx_context_t_Pointer_Pointers.Pointer; -- xcb_glx_pbuffer_t_Pointer_Pointer -- package C_xcb_glx_pbuffer_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_pbuffer_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_pbuffer_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_pbuffer_t_Pointer_Pointer is C_xcb_glx_pbuffer_t_Pointer_Pointers.Pointer; -- xcb_glx_window_t_Pointer_Pointer -- package C_xcb_glx_window_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_window_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_window_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_window_t_Pointer_Pointer is C_xcb_glx_window_t_Pointer_Pointers.Pointer; -- xcb_glx_fbconfig_t_Pointer_Pointer -- package C_xcb_glx_fbconfig_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_fbconfig_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_fbconfig_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_fbconfig_t_Pointer_Pointer is C_xcb_glx_fbconfig_t_Pointer_Pointers.Pointer; -- xcb_glx_drawable_t_Pointer_Pointer -- package C_xcb_glx_drawable_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_drawable_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_drawable_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_drawable_t_Pointer_Pointer is C_xcb_glx_drawable_t_Pointer_Pointers.Pointer; -- xcb_glx_float32_t_Pointer_Pointer -- package C_xcb_glx_float32_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_float32_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_float32_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_float32_t_Pointer_Pointer is C_xcb_glx_float32_t_Pointer_Pointers.Pointer; -- xcb_glx_float64_t_Pointer_Pointer -- package C_xcb_glx_float64_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_float64_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_float64_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_float64_t_Pointer_Pointer is C_xcb_glx_float64_t_Pointer_Pointers.Pointer; -- xcb_glx_bool32_t_Pointer_Pointer -- package C_xcb_glx_bool32_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_bool32_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_bool32_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_bool32_t_Pointer_Pointer is C_xcb_glx_bool32_t_Pointer_Pointers.Pointer; -- xcb_glx_context_tag_t_Pointer_Pointer -- package C_xcb_glx_context_tag_t_Pointer_Pointers is new Interfaces.C .Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_context_tag_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_context_tag_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_context_tag_t_Pointer_Pointer is C_xcb_glx_context_tag_t_Pointer_Pointers.Pointer; -- xcb_glx_pbcet_t_Pointer_Pointer -- package C_xcb_glx_pbcet_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_pbcet_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_pbcet_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_pbcet_t_Pointer_Pointer is C_xcb_glx_pbcet_t_Pointer_Pointers.Pointer; -- xcb_glx_pbcdt_t_Pointer_Pointer -- package C_xcb_glx_pbcdt_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_pbcdt_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_pbcdt_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_pbcdt_t_Pointer_Pointer is C_xcb_glx_pbcdt_t_Pointer_Pointers.Pointer; -- xcb_glx_gc_t_Pointer_Pointer -- package C_xcb_glx_gc_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_gc_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_gc_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_gc_t_Pointer_Pointer is C_xcb_glx_gc_t_Pointer_Pointers.Pointer; -- xcb_glx_rm_t_Pointer_Pointer -- package C_xcb_glx_rm_t_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.xcb_glx_rm_t_Pointer, Element_Array => xcb.Pointers.xcb_glx_rm_t_Pointer_Array, Default_Terminator => null); subtype xcb_glx_rm_t_Pointer_Pointer is C_xcb_glx_rm_t_Pointer_Pointers.Pointer; -- Display_Pointer_Pointer -- package C_Display_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.Display_Pointer, Element_Array => xcb.Pointers.Display_Pointer_Array, Default_Terminator => null); subtype Display_Pointer_Pointer is C_Display_Pointer_Pointers.Pointer; -- XEventQueueOwner_Pointer_Pointer -- package C_XEventQueueOwner_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.Pointers.XEventQueueOwner_Pointer, Element_Array => xcb.Pointers.XEventQueueOwner_Pointer_Array, Default_Terminator => null); subtype XEventQueueOwner_Pointer_Pointer is C_XEventQueueOwner_Pointer_Pointers.Pointer; end xcb.pointer_Pointers;
-- -- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- 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 ewok.tasks; use ewok.tasks; with ewok.sanitize; with ewok.perm; with ewok.debug; with types.c; use type types.c.t_retval; with c.kernel; package body ewok.syscalls.rng with spark_mode => off is pragma warnings (off); function to_integer is new ada.unchecked_conversion (unsigned_16, integer); pragma warnings (on); procedure sys_get_random (caller_id : in ewok.tasks_shared.t_task_id; params : in out t_parameters; mode : in ewok.tasks_shared.t_task_mode) is length : unsigned_16 with address => params(1)'address; buffer : types.c.c_string (1 .. to_integer(length)) with address => to_address (params(0)); begin -- Forbidden after end of task initialization if not is_init_done (caller_id) then goto ret_denied; end if; -- Does buffer'address is in the caller address space ? if not ewok.sanitize.is_range_in_data_slot (to_system_address (buffer'address), types.to_unsigned_32(length), caller_id, mode) then pragma DEBUG (debug.log (debug.ERROR, ewok.tasks.tasks_list(caller_id).name & ": sys_get_random(): 'value' parameter not in caller space")); goto ret_inval; end if; -- Size is arbitrary limited to 16 bytes to avoid exhausting the entropy pool -- FIXME - is that check really correct? if length > 16 then goto ret_inval; end if; -- Is the task allowed to use the RNG? if not ewok.perm.ressource_is_granted (ewok.perm.PERM_RES_TSK_RNG, caller_id) then pragma DEBUG (debug.log (debug.ERROR, ewok.tasks.tasks_list(caller_id).name & ": sys_get_random(): permission not granted")); goto ret_denied; end if; -- Calling the RNG which handle the potential random source errors (case -- of harware random sources such as TRNG IP) -- NOTE: there is some time when the generated random -- content may be weak for various reason due to arch-specific -- constraint. In this case, the return value is set to -- busy. Please check this return value when using this -- syscall to avoid using weak random content if c.kernel.get_random (buffer, length) /= types.c.SUCCESS then pragma DEBUG (debug.log (debug.ERROR, ewok.tasks.tasks_list(caller_id).name & ": sys_get_random(): weak seed")); goto ret_busy; end if; set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_inval>> set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_busy>> set_return_value (caller_id, mode, SYS_E_BUSY); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_denied>> set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end sys_get_random; end ewok.syscalls.rng;
-- 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.Numerics.Generic_Complex_Types; generic with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>); package Ada.Text_IO.Complex_IO is use Complex_Types; Default_Fore : Field := 2; Default_Aft : Field := Real'Digits - 1; Default_Exp : Field := 3; procedure Get (File : in File_Type; Item : out Complex; Width : in Field := 0); procedure Get (Item : out Complex; Width : in Field := 0); procedure Put (File : in File_Type; Item : in Complex; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); procedure Put (Item : in Complex; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); procedure Get (From : in String; Item : out Complex; Last : out Positive); procedure Put (To : out String; Item : in Complex; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); end Ada.Text_IO.Complex_IO;
-- { dg-do run } -- { dg-options "-gnatws" } procedure Biased_Subtype is CIM_Max_AA : constant := 9_999_999; CIM_Min_AA : constant := -999_999; type TIM_AA is range CIM_Min_AA..CIM_Max_AA + 1; for TIM_AA'Size use 24; subtype STIM_AA is TIM_AA range TIM_AA(CIM_Min_AA)..TIM_AA(CIM_Max_AA); SAA : STIM_AA := 1; begin if Integer(SAA) /= 1 then raise Program_Error; end if; end;
---------------------------------------------------------------------------- -- Symbolic Expressions (symexpr) -- -- Copyright (C) 2012, Riccardo Bernardini -- -- This file is part of symexpr. -- -- symexpr is free software: you can redistribute it and/or modify -- it under the terms of the Lesser GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- symexpr 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 Lesser GNU General Public License -- along with gclp. If not, see <http://www.gnu.org/licenses/>. ---------------------------------------------------------------------------- with Symbolic_Expressions; package Test is function Get_Int (X : String) return String; type Int_Array is array (Positive range <>) of Integer; function Call (Name : String; Param : Int_Array) return Integer; package Int_Expr is new Symbolic_Expressions (Scalar_Type => Integer, Scalar_Array => Int_Array, Read_Scalar => Get_Int, Value => Integer'Value, Image => Integer'Image); end Test;
generic HSE_Value : HSE_Range := 8_000_000; PLL_Source : PLL_Source_Type := HSI; SYSCLK_Source : SYSCLK_Source_Type := HSI; RTC_Source : RTC_Source_Type := LSI; PLL_Prediv : PLL_Prediv_Range := 1; PLL_Mul : PLL_Mul_Range := 1; AHB_Prescaler : AHB_Prescaler_Type := DIV1; APB_Prescaler : APB_Prescaler_Type := DIV1; LSI_Enabled : Boolean := True; LSE_Enabled : Boolean := False; package STM32GD.Clock.Tree is pragma Preelaborate; PLL_Value : constant Integer := ( case PLL_Source is when HSI => HSI_Value / 2, when HSE => HSE_Value / PLL_Prediv); PLL_Output_Value : constant Integer := (PLL_Value / PLL_Prediv) * PLL_Mul; SYSCLK : constant Integer := ( case SYSCLK_Source is when HSI => HSI_Value, when PLL => PLL_Output_Value, when HSE => HSE_Value); HCLK : constant Integer := ( case AHB_Prescaler is when DIV1 => SYSCLK, when DIV2 => SYSCLK / 2, when DIV4 => SYSCLK / 4, when DIV8 => SYSCLK / 8, when DIV16 => SYSCLK / 16, when DIV64 => SYSCLK / 64, when DIV128 => SYSCLK / 128, when DIV256 => SYSCLK / 256, when DIV512 => SYSCLK / 512); PCLK : constant Integer := ( case APB_Prescaler is when DIV1 => HCLK, when DIV2 => HCLK / 2, when DIV4 => HCLK / 4, when DIV8 => HCLK / 8, when DIV16 => HCLK / 16); RTCCLK : constant Integer := ( case RTC_Source is when LSI => LSI_Value, when LSE => LSE_Value, when HSE => HSE_Value / 128); function Frequency (Clock : Clock_Type) return Integer; procedure Init; end STM32GD.Clock.Tree;
-- Copyright (c) 2015-2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Incr.Nodes.Tokens; package Incr.Nodes.Ultra_Roots is -- @summary -- Ultra_Root nodes of parse trees -- -- @description -- This package provides implementation of ultra_root nodes type Ultra_Root is new Node with private; type Ultra_Root_Access is access all Ultra_Root'Class; package Constructors is procedure Initialize (Self : out Ultra_Root'Class; Root : Nodes.Node_Access); end Constructors; private type Versioned_Node_Array is array (Positive range <>) of Versioned_Nodes.Container; type Ultra_Root is new Node with record BOS : Nodes.Tokens.Token_Access; Root : Versioned_Nodes.Container; EOS : Nodes.Tokens.Token_Access; end record; overriding function Is_Token (Self : Ultra_Root) return Boolean; overriding function Arity (Self : Ultra_Root) return Natural; overriding function Kind (Self : Ultra_Root) return Node_Kind; overriding function Child (Self : Ultra_Root; Index : Positive; Time : Version_Trees.Version) return Node_Access; overriding procedure Set_Child (Self : aliased in out Ultra_Root; Index : Positive; Value : Node_Access); overriding function Nested_Changes (Self : Ultra_Root; From : Version_Trees.Version; To : Version_Trees.Version) return Boolean; overriding function Parent (Self : Ultra_Root; Time : Version_Trees.Version) return Node_Access; overriding procedure Set_Parent (Self : in out Ultra_Root; Value : Node_Access) is null; overriding function Exists (Self : Ultra_Root; Time : Version_Trees.Version) return Boolean; overriding function Get_Flag (Self : Ultra_Root; Flag : Transient_Flags) return Boolean; overriding procedure Set_Flag (Self : in out Ultra_Root; Flag : Transient_Flags; Value : Boolean := True) is null; overriding procedure On_Commit (Self : in out Ultra_Root; Parent : Node_Access); overriding procedure On_Nested_Changes (Self : in out Ultra_Root; Diff : Integer) is null; overriding function Span (Self : aliased in out Ultra_Root; Kind : Span_Kinds; Time : Version_Trees.Version) return Natural; overriding procedure Discard (Self : in out Ultra_Root); overriding procedure Discard_Parent (Self : in out Ultra_Root) is null; overriding function Local_Changes (Self : Ultra_Root; From : Version_Trees.Version; To : Version_Trees.Version) return Boolean; overriding function Nested_Errors (Self : Ultra_Root; Time : Version_Trees.Version) return Boolean; overriding function Local_Errors (Self : Ultra_Root; Unused : Version_Trees.Version) return Boolean is (False); overriding procedure Set_Local_Errors (Self : in out Ultra_Root; Value : Boolean := True) is null; end Incr.Nodes.Ultra_Roots;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2013, 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.OCL.Feature_Call_Exps.Collections is pragma Preelaborate; package OCL_Feature_Call_Exp_Collections is new AMF.Generic_Collections (OCL_Feature_Call_Exp, OCL_Feature_Call_Exp_Access); type Set_Of_OCL_Feature_Call_Exp is new OCL_Feature_Call_Exp_Collections.Set with null record; Empty_Set_Of_OCL_Feature_Call_Exp : constant Set_Of_OCL_Feature_Call_Exp; type Ordered_Set_Of_OCL_Feature_Call_Exp is new OCL_Feature_Call_Exp_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_OCL_Feature_Call_Exp : constant Ordered_Set_Of_OCL_Feature_Call_Exp; type Bag_Of_OCL_Feature_Call_Exp is new OCL_Feature_Call_Exp_Collections.Bag with null record; Empty_Bag_Of_OCL_Feature_Call_Exp : constant Bag_Of_OCL_Feature_Call_Exp; type Sequence_Of_OCL_Feature_Call_Exp is new OCL_Feature_Call_Exp_Collections.Sequence with null record; Empty_Sequence_Of_OCL_Feature_Call_Exp : constant Sequence_Of_OCL_Feature_Call_Exp; private Empty_Set_Of_OCL_Feature_Call_Exp : constant Set_Of_OCL_Feature_Call_Exp := (OCL_Feature_Call_Exp_Collections.Set with null record); Empty_Ordered_Set_Of_OCL_Feature_Call_Exp : constant Ordered_Set_Of_OCL_Feature_Call_Exp := (OCL_Feature_Call_Exp_Collections.Ordered_Set with null record); Empty_Bag_Of_OCL_Feature_Call_Exp : constant Bag_Of_OCL_Feature_Call_Exp := (OCL_Feature_Call_Exp_Collections.Bag with null record); Empty_Sequence_Of_OCL_Feature_Call_Exp : constant Sequence_Of_OCL_Feature_Call_Exp := (OCL_Feature_Call_Exp_Collections.Sequence with null record); end AMF.OCL.Feature_Call_Exps.Collections;
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces.C; with xcb.xcb_charinfo_t; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_charinfo_iterator_t is -- Item -- type Item is record data : access xcb.xcb_charinfo_t.Item; the_rem : aliased Interfaces.C.int; index : aliased Interfaces.C.int; end record; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_charinfo_iterator_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_charinfo_iterator_t.Item, Element_Array => xcb.xcb_charinfo_iterator_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_charinfo_iterator_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_charinfo_iterator_t.Pointer, Element_Array => xcb.xcb_charinfo_iterator_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_charinfo_iterator_t;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- A D A . C O N T A I N E R S . B O U N D E D _ H O L D E R S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2015-2021, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- 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/>. -- ------------------------------------------------------------------------------ private with System; private with Ada.Strings.Text_Buffers; generic type Element_Type (<>) is private; Max_Size_In_Storage_Elements : Natural := Element_Type'Max_Size_In_Storage_Elements; with function "=" (Left, Right : Element_Type) return Boolean is <>; package Ada.Containers.Bounded_Holders is pragma Annotate (CodePeer, Skip_Analysis); -- This package is patterned after Ada.Containers.Indefinite_Holders. It is -- used to treat indefinite subtypes as definite, but without using heap -- allocation. For example, you might like to say: -- -- type A is array (...) of T'Class; -- illegal -- -- Instead, you can instantiate this package with Element_Type => T'Class, -- and say: -- -- type A is array (...) of Holder; -- -- Each object of type Holder is allocated Max_Size_In_Storage_Elements -- bytes. If you try to create a holder from an object of type Element_Type -- that is too big, an exception is raised (assuming assertions are -- enabled). This applies to To_Holder and Set. If you pass an Element_Type -- object that is smaller than Max_Size_In_Storage_Elements, it works fine, -- but some space is wasted. -- -- NOTE: If assertions are disabled, and you try to use an Element that is -- too big, execution is erroneous, and anything can happen, such as -- overwriting arbitrary memory locations. -- -- Element_Type must not be an unconstrained array type. It can be a -- class-wide type or a type with non-defaulted discriminants. -- -- The 'Size of each Element_Type object must be a multiple of -- System.Storage_Unit; e.g. creating Holders from 5-bit objects won't -- work. type Holder is private; function "=" (Left, Right : Holder) return Boolean; function To_Holder (New_Item : Element_Type) return Holder; function "+" (New_Item : Element_Type) return Holder renames To_Holder; function Get (Container : Holder) return Element_Type; procedure Set (Container : in out Holder; New_Item : Element_Type); function Constant_Reference (Container : aliased Holder) return not null access constant Element_Type; function Reference (Container : not null access Holder) return not null access Element_Type; private -- The implementation uses low-level tricks (Address clauses and unchecked -- conversions of access types) to treat the elements as storage arrays. pragma Assert (Element_Type'Alignment <= Standard'Maximum_Alignment); -- This prevents elements with a user-specified Alignment that is too big type Storage_Element is mod 2 ** System.Storage_Unit; type Storage_Array is array (Positive range <>) of Storage_Element; type Holder is record Data : Storage_Array (1 .. Max_Size_In_Storage_Elements); end record with Alignment => Standard'Maximum_Alignment, Put_Image => Put_Image; -- We would like to say "Alignment => Element_Type'Alignment", but that -- is illegal because it's not static, so we use the maximum possible -- (default) alignment instead. procedure Put_Image (S : in out Ada.Strings.Text_Buffers.Root_Buffer_Type'Class; V : Holder); type Element_Access is access all Element_Type; pragma Assert (Element_Access'Size = Standard'Address_Size, "cannot instantiate with an array type"); -- If Element_Access is a fat pointer, Element_Type must be an -- unconstrained array, which is not allowed. Arrays won't work, because -- the 'Address of an array points to the first element, thus losing the -- bounds. pragma No_Strict_Aliasing (Element_Access); -- Needed because we are unchecked-converting from Address to -- Element_Access (see package body), which is a violation of the -- normal aliasing rules enforced by gcc. end Ada.Containers.Bounded_Holders;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017-2020, Fabien Chouteau -- -- -- -- 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 Cortex_M_SVD.SysTick; use Cortex_M_SVD.SysTick; with AGATE.Scheduler; use AGATE.Scheduler; with Cortex_M_SVD.SCB; use Cortex_M_SVD.SCB; package body AGATE.Timer is Tick_Period : constant := 168_000_000 / 1_000; Next_Tick : Time; procedure Initialize; procedure Timer_Handler; pragma Export (C, Timer_Handler, "SysTick_Handler"); procedure Clear_Timer_Interrupt; ---------------- -- Initialize -- ---------------- procedure Initialize is CSR : Word with Volatile, Address => SysTick_Periph.CSR'Address; begin Next_Tick := Time (Tick_Period); SysTick_Periph.RVR.RELOAD := Tick_Period - 1; SysTick_Periph.CSR.ENABLE := Enable; Clear_Timer_Interrupt; -- SysTick_Periph.CSR.TICKINT := Enable; -- Workaround... CSR := CSR or 2**1; end Initialize; --------------------------- -- Clear_Timer_Interrupt -- --------------------------- procedure Clear_Timer_Interrupt is begin SCB_Periph.ICSR.PENDSTCLR := True; end Clear_Timer_Interrupt; ------------------- -- Timer_Handler -- ------------------- procedure Timer_Handler is begin AGATE.Scheduler.Wakeup_Expired_Alarms; Clear_Timer_Interrupt; end Timer_Handler; ----------- -- Clock -- ----------- function Clock return Time is Ret : Time; Count : UInt24; begin Count := SysTick_Periph.CVR.CURRENT; if SysTick_Periph.CSR.COUNTFLAG then Ret := Next_Tick; Next_Tick := Next_Tick + Tick_Period; else Ret := Next_Tick - Time (Count); end if; return Ret; end Clock; --------------- -- Set_Alarm -- --------------- procedure Set_Alarm (Alarm_Time : Time) is begin -- There's no alarm timer in the SysTick implementation. Instead the -- system gets an interrupt at a given frequency (the tick). null; end Set_Alarm; begin Initialize; end AGATE.Timer;
------------------------------------------------------------------------------ -- -- -- Ada binding for OpenGL/WebGL -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2018, 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. -- -- -- ------------------------------------------------------------------------------ package body OpenGL.Contexts.Internals is function Current_GLFW_Context return GLFW.GLFWwindow_Access is begin if OpenGL.Contexts.Current_Context /= null then return GLFW_Context (OpenGL.Contexts.Current_Context.all); else return null; end if; end Current_GLFW_Context; function GLFW_Context (Self : OpenGL_Context'Class) return GLFW.GLFWwindow_Access is begin return Self.Window; end GLFW_Context; end OpenGL.Contexts.Internals;
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- 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. -- * The name of the copyright holder 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 HOLDER 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. ------------------------------------------------------------------------------- pragma SPARK_Mode (On); with Ascon.Permutations; with Keccak.Generic_Sponge; with Keccak.Padding; package Ascon.Sponge is new Keccak.Generic_Sponge (State_Size_Bits => Ascon.State_Size_Bits, State_Type => Ascon.State, Init_State => Ascon.Init, Permute => Ascon.Permutations.Permute_12, XOR_Bits_Into_State => Ascon.XOR_Bits_Into_State, Extract_Data => Ascon.Extract_Bytes, Pad => Keccak.Padding.Pad10_Multi_Blocks_Big_Endian);
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Nodes.Number_Declarations is function Create (Names : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Vector_Access; Colon_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Constant_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Assignment_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Expression : not null Program.Elements.Expressions .Expression_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Number_Declaration is begin return Result : Number_Declaration := (Names => Names, Colon_Token => Colon_Token, Constant_Token => Constant_Token, Assignment_Token => Assignment_Token, Expression => Expression, Semicolon_Token => Semicolon_Token, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Names : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Vector_Access; Expression : not null Program.Elements.Expressions .Expression_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Number_Declaration is begin return Result : Implicit_Number_Declaration := (Names => Names, Expression => Expression, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Names (Self : Base_Number_Declaration) return not null Program.Elements.Defining_Identifiers .Defining_Identifier_Vector_Access is begin return Self.Names; end Names; overriding function Expression (Self : Base_Number_Declaration) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Expression; end Expression; overriding function Colon_Token (Self : Number_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Colon_Token; end Colon_Token; overriding function Constant_Token (Self : Number_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Constant_Token; end Constant_Token; overriding function Assignment_Token (Self : Number_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Assignment_Token; end Assignment_Token; overriding function Semicolon_Token (Self : Number_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Semicolon_Token; end Semicolon_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Number_Declaration) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Number_Declaration) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Number_Declaration) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : in out Base_Number_Declaration'Class) is begin for Item in Self.Names.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; Set_Enclosing_Element (Self.Expression, Self'Unchecked_Access); null; end Initialize; overriding function Is_Number_Declaration (Self : Base_Number_Declaration) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Number_Declaration; overriding function Is_Declaration (Self : Base_Number_Declaration) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Declaration; overriding procedure Visit (Self : not null access Base_Number_Declaration; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Number_Declaration (Self); end Visit; overriding function To_Number_Declaration_Text (Self : in out Number_Declaration) return Program.Elements.Number_Declarations .Number_Declaration_Text_Access is begin return Self'Unchecked_Access; end To_Number_Declaration_Text; overriding function To_Number_Declaration_Text (Self : in out Implicit_Number_Declaration) return Program.Elements.Number_Declarations .Number_Declaration_Text_Access is pragma Unreferenced (Self); begin return null; end To_Number_Declaration_Text; end Program.Nodes.Number_Declarations;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web 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$ ------------------------------------------------------------------------------ package Web_Services is pragma Pure; end Web_Services;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M -- -- -- -- S p e c -- -- (VxWorks 6 Kernel Version PPC) -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- 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 System is pragma Pure; -- Note that we take advantage of the implementation permission to make -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada -- 2005, this is Pure in any case (AI-362). pragma No_Elaboration_Code_All; -- Allow the use of that restriction in units that WITH this unit type Name is (SYSTEM_NAME_GNAT); System_Name : constant Name := SYSTEM_NAME_GNAT; -- System-Dependent Named Numbers Min_Int : constant := -2 ** (Standard'Max_Integer_Size - 1); Max_Int : constant := 2 ** (Standard'Max_Integer_Size - 1) - 1; Max_Binary_Modulus : constant := 2 ** Standard'Max_Integer_Size; Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; Max_Base_Digits : constant := Long_Long_Float'Digits; Max_Digits : constant := Long_Long_Float'Digits; Max_Mantissa : constant := 63; Fine_Delta : constant := 2.0 ** (-Max_Mantissa); Tick : constant := 1.0 / 60.0; -- Storage-related Declarations type Address is private; pragma Preelaborable_Initialization (Address); Null_Address : constant Address; Storage_Unit : constant := 8; Word_Size : constant := 32; Memory_Size : constant := 2 ** 32; -- Address comparison function "<" (Left, Right : Address) return Boolean; function "<=" (Left, Right : Address) return Boolean; function ">" (Left, Right : Address) return Boolean; function ">=" (Left, Right : Address) return Boolean; function "=" (Left, Right : Address) return Boolean; pragma Import (Intrinsic, "<"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, ">="); pragma Import (Intrinsic, "="); -- Other System-Dependent Declarations type Bit_Order is (High_Order_First, Low_Order_First); Default_Bit_Order : constant Bit_Order := High_Order_First; pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning -- Priority-related Declarations (RM D.1) -- Ada priorities are mapped to VxWorks priorities using the following -- transformation: 255 - Ada Priority -- Ada priorities are used as follows: -- 256 is reserved for the VxWorks kernel -- 248 - 255 correspond to hardware interrupt levels 0 .. 7 -- 247 is a catchall default "interrupt" priority for signals, -- allowing higher priority than normal tasks, but lower than -- hardware priority levels. Protected Object ceilings can -- override these values. -- 246 is used by the Interrupt_Manager task Max_Priority : constant Positive := 245; Max_Interrupt_Priority : constant Positive := 255; subtype Any_Priority is Integer range 0 .. 255; subtype Priority is Any_Priority range 0 .. 245; subtype Interrupt_Priority is Any_Priority range 246 .. 255; Default_Priority : constant Priority := 122; private type Address is mod Memory_Size; Null_Address : constant Address := 0; -------------------------------------- -- System Implementation Parameters -- -------------------------------------- -- These parameters provide information about the target that is used -- by the compiler. They are in the private part of System, where they -- can be accessed using the special circuitry in the Targparm unit -- whose source should be consulted for more detailed descriptions -- of the individual switch values. Backend_Divide_Checks : constant Boolean := False; Backend_Overflow_Checks : constant Boolean := True; Command_Line_Args : constant Boolean := False; Configurable_Run_Time : constant Boolean := False; Denorm : constant Boolean := True; Duration_32_Bits : constant Boolean := False; Exit_Status_Supported : constant Boolean := True; Fractional_Fixed_Ops : constant Boolean := False; Frontend_Layout : constant Boolean := False; Machine_Overflows : constant Boolean := False; Machine_Rounds : constant Boolean := True; Preallocated_Stacks : constant Boolean := False; Signed_Zeros : constant Boolean := True; Stack_Check_Default : constant Boolean := False; Stack_Check_Probes : constant Boolean := True; Stack_Check_Limits : constant Boolean := False; Support_Aggregates : constant Boolean := True; Support_Composite_Assign : constant Boolean := True; Support_Composite_Compare : constant Boolean := True; Support_Long_Shifts : constant Boolean := True; Always_Compatible_Rep : constant Boolean := False; Suppress_Standard_Library : constant Boolean := False; Use_Ada_Main_Program_Name : constant Boolean := True; Frontend_Exceptions : constant Boolean := False; ZCX_By_Default : constant Boolean := True; Executable_Extension : constant String := ".out"; end System;
----------------------------------------------------------------------- -- mat-events-timelines - Timelines -- 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 Ada.Containers.Vectors; with MAT.Expressions; with MAT.Events.Tools; with MAT.Events.Targets; package MAT.Events.Timelines is -- Describe a section of the timeline. The section has a starting and ending -- event that marks the boundary of the section within the collected events. -- The timeline section gives the duration and some statistics about memory -- allocation made in the section. type Timeline_Info is record First_Event : MAT.Events.Target_Event_Type; Last_Event : MAT.Events.Target_Event_Type; Duration : MAT.Types.Target_Time := 0; Malloc_Count : Natural := 0; Realloc_Count : Natural := 0; Free_Count : Natural := 0; Alloc_Size : MAT.Types.Target_Size := 0; Free_Size : MAT.Types.Target_Size := 0; end record; package Timeline_Info_Vectors is new Ada.Containers.Vectors (Positive, Timeline_Info); subtype Timeline_Info_Vector is Timeline_Info_Vectors.Vector; subtype Timeline_Info_Cursor is Timeline_Info_Vectors.Cursor; procedure Extract (Target : in out MAT.Events.Targets.Target_Events'Class; Level : in Positive; Into : in out Timeline_Info_Vector); -- Find in the events stream the events which are associated with a given event. -- When the <tt>Event</tt> is a memory allocation, find the associated reallocation -- and free events. When the event is a free, find the associated allocations. -- Collect at most <tt>Max</tt> events. procedure Find_Related (Target : in out MAT.Events.Targets.Target_Events'Class; Event : in MAT.Events.Target_Event_Type; Max : in Positive; List : in out MAT.Events.Tools.Target_Event_Vector); -- Find the sizes of malloc and realloc events which is selected by the given filter. -- Update the <tt>Sizes</tt> map to keep track of the first event and last event and -- the number of events found for the corresponding size. procedure Find_Sizes (Target : in out MAT.Events.Targets.Target_Events'Class; Filter : in MAT.Expressions.Expression_Type; Sizes : in out MAT.Events.Tools.Size_Event_Info_Map); -- Find the function address from the call event frames for the events which is selected -- by the given filter. The function addresses are collected up to the given frame depth. -- Update the <tt>Frames</tt> map to keep track of the first event and last event and -- the number of events found for the corresponding frame address. procedure Find_Frames (Target : in out MAT.Events.Targets.Target_Events'Class; Filter : in MAT.Expressions.Expression_Type; Depth : in Positive; Exact : in Boolean; Frames : in out MAT.Events.Tools.Frame_Event_Info_Map); -- Collect the events that match the filter and append them to the events vector. procedure Filter_Events (Target : in out MAT.Events.Targets.Target_Events'Class; Filter : in MAT.Expressions.Expression_Type; Events : in out MAT.Events.Tools.Target_Event_Vector); end MAT.Events.Timelines;
with C.string; package body GMP is function Version return String is S : constant C.char_const_ptr := C.gmp.qqgmp_version; Length : constant Natural := Natural (C.string.strlen (S)); Result : String (1 .. Length); for Result'Address use S.all'Address; begin return Result; end Version; function Default_Precision return Precision is begin return Precision (C.gmp.gmpf_get_default_prec); end Default_Precision; procedure mpz_set_Long_Long_Integer ( rop : not null access C.gmp.mpz_struct; op : in Long_Long_Integer) is subtype ui is Long_Long_Integer range Long_Long_Integer (C.unsigned_long'First) .. Long_Long_Integer ( C.unsigned_long_long'Min ( C.unsigned_long_long (C.unsigned_long'Last), C.unsigned_long_long (Long_Long_Integer'Last))); op_in_ui : constant Boolean := op in ui; begin if op_in_ui then C.gmp.mpz_set_ui (rop, C.unsigned_long'Mod (op)); else declare subtype si is Long_Long_Integer range Long_Long_Integer (C.signed_long'First) .. Long_Long_Integer (C.signed_long'Last); pragma Warnings (Off); -- always True in 64bit environment op_in_si : constant Boolean := op in si; pragma Warnings (On); begin if op_in_si then C.gmp.mpz_set_si (rop, C.signed_long (op)); else C.gmp.mpz_set_si ( rop, C.signed_long (C.Shift_Right_Arithmetic ( C.signed_long_long (op), C.unsigned_long'Size))); C.gmp.mpz_mul_2exp ( rop, rop, C.unsigned_long'Size); C.gmp.mpz_add_ui ( rop, rop, C.unsigned_long'Mod (op)); end if; end; end if; end mpz_set_Long_Long_Integer; end GMP;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . S P I T B O L . P A T T E R N S -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1997-1999 Ada Core Technologies, 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, 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. -- -- -- -- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- SPITBOL-like pattern construction and matching -- This child package of GNAT.SPITBOL provides a complete implementation -- of the SPITBOL-like pattern construction and matching operations. This -- package is based on Macro-SPITBOL created by Robert Dewar. ------------------------------------------------------------ -- Summary of Pattern Matching Packages in GNAT Hierarchy -- ------------------------------------------------------------ -- There are three related packages that perform pattern maching functions. -- the following is an outline of these packages, to help you determine -- which is best for your needs. -- GNAT.Regexp (files g-regexp.ads/g-regexp.adb) -- This is a simple package providing Unix-style regular expression -- matching with the restriction that it matches entire strings. It -- is particularly useful for file name matching, and in particular -- it provides "globbing patterns" that are useful in implementing -- unix or DOS style wild card matching for file names. -- GNAT.Regpat (files g-regpat.ads/g-regpat.adb) -- This is a more complete implementation of Unix-style regular -- expressions, copied from the original V7 style regular expression -- library written in C by Henry Spencer. It is functionally the -- same as this library, and uses the same internal data structures -- stored in a binary compatible manner. -- GNAT.Spitbol.Patterns (files g-spipat.ads/g-spipat.adb) -- This is a completely general patterm matching package based on the -- pattern language of SNOBOL4, as implemented in SPITBOL. The pattern -- language is modeled on context free grammars, with context sensitive -- extensions that provide full (type 0) computational capabilities. with Ada.Finalization; use Ada.Finalization; with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Text_IO; use Ada.Text_IO; package GNAT.Spitbol.Patterns is pragma Elaborate_Body (Patterns); ------------------------------- -- Pattern Matching Tutorial -- ------------------------------- -- A pattern matching operation (a call to one of the Match subprograms) -- takes a subject string and a pattern, and optionally a replacement -- string. The replacement string option is only allowed if the subject -- is a variable. -- The pattern is matched against the subject string, and either the -- match fails, or it succeeds matching a contiguous substring. If a -- replacement string is specified, then the subject string is modified -- by replacing the matched substring with the given replacement. -- Concatenation and Alternation -- ============================= -- A pattern consists of a series of pattern elements. The pattern is -- built up using either the concatenation operator: -- A & B -- which means match A followed immediately by matching B, or the -- alternation operator: -- A or B -- which means first attempt to match A, and then if that does not -- succeed, match B. -- There is full backtracking, which means that if a given pattern -- element fails to match, then previous alternatives are matched. -- For example if we have the pattern: -- (A or B) & (C or D) & (E or F) -- First we attempt to match A, if that succeeds, then we go on to try -- to match C, and if that succeeds, we go on to try to match E. If E -- fails, then we try F. If F fails, then we go back and try matching -- D instead of C. Let's make this explicit using a specific example, -- and introducing the simplest kind of pattern element, which is a -- literal string. The meaning of this pattern element is simply to -- match the characters that correspond to the string characters. Now -- let's rewrite the above pattern form with specific string literals -- as the pattern elements: -- ("ABC" or "AB") & ("DEF" or "CDE") & ("GH" or "IJ") -- The following strings will be attempted in sequence: -- ABC . DEF . GH -- ABC . DEF . IJ -- ABC . CDE . GH -- ABC . CDE . IJ -- AB . DEF . GH -- AB . DEF . IJ -- AB . CDE . GH -- AB . CDE . IJ -- Here we use the dot simply to separate the pieces of the string -- matched by the three separate elements. -- Moving the Start Point -- ====================== -- A pattern is not required to match starting at the first character -- of the string, and is not required to match to the end of the string. -- The first attempt does indeed attempt to match starting at the first -- character of the string, trying all the possible alternatives. But -- if all alternatives fail, then the starting point of the match is -- moved one character, and all possible alternatives are attempted at -- the new anchor point. -- The entire match fails only when every possible starting point has -- been attempted. As an example, suppose that we had the subject -- string -- "ABABCDEIJKL" -- matched using the pattern in the previous example: -- ("ABC" or "AB") & ("DEF" or "CDE") & ("GH" or "IJ") -- would succeed, afer two anchor point moves: -- "ABABCDEIJKL" -- ^^^^^^^ -- matched -- section -- This mode of pattern matching is called the unanchored mode. It is -- also possible to put the pattern matcher into anchored mode by -- setting the global variable Anchored_Mode to True. This will cause -- all subsequent matches to be performed in anchored mode, where the -- match is required to start at the first character. -- We will also see later how the effect of an anchored match can be -- obtained for a single specified anchor point if this is desired. -- Other Pattern Elements -- ====================== -- In addition to strings (or single characters), there are many special -- pattern elements that correspond to special predefined alternations: -- Arb Matches any string. First it matches the null string, and -- then on a subsequent failure, matches one character, and -- then two characters, and so on. It only fails if the -- entire remaining string is matched. -- Bal Matches a non-empty string that is parentheses balanced -- with respect to ordinary () characters. Examples of -- balanced strings are "ABC", "A((B)C)", and "A(B)C(D)E". -- Bal matches the shortest possible balanced string on the -- first attempt, and if there is a subsequent failure, -- attempts to extend the string. -- Cancel Immediately aborts the entire pattern match, signalling -- failure. This is a specialized pattern element, which is -- useful in conjunction with some of the special pattern -- elements that have side effects. -- Fail The null alternation. Matches no possible strings, so it -- always signals failure. This is a specialized pattern -- element, which is useful in conjunction with some of the -- special pattern elements that have side effects. -- Fence Matches the null string at first, and then if a failure -- causes alternatives to be sought, aborts the match (like -- a Cancel). Note that using Fence at the start of a pattern -- has the same effect as matching in anchored mode. -- Rest Matches from the current point to the last character in -- the string. This is a specialized pattern element, which -- is useful in conjunction with some of the special pattern -- elements that have side effects. -- Succeed Repeatedly matches the null string (it is equivalent to -- the alternation ("" or "" or "" ....). This is a special -- pattern element, which is useful in conjunction with some -- of the special pattern elements that have side effects. -- Pattern Construction Functions -- ============================== -- The following functions construct additional pattern elements -- Any(S) Where S is a string, matches a single character that is -- any one of the characters in S. Fails if the current -- character is not one of the given set of characters. -- Arbno(P) Where P is any pattern, matches any number of instances -- of the pattern, starting with zero occurrences. It is -- thus equivalent to ("" or (P & ("" or (P & ("" ....)))). -- The pattern P may contain any number of pattern elements -- including the use of alternatiion and concatenation. -- Break(S) Where S is a string, matches a string of zero or more -- characters up to but not including a break character -- that is one of the characters given in the string S. -- Can match the null string, but cannot match the last -- character in the string, since a break character is -- required to be present. -- BreakX(S) Where S is a string, behaves exactly like Break(S) when -- it first matches, but if a string is successfully matched, -- then a susequent failure causes an attempt to extend the -- matched string. -- Fence(P) Where P is a pattern, attempts to match the pattern P -- including trying all possible alternatives of P. If none -- of these alternatives succeeds, then the Fence pattern -- fails. If one alternative succeeds, then the pattern -- match proceeds, but on a subsequent failure, no attempt -- is made to search for alternative matches of P. The -- pattern P may contain any number of pattern elements -- including the use of alternatiion and concatenation. -- Len(N) Where N is a natural number, matches the given number of -- characters. For example, Len(10) matches any string that -- is exactly ten characters long. -- NotAny(S) Where S is a string, matches a single character that is -- not one of the characters of S. Fails if the current -- characer is one of the given set of characters. -- NSpan(S) Where S is a string, matches a string of zero or more -- characters that is among the characters given in the -- string. Always matches the longest possible such string. -- Always succeeds, since it can match the null string. -- Pos(N) Where N is a natural number, matches the null string -- if exactly N characters have been matched so far, and -- otherwise fails. -- Rpos(N) Where N is a natural number, matches the null string -- if exactly N characters remain to be matched, and -- otherwise fails. -- Rtab(N) Where N is a natural number, matches characters from -- the current position until exactly N characters remain -- to be matched in the string. Fails if fewer than N -- unmatched characters remain in the string. -- Tab(N) Where N is a natural number, matches characters from -- the current position until exactly N characters have -- been matched in all. Fails if more than N characters -- have already been matched. -- Span(S) Where S is a string, matches a string of one or more -- characters that is among the characters given in the -- string. Always matches the longest possible such string. -- Fails if the current character is not one of the given -- set of characters. -- Recursive Pattern Matching -- ========================== -- The plus operator (+P) where P is a pattern variable, creates -- a recursive pattern that will, at pattern matching time, follow -- the pointer to obtain the referenced pattern, and then match this -- pattern. This may be used to construct recursive patterns. Consider -- for example: -- P := ("A" or ("B" & (+P))) -- On the first attempt, this pattern attempts to match the string "A". -- If this fails, then the alternative matches a "B", followed by an -- attempt to match P again. This second attempt first attempts to -- match "A", and so on. The result is a pattern that will match a -- string of B's followed by a single A. -- This particular example could simply be written as NSpan('B') & 'A', -- but the use of recursive patterns in the general case can construct -- complex patterns which could not otherwise be built. -- Pattern Assignment Operations -- ============================= -- In addition to the overall result of a pattern match, which indicates -- success or failure, it is often useful to be able to keep track of -- the pieces of the subject string that are matched by individual -- pattern elements, or subsections of the pattern. -- The pattern assignment operators allow this capability. The first -- form is the immediate assignment: -- P * S -- Here P is an arbitrary pattern, and S is a variable of type VString -- that will be set to the substring matched by P. This assignment -- happens during pattern matching, so if P matches more than once, -- then the assignment happens more than once. -- The deferred assignment operation: -- P ** S -- avoids these multiple assignments by deferring the assignment to the -- end of the match. If the entire match is successful, and if the -- pattern P was part of the successful match, then at the end of the -- matching operation the assignment to S of the string matching P is -- performed. -- The cursor assignment operation: -- Setcur(N'Access) -- assigns the current cursor position to the natural variable N. The -- cursor position is defined as the count of characters that have been -- matched so far (including any start point moves). -- Finally the operations * and ** may be used with values of type -- Text_IO.File_Access. The effect is to do a Put_Line operation of -- the matched substring. These are particularly useful in debugging -- pattern matches. -- Deferred Matching -- ================= -- The pattern construction functions (such as Len and Any) all permit -- the use of pointers to natural or string values, or functions that -- return natural or string values. These forms cause the actual value -- to be obtained at pattern matching time. This allows interesting -- possibilities for constructing dynamic patterns as illustrated in -- the examples section. -- In addition the (+S) operator may be used where S is a pointer to -- string or function returning string, with a similar deferred effect. -- A special use of deferred matching is the construction of predicate -- functions. The element (+P) where P is an access to a function that -- returns a Boolean value, causes the function to be called at the -- time the element is matched. If the function returns True, then the -- null string is matched, if the function returns False, then failure -- is signalled and previous alternatives are sought. -- Deferred Replacement -- ==================== -- The simple model given for pattern replacement (where the matched -- substring is replaced by the string given as the third argument to -- Match) works fine in simple cases, but this approach does not work -- in the case where the expression used as the replacement string is -- dependent on values set by the match. -- For example, suppose we want to find an instance of a parenthesized -- character, and replace the parentheses with square brackets. At first -- glance it would seem that: -- Match (Subject, '(' & Len (1) * Char & ')', '[' & Char & ']'); -- would do the trick, but that does not work, because the third -- argument to Match gets evaluated too early, before the call to -- Match, and before the pattern match has had a chance to set Char. -- To solve this problem we provide the deferred replacement capability. -- With this approach, which of course is only needed if the pattern -- involved has side effects, is to do the match in two stages. The -- call to Match sets a pattern result in a variable of the private -- type Match_Result, and then a subsequent Replace operation uses -- this Match_Result object to perform the required replacement. -- Using this approach, we can now write the above operation properly -- in a manner that will work: -- M : Match_Result; -- ... -- Match (Subject, '(' & Len (1) * Char & ')', M); -- Replace (M, '[' & Char & ']'); -- As with other Match cases, there is a function and procedure form -- of this match call. A call to Replace after a failed match has no -- effect. Note that Subject should not be modified between the calls. -- Examples of Pattern Matching -- ============================ -- First a simple example of the use of pattern replacement to remove -- a line number from the start of a string. We assume that the line -- number has the form of a string of decimal digits followed by a -- period, followed by one or more spaces. -- Digs : constant Pattern := Span("0123456789"); -- Lnum : constant Pattern := Pos(0) & Digs & '.' & Span(' '); -- Now to use this pattern we simply do a match with a replacement: -- Match (Line, Lnum, ""); -- which replaces the line number by the null string. Note that it is -- also possible to use an Ada.Strings.Maps.Character_Set value as an -- argument to Span and similar functions, and in particular all the -- useful constants 'in Ada.Strings.Maps.Constants are available. This -- means that we could define Digs as: -- Digs : constant Pattern := Span(Decimal_Digit_Set); -- The style we use here, of defining constant patterns and then using -- them is typical. It is possible to build up patterns dynamically, -- but it is usually more efficient to build them in pieces in advance -- using constant declarations. Note in particular that although it is -- possible to construct a pattern directly as an argument for the -- Match routine, it is much more efficient to preconstruct the pattern -- as we did in this example. -- Now let's look at the use of pattern assignment to break a -- string into sections. Suppose that the input string has two -- unsigned decimal integers, separated by spaces or a comma, -- with spaces allowed anywhere. Then we can isolate the two -- numbers with the following pattern: -- Num1, Num2 : aliased VString; -- B : constant Pattern := NSpan(' '); -- N : constant Pattern := Span("0123456789"); -- T : constant Pattern := -- NSpan(' ') & N * Num1 & Span(" ,") & N * Num2; -- The match operation Match (" 124, 257 ", T) would assign the -- string 124 to Num1 and the string 257 to Num2. -- Now let's see how more complex elements can be built from the -- set of primitive elements. The following pattern matches strings -- that have the syntax of Ada 95 based literals: -- Digs : constant Pattern := Span(Decimal_Digit_Set); -- UDigs : constant Pattern := Digs & Arbno('_' & Digs); -- Edig : constant Pattern := Span(Hexadecimal_Digit_Set); -- UEdig : constant Pattern := Edig & Arbno('_' & Edig); -- Bnum : constant Pattern := Udigs & '#' & UEdig & '#'; -- A match against Bnum will now match the desired strings, e.g. -- it will match 16#123_abc#, but not a#b#. However, this pattern -- is not quite complete, since it does not allow colons to replace -- the pound signs. The following is more complete: -- Bchar : constant Pattern := Any("#:"); -- Bnum : constant Pattern := Udigs & Bchar & UEdig & Bchar; -- but that is still not quite right, since it allows # and : to be -- mixed, and they are supposed to be used consistently. We solve -- this by using a deferred match. -- Temp : aliased VString; -- Bnum : constant Pattern := -- Udigs & Bchar * Temp & UEdig & (+Temp) -- Here the first instance of the base character is stored in Temp, and -- then later in the pattern we rematch the value that was assigned. -- For an example of a recursive pattern, let's define a pattern -- that is like the built in Bal, but the string matched is balanced -- with respect to square brackets or curly brackets. -- The language for such strings might be defined in extended BNF as -- ELEMENT ::= <any character other than [] or {}> -- | '[' BALANCED_STRING ']' -- | '{' BALANCED_STRING '}' -- BALANCED_STRING ::= ELEMENT {ELEMENT} -- Here we use {} to indicate zero or more occurrences of a term, as -- is common practice in extended BNF. Now we can translate the above -- BNF into recursive patterns as follows: -- Element, Balanced_String : aliased Pattern; -- . -- . -- . -- Element := NotAny ("[]{}") -- or -- ('[' & (+Balanced_String) & ']') -- or -- ('{' & (+Balanced_String) & '}'); -- Balanced_String := Element & Arbno (Element); -- Note the important use of + here to refer to a pattern not yet -- defined. Note also that we use assignments precisely because we -- cannot refer to as yet undeclared variables in initializations. -- Now that this pattern is constructed, we can use it as though it -- were a new primitive pattern element, and for example, the match: -- Match ("xy[ab{cd}]", Balanced_String * Current_Output & Fail); -- will generate the output: -- x -- xy -- xy[ab{cd}] -- y -- y[ab{cd}] -- [ab{cd}] -- a -- ab -- ab{cd} -- b -- b{cd} -- {cd} -- c -- cd -- d -- Note that the function of the fail here is simply to force the -- pattern Balanced_String to match all possible alternatives. Studying -- the operation of this pattern in detail is highly instructive. -- Finally we give a rather elaborate example of the use of deferred -- matching. The following declarations build up a pattern which will -- find the longest string of decimal digits in the subject string. -- Max, Cur : VString; -- Loc : Natural; -- function GtS return Boolean is -- begin -- return Length (Cur) > Length (Max); -- end GtS; -- Digit : constant Character_Set := Decimal_Digit_Set; -- Digs : constant Pattern := Span(Digit); -- Find : constant Pattern := -- "" * Max & Fence & -- initialize Max to null -- BreakX (Digit) & -- scan looking for digits -- ((Span(Digit) * Cur & -- assign next string to Cur -- (+GtS'Unrestricted_Access) & -- check size(Cur) > Size(Max) -- Setcur(Loc'Access)) -- if so, save location -- * Max) & -- and assign to Max -- Fail; -- seek all alternatives -- As we see from the comments here, complex patterns like this take -- on aspects of sequential programs. In fact they are sequential -- programs with general backtracking. In this pattern, we first use -- a pattern assignment that matches null and assigns it to Max, so -- that it is initialized for the new match. Now BreakX scans to the -- next digit. Arb would do here, but BreakX will be more efficient. -- Once we have found a digit, we scan out the longest string of -- digits with Span, and assign it to Cur. The deferred call to GtS -- tests if the string we assigned to Cur is the longest so far. If -- not, then failure is signalled, and we seek alternatives (this -- means that BreakX will extend and look for the next digit string). -- If the call to GtS succeeds then the matched string is assigned -- as the largest string so far into Max and its location is saved -- in Loc. Finally Fail forces the match to fail and seek alternatives, -- so that the entire string is searched. -- If the pattern Find is matched against a string, the variable Max -- at the end of the pattern will have the longest string of digits, -- and Loc will be the starting character location of the string. For -- example, Match("ab123cd4657ef23", Find) will assign "4657" to Max -- and 11 to Loc (indicating that the string ends with the eleventh -- character of the string). -- Note: the use of Unrestricted_Access to reference GtS will not -- be needed if GtS is defined at the outer level, but definitely -- will be necessary if GtS is a nested function (in which case of -- course the scope of the pattern Find will be restricted to this -- nested scope, and this cannot be checked, i.e. use of the pattern -- outside this scope is erroneous). Generally it is a good idea to -- define patterns and the functions they call at the outer level -- where possible, to avoid such problems. -- Correspondence with Pattern Matching in SPITBOL -- =============================================== -- Generally the Ada syntax and names correspond closely to SPITBOL -- syntax for pattern matching construction. -- The basic pattern construction operators are renamed as follows: -- Spitbol Ada -- (space) & -- | or -- $ * -- . ** -- The Ada operators were chosen so that the relative precedences of -- these operators corresponds to that of the Spitbol operators, but -- as always, the use of parentheses is advisable to clarify. -- The pattern construction operators all have similar names except for -- Spitbol Ada -- Abort Cancel -- Rem Rest -- where we have clashes with Ada reserved names. -- Ada requires the use of 'Access to refer to functions used in the -- pattern match, and often the use of 'Unrestricted_Access may be -- necessary to get around the scope restrictions if the functions -- are not declared at the outer level. -- The actual pattern matching syntax is modified in Ada as follows: -- Spitbol Ada -- X Y Match (X, Y); -- X Y = Z Match (X, Y, Z); -- and pattern failure is indicated by returning a Boolean result from -- the Match function (True for success, False for failure). ----------------------- -- Type Declarations -- ----------------------- type Pattern is private; -- Type representing a pattern. This package provides a complete set of -- operations for constructing patterns that can be used in the pattern -- matching operations provided. type Boolean_Func is access function return Boolean; -- General Boolean function type. When this type is used as a formal -- parameter type in this package, it indicates a deferred predicate -- pattern. The function will be called when the pattern element is -- matched and failure signalled if False is returned. type Natural_Func is access function return Natural; -- General Natural function type. When this type is used as a formal -- parameter type in this package, it indicates a deferred pattern. -- The function will be called when the pattern element is matched -- to obtain the currently referenced Natural value. type VString_Func is access function return VString; -- General VString function type. When this type is used as a formal -- parameter type in this package, it indicates a deferred pattern. -- The function will be called when the pattern element is matched -- to obtain the currently referenced string value. subtype PString is String; -- This subtype is used in the remainder of the package to indicate a -- formal parameter that is converted to its corresponding pattern, -- i.e. a pattern that matches the characters of the string. subtype PChar is Character; -- Similarly, this subtype is used in the remainder of the package to -- indicate a formal parameter that is converted to its corresponding -- pattern, i.e. a pattern that matches this one character. subtype VString_Var is VString; subtype Pattern_Var is Pattern; -- These synonyms are used as formal parameter types to a function where, -- if the language allowed, we would use in out parameters, but we are -- not allowed to have in out parameters for functions. Instead we pass -- actuals which must be variables, and with a bit of trickery in the -- body, manage to interprete them properly as though they were indeed -- in out parameters. -------------------------------- -- Basic Pattern Construction -- -------------------------------- function "&" (L : Pattern; R : Pattern) return Pattern; function "&" (L : PString; R : Pattern) return Pattern; function "&" (L : Pattern; R : PString) return Pattern; function "&" (L : PChar; R : Pattern) return Pattern; function "&" (L : Pattern; R : PChar) return Pattern; -- Pattern concatenation. Matches L followed by R. function "or" (L : Pattern; R : Pattern) return Pattern; function "or" (L : PString; R : Pattern) return Pattern; function "or" (L : Pattern; R : PString) return Pattern; function "or" (L : PString; R : PString) return Pattern; function "or" (L : PChar; R : Pattern) return Pattern; function "or" (L : Pattern; R : PChar) return Pattern; function "or" (L : PChar; R : PChar) return Pattern; function "or" (L : PString; R : PChar) return Pattern; function "or" (L : PChar; R : PString) return Pattern; -- Pattern alternation. Creates a pattern that will first try to match -- L and then on a subsequent failure, attempts to match R instead. ---------------------------------- -- Pattern Assignment Functions -- ---------------------------------- function "*" (P : Pattern; Var : VString_Var) return Pattern; function "*" (P : PString; Var : VString_Var) return Pattern; function "*" (P : PChar; Var : VString_Var) return Pattern; -- Matches P, and if the match succeeds, assigns the matched substring -- to the given VString variable S. This assignment happens as soon as -- the substring is matched, and if the pattern P1 is matched more than -- once during the course of the match, then the assignment will occur -- more than once. function "**" (P : Pattern; Var : VString_Var) return Pattern; function "**" (P : PString; Var : VString_Var) return Pattern; function "**" (P : PChar; Var : VString_Var) return Pattern; -- Like "*" above, except that the assignment happens at most once -- after the entire match is completed successfully. If the match -- fails, then no assignment takes place. ---------------------------------- -- Deferred Matching Operations -- ---------------------------------- function "+" (Str : VString_Var) return Pattern; -- Here Str must be a VString variable. This function constructs a -- pattern which at pattern matching time will access the current -- value of this variable, and match against these characters. function "+" (Str : VString_Func) return Pattern; -- Constructs a pattern which at pattern matching time calls the given -- function, and then matches against the string or character value -- that is returned by the call. function "+" (P : Pattern_Var) return Pattern; -- Here P must be a Pattern variable. This function constructs a -- pattern which at pattern matching time will access the current -- value of this variable, and match against the pattern value. function "+" (P : Boolean_Func) return Pattern; -- Constructs a predicate pattern function that at pattern matching time -- calls the given function. If True is returned, then the pattern matches. -- If False is returned, then failure is signalled. -------------------------------- -- Pattern Building Functions -- -------------------------------- function Arb return Pattern; -- Constructs a pattern that will match any string. On the first attempt, -- the pattern matches a null string, then on each successive failure, it -- matches one more character, and only fails if matching the entire rest -- of the string. function Arbno (P : Pattern) return Pattern; function Arbno (P : PString) return Pattern; function Arbno (P : PChar) return Pattern; -- Pattern repetition. First matches null, then on a subsequent failure -- attempts to match an additional instance of the given pattern. -- Equivalent to (but more efficient than) P & ("" or (P & ("" or ... function Any (Str : String) return Pattern; function Any (Str : VString) return Pattern; function Any (Str : Character) return Pattern; function Any (Str : Character_Set) return Pattern; function Any (Str : access VString) return Pattern; function Any (Str : VString_Func) return Pattern; -- Constructs a pattern that matches a single character that is one of -- the characters in the given argument. The pattern fails if the current -- character is not in Str. function Bal return Pattern; -- Constructs a pattern that will match any non-empty string that is -- parentheses balanced with respect to the normal parentheses characters. -- Attempts to extend the string if a subsequent failure occurs. function Break (Str : String) return Pattern; function Break (Str : VString) return Pattern; function Break (Str : Character) return Pattern; function Break (Str : Character_Set) return Pattern; function Break (Str : access VString) return Pattern; function Break (Str : VString_Func) return Pattern; -- Constructs a pattern that matches a (possibly null) string which -- is immediately followed by a character in the given argument. This -- character is not part of the matched string. The pattern fails if -- the remaining characters to be matched do not include any of the -- characters in Str. function BreakX (Str : String) return Pattern; function BreakX (Str : VString) return Pattern; function BreakX (Str : Character) return Pattern; function BreakX (Str : Character_Set) return Pattern; function BreakX (Str : access VString) return Pattern; function BreakX (Str : VString_Func) return Pattern; -- Like Break, but the pattern attempts to extend on a failure to find -- the next occurrence of a character in Str, and only fails when the -- last such instance causes a failure. function Cancel return Pattern; -- Constructs a pattern that immediately aborts the entire match function Fail return Pattern; -- Constructs a pattern that always fails. function Fence return Pattern; -- Constructs a pattern that matches null on the first attempt, and then -- causes the entire match to be aborted if a subsequent failure occurs. function Fence (P : Pattern) return Pattern; -- Constructs a pattern that first matches P. if P fails, then the -- constructed pattern fails. If P succeeds, then the match proceeds, -- but if subsequent failure occurs, alternatives in P are not sought. -- The idea of Fence is that each time the pattern is matched, just -- one attempt is made to match P, without trying alternatives. function Len (Count : Natural) return Pattern; function Len (Count : access Natural) return Pattern; function Len (Count : Natural_Func) return Pattern; -- Constructs a pattern that matches exactly the given number of -- characters. The pattern fails if fewer than this number of characters -- remain to be matched in the string. function NotAny (Str : String) return Pattern; function NotAny (Str : VString) return Pattern; function NotAny (Str : Character) return Pattern; function NotAny (Str : Character_Set) return Pattern; function NotAny (Str : access VString) return Pattern; function NotAny (Str : VString_Func) return Pattern; -- Constructs a pattern that matches a single character that is not -- one of the characters in the given argument. The pattern Fails if -- the current character is in Str. function NSpan (Str : String) return Pattern; function NSpan (Str : VString) return Pattern; function NSpan (Str : Character) return Pattern; function NSpan (Str : Character_Set) return Pattern; function NSpan (Str : access VString) return Pattern; function NSpan (Str : VString_Func) return Pattern; -- Constructs a pattern that matches the longest possible string -- consisting entirely of characters from the given argument. The -- string may be empty, so this pattern always succeeds. function Pos (Count : Natural) return Pattern; function Pos (Count : access Natural) return Pattern; function Pos (Count : Natural_Func) return Pattern; -- Constructs a pattern that matches the null string if exactly Count -- characters have already been matched, and otherwise fails. function Rest return Pattern; -- Constructs a pattern that always succeeds, matching the remaining -- unmatched characters in the pattern. function Rpos (Count : Natural) return Pattern; function Rpos (Count : access Natural) return Pattern; function Rpos (Count : Natural_Func) return Pattern; -- Constructs a pattern that matches the null string if exactly Count -- characters remain to be matched in the string, and otherwise fails. function Rtab (Count : Natural) return Pattern; function Rtab (Count : access Natural) return Pattern; function Rtab (Count : Natural_Func) return Pattern; -- Constructs a pattern that matches from the current location until -- exactly Count characters remain to be matched in the string. The -- pattern fails if fewer than Count characters remain to be matched. function Setcur (Var : access Natural) return Pattern; -- Constructs a pattern that matches the null string, and assigns the -- current cursor position in the string. This value is the number of -- characters matched so far. So it is zero at the start of the match. function Span (Str : String) return Pattern; function Span (Str : VString) return Pattern; function Span (Str : Character) return Pattern; function Span (Str : Character_Set) return Pattern; function Span (Str : access VString) return Pattern; function Span (Str : VString_Func) return Pattern; -- Constructs a pattern that matches the longest possible string -- consisting entirely of characters from the given argument. The -- string cannot be empty , so the pattern fails if the current -- character is not one of the characters in Str. function Succeed return Pattern; -- Constructs a pattern that succeeds matching null, both on the first -- attempt, and on any rematch attempt, i.e. it is equivalent to an -- infinite alternation of null strings. function Tab (Count : Natural) return Pattern; function Tab (Count : access Natural) return Pattern; function Tab (Count : Natural_Func) return Pattern; -- Constructs a pattern that from the current location until Count -- characters have been matched. The pattern fails if more than Count -- characters have already been matched. --------------------------------- -- Pattern Matching Operations -- --------------------------------- -- The Match function performs an actual pattern matching operation. -- The versions with three parameters perform a match without modifying -- the subject string and return a Boolean result indicating if the -- match is successful or not. The Anchor parameter is set to True to -- obtain an anchored match in which the pattern is required to match -- the first character of the string. In an unanchored match, which is -- the default, successive attempts are made to match the given pattern -- at each character of the subject string until a match succeeds, or -- until all possibilities have failed. -- Note that pattern assignment functions in the pattern may generate -- side effects, so these functions are not necessarily pure. Anchored_Mode : Boolean := False; -- This global variable can be set True to cause all subsequent pattern -- matches to operate in anchored mode. In anchored mode, no attempt is -- made to move the anchor point, so that if the match succeeds it must -- succeed starting at the first character. Note that the effect of -- anchored mode may be achieved in individual pattern matches by using -- Fence or Pos(0) at the start of the pattern. Pattern_Stack_Overflow : exception; -- Exception raised if internal pattern matching stack overflows. This -- is typically the result of runaway pattern recursion. If there is a -- genuine case of stack overflow, then either the match must be broken -- down into simpler steps, or the stack limit must be reset. Stack_Size : constant Positive := 2000; -- Size used for internal pattern matching stack. Increase this size if -- complex patterns cause Pattern_Stack_Overflow to be raised. -- Simple match functions. The subject is matched against the pattern. -- Any immediate or deferred assignments or writes are executed, and -- the returned value indicates whether or not the match succeeded. function Match (Subject : VString; Pat : Pattern) return Boolean; function Match (Subject : VString; Pat : PString) return Boolean; function Match (Subject : String; Pat : Pattern) return Boolean; function Match (Subject : String; Pat : PString) return Boolean; -- Replacement functions. The subject is matched against the pattern. -- Any immediate or deferred assignments or writes are executed, and -- the returned value indicates whether or not the match succeeded. -- If the match succeeds, then the matched part of the subject string -- is replaced by the given Replace string. function Match (Subject : VString_Var; Pat : Pattern; Replace : VString) return Boolean; function Match (Subject : VString_Var; Pat : PString; Replace : VString) return Boolean; function Match (Subject : VString_Var; Pat : Pattern; Replace : String) return Boolean; function Match (Subject : VString_Var; Pat : PString; Replace : String) return Boolean; -- Simple match procedures. The subject is matched against the pattern. -- Any immediate or deferred assignments or writes are executed. No -- indication of success or failure is returned. procedure Match (Subject : VString; Pat : Pattern); procedure Match (Subject : VString; Pat : PString); procedure Match (Subject : String; Pat : Pattern); procedure Match (Subject : String; Pat : PString); -- Replacement procedures. The subject is matched against the pattern. -- Any immediate or deferred assignments or writes are executed. No -- indication of success or failure is returned. If the match succeeds, -- then the matched part of the subject string is replaced by the given -- Replace string. procedure Match (Subject : in out VString; Pat : Pattern; Replace : VString); procedure Match (Subject : in out VString; Pat : PString; Replace : VString); procedure Match (Subject : in out VString; Pat : Pattern; Replace : String); procedure Match (Subject : in out VString; Pat : PString; Replace : String); -- Deferred Replacement type Match_Result is private; -- Type used to record result of pattern match subtype Match_Result_Var is Match_Result; -- This synonyms is used as a formal parameter type to a function where, -- if the language allowed, we would use an in out parameter, but we are -- not allowed to have in out parameters for functions. Instead we pass -- actuals which must be variables, and with a bit of trickery in the -- body, manage to interprete them properly as though they were indeed -- in out parameters. function Match (Subject : VString_Var; Pat : Pattern; Result : Match_Result_Var) return Boolean; procedure Match (Subject : in out VString; Pat : Pattern; Result : out Match_Result); procedure Replace (Result : in out Match_Result; Replace : VString); -- Given a previous call to Match which set Result, performs a pattern -- replacement if the match was successful. Has no effect if the match -- failed. This call should immediately follow the Match call. ------------------------ -- Debugging Routines -- ------------------------ -- Debugging pattern matching operations can often be quite complex, -- since there is no obvious way to trace the progress of the match. -- The declarations in this section provide some debugging assistance. Debug_Mode : Boolean := False; -- This global variable can be set True to generate debugging on all -- subsequent calls to Match. The debugging output is a full trace of -- the actions of the pattern matcher, written to Standard_Output. The -- level of this information is intended to be comprehensible at the -- abstract level of this package declaration. However, note that the -- use of this switch often generates large amounts of output. function "*" (P : Pattern; Fil : File_Access) return Pattern; function "*" (P : PString; Fil : File_Access) return Pattern; function "*" (P : PChar; Fil : File_Access) return Pattern; function "**" (P : Pattern; Fil : File_Access) return Pattern; function "**" (P : PString; Fil : File_Access) return Pattern; function "**" (P : PChar; Fil : File_Access) return Pattern; -- These are similar to the corresponding pattern assignment operations -- except that instead of setting the value of a variable, the matched -- substring is written to the appropriate file. This can be useful in -- following the progress of a match without generating the full amount -- of information obtained by setting Debug_Mode to True. Terminal : constant File_Access := Standard_Error; Output : constant File_Access := Standard_Output; -- Two handy synonyms for use with the above pattern write operations. -- Finally we have some routines that are useful for determining what -- patterns are in use, particularly if they are constructed dynamically. function Image (P : Pattern) return String; function Image (P : Pattern) return VString; -- This procedures yield strings that corresponds to the syntax needed -- to create the given pattern using the functions in this package. The -- form of this string is such that it could actually be compiled and -- evaluated to yield the required pattern except for references to -- variables and functions, which are output using one of the following -- forms: -- -- access Natural NP(16#...#) -- access Pattern PP(16#...#) -- access VString VP(16#...#) -- -- Natural_Func NF(16#...#) -- VString_Func VF(16#...#) -- -- where 16#...# is the hex representation of the integer address that -- corresponds to the given access value procedure Dump (P : Pattern); -- This procedure writes information about the pattern to Standard_Out. -- The format of this information is keyed to the internal data structures -- used to implement patterns. The information provided by Dump is thus -- more precise than that yielded by Image, but is also a bit more obscure -- (i.e. it cannot be interpreted solely in terms of this spec, you have -- to know something about the data structures). ------------------ -- Private Part -- ------------------ private type PE; -- Pattern element, a pattern is a plex structure of PE's. This type -- is defined and sdescribed in the body of this package. type PE_Ptr is access all PE; -- Pattern reference. PE's use PE_Ptr values to reference other PE's type Pattern is new Controlled with record Stk : Natural; -- Maximum number of stack entries required for matching this -- pattern. See description of pattern history stack in body. P : PE_Ptr; -- Pointer to initial pattern element for pattern end record; pragma Finalize_Storage_Only (Pattern); procedure Adjust (Object : in out Pattern); -- Adjust routine used to copy pattern objects procedure Finalize (Object : in out Pattern); -- Finalization routine used to release storage allocated for a pattern. type VString_Ptr is access all VString; type Match_Result is record Var : VString_Ptr; -- Pointer to subject string. Set to null if match failed. Start : Natural; -- Starting index position (1's origin) of matched section of -- subject string. Only valid if Var is non-null. Stop : Natural; -- Ending index position (1's origin) of matched section of -- subject string. Only valid if Var is non-null. end record; pragma Volatile (Match_Result); -- This ensures that the Result parameter is passed by reference, so -- that we can play our games with the bogus Match_Result_Var parameter -- in the function case to treat it as though it were an in out parameter. end GNAT.Spitbol.Patterns;
-- CE2204D.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. --* -- OBJECTIVE: -- CHECK THAT READ AND END_OF_FILE ARE FORBIDDEN FOR SEQUENTIAL -- FILES OF MODE OUT_FILE. -- B) CHECK TEMPORARY FILES. -- APPLICABILITY CRITERIA: -- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT -- THE CREATION OF TEMPORARY SEQUENTIAL FILES. -- HISTORY: -- GMT 07/24/87 CREATED ORIGINAL TEST. WITH REPORT; USE REPORT; WITH SEQUENTIAL_IO; PROCEDURE CE2204D IS BEGIN TEST ("CE2204D", "FOR A TEMPORARY SEQUENTIAL FILE, CHECK THAT " & "MODE_ERROR IS RAISED BY READ AND END_OF_FILE " & "WHEN THE MODE IS OUT_FILE"); DECLARE PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO (INTEGER); USE SEQ_IO; FT : FILE_TYPE; X : INTEGER; B : BOOLEAN; INCOMPLETE : EXCEPTION; BEGIN BEGIN CREATE (FT); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE - 1"); RAISE INCOMPLETE; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED ON CREATE - 2"); RAISE INCOMPLETE; END; WRITE (FT, 5); BEGIN -- THIS IS ONLY RESET (FT); -- AN ATTEMPT EXCEPTION -- TO RESET, WHEN USE_ERROR => -- IF RESET NULL; -- N/A THEN END; -- TEST IS -- NOT AFFECTED. BEGIN READ (FT, X); FAILED ("MODE_ERROR NOT RAISED ON READ - 3"); EXCEPTION WHEN MODE_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED ON READ - 4"); END; BEGIN B := END_OF_FILE (FT); FAILED ("MODE_ERROR NOT RAISED ON END_OF_FILE - 5"); EXCEPTION WHEN MODE_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - END_OF_FILE - 6"); END; CLOSE (FT); EXCEPTION WHEN INCOMPLETE => NULL; END; RESULT; END CE2204D;
with Ada.Finalization; with Ada.Iterator_Interfaces; generic type Element_Type is private; with function "=" (Left, Right : Element_Type) return Boolean is <>; with procedure Destroy (Value : in out Element_Type) is null; package Regions.Shared_Lists is pragma Preelaborate; type List is tagged private with Constant_Indexing => Constant_Indexing, Default_Iterator => Iterate, Iterator_Element => Element_Type; function "=" (Left, Right : List) return Boolean; function Is_Empty (Self : List) return Boolean with Inline; function Length (Self : List) return Natural with Inline; function Empty_List return List with Inline; function First_Element (Self : List) return Element_Type with Pre => not Self.Is_Empty, Inline; procedure Prepend (Self : in out List; Item : Element_Type) with Inline; type Cursor is private; function Has_Element (Self : Cursor) return Boolean with Inline; -- Check if the cursor points to any element package Iterator_Interfaces is new Ada.Iterator_Interfaces (Cursor, Has_Element); type Forward_Iterator is new Iterator_Interfaces.Forward_Iterator with private; function Iterate (Self : List'Class) return Forward_Iterator with Inline; -- Iterate over all elements in the map function Constant_Indexing (Self : List; Position : Cursor) return Element_Type with Pre => Has_Element (Position), Inline; No_Element : constant Cursor; private type List_Node; type List_Node_Access is access all List_Node; type List_Node is record Next : List_Node_Access; Counter : Natural; Data : Element_Type; end record; type List is new Ada.Finalization.Controlled with record Head : List_Node_Access; Length : Natural := 0; end record; overriding procedure Adjust (Self : in out List); overriding procedure Finalize (Self : in out List); type Cursor is record Item : List_Node_Access; end record; type Forward_Iterator is new Iterator_Interfaces.Forward_Iterator with record First : Cursor; end record; overriding function First (Self : Forward_Iterator) return Cursor; overriding function Next (Self : Forward_Iterator; Position : Cursor) return Cursor; No_Element : constant Cursor := (Item => null); end Regions.Shared_Lists;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . W I D E _ W I D E _ T E X T _ I O . D E C I M A L _ A U X -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with Ada.Wide_Wide_Text_IO.Generic_Aux; use Ada.Wide_Wide_Text_IO.Generic_Aux; with Ada.Wide_Wide_Text_IO.Float_Aux; use Ada.Wide_Wide_Text_IO.Float_Aux; with System.Img_Dec; use System.Img_Dec; with System.Img_LLD; use System.Img_LLD; with System.Val_Dec; use System.Val_Dec; with System.Val_LLD; use System.Val_LLD; package body Ada.Wide_Wide_Text_IO.Decimal_Aux is ------------- -- Get_Dec -- ------------- function Get_Dec (File : File_Type; Width : Field; Scale : Integer) return Integer is Buf : String (1 .. Field'Last); Ptr : aliased Integer; Stop : Integer := 0; Item : Integer; begin if Width /= 0 then Load_Width (File, Width, Buf, Stop); String_Skip (Buf, Ptr); else Load_Real (File, Buf, Stop); Ptr := 1; end if; Item := Scan_Decimal (Buf, Ptr'Access, Stop, Scale); Check_End_Of_Field (Buf, Stop, Ptr, Width); return Item; end Get_Dec; ------------- -- Get_LLD -- ------------- function Get_LLD (File : File_Type; Width : Field; Scale : Integer) return Long_Long_Integer is Buf : String (1 .. Field'Last); Ptr : aliased Integer; Stop : Integer := 0; Item : Long_Long_Integer; begin if Width /= 0 then Load_Width (File, Width, Buf, Stop); String_Skip (Buf, Ptr); else Load_Real (File, Buf, Stop); Ptr := 1; end if; Item := Scan_Long_Long_Decimal (Buf, Ptr'Access, Stop, Scale); Check_End_Of_Field (Buf, Stop, Ptr, Width); return Item; end Get_LLD; -------------- -- Gets_Dec -- -------------- function Gets_Dec (From : String; Last : not null access Positive; Scale : Integer) return Integer is Pos : aliased Integer; Item : Integer; begin String_Skip (From, Pos); Item := Scan_Decimal (From, Pos'Access, From'Last, Scale); Last.all := Pos - 1; return Item; exception when Constraint_Error => Last.all := Pos - 1; raise Data_Error; end Gets_Dec; -------------- -- Gets_LLD -- -------------- function Gets_LLD (From : String; Last : not null access Positive; Scale : Integer) return Long_Long_Integer is Pos : aliased Integer; Item : Long_Long_Integer; begin String_Skip (From, Pos); Item := Scan_Long_Long_Decimal (From, Pos'Access, From'Last, Scale); Last.all := Pos - 1; return Item; exception when Constraint_Error => Last.all := Pos - 1; raise Data_Error; end Gets_LLD; ------------- -- Put_Dec -- ------------- procedure Put_Dec (File : File_Type; Item : Integer; Fore : Field; Aft : Field; Exp : Field; Scale : Integer) is Buf : String (1 .. Field'Last); Ptr : Natural := 0; begin Set_Image_Decimal (Item, Buf, Ptr, Scale, Fore, Aft, Exp); Put_Item (File, Buf (1 .. Ptr)); end Put_Dec; ------------- -- Put_LLD -- ------------- procedure Put_LLD (File : File_Type; Item : Long_Long_Integer; Fore : Field; Aft : Field; Exp : Field; Scale : Integer) is Buf : String (1 .. Field'Last); Ptr : Natural := 0; begin Set_Image_Long_Long_Decimal (Item, Buf, Ptr, Scale, Fore, Aft, Exp); Put_Item (File, Buf (1 .. Ptr)); end Put_LLD; -------------- -- Puts_Dec -- -------------- procedure Puts_Dec (To : out String; Item : Integer; Aft : Field; Exp : Field; Scale : Integer) is Buf : String (1 .. Field'Last); Fore : Integer; Ptr : Natural := 0; begin -- Compute Fore, allowing for Aft digits and the decimal dot Fore := To'Length - Field'Max (1, Aft) - 1; -- Allow for Exp and two more for E+ or E- if exponent present if Exp /= 0 then Fore := Fore - 2 - Exp; end if; -- Make sure we have enough room if Fore < 1 then raise Layout_Error; end if; -- Do the conversion and check length of result Set_Image_Decimal (Item, Buf, Ptr, Scale, Fore, Aft, Exp); if Ptr > To'Length then raise Layout_Error; else To := Buf (1 .. Ptr); end if; end Puts_Dec; -------------- -- Puts_Dec -- -------------- procedure Puts_LLD (To : out String; Item : Long_Long_Integer; Aft : Field; Exp : Field; Scale : Integer) is Buf : String (1 .. Field'Last); Fore : Integer; Ptr : Natural := 0; begin Fore := (if Exp = 0 then To'Length - 1 - Aft else To'Length - 2 - Aft - Exp); if Fore < 1 then raise Layout_Error; end if; Set_Image_Long_Long_Decimal (Item, Buf, Ptr, Scale, Fore, Aft, Exp); if Ptr > To'Length then raise Layout_Error; else To := Buf (1 .. Ptr); end if; end Puts_LLD; end Ada.Wide_Wide_Text_IO.Decimal_Aux;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S E M _ A T T R -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2016, 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 along -- -- with this program; see file COPYING3. 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. -- -- -- ------------------------------------------------------------------------------ -- Attribute handling is isolated in a separate package to ease the addition -- of implementation defined attributes. Logically this processing belongs -- in chapter 4. See Sem_Ch4 for a description of the relation of the -- Analyze and Resolve routines for expression components. -- This spec also documents all GNAT implementation defined pragmas with Exp_Tss; use Exp_Tss; with Namet; use Namet; with Snames; use Snames; with Types; use Types; package Sem_Attr is ----------------------------------------- -- Implementation Dependent Attributes -- ----------------------------------------- -- This section describes the implementation dependent attributes provided -- in GNAT, as well as constructing an array of flags indicating which -- attributes these are. Attribute_Impl_Def : constant Attribute_Class_Array := Attribute_Class_Array'( ------------------ -- Abort_Signal -- ------------------ Attribute_Abort_Signal => True, -- Standard'Abort_Signal (Standard is the only allowed prefix) provides -- the entity for the special exception used to signal task abort or -- asynchronous transfer of control. Normally this attribute should only -- be used in the tasking runtime (it is highly peculiar, and completely -- outside the normal semantics of Ada, for a user program to intercept -- the abort exception). ------------------ -- Address_Size -- ------------------ Attribute_Address_Size => True, -- Standard'Address_Size (Standard is the only allowed prefix) is -- a static constant giving the number of bits in an Address. It -- is used primarily for constructing the definition of Memory_Size -- in package Standard, but may be freely used in user programs. -- This is a static attribute. --------------- -- Asm_Input -- --------------- Attribute_Asm_Input => True, -- Used only in conjunction with the Asm subprograms in package -- Machine_Code to construct machine instructions. See documentation -- in package Machine_Code in file s-maccod.ads. ---------------- -- Asm_Output -- ---------------- Attribute_Asm_Output => True, -- Used only in conjunction with the Asm subprograms in package -- Machine_Code to construct machine instructions. See documentation -- in package Machine_Code in file s-maccod.ads. --------- -- Bit -- --------- Attribute_Bit => True, -- Obj'Bit, where Obj is any object, yields the bit offset within the -- storage unit (byte) that contains the first bit of storage allocated -- for the object. The attribute value is of type Universal_Integer, -- and is always a non-negative number not exceeding the value of -- System.Storage_Unit. -- -- For an object that is a variable or a constant allocated in a -- register, the value is zero. (The use of this attribute does not -- force the allocation of a variable to memory). -- -- For an object that is a formal parameter, this attribute applies to -- either the matching actual parameter or to a copy of the matching -- actual parameter. -- -- For an access object the value is zero. Note that Obj.all'Bit is -- subject to an Access_Check for the designated object. Similarly -- for a record component X.C'Bit is subject to a discriminant check -- and X(I).Bit and X(I1..I2)'Bit are subject to index checks. -- -- This attribute is designed to be compatible with the DEC Ada -- definition and implementation of the Bit attribute. ------------------ -- Code_Address -- ------------------ Attribute_Code_Address => True, -- The reference subp'Code_Address, where subp is a subprogram entity, -- gives the address of the first generated instruction for the sub- -- program. This is often, but not always the same as the 'Address -- value, which is the address to be used in a call. The differences -- occur in the case of a nested procedure (where Address yields the -- address of the trampoline code used to load the static link), and on -- some systems which use procedure descriptors (in which case Address -- yields the address of the descriptor). ----------------------- -- Default_Bit_Order -- ----------------------- Attribute_Default_Bit_Order => True, -- Standard'Default_Bit_Order (Standard is the only permissible prefix) -- provides the value System.Default_Bit_Order as a Pos value (0 for -- High_Order_First, 1 for Low_Order_First). This is used to construct -- the definition of Default_Bit_Order in package System. This is a -- static attribute. ---------------------------------- -- Default_Scalar_Storage_Order -- ---------------------------------- Attribute_Default_Scalar_Storage_Order => True, -- Standard'Default_Scalar_Storage_Order (Standard is the -- only permissible prefix) provides the current value of the -- default scalar storage order (as specified using pragma -- Default_Scalar_Storage_Order, or equal to Default_Bit_Order if -- unspecified) as a System.Bit_Order value. This is a static attribute. ----------- -- Deref -- ----------- Attribute_Deref => True, -- typ'Deref (expr) is valid only if expr is of type System'Address. -- The result is an object of type typ that is obtained by treating the -- address as an access-to-typ value that points to the result. It is -- basically equivalent to (atyp!expr).all where atyp is an access type -- for the type. --------------- -- Elab_Body -- --------------- Attribute_Elab_Body => True, -- This attribute can only be applied to a program unit name. It -- returns the entity for the corresponding elaboration procedure for -- elaborating the body of the referenced unit. This is used in the main -- generated elaboration procedure by the binder, and is not normally -- used in any other context, but there may be specialized situations in -- which it is useful to be able to call this elaboration procedure from -- Ada code, e.g. if it is necessary to do selective reelaboration to -- fix some error. -------------------- -- Elab_Subp_Body -- -------------------- Attribute_Elab_Subp_Body => True, -- This attribute can only be applied to a library level subprogram -- name and is only relevant in CodePeer mode. It returns the entity -- for the corresponding elaboration procedure for elaborating the body -- of the referenced subprogram unit. This is used in the main generated -- elaboration procedure by the binder in CodePeer mode only. --------------- -- Elab_Spec -- --------------- Attribute_Elab_Spec => True, -- This attribute can only be applied to a program unit name. It -- returns the entity for the corresponding elaboration procedure for -- elaborating the spec of the referenced unit. This is used in the main -- generated elaboration procedure by the binder, and is not normally -- used in any other context, but there may be specialized situations in -- which it is useful to be able to call this elaboration procedure from -- Ada code, e.g. if it is necessary to do selective reelaboration to -- fix some error. ---------------- -- Elaborated -- ---------------- Attribute_Elaborated => True, -- Lunit'Elaborated, where Lunit is a library unit, yields a boolean -- value indicating whether or not the body of the designated library -- unit has been elaborated yet. -------------- -- Enum_Rep -- -------------- Attribute_Enum_Rep => True, -- For every enumeration subtype S, S'Enum_Rep denotes a function -- with the following specification: -- -- function S'Enum_Rep (Arg : S'Base) return universal_integer; -- -- The function returns the representation value for the given -- enumeration value. This will be equal to the 'Pos value in the -- absence of an enumeration representation clause. This is a static -- attribute (i.e. the result is static if the argument is static). -------------- -- Enum_Val -- -------------- Attribute_Enum_Val => True, -- For every enumeration subtype S, S'Enum_Val denotes a function with -- the following specification: -- -- function S'Enum_Val (Arg : universal_integer) return S'Base; -- -- This function performs the inverse transformation to Enum_Rep. Given -- a representation value for the type, it returns the corresponding -- enumeration value. Constraint_Error is raised if no value of the -- enumeration type corresponds to the given integer value. ----------------------- -- Finalization_Size -- ----------------------- Attribute_Finalization_Size => True, -- For every object or non-class-wide-type, Finalization_Size returns -- the size of the hidden header used for finalization purposes as if -- the object or type was allocated on the heap. The size of the header -- does take into account any extra padding due to alignment issues. ----------------- -- Fixed_Value -- ----------------- Attribute_Fixed_Value => True, -- For every fixed-point type S, S'Fixed_Value denotes a function -- with the following specification: -- -- function S'Fixed_Value (Arg : universal_integer) return S; -- -- The value returned is the fixed-point value V such that -- -- V = Arg * S'Small -- -- The effect is thus equivalent to first converting the argument to -- the integer type used to represent S, and then doing an unchecked -- conversion to the fixed-point type. This attribute is primarily -- intended for use in implementation of the input-output functions -- for fixed-point values. ----------------------- -- Has_Discriminants -- ----------------------- Attribute_Has_Discriminants => True, -- Gtyp'Has_Discriminants, where Gtyp is a generic formal type, yields -- a Boolean value indicating whether or not the actual instantiation -- type has discriminants. --------- -- Img -- --------- Attribute_Img => True, -- The 'Img function is defined for any prefix, P, that denotes an -- object of scalar type T. P'Img is equivalent to T'Image (P). This -- is convenient for debugging. For example: -- -- Put_Line ("X = " & X'Img); -- -- has the same meaning as the more verbose: -- -- Put_Line ("X = " & Temperature_Type'Image (X)); -- -- where Temperature_Type is the subtype of the object X. ------------------- -- Integer_Value -- ------------------- Attribute_Integer_Value => True, -- For every integer type S, S'Integer_Value denotes a function -- with the following specification: -- -- function S'Integer_Value (Arg : universal_fixed) return S; -- -- The value returned is the integer value V, such that -- -- Arg = V * fixed-type'Small -- -- The effect is thus equivalent to first doing an unchecked convert -- from the fixed-point type to its corresponding implementation type, -- and then converting the result to the target integer type. This -- attribute is primarily intended for use in implementation of the -- standard input-output functions for fixed-point values. Attribute_Invalid_Value => True, -- For every scalar type, S'Invalid_Value designates an undefined value -- of the type. If possible this value is an invalid value, and in fact -- is identical to the value that would be set if Initialize_Scalars -- mode were in effect (including the behavior of its value on -- environment variables or binder switches). The intended use is to -- set a value where initialization is required (e.g. as a result of the -- coding standards in use), but logically no initialization is needed, -- and the value should never be accessed. Attribute_Loop_Entry => True, -- For every object of a non-limited type, S'Loop_Entry [(Loop_Name)] -- denotes the constant value of prefix S at the point of entry into the -- related loop. The type of the attribute is the type of the prefix. ------------------ -- Machine_Size -- ------------------ Attribute_Machine_Size => True, -- This attribute is identical to the Object_Size attribute. It is -- provided for compatibility with the DEC attribute of this name. ----------------------- -- Maximum_Alignment -- ----------------------- Attribute_Maximum_Alignment => True, -- Standard'Maximum_Alignment (Standard is the only permissible prefix) -- provides the maximum useful alignment value for the target. This is a -- static value that can be used to specify the alignment for an object, -- guaranteeing that it is properly aligned in all cases. The time this -- is useful is when an external object is imported and its alignment -- requirements are unknown. This is a static attribute. -------------------- -- Mechanism_Code -- -------------------- Attribute_Mechanism_Code => True, -- function'Mechanism_Code yields an integer code for the mechanism -- used for the result of function, and subprogram'Mechanism_Code (n) -- yields the mechanism used for formal parameter number n (a static -- integer value, 1 = first parameter). The code returned is: -- -- 1 = by copy (value) -- 2 = by reference -- 3 = by descriptor (default descriptor type) -- 4 = by descriptor (UBS unaligned bit string) -- 5 = by descriptor (UBSB aligned bit string with arbitrary bounds) -- 6 = by descriptor (UBA unaligned bit array) -- 7 = by descriptor (S string, also scalar access type parameter) -- 8 = by descriptor (SB string with arbitrary bounds) -- 9 = by descriptor (A contiguous array) -- 10 = by descriptor (NCA non-contiguous array) -------------------- -- Null_Parameter -- -------------------- Attribute_Null_Parameter => True, -- A reference T'Null_Parameter denotes an (imaginary) object of type -- or subtype T allocated at (machine) address zero. The attribute is -- allowed only as the default expression of a formal parameter, or -- as an actual expression of a subprogram call. In either case, the -- subprogram must be imported. -- -- The identity of the object is represented by the address zero in -- the argument list, independent of the passing mechanism (explicit -- or default). -- -- The reason that this capability is needed is that for a record or -- other composite object passed by reference, there is no other way -- of specifying that a zero address should be passed. ----------------- -- Object_Size -- ----------------- Attribute_Object_Size => True, -- Type'Object_Size is the same as Type'Size for all types except -- fixed-point types and discrete types. For fixed-point types and -- discrete types, this attribute gives the size used for default -- allocation of objects and components of the size. See section in -- Einfo ("Handling of Type'Size values") for further details. ------------------------- -- Passed_By_Reference -- ------------------------- Attribute_Passed_By_Reference => True, -- T'Passed_By_Reference for any subtype T returns a boolean value that -- is true if the type is normally passed by reference and false if the -- type is normally passed by copy in calls. For scalar types, the -- result is always False and is static. For non-scalar types, the -- result is non-static (since it is computed by Gigi). ------------------ -- Range_Length -- ------------------ Attribute_Range_Length => True, -- T'Range_Length for any discrete type T yields the number of values -- represented by the subtype (zero for a null range). The result is -- static for static subtypes. Note that Range_Length applied to the -- index subtype of a one dimensional array always gives the same result -- as Range applied to the array itself. The result is of type universal -- integer. --------- -- Ref -- --------- Attribute_Ref => True, -- System.Address'Ref (Address is the only permissible prefix) is -- equivalent to System'To_Address, provided for compatibility with -- other compilers. ------------------ -- Storage_Unit -- ------------------ Attribute_Storage_Unit => True, -- Standard'Storage_Unit (Standard is the only permissible prefix) -- provides the value System.Storage_Unit, and is intended primarily -- for constructing this definition in package System (see note above -- in Default_Bit_Order description). The is a static attribute. --------------- -- Stub_Type -- --------------- Attribute_Stub_Type => True, -- The GNAT implementation of remote access-to-classwide types is -- organised as described in AARM E.4(20.t): a value of an RACW type -- (designating a remote object) is represented as a normal access -- value, pointing to a "stub" object which in turn contains the -- necessary information to contact the designated remote object. A -- call on any dispatching operation of such a stub object does the -- remote call, if necessary, using the information in the stub object -- to locate the target partition, etc. -- -- For a prefix T that denotes a remote access-to-classwide type, -- T'Stub_Type denotes the type of the corresponding stub objects. -- -- By construction, the layout of T'Stub_Type is identical to that of -- System.Partition_Interface.RACW_Stub_Type (see implementation notes -- in body of Exp_Dist). ----------------- -- Target_Name -- ----------------- Attribute_Target_Name => True, -- Standard'Target_Name yields the string identifying the target for the -- compilation, taken from Sdefault.Target_Name. ---------------- -- To_Address -- ---------------- Attribute_To_Address => True, -- System'To_Address (System is the only permissible prefix) is a -- function that takes any integer value, and converts it into an -- address value. The semantics is to first convert the integer value to -- type Integer_Address according to normal conversion rules, and then -- to convert this to an address using the same semantics as the -- System.Storage_Elements.To_Address function. The important difference -- is that this is a static attribute so it can be used in -- initializations in preelaborate packages. ---------------- -- Type_Class -- ---------------- Attribute_Type_Class => True, -- T'Type_Class for any type or subtype T yields the value of the type -- class for the full type of T. If T is a generic formal type, then the -- value is the value for the corresponding actual subtype. The value of -- this attribute is of type System.Aux_DEC.Type_Class, which has the -- following definition: -- -- type Type_Class is -- (Type_Class_Enumeration, -- Type_Class_Integer, -- Type_Class_Fixed_Point, -- Type_Class_Floating_Point, -- Type_Class_Array, -- Type_Class_Record, -- Type_Class_Access, -- Type_Class_Task, -- Type_Class_Address); -- -- Protected types yield the value Type_Class_Task, which thus applies -- to all concurrent types. This attribute is designed to be compatible -- with the DEC Ada attribute of the same name. -- -- Note: if pragma Extend_System is used to merge the definitions of -- Aux_DEC into System, then the type Type_Class can be referenced -- as an entity within System, as can its enumeration literals. ------------------------------ -- Universal_Literal_String -- ------------------------------ Attribute_Universal_Literal_String => True, -- The prefix of 'Universal_Literal_String must be a named number. -- The static result is the string consisting of the characters of -- the number as defined in the original source. This allows the -- user program to access the actual text of named numbers without -- intermediate conversions and without the need to enclose the -- strings in quotes (which would preclude their use as numbers). ------------------------- -- Unrestricted_Access -- ------------------------- Attribute_Unrestricted_Access => True, -- The Unrestricted_Access attribute is similar to Access except that -- all accessibility and aliased view checks are omitted. This is very -- much a user-beware attribute. Basically its status is very similar -- to Address, for which it is a desirable replacement where the value -- desired is an access type. In other words, its effect is identical -- to first taking 'Address and then doing an unchecked conversion to -- a desired access type. Note that in GNAT, but not necessarily in -- other implementations, the use of static chains for inner level -- subprograms means that Unrestricted_Access applied to a subprogram -- yields a value that can be called as long as the subprogram is in -- scope (normal Ada 95 accessibility rules restrict this usage). --------------- -- VADS_Size -- --------------- Attribute_VADS_Size => True, -- Typ'VADS_Size yields the Size value typically yielded by some Ada 83 -- compilers. The differences between VADS_Size and Size is that for -- scalar types for which no Size has been specified, VADS_Size yields -- the Object_Size rather than the Value_Size. For example, while -- Natural'Size is typically 31, the value of Natural'VADS_Size is 32. -- For all other types, Size and VADS_Size yield the same value. ------------------- -- Valid_Scalars -- ------------------- Attribute_Valid_Scalars => True, -- Obj'Valid_Scalars can be applied to any object. The result depends -- on the type of the object: -- -- For a scalar type, the result is the same as obj'Valid -- -- For an array object, the result is True if the result of applying -- Valid_Scalars to every component is True. For an empty array the -- result is True. -- -- For a record object, the result is True if the result of applying -- Valid_Scalars to every component is True. For class-wide types, -- only the components of the base type are checked. For variant -- records, only the components actually present are checked. The -- discriminants, if any, are also checked. If there are no components -- or discriminants, the result is True. -- -- For any other type that has discriminants, the result is True if -- the result of applying Valid_Scalars to each discriminant is True. -- -- For all other types, the result is always True -- -- A warning is given for a trivially True result, when the attribute -- is applied to an object that is not of scalar, array, or record -- type, or in the composite case if no scalar subcomponents exist. For -- a variant record, the warning is given only if none of the variants -- have scalar subcomponents. In addition, the warning is suppressed -- for private types, or generic formal types in an instance. ---------------- -- Value_Size -- ---------------- Attribute_Value_Size => True, -- Type'Value_Size is the number of bits required to represent value of -- the given subtype. It is the same as Type'Size, but, unlike Size, may -- be set for non-first subtypes. See section in Einfo ("Handling of -- type'Size values") for further details. --------------- -- Word_Size -- --------------- Attribute_Word_Size => True, -- Standard'Word_Size (Standard is the only permissible prefix) -- provides the value System.Word_Size, and is intended primarily -- for constructing this definition in package System (see note above -- in Default_Bit_Order description). This is a static attribute. others => False); -- The following table lists all attributes that yield a result of a -- universal type. Universal_Type_Attribute : constant array (Attribute_Id) of Boolean := (Attribute_Aft => True, Attribute_Alignment => True, Attribute_Component_Size => True, Attribute_Count => True, Attribute_Delta => True, Attribute_Digits => True, Attribute_Exponent => True, Attribute_First_Bit => True, Attribute_Fore => True, Attribute_Last_Bit => True, Attribute_Length => True, Attribute_Machine_Emax => True, Attribute_Machine_Emin => True, Attribute_Machine_Mantissa => True, Attribute_Machine_Radix => True, Attribute_Max_Alignment_For_Allocation => True, Attribute_Max_Size_In_Storage_Elements => True, Attribute_Model_Emin => True, Attribute_Model_Epsilon => True, Attribute_Model_Mantissa => True, Attribute_Model_Small => True, Attribute_Modulus => True, Attribute_Pos => True, Attribute_Position => True, Attribute_Safe_First => True, Attribute_Safe_Last => True, Attribute_Scale => True, Attribute_Size => True, Attribute_Small => True, Attribute_Wide_Wide_Width => True, Attribute_Wide_Width => True, Attribute_Width => True, others => False); ----------------- -- Subprograms -- ----------------- procedure Analyze_Attribute (N : Node_Id); -- Performs bottom up semantic analysis of an attribute. Note that the -- parser has already checked that type returning attributes appear only -- in appropriate contexts (i.e. in subtype marks, or as prefixes for -- other attributes). function Name_Implies_Lvalue_Prefix (Nam : Name_Id) return Boolean; -- Determine whether the name of an attribute reference categorizes its -- prefix as an lvalue. The following attributes fall under this bracket -- by directly or indirectly modifying their prefixes. -- Access -- Address -- Input -- Read -- Unchecked_Access -- Unrestricted_Access procedure Resolve_Attribute (N : Node_Id; Typ : Entity_Id); -- Performs type resolution of attribute. If the attribute yields a -- universal value, mark its type as that of the context. On the other -- hand, if the context itself is universal (as in T'Val (T'Pos (X)), mark -- the type as being the largest type of that class that can be used at -- run-time. This is correct since either the value gets folded (in which -- case it doesn't matter what type of the class we give if, since the -- folding uses universal arithmetic anyway) or it doesn't get folded (in -- which case it is going to be dealt with at runtime, and the largest type -- is right). function Stream_Attribute_Available (Typ : Entity_Id; Nam : TSS_Name_Type; Partial_View : Entity_Id := Empty) return Boolean; -- For a limited type Typ, return True if and only if the given attribute -- is available. For Ada 2005, availability is defined by 13.13.2(36/1). -- For Ada 95, an attribute is considered to be available if it has been -- specified using an attribute definition clause for the type, or for its -- full view, or for an ancestor of either. Parameter Partial_View is used -- only internally, when checking for an attribute definition clause that -- is not visible (Ada 95 only). end Sem_Attr;