repo_name
stringlengths 9
74
| language
stringclasses 1
value | length_bytes
int64 11
9.34M
| extension
stringclasses 2
values | content
stringlengths 11
9.34M
|
---|---|---|---|---|
sebsgit/textproc | Ada | 6,058 | adb | with AUnit.Assertions; use AUnit.Assertions;
with Interfaces.C.Strings;
with Ada.Text_IO;
with ImageIO;
with PixelArray;
with ImageRegions;
with Histogram;
with HistogramGenerator;
use PixelArray;
package body HistogramTests is
procedure Register_Tests (T: in out TestCase) is
use AUnit.Test_Cases.Registration;
begin
Register_Routine (T, testBasicHistograms'Access, "basic histograms");
Register_Routine (T, testRescale'Access, "resizing histograms");
Register_Routine (T, testMultiplication'Access, "multiplication");
Register_Routine (T, testProjections'Access, "projecting images");
Register_Routine (T, testDistance'Access, "histogram distances");
end Register_Tests;
function Name(T: TestCase) return Test_String is
begin
return Format("Histogram Tests");
end Name;
procedure testBasicHistograms(T : in out Test_Cases.Test_Case'Class) is
d: Histogram.Data(5);
d1: Histogram.Data(5);
begin
Assert(d.sum = 0.0, "test 1");
Assert(d.size = 5, "test size");
d.set(0, 5.0);
d.set(1, 4.0);
d.set(2, 3.0);
d.set(3, 2.0);
d.set(4, 1.0);
Assert(d.get(3) = 2.0, "get");
Assert(d.sum = 15.0, "test sum");
Assert(d.average = 3.0, "avg");
d1 := d.normalized;
Assert(d1.sum = 1.0, "test normalized sum");
Assert(d.sum = 15.0, "control sum");
d.normalize;
Assert(d.sum = 1.0, "test normalized sum");
end testBasicHistograms;
procedure testRescale(T : in out Test_Cases.Test_Case'Class) is
d: Histogram.Data(3);
resized: Histogram.Data(4);
begin
d.set(0, 7.0);
d.set(1, 3.0);
d.set(2, 1.0);
resized := d.resized(4);
Assert(resized.get(0) = d.get(0), "0");
Assert(resized.get(1) < d.get(0) and resized.get(1) > d.get(1), "1");
Assert(resized.get(2) < d.get(1) and resized.get(2) > d.get(2), "2");
Assert(resized.get(3) = d.get(2), "3");
resized.set(0, 4.0);
resized.set(1, 1.0);
resized.set(2, 0.0);
resized.set(3, 4.0);
d := resized.resized(3);
Assert(d.get(0) = resized.get(0), "0");
Assert(d.get(1) < resized.get(0) and d.get(1) > resized.get(2), "1");
Assert(d.get(2) = resized.get(3), "2");
end testRescale;
procedure testMultiplication(T: in out Test_Cases.Test_Case'Class) is
h0, h1: Histogram.Data(3);
begin
h0.set(0, 1.0);
h0.set(1, 2.0);
h0.set(2, 3.0);
h1 := h0;
h1.multiply(1.5);
Assert(h1.get(0) = 1.5, "0");
Assert(h1.get(1) = 3.0, "1");
Assert(h1.get(2) = 4.5, "2");
Assert(h1.compare(h0, Histogram.ChiSquare) /= 0.0, "distance not equal");
Assert(h1.compare(h0.multiplied(1.5), Histogram.ChiSquare) = 0.0, "distance equal");
h1 := h0.add(h0);
Assert(h1.compare(h0.multiplied(2.0), Histogram.ChiSquare) = 0.0, "distance equal");
end testMultiplication;
procedure testProjections(T: in out Test_Cases.Test_Case'Class) is
image: PixelArray.ImagePlane := PixelArray.allocate(width => 5, height => 5);
r: ImageRegions.Rect;
begin
r.x := 0;
r.y := 0;
r.width := 5;
r.height := 5;
image.set(Pixel(255));
image.set(2, 0, 0);
image.set(2, 1, 0);
image.set(2, 2, 0);
image.set(2, 3, 0);
image.set(2, 4, 0);
-- horizontal and vertical projections of a straight vertical line
declare
hist: Histogram.Data := HistogramGenerator.horizontalProjection(image, r);
begin
Assert(hist.size = r.width, "hist w");
Assert(hist.sum = 5.0, "hist sum");
Assert(hist.get(0) = 0.0, "hist 0");
Assert(hist.get(1) = 0.0, "hist 1");
Assert(hist.get(2) = 5.0, "hist 2");
Assert(hist.get(3) = 0.0, "hist 3");
Assert(hist.get(4) = 0.0, "hist 4");
hist := HistogramGenerator.verticalProjection(image, r);
Assert(hist.size = r.height, "hist w");
Assert(hist.sum = 5.0, "hist sum");
Assert(hist.get(0) = 1.0, "hist 0");
Assert(hist.get(1) = 1.0, "hist 1");
Assert(hist.get(2) = 1.0, "hist 2");
Assert(hist.get(3) = 1.0, "hist 3");
Assert(hist.get(4) = 1.0, "hist 4");
end;
-- projections of y = x
image.set(Pixel(255));
image.set(0, 0, 0);
image.set(1, 1, 0);
image.set(2, 2, 0);
image.set(3, 3, 0);
image.set(4, 4, 0);
declare
hist: Histogram.Data := HistogramGenerator.horizontalProjection(image, r);
begin
Assert(hist.size = r.width, "hist w");
Assert(hist.sum = 5.0, "hist sum");
Assert(hist.get(0) = 1.0, "hist 0");
Assert(hist.get(1) = 1.0, "hist 1");
Assert(hist.get(2) = 1.0, "hist 2");
Assert(hist.get(3) = 1.0, "hist 3");
Assert(hist.get(4) = 1.0, "hist 4");
hist := HistogramGenerator.verticalProjection(image, r);
Assert(hist.size = r.height, "hist w");
Assert(hist.sum = 5.0, "hist sum");
Assert(hist.get(0) = 1.0, "hist 0");
Assert(hist.get(1) = 1.0, "hist 1");
Assert(hist.get(2) = 1.0, "hist 2");
Assert(hist.get(3) = 1.0, "hist 3");
Assert(hist.get(4) = 1.0, "hist 4");
end;
end testProjections;
procedure testDistance(T: in out Test_Cases.Test_Case'Class) is
h0, h1: Histogram.Data(5);
dist, dist2: Float := 0.0;
method: Histogram.CompareMethod;
begin
method := Histogram.Bhattacharyya;
dist := h0.compare(h1, method);
Assert(dist = 0.0, "compare id");
h0.set(0, 1.0);
h0.set(1, 2.0);
h0.set(2, 3.0);
h0.set(3, 4.0);
h0.set(4, 5.0);
dist := h0.compare(h1, method);
Assert(dist > 0.0, "compare different");
h1.set(0, 10.0);
h1.set(1, 10.0);
h1.set(2, 30.0);
h1.set(3, 40.0);
h1.set(4, 50.0);
dist2 := h0.compare(h1, method);
Assert(dist2 < dist, "similarity");
end testDistance;
end HistogramTests;
|
reznikmm/matreshka | Ada | 6,204 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.Constants;
with ODF.DOM.Elements.Text.Outline_Style.Internals;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Elements.Text.Outline_Style is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access Text_Outline_Style_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Visitor in ODF.DOM.Visitors.ODF_Visitor'Class then
ODF.DOM.Visitors.ODF_Visitor'Class
(Visitor).Enter_Text_Outline_Style
(ODF.DOM.Elements.Text.Outline_Style.Internals.Create
(Text_Outline_Style_Access (Self)),
Control);
else
Matreshka.DOM_Nodes.Elements.Abstract_Element
(Self.all).Enter_Element (Visitor, Control);
end if;
end Enter_Element;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Text_Outline_Style_Node)
return League.Strings.Universal_String is
begin
return ODF.Constants.Outline_Style_Name;
end Get_Local_Name;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access Text_Outline_Style_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Visitor in ODF.DOM.Visitors.ODF_Visitor'Class then
ODF.DOM.Visitors.ODF_Visitor'Class
(Visitor).Leave_Text_Outline_Style
(ODF.DOM.Elements.Text.Outline_Style.Internals.Create
(Text_Outline_Style_Access (Self)),
Control);
else
Matreshka.DOM_Nodes.Elements.Abstract_Element
(Self.all).Leave_Element (Visitor, Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access Text_Outline_Style_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Iterator in ODF.DOM.Iterators.ODF_Iterator'Class then
ODF.DOM.Iterators.ODF_Iterator'Class
(Iterator).Visit_Text_Outline_Style
(Visitor,
ODF.DOM.Elements.Text.Outline_Style.Internals.Create
(Text_Outline_Style_Access (Self)),
Control);
else
Matreshka.DOM_Nodes.Elements.Abstract_Element
(Self.all).Visit_Element (Iterator, Visitor, Control);
end if;
end Visit_Element;
end Matreshka.ODF_Elements.Text.Outline_Style;
|
reznikmm/matreshka | Ada | 13,059 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2011, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Characters.Wide_Wide_Latin_1;
with Ada.Containers.Ordered_Maps;
with Ada.Strings.Wide_Wide_Fixed;
package body XMLConf.Canonical_Writers is
use Ada.Characters.Wide_Wide_Latin_1;
use type League.Strings.Universal_String;
package Universal_String_Integer_Maps is
new Ada.Containers.Ordered_Maps
(League.Strings.Universal_String, Positive);
function Escape_Character_Data
(Item : League.Strings.Universal_String;
Version : XML_Version)
return League.Strings.Universal_String;
-- Escape character data according to canonical form representation.
-- '&', '<', '>' and '"' characters are replaced by general entity
-- reference; TAB, CR and LF characters are replaced by character
-- reference in hexadecimal format.
procedure Set_Version (Self : in out Canonical_Writer);
-- Sets version.
----------------
-- Characters --
----------------
overriding procedure Characters
(Self : in out Canonical_Writer;
Text : League.Strings.Universal_String;
Success : in out Boolean) is
begin
Self.Result.Append (Escape_Character_Data (Text, Self.Version));
end Characters;
-------------
-- End_DTD --
-------------
overriding procedure End_DTD
(Self : in out Canonical_Writer;
Success : in out Boolean)
is
procedure Output_Notation (Position : Notation_Maps.Cursor);
-- Outputs notation declaration.
---------------------
-- Output_Notation --
---------------------
procedure Output_Notation (Position : Notation_Maps.Cursor) is
Notation : constant Notation_Information
:= Notation_Maps.Element (Position);
begin
if Notation.Public_Id.Is_Empty then
Self.Result.Append
("<!NOTATION "
& Notation.Name
& " SYSTEM '"
& Notation.System_Id
& "'>"
& LF);
elsif Notation.System_Id.Is_Empty then
Self.Result.Append
("<!NOTATION "
& Notation.Name
& " PUBLIC '"
& Notation.Public_Id
& "'>"
& LF);
else
Self.Result.Append
("<!NOTATION "
& Notation.Name
& " PUBLIC '"
& Notation.Public_Id
& "' '"
& Notation.System_Id
& "'>"
& LF);
end if;
end Output_Notation;
begin
if not Self.Notations.Is_Empty then
Self.Result.Append ("<!DOCTYPE " & Self.Name & " [" & LF);
Self.Notations.Iterate (Output_Notation'Access);
Self.Result.Append
(League.Strings.To_Universal_String ("]>" & LF));
end if;
end End_DTD;
-----------------
-- End_Element --
-----------------
overriding procedure End_Element
(Self : in out Canonical_Writer;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
Qualified_Name : League.Strings.Universal_String;
Success : in out Boolean) is
begin
Self.Result.Append ("</" & Qualified_Name & ">");
end End_Element;
------------------
-- Error_String --
------------------
overriding function Error_String
(Self : Canonical_Writer) return League.Strings.Universal_String is
begin
return League.Strings.Empty_Universal_String;
end Error_String;
---------------------------
-- Escape_Character_Data --
---------------------------
function Escape_Character_Data
(Item : League.Strings.Universal_String;
Version : XML_Version)
return League.Strings.Universal_String
is
Result : League.Strings.Universal_String := Item;
C : Wide_Wide_Character;
begin
for J in reverse 1 .. Item.Length loop
C := Result.Element (J).To_Wide_Wide_Character;
if C = '&' then
Result.Replace (J, J, "&");
elsif C = '<' then
Result.Replace (J, J, "<");
elsif C = '>' then
Result.Replace (J, J, ">");
elsif C = '"' then
Result.Replace (J, J, """);
else
case Version is
when Unspecified =>
raise Program_Error;
when XML_1_0 =>
if C = Wide_Wide_Character'Val (9) then
Result.Replace (J, J, "	");
elsif C = Wide_Wide_Character'Val (10) then
Result.Replace (J, J, " ");
elsif C = Wide_Wide_Character'Val (13) then
Result.Replace (J, J, " ");
end if;
when XML_1_1 =>
if C in Wide_Wide_Character'Val (16#01#)
.. Wide_Wide_Character'Val (16#1F#)
or C in Wide_Wide_Character'Val (16#7F#)
.. Wide_Wide_Character'Val (16#9F#)
then
Result.Replace
(J,
J,
"&#"
& Ada.Strings.Wide_Wide_Fixed.Trim
(Integer'Wide_Wide_Image
(Wide_Wide_Character'Pos (C)),
Ada.Strings.Both)
& ";");
end if;
end case;
end if;
end loop;
return Result;
end Escape_Character_Data;
--------------------------
-- Ignorable_Whitespace --
--------------------------
overriding procedure Ignorable_Whitespace
(Self : in out Canonical_Writer;
Text : League.Strings.Universal_String;
Success : in out Boolean) is
begin
Set_Version (Self);
Self.Result.Append (Escape_Character_Data (Text, Self.Version));
end Ignorable_Whitespace;
--------------------------
-- Notation_Declaration --
--------------------------
overriding procedure Notation_Declaration
(Self : in out Canonical_Writer;
Name : League.Strings.Universal_String;
Public_Id : League.Strings.Universal_String;
System_Id : League.Strings.Universal_String;
Success : in out Boolean) is
begin
Self.Notations.Insert (Name, (Name, Public_Id, System_Id));
end Notation_Declaration;
----------------------------
-- Processing_Instruction --
----------------------------
overriding procedure Processing_Instruction
(Self : in out Canonical_Writer;
Target : League.Strings.Universal_String;
Data : League.Strings.Universal_String;
Success : in out Boolean) is
begin
Set_Version (Self);
Self.Result.Append ("<?" & Target & " " & Data & "?>");
end Processing_Instruction;
--------------------------
-- Set_Document_Locator --
--------------------------
overriding procedure Set_Document_Locator
(Self : in out Canonical_Writer;
Locator : XML.SAX.Locators.SAX_Locator) is
begin
Self.Locator := Locator;
end Set_Document_Locator;
-----------------
-- Set_Version --
-----------------
procedure Set_Version (Self : in out Canonical_Writer) is
use League.Strings;
begin
if Self.Version = Unspecified then
if Self.Locator.Version = To_Universal_String ("1.0") then
Self.Version := XML_1_0;
elsif Self.Locator.Version = To_Universal_String ("1.1") then
-- Self.Result.Prepend ("<?xml version=""1.1""?>");
Self.Result := "<?xml version=""1.1""?>" & Self.Result;
Self.Version := XML_1_1;
else
raise Program_Error;
end if;
end if;
end Set_Version;
---------------
-- Start_DTD --
---------------
overriding procedure Start_DTD
(Self : in out Canonical_Writer;
Name : League.Strings.Universal_String;
Public_Id : League.Strings.Universal_String;
System_Id : League.Strings.Universal_String;
Success : in out Boolean) is
begin
Set_Version (Self);
Self.Name := Name;
end Start_DTD;
-------------------
-- Start_Element --
-------------------
overriding procedure Start_Element
(Self : in out Canonical_Writer;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
Qualified_Name : League.Strings.Universal_String;
Attributes : XML.SAX.Attributes.SAX_Attributes;
Success : in out Boolean)
is
use League.Strings;
use Universal_String_Integer_Maps;
Map : Universal_String_Integer_Maps.Map;
Position : Universal_String_Integer_Maps.Cursor;
Index : Positive;
begin
Set_Version (Self);
Self.Result.Append ("<" & Qualified_Name);
for J in 1 .. Attributes.Length loop
Map.Insert (Attributes.Qualified_Name (J), J);
end loop;
Position := Map.First;
while Has_Element (Position) loop
Index := Element (Position);
Self.Result.Append
(" "
& Attributes.Qualified_Name (Index)
& "="""
& Escape_Character_Data (Attributes.Value (Index), Self.Version)
& '"');
Next (Position);
end loop;
Self.Result.Append ('>');
end Start_Element;
----------
-- Text --
----------
function Text
(Self : Canonical_Writer) return League.Strings.Universal_String is
begin
return Self.Result;
end Text;
end XMLConf.Canonical_Writers;
|
reznikmm/matreshka | Ada | 5,546 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A substitution is a relationship between two classifiers signifies that
-- the substituting classifier complies with the contract specified by the
-- contract classifier. This implies that instances of the substituting
-- classifier are runtime substitutable where instances of the contract
-- classifier are expected.
------------------------------------------------------------------------------
limited with AMF.UML.Classifiers;
with AMF.UML.Realizations;
package AMF.UML.Substitutions is
pragma Preelaborate;
type UML_Substitution is limited interface
and AMF.UML.Realizations.UML_Realization;
type UML_Substitution_Access is
access all UML_Substitution'Class;
for UML_Substitution_Access'Storage_Size use 0;
not overriding function Get_Contract
(Self : not null access constant UML_Substitution)
return AMF.UML.Classifiers.UML_Classifier_Access is abstract;
-- Getter of Substitution::contract.
--
-- The contract with which the substituting classifier complies.
not overriding procedure Set_Contract
(Self : not null access UML_Substitution;
To : AMF.UML.Classifiers.UML_Classifier_Access) is abstract;
-- Setter of Substitution::contract.
--
-- The contract with which the substituting classifier complies.
not overriding function Get_Substituting_Classifier
(Self : not null access constant UML_Substitution)
return AMF.UML.Classifiers.UML_Classifier_Access is abstract;
-- Getter of Substitution::substitutingClassifier.
--
-- Instances of the substituting classifier are runtime substitutable
-- where instances of the contract classifier are expected.
not overriding procedure Set_Substituting_Classifier
(Self : not null access UML_Substitution;
To : AMF.UML.Classifiers.UML_Classifier_Access) is abstract;
-- Setter of Substitution::substitutingClassifier.
--
-- Instances of the substituting classifier are runtime substitutable
-- where instances of the contract classifier are expected.
end AMF.UML.Substitutions;
|
stcarrez/ada-servlet | Ada | 24,405 | ads | -----------------------------------------------------------------------
-- servlet-requests -- Servlet Requests
-- Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016, 2017, 2018, 2019, 2022 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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 EL.Objects;
with EL.Contexts;
with Util.Locales;
with Util.Beans.Objects.Maps;
with Util.Http.Headers;
with Ada.Calendar;
with Ada.Strings.Unbounded;
with Ada.Finalization;
with Servlet.Cookies;
with Servlet.Sessions;
with Servlet.Responses;
with Servlet.Principals;
with Servlet.Parts;
with Servlet.Routes;
with Servlet.Streams;
-- The <b>Servlet.Requests</b> package is an Ada implementation of
-- the Java servlet request (JSR 315 3. The Request).
package Servlet.Requests is
subtype Quality_Type is Util.Http.Headers.Quality_Type;
-- Split an accept like header into multiple tokens and a quality value.
-- Invoke the <b>Process</b> procedure for each token. Example:
-- Accept-Language: de, en;q=0.7, jp, fr;q=0.8, ru
-- The <b>Process</b> will be called for "de", "en" with quality 0.7,
-- and "jp", "fr" with quality 0.8 and then "ru" with quality 1.0.
procedure Split_Header (Header : in String;
Process : access procedure (Item : in String;
Quality : in Quality_Type))
renames Util.Http.Headers.Split_Header;
-- ------------------------------
-- Request
-- ------------------------------
-- The <b>Request</b> type describes a web request that a servlet can process.
type Request is abstract new Ada.Finalization.Limited_Controlled with private;
type Request_Access is access all Request'Class;
-- Returns the value of the named attribute as an Object, or null if no attribute
-- of the given name exists.
--
-- Attributes can be set two ways. The servlet container may set attributes to make
-- available custom information about a request. For example, for requests made
-- using HTTPS, the attribute javax.servlet.request.X509Certificate can be used
-- to retrieve information on the certificate of the client. Attributes can also
-- be set programatically using setAttribute(String, Object).
-- This allows information to be embedded into a request before
-- a RequestDispatcher call.
function Get_Attribute (Req : in Request;
Name : in String) return EL.Objects.Object;
-- Stores an attribute in this request. Attributes are reset between requests.
-- This method is most often used in conjunction with RequestDispatcher.
--
-- If the object passed in is null, the effect is the same as calling
-- removeAttribute(java.lang.String). It is warned that when the request is
-- dispatched from the servlet resides in a different web application by
-- RequestDispatcher, the object set by this method may not be correctly
-- retrieved in the caller servlet.
procedure Set_Attribute (Req : in out Request;
Name : in String;
Value : in EL.Objects.Object);
-- Stores a list of attributes in this request.
procedure Set_Attributes (Req : in out Request;
Attributes : in Util.Beans.Objects.Maps.Map);
-- Removes an attribute from this request. This method is not generally needed
-- as attributes only persist as long as the request is being handled.
procedure Remove_Attribute (Req : in out Request;
Name : in String);
-- Iterate over the request attributes and executes the <b>Process</b> procedure.
procedure Iterate_Attributes (Req : in Request;
Process : not null access
procedure (Name : in String;
Value : in EL.Objects.Object));
-- Returns the name of the character encoding used in the body of this request.
-- This method returns null if the request does not specify a character encoding
function Get_Character_Encoding (Req : in Request) return String;
-- Overrides the name of the character encoding used in the body of this request.
-- This method must be called prior to reading request parameters or reading input
-- using getReader(). Otherwise, it has no effect.
procedure Set_Character_Encoding (Req : in out Request;
Encoding : in String);
-- Returns the length, in bytes, of the request body and made available by the
-- input stream, or -1 if the length is not known. For HTTP servlets,
-- same as the value of the CGI variable CONTENT_LENGTH.
function Get_Content_Length (Req : in Request) return Integer;
-- Returns the MIME type of the body of the request, or null if the type is
-- not known. For HTTP servlets, same as the value of the CGI variable CONTENT_TYPE.
function Get_Content_Type (Req : in Request) return String;
-- Returns the value of a request parameter as a String, or null if the
-- parameter does not exist. Request parameters are extra information sent with
-- the request. For HTTP servlets, parameters are contained in the query string
-- or posted form data.
--
-- You should only use this method when you are sure the parameter has only one
-- value. If the parameter might have more than one value, use
-- Get_Parameter_Values(String).
--
-- If you use this method with a multivalued parameter, the value returned is
-- equal to the first value in the array returned by Get_Parameter_Values.
--
-- If the parameter data was sent in the request body, such as occurs with
-- an HTTP POST request, then reading the body directly via getInputStream()
-- or getReader() can interfere with the execution of this method.
--
function Get_Parameter (Req : in Request;
Name : in String)
return String is abstract;
-- Returns an array of String objects containing all of the values the given
-- request parameter has, or null if the parameter does not exist.
--
-- If the parameter has a single value, the array has a length of 1.
function Get_Parameter_Values (Req : in Request;
Name : in String) return String;
-- Iterate over the request parameters and executes the <b>Process</b> procedure.
procedure Iterate_Parameters (Req : in Request;
Process : not null access
procedure (Name : in String;
Value : in String)) is abstract;
-- Returns the name and version of the protocol the request uses in the form
-- protocol/majorVersion.minorVersion, for example, HTTP/1.1. For HTTP servlets,
-- the value returned is the same as the value of the CGI variable SERVER_PROTOCOL.
function Get_Protocol (Req : in Request) return String;
-- Returns the name of the scheme used to make this request, for example, http,
-- https, or ftp. Different schemes have different rules for constructing URLs,
-- as noted in RFC 1738.
function Get_Scheme (Req : in Request) return String;
-- Returns the host name of the server to which the request was sent.
-- It is the value of the part before ":" in the Host header value, if any,
-- or the resolved server name, or the server IP address.
function Get_Server_Name (Req : in Request) return String;
-- Returns the port number to which the request was sent. It is the value of the
-- part after ":" in the Host header value, if any, or the server port where the
-- client connection was accepted on.
function Get_Server_Port (Req : in Request) return Natural;
-- Returns the Internet Protocol (IP) address of the client or last proxy that
-- sent the request. For HTTP servlets, same as the value of the CGI variable
-- REMOTE_ADDR.
function Get_Remote_Addr (Req : in Request) return String;
-- Returns the fully qualified name of the client or the last proxy that sent
-- the request. If the engine cannot or chooses not to resolve the hostname
-- (to improve performance), this method returns the dotted-string form of the
-- IP address. For HTTP servlets, same as the value of the CGI variable REMOTE_HOST.
function Get_Remote_Host (Req : in Request) return String;
-- Returns the preferred Locale that the client will accept content in, based
-- on the Accept-Language header. If the client request doesn't provide an
-- Accept-Language header, this method returns the default locale for the server.
function Get_Locale (Req : in Request) return Util.Locales.Locale;
-- Returns an Enumeration of Locale objects indicating, in decreasing order
-- starting with the preferred locale, the locales that are acceptable to the
-- client based on the Accept-Language header. If the client request doesn't
-- provide an Accept-Language header, this method returns an Enumeration containing
-- one Locale, the default locale for the server.
function Get_Locales (Req : in Request) return Util.Locales.Locale;
-- From the <b>Accept-Language</b> request header, find the locales that are recognized
-- by the client and execute the <b>Process</b> procedure with each locale and the
-- associated quality value (ranging from 0.0 to 1.0).
procedure Accept_Locales (Req : in Request;
Process : access procedure (Item : in Util.Locales.Locale;
Quality : in Quality_Type));
-- Returns a boolean indicating whether this request was made using a secure
-- channel, such as HTTPS.
function Is_Secure (Req : in Request) return Boolean;
-- Returns the Internet Protocol (IP) source port of the client or last proxy
-- that sent the request.
function Get_Remote_Port (Req : in Request) return Natural;
-- Returns the host name of the Internet Protocol (IP) interface on which
-- the request was received.
function Get_Local_Name (Req : in Request) return String;
-- Returns the Internet Protocol (IP) address of the interface on which the
-- request was received.
function Get_Local_Addr (Req : in Request) return String;
-- Returns the Internet Protocol (IP) port number of the interface on which
-- the request was received.
function Get_Local_Port (Req : in Request) return Natural;
-- Returns the name of the authentication scheme used to protect the servlet.
-- All servlet containers support basic, form and client certificate authentication,
-- and may additionally support digest authentication. If the servlet is not
-- authenticated null is returned.
function Get_Auth_Type (Req : in Request) return String;
-- Returns an array containing all of the Cookie objects the client sent with
-- this request. This method returns null if no cookies were sent.
function Get_Cookies (Req : in Request) return Servlet.Cookies.Cookie_Array;
-- Iterate over the request cookies and executes the <b>Process</b> procedure.
procedure Iterate_Cookies (Req : in Request;
Process : not null access
procedure (Cookie : in Servlet.Cookies.Cookie));
-- Returns the value of the specified request header as a long value that
-- represents a Date object. Use this method with headers that contain dates,
-- such as If-Modified-Since.
--
-- The date is returned as the number of milliseconds since January 1, 1970 GMT.
-- The header name is case insensitive.
--
-- If the request did not have a header of the specified name, this method
-- returns -1. If the header can't be converted to a date, the method throws
-- an IllegalArgumentException.
function Get_Date_Header (Req : in Request;
Name : in String) return Ada.Calendar.Time;
-- Returns the value of the specified request header as a String. If the request
-- did not include a header of the specified name, this method returns null.
-- If there are multiple headers with the same name, this method returns the
-- first head in the request. The header name is case insensitive. You can use
-- this method with any request header.
function Get_Header (Req : in Request;
Name : in String) return String;
-- Returns all the values of the specified request header as an Enumeration
-- of String objects.
--
-- Some headers, such as Accept-Language can be sent by clients as several headers
-- each with a different value rather than sending the header as a comma
-- separated list.
--
-- If the request did not include any headers of the specified name, this method
-- returns an empty Enumeration. The header name is case insensitive. You can use
-- this method with any request header.
function Get_Headers (Req : in Request;
Name : in String) return String;
-- Returns the value of the specified request header as an int. If the request
-- does not have a header of the specified name, this method returns -1.
-- If the header cannot be converted to an integer, this method throws
-- a NumberFormatException.
--
-- The header name is case insensitive.
function Get_Int_Header (Req : in Request;
Name : in String) return Integer;
-- Iterate over the request headers and executes the <b>Process</b> procedure.
procedure Iterate_Headers (Req : in Request;
Process : not null access
procedure (Name : in String;
Value : in String)) is abstract;
-- Returns the name of the HTTP method with which this request was made,
-- for example, GET, POST, or PUT. Same as the value of the CGI variable
-- REQUEST_METHOD.
function Get_Method (Req : in Request) return String;
-- Returns any extra path information associated with the URL the client sent when
-- it made this request. The extra path information follows the servlet path but
-- precedes the query string and will start with a "/" character.
function Get_Path_Info (Req : in Request) return String;
-- Get the request path that correspond to the servlet path and the path info.
function Get_Path (Req : in Request) return String;
-- Returns the portion of the request URI that indicates the context of the
-- request. The context path always comes first in a request URI. The path
-- starts with a "/" character but does not end with a "/" character.
-- For servlets in the default (root) context, this method returns "".
-- The container does not decode this string.
function Get_Context_Path (Req : in Request) return String;
-- Returns the query string that is contained in the request URL after the path.
-- This method returns null if the URL does not have a query string. Same as the
-- value of the CGI variable QUERY_STRING.
function Get_Query_String (Req : in Request) return String;
-- Returns the login of the user making this request, if the user has been
-- authenticated, or null if the user has not been authenticated. Whether
-- the user name is sent with each subsequent request depends on the browser
-- and type of authentication. Same as the value of the CGI variable REMOTE_USER.
function Get_Remote_User (Req : in Request) return String;
-- Returns a Principal object containing the name of the current
-- authenticated user. If the user has not been authenticated, the method returns null.
function Get_User_Principal (Req : in Request) return Servlet.Principals.Principal_Access;
-- Set the principal that represents the authenticated user.
procedure Set_User_Principal (Req : in out Request;
User : in Servlet.Principals.Principal_Access);
-- Returns the session ID specified by the client. This may not be the same as
-- the ID of the current valid session for this request. If the client did not
-- specify a session ID, this method returns null.
function Get_Request_Session_Id (Req : in Request) return String;
-- Returns the part of this request's URL from the protocol name up to the query
-- string in the first line of the HTTP request. The web container does not decode
-- this String. For example:
-- First line of HTTP request Returned Value
-- POST /some/path.html HTTP/1.1 /some/path.html
-- GET http://foo.bar/a.html HTTP/1.0 /a.html
-- HEAD /xyz?a=b HTTP/1.1 /xyz
function Get_Request_URI (Req : in Request) return String;
-- Reconstructs the URL the client used to make the request. The returned URL
-- contains a protocol, server name, port number, and server path, but it does
-- not include query string parameters.
--
-- If this request has been forwarded using RequestDispatcher.forward(Request, Response),
-- the server path in the reconstructed URL must reflect the path used to
-- obtain the RequestDispatcher, and not the server path specified by the client.
--
-- Because this method returns a StringBuffer, not a string, you can modify the
-- URL easily, for example, to append query parameters.
--
-- This method is useful for creating redirect messages and for reporting errors.
function Get_Request_URL (Req : in Request) return Ada.Strings.Unbounded.Unbounded_String;
-- Returns the part of this request's URL that calls the servlet. This path starts
-- with a "/" character and includes either the servlet name or a path to the
-- servlet, but does not include any extra path information or a query string.
-- Same as the value of the CGI variable SCRIPT_NAME.
--
-- This method will return an empty string ("") if the servlet used to process
-- this request was matched using the "/*" pattern.
function Get_Servlet_Path (Req : in Request) return String;
-- Returns the current HttpSession associated with this request or, if there
-- is no current session and create is true, returns a new session.
--
-- If create is false and the request has no valid HttpSession, this method
-- returns null.
--
-- To make sure the session is properly maintained, you must call this method
-- before the response is committed. If the container is using cookies to maintain
-- session integrity and is asked to create a new session when the response is
-- committed, an IllegalStateException is thrown.
function Get_Session (Req : in Request;
Create : in Boolean := False) return Servlet.Sessions.Session;
-- Set the path info. The <tt>Path_Pos</tt> parameter indicates the optional starting
-- position for the path info. When specified, the servlet path is built from the
-- beginning of the path up to that path position.
procedure Set_Path_Info (Req : in out Request;
Path : in String;
Path_Pos : in Natural := 0);
-- Get the number of parts included in the request.
function Get_Part_Count (Req : in Request) return Natural is abstract;
-- Process the part at the given position and executes the <b>Process</b> operation
-- with the part object.
procedure Process_Part (Req : in out Request;
Position : in Positive;
Process : not null access
procedure (Data : in Servlet.Parts.Part'Class)) is abstract;
-- Process the part identified by <b>Id</b> and executes the <b>Process</b> operation
-- with the part object.
procedure Process_Part (Req : in out Request;
Id : in String;
Process : not null access
procedure (Data : in Servlet.Parts.Part'Class)) is abstract;
-- Returns True if the request is an AJAX request.
function Is_Ajax_Request (Req : in Request) return Boolean;
-- Returns the absolute path of the resource identified by the given relative path.
-- The resource is searched in a list of directories configured by the application.
-- The path must begin with a "/" and is interpreted as relative to the current
-- context root.
--
-- This method allows the servlet container to make a resource available to
-- servlets from any source.
--
-- This method returns an empty string if the resource could not be localized.
function Get_Resource (Req : in Request;
Path : in String) return String;
-- Returns the route object that is associated with the request.
function Get_Route (Req : in Request) return Servlet.Routes.Route_Type_Accessor;
-- Returns true if we have a route object.
function Has_Route (Req : in Request) return Boolean;
-- Inject the parameters that have been extracted from the path according
-- to the selected route. The parameters are injected in the request attributes map.
procedure Inject_Parameters (Req : in out Request;
ELContext : in EL.Contexts.ELContext'Class);
-- Get the path parameter value for the given parameter index.
-- The <tt>No_Parameter</tt> exception is raised if the parameter does not exist.
function Get_Path_Parameter (Req : in Request;
Index : in Positive) return String;
-- Get the number of path parameters that were extracted for the route.
function Get_Path_Parameter_Count (Req : in Request) return Natural;
-- Get a buffer stream to read the request body.
function Get_Input_Stream (Req : in Request)
return Servlet.Streams.Input_Stream_Access;
-- Create the buffer stream instance to read the request body.
function Create_Input_Stream (Req : in Request)
return Servlet.Streams.Input_Stream_Access is (null);
-- Initialize the request object.
overriding
procedure Initialize (Req : in out Request);
-- Finalize the request object.
overriding
procedure Finalize (Req : in out Request);
private
-- Make sure the cookies are loaded in the request object.
procedure Load_Cookies (Req : in Request'Class);
-- Get and check the request session
function Has_Session (Req : in Request'Class) return Boolean;
type Request_Data is record
-- The session
Session : Servlet.Sessions.Session;
-- Indicates whether the session object is known.
Session_Initialized : Boolean := False;
-- The response object associated with the request.
Response : Servlet.Responses.Response_Access;
-- The request cookies.
Cookies : Servlet.Cookies.Cookie_Array_Access := null;
-- The input stream.
Stream : Servlet.Streams.Input_Stream_Access;
end record;
type Request_Data_Access is access Request_Data;
type Request is abstract new Ada.Finalization.Limited_Controlled with record
Attributes : Util.Beans.Objects.Maps.Map_Bean;
Info : Request_Data_Access := null;
Context : access Servlet.Routes.Route_Context_Type;
User : Servlet.Principals.Principal_Access;
end record;
end Servlet.Requests;
|
stcarrez/swagger-ada | Ada | 14,085 | ads | -- REST API Validation
-- API to validate
--
-- The version of the OpenAPI document: 1.0.0
-- Contact: [email protected]
--
-- NOTE: This package is auto generated by OpenAPI-Generator 7.0.1-2023-08-27.
-- https://openapi-generator.tech
-- Do not edit the class manually.
pragma Warnings (Off, "*is not referenced");
pragma Warnings (Off, "*no entities of*are referenced");
with Swagger.Servers;
with TestAPI.Models;
with Security.Permissions;
package TestAPI.Skeletons is
pragma Style_Checks ("-bmrIu");
pragma Warnings (Off, "*use clause for package*");
use TestAPI.Models;
type Server_Type is limited interface;
-- Update a ticket
package ACL_Write_Ticket is new Security.Permissions.Definition
("write:ticket");
-- Read a ticket
package ACL_Read_Ticket is new Security.Permissions.Definition
("read:ticket");
--
-- Query an orchestrated service instance
procedure Orch_Store
(Server : in out Server_Type;
Orch_Store_Request_Type : in OrchStoreRequest_Type;
Context : in out Swagger.Servers.Context_Type) is abstract;
--
procedure Test_Int
(Server : in out Server_Type;
Options : in Swagger.Nullable_UString;
Result : out TestAPI.Models.IntStruct_Type;
Context : in out Swagger.Servers.Context_Type) is abstract;
--
procedure Test_Text_Response
(Server : in out Server_Type;
Options : in Swagger.Nullable_UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is abstract;
-- Create a ticket
procedure Do_Create_Ticket
(Server : in out Server_Type;
Title : in Swagger.UString;
Owner : in Swagger.Nullable_UString;
Status : in Swagger.Nullable_UString;
Description : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is abstract;
-- Delete a ticket
procedure Do_Delete_Ticket
(Server : in out Server_Type;
Tid : in Swagger.Long;
Context : in out Swagger.Servers.Context_Type) is abstract;
-- List the tickets
procedure Do_Head_Ticket
(Server : in out Server_Type;
Context : in out Swagger.Servers.Context_Type) is abstract;
-- Patch a ticket
procedure Do_Patch_Ticket
(Server : in out Server_Type;
Tid : in Swagger.Long;
Owner : in Swagger.Nullable_UString;
Status : in Swagger.Nullable_UString;
Title : in Swagger.Nullable_UString;
Description : in Swagger.Nullable_UString;
Result : out TestAPI.Models.Ticket_Type;
Context : in out Swagger.Servers.Context_Type) is abstract;
-- Update a ticket
procedure Do_Update_Ticket
(Server : in out Server_Type;
Tid : in Swagger.Long;
Owner : in Swagger.Nullable_UString;
Status : in Swagger.Nullable_UString;
Title : in Swagger.Nullable_UString;
Description : in Swagger.Nullable_UString;
Result : out TestAPI.Models.Ticket_Type;
Context : in out Swagger.Servers.Context_Type) is abstract;
-- Get a ticket
-- Get a ticket
procedure Do_Get_Ticket
(Server : in out Server_Type;
Tid : in Swagger.Long;
Result : out TestAPI.Models.Ticket_Type;
Context : in out Swagger.Servers.Context_Type) is abstract;
-- List the tickets
-- List the tickets created for the project.
procedure Do_List_Tickets
(Server : in out Server_Type;
Status : in Swagger.Nullable_UString;
Owner : in Swagger.Nullable_UString;
Result : out TestAPI.Models.Ticket_Type_Vectors.Vector;
Context : in out Swagger.Servers.Context_Type) is abstract;
-- Get a ticket
-- Get a ticket
procedure Do_Options_Ticket
(Server : in out Server_Type;
Tid : in Swagger.Long;
Result : out TestAPI.Models.Ticket_Type;
Context : in out Swagger.Servers.Context_Type) is abstract;
generic
type Implementation_Type is limited new Server_Type with private;
URI_Prefix : String := "";
package Skeleton is
procedure Register
(Server : in out Swagger.Servers.Application_Type'Class);
--
procedure Orch_Store
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
--
procedure Test_Int
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
--
procedure Test_Text_Response
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Create a ticket
procedure Do_Create_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Delete a ticket
procedure Do_Delete_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- List the tickets
procedure Do_Head_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Patch a ticket
procedure Do_Patch_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Update a ticket
procedure Do_Update_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Get a ticket
procedure Do_Get_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- List the tickets
procedure Do_List_Tickets
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Get a ticket
procedure Do_Options_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
end Skeleton;
generic
type Implementation_Type is limited new Server_Type with private;
URI_Prefix : String := "";
package Shared_Instance is
procedure Register
(Server : in out Swagger.Servers.Application_Type'Class);
--
procedure Orch_Store
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
--
procedure Test_Int
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
--
procedure Test_Text_Response
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Create a ticket
procedure Do_Create_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Delete a ticket
procedure Do_Delete_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- List the tickets
procedure Do_Head_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Patch a ticket
procedure Do_Patch_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Update a ticket
procedure Do_Update_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Get a ticket
procedure Do_Get_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- List the tickets
procedure Do_List_Tickets
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
-- Get a ticket
procedure Do_Options_Ticket
(Req : in out Swagger.Servers.Request'Class;
Reply : in out Swagger.Servers.Response'Class;
Stream : in out Swagger.Servers.Output_Stream'Class;
Context : in out Swagger.Servers.Context_Type);
private
protected Server is
--
procedure Orch_Store
(Orch_Store_Request_Type : in OrchStoreRequest_Type;
Context : in out Swagger.Servers.Context_Type);
--
procedure Test_Int
(Options : in Swagger.Nullable_UString;
Result : out TestAPI.Models.IntStruct_Type;
Context : in out Swagger.Servers.Context_Type);
--
procedure Test_Text_Response
(Options : in Swagger.Nullable_UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type);
-- Create a ticket
procedure Do_Create_Ticket
(Title : in Swagger.UString;
Owner : in Swagger.Nullable_UString;
Status : in Swagger.Nullable_UString;
Description : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type);
-- Delete a ticket
procedure Do_Delete_Ticket
(Tid : in Swagger.Long;
Context : in out Swagger.Servers.Context_Type);
-- List the tickets
procedure Do_Head_Ticket
(Context : in out Swagger.Servers.Context_Type);
-- Patch a ticket
procedure Do_Patch_Ticket
(Tid : in Swagger.Long;
Owner : in Swagger.Nullable_UString;
Status : in Swagger.Nullable_UString;
Title : in Swagger.Nullable_UString;
Description : in Swagger.Nullable_UString;
Result : out TestAPI.Models.Ticket_Type;
Context : in out Swagger.Servers.Context_Type);
-- Update a ticket
procedure Do_Update_Ticket
(Tid : in Swagger.Long;
Owner : in Swagger.Nullable_UString;
Status : in Swagger.Nullable_UString;
Title : in Swagger.Nullable_UString;
Description : in Swagger.Nullable_UString;
Result : out TestAPI.Models.Ticket_Type;
Context : in out Swagger.Servers.Context_Type);
-- Get a ticket
procedure Do_Get_Ticket
(Tid : in Swagger.Long;
Result : out TestAPI.Models.Ticket_Type;
Context : in out Swagger.Servers.Context_Type);
-- List the tickets
procedure Do_List_Tickets
(Status : in Swagger.Nullable_UString;
Owner : in Swagger.Nullable_UString;
Result : out TestAPI.Models.Ticket_Type_Vectors.Vector;
Context : in out Swagger.Servers.Context_Type);
-- Get a ticket
procedure Do_Options_Ticket
(Tid : in Swagger.Long;
Result : out TestAPI.Models.Ticket_Type;
Context : in out Swagger.Servers.Context_Type);
private
Impl : Implementation_Type;
end Server;
end Shared_Instance;
end TestAPI.Skeletons;
|
docandrew/troodon | Ada | 1,747 | ads | with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Interfaces.C;
with Interfaces.C.Strings;
with System;
with xcb; use xcb;
with xproto; use xproto;
package Util is
type errorPtr is access all xcb_generic_error_t;
---------------------------------------------------------------------------
-- charsToUBS
-- Given the address of a xcb string property reply and it's length, return
-- an Unbounded_String with its contents.
---------------------------------------------------------------------------
function charsToUBS (charPtr : System.Address; len : Interfaces.C.int) return Unbounded_String;
-- function charsToUBS(charPtr : Interfaces.C.Strings.chars_ptr; len : Interfaces.C.unsigned) return Unbounded_String;
procedure checkFatal (connection : access xcb_connection_t;
cookie : xcb_void_cookie_t;
message : String);
function getStringProperty (connection : access xcb_connection_t;
window : xcb_window_t;
name : xcb_atom_t) return Unbounded_String;
function getAtomProperty (connection : access xcb_connection_t;
window : xcb_window_t;
name : xcb_atom_t) return xcb_atom_t;
function getWindowGeometry (connection : access xcb_connection_t;
window : xcb_window_t;
error : out errorPtr) return xcb_get_geometry_reply_t;
function getWindowGeometry (connection : access xcb_connection_t;
window : xcb_window_t) return xcb_get_geometry_reply_t;
end Util;
|
zhmu/ananas | Ada | 26,828 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ C H 2 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, 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. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Checks; use Checks;
with Debug; use Debug;
with Einfo; use Einfo;
with Einfo.Entities; use Einfo.Entities;
with Einfo.Utils; use Einfo.Utils;
with Elists; use Elists;
with Exp_Smem; use Exp_Smem;
with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Namet; use Namet;
with Nmake; use Nmake;
with Opt; use Opt;
with Output; use Output;
with Sem; use Sem;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sem_Warn; use Sem_Warn;
with Sinfo; use Sinfo;
with Sinfo.Nodes; use Sinfo.Nodes;
with Sinfo.Utils; use Sinfo.Utils;
with Sinput; use Sinput;
with Snames; use Snames;
with Tbuild; use Tbuild;
package body Exp_Ch2 is
-----------------------
-- Local Subprograms --
-----------------------
procedure Expand_Current_Value (N : Node_Id);
-- N is a node for a variable whose Current_Value field is set. If N is
-- node is for a discrete type, replaces node with a copy of the referenced
-- value. This provides a limited form of value propagation for variables
-- which are initialized or assigned not been further modified at the time
-- of reference. The call has no effect if the Current_Value refers to a
-- conditional with condition other than equality.
procedure Expand_Discriminant (N : Node_Id);
-- An occurrence of a discriminant within a discriminated type is replaced
-- with the corresponding discriminal, that is to say the formal parameter
-- of the initialization procedure for the type that is associated with
-- that particular discriminant. This replacement is not performed for
-- discriminants of records that appear in constraints of component of the
-- record, because Gigi uses the discriminant name to retrieve its value.
-- In the other hand, it has to be performed for default expressions of
-- components because they are used in the record init procedure. See Einfo
-- for more details, and Exp_Ch3, Exp_Ch9 for examples of use. For
-- discriminants of tasks and protected types, the transformation is more
-- complex when it occurs within a default expression for an entry or
-- protected operation. The corresponding default_expression_function has
-- an additional parameter which is the target of an entry call, and the
-- discriminant of the task must be replaced with a reference to the
-- discriminant of that formal parameter.
procedure Expand_Entity_Reference (N : Node_Id);
-- Common processing for expansion of identifiers and expanded names
-- Dispatches to specific expansion procedures.
procedure Expand_Entry_Index_Parameter (N : Node_Id);
-- A reference to the identifier in the entry index specification of an
-- entry body is modified to a reference to a constant definition equal to
-- the index of the entry family member being called. This constant is
-- calculated as part of the elaboration of the expanded code for the body,
-- and is calculated from the object-wide entry index returned by Next_
-- Entry_Call.
procedure Expand_Entry_Parameter (N : Node_Id);
-- A reference to an entry parameter is modified to be a reference to the
-- corresponding component of the entry parameter record that is passed by
-- the runtime to the accept body procedure.
procedure Expand_Formal (N : Node_Id);
-- A reference to a formal parameter of a protected subprogram is expanded
-- into the corresponding formal of the unprotected procedure used to
-- represent the operation within the protected object. In other cases
-- Expand_Formal is a no-op.
procedure Expand_Protected_Component (N : Node_Id);
-- A reference to a private component of a protected type is expanded into
-- a reference to the corresponding prival in the current protected entry
-- or subprogram.
procedure Expand_Renaming (N : Node_Id);
-- For renamings, just replace the identifier by the corresponding
-- named expression. Note that this has been evaluated (see routine
-- Exp_Ch8.Expand_N_Object_Renaming.Evaluate_Name) so this gives
-- the correct renaming semantics.
--------------------------
-- Expand_Current_Value --
--------------------------
procedure Expand_Current_Value (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
E : constant Entity_Id := Entity (N);
CV : constant Node_Id := Current_Value (E);
T : constant Entity_Id := Etype (N);
Val : Node_Id;
Op : Node_Kind;
begin
if True
-- No replacement if value raises constraint error
and then Nkind (CV) /= N_Raise_Constraint_Error
-- Do this only for discrete types
and then Is_Discrete_Type (T)
-- Do not replace biased types, since it is problematic to
-- consistently generate a sensible constant value in this case.
and then not Has_Biased_Representation (T)
-- Do not replace lvalues
and then not Known_To_Be_Assigned (N)
-- Check that entity is suitable for replacement
and then OK_To_Do_Constant_Replacement (E)
-- Do not replace occurrences in pragmas (where names typically
-- appear not as values, but as simply names. If there are cases
-- where values are required, it is only a very minor efficiency
-- issue that they do not get replaced when they could be).
and then Nkind (Parent (N)) /= N_Pragma_Argument_Association
-- Do not replace the prefixes of attribute references, since this
-- causes trouble with cases like 4'Size. Also for Name_Asm_Input and
-- Name_Asm_Output, don't do replacement anywhere, since we can have
-- lvalue references in the arguments.
and then not (Nkind (Parent (N)) = N_Attribute_Reference
and then
(Attribute_Name (Parent (N)) in Name_Asm_Input
| Name_Asm_Output
or else Prefix (Parent (N)) = N))
then
-- Case of Current_Value is a compile time known value
if Nkind (CV) in N_Subexpr then
Val := CV;
-- Case of Current_Value is an if expression reference
else
Get_Current_Value_Condition (N, Op, Val);
if Op /= N_Op_Eq then
return;
end if;
end if;
-- If constant value is an occurrence of an enumeration literal,
-- then we just make another occurrence of the same literal.
if Is_Entity_Name (Val)
and then Ekind (Entity (Val)) = E_Enumeration_Literal
then
Rewrite (N,
Unchecked_Convert_To (T,
New_Occurrence_Of (Entity (Val), Loc)));
-- If constant is of a character type, just make an appropriate
-- character literal, which will get the proper type.
elsif Is_Character_Type (T) then
Rewrite (N,
Make_Character_Literal (Loc,
Chars => Chars (Val),
Char_Literal_Value => Expr_Rep_Value (Val)));
-- If constant is of an integer type, just make an appropriate
-- integer literal, which will get the proper type.
elsif Is_Integer_Type (T) then
Rewrite (N,
Make_Integer_Literal (Loc,
Intval => Expr_Rep_Value (Val)));
-- Otherwise do unchecked conversion of value to right type
else
Rewrite (N,
Unchecked_Convert_To (T,
Make_Integer_Literal (Loc,
Intval => Expr_Rep_Value (Val))));
end if;
Analyze_And_Resolve (N, T);
Set_Is_Static_Expression (N, False);
end if;
end Expand_Current_Value;
-------------------------
-- Expand_Discriminant --
-------------------------
procedure Expand_Discriminant (N : Node_Id) is
Scop : constant Entity_Id := Scope (Entity (N));
P : Node_Id := N;
Parent_P : Node_Id := Parent (P);
In_Entry : Boolean := False;
begin
-- The Incomplete_Or_Private_Kind happens while resolving the
-- discriminant constraint involved in a derived full type,
-- such as:
-- type D is private;
-- type D(C : ...) is new T(C);
if Ekind (Scop) = E_Record_Type
or Ekind (Scop) in Incomplete_Or_Private_Kind
then
-- Find the origin by walking up the tree till the component
-- declaration
while Present (Parent_P)
and then Nkind (Parent_P) /= N_Component_Declaration
loop
P := Parent_P;
Parent_P := Parent (P);
end loop;
-- If the discriminant reference was part of the default expression
-- it has to be "discriminalized"
if Present (Parent_P) and then P = Expression (Parent_P) then
Set_Entity (N, Discriminal (Entity (N)));
end if;
elsif Is_Concurrent_Type (Scop) then
while Present (Parent_P)
and then Nkind (Parent_P) /= N_Subprogram_Body
loop
P := Parent_P;
if Nkind (P) = N_Entry_Declaration then
In_Entry := True;
end if;
Parent_P := Parent (Parent_P);
end loop;
-- If the discriminant occurs within the default expression for a
-- formal of an entry or protected operation, replace it with a
-- reference to the discriminant of the formal of the enclosing
-- operation.
if Present (Parent_P)
and then Present (Corresponding_Spec (Parent_P))
then
declare
Loc : constant Source_Ptr := Sloc (N);
D_Fun : constant Entity_Id := Corresponding_Spec (Parent_P);
Formal : constant Entity_Id := First_Formal (D_Fun);
New_N : Node_Id;
Disc : Entity_Id;
begin
-- Verify that we are within the body of an entry or protected
-- operation. Its first formal parameter is the synchronized
-- type itself.
if Present (Formal)
and then Etype (Formal) = Scope (Entity (N))
then
Disc := CR_Discriminant (Entity (N));
New_N :=
Make_Selected_Component (Loc,
Prefix => New_Occurrence_Of (Formal, Loc),
Selector_Name => New_Occurrence_Of (Disc, Loc));
Set_Etype (New_N, Etype (N));
Rewrite (N, New_N);
else
Set_Entity (N, Discriminal (Entity (N)));
end if;
end;
elsif Nkind (Parent (N)) = N_Range
and then In_Entry
then
Set_Entity (N, CR_Discriminant (Entity (N)));
-- Finally, if the entity is the discriminant of the original
-- type declaration, and we are within the initialization
-- procedure for a task, the designated entity is the
-- discriminal of the task body. This can happen when the
-- argument of pragma Task_Name mentions a discriminant,
-- because the pragma is analyzed in the task declaration
-- but is expanded in the call to Create_Task in the init_proc.
elsif Within_Init_Proc then
Set_Entity (N, Discriminal (CR_Discriminant (Entity (N))));
else
Set_Entity (N, Discriminal (Entity (N)));
end if;
else
Set_Entity (N, Discriminal (Entity (N)));
end if;
end Expand_Discriminant;
-----------------------------
-- Expand_Entity_Reference --
-----------------------------
procedure Expand_Entity_Reference (N : Node_Id) is
function Is_Object_Renaming_Name (N : Node_Id) return Boolean;
-- Indicates that N occurs (after accounting for qualified expressions
-- and type conversions) as the name of an object renaming declaration.
-- We don't want to fold values in that case.
-----------------------------
-- Is_Object_Renaming_Name --
-----------------------------
function Is_Object_Renaming_Name (N : Node_Id) return Boolean is
Trailer : Node_Id := N;
Rover : Node_Id;
begin
loop
Rover := Parent (Trailer);
case Nkind (Rover) is
when N_Qualified_Expression | N_Type_Conversion =>
-- Conservative for type conversions; only necessary if
-- conversion does not introduce a new object (as opposed
-- to a new view of an existing object).
null;
when N_Object_Renaming_Declaration =>
return Trailer = Name (Rover);
when others =>
return False; -- the usual case
end case;
Trailer := Rover;
end loop;
end Is_Object_Renaming_Name;
-- Local variables
E : constant Entity_Id := Entity (N);
-- Start of processing for Expand_Entity_Reference
begin
-- Defend against errors
if No (E) then
Check_Error_Detected;
return;
end if;
if Ekind (E) = E_Discriminant then
Expand_Discriminant (N);
elsif Is_Entry_Formal (E) then
Expand_Entry_Parameter (N);
elsif Is_Protected_Component (E) then
if No_Run_Time_Mode then
return;
else
Expand_Protected_Component (N);
end if;
elsif Ekind (E) = E_Entry_Index_Parameter then
Expand_Entry_Index_Parameter (N);
elsif Is_Formal (E) then
Expand_Formal (N);
elsif Is_Renaming_Of_Object (E) then
Expand_Renaming (N);
elsif Ekind (E) = E_Variable
and then Is_Shared_Passive (E)
then
Expand_Shared_Passive_Variable (N);
end if;
-- Test code for implementing the pragma Reviewable requirement of
-- classifying reads of scalars as referencing potentially uninitialized
-- objects or not.
if Debug_Flag_XX
and then Is_Scalar_Type (Etype (N))
and then (Is_Assignable (E) or else Is_Constant_Object (E))
and then Comes_From_Source (N)
and then not Known_To_Be_Assigned (N)
and then not Is_Actual_Out_Parameter (N)
and then (Nkind (Parent (N)) /= N_Attribute_Reference
or else Attribute_Name (Parent (N)) /= Name_Valid)
then
Write_Location (Sloc (N));
Write_Str (": Read from scalar """);
Write_Name (Chars (N));
Write_Str ("""");
if Is_Known_Valid (E) then
Write_Str (", Is_Known_Valid");
end if;
Write_Eol;
end if;
-- Set Atomic_Sync_Required if necessary for atomic variable. Note that
-- this processing does NOT apply to Volatile_Full_Access variables.
if Nkind (N) in N_Identifier | N_Expanded_Name
and then Ekind (E) = E_Variable
and then (Is_Atomic (E) or else Is_Atomic (Etype (E)))
then
declare
Set : Boolean;
begin
-- If variable is atomic, but type is not, setting depends on
-- disable/enable state for the variable.
if Is_Atomic (E) and then not Is_Atomic (Etype (E)) then
Set := not Atomic_Synchronization_Disabled (E);
-- If variable is not atomic, but its type is atomic, setting
-- depends on disable/enable state for the type.
elsif not Is_Atomic (E) and then Is_Atomic (Etype (E)) then
Set := not Atomic_Synchronization_Disabled (Etype (E));
-- Else both variable and type are atomic (see outer if), and we
-- disable if either variable or its type have sync disabled.
else
Set := (not Atomic_Synchronization_Disabled (E))
and then
(not Atomic_Synchronization_Disabled (Etype (E)));
end if;
-- Set flag if required
if Set then
Activate_Atomic_Synchronization (N);
end if;
end;
end if;
-- Interpret possible Current_Value for variable case. The
-- Is_Object_Renaming_Name test is needed for cases such as
-- X : Integer := 1;
-- Y : Integer renames Integer'(X);
-- where the value of Y is changed by any subsequent assignments to X.
-- In cases like this, we do not want to use Current_Value even though
-- it is available.
if Is_Assignable (E)
and then Present (Current_Value (E))
and then not Is_Object_Renaming_Name (N)
then
Expand_Current_Value (N);
-- We do want to warn for the case of a boolean variable (not a
-- boolean constant) whose value is known at compile time.
if Is_Boolean_Type (Etype (N)) then
Warn_On_Known_Condition (N);
end if;
-- Don't mess with Current_Value for compile time known values. Not
-- only is it unnecessary, but we could disturb an indication of a
-- static value, which could cause semantic trouble.
elsif Compile_Time_Known_Value (N) then
null;
-- Interpret possible Current_Value for constant case
elsif Is_Constant_Object (E)
and then Present (Current_Value (E))
then
Expand_Current_Value (N);
end if;
end Expand_Entity_Reference;
----------------------------------
-- Expand_Entry_Index_Parameter --
----------------------------------
procedure Expand_Entry_Index_Parameter (N : Node_Id) is
Index_Con : constant Entity_Id := Entry_Index_Constant (Entity (N));
begin
Set_Entity (N, Index_Con);
Set_Etype (N, Etype (Index_Con));
end Expand_Entry_Index_Parameter;
----------------------------
-- Expand_Entry_Parameter --
----------------------------
procedure Expand_Entry_Parameter (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Ent_Formal : constant Entity_Id := Entity (N);
Ent_Spec : constant Entity_Id := Scope (Ent_Formal);
Parm_Type : constant Entity_Id := Entry_Parameters_Type (Ent_Spec);
Acc_Stack : constant Elist_Id := Accept_Address (Ent_Spec);
Addr_Ent : constant Entity_Id := Node (Last_Elmt (Acc_Stack));
P_Comp_Ref : Entity_Id;
-- Start of processing for Expand_Entry_Parameter
begin
if Is_Task_Type (Scope (Ent_Spec))
and then Comes_From_Source (Ent_Formal)
then
-- Before replacing the formal with the local renaming that is used
-- in the accept block, note if this is an assignment context, and
-- note the modification to avoid spurious warnings, because the
-- original entity is not used further. If formal is unconstrained,
-- we also generate an extra parameter to hold the Constrained
-- attribute of the actual. No renaming is generated for this flag.
-- Calling Note_Possible_Modification in the expander is dubious,
-- because this generates a cross-reference entry, and should be
-- done during semantic processing so it is called in -gnatc mode???
if Ekind (Entity (N)) /= E_In_Parameter
and then Known_To_Be_Assigned (N)
then
Note_Possible_Modification (N, Sure => True);
end if;
end if;
-- What we need is a reference to the corresponding component of the
-- parameter record object. The Accept_Address field of the entry entity
-- references the address variable that contains the address of the
-- accept parameters record. We first have to do an unchecked conversion
-- to turn this into a pointer to the parameter record and then we
-- select the required parameter field.
-- The same processing applies to protected entries, where the Accept_
-- Address is also the address of the Parameters record.
P_Comp_Ref :=
Make_Selected_Component (Loc,
Prefix =>
Make_Explicit_Dereference (Loc,
Unchecked_Convert_To (Parm_Type,
New_Occurrence_Of (Addr_Ent, Loc))),
Selector_Name =>
New_Occurrence_Of (Entry_Component (Ent_Formal), Loc));
-- For all types of parameters, the constructed parameter record object
-- contains a pointer to the parameter. Thus we must dereference them to
-- access them (this will often be redundant, since the dereference is
-- implicit, but no harm is done by making it explicit).
Rewrite (N,
Make_Explicit_Dereference (Loc, P_Comp_Ref));
Analyze (N);
end Expand_Entry_Parameter;
-------------------
-- Expand_Formal --
-------------------
procedure Expand_Formal (N : Node_Id) is
E : constant Entity_Id := Entity (N);
Scop : constant Entity_Id := Scope (E);
begin
-- Check whether the subprogram of which this is a formal is
-- a protected operation. The initialization procedure for
-- the corresponding record type is not itself a protected operation.
if Is_Protected_Type (Scope (Scop))
and then not Is_Init_Proc (Scop)
and then Present (Protected_Formal (E))
then
Set_Entity (N, Protected_Formal (E));
end if;
end Expand_Formal;
----------------------------
-- Expand_N_Expanded_Name --
----------------------------
procedure Expand_N_Expanded_Name (N : Node_Id) is
begin
Expand_Entity_Reference (N);
end Expand_N_Expanded_Name;
-------------------------
-- Expand_N_Identifier --
-------------------------
procedure Expand_N_Identifier (N : Node_Id) is
begin
Expand_Entity_Reference (N);
end Expand_N_Identifier;
---------------------------
-- Expand_N_Real_Literal --
---------------------------
procedure Expand_N_Real_Literal (N : Node_Id) is
pragma Unreferenced (N);
begin
-- Historically, this routine existed because there were expansion
-- requirements for Vax real literals, but now Vax real literals
-- are now handled by gigi, so this routine no longer does anything.
null;
end Expand_N_Real_Literal;
--------------------------------
-- Expand_Protected_Component --
--------------------------------
procedure Expand_Protected_Component (N : Node_Id) is
function Inside_Eliminated_Body return Boolean;
-- Determine whether the current entity is inside a subprogram or an
-- entry which has been marked as eliminated.
----------------------------
-- Inside_Eliminated_Body --
----------------------------
function Inside_Eliminated_Body return Boolean is
S : Entity_Id := Current_Scope;
begin
while Present (S) loop
if (Ekind (S) = E_Entry
or else Ekind (S) = E_Entry_Family
or else Ekind (S) = E_Function
or else Ekind (S) = E_Procedure)
and then Is_Eliminated (S)
then
return True;
end if;
S := Scope (S);
end loop;
return False;
end Inside_Eliminated_Body;
-- Start of processing for Expand_Protected_Component
begin
-- Eliminated bodies are not expanded and thus do not need privals
if not Inside_Eliminated_Body then
declare
Priv : constant Entity_Id := Prival (Entity (N));
begin
Set_Entity (N, Priv);
Set_Etype (N, Etype (Priv));
end;
end if;
end Expand_Protected_Component;
---------------------
-- Expand_Renaming --
---------------------
procedure Expand_Renaming (N : Node_Id) is
E : constant Entity_Id := Entity (N);
T : constant Entity_Id := Etype (N);
begin
Rewrite (N, New_Copy_Tree (Renamed_Object (E)));
-- We mark the copy as unanalyzed, so that it is sure to be reanalyzed
-- at the top level. This is needed in the packed case since we
-- specifically avoided expanding packed array references when the
-- renaming declaration was analyzed.
Reset_Analyzed_Flags (N);
Analyze_And_Resolve (N, T);
end Expand_Renaming;
end Exp_Ch2;
|
reznikmm/matreshka | Ada | 4,495 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- 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: 3559 $ $Date: 2012-12-07 13:08:31 +0200 (Пт., 07 дек. 2012) $
------------------------------------------------------------------------------
with League.Strings;
package XSD_To_Ada.Writers is
pragma Preelaborate;
type Writer is tagged record
Text : League.Strings.Universal_String;
end record;
procedure P
(Self : in out Writer;
Text : Wide_Wide_String := "");
procedure N
(Self : in out Writer;
Text : Wide_Wide_String);
procedure P
(Self : in out Writer;
Text : League.Strings.Universal_String);
procedure N
(Self : in out Writer;
Text : League.Strings.Universal_String);
procedure P
(Self : in out Writer;
Text : Wide_Wide_String := "";
Copy : in out Writer'Class);
procedure N
(Self : in out Writer;
Text : Wide_Wide_String;
Copy : in out Writer'Class);
procedure P
(Self : in out Writer;
Text : League.Strings.Universal_String;
Copy : in out Writer'Class);
procedure N
(Self : in out Writer;
Text : League.Strings.Universal_String;
Copy : in out Writer'Class);
procedure N
(Self : in out Writer;
Value : Natural);
end XSD_To_Ada.Writers;
|
reznikmm/matreshka | Ada | 4,855 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Elements;
with AMF.Standard_Profile_L2.Sends;
with AMF.UML.Usages;
with AMF.Visitors;
package AMF.Internals.Standard_Profile_L2_Sends is
type Standard_Profile_L2_Send_Proxy is
limited new AMF.Internals.UML_Elements.UML_Element_Base
and AMF.Standard_Profile_L2.Sends.Standard_Profile_L2_Send with null record;
overriding function Get_Base_Usage
(Self : not null access constant Standard_Profile_L2_Send_Proxy)
return AMF.UML.Usages.UML_Usage_Access;
-- Getter of Send::base_Usage.
--
overriding procedure Set_Base_Usage
(Self : not null access Standard_Profile_L2_Send_Proxy;
To : AMF.UML.Usages.UML_Usage_Access);
-- Setter of Send::base_Usage.
--
overriding procedure Enter_Element
(Self : not null access constant Standard_Profile_L2_Send_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Leave_Element
(Self : not null access constant Standard_Profile_L2_Send_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Visit_Element
(Self : not null access constant Standard_Profile_L2_Send_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
end AMF.Internals.Standard_Profile_L2_Sends;
|
jhumphry/SPARK_SipHash | Ada | 5,250 | adb | -- HalfSipHash
-- A 32-bit friendly version of SipHash, the algorithm described in
-- "SipHash: a fast short-input PRF"
-- by Jean-Philippe Aumasson and Daniel J. Bernstein
-- Half Siphash was designed by Jean-Philippe Aumasson but is not yet documented
-- in a paper. This implementation is based on the reference code.
-- Copyright (c) 2016, James Humphry - see LICENSE file for details
with System;
package body HalfSipHash with
SPARK_Mode,
Refined_State => (Initial_Hash_State => Initial_State)
is
-- Short names for fundamental machine types
subtype Storage_Offset is System.Storage_Elements.Storage_Offset;
-- The initial state from the key passed as generic formal parameters is
-- stored here, so that static elaboration followed by a call of SetKey
-- can be used in situations where dynamic elaboration might be a problem.
-- This could really be in the private part of the package, but SPARK GPL
-- 2015 doesn't seem to like Part_Of in the private part of a package,
-- regardless of what the SPARK RM says...
Initial_State : HalfSipHash_State := (k0,
k1,
k0 xor 16#6c796765#,
k1 xor 16#74656462#);
-----------------------
-- Get_Initial_State --
-----------------------
function Get_Initial_State return HalfSipHash_State is
(Initial_State);
-----------------------
-- SArray4_to_U32_LE --
-----------------------
function SArray4_to_U32_LE (S : in SArray_4) return U32 is
(U32(S(0))
or Shift_Left(U32(S(1)), 8)
or Shift_Left(U32(S(2)), 16)
or Shift_Left(U32(S(3)), 24));
---------------------------
-- SArray_Tail_to_U32_LE --
---------------------------
function SArray_Tail_to_U32_LE (S : in SArray)
return U32 is
R : U32 := 0;
Shift : Natural := 0;
begin
for I in 0..(S'Length-1) loop
pragma Loop_Invariant (Shift = I * 8);
R := R or Shift_Left(U32(S(S'First + Storage_Offset(I))), Shift);
Shift := Shift + 8;
end loop;
return R;
end SArray_Tail_to_U32_LE;
---------------
-- Sip_Round --
---------------
procedure Sip_Round (v : in out HalfSipHash_State) is
begin
v(0) := v(0) + v(1);
v(1) := Rotate_Left(v(1), 5);
v(1) := v(1) xor v(0);
v(0) := Rotate_Left(v(0), 16);
v(2) := v(2) + v(3);
v(3) := Rotate_Left(v(3), 8);
v(3) := v(3) xor v(2);
v(0) := v(0) + v(3);
v(3) := Rotate_Left(v(3), 7);
v(3) := v(3) xor v(0);
v(2) := v(2) + v(1);
v(1) := Rotate_Left(v(1), 13);
v(1) := v(1) xor v(2);
v(2) := Rotate_Left(v(2), 16);
end Sip_Round;
----------------------
-- Sip_Finalization --
----------------------
function Sip_Finalization (v : in HalfSipHash_State)
return U32 is
vv : HalfSipHash_State := v;
begin
vv(2) := vv(2) xor 16#ff#;
for I in 1..d_rounds loop
Sip_Round(vv);
end loop;
return (vv(1) xor vv(3));
end Sip_Finalization;
-------------
-- Set_Key --
-------------
procedure Set_Key (k0, k1 : U32) is
begin
Initial_State := (k0,
k1,
k0 xor 16#6c796765#,
k1 xor 16#74656462#);
end Set_Key;
procedure Set_Key (k : HalfSipHash_Key) is
k0, k1 : U32;
begin
k0 := SArray4_to_U32_LE(k(k'First..k'First+3));
k1 := SArray4_to_U32_LE(k(k'First+4..k'Last));
Set_Key(k0, k1);
end Set_Key;
-----------------
-- HalfSipHash --
-----------------
function HalfSipHash (m : System.Storage_Elements.Storage_Array)
return U32
is
m_pos : Storage_Offset := 0;
m_i : U32;
v : HalfSipHash_State := Initial_State;
w : constant Storage_Offset := (m'Length / 4) + 1;
begin
-- This compile-time check is useful for GNAT but in GNATprove it
-- currently just generates a warning that it can not yet prove
-- them correct.
pragma Warnings (GNATprove, Off, "Compile_Time_Error");
pragma Compile_Time_Error (System.Storage_Elements.Storage_Element'Size /= 8,
"This implementation of SipHash cannot work " &
"with Storage_Element'Size /= 8.");
pragma Warnings (GNATprove, On, "Compile_Time_Error");
for I in 1..w-1 loop
pragma Loop_Invariant (m_pos = (I - 1) * 4);
m_i := SArray4_to_U32_LE(m(m'First + m_pos..m'First + m_pos + 3));
v(3) := v(3) xor m_i;
for J in 1..c_rounds loop
Sip_Round(v);
end loop;
v(0) := v(0) xor m_i;
m_pos := m_pos + 4;
end loop;
if m_pos < m'Length then
m_i := SArray_Tail_to_U32_LE(m(m'First + m_pos .. m'Last));
else
m_i := 0;
end if;
m_i := m_i or Shift_Left(U32(m'Length mod 256), 24);
v(3) := v(3) xor m_i;
for J in 1..c_rounds loop
Sip_Round(v);
end loop;
v(0) := v(0) xor m_i;
return Sip_Finalization(v);
end HalfSipHash;
end HalfSipHash;
|
io7m/coreland-math_2d | Ada | 372 | adb | package body Math_2D.Trigonometry is
function To_Radians (Degrees : in Degrees_t) return Radians_t is
begin
return Radians_t (Degrees * (Ada.Numerics.Pi / 180.0));
end To_Radians;
function To_Degrees (Radians : in Radians_t) return Degrees_t is
begin
return Degrees_t (Radians * (180.0 / Ada.Numerics.Pi));
end To_Degrees;
end Math_2D.Trigonometry;
|
ohenley/ada-util | Ada | 28,727 | adb | -----------------------------------------------------------------------
-- util-serialize-io-xml -- XML Serialization Driver
-- Copyright (C) 2011, 2012, 2013, 2016, 2017 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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.Characters.Conversions;
with Unicode;
with Unicode.CES.Utf8;
with Util.Log.Loggers;
with Util.Strings;
with Util.Dates.ISO8601;
with Util.Streams.Texts.TR;
with Util.Streams.Texts.WTR;
package body Util.Serialize.IO.XML is
use Sax.Readers;
use Sax.Exceptions;
use Sax.Locators;
use Sax.Attributes;
use Unicode;
use Unicode.CES;
use Ada.Strings.Unbounded;
-- The logger
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Util.Serialize.IO.XML");
-- Return the location where the exception was raised.
function Get_Location (Except : Sax.Exceptions.Sax_Parse_Exception'Class)
return String is separate;
-- ------------------------------
-- Warning
-- ------------------------------
overriding
procedure Warning (Handler : in out Xhtml_Reader;
Except : Sax.Exceptions.Sax_Parse_Exception'Class) is
pragma Warnings (Off, Handler);
begin
Log.Warn ("{0}", Get_Message (Except));
end Warning;
-- ------------------------------
-- Error
-- ------------------------------
overriding
procedure Error (Handler : in out Xhtml_Reader;
Except : in Sax.Exceptions.Sax_Parse_Exception'Class) is
Msg : constant String := Get_Message (Except);
Pos : constant Natural := Util.Strings.Index (Msg, ' ');
begin
-- The SAX error message contains the line+file name. Remove it because this part
-- will be added by the <b>Error</b> procedure.
if Pos > Msg'First and then Msg (Pos - 1) = ':' then
Handler.Handler.Error (Msg (Pos + 1 .. Msg'Last));
else
Handler.Handler.Error (Msg);
end if;
end Error;
-- ------------------------------
-- Fatal_Error
-- ------------------------------
overriding
procedure Fatal_Error (Handler : in out Xhtml_Reader;
Except : in Sax.Exceptions.Sax_Parse_Exception'Class) is
begin
Handler.Error (Except);
end Fatal_Error;
-- ------------------------------
-- Set_Document_Locator
-- ------------------------------
overriding
procedure Set_Document_Locator (Handler : in out Xhtml_Reader;
Loc : in out Sax.Locators.Locator) is
begin
Handler.Handler.Locator := Loc;
end Set_Document_Locator;
-- ------------------------------
-- Start_Document
-- ------------------------------
overriding
procedure Start_Document (Handler : in out Xhtml_Reader) is
begin
null;
end Start_Document;
-- ------------------------------
-- End_Document
-- ------------------------------
overriding
procedure End_Document (Handler : in out Xhtml_Reader) is
begin
null;
end End_Document;
-- ------------------------------
-- Start_Prefix_Mapping
-- ------------------------------
overriding
procedure Start_Prefix_Mapping (Handler : in out Xhtml_Reader;
Prefix : in Unicode.CES.Byte_Sequence;
URI : in Unicode.CES.Byte_Sequence) is
begin
null;
end Start_Prefix_Mapping;
-- ------------------------------
-- End_Prefix_Mapping
-- ------------------------------
overriding
procedure End_Prefix_Mapping (Handler : in out Xhtml_Reader;
Prefix : in Unicode.CES.Byte_Sequence) is
begin
null;
end End_Prefix_Mapping;
-- ------------------------------
-- Start_Element
-- ------------------------------
overriding
procedure Start_Element (Handler : in out Xhtml_Reader;
Namespace_URI : in Unicode.CES.Byte_Sequence := "";
Local_Name : in Unicode.CES.Byte_Sequence := "";
Qname : in Unicode.CES.Byte_Sequence := "";
Atts : in Sax.Attributes.Attributes'Class) is
pragma Unreferenced (Namespace_URI, Qname);
Attr_Count : Natural;
begin
Log.Debug ("Start object {0}", Local_Name);
Handler.Sink.Start_Object (Local_Name, Handler.Handler.all);
Attr_Count := Get_Length (Atts);
for I in 0 .. Attr_Count - 1 loop
declare
Name : constant String := Get_Qname (Atts, I);
Value : constant String := Get_Value (Atts, I);
begin
Handler.Sink.Set_Member (Name => Name,
Value => Util.Beans.Objects.To_Object (Value),
Logger => Handler.Handler.all,
Attribute => True);
end;
end loop;
end Start_Element;
-- ------------------------------
-- End_Element
-- ------------------------------
overriding
procedure End_Element (Handler : in out Xhtml_Reader;
Namespace_URI : in Unicode.CES.Byte_Sequence := "";
Local_Name : in Unicode.CES.Byte_Sequence := "";
Qname : in Unicode.CES.Byte_Sequence := "") is
pragma Unreferenced (Namespace_URI, Qname);
Len : constant Natural := Length (Handler.Text);
begin
Handler.Sink.Finish_Object (Local_Name, Handler.Handler.all);
if Len > 0 then
-- Add debug message only when it is active (saves the To_String conversion).
if Log.Get_Level >= Util.Log.DEBUG_LEVEL then
Log.Debug ("Close object {0} -> {1}", Local_Name, To_String (Handler.Text));
end if;
Handler.Sink.Set_Member (Local_Name, Util.Beans.Objects.To_Object (Handler.Text),
Handler.Handler.all);
-- Clear the string using Delete so that the buffer is kept.
Ada.Strings.Unbounded.Delete (Source => Handler.Text, From => 1, Through => Len);
else
Log.Debug ("Close object {0}", Local_Name);
Handler.Sink.Set_Member (Local_Name, Util.Beans.Objects.To_Object (Handler.Text),
Handler.Handler.all);
end if;
end End_Element;
procedure Collect_Text (Handler : in out Xhtml_Reader;
Content : Unicode.CES.Byte_Sequence) is
begin
Append (Handler.Text, Content);
end Collect_Text;
-- ------------------------------
-- Characters
-- ------------------------------
overriding
procedure Characters (Handler : in out Xhtml_Reader;
Ch : in Unicode.CES.Byte_Sequence) is
begin
Collect_Text (Handler, Ch);
end Characters;
-- ------------------------------
-- Ignorable_Whitespace
-- ------------------------------
overriding
procedure Ignorable_Whitespace (Handler : in out Xhtml_Reader;
Ch : in Unicode.CES.Byte_Sequence) is
begin
if not Handler.Ignore_White_Spaces then
Collect_Text (Handler, Ch);
end if;
end Ignorable_Whitespace;
-- ------------------------------
-- Processing_Instruction
-- ------------------------------
overriding
procedure Processing_Instruction (Handler : in out Xhtml_Reader;
Target : in Unicode.CES.Byte_Sequence;
Data : in Unicode.CES.Byte_Sequence) is
pragma Unreferenced (Handler);
begin
Log.Error ("Processing instruction: {0}: {1}", Target, Data);
end Processing_Instruction;
-- ------------------------------
-- Skipped_Entity
-- ------------------------------
overriding
procedure Skipped_Entity (Handler : in out Xhtml_Reader;
Name : in Unicode.CES.Byte_Sequence) is
pragma Unmodified (Handler);
begin
null;
end Skipped_Entity;
-- ------------------------------
-- Start_Cdata
-- ------------------------------
overriding
procedure Start_Cdata (Handler : in out Xhtml_Reader) is
pragma Unmodified (Handler);
pragma Unreferenced (Handler);
begin
Log.Info ("Start CDATA");
end Start_Cdata;
-- ------------------------------
-- End_Cdata
-- ------------------------------
overriding
procedure End_Cdata (Handler : in out Xhtml_Reader) is
pragma Unmodified (Handler);
pragma Unreferenced (Handler);
begin
Log.Info ("End CDATA");
end End_Cdata;
-- ------------------------------
-- Resolve_Entity
-- ------------------------------
overriding
function Resolve_Entity (Handler : Xhtml_Reader;
Public_Id : Unicode.CES.Byte_Sequence;
System_Id : Unicode.CES.Byte_Sequence)
return Input_Sources.Input_Source_Access is
pragma Unreferenced (Handler);
begin
Log.Error ("Cannot resolve entity {0} - {1}", Public_Id, System_Id);
return null;
end Resolve_Entity;
overriding
procedure Start_DTD (Handler : in out Xhtml_Reader;
Name : Unicode.CES.Byte_Sequence;
Public_Id : Unicode.CES.Byte_Sequence := "";
System_Id : Unicode.CES.Byte_Sequence := "") is
begin
null;
end Start_DTD;
-- ------------------------------
-- Set the XHTML reader to ignore or not the white spaces.
-- When set to True, the ignorable white spaces will not be kept.
-- ------------------------------
procedure Set_Ignore_White_Spaces (Reader : in out Parser;
Value : in Boolean) is
begin
Reader.Ignore_White_Spaces := Value;
end Set_Ignore_White_Spaces;
-- ------------------------------
-- Set the XHTML reader to ignore empty lines.
-- ------------------------------
procedure Set_Ignore_Empty_Lines (Reader : in out Parser;
Value : in Boolean) is
begin
Reader.Ignore_Empty_Lines := Value;
end Set_Ignore_Empty_Lines;
-- ------------------------------
-- Get the current location (file and line) to report an error message.
-- ------------------------------
function Get_Location (Handler : in Parser) return String is
File : constant String := Util.Serialize.IO.Parser (Handler).Get_Location;
begin
if Handler.Locator = Sax.Locators.No_Locator then
return File;
else
return File & Sax.Locators.To_String (Handler.Locator);
end if;
end Get_Location;
-- ------------------------------
-- Parse an XML stream, and calls the appropriate SAX callbacks for each
-- event.
-- This is not re-entrant: you can not call Parse with the same Parser
-- argument in one of the SAX callbacks. This has undefined behavior.
-- ------------------------------
-- Parse the stream using the JSON parser.
procedure Parse (Handler : in out Parser;
Stream : in out Util.Streams.Buffered.Input_Buffer_Stream'Class;
Sink : in out Reader'Class) is
Buffer_Size : constant Positive := 256;
type String_Access is access all String (1 .. Buffer_Size);
type Stream_Input is new Input_Sources.Input_Source with record
Index : Natural;
Last : Natural;
Encoding : Unicode.CES.Encoding_Scheme;
Buffer : String_Access;
end record;
-- Return the next character in the string.
procedure Next_Char (From : in out Stream_Input;
C : out Unicode.Unicode_Char);
-- True if From is past the last character in the string.
function Eof (From : in Stream_Input) return Boolean;
procedure Fill (From : in out Stream_Input'Class);
procedure Fill (From : in out Stream_Input'Class) is
Last : Natural := From.Last;
begin
-- Move to the buffer start
if Last > From.Index and From.Index > From.Buffer'First then
From.Buffer (From.Buffer'First .. Last - 1 - From.Index + From.Buffer'First) :=
From.Buffer (From.Index .. Last - 1);
Last := Last - From.Index + From.Buffer'First;
From.Index := From.Buffer'First;
end if;
if From.Index > From.Last then
From.Index := From.Buffer'First;
end if;
begin
loop
Stream.Read (From.Buffer (Last));
Last := Last + 1;
exit when Last > From.Buffer'Last;
end loop;
exception
when others =>
null;
end;
From.Last := Last;
end Fill;
-- Return the next character in the string.
procedure Next_Char (From : in out Stream_Input;
C : out Unicode.Unicode_Char) is
begin
if From.Index + 6 >= From.Last then
Fill (From);
end if;
From.Encoding.Read (From.Buffer.all, From.Index, C);
end Next_Char;
-- True if From is past the last character in the string.
function Eof (From : in Stream_Input) return Boolean is
begin
if From.Index < From.Last then
return False;
end if;
return Stream.Is_Eof;
end Eof;
Input : Stream_Input;
Xml_Parser : Xhtml_Reader;
Buf : aliased String (1 .. Buffer_Size);
begin
Input.Buffer := Buf'Access;
Input.Index := Buf'First + 1;
Input.Last := Buf'First;
Input.Set_Encoding (Unicode.CES.Utf8.Utf8_Encoding);
Input.Encoding := Unicode.CES.Utf8.Utf8_Encoding;
Xml_Parser.Handler := Handler'Unchecked_Access;
Xml_Parser.Ignore_White_Spaces := Handler.Ignore_White_Spaces;
Xml_Parser.Ignore_Empty_Lines := Handler.Ignore_Empty_Lines;
Xml_Parser.Sink := Sink'Unchecked_Access;
Sax.Readers.Reader (Xml_Parser).Parse (Input);
Handler.Locator := Sax.Locators.No_Locator;
-- Ignore the Program_Error exception that SAX could raise if we know that the
-- error was reported.
exception
when Program_Error =>
Handler.Locator := Sax.Locators.No_Locator;
if not Handler.Has_Error then
raise;
end if;
when others =>
Handler.Locator := Sax.Locators.No_Locator;
raise;
end Parse;
-- Close the current XML entity if an entity was started
procedure Close_Current (Stream : in out Output_Stream'Class);
-- ------------------------------
-- Close the current XML entity if an entity was started
-- ------------------------------
procedure Close_Current (Stream : in out Output_Stream'Class) is
begin
if Stream.Close_Start then
Stream.Write ('>');
Stream.Close_Start := False;
end if;
end Close_Current;
-- -----------------------
-- Set the target output stream.
-- -----------------------
procedure Initialize (Stream : in out Output_Stream;
Output : in Util.Streams.Texts.Print_Stream_Access) is
begin
Stream.Stream := Output;
end Initialize;
-- -----------------------
-- Flush the buffer (if any) to the sink.
-- -----------------------
overriding
procedure Flush (Stream : in out Output_Stream) is
begin
Stream.Stream.Flush;
end Flush;
-- -----------------------
-- Close the sink.
-- -----------------------
overriding
procedure Close (Stream : in out Output_Stream) is
begin
Stream.Stream.Close;
end Close;
-- -----------------------
-- Write the buffer array to the output stream.
-- -----------------------
overriding
procedure Write (Stream : in out Output_Stream;
Buffer : in Ada.Streams.Stream_Element_Array) is
begin
Stream.Stream.Write (Buffer);
end Write;
-- -----------------------
-- Write a raw character on the stream.
-- -----------------------
procedure Write (Stream : in out Output_Stream;
Char : in Character) is
begin
Stream.Stream.Write (Char);
end Write;
-- -----------------------
-- Write a wide character on the stream doing some conversion if necessary.
-- The default implementation translates the wide character to a UTF-8 sequence.
-- -----------------------
procedure Write_Wide (Stream : in out Output_Stream;
Item : in Wide_Wide_Character) is
begin
Stream.Stream.Write_Wide (Item);
end Write_Wide;
-- -----------------------
-- Write a raw string on the stream.
-- -----------------------
procedure Write (Stream : in out Output_Stream;
Item : in String) is
begin
Stream.Stream.Write (Item);
end Write;
-- ------------------------------
-- Write a character on the response stream and escape that character as necessary.
-- ------------------------------
procedure Write_Escape (Stream : in out Output_Stream'Class;
Char : in Wide_Wide_Character) is
type Unicode_Char is mod 2**32;
Code : constant Unicode_Char := Wide_Wide_Character'Pos (Char);
begin
-- If "?" or over, no escaping is needed (this covers
-- most of the Latin alphabet)
if Code >= 16#80# then
Stream.Write_Wide (Char);
elsif Code > 16#3F# or Code <= 16#20# then
Stream.Write (Character'Val (Code));
elsif Char = '<' then
Stream.Write ("<");
elsif Char = '>' then
Stream.Write (">");
elsif Char = '&' then
Stream.Write ("&");
else
Stream.Write (Character'Val (Code));
end if;
end Write_Escape;
-- ------------------------------
-- Write the value as a XML string. Special characters are escaped using the XML
-- escape rules.
-- ------------------------------
procedure Write_String (Stream : in out Output_Stream;
Value : in String) is
begin
Close_Current (Stream);
for I in Value'Range loop
Stream.Write_Escape (Ada.Characters.Conversions.To_Wide_Wide_Character (Value (I)));
end loop;
end Write_String;
-- ------------------------------
-- Write the value as a XML string. Special characters are escaped using the XML
-- escape rules.
-- ------------------------------
procedure Write_Wide_String (Stream : in out Output_Stream;
Value : in Wide_Wide_String) is
begin
Close_Current (Stream);
for I in Value'Range loop
Stream.Write_Escape (Value (I));
end loop;
end Write_Wide_String;
-- ------------------------------
-- Write the value as a XML string. Special characters are escaped using the XML
-- escape rules.
-- ------------------------------
procedure Write_String (Stream : in out Output_Stream;
Value : in Util.Beans.Objects.Object) is
use Util.Beans.Objects;
begin
Close_Current (Stream);
case Util.Beans.Objects.Get_Type (Value) is
when TYPE_NULL =>
null;
when TYPE_BOOLEAN =>
if Util.Beans.Objects.To_Boolean (Value) then
Stream.Write ("true");
else
Stream.Write ("false");
end if;
when TYPE_INTEGER =>
Stream.Stream.Write (Util.Beans.Objects.To_Long_Long_Integer (Value));
when others =>
Stream.Write_String (Util.Beans.Objects.To_String (Value));
end case;
end Write_String;
-- ------------------------------
-- Start a new XML object.
-- ------------------------------
procedure Start_Entity (Stream : in out Output_Stream;
Name : in String) is
begin
Close_Current (Stream);
Stream.Close_Start := True;
Stream.Write ('<');
Stream.Write (Name);
end Start_Entity;
-- ------------------------------
-- Terminates the current XML object.
-- ------------------------------
procedure End_Entity (Stream : in out Output_Stream;
Name : in String) is
begin
Close_Current (Stream);
Stream.Write ("</");
Stream.Write (Name);
Stream.Write ('>');
end End_Entity;
-- ------------------------------
-- Write the attribute name/value pair.
-- ------------------------------
overriding
procedure Write_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in String) is
begin
Stream.Write (' ');
Stream.Write (Name);
Stream.Write ("=""");
Util.Streams.Texts.TR.Escape_Xml (Content => Value, Into => Stream.Stream.all);
Stream.Write ('"');
end Write_Attribute;
overriding
procedure Write_Wide_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in Wide_Wide_String) is
begin
Stream.Write (' ');
Stream.Write (Name);
Stream.Write ("=""");
Util.Streams.Texts.WTR.Escape_Xml (Content => Value, Into => Stream.Stream.all);
Stream.Write ('"');
end Write_Wide_Attribute;
overriding
procedure Write_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in Integer) is
begin
Stream.Write (' ');
Stream.Write (Name);
Stream.Write ("=""");
Stream.Stream.Write (Value);
Stream.Write ('"');
end Write_Attribute;
overriding
procedure Write_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in Boolean) is
begin
Stream.Write (' ');
Stream.Write (Name);
if Value then
Stream.Write ("=""true""");
else
Stream.Write ("=""false""");
end if;
end Write_Attribute;
-- ------------------------------
-- Write a XML name/value attribute.
-- ------------------------------
procedure Write_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in Util.Beans.Objects.Object) is
use Util.Beans.Objects;
begin
Stream.Write (' ');
Stream.Write (Name);
Stream.Write ("=""");
case Util.Beans.Objects.Get_Type (Value) is
when TYPE_NULL =>
null;
when TYPE_BOOLEAN =>
if Util.Beans.Objects.To_Boolean (Value) then
Stream.Write ("true");
else
Stream.Write ("false");
end if;
when TYPE_INTEGER =>
Stream.Stream.Write (Util.Beans.Objects.To_Long_Long_Integer (Value));
when others =>
Stream.Write (Util.Beans.Objects.To_String (Value));
end case;
Stream.Write ('"');
end Write_Attribute;
-- ------------------------------
-- Write the attribute with a null value.
-- ------------------------------
overriding
procedure Write_Null_Attribute (Stream : in out Output_Stream;
Name : in String) is
begin
null;
end Write_Null_Attribute;
-- ------------------------------
-- Write the entity value.
-- ------------------------------
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in String) is
begin
Close_Current (Stream);
Stream.Write ('<');
Stream.Write (Name);
Stream.Close_Start := True;
Stream.Write_String (Value);
Stream.Write ("</");
Stream.Write (Name);
Stream.Write ('>');
end Write_Entity;
overriding
procedure Write_Wide_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Wide_Wide_String) is
begin
Close_Current (Stream);
Stream.Write ('<');
Stream.Write (Name);
Stream.Close_Start := True;
Stream.Write_Wide_String (Value);
Stream.Write ("</");
Stream.Write (Name);
Stream.Write ('>');
end Write_Wide_Entity;
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Boolean) is
begin
Close_Current (Stream);
Stream.Write ('<');
Stream.Write (Name);
if Value then
Stream.Write (">true</");
else
Stream.Write (">false</");
end if;
Stream.Write (Name);
Stream.Write ('>');
end Write_Entity;
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Integer) is
begin
Close_Current (Stream);
Stream.Write ('<');
Stream.Write (Name);
Stream.Write ('>');
Stream.Stream.Write (Value);
Stream.Write ("</");
Stream.Write (Name);
Stream.Write ('>');
end Write_Entity;
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Ada.Calendar.Time) is
begin
Stream.Write_Entity (Name, Util.Dates.ISO8601.Image (Value, Util.Dates.ISO8601.SUBSECOND));
end Write_Entity;
overriding
procedure Write_Long_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Long_Long_Integer) is
begin
Close_Current (Stream);
Stream.Write ('<');
Stream.Write (Name);
Stream.Write ('>');
Stream.Stream.Write (Value);
Stream.Write ("</");
Stream.Write (Name);
Stream.Write ('>');
end Write_Long_Entity;
overriding
procedure Write_Enum_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in String) is
begin
Stream.Write_Entity (Name, Value);
end Write_Enum_Entity;
-- ------------------------------
-- Write a XML name/value entity (see Write_Attribute).
-- ------------------------------
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Util.Beans.Objects.Object) is
use Util.Beans.Objects;
begin
Close_Current (Stream);
Stream.Write ('<');
Stream.Write (Name);
Stream.Close_Start := True;
Stream.Write_String (Value);
Stream.Write ("</");
Stream.Write (Name);
Stream.Write ('>');
end Write_Entity;
-- ------------------------------
-- Write an entity with a null value.
-- ------------------------------
overriding
procedure Write_Null_Entity (Stream : in out Output_Stream;
Name : in String) is
begin
null;
end Write_Null_Entity;
-- ------------------------------
-- Starts a XML array.
-- ------------------------------
overriding
procedure Start_Array (Stream : in out Output_Stream;
Name : in String) is
pragma Unreferenced (Stream, Name);
begin
null;
end Start_Array;
-- ------------------------------
-- Terminates a XML array.
-- ------------------------------
overriding
procedure End_Array (Stream : in out Output_Stream;
Name : in String) is
begin
null;
end End_Array;
end Util.Serialize.IO.XML;
|
aherd2985/Amass | Ada | 2,210 | ads | -- 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 = "VirusTotal"
type = "api"
function start()
setratelimit(15)
end
function vertical(ctx, domain)
local c
local cfg = datasrc_config()
if cfg ~= nil then
c = cfg.credentials
end
local haskey = true
if (c == nil or c.key == nil or c.key == "") then
haskey = false
end
local resp
local vurl = buildurl(domain)
if haskey then
vurl = apiurl(domain, c.key)
end
-- Check if the response data is in the graph database
if (cfg and 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(ctx, {
url=vurl,
headers={['Content-Type']="application/json"},
})
if (err ~= nil and err ~= "") then
return
end
if (cfg and cfg.ttl ~= nil and cfg.ttl > 0) then
cache_response(domain, resp)
end
end
local d = json.decode(resp)
if haskey then
if d['response_code'] ~= 1 then
log(ctx, name .. ": " .. vurl .. ": Response code " .. d['response_code'] .. ": " .. d['verbose_msg'])
return
end
for i, sub in pairs(d.subdomains) do
sendnames(ctx, sub)
end
else
for i, data in pairs(d.data) do
if data.type == "domain" then
sendnames(ctx, data.id)
end
end
end
end
function buildurl(domain)
return "https://www.virustotal.com/ui/domains/" .. domain .. "/subdomains?limit=40"
end
function apiurl(domain, key)
return "https://www.virustotal.com/vtapi/v2/domain/report?apikey=" .. key .. "&domain=" .. domain
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
|
Tim-Tom/project-euler | Ada | 661 | adb | with Ada.Long_Long_Integer_Text_IO;
with Ada.Text_IO;
with PrimeInstances;
package body Problem_10 is
package IO renames Ada.Text_IO;
package I_IO renames Ada.Long_Long_Integer_Text_IO;
procedure Solve is
package Integer_Primes renames PrimeInstances.Integer_Primes;
gen : Integer_Primes.Prime_Generator := Integer_Primes.Make_Generator(2_000_000);
sum : Long_Long_Integer := 0;
prime : Integer;
begin
loop
Integer_Primes.Next_Prime(gen, prime);
exit when prime = 1;
sum := sum + Long_Long_Integer(prime);
end loop;
I_IO.Put(sum);
IO.New_Line;
end Solve;
end Problem_10;
|
ashleygay/adaboy | Ada | 1,341 | ads | pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with word_operations_hpp;
with System;
package instructionset_hpp is
-- skipped empty struct Instruction
subtype OpCode is word_operations_hpp.uint16_t; -- ./instructionset.hpp:6
-- -1 invalid instruction
-- otherwise, the number of arguments it takes
-- Function not safe on its own, use isOpCodeValid() first
type InstructionSet_map_array is array (0 .. 53246) of System.Address;
package Class_InstructionSet is
type InstructionSet is limited record
map : InstructionSet_map_array; -- ./instructionset.hpp:21
end record;
pragma Import (CPP, InstructionSet);
function New_InstructionSet return InstructionSet; -- ./instructionset.hpp:11
pragma CPP_Constructor (New_InstructionSet, "_ZN14InstructionSetC1Ev");
function isValidOpCode (this : access InstructionSet; the_opcode : OpCode) return int; -- ./instructionset.hpp:15
pragma Import (CPP, isValidOpCode, "_ZN14InstructionSet13isValidOpCodeEt");
function getInstruction (this : access InstructionSet; the_opcode : OpCode) return System.Address; -- ./instructionset.hpp:18
pragma Import (CPP, getInstruction, "_ZN14InstructionSet14getInstructionEt");
end;
use Class_InstructionSet;
end instructionset_hpp;
|
sungyeon/drake | Ada | 7,501 | adb | with System.Long_Long_Integer_Types;
package body System.Boolean_Array_Operations is
pragma Suppress (All_Checks);
use type Long_Long_Integer_Types.Word_Unsigned;
use type Storage_Elements.Storage_Element;
use type Storage_Elements.Storage_Offset;
subtype Word_Unsigned is Long_Long_Integer_Types.Word_Unsigned;
Word_Unit : constant := Standard'Word_Size / Standard'Storage_Unit;
Word_Mask : constant := Word_Unit - 1;
pragma Compile_Time_Error (Word_Unit > 8, "should fix Vector_Not");
-- implementation
procedure Vector_Not (
R, X : Address;
Length : Storage_Elements.Storage_Count)
is
Dest_Addr : Address := R;
Right_Addr : Address := X;
Dest_End : constant Address := Dest_Addr + Length;
begin
if ((Dest_Addr or Right_Addr) and Word_Mask) = 0 then
declare
Dest_End_Word : constant Address := Dest_End and not Word_Mask;
begin
while Dest_Addr < Dest_End_Word loop
declare
Dest : Word_Unsigned;
for Dest'Address use Dest_Addr;
Right : Word_Unsigned;
for Right'Address use Right_Addr;
begin
Dest :=
(2 ** 0
or 2 ** Standard'Storage_Unit
or 2 ** (Standard'Storage_Unit * 2)
or 2 ** (Standard'Storage_Unit * 3)
or 2 ** (Standard'Storage_Unit * 4)
or 2 ** (Standard'Storage_Unit * 5)
or 2 ** (Standard'Storage_Unit * 6)
or 2 ** (Standard'Storage_Unit * 7))
xor Right;
end;
Dest_Addr := Dest_Addr + Address'(Word_Unit);
Right_Addr := Right_Addr + Address'(Word_Unit);
end loop;
end;
end if;
while Dest_Addr < Dest_End loop
declare
Dest : Storage_Elements.Storage_Element;
for Dest'Address use Dest_Addr;
Right : Storage_Elements.Storage_Element;
for Right'Address use Right_Addr;
begin
Dest := 1 xor Right;
end;
Dest_Addr := Dest_Addr + Address'(1);
Right_Addr := Right_Addr + Address'(1);
end loop;
end Vector_Not;
procedure Vector_And (
R, X, Y : Address;
Length : Storage_Elements.Storage_Count)
is
Dest_Addr : Address := R;
Left_Addr : Address := X;
Right_Addr : Address := Y;
Dest_End : constant Address := Dest_Addr + Length;
begin
if ((Dest_Addr or Left_Addr or Right_Addr) and Word_Mask) = 0 then
declare
Dest_End_Word : constant Address := Dest_End and not Word_Mask;
begin
while Dest_Addr < Dest_End_Word loop
declare
Dest : Word_Unsigned;
for Dest'Address use Dest_Addr;
Left : Word_Unsigned;
for Left'Address use Left_Addr;
Right : Word_Unsigned;
for Right'Address use Right_Addr;
begin
Dest := Left and Right;
end;
Dest_Addr := Dest_Addr + Address'(Word_Unit);
Left_Addr := Left_Addr + Address'(Word_Unit);
Right_Addr := Right_Addr + Address'(Word_Unit);
end loop;
end;
end if;
while Dest_Addr < Dest_End loop
declare
Dest : Storage_Elements.Storage_Element;
for Dest'Address use Dest_Addr;
Left : Storage_Elements.Storage_Element;
for Left'Address use Left_Addr;
Right : Storage_Elements.Storage_Element;
for Right'Address use Right_Addr;
begin
Dest := Left and Right;
end;
Dest_Addr := Dest_Addr + Address'(1);
Left_Addr := Left_Addr + Address'(1);
Right_Addr := Right_Addr + Address'(1);
end loop;
end Vector_And;
procedure Vector_Or (
R, X, Y : Address;
Length : Storage_Elements.Storage_Count)
is
Dest_Addr : Address := R;
Left_Addr : Address := X;
Right_Addr : Address := Y;
Dest_End : constant Address := Dest_Addr + Length;
begin
if ((Dest_Addr or Left_Addr or Right_Addr) and Word_Mask) = 0 then
declare
Dest_End_Word : constant Address := Dest_End and not Word_Mask;
begin
while Dest_Addr < Dest_End_Word loop
declare
Dest : Word_Unsigned;
for Dest'Address use Dest_Addr;
Left : Word_Unsigned;
for Left'Address use Left_Addr;
Right : Word_Unsigned;
for Right'Address use Right_Addr;
begin
Dest := Left or Right;
end;
Dest_Addr := Dest_Addr + Address'(Word_Unit);
Left_Addr := Left_Addr + Address'(Word_Unit);
Right_Addr := Right_Addr + Address'(Word_Unit);
end loop;
end;
end if;
while Dest_Addr < Dest_End loop
declare
Dest : Storage_Elements.Storage_Element;
for Dest'Address use Dest_Addr;
Left : Storage_Elements.Storage_Element;
for Left'Address use Left_Addr;
Right : Storage_Elements.Storage_Element;
for Right'Address use Right_Addr;
begin
Dest := Left or Right;
end;
Dest_Addr := Dest_Addr + Address'(1);
Left_Addr := Left_Addr + Address'(1);
Right_Addr := Right_Addr + Address'(1);
end loop;
end Vector_Or;
procedure Vector_Xor (
R, X, Y : Address;
Length : Storage_Elements.Storage_Count)
is
Dest_Addr : Address := R;
Left_Addr : Address := X;
Right_Addr : Address := Y;
Dest_End : constant Address := Dest_Addr + Length;
begin
if ((Dest_Addr or Left_Addr or Right_Addr) and Word_Mask) = 0 then
declare
Dest_End_Word : constant Address := Dest_End and not Word_Mask;
begin
while Dest_Addr < Dest_End_Word loop
declare
Dest : Word_Unsigned;
for Dest'Address use Dest_Addr;
Left : Word_Unsigned;
for Left'Address use Left_Addr;
Right : Word_Unsigned;
for Right'Address use Right_Addr;
begin
Dest := Left xor Right;
end;
Dest_Addr := Dest_Addr + Address'(Word_Unit);
Left_Addr := Left_Addr + Address'(Word_Unit);
Right_Addr := Right_Addr + Address'(Word_Unit);
end loop;
end;
end if;
while Dest_Addr < Dest_End loop
declare
Dest : Storage_Elements.Storage_Element;
for Dest'Address use Dest_Addr;
Left : Storage_Elements.Storage_Element;
for Left'Address use Left_Addr;
Right : Storage_Elements.Storage_Element;
for Right'Address use Right_Addr;
begin
Dest := Left xor Right;
end;
Dest_Addr := Dest_Addr + Address'(1);
Left_Addr := Left_Addr + Address'(1);
Right_Addr := Right_Addr + Address'(1);
end loop;
end Vector_Xor;
end System.Boolean_Array_Operations;
|
reznikmm/matreshka | Ada | 4,856 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016-2017, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with WebAPI.DOM.Event_Targets;
package body WUI.Widgets.Spin_Boxes is
------------------
-- Constructors --
------------------
package body Constructors is
----------------
-- Initialize --
----------------
procedure Initialize
(Self : in out Abstract_Spin_Box'Class;
Element :
not null WebAPI.HTML.Input_Elements.HTML_Input_Element_Access) is
begin
WUI.Widgets.Constructors.Initialize
(Self, WebAPI.HTML.Elements.HTML_Element_Access (Element));
end Initialize;
end Constructors;
-----------------------------
-- Editing_Finished_Signal --
-----------------------------
not overriding function Editing_Finished_Signal
(Self : in out Abstract_Spin_Box)
return not null access Core.Slots_0.Signal'Class
is
begin
return Self.Editing_Finished'Unchecked_Access;
end Editing_Finished_Signal;
------------------
-- Set_Disabled --
------------------
not overriding procedure Set_Disabled
(Self : in out Abstract_Spin_Box;
Disabled : Boolean) is
begin
WebAPI.HTML.Input_Elements.HTML_Input_Element_Access
(Self.Element).Set_Disabled (Disabled);
end Set_Disabled;
-----------------
-- Set_Enabled --
-----------------
not overriding procedure Set_Enabled
(Self : in out Abstract_Spin_Box;
Enabled : Boolean) is
begin
Self.Set_Disabled (not Enabled);
end Set_Enabled;
end WUI.Widgets.Spin_Boxes;
|
NCommander/dnscatcher | Ada | 2,667 | ads | -- Copyright 2019 Michael Casadevall <[email protected]>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to
-- deal in the Software without restriction, including without limitation the
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-- sell copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with DNSCatcher.DNS.Processor.Packet; use DNSCatcher.DNS.Processor.Packet;
with DNSCatcher.Config; use DNSCatcher.Config;
with DNSCatcher.DNS; use DNSCatcher.DNS;
with DNSCatcher.Types; use DNSCatcher.Types;
-- Creates and handles making DNS client requests
package DNSCatcher.DNS.Client is
-- DNS Client object
type Client is tagged private;
type Client_Access is access all Client'Class;
-- Populates the header field for a given DNS request
--
-- @value This the DNS Client object
procedure Create_Header (This : in out Client);
--!pp off
-- Adds a question to the DNS request
--
-- @value This the DNS Client object
-- @value QName DNS name to query
-- @value QType The RRType to query
-- @value QClass DNS Class to query
--!pp on
procedure Add_Query
(This : in out Client;
QName : Unbounded_String;
QType : RR_Types;
QClass : Classes);
--!pp off
-- Creates a DNS packet out of a client request (should be private)
--
-- @value This the DNS Client object
-- @value Config to the DNSCatcher configuration
--!pp on
function Create_Packet
(This : in out Client;
Config : Configuration)
return Raw_Packet_Record_Ptr;
private
type Client is tagged record
Header : DNS_Packet_Header;
Questions : Question_Vector.Vector;
end record;
end DNSCatcher.DNS.Client;
|
reznikmm/matreshka | Ada | 3,953 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Dr3d_Size_Attributes;
package Matreshka.ODF_Dr3d.Size_Attributes is
type Dr3d_Size_Attribute_Node is
new Matreshka.ODF_Dr3d.Abstract_Dr3d_Attribute_Node
and ODF.DOM.Dr3d_Size_Attributes.ODF_Dr3d_Size_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Dr3d_Size_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Dr3d_Size_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Dr3d.Size_Attributes;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 269 | ads | with STM32_SVD.I2C;
with STM32_SVD; use STM32_SVD;
package STM32GD.I2C is
pragma Preelaborate;
I2C_1 : STM32_SVD.I2C.I2C_Peripheral renames STM32_SVD.I2C.I2C1_Periph;
I2C_2 : STM32_SVD.I2C.I2C_Peripheral renames STM32_SVD.I2C.I2C2_Periph;
end STM32GD.I2C;
|
reznikmm/matreshka | Ada | 3,870 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, Vadim Godunko <[email protected]> --
-- 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.UML.Typed_Elements;
package AMF.OCL.Collection_Literal_Parts is
pragma Preelaborate;
type OCL_Collection_Literal_Part is limited interface
and AMF.UML.Typed_Elements.UML_Typed_Element;
type OCL_Collection_Literal_Part_Access is
access all OCL_Collection_Literal_Part'Class;
for OCL_Collection_Literal_Part_Access'Storage_Size use 0;
end AMF.OCL.Collection_Literal_Parts;
|
AdaCore/Ada_Drivers_Library | Ada | 2,578 | ads | -- This spec has been automatically generated from STM32F46_79x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.RNG is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- control register
type CR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Random number generator enable
RNGEN : Boolean := False;
-- Interrupt enable
IE : Boolean := False;
-- unspecified
Reserved_4_31 : HAL.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
RNGEN at 0 range 2 .. 2;
IE at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-- status register
type SR_Register is record
-- Read-only. Data ready
DRDY : Boolean := False;
-- Read-only. Clock error current status
CECS : Boolean := False;
-- Read-only. Seed error current status
SECS : Boolean := False;
-- unspecified
Reserved_3_4 : HAL.UInt2 := 16#0#;
-- Clock error interrupt status
CEIS : Boolean := False;
-- Seed error interrupt status
SEIS : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
DRDY at 0 range 0 .. 0;
CECS at 0 range 1 .. 1;
SECS at 0 range 2 .. 2;
Reserved_3_4 at 0 range 3 .. 4;
CEIS at 0 range 5 .. 5;
SEIS at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Random number generator
type RNG_Peripheral is record
-- control register
CR : aliased CR_Register;
-- status register
SR : aliased SR_Register;
-- data register
DR : aliased HAL.UInt32;
end record
with Volatile;
for RNG_Peripheral use record
CR at 16#0# range 0 .. 31;
SR at 16#4# range 0 .. 31;
DR at 16#8# range 0 .. 31;
end record;
-- Random number generator
RNG_Periph : aliased RNG_Peripheral
with Import, Address => System'To_Address (16#50060800#);
end STM32_SVD.RNG;
|
zhmu/ananas | Ada | 5,053 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . O S _ P R I M I T I V E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1998-2022, 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 package provides low level primitives used to implement clock and
-- delays in non tasking applications.
-- The choice of the real clock/delay implementation (depending on whether
-- tasking is involved or not) is done via soft links (see s-soflin.ads)
-- NEVER add any dependency to tasking packages here
package System.OS_Primitives is
pragma Preelaborate;
Max_Sensible_Delay : constant Duration :=
Duration'Min (183 * 24 * 60 * 60.0,
Duration'Last);
-- Max of half a year delay, needed to prevent exceptions for large delay
-- values. It seems unlikely that any test will notice this restriction,
-- except in the case of applications setting the clock at run time (see
-- s-tastim.adb). Also note that a larger value might cause problems (e.g
-- overflow, or more likely OS limitation in the primitives used). In the
-- case where half a year is too long (which occurs in high integrity mode
-- with 32-bit words, and possibly on some specific ports of GNAT),
-- Duration'Last is used instead.
Max_System_Delay : constant Duration := Max_Sensible_Delay;
-- If the Max_System_Delay is larger it doesn't matter. Setting it equal
-- allows optimization of code in some targets delay functions.
procedure Initialize;
-- Initialize global settings related to this package. This procedure
-- should be called before any other subprograms in this package. Note
-- that this procedure can be called several times.
function Clock return Duration;
pragma Inline (Clock);
-- Returns "absolute" time, represented as an offset relative to "the
-- Epoch", which is Jan 1, 1970 00:00:00 UTC on UNIX systems. This
-- implementation is affected by system's clock changes.
Relative : constant := 0;
Absolute_Calendar : constant := 1;
Absolute_RT : constant := 2;
-- Values for Mode call below. Note that the compiler (exp_ch9.adb) relies
-- on these values. So any change here must be reflected in corresponding
-- changes in the compiler.
procedure Timed_Delay (Time : Duration; Mode : Integer);
-- Implements the semantics of the delay statement when no tasking is used
-- in the application.
--
-- Mode is one of the three values above
--
-- Time is a relative or absolute duration value, depending on Mode.
--
-- Note that currently Ada.Real_Time always uses the tasking run time,
-- so this procedure should never be called with Mode set to Absolute_RT.
-- This may change in future or bare board implementations.
end System.OS_Primitives;
|
AdaCore/libadalang | Ada | 186 | adb | procedure Test is
type VolatileType is new Integer;
pragma Volatile (VolatileType);
VolatileVariable : Integer;
pragma Volatile (VolatileVariable);
begin
null;
end Test;
|
reznikmm/matreshka | Ada | 3,738 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.Constants;
package body Matreshka.ODF_Attributes.Text.Name is
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Text_Name_Node)
return League.Strings.Universal_String is
begin
return ODF.Constants.Name_Name;
end Get_Local_Name;
end Matreshka.ODF_Attributes.Text.Name;
|
twdroeger/ada-awa | Ada | 3,927 | adb | -----------------------------------------------------------------------
-- awa-storages-stores-databases -- Database store
-- Copyright (C) 2012, 2015, 2016 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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.Stream_IO;
with Util.Log.Loggers;
package body AWA.Storages.Stores.Databases is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Storages.Stores.Files");
-- Create a storage
procedure Create (Storage : in Database_Store;
Session : in out ADO.Sessions.Master_Session;
From : in AWA.Storages.Models.Storage_Ref'Class;
Into : in out AWA.Storages.Storage_File) is
begin
Storage.Tmp.Create (Session, From, Into);
end Create;
-- ------------------------------
-- Save the file represented by the `Path` variable into a store and associate that
-- content with the storage reference represented by `Into`.
-- ------------------------------
procedure Save (Storage : in Database_Store;
Session : in out ADO.Sessions.Master_Session;
Into : in out AWA.Storages.Models.Storage_Ref'Class;
Path : in String) is
pragma Unreferenced (Storage);
Store : AWA.Storages.Models.Storage_Data_Ref;
Blob : constant ADO.Blob_Ref := ADO.Create_Blob (Path);
begin
Log.Info ("Save database file {0}", Path);
Store.Set_Data (Blob);
Store.Save (Session);
Into.Set_File_Size (Natural (Blob.Value.Len));
Into.Set_Store_Data (Store);
end Save;
procedure Load (Storage : in Database_Store;
Session : in out ADO.Sessions.Session'Class;
From : in AWA.Storages.Models.Storage_Ref'Class;
Into : in out AWA.Storages.Storage_File) is
Store : AWA.Storages.Models.Storage_Data_Ref'Class := From.Get_Store_Data;
File : Ada.Streams.Stream_IO.File_Type;
DB : ADO.Sessions.Master_Session := ADO.Sessions.Master_Session (Session);
begin
Storage.Tmp.Create (DB, From, Into);
Log.Info ("Load database file {0} to {1}",
ADO.Identifier'Image (Store.Get_Id), Get_Path (Into));
Store.Load (Session, Store.Get_Id);
Ada.Streams.Stream_IO.Create (File => File,
Mode => Ada.Streams.Stream_IO.Out_File,
Name => Get_Path (Into));
Ada.Streams.Stream_IO.Write (File, Store.Get_Data.Value.Data);
Ada.Streams.Stream_IO.Close (File);
end Load;
-- ------------------------------
-- Delete the content associate with the storage represented by `From`.
-- ------------------------------
procedure Delete (Storage : in Database_Store;
Session : in out ADO.Sessions.Master_Session;
From : in out AWA.Storages.Models.Storage_Ref'Class) is
pragma Unreferenced (Storage);
Store : AWA.Storages.Models.Storage_Data_Ref'Class := From.Get_Store_Data;
begin
if not Store.Is_Null then
Log.Info ("Delete file {0}", ADO.Identifier'Image (From.Get_Id));
Store.Delete (Session);
end if;
end Delete;
end AWA.Storages.Stores.Databases;
|
charlie5/aIDE | Ada | 1,263 | ads | with
AdaM.a_Type.array_type,
gtk.Widget;
private
with
gtk.gEntry,
gtk.Box,
gtk.Label,
gtk.Button;
package aIDE.Editor.of_array_type
is
type Item is new Editor.item with private;
type View is access all Item'Class;
package Forge
is
function to_Editor (the_Target : in AdaM.a_Type.array_type.view) return View;
end Forge;
overriding
function top_Widget (Self : in Item) return gtk.Widget.Gtk_Widget;
private
use gtk.Button,
gtk.gEntry,
gtk.Label,
gtk.Box;
type Item is new Editor.item with
record
Target : AdaM.a_Type.array_type.view;
top_Box : gtk_Box;
type_name_Entry : Gtk_Entry;
index_Box : gtk_Box;
component_Box : gtk_Box;
-- index_type_Button : gtk_Button;
-- unconstrained_Label : gtk_Label;
-- constrained_Label : gtk_Label;
-- first_Entry : Gtk_Entry;
-- last_Entry : Gtk_Entry;
-- element_type_Button : gtk_Button;
rid_Button : gtk_Button;
end record;
overriding
procedure freshen (Self : in out Item);
end aIDE.Editor.of_array_type;
|
charlie5/aIDE | Ada | 3,286 | ads | with
AdaM.Entity,
Ada.Containers.Vectors,
Ada.Streams;
package AdaM.a_Pragma
is
type Item is new Entity.item with private;
-- View
--
type View is access all Item'Class;
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View);
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View);
for View'write use View_write;
for View'read use View_read;
-- Vector
--
package Vectors is new ada.Containers.Vectors (Positive, View);
subtype Vector is Vectors.Vector;
-- Forge
--
function new_Pragma (Name : in String := "") return a_Pragma.view;
procedure free (Self : in out a_Pragma.view);
procedure destruct (Self : in out a_Pragma.item);
-- Attributes
--
overriding
function Id (Self : access Item) return AdaM.Id;
overriding
function Name (Self : in Item) return Identifier;
procedure Name_is (Self : in out Item; Now : in String);
procedure add_Argument (Self : in out Item; Now : in String);
function Arguments (Self : in Item) return text_Lines;
overriding
function to_Source (Self : in Item) return text_Vectors.Vector;
type Kind is (all_calls_remote,
assert,
assertion_policy,
asynchronous,
atomic,
atomic_components,
attach_handler,
convention,
cpu,
default_storage_pool,
detect_blocking,
discard_names,
dispatching_domain,
elaborate,
elaborate_all,
elaborate_body,
export,
import,
independent,
independent_components,
inline,
inspection_point,
interrupt_handler,
interrupt_priority,
linker_options,
list,
locking_policy,
no_return,
normalize_scalars,
optimize,
pack,
page,
partition_elaboration_policy,
preelaborable_initialization,
preelaborate,
priority,
priority_specific_dispatching,
profile,
pure,
queuing_policy,
relative_deadline,
remote_call_interface,
remote_types,
restrictions,
reviewable,
shared_passive,
storage_size,
suppress,
task_dispatching_policy,
unchecked_union,
unsuppress,
volatile,
volatile_components,
assertion_policy_2);
private
type Item is new Entity.item with
record
Name : Text;
Arguments : text_Lines;
end record;
end AdaM.a_Pragma;
|
ellamosi/Ada_BMP_Library | Ada | 8,024 | adb | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Interfaces; use Interfaces;
with Bitmap.Memory_Mapped; use Bitmap.Memory_Mapped;
with System;
package body Bitmap.File_IO is
type Header (As_Array : Boolean := True) is record
case As_Array is
when True =>
Arr : UInt8_Array (1 .. 14);
when False =>
Signature : Integer_16;
Size : Integer_32; -- File size
Reserved1 : Integer_16;
Reserved2 : Integer_16;
Offset : Integer_32; -- Data offset
end case;
end record with Unchecked_Union, Pack, Size => 14 * 8;
type Info (As_Array : Boolean := True) is record
case As_Array is
when True =>
Arr : UInt8_Array (1 .. 40);
when False =>
Struct_Size : Integer_32;
Width : Integer_32; -- Image width in pixels
Height : Integer_32; -- Image hieght in pixels
Planes : Integer_16;
Pixel_Size : Integer_16; -- Bits per pixel
Compression : Integer_32; -- Zero means no compression
Image_Size : Integer_32; -- Size of the image data in UInt8s
PPMX : Integer_32; -- Pixels per meter in x led
PPMY : Integer_32; -- Pixels per meter in y led
Palette_Size : Integer_32; -- Number of colors
Important : Integer_32;
end case;
end record with Unchecked_Union, Pack, Size => 40 * 8;
-------------------
-- Read_BMP_File --
-------------------
function Read_BMP_File (File : File_Type) return not null Any_Bitmap_Buffer
is
function Allocate_Pixel_Data return System.Address;
procedure Read_Pixel_Data;
Input_Stream : Ada.Streams.Stream_IO.Stream_Access;
Hdr : Header;
Inf : Info;
Width : Integer;
Height : Integer;
BM : constant Any_Memory_Mapped_Bitmap_Buffer := new Memory_Mapped_Bitmap_Buffer;
RGB_Pix : Bitmap_Color;
Pix_In : UInt8_Array (1 .. 3);
-------------------------
-- Allocate_Pixel_Data --
-------------------------
function Allocate_Pixel_Data return System.Address is
type Pixel_Data is new Bitmap.UInt16_Array (1 .. Width * Height) with Pack;
type Pixel_Data_Access is access Pixel_Data;
Data : constant Pixel_Data_Access := new Pixel_Data;
begin
return Data.all'Address;
end Allocate_Pixel_Data;
---------------------
-- Read_Pixel_Data --
---------------------
procedure Read_Pixel_Data is
Row_Size : constant Integer_32 := Integer_32 (Width * 24);
Row_Padding : constant Integer_32 := (32 - (Row_Size mod 32)) mod 32 / 8;
Padding : UInt8_Array (1 .. Integer (Row_Padding));
begin
for Y in reverse 0 .. Height - 1 loop
for X in 0 .. Width - 1 loop
UInt8_Array'Read (Input_Stream, Pix_In);
RGB_Pix.Blue := Pix_In (1);
RGB_Pix.Green := Pix_In (2);
RGB_Pix.Red := Pix_In (3);
BM.Set_Pixel ((X, Y), RGB_Pix);
end loop;
UInt8_Array'Read (Input_Stream, Padding);
end loop;
end Read_Pixel_Data;
begin
Input_Stream := Ada.Streams.Stream_IO.Stream (File);
UInt8_Array'Read (Input_Stream, Hdr.Arr);
UInt8_Array'Read (Input_Stream, Inf.Arr);
Width := Integer (Inf.Width);
Height := Integer (Inf.Height);
BM.Actual_Width := Width;
BM.Actual_Height := Height;
BM.Actual_Color_Mode := RGB_565;
BM.Currently_Swapped := False;
BM.Addr := Allocate_Pixel_Data;
Set_Index (File, Positive_Count (Hdr.Offset + 1));
Read_Pixel_Data;
return Any_Bitmap_Buffer (BM);
end Read_BMP_File;
--------------------
-- Write_BMP_File --
--------------------
procedure Write_BMP_File (File : File_Type;
Bitmap : Bitmap_Buffer'Class)
is
Hdr : Header;
Inf : Info;
Row_Size : constant Integer_32 := Integer_32 (Bitmap.Width * 24);
Row_Padding : constant Integer_32 := (32 - (Row_Size mod 32)) mod 32 / 8;
Data_Size : constant Integer_32 := (Row_Size + Row_Padding) * Integer_32 (Bitmap.Height);
RGB_Pix : Bitmap_Color;
Pix_Out : UInt8_Array (1 .. 3);
Padding : constant UInt8_Array (1 .. Integer (Row_Padding)) := (others => 0);
Output_Stream : Ada.Streams.Stream_IO.Stream_Access;
begin
Hdr.Signature := 16#4D42#;
Hdr.Size := (Data_Size + 54) / 4;
Hdr.Reserved1 := 0;
Hdr.Reserved2 := 0;
Hdr.Offset := 54;
Inf.Struct_Size := 40;
Inf.Width := Integer_32 (Bitmap.Width);
Inf.Height := Integer_32 (Bitmap.Height);
Inf.Planes := 1;
Inf.Pixel_Size := 24;
Inf.Compression := 0;
Inf.Image_Size := Data_Size / 4;
Inf.PPMX := 2835;
Inf.PPMY := 2835;
Inf.Palette_Size := 0;
Inf.Important := 0;
Output_Stream := Ada.Streams.Stream_IO.Stream (File);
UInt8_Array'Write (Output_Stream, Hdr.Arr);
UInt8_Array'Write (Output_Stream, Inf.Arr);
for Y in reverse 0 .. Bitmap.Height - 1 loop
for X in 0 .. Bitmap.Width - 1 loop
RGB_Pix := Bitmap.Pixel ((X, Y));
Pix_Out (1) := RGB_Pix.Blue;
Pix_Out (2) := RGB_Pix.Green;
Pix_Out (3) := RGB_Pix.Red;
UInt8_Array'Write (Output_Stream, Pix_Out);
end loop;
UInt8_Array'Write (Output_Stream, Padding);
end loop;
end Write_BMP_File;
end Bitmap.File_IO;
|
amondnet/openapi-generator | Ada | 8,237 | ads | -- OpenAPI Petstore
-- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters.
--
-- The version of the OpenAPI document: 1.0.0
--
--
-- NOTE: This package is auto generated by OpenAPI-Generator 7.0.0-SNAPSHOT.
-- https://openapi-generator.tech
-- Do not edit the class manually.
with Swagger.Streams;
with Ada.Containers.Vectors;
package Samples.Petstore.Models is
pragma Style_Checks ("-bmrIu");
-- ------------------------------
-- An uploaded response
-- Describes the result of uploading an image resource
-- ------------------------------
type ApiResponse_Type is
record
Code : Swagger.Nullable_Integer;
P_Type : Swagger.Nullable_UString;
Message : Swagger.Nullable_UString;
end record;
package ApiResponse_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Samples.Petstore.Models.ApiResponse_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Samples.Petstore.Models.ApiResponse_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ApiResponse_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Samples.Petstore.Models.ApiResponse_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : in out ApiResponse_Type_Vectors.Vector);
-- ------------------------------
-- Pet category
-- A category for a pet
-- ------------------------------
type Category_Type is
record
Id : Swagger.Nullable_Long;
Name : Swagger.Nullable_UString;
end record;
package Category_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Samples.Petstore.Models.Category_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Samples.Petstore.Models.Category_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Category_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Samples.Petstore.Models.Category_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : in out Category_Type_Vectors.Vector);
-- ------------------------------
-- Pet Order
-- An order for a pets from the pet store
-- ------------------------------
type Order_Type is
record
Id : Swagger.Nullable_Long;
Pet_Id : Swagger.Nullable_Long;
Quantity : Swagger.Nullable_Integer;
Ship_Date : Swagger.Nullable_Date;
Status : Swagger.Nullable_UString;
Complete : Swagger.Nullable_Boolean;
end record;
package Order_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Samples.Petstore.Models.Order_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Samples.Petstore.Models.Order_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Order_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Samples.Petstore.Models.Order_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : in out Order_Type_Vectors.Vector);
-- ------------------------------
-- Pet Tag
-- A tag for a pet
-- ------------------------------
type Tag_Type is
record
Id : Swagger.Nullable_Long;
Name : Swagger.Nullable_UString;
end record;
package Tag_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Samples.Petstore.Models.Tag_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Samples.Petstore.Models.Tag_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Tag_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Samples.Petstore.Models.Tag_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : in out Tag_Type_Vectors.Vector);
-- ------------------------------
-- a User
-- A User who is purchasing from the pet store
-- ------------------------------
type User_Type is
record
Id : Swagger.Nullable_Long;
Username : Swagger.Nullable_UString;
First_Name : Swagger.Nullable_UString;
Last_Name : Swagger.Nullable_UString;
Email : Swagger.Nullable_UString;
Password : Swagger.Nullable_UString;
Phone : Swagger.Nullable_UString;
User_Status : Swagger.Nullable_Integer;
end record;
package User_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Samples.Petstore.Models.User_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Samples.Petstore.Models.User_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in User_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Samples.Petstore.Models.User_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : in out User_Type_Vectors.Vector);
-- ------------------------------
-- a Pet
-- A pet for sale in the pet store
-- ------------------------------
type Pet_Type is
record
Id : Swagger.Nullable_Long;
Category : Samples.Petstore.Models.Category_Type;
Name : Swagger.UString;
Photo_Urls : Swagger.UString_Vectors.Vector;
Tags : Samples.Petstore.Models.Tag_Type_Vectors.Vector;
Status : Swagger.Nullable_UString;
end record;
package Pet_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Samples.Petstore.Models.Pet_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Samples.Petstore.Models.Pet_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Pet_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Samples.Petstore.Models.Pet_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : in out Pet_Type_Vectors.Vector);
end Samples.Petstore.Models;
|
AdaCore/libadalang | Ada | 367 | adb | procedure Test is
package Pkg is
type T is tagged null record;
procedure Foo (X : T) is null;
end Pkg;
package Der is
type U is new Pkg.T with null record;
end Der;
X : Der.U;
begin
Der.Foo (X);
--% called_subp=node.f_call.p_referenced_decl()
--% called_subp.p_subp_spec_or_null().p_primitive_subp_tagged_type()
end Test;
|
AdaCore/libadalang | Ada | 62 | ads | with Foo;
package Foo.Bar is
end Foo.Bar;
pragma Test_Block;
|
RREE/ada-util | Ada | 7,586 | adb | -----------------------------------------------------------------------
-- util-serialize-io -- IO Drivers for serialization
-- Copyright (C) 2010, 2011, 2016, 2017 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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.Streams.Files;
with Ada.Streams;
with Ada.Streams.Stream_IO;
with Ada.Exceptions;
with Ada.IO_Exceptions;
package body Util.Serialize.IO is
-- use Util.Log;
use type Util.Log.Loggers.Logger_Access;
-- The logger'
Log : aliased constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Util.Serialize.IO",
Util.Log.WARN_LEVEL);
procedure Write_Attribute (Stream : in out Output_Stream'Class;
Name : in String;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
begin
Stream.Write_Attribute (Name, Ada.Strings.Unbounded.To_String (Value));
end Write_Attribute;
procedure Write_Entity (Stream : in out Output_Stream'Class;
Name : in String;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
begin
Stream.Write_Entity (Name, Ada.Strings.Unbounded.To_String (Value));
end Write_Entity;
procedure Write_Entity (Stream : in out Output_Stream'Class;
Name : in String;
Value : in Util.Nullables.Nullable_String) is
begin
if Value.Is_Null then
Stream.Write_Null_Entity (Name);
else
Stream.Write_Entity (Name, Value.Value);
end if;
end Write_Entity;
procedure Write_Entity (Stream : in out Output_Stream'Class;
Name : in String;
Value : in Util.Nullables.Nullable_Time) is
begin
if Value.Is_Null then
Stream.Write_Null_Entity (Name);
else
Stream.Write_Entity (Name, Value.Value);
end if;
end Write_Entity;
procedure Write_Entity (Stream : in out Output_Stream'Class;
Name : in String;
Value : in Util.Nullables.Nullable_Boolean) is
begin
if Value.Is_Null then
Stream.Write_Null_Entity (Name);
else
Stream.Write_Entity (Name, Value.Value);
end if;
end Write_Entity;
procedure Write_Entity (Stream : in out Output_Stream'Class;
Name : in String;
Value : in Util.Nullables.Nullable_Integer) is
begin
if Value.Is_Null then
Stream.Write_Null_Entity (Name);
else
Stream.Write_Entity (Name, Value.Value);
end if;
end Write_Entity;
procedure Write_Entity (Stream : in out Output_Stream'Class;
Name : in String;
Value : in Util.Nullables.Nullable_Long) is
begin
if Value.Is_Null then
Stream.Write_Null_Entity (Name);
else
Stream.Write_Entity (Name, Integer (Value.Value));
end if;
end Write_Entity;
-- ------------------------------
-- Read the file and parse it using the JSON parser.
-- ------------------------------
procedure Parse (Handler : in out Parser;
File : in String;
Sink : in out Reader'Class) is
Stream : aliased Util.Streams.Files.File_Stream;
Buffer : Util.Streams.Buffered.Input_Buffer_Stream;
begin
if Handler.Error_Logger = null then
Handler.Error_Logger := Log'Access;
end if;
Handler.Error_Logger.Info ("Reading file {0}", File);
Handler.File := Ada.Strings.Unbounded.To_Unbounded_String (File);
Buffer.Initialize (Input => Stream'Unchecked_Access,
Size => 1024);
Stream.Open (Mode => Ada.Streams.Stream_IO.In_File, Name => File);
Sink.Start_Document;
Parser'Class (Handler).Parse (Buffer, Sink);
exception
-- when Util.Serialize.Mappers.Field_Fatal_Error =>
-- null;
when Ada.IO_Exceptions.Name_Error =>
Parser'Class (Handler).Error ("File '" & File & "' does not exist.");
when E : others =>
if not Handler.Error_Flag then
Parser'Class (Handler).Error ("Exception " & Ada.Exceptions.Exception_Name (E));
end if;
end Parse;
-- ------------------------------
-- Parse the content string.
-- ------------------------------
procedure Parse_String (Handler : in out Parser;
Content : in String;
Sink : in out Reader'Class) is
Stream : aliased Util.Streams.Buffered.Input_Buffer_Stream;
begin
if Handler.Error_Logger = null then
Handler.Error_Logger := Log'Access;
end if;
Handler.File := Ada.Strings.Unbounded.To_Unbounded_String ("<inline>");
Stream.Initialize (Content => Content);
Sink.Start_Document;
Parser'Class (Handler).Parse (Stream, Sink);
exception
-- when Util.Serialize.Mappers.Field_Fatal_Error =>
-- null;
when E : others =>
if not Handler.Error_Flag then
Parser'Class (Handler).Error ("Exception " & Ada.Exceptions.Exception_Name (E));
end if;
end Parse_String;
-- ------------------------------
-- Returns true if the <b>Parse</b> operation detected at least one error.
-- ------------------------------
function Has_Error (Handler : in Parser) return Boolean is
begin
return Handler.Error_Flag;
end Has_Error;
-- ------------------------------
-- Set the error logger to report messages while parsing and reading the input file.
-- ------------------------------
procedure Set_Logger (Handler : in out Parser;
Logger : in Util.Log.Loggers.Logger_Access) is
begin
Handler.Error_Logger := Logger;
end Set_Logger;
-- ------------------------------
-- Get the current location (file and line) to report an error message.
-- ------------------------------
function Get_Location (Handler : in Parser) return String is
begin
return Ada.Strings.Unbounded.To_String (Handler.File);
end Get_Location;
-- ------------------------------
-- Report an error while parsing the input stream. The error message will be reported
-- on the logger associated with the parser. The parser will be set as in error so that
-- the <b>Has_Error</b> function will return True after parsing the whole file.
-- ------------------------------
procedure Error (Handler : in out Parser;
Message : in String) is
begin
Handler.Error_Logger.Error ("{0}: {1}",
Parser'Class (Handler).Get_Location,
Message);
Handler.Error_Flag := True;
end Error;
end Util.Serialize.IO;
|
DrenfongWong/tkm-rpc | Ada | 299 | ads | with Tkmrpc.Request;
with Tkmrpc.Response;
package Tkmrpc.Operation_Handlers.Ike.Isa_Skip_Create_First is
procedure Handle (Req : Request.Data_Type; Res : out Response.Data_Type);
-- Handler for the isa_skip_create_first operation.
end Tkmrpc.Operation_Handlers.Ike.Isa_Skip_Create_First;
|
charlie5/lace | Ada | 1,471 | adb |
package body lace.Dice
is
function Image (Self : in Item'Class) return String
is
roll_count_Image : constant String := Integer'Image (self.roll_Count);
function side_count_Image return String
is
begin
if Self.side_Count = 6 then
return "";
else
declare
the_Image : constant String := Integer'Image (Self.side_Count);
begin
return the_Image (the_Image'First + 1 .. the_Image'Last);
end;
end if;
end side_count_Image;
function modifier_Image return String
is
begin
if self.Modifier = 0 then
return "";
else
declare
the_Image : String := integer'Image (self.Modifier);
begin
if self.Modifier > 0 then
the_Image (the_Image'First) := '+';
end if;
return the_Image;
end;
end if;
end modifier_Image;
begin
return roll_count_Image (roll_count_Image'First + 1 .. roll_count_Image'Last)
& "d"
& side_count_Image
& modifier_Image;
end Image;
function Extent (Self : in Item'Class) return an_Extent
is
begin
return (min => self.roll_Count + self.Modifier,
max => self.roll_Count * self.side_Count + self.Modifier);
end Extent;
end lace.Dice;
|
AdaCore/training_material | Ada | 1,748 | ads | pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
package avx512ifmavlintrin_h is
-- Copyright (C) 2013-2017 Free Software Foundation, Inc.
-- This file is part of GCC.
-- GCC 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, or (at your option)
-- any later version.
-- GCC 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.
-- 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/>.
-- skipped func _mm_madd52lo_epu64
-- skipped func _mm_madd52hi_epu64
-- skipped func _mm256_madd52lo_epu64
-- skipped func _mm256_madd52hi_epu64
-- skipped func _mm_mask_madd52lo_epu64
-- skipped func _mm_mask_madd52hi_epu64
-- skipped func _mm256_mask_madd52lo_epu64
-- skipped func _mm256_mask_madd52hi_epu64
-- skipped func _mm_maskz_madd52lo_epu64
-- skipped func _mm_maskz_madd52hi_epu64
-- skipped func _mm256_maskz_madd52lo_epu64
-- skipped func _mm256_maskz_madd52hi_epu64
end avx512ifmavlintrin_h;
|
reznikmm/matreshka | Ada | 4,075 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015-2017, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Asis;
with Engines.Contexts;
with League.Strings;
package Properties.Expressions.Record_Component_Association is
function Associations
(Engine : access Engines.Contexts.Context;
Element : Asis.Association;
Name : Engines.Text_Property)
return League.Strings.Universal_String;
function Bounds
(Engine : access Engines.Contexts.Context;
Element : Asis.Definition;
Name : Engines.Text_Property) return League.Strings.Universal_String;
function Code
(Engine : access Engines.Contexts.Context;
Element : Asis.Association;
Name : Engines.Text_Property) return League.Strings.Universal_String;
end Properties.Expressions.Record_Component_Association;
|
stcarrez/ada-servlet | Ada | 1,634 | ads | -----------------------------------------------------------------------
-- Filters Tests - Unit tests for Servlet.Filters
-- Copyright (C) 2015, 2022 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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.
-----------------------------------------------------------------------
package Servlet.Filters.Tests is
-- A simple filter that counts the number of times it is traversed.
type Test_Filter is new Filter with record
Count : access Integer;
Counter : aliased Integer := 0;
end record;
-- Increment the counter each time Do_Filter is called.
overriding
procedure Do_Filter (F : in Test_Filter;
Request : in out Requests.Request'Class;
Response : in out Responses.Response'Class;
Chain : in out Servlet.Core.Filter_Chain);
-- Initialize the test filter.
overriding
procedure Initialize (Server : in out Test_Filter;
Config : in Servlet.Core.Filter_Config);
end Servlet.Filters.Tests;
|
vaginessa/ardoducky | Ada | 229 | ads | # Turns capslock off
ifj caps turn_off
goto off_done
:turn_off
toggle caps
:off_done
# Turn light on depending on caps state
:light_off
light off
goto loop
:light_on
light on
:loop
wait 100
ifj caps light_on
goto light_off
|
HeisenbugLtd/cache-sim | Ada | 1,492 | adb | ------------------------------------------------------------------------------
-- Copyright (C) 2012-2020 by Heisenbug Ltd.
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
package body Caches.Access_Patterns.Linear is
-----------------------------------------------------------------------------
-- Create
-----------------------------------------------------------------------------
function Create (Length : in Bytes;
Step : in Bytes := 1) return Linear_Pattern is
begin
return Linear_Pattern'(Length => Length,
Count => 0,
Start_Address => 0,
Step => Address (Step));
end Create;
-----------------------------------------------------------------------------
-- Next
-----------------------------------------------------------------------------
function Next (This_Ptr : access Linear_Pattern) return Address is
This : Linear_Pattern renames This_Ptr.all;
begin
This.Count := This.Count + 1;
return This.Start_Address + Address (This.Count - 1) * This.Step;
end Next;
end Caches.Access_Patterns.Linear;
|
zhmu/ananas | Ada | 83,816 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C S T A N D --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, 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. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Csets; use Csets;
with Debug; use Debug;
with Einfo; use Einfo;
with Einfo.Entities; use Einfo.Entities;
with Einfo.Utils; use Einfo.Utils;
with Elists; use Elists;
with Layout; use Layout;
with Namet; use Namet;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
with Output; use Output;
with Set_Targ; use Set_Targ;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
with Sem_Mech; use Sem_Mech;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Sinfo.Nodes; use Sinfo.Nodes;
with Sinfo.Utils; use Sinfo.Utils;
with Snames; use Snames;
with Stand; use Stand;
with Uintp; use Uintp;
with Urealp; use Urealp;
package body CStand is
Stloc : Source_Ptr renames Standard_Location;
Staloc : Source_Ptr renames Standard_ASCII_Location;
-- Standard abbreviations used throughout this package
Back_End_Float_Types : Elist_Id := No_Elist;
-- List used for any floating point supported by the back end. This needs
-- to be at the library level, because the call back procedures retrieving
-- this information are at that level.
-----------------------
-- Local Subprograms --
-----------------------
procedure Build_Float_Type
(E : Entity_Id;
Digs : Int;
Rep : Float_Rep_Kind;
Siz : Int;
Align : Int);
-- Procedure to build standard predefined float base type. The first
-- parameter is the entity for the type. The second parameter is the
-- digits value. The third parameter indicates the representation to
-- be used for the type. The fourth parameter is the size in bits.
-- The fifth parameter is the alignment in storage units. Each type
-- is added to the list of predefined floating point types.
--
-- Note that both RM_Size and Esize are set to the specified size, i.e.
-- we do not set the RM_Size to the precision passed by the back end.
-- This is consistent with the semantics of 'Size specified in the RM
-- because we cannot pack components of the type tighter than this size.
procedure Build_Signed_Integer_Type (E : Entity_Id; Siz : Nat);
-- Procedure to build standard predefined signed integer subtype. The
-- first parameter is the entity for the subtype. The second parameter
-- is the size in bits. The corresponding base type is not built by
-- this routine but instead must be built by the caller where needed.
procedure Build_Unsigned_Integer_Type (Uns : Entity_Id; Siz : Nat);
-- Procedure to build standard predefined unsigned integer subtype. These
-- subtypes are not user visible, but they are used internally. The first
-- parameter is the entity for the subtype. The second parameter is the
-- size in bits.
procedure Copy_Float_Type (To : Entity_Id; From : Entity_Id);
-- Build a floating point type, copying representation details from From.
-- This is used to create predefined floating point types based on
-- available types in the back end.
procedure Create_Operators;
-- Make entries for each of the predefined operators in Standard
procedure Create_Unconstrained_Base_Type
(E : Entity_Id;
K : Entity_Kind);
-- The predefined signed integer types are constrained subtypes which
-- must have a corresponding unconstrained base type. This type is almost
-- useless. The only place it has semantics is Subtypes_Statically_Match.
-- Consequently, we arrange for it to be identical apart from the setting
-- of the constrained bit. This routine takes an entity E for the Type,
-- copies it to estabish the base type, then resets the Ekind of the
-- original entity to K (the Ekind for the subtype). The Etype field of
-- E is set by the call (to point to the created base type entity), and
-- also the Is_Constrained flag of E is set.
--
-- To understand the exact requirement for this, see RM 3.5.4(11) which
-- makes it clear that Integer, for example, is constrained, with the
-- constraint bounds matching the bounds of the (unconstrained) base
-- type. The point is that Integer and Integer'Base have identical
-- bounds, but do not statically match, since a subtype with constraints
-- never matches a subtype with no constraints.
function Find_Back_End_Float_Type (Name : String) return Entity_Id;
-- Return the first float type in Back_End_Float_Types with the given name.
-- Names of entities in back end types, are either type names of C
-- predefined types (all lower case), or mode names (upper case).
-- These are not generally valid identifier names.
function Identifier_For (S : Standard_Entity_Type) return Node_Id;
-- Returns an identifier node with the same name as the defining identifier
-- corresponding to the given Standard_Entity_Type value.
procedure Make_Aliased_Component
(Rec : Entity_Id;
Typ : Entity_Id;
Nam : String);
-- Build an aliased record component with the given type and name,
-- and append to the list of components of Rec.
function Make_Formal (Typ : Entity_Id; Nam : String) return Entity_Id;
-- Construct entity for subprogram formal with given name and type
function Make_Integer (V : Uint) return Node_Id;
-- Builds integer literal with given value
function New_Operator (Op : Name_Id; Typ : Entity_Id) return Entity_Id;
-- Build entity for standard operator with given name and type
function New_Standard_Entity return Entity_Id;
-- Builds a new entity for Standard
function New_Standard_Entity (Nam : String) return Entity_Id;
-- Builds a new entity for Standard with Nkind = N_Defining_Identifier,
-- and Chars of this defining identifier set to the given string Nam.
procedure Print_Standard;
-- Print representation of package Standard if switch set
procedure Register_Float_Type
(Name : String;
Digs : Positive;
Float_Rep : Float_Rep_Kind;
Precision : Positive;
Size : Positive;
Alignment : Natural);
-- Registers a single back end floating-point type (from FPT_Mode_Table in
-- Set_Targ). This will create a predefined floating-point base type for
-- one of the floating point types reported by the back end, and add it
-- to the list of predefined float types. Name is the name of the type
-- as a normal format (non-null-terminated) string. Digs is the number of
-- digits, which is always non-zero, since non-floating-point types were
-- filtered out earlier. Float_Rep indicates the kind of floating-point
-- type, and Precision, Size and Alignment are the precision, size and
-- alignment in bits.
procedure Set_Integer_Bounds
(Id : Entity_Id;
Typ : Entity_Id;
Lb : Uint;
Hb : Uint);
-- Procedure to set bounds for integer type or subtype. Id is the entity
-- whose bounds and type are to be set. The Typ parameter is the Etype
-- value for the entity (which will be the same as Id for all predefined
-- integer base types. The third and fourth parameters are the bounds.
----------------------
-- Build_Float_Type --
----------------------
procedure Build_Float_Type
(E : Entity_Id;
Digs : Int;
Rep : Float_Rep_Kind;
Siz : Int;
Align : Int)
is
begin
Set_Type_Definition (Parent (E),
Make_Floating_Point_Definition (Stloc,
Digits_Expression => Make_Integer (UI_From_Int (Digs))));
Mutate_Ekind (E, E_Floating_Point_Type);
Set_Etype (E, E);
Set_Digits_Value (E, UI_From_Int (Digs));
Set_Float_Rep (E, Rep);
Init_Size (E, Siz);
Set_Elem_Alignment (E, Align);
Set_Float_Bounds (E);
Set_Is_Frozen (E);
Set_Is_Public (E);
Set_Size_Known_At_Compile_Time (E);
end Build_Float_Type;
------------------------------
-- Find_Back_End_Float_Type --
------------------------------
function Find_Back_End_Float_Type (Name : String) return Entity_Id is
N : Elmt_Id;
begin
N := First_Elmt (Back_End_Float_Types);
while Present (N) and then Get_Name_String (Chars (Node (N))) /= Name
loop
Next_Elmt (N);
end loop;
return Node (N);
end Find_Back_End_Float_Type;
-------------------------------
-- Build_Signed_Integer_Type --
-------------------------------
procedure Build_Signed_Integer_Type (E : Entity_Id; Siz : Nat) is
U2Siz1 : constant Uint := 2 ** (Siz - 1);
Lbound : constant Uint := -U2Siz1;
Ubound : constant Uint := U2Siz1 - 1;
begin
Set_Type_Definition (Parent (E),
Make_Signed_Integer_Type_Definition (Stloc,
Low_Bound => Make_Integer (Lbound),
High_Bound => Make_Integer (Ubound)));
Mutate_Ekind (E, E_Signed_Integer_Type);
Set_Etype (E, E);
Init_Size (E, Siz);
Set_Elem_Alignment (E);
Set_Integer_Bounds (E, E, Lbound, Ubound);
Set_Is_Frozen (E);
Set_Is_Public (E);
Set_Is_Known_Valid (E);
Set_Size_Known_At_Compile_Time (E);
end Build_Signed_Integer_Type;
---------------------------------
-- Build_Unsigned_Integer_Type --
---------------------------------
procedure Build_Unsigned_Integer_Type
(Uns : Entity_Id;
Siz : Nat)
is
Decl : constant Node_Id := New_Node (N_Full_Type_Declaration, Stloc);
R_Node : constant Node_Id := New_Node (N_Range, Stloc);
begin
Set_Defining_Identifier (Decl, Uns);
Mutate_Ekind (Uns, E_Modular_Integer_Type);
Set_Scope (Uns, Standard_Standard);
Set_Etype (Uns, Uns);
Init_Size (Uns, Siz);
Set_Elem_Alignment (Uns);
Set_Modulus (Uns, Uint_2 ** Siz);
Set_Is_Unsigned_Type (Uns);
Set_Size_Known_At_Compile_Time (Uns);
Set_Is_Known_Valid (Uns, True);
Set_Low_Bound (R_Node, Make_Integer (Uint_0));
Set_High_Bound (R_Node, Make_Integer (Modulus (Uns) - 1));
Set_Etype (Low_Bound (R_Node), Uns);
Set_Etype (High_Bound (R_Node), Uns);
Set_Scalar_Range (Uns, R_Node);
end Build_Unsigned_Integer_Type;
---------------------
-- Copy_Float_Type --
---------------------
procedure Copy_Float_Type (To : Entity_Id; From : Entity_Id) is
begin
Build_Float_Type
(To, UI_To_Int (Digits_Value (From)), Float_Rep (From),
UI_To_Int (Esize (From)), UI_To_Int (Alignment (From)));
end Copy_Float_Type;
----------------------
-- Create_Operators --
----------------------
-- Each operator has an abbreviated signature. The formals have the names
-- LEFT and RIGHT. Their types are not actually used for resolution.
procedure Create_Operators is
Op_Node : Entity_Id;
-- The following tables define the binary and unary operators and their
-- corresponding result type.
Binary_Ops : constant array (S_Binary_Ops) of Name_Id :=
-- There is one entry here for each binary operator, except for the
-- case of concatenation, where there are three entries, one for a
-- String result, one for Wide_String, and one for Wide_Wide_String.
(Name_Op_Add,
Name_Op_And,
Name_Op_Concat,
Name_Op_Concat,
Name_Op_Concat,
Name_Op_Divide,
Name_Op_Eq,
Name_Op_Expon,
Name_Op_Ge,
Name_Op_Gt,
Name_Op_Le,
Name_Op_Lt,
Name_Op_Mod,
Name_Op_Multiply,
Name_Op_Ne,
Name_Op_Or,
Name_Op_Rem,
Name_Op_Subtract,
Name_Op_Xor);
Bin_Op_Types : constant array (S_Binary_Ops) of Entity_Id :=
-- This table has the corresponding result types. The entries are
-- ordered so they correspond to the Binary_Ops array above.
(Universal_Integer, -- Add
Standard_Boolean, -- And
Standard_String, -- Concat (String)
Standard_Wide_String, -- Concat (Wide_String)
Standard_Wide_Wide_String, -- Concat (Wide_Wide_String)
Universal_Integer, -- Divide
Standard_Boolean, -- Eq
Universal_Integer, -- Expon
Standard_Boolean, -- Ge
Standard_Boolean, -- Gt
Standard_Boolean, -- Le
Standard_Boolean, -- Lt
Universal_Integer, -- Mod
Universal_Integer, -- Multiply
Standard_Boolean, -- Ne
Standard_Boolean, -- Or
Universal_Integer, -- Rem
Universal_Integer, -- Subtract
Standard_Boolean); -- Xor
Unary_Ops : constant array (S_Unary_Ops) of Name_Id :=
-- There is one entry here for each unary operator
(Name_Op_Abs,
Name_Op_Subtract,
Name_Op_Not,
Name_Op_Add);
Unary_Op_Types : constant array (S_Unary_Ops) of Entity_Id :=
-- This table has the corresponding result types. The entries are
-- ordered so they correspond to the Unary_Ops array above.
(Universal_Integer, -- Abs
Universal_Integer, -- Subtract
Standard_Boolean, -- Not
Universal_Integer); -- Add
begin
for J in S_Binary_Ops loop
Op_Node := New_Operator (Binary_Ops (J), Bin_Op_Types (J));
SE (J) := Op_Node;
Append_Entity (Make_Formal (Any_Type, "LEFT"), Op_Node);
Append_Entity (Make_Formal (Any_Type, "RIGHT"), Op_Node);
end loop;
for J in S_Unary_Ops loop
Op_Node := New_Operator (Unary_Ops (J), Unary_Op_Types (J));
SE (J) := Op_Node;
Append_Entity (Make_Formal (Any_Type, "RIGHT"), Op_Node);
end loop;
-- For concatenation, we create a separate operator for each
-- array type. This simplifies the resolution of the component-
-- component concatenation operation. In Standard, we set the types
-- of the formals for string, wide [wide]_string, concatenations.
Set_Etype (First_Entity (Standard_Op_Concat), Standard_String);
Set_Etype (Last_Entity (Standard_Op_Concat), Standard_String);
Set_Etype (First_Entity (Standard_Op_Concatw), Standard_Wide_String);
Set_Etype (Last_Entity (Standard_Op_Concatw), Standard_Wide_String);
Set_Etype (First_Entity (Standard_Op_Concatww),
Standard_Wide_Wide_String);
Set_Etype (Last_Entity (Standard_Op_Concatww),
Standard_Wide_Wide_String);
end Create_Operators;
---------------------
-- Create_Standard --
---------------------
-- The tree for the package Standard is prefixed to all compilations.
-- Several entities required by semantic analysis are denoted by global
-- variables that are initialized to point to the corresponding occurrences
-- in Standard. The visible entities of Standard are created here. Special
-- entities maybe created here as well or may be created from the semantics
-- module. By not adding them to the Decls list of Standard they will not
-- be visible to Ada programs.
procedure Create_Standard is
Decl_S : constant List_Id := New_List;
-- List of declarations in Standard
Decl_A : constant List_Id := New_List;
-- List of declarations in ASCII
Decl : Node_Id;
Pspec : Node_Id;
Tdef_Node : Node_Id;
Ident_Node : Node_Id;
Ccode : Char_Code;
E_Id : Entity_Id;
R_Node : Node_Id;
B_Node : Node_Id;
procedure Build_Exception (S : Standard_Entity_Type);
-- Procedure to declare given entity as an exception
procedure Create_Back_End_Float_Types;
-- Initialize the Back_End_Float_Types list by having the back end
-- enumerate all available types and building type entities for them.
procedure Create_Float_Types;
-- Creates entities for all predefined floating point types, and
-- adds these to the Predefined_Float_Types list in package Standard.
procedure Make_Dummy_Index (E : Entity_Id);
-- Called to provide a dummy index field value for Any_Array/Any_String
procedure Pack_String_Type (String_Type : Entity_Id);
-- Generate proper tree for pragma Pack that applies to given type, and
-- mark type as having the pragma.
---------------------
-- Build_Exception --
---------------------
procedure Build_Exception (S : Standard_Entity_Type) is
begin
Mutate_Ekind (Standard_Entity (S), E_Exception);
Set_Etype (Standard_Entity (S), Standard_Exception_Type);
Set_Is_Public (Standard_Entity (S), True);
Decl :=
Make_Exception_Declaration (Stloc,
Defining_Identifier => Standard_Entity (S));
Append (Decl, Decl_S);
end Build_Exception;
---------------------------------
-- Create_Back_End_Float_Types --
---------------------------------
procedure Create_Back_End_Float_Types is
begin
for J in 1 .. Num_FPT_Modes loop
declare
E : FPT_Mode_Entry renames FPT_Mode_Table (J);
begin
Register_Float_Type
(E.NAME.all, E.DIGS, E.FLOAT_REP, E.PRECISION, E.SIZE,
E.ALIGNMENT);
end;
end loop;
end Create_Back_End_Float_Types;
------------------------
-- Create_Float_Types --
------------------------
procedure Create_Float_Types is
begin
-- Create type definition nodes for predefined float types
Copy_Float_Type
(Standard_Short_Float,
Find_Back_End_Float_Type (C_Type_For (S_Short_Float)));
Set_Is_Implementation_Defined (Standard_Short_Float);
Copy_Float_Type (Standard_Float, Standard_Short_Float);
Copy_Float_Type
(Standard_Long_Float,
Find_Back_End_Float_Type (C_Type_For (S_Long_Float)));
Copy_Float_Type
(Standard_Long_Long_Float,
Find_Back_End_Float_Type (C_Type_For (S_Long_Long_Float)));
Set_Is_Implementation_Defined (Standard_Long_Long_Float);
Predefined_Float_Types := New_Elmt_List;
Append_Elmt (Standard_Short_Float, Predefined_Float_Types);
Append_Elmt (Standard_Float, Predefined_Float_Types);
Append_Elmt (Standard_Long_Float, Predefined_Float_Types);
Append_Elmt (Standard_Long_Long_Float, Predefined_Float_Types);
-- Any other back end types are appended at the end of the list of
-- predefined float types, and will only be selected if the none of
-- the types in Standard is suitable, or if a specific named type is
-- requested through a pragma Import.
while not Is_Empty_Elmt_List (Back_End_Float_Types) loop
declare
E : constant Elmt_Id := First_Elmt (Back_End_Float_Types);
begin
Append_Elmt (Node (E), To => Predefined_Float_Types);
Remove_Elmt (Back_End_Float_Types, E);
end;
end loop;
end Create_Float_Types;
----------------------
-- Make_Dummy_Index --
----------------------
procedure Make_Dummy_Index (E : Entity_Id) is
Index : constant Node_Id :=
Make_Range (Sloc (E),
Low_Bound => Make_Integer (Uint_0),
High_Bound => Make_Integer (Uint_2 ** Standard_Integer_Size));
-- Make sure Index is a list as required, so Next_Index is Empty
Dummy : constant List_Id := New_List (Index);
begin
Set_Etype (Index, Standard_Integer);
Set_First_Index (E, Index);
end Make_Dummy_Index;
----------------------
-- Pack_String_Type --
----------------------
procedure Pack_String_Type (String_Type : Entity_Id) is
Prag : constant Node_Id :=
Make_Pragma (Stloc,
Chars => Name_Pack,
Pragma_Argument_Associations =>
New_List (
Make_Pragma_Argument_Association (Stloc,
Expression => New_Occurrence_Of (String_Type, Stloc))));
begin
Append (Prag, Decl_S);
Record_Rep_Item (String_Type, Prag);
Set_Has_Pragma_Pack (String_Type, True);
end Pack_String_Type;
Char_Size : constant Unat := UI_From_Int (Standard_Character_Size);
-- Start of processing for Create_Standard
begin
-- First step is to create defining identifiers for each entity
for S in Standard_Entity_Type loop
declare
S_Name : constant String := Standard_Entity_Type'Image (S);
-- Name of entity (note we skip S_ at the start)
Ident_Node : Node_Id;
-- Defining identifier node
begin
Ident_Node := New_Standard_Entity (S_Name (3 .. S_Name'Length));
Standard_Entity (S) := Ident_Node;
end;
end loop;
-- Create package declaration node for package Standard
Standard_Package_Node := New_Node (N_Package_Declaration, Stloc);
Pspec := New_Node (N_Package_Specification, Stloc);
Set_Specification (Standard_Package_Node, Pspec);
Set_Defining_Unit_Name (Pspec, Standard_Standard);
Set_Visible_Declarations (Pspec, Decl_S);
Mutate_Ekind (Standard_Standard, E_Package);
Set_Is_Pure (Standard_Standard);
Set_Is_Compilation_Unit (Standard_Standard);
-- Create type/subtype declaration nodes for standard types
for S in S_Types loop
-- Subtype declaration case
if S = S_Natural or else S = S_Positive then
Decl := New_Node (N_Subtype_Declaration, Stloc);
Set_Subtype_Indication (Decl,
New_Occurrence_Of (Standard_Integer, Stloc));
-- Full type declaration case
else
Decl := New_Node (N_Full_Type_Declaration, Stloc);
end if;
Set_Is_Frozen (Standard_Entity (S));
Set_Is_Public (Standard_Entity (S));
Set_Defining_Identifier (Decl, Standard_Entity (S));
Append (Decl, Decl_S);
end loop;
Create_Back_End_Float_Types;
-- Create type definition node for type Boolean. The Size is set to
-- 1 as required by Ada 95 and current ARG interpretations for Ada/83.
-- Note: Object_Size of Boolean is 8. This means that we do NOT in
-- general know that Boolean variables have valid values, so we do
-- not set the Is_Known_Valid flag.
Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
Set_Literals (Tdef_Node, New_List);
Append (Standard_False, Literals (Tdef_Node));
Append (Standard_True, Literals (Tdef_Node));
Set_Type_Definition (Parent (Standard_Boolean), Tdef_Node);
Mutate_Ekind (Standard_Boolean, E_Enumeration_Type);
Set_First_Literal (Standard_Boolean, Standard_False);
Set_Etype (Standard_Boolean, Standard_Boolean);
Set_Esize (Standard_Boolean, Char_Size);
Set_RM_Size (Standard_Boolean, Uint_1);
Set_Elem_Alignment (Standard_Boolean);
Set_Is_Unsigned_Type (Standard_Boolean);
Set_Size_Known_At_Compile_Time (Standard_Boolean);
Set_Has_Pragma_Ordered (Standard_Boolean);
Mutate_Ekind (Standard_True, E_Enumeration_Literal);
Set_Etype (Standard_True, Standard_Boolean);
Set_Enumeration_Pos (Standard_True, Uint_1);
Set_Enumeration_Rep (Standard_True, Uint_1);
Set_Is_Known_Valid (Standard_True, True);
Mutate_Ekind (Standard_False, E_Enumeration_Literal);
Set_Etype (Standard_False, Standard_Boolean);
Set_Enumeration_Pos (Standard_False, Uint_0);
Set_Enumeration_Rep (Standard_False, Uint_0);
Set_Is_Known_Valid (Standard_False, True);
-- For the bounds of Boolean, we create a range node corresponding to
-- range False .. True
-- where the occurrences of the literals must point to the
-- corresponding definition.
R_Node := New_Node (N_Range, Stloc);
B_Node := New_Node (N_Identifier, Stloc);
Set_Chars (B_Node, Chars (Standard_False));
Set_Entity (B_Node, Standard_False);
Set_Etype (B_Node, Standard_Boolean);
Set_Is_Static_Expression (B_Node);
Set_Low_Bound (R_Node, B_Node);
B_Node := New_Node (N_Identifier, Stloc);
Set_Chars (B_Node, Chars (Standard_True));
Set_Entity (B_Node, Standard_True);
Set_Etype (B_Node, Standard_Boolean);
Set_Is_Static_Expression (B_Node);
Set_High_Bound (R_Node, B_Node);
Set_Scalar_Range (Standard_Boolean, R_Node);
Set_Etype (R_Node, Standard_Boolean);
Set_Parent (R_Node, Standard_Boolean);
-- Record entity identifiers for boolean literals in the
-- Boolean_Literals array, for easy reference during expansion.
Boolean_Literals := (False => Standard_False, True => Standard_True);
-- Create type definition nodes for predefined integer types
Build_Signed_Integer_Type
(Standard_Short_Short_Integer, Standard_Short_Short_Integer_Size);
Set_Is_Implementation_Defined (Standard_Short_Short_Integer);
Build_Signed_Integer_Type
(Standard_Short_Integer, Standard_Short_Integer_Size);
Set_Is_Implementation_Defined (Standard_Short_Integer);
Build_Signed_Integer_Type
(Standard_Integer, Standard_Integer_Size);
Build_Signed_Integer_Type
(Standard_Long_Integer, Standard_Long_Integer_Size);
Build_Signed_Integer_Type
(Standard_Long_Long_Integer, Standard_Long_Long_Integer_Size);
Set_Is_Implementation_Defined (Standard_Long_Long_Integer);
Build_Signed_Integer_Type
(Standard_Long_Long_Long_Integer,
Standard_Long_Long_Long_Integer_Size);
Set_Is_Implementation_Defined (Standard_Long_Long_Long_Integer);
Create_Unconstrained_Base_Type
(Standard_Short_Short_Integer, E_Signed_Integer_Subtype);
Create_Unconstrained_Base_Type
(Standard_Short_Integer, E_Signed_Integer_Subtype);
Create_Unconstrained_Base_Type
(Standard_Integer, E_Signed_Integer_Subtype);
Create_Unconstrained_Base_Type
(Standard_Long_Integer, E_Signed_Integer_Subtype);
Create_Unconstrained_Base_Type
(Standard_Long_Long_Integer, E_Signed_Integer_Subtype);
Create_Unconstrained_Base_Type
(Standard_Long_Long_Long_Integer, E_Signed_Integer_Subtype);
Create_Float_Types;
-- Create type definition node for type Character. Note that we do not
-- set the Literals field, since type Character is handled with special
-- routine that do not need a literal list.
Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
Set_Type_Definition (Parent (Standard_Character), Tdef_Node);
Mutate_Ekind (Standard_Character, E_Enumeration_Type);
Set_Etype (Standard_Character, Standard_Character);
Set_Esize (Standard_Character, Char_Size);
Set_RM_Size (Standard_Character, Uint_8);
Set_Elem_Alignment (Standard_Character);
Set_Has_Pragma_Ordered (Standard_Character);
Set_Is_Unsigned_Type (Standard_Character);
Set_Is_Character_Type (Standard_Character);
Set_Is_Known_Valid (Standard_Character);
Set_Size_Known_At_Compile_Time (Standard_Character);
-- Create the bounds for type Character
R_Node := New_Node (N_Range, Stloc);
-- Low bound for type Character (Standard.Nul)
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
Set_Char_Literal_Value (B_Node, Uint_0);
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Character);
Set_Low_Bound (R_Node, B_Node);
-- High bound for type Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
Set_Char_Literal_Value (B_Node, UI_From_Int (16#FF#));
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Character);
Set_High_Bound (R_Node, B_Node);
Set_Scalar_Range (Standard_Character, R_Node);
Set_Etype (R_Node, Standard_Character);
Set_Parent (R_Node, Standard_Character);
-- Create type definition for type Wide_Character. Note that we do not
-- set the Literals field, since type Wide_Character is handled with
-- special routines that do not need a literal list.
Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
Set_Type_Definition (Parent (Standard_Wide_Character), Tdef_Node);
Mutate_Ekind (Standard_Wide_Character, E_Enumeration_Type);
Set_Etype (Standard_Wide_Character, Standard_Wide_Character);
Init_Size (Standard_Wide_Character, Standard_Wide_Character_Size);
Set_Elem_Alignment (Standard_Wide_Character);
Set_Has_Pragma_Ordered (Standard_Wide_Character);
Set_Is_Unsigned_Type (Standard_Wide_Character);
Set_Is_Character_Type (Standard_Wide_Character);
Set_Is_Known_Valid (Standard_Wide_Character);
Set_Size_Known_At_Compile_Time (Standard_Wide_Character);
-- Create the bounds for type Wide_Character
R_Node := New_Node (N_Range, Stloc);
-- Low bound for type Wide_Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
Set_Char_Literal_Value (B_Node, Uint_0);
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Character);
Set_Low_Bound (R_Node, B_Node);
-- High bound for type Wide_Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
Set_Char_Literal_Value (B_Node, UI_From_Int (16#FFFF#));
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Character);
Set_High_Bound (R_Node, B_Node);
Set_Scalar_Range (Standard_Wide_Character, R_Node);
Set_Etype (R_Node, Standard_Wide_Character);
Set_Parent (R_Node, Standard_Wide_Character);
-- Create type definition for type Wide_Wide_Character. Note that we
-- do not set the Literals field, since type Wide_Wide_Character is
-- handled with special routines that do not need a literal list.
Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
Set_Type_Definition (Parent (Standard_Wide_Wide_Character), Tdef_Node);
Mutate_Ekind (Standard_Wide_Wide_Character, E_Enumeration_Type);
Set_Etype (Standard_Wide_Wide_Character,
Standard_Wide_Wide_Character);
Init_Size (Standard_Wide_Wide_Character,
Standard_Wide_Wide_Character_Size);
Set_Elem_Alignment (Standard_Wide_Wide_Character);
Set_Has_Pragma_Ordered (Standard_Wide_Wide_Character);
Set_Is_Unsigned_Type (Standard_Wide_Wide_Character);
Set_Is_Character_Type (Standard_Wide_Wide_Character);
Set_Is_Known_Valid (Standard_Wide_Wide_Character);
Set_Size_Known_At_Compile_Time (Standard_Wide_Wide_Character);
Set_Is_Ada_2005_Only (Standard_Wide_Wide_Character);
-- Create the bounds for type Wide_Wide_Character
R_Node := New_Node (N_Range, Stloc);
-- Low bound for type Wide_Wide_Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
Set_Char_Literal_Value (B_Node, Uint_0);
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Wide_Character);
Set_Low_Bound (R_Node, B_Node);
-- High bound for type Wide_Wide_Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
Set_Char_Literal_Value (B_Node, UI_From_Int (16#7FFF_FFFF#));
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Wide_Character);
Set_High_Bound (R_Node, B_Node);
Set_Scalar_Range (Standard_Wide_Wide_Character, R_Node);
Set_Etype (R_Node, Standard_Wide_Wide_Character);
Set_Parent (R_Node, Standard_Wide_Wide_Character);
-- Create type definition node for type String
Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
declare
CompDef_Node : Node_Id;
begin
CompDef_Node := New_Node (N_Component_Definition, Stloc);
Set_Aliased_Present (CompDef_Node, False);
Set_Access_Definition (CompDef_Node, Empty);
Set_Subtype_Indication (CompDef_Node, Identifier_For (S_Character));
Set_Component_Definition (Tdef_Node, CompDef_Node);
end;
Set_Subtype_Marks (Tdef_Node, New_List);
Append (Identifier_For (S_Positive), Subtype_Marks (Tdef_Node));
Set_Type_Definition (Parent (Standard_String), Tdef_Node);
Mutate_Ekind (Standard_String, E_Array_Type);
Set_Etype (Standard_String, Standard_String);
Set_Component_Type (Standard_String, Standard_Character);
Set_Component_Size (Standard_String, Uint_8);
Reinit_Size_Align (Standard_String);
Set_Alignment (Standard_String, Uint_1);
Pack_String_Type (Standard_String);
-- On targets where a storage unit is larger than a byte, pragma Pack
-- has a real effect on the representation of type String, and the type
-- must be marked as having a nonstandard representation.
if System_Storage_Unit > Uint_8 then
Set_Has_Non_Standard_Rep (Standard_String);
Set_Has_Pragma_Pack (Standard_String);
end if;
-- Set index type of String
E_Id :=
First (Subtype_Marks (Type_Definition (Parent (Standard_String))));
Set_First_Index (Standard_String, E_Id);
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
-- Create type definition node for type Wide_String
Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
declare
CompDef_Node : Node_Id;
begin
CompDef_Node := New_Node (N_Component_Definition, Stloc);
Set_Aliased_Present (CompDef_Node, False);
Set_Access_Definition (CompDef_Node, Empty);
Set_Subtype_Indication (CompDef_Node,
Identifier_For (S_Wide_Character));
Set_Component_Definition (Tdef_Node, CompDef_Node);
end;
Set_Subtype_Marks (Tdef_Node, New_List);
Append (Identifier_For (S_Positive), Subtype_Marks (Tdef_Node));
Set_Type_Definition (Parent (Standard_Wide_String), Tdef_Node);
Mutate_Ekind (Standard_Wide_String, E_Array_Type);
Set_Etype (Standard_Wide_String, Standard_Wide_String);
Set_Component_Type (Standard_Wide_String, Standard_Wide_Character);
Set_Component_Size (Standard_Wide_String, Uint_16);
Reinit_Size_Align (Standard_Wide_String);
Pack_String_Type (Standard_Wide_String);
-- Set index type of Wide_String
E_Id :=
First
(Subtype_Marks (Type_Definition (Parent (Standard_Wide_String))));
Set_First_Index (Standard_Wide_String, E_Id);
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
-- Create type definition node for type Wide_Wide_String
Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
declare
CompDef_Node : Node_Id;
begin
CompDef_Node := New_Node (N_Component_Definition, Stloc);
Set_Aliased_Present (CompDef_Node, False);
Set_Access_Definition (CompDef_Node, Empty);
Set_Subtype_Indication (CompDef_Node,
Identifier_For (S_Wide_Wide_Character));
Set_Component_Definition (Tdef_Node, CompDef_Node);
end;
Set_Subtype_Marks (Tdef_Node, New_List);
Append (Identifier_For (S_Positive), Subtype_Marks (Tdef_Node));
Set_Type_Definition (Parent (Standard_Wide_Wide_String), Tdef_Node);
Mutate_Ekind (Standard_Wide_Wide_String, E_Array_Type);
Set_Etype (Standard_Wide_Wide_String,
Standard_Wide_Wide_String);
Set_Component_Type (Standard_Wide_Wide_String,
Standard_Wide_Wide_Character);
Set_Component_Size (Standard_Wide_Wide_String, Uint_32);
Reinit_Size_Align (Standard_Wide_Wide_String);
Set_Is_Ada_2005_Only (Standard_Wide_Wide_String);
Pack_String_Type (Standard_Wide_Wide_String);
-- Set index type of Wide_Wide_String
E_Id :=
First
(Subtype_Marks
(Type_Definition (Parent (Standard_Wide_Wide_String))));
Set_First_Index (Standard_Wide_Wide_String, E_Id);
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
-- Setup entity for Natural
Mutate_Ekind (Standard_Natural, E_Signed_Integer_Subtype);
Set_Etype (Standard_Natural, Base_Type (Standard_Integer));
Set_Esize (Standard_Natural, UI_From_Int (Standard_Integer_Size));
Set_RM_Size (Standard_Natural, UI_From_Int (Standard_Integer_Size - 1));
Set_Elem_Alignment (Standard_Natural);
Set_Size_Known_At_Compile_Time
(Standard_Natural);
Set_Integer_Bounds (Standard_Natural,
Typ => Base_Type (Standard_Integer),
Lb => Uint_0,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Natural);
-- Setup entity for Positive
Mutate_Ekind (Standard_Positive, E_Signed_Integer_Subtype);
Set_Etype (Standard_Positive, Base_Type (Standard_Integer));
Set_Esize (Standard_Positive, UI_From_Int (Standard_Integer_Size));
Set_RM_Size
(Standard_Positive, UI_From_Int (Standard_Integer_Size - 1));
Set_Elem_Alignment (Standard_Positive);
Set_Size_Known_At_Compile_Time (Standard_Positive);
Set_Integer_Bounds (Standard_Positive,
Typ => Base_Type (Standard_Integer),
Lb => Uint_1,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Positive);
-- Create declaration for package ASCII
Decl := New_Node (N_Package_Declaration, Stloc);
Append (Decl, Decl_S);
Pspec := New_Node (N_Package_Specification, Stloc);
Set_Specification (Decl, Pspec);
Set_Defining_Unit_Name (Pspec, Standard_Entity (S_ASCII));
Mutate_Ekind (Standard_Entity (S_ASCII), E_Package);
Set_Visible_Declarations (Pspec, Decl_A);
-- Create control character definitions in package ASCII. Note that
-- the character literal entries created here correspond to literal
-- values that are impossible in the source, but can be represented
-- internally with no difficulties.
Ccode := 16#00#;
for S in S_ASCII_Names loop
Decl := New_Node (N_Object_Declaration, Staloc);
Set_Constant_Present (Decl, True);
declare
A_Char : constant Entity_Id := Standard_Entity (S);
Expr_Decl : Node_Id;
begin
Set_Sloc (A_Char, Staloc);
Mutate_Ekind (A_Char, E_Constant);
Set_Never_Set_In_Source (A_Char, True);
Set_Is_True_Constant (A_Char, True);
Set_Etype (A_Char, Standard_Character);
Set_Scope (A_Char, Standard_Entity (S_ASCII));
Set_Is_Immediately_Visible (A_Char, False);
Set_Is_Public (A_Char, True);
Set_Is_Known_Valid (A_Char, True);
Append_Entity (A_Char, Standard_Entity (S_ASCII));
Set_Defining_Identifier (Decl, A_Char);
Set_Object_Definition (Decl, Identifier_For (S_Character));
Expr_Decl := New_Node (N_Character_Literal, Staloc);
Set_Expression (Decl, Expr_Decl);
Set_Is_Static_Expression (Expr_Decl);
Set_Chars (Expr_Decl, No_Name);
Set_Etype (Expr_Decl, Standard_Character);
Set_Char_Literal_Value (Expr_Decl, UI_From_Int (Int (Ccode)));
end;
Append (Decl, Decl_A);
-- Increment character code, dealing with non-contiguities
Ccode := Ccode + 1;
if Ccode = 16#20# then
Ccode := 16#21#;
elsif Ccode = 16#27# then
Ccode := 16#3A#;
elsif Ccode = 16#3C# then
Ccode := 16#3F#;
elsif Ccode = 16#41# then
Ccode := 16#5B#;
end if;
end loop;
-- Create semantic phase entities
Standard_Void_Type := New_Standard_Entity ("_void_type");
pragma Assert (Ekind (Standard_Void_Type) = E_Void); -- it's the default
Set_Etype (Standard_Void_Type, Standard_Void_Type);
Set_Scope (Standard_Void_Type, Standard_Standard);
-- The type field of packages is set to void
Set_Etype (Standard_Standard, Standard_Void_Type);
Set_Etype (Standard_ASCII, Standard_Void_Type);
-- Standard_A_String is actually used in generated code, so it has a
-- type name that is reasonable, but does not overlap any Ada name.
Standard_A_String := New_Standard_Entity ("access_string");
Mutate_Ekind (Standard_A_String, E_Access_Type);
Set_Scope (Standard_A_String, Standard_Standard);
Set_Etype (Standard_A_String, Standard_A_String);
if Debug_Flag_6 then
Init_Size (Standard_A_String, System_Address_Size);
else
Init_Size (Standard_A_String, System_Address_Size * 2);
end if;
pragma Assert (not Known_Alignment (Standard_A_String));
Set_Directly_Designated_Type
(Standard_A_String, Standard_String);
Standard_A_Char := New_Standard_Entity ("access_character");
Mutate_Ekind (Standard_A_Char, E_Access_Type);
Set_Scope (Standard_A_Char, Standard_Standard);
Set_Etype (Standard_A_Char, Standard_A_String);
Init_Size (Standard_A_Char, System_Address_Size);
Set_Elem_Alignment (Standard_A_Char);
Set_Directly_Designated_Type (Standard_A_Char, Standard_Character);
-- Standard_Debug_Renaming_Type is used for the special objects created
-- to encode the names occurring in renaming declarations for use by the
-- debugger (see exp_dbug.adb). The type is a zero-sized subtype of
-- Standard.Integer.
Standard_Debug_Renaming_Type := New_Standard_Entity ("_renaming_type");
Mutate_Ekind (Standard_Debug_Renaming_Type, E_Signed_Integer_Subtype);
Set_Scope (Standard_Debug_Renaming_Type, Standard_Standard);
Set_Etype (Standard_Debug_Renaming_Type, Base_Type (Standard_Integer));
Set_Esize (Standard_Debug_Renaming_Type, Uint_0);
Set_RM_Size (Standard_Debug_Renaming_Type, Uint_0);
Set_Size_Known_At_Compile_Time (Standard_Debug_Renaming_Type);
Set_Integer_Bounds (Standard_Debug_Renaming_Type,
Typ => Base_Type (Standard_Debug_Renaming_Type),
Lb => Uint_1,
Hb => Uint_0);
Set_Is_Constrained (Standard_Debug_Renaming_Type);
Set_Has_Size_Clause (Standard_Debug_Renaming_Type);
-- Note on type names. The type names for the following special types
-- are constructed so that they will look reasonable should they ever
-- appear in error messages etc, although in practice the use of the
-- special insertion character } for types results in special handling
-- of these type names in any case. The blanks in these names would
-- trouble in Gigi, but that's OK here, since none of these types
-- should ever get through to Gigi. Attributes of these types are
-- filled out to minimize problems with cascaded errors (for example,
-- Any_Integer is given reasonable and consistent type and size values)
Any_Type := New_Standard_Entity ("any type");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Any_Type);
Set_Scope (Any_Type, Standard_Standard);
Build_Signed_Integer_Type (Any_Type, Standard_Integer_Size);
Any_Id := New_Standard_Entity ("any id");
Mutate_Ekind (Any_Id, E_Variable);
Set_Scope (Any_Id, Standard_Standard);
Set_Etype (Any_Id, Any_Type);
pragma Assert (not Known_Esize (Any_Id));
pragma Assert (not Known_Alignment (Any_Id));
Any_Character := New_Standard_Entity ("a character type");
Mutate_Ekind (Any_Character, E_Enumeration_Type);
Set_Scope (Any_Character, Standard_Standard);
Set_Etype (Any_Character, Any_Character);
Set_Is_Unsigned_Type (Any_Character);
Set_Is_Character_Type (Any_Character);
Set_Esize (Any_Character, Char_Size);
Set_RM_Size (Any_Character, Uint_8);
Set_Elem_Alignment (Any_Character);
Set_Scalar_Range (Any_Character, Scalar_Range (Standard_Character));
Any_Array := New_Standard_Entity ("an array type");
Mutate_Ekind (Any_Array, E_Array_Type);
Set_Scope (Any_Array, Standard_Standard);
Set_Etype (Any_Array, Any_Array);
Set_Component_Type (Any_Array, Any_Character);
Reinit_Size_Align (Any_Array);
Make_Dummy_Index (Any_Array);
Any_Boolean := New_Standard_Entity ("a boolean type");
Mutate_Ekind (Any_Boolean, E_Enumeration_Type);
Set_Scope (Any_Boolean, Standard_Standard);
Set_Etype (Any_Boolean, Standard_Boolean);
Set_Esize (Any_Boolean, Char_Size);
Set_RM_Size (Any_Boolean, Uint_1);
Set_Elem_Alignment (Any_Boolean);
Set_Is_Unsigned_Type (Any_Boolean);
Set_Scalar_Range (Any_Boolean, Scalar_Range (Standard_Boolean));
Any_Composite := New_Standard_Entity ("a composite type");
Mutate_Ekind (Any_Composite, E_Array_Type);
Set_Scope (Any_Composite, Standard_Standard);
Set_Etype (Any_Composite, Any_Composite);
Set_Component_Type (Any_Composite, Standard_Integer);
Reinit_Size_Align (Any_Composite);
pragma Assert (not Known_Component_Size (Any_Composite));
Any_Discrete := New_Standard_Entity ("a discrete type");
Mutate_Ekind (Any_Discrete, E_Signed_Integer_Type);
Set_Scope (Any_Discrete, Standard_Standard);
Set_Etype (Any_Discrete, Any_Discrete);
Init_Size (Any_Discrete, Standard_Integer_Size);
Set_Elem_Alignment (Any_Discrete);
Any_Fixed := New_Standard_Entity ("a fixed-point type");
Mutate_Ekind (Any_Fixed, E_Ordinary_Fixed_Point_Type);
Set_Scope (Any_Fixed, Standard_Standard);
Set_Etype (Any_Fixed, Any_Fixed);
Init_Size (Any_Fixed, Standard_Integer_Size);
Set_Elem_Alignment (Any_Fixed);
Any_Integer := New_Standard_Entity ("an integer type");
Mutate_Ekind (Any_Integer, E_Signed_Integer_Type);
Set_Scope (Any_Integer, Standard_Standard);
Set_Etype (Any_Integer, Standard_Long_Long_Long_Integer);
Init_Size (Any_Integer, Standard_Long_Long_Long_Integer_Size);
Set_Elem_Alignment (Any_Integer);
Set_Integer_Bounds
(Any_Integer,
Typ => Base_Type (Standard_Integer),
Lb => Uint_0,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Any_Modular := New_Standard_Entity ("a modular type");
Mutate_Ekind (Any_Modular, E_Modular_Integer_Type);
Set_Scope (Any_Modular, Standard_Standard);
Set_Etype (Any_Modular, Standard_Long_Long_Long_Integer);
Init_Size (Any_Modular, Standard_Long_Long_Long_Integer_Size);
Set_Elem_Alignment (Any_Modular);
Set_Is_Unsigned_Type (Any_Modular);
Any_Numeric := New_Standard_Entity ("a numeric type");
Mutate_Ekind (Any_Numeric, E_Signed_Integer_Type);
Set_Scope (Any_Numeric, Standard_Standard);
Set_Etype (Any_Numeric, Standard_Long_Long_Long_Integer);
Init_Size (Any_Numeric, Standard_Long_Long_Long_Integer_Size);
Set_Elem_Alignment (Any_Numeric);
Any_Real := New_Standard_Entity ("a real type");
Mutate_Ekind (Any_Real, E_Floating_Point_Type);
Set_Scope (Any_Real, Standard_Standard);
Set_Etype (Any_Real, Standard_Long_Long_Float);
Init_Size (Any_Real,
UI_To_Int (Esize (Standard_Long_Long_Float)));
Set_Elem_Alignment (Any_Real);
Any_Scalar := New_Standard_Entity ("a scalar type");
Mutate_Ekind (Any_Scalar, E_Signed_Integer_Type);
Set_Scope (Any_Scalar, Standard_Standard);
Set_Etype (Any_Scalar, Any_Scalar);
Init_Size (Any_Scalar, Standard_Integer_Size);
Set_Elem_Alignment (Any_Scalar);
Any_String := New_Standard_Entity ("a string type");
Mutate_Ekind (Any_String, E_Array_Type);
Set_Scope (Any_String, Standard_Standard);
Set_Etype (Any_String, Any_String);
Set_Component_Type (Any_String, Any_Character);
Reinit_Size_Align (Any_String);
Make_Dummy_Index (Any_String);
Raise_Type := New_Standard_Entity ("raise type");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Raise_Type);
Set_Scope (Raise_Type, Standard_Standard);
Build_Signed_Integer_Type (Raise_Type, Standard_Integer_Size);
Standard_Integer_8 := New_Standard_Entity ("integer_8");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_8);
Set_Scope (Standard_Integer_8, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_8, 8);
Standard_Integer_16 := New_Standard_Entity ("integer_16");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_16);
Set_Scope (Standard_Integer_16, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_16, 16);
Standard_Integer_32 := New_Standard_Entity ("integer_32");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_32);
Set_Scope (Standard_Integer_32, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_32, 32);
Standard_Integer_64 := New_Standard_Entity ("integer_64");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_64);
Set_Scope (Standard_Integer_64, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_64, 64);
Standard_Integer_128 := New_Standard_Entity ("integer_128");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_128);
Set_Scope (Standard_Integer_128, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_128, 128);
-- Standard_*_Unsigned subtypes are not user visible, but they are
-- used internally. They are unsigned types with the same length as
-- the correspondingly named signed integer types.
Standard_Short_Short_Unsigned
:= New_Standard_Entity ("short_short_unsigned");
Build_Unsigned_Integer_Type
(Standard_Short_Short_Unsigned, Standard_Short_Short_Integer_Size);
Standard_Short_Unsigned := New_Standard_Entity ("short_unsigned");
Build_Unsigned_Integer_Type
(Standard_Short_Unsigned, Standard_Short_Integer_Size);
Standard_Unsigned := New_Standard_Entity ("unsigned");
Build_Unsigned_Integer_Type
(Standard_Unsigned, Standard_Integer_Size);
Standard_Long_Unsigned := New_Standard_Entity ("long_unsigned");
Build_Unsigned_Integer_Type
(Standard_Long_Unsigned, Standard_Long_Integer_Size);
Standard_Long_Long_Unsigned :=
New_Standard_Entity ("long_long_unsigned");
Build_Unsigned_Integer_Type
(Standard_Long_Long_Unsigned, Standard_Long_Long_Integer_Size);
Standard_Long_Long_Long_Unsigned :=
New_Standard_Entity ("long_long_long_unsigned");
Build_Unsigned_Integer_Type
(Standard_Long_Long_Long_Unsigned,
Standard_Long_Long_Long_Integer_Size);
-- Standard_Unsigned_64 is not user visible, but is used internally. It
-- is an unsigned type mod 2**64 with 64 bits size.
Standard_Unsigned_64 := New_Standard_Entity ("unsigned_64");
Build_Unsigned_Integer_Type (Standard_Unsigned_64, 64);
-- Standard_Address is not user visible, but is used internally. It is
-- an unsigned type mod 2**System_Address_Size with System.Address size.
Standard_Address := New_Standard_Entity ("standard_address");
Build_Unsigned_Integer_Type (Standard_Address, System_Address_Size);
-- Note: universal integer and universal real are constructed as fully
-- formed signed numeric types, with parameters corresponding to the
-- longest runtime types (Long_Long_Long_Integer and Long_Long_Float).
-- This allows Gigi to properly process references to universal types
-- that are not folded at compile time.
Universal_Integer := New_Standard_Entity ("universal_integer");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Universal_Integer);
Set_Scope (Universal_Integer, Standard_Standard);
Build_Signed_Integer_Type
(Universal_Integer, Standard_Long_Long_Long_Integer_Size);
Universal_Real := New_Standard_Entity ("universal_real");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Universal_Real);
Set_Scope (Universal_Real, Standard_Standard);
Copy_Float_Type (Universal_Real, Standard_Long_Long_Float);
-- Note: universal fixed, unlike universal integer and universal real,
-- is never used at runtime, so it does not need to have bounds set.
Universal_Fixed := New_Standard_Entity ("universal_fixed");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Universal_Fixed);
Mutate_Ekind (Universal_Fixed, E_Ordinary_Fixed_Point_Type);
Set_Etype (Universal_Fixed, Universal_Fixed);
Set_Scope (Universal_Fixed, Standard_Standard);
Init_Size (Universal_Fixed, Standard_Long_Long_Integer_Size);
Set_Elem_Alignment (Universal_Fixed);
Set_Size_Known_At_Compile_Time
(Universal_Fixed);
Universal_Access := New_Standard_Entity ("universal_access");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Universal_Access);
Mutate_Ekind (Universal_Access, E_Access_Type);
Set_Etype (Universal_Access, Universal_Access);
Set_Scope (Universal_Access, Standard_Standard);
Init_Size (Universal_Access, System_Address_Size);
Set_Elem_Alignment (Universal_Access);
Set_Directly_Designated_Type (Universal_Access, Any_Type);
-- Create type declaration for Duration, using a 64-bit size. The
-- delta and size values depend on the mode set in system.ads.
Build_Duration : declare
Dlo : Uint;
Dhi : Uint;
Delta_Val : Ureal;
begin
-- In 32 bit mode, the size is 32 bits, and the delta and
-- small values are set to 20 milliseconds (20.0*(10.0**(-3)).
if Duration_32_Bits_On_Target then
Dlo := Intval (Type_Low_Bound (Standard_Integer_32));
Dhi := Intval (Type_High_Bound (Standard_Integer_32));
Delta_Val := UR_From_Components (UI_From_Int (20), Uint_3, 10);
-- In 64-bit mode, the size is 64-bits and the delta and
-- small values are set to nanoseconds (1.0*(10.0**(-9)).
else
Dlo := Intval (Type_Low_Bound (Standard_Integer_64));
Dhi := Intval (Type_High_Bound (Standard_Integer_64));
Delta_Val := UR_From_Components (Uint_1, Uint_9, 10);
end if;
Tdef_Node := Make_Ordinary_Fixed_Point_Definition (Stloc,
Delta_Expression => Make_Real_Literal (Stloc, Delta_Val),
Real_Range_Specification =>
Make_Real_Range_Specification (Stloc,
Low_Bound => Make_Real_Literal (Stloc,
Realval => Dlo * Delta_Val),
High_Bound => Make_Real_Literal (Stloc,
Realval => Dhi * Delta_Val)));
Set_Type_Definition (Parent (Standard_Duration), Tdef_Node);
Mutate_Ekind (Standard_Duration, E_Ordinary_Fixed_Point_Type);
Set_Etype (Standard_Duration, Standard_Duration);
if Duration_32_Bits_On_Target then
Init_Size (Standard_Duration, 32);
else
Init_Size (Standard_Duration, 64);
end if;
Set_Elem_Alignment (Standard_Duration);
Set_Delta_Value (Standard_Duration, Delta_Val);
Set_Small_Value (Standard_Duration, Delta_Val);
Set_Scalar_Range (Standard_Duration,
Real_Range_Specification
(Type_Definition (Parent (Standard_Duration))));
-- Normally it does not matter that nodes in package Standard are
-- not marked as analyzed. The Scalar_Range of the fixed-point type
-- Standard_Duration is an exception, because of the special test
-- made in Freeze.Freeze_Fixed_Point_Type.
Set_Analyzed (Scalar_Range (Standard_Duration));
Set_Etype (Type_High_Bound (Standard_Duration), Standard_Duration);
Set_Etype (Type_Low_Bound (Standard_Duration), Standard_Duration);
Set_Is_Static_Expression (Type_High_Bound (Standard_Duration));
Set_Is_Static_Expression (Type_Low_Bound (Standard_Duration));
Set_Corresponding_Integer_Value
(Type_High_Bound (Standard_Duration), Dhi);
Set_Corresponding_Integer_Value
(Type_Low_Bound (Standard_Duration), Dlo);
Set_Size_Known_At_Compile_Time (Standard_Duration);
end Build_Duration;
-- Build standard exception type. Note that the type name here is
-- actually used in the generated code, so it must be set correctly.
-- The type Standard_Exception_Type must be consistent with the type
-- System.Standard_Library.Exception_Data, as the latter is what is
-- known by the run-time. Components of the record are documented in
-- the declaration in System.Standard_Library.
Build_Exception_Type : declare
Comp_List : List_Id;
Comp : Entity_Id;
begin
Standard_Exception_Type := New_Standard_Entity ("exception");
Mutate_Ekind (Standard_Exception_Type, E_Record_Type);
Set_Etype (Standard_Exception_Type, Standard_Exception_Type);
Set_Scope (Standard_Exception_Type, Standard_Standard);
Set_Stored_Constraint
(Standard_Exception_Type, No_Elist);
Set_Size_Known_At_Compile_Time
(Standard_Exception_Type, True);
pragma Assert (not Known_RM_Size (Standard_Exception_Type));
Make_Aliased_Component (Standard_Exception_Type, Standard_Boolean,
"Not_Handled_By_Others");
Make_Aliased_Component (Standard_Exception_Type, Standard_Character,
"Lang");
Make_Aliased_Component (Standard_Exception_Type, Standard_Natural,
"Name_Length");
Make_Aliased_Component (Standard_Exception_Type, Standard_Address,
"Full_Name");
Make_Aliased_Component (Standard_Exception_Type, Standard_A_Char,
"HTable_Ptr");
Make_Aliased_Component (Standard_Exception_Type, Standard_Address,
"Foreign_Data");
Make_Aliased_Component (Standard_Exception_Type, Standard_A_Char,
"Raise_Hook");
Layout_Type (Standard_Exception_Type);
-- Build tree for record declaration, for use by the back-end
Comp := First_Entity (Standard_Exception_Type);
Comp_List := New_List;
while Present (Comp) loop
Append (
Make_Component_Declaration (Stloc,
Defining_Identifier => Comp,
Component_Definition =>
Make_Component_Definition (Stloc,
Aliased_Present => True,
Subtype_Indication =>
New_Occurrence_Of (Etype (Comp), Stloc))),
Comp_List);
Next_Entity (Comp);
end loop;
Decl := Make_Full_Type_Declaration (Stloc,
Defining_Identifier => Standard_Exception_Type,
Type_Definition =>
Make_Record_Definition (Stloc,
End_Label => Empty,
Component_List =>
Make_Component_List (Stloc,
Component_Items => Comp_List)));
Append (Decl, Decl_S);
end Build_Exception_Type;
-- Create declarations of standard exceptions
Build_Exception (S_Constraint_Error);
Build_Exception (S_Program_Error);
Build_Exception (S_Storage_Error);
Build_Exception (S_Tasking_Error);
-- Numeric_Error is a normal exception in Ada 83, but in Ada 95
-- it is a renaming of Constraint_Error. This test is too early since
-- it doesn't handle pragma Ada_83. But it's not worth the trouble of
-- fixing this.
if Ada_Version = Ada_83 then
Build_Exception (S_Numeric_Error);
else
Decl := New_Node (N_Exception_Renaming_Declaration, Stloc);
E_Id := Standard_Entity (S_Numeric_Error);
Mutate_Ekind (E_Id, E_Exception);
Set_Etype (E_Id, Standard_Exception_Type);
Set_Is_Public (E_Id);
Set_Renamed_Entity (E_Id, Standard_Entity (S_Constraint_Error));
Set_Defining_Identifier (Decl, E_Id);
Append (Decl, Decl_S);
Ident_Node := New_Node (N_Identifier, Stloc);
Set_Chars (Ident_Node, Chars (Standard_Entity (S_Constraint_Error)));
Set_Entity (Ident_Node, Standard_Entity (S_Constraint_Error));
Set_Name (Decl, Ident_Node);
end if;
-- Abort_Signal is an entity that does not get made visible
Abort_Signal := New_Standard_Entity;
Set_Chars (Abort_Signal, Name_uAbort_Signal);
Mutate_Ekind (Abort_Signal, E_Exception);
Set_Etype (Abort_Signal, Standard_Exception_Type);
Set_Scope (Abort_Signal, Standard_Standard);
Set_Is_Public (Abort_Signal, True);
Decl :=
Make_Exception_Declaration (Stloc,
Defining_Identifier => Abort_Signal);
-- Create defining identifiers for shift operator entities. Note
-- that these entities are used only for marking shift operators
-- generated internally, and hence need no structure, just a name
-- and a unique identity.
Standard_Op_Rotate_Left := New_Standard_Entity;
Set_Chars (Standard_Op_Rotate_Left, Name_Rotate_Left);
Mutate_Ekind (Standard_Op_Rotate_Left, E_Operator);
Standard_Op_Rotate_Right := New_Standard_Entity;
Set_Chars (Standard_Op_Rotate_Right, Name_Rotate_Right);
Mutate_Ekind (Standard_Op_Rotate_Right, E_Operator);
Standard_Op_Shift_Left := New_Standard_Entity;
Set_Chars (Standard_Op_Shift_Left, Name_Shift_Left);
Mutate_Ekind (Standard_Op_Shift_Left, E_Operator);
Standard_Op_Shift_Right := New_Standard_Entity;
Set_Chars (Standard_Op_Shift_Right, Name_Shift_Right);
Mutate_Ekind (Standard_Op_Shift_Right, E_Operator);
Standard_Op_Shift_Right_Arithmetic := New_Standard_Entity;
Set_Chars (Standard_Op_Shift_Right_Arithmetic,
Name_Shift_Right_Arithmetic);
Mutate_Ekind (Standard_Op_Shift_Right_Arithmetic,
E_Operator);
-- Create standard operator declarations
Create_Operators;
-- Initialize visibility table with entities in Standard
for E in Standard_Entity_Type loop
if Ekind (Standard_Entity (E)) /= E_Operator then
Set_Name_Entity_Id
(Chars (Standard_Entity (E)), Standard_Entity (E));
Set_Homonym (Standard_Entity (E), Empty);
end if;
if E not in S_ASCII_Names then
Set_Scope (Standard_Entity (E), Standard_Standard);
Set_Is_Immediately_Visible (Standard_Entity (E));
end if;
end loop;
-- The predefined package Standard itself does not have a scope;
-- it is the only entity in the system not to have one, and this
-- is what identifies the package to Gigi.
Set_Scope (Standard_Standard, Empty);
-- Set global variables indicating last Id values and version
Last_Standard_Node_Id := Last_Node_Id;
Last_Standard_List_Id := Last_List_Id;
-- The Error node has an Etype of Any_Type to help error recovery
Set_Etype (Error, Any_Type);
-- Print representation of standard if switch set
if Opt.Print_Standard then
Print_Standard;
end if;
end Create_Standard;
------------------------------------
-- Create_Unconstrained_Base_Type --
------------------------------------
procedure Create_Unconstrained_Base_Type
(E : Entity_Id;
K : Entity_Kind)
is
New_Ent : constant Entity_Id := New_Copy (E);
begin
Mutate_Ekind (E, K);
Set_Is_Constrained (E, True);
Set_Is_First_Subtype (E, True);
Set_Etype (E, New_Ent);
Append_Entity (New_Ent, Standard_Standard);
Set_Is_Constrained (New_Ent, False);
Set_Etype (New_Ent, New_Ent);
Set_Is_Known_Valid (New_Ent, True);
if K = E_Signed_Integer_Subtype then
Set_Etype (Low_Bound (Scalar_Range (E)), New_Ent);
Set_Etype (High_Bound (Scalar_Range (E)), New_Ent);
end if;
end Create_Unconstrained_Base_Type;
--------------------
-- Identifier_For --
--------------------
function Identifier_For (S : Standard_Entity_Type) return Node_Id is
Ident_Node : constant Node_Id := New_Node (N_Identifier, Stloc);
begin
Set_Chars (Ident_Node, Chars (Standard_Entity (S)));
Set_Entity (Ident_Node, Standard_Entity (S));
return Ident_Node;
end Identifier_For;
----------------------------
-- Make_Aliased_Component --
----------------------------
procedure Make_Aliased_Component
(Rec : Entity_Id;
Typ : Entity_Id;
Nam : String)
is
Id : constant Entity_Id := New_Standard_Entity (Nam);
begin
Mutate_Ekind (Id, E_Component);
Set_Etype (Id, Typ);
Set_Scope (Id, Rec);
Reinit_Component_Location (Id);
Set_Original_Record_Component (Id, Id);
Set_Is_Aliased (Id);
Set_Is_Independent (Id);
Append_Entity (Id, Rec);
end Make_Aliased_Component;
-----------------
-- Make_Formal --
-----------------
function Make_Formal (Typ : Entity_Id; Nam : String) return Entity_Id is
Formal : constant Entity_Id := New_Standard_Entity (Nam);
begin
Mutate_Ekind (Formal, E_In_Parameter);
Set_Mechanism (Formal, Default_Mechanism);
Set_Scope (Formal, Standard_Standard);
Set_Etype (Formal, Typ);
return Formal;
end Make_Formal;
------------------
-- Make_Integer --
------------------
function Make_Integer (V : Uint) return Node_Id is
N : constant Node_Id := Make_Integer_Literal (Stloc, V);
begin
Set_Is_Static_Expression (N);
return N;
end Make_Integer;
------------------
-- New_Operator --
------------------
function New_Operator (Op : Name_Id; Typ : Entity_Id) return Entity_Id is
Ident_Node : constant Entity_Id := Make_Defining_Identifier (Stloc, Op);
begin
Set_Is_Pure (Ident_Node, True);
Mutate_Ekind (Ident_Node, E_Operator);
Set_Etype (Ident_Node, Typ);
Set_Scope (Ident_Node, Standard_Standard);
Set_Homonym (Ident_Node, Get_Name_Entity_Id (Op));
Set_Convention (Ident_Node, Convention_Intrinsic);
Set_Is_Immediately_Visible (Ident_Node, True);
Set_Is_Intrinsic_Subprogram (Ident_Node, True);
Set_Name_Entity_Id (Op, Ident_Node);
Append_Entity (Ident_Node, Standard_Standard);
return Ident_Node;
end New_Operator;
-------------------------
-- New_Standard_Entity --
-------------------------
function New_Standard_Entity return Entity_Id
is
E : constant Entity_Id := New_Entity (N_Defining_Identifier, Stloc);
begin
-- All standard entities are Pure and Public
Set_Is_Pure (E);
Set_Is_Public (E);
-- All standard entity names are analyzed manually, and are thus
-- frozen as soon as they are created.
Set_Is_Frozen (E);
-- Set debug information required for all standard types
Set_Needs_Debug_Info (E);
-- All standard entities are built with fully qualified names, so
-- set the flag to prevent an abortive attempt at requalification.
Set_Has_Qualified_Name (E);
-- Return newly created entity to be completed by caller
return E;
end New_Standard_Entity;
function New_Standard_Entity (Nam : String) return Entity_Id is
Ent : constant Entity_Id := New_Standard_Entity;
begin
for J in 1 .. Nam'Length loop
Name_Buffer (J) := Fold_Lower (Nam (Nam'First + (J - 1)));
end loop;
Name_Len := Nam'Length;
Set_Chars (Ent, Name_Find);
return Ent;
end New_Standard_Entity;
--------------------
-- Print_Standard --
--------------------
procedure Print_Standard is
procedure P (Item : String) renames Output.Write_Line;
-- Short-hand, since we do a lot of line writes here
procedure P_Int_Range (Size : Pos);
-- Prints the range of an integer based on its Size
procedure P_Float_Range (Id : Entity_Id);
-- Prints the bounds range for the given float type entity
procedure P_Float_Type (Id : Entity_Id);
-- Prints the type declaration of the given float type entity
procedure P_Mixed_Name (Id : Name_Id);
-- Prints Id in mixed case
-------------------
-- P_Float_Range --
-------------------
procedure P_Float_Range (Id : Entity_Id) is
begin
Write_Str (" range ");
UR_Write (Realval (Type_Low_Bound (Id)));
Write_Str (" .. ");
UR_Write (Realval (Type_High_Bound (Id)));
Write_Str (";");
Write_Eol;
end P_Float_Range;
------------------
-- P_Float_Type --
------------------
procedure P_Float_Type (Id : Entity_Id) is
begin
Write_Str (" type ");
P_Mixed_Name (Chars (Id));
Write_Str (" is digits ");
Write_Int (UI_To_Int (Digits_Value (Id)));
Write_Eol;
P_Float_Range (Id);
Write_Str (" for ");
P_Mixed_Name (Chars (Id));
Write_Str ("'Size use ");
Write_Int (UI_To_Int (RM_Size (Id)));
Write_Line (";");
Write_Eol;
end P_Float_Type;
-----------------
-- P_Int_Range --
-----------------
procedure P_Int_Range (Size : Pos) is
begin
Write_Str (" is range -(2 **");
Write_Int (Size - 1);
Write_Str (")");
Write_Str (" .. +(2 **");
Write_Int (Size - 1);
Write_Str (" - 1);");
Write_Eol;
end P_Int_Range;
------------------
-- P_Mixed_Name --
------------------
procedure P_Mixed_Name (Id : Name_Id) is
begin
Get_Name_String (Id);
for J in 1 .. Name_Len loop
if J = 1 or else Name_Buffer (J - 1) = '_' then
Name_Buffer (J) := Fold_Upper (Name_Buffer (J));
end if;
end loop;
Write_Str (Name_Buffer (1 .. Name_Len));
end P_Mixed_Name;
-- Start of processing for Print_Standard
begin
P ("-- Representation of package Standard");
Write_Eol;
P ("-- This is not accurate Ada, since new base types cannot be ");
P ("-- created, but the listing shows the target dependent");
P ("-- characteristics of the Standard types for this compiler");
Write_Eol;
P ("package Standard is");
P ("pragma Pure (Standard);");
Write_Eol;
P (" type Boolean is (False, True);");
P (" for Boolean'Size use 1;");
P (" for Boolean use (False => 0, True => 1);");
Write_Eol;
-- Integer types
Write_Str (" type Integer");
P_Int_Range (Standard_Integer_Size);
Write_Str (" for Integer'Size use ");
Write_Int (Standard_Integer_Size);
P (";");
Write_Eol;
P (" subtype Natural is Integer range 0 .. Integer'Last;");
P (" subtype Positive is Integer range 1 .. Integer'Last;");
Write_Eol;
Write_Str (" type Short_Short_Integer");
P_Int_Range (Standard_Short_Short_Integer_Size);
Write_Str (" for Short_Short_Integer'Size use ");
Write_Int (Standard_Short_Short_Integer_Size);
P (";");
Write_Eol;
Write_Str (" type Short_Integer");
P_Int_Range (Standard_Short_Integer_Size);
Write_Str (" for Short_Integer'Size use ");
Write_Int (Standard_Short_Integer_Size);
P (";");
Write_Eol;
Write_Str (" type Long_Integer");
P_Int_Range (Standard_Long_Integer_Size);
Write_Str (" for Long_Integer'Size use ");
Write_Int (Standard_Long_Integer_Size);
P (";");
Write_Eol;
Write_Str (" type Long_Long_Integer");
P_Int_Range (Standard_Long_Long_Integer_Size);
Write_Str (" for Long_Long_Integer'Size use ");
Write_Int (Standard_Long_Long_Integer_Size);
P (";");
Write_Eol;
Write_Str (" type Long_Long_Long_Integer");
P_Int_Range (Standard_Long_Long_Long_Integer_Size);
Write_Str (" for Long_Long_Long_Integer'Size use ");
Write_Int (Standard_Long_Long_Long_Integer_Size);
P (";");
Write_Eol;
-- Floating point types
P_Float_Type (Standard_Short_Float);
P_Float_Type (Standard_Float);
P_Float_Type (Standard_Long_Float);
P_Float_Type (Standard_Long_Long_Float);
P (" type Character is (...)");
Write_Str (" for Character'Size use ");
Write_Int (Standard_Character_Size);
P (";");
P (" -- See RM A.1(35) for details of this type");
Write_Eol;
P (" type Wide_Character is (...)");
Write_Str (" for Wide_Character'Size use ");
Write_Int (Standard_Wide_Character_Size);
P (";");
P (" -- See RM A.1(36) for details of this type");
Write_Eol;
P (" type Wide_Wide_Character is (...)");
Write_Str (" for Wide_Wide_Character'Size use ");
Write_Int (Standard_Wide_Wide_Character_Size);
P (";");
P (" -- See RM A.1(36) for details of this type");
P (" type String is array (Positive range <>) of Character;");
P (" pragma Pack (String);");
Write_Eol;
P (" type Wide_String is array (Positive range <>)" &
" of Wide_Character;");
P (" pragma Pack (Wide_String);");
Write_Eol;
P (" type Wide_Wide_String is array (Positive range <>)" &
" of Wide_Wide_Character;");
P (" pragma Pack (Wide_Wide_String);");
Write_Eol;
-- We only have one representation each for 32-bit and 64-bit sizes,
-- so select the right one based on Duration_32_Bits_On_Target.
if Duration_32_Bits_On_Target then
P (" type Duration is delta 0.020");
P (" range -((2 ** 31) * 0.020) ..");
P (" +((2 ** 31 - 1) * 0.020);");
P (" for Duration'Small use 0.020;");
else
P (" type Duration is delta 0.000000001");
P (" range -((2 ** 63) * 0.000000001) ..");
P (" +((2 ** 63 - 1) * 0.000000001);");
P (" for Duration'Small use 0.000000001;");
end if;
Write_Eol;
P (" Constraint_Error : exception;");
P (" Program_Error : exception;");
P (" Storage_Error : exception;");
P (" Tasking_Error : exception;");
P (" Numeric_Error : exception renames Constraint_Error;");
Write_Eol;
P ("end Standard;");
end Print_Standard;
-------------------------
-- Register_Float_Type --
-------------------------
procedure Register_Float_Type
(Name : String;
Digs : Positive;
Float_Rep : Float_Rep_Kind;
Precision : Positive;
Size : Positive;
Alignment : Natural)
is
pragma Unreferenced (Precision);
-- See Build_Float_Type for the rationale
Ent : constant Entity_Id := New_Standard_Entity (Name);
begin
Set_Defining_Identifier (New_Node (N_Full_Type_Declaration, Stloc), Ent);
Set_Scope (Ent, Standard_Standard);
Build_Float_Type
(Ent, Pos (Digs), Float_Rep, Int (Size), Int (Alignment / 8));
Append_New_Elmt (Ent, Back_End_Float_Types);
end Register_Float_Type;
----------------------
-- Set_Float_Bounds --
----------------------
procedure Set_Float_Bounds (Id : Entity_Id) is
L : Node_Id;
H : Node_Id;
-- Low and high bounds of literal value
R : Node_Id;
-- Range specification
Radix : constant Uint := Machine_Radix_Value (Id);
Mantissa : constant Uint := Machine_Mantissa_Value (Id);
Emax : constant Uint := Machine_Emax_Value (Id);
Significand : constant Uint := Radix ** Mantissa - 1;
Exponent : constant Uint := Emax - Mantissa;
begin
H := Make_Float_Literal (Stloc, Radix, Significand, Exponent);
L := Make_Float_Literal (Stloc, Radix, -Significand, Exponent);
Set_Etype (L, Id);
Set_Is_Static_Expression (L);
Set_Etype (H, Id);
Set_Is_Static_Expression (H);
R := New_Node (N_Range, Stloc);
Set_Low_Bound (R, L);
Set_High_Bound (R, H);
Set_Includes_Infinities (R, True);
Set_Scalar_Range (Id, R);
Set_Etype (R, Id);
Set_Parent (R, Id);
end Set_Float_Bounds;
------------------------
-- Set_Integer_Bounds --
------------------------
procedure Set_Integer_Bounds
(Id : Entity_Id;
Typ : Entity_Id;
Lb : Uint;
Hb : Uint)
is
L : Node_Id;
H : Node_Id;
-- Low and high bounds of literal value
R : Node_Id;
-- Range specification
begin
L := Make_Integer (Lb);
H := Make_Integer (Hb);
Set_Etype (L, Typ);
Set_Etype (H, Typ);
R := New_Node (N_Range, Stloc);
Set_Low_Bound (R, L);
Set_High_Bound (R, H);
Set_Scalar_Range (Id, R);
Set_Etype (R, Typ);
Set_Parent (R, Id);
Set_Is_Unsigned_Type (Id, Lb >= 0);
end Set_Integer_Bounds;
end CStand;
|
Rodeo-McCabe/orka | Ada | 889 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <[email protected]>
--
-- 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 GL.Types;
package Orka.SIMD.SSE2.Doubles is
pragma Pure;
type m128d is array (Index_2D) of GL.Types.Double
with Alignment => 16;
pragma Machine_Attribute (m128d, "vector_type");
end Orka.SIMD.SSE2.Doubles;
|
reznikmm/matreshka | Ada | 3,643 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Attributes;
package ODF.DOM.Attributes.SVG.Font_Family is
type ODF_SVG_Font_Family is
new XML.DOM.Attributes.DOM_Attribute with private;
private
type ODF_SVG_Font_Family is
new XML.DOM.Attributes.DOM_Attribute with null record;
end ODF.DOM.Attributes.SVG.Font_Family;
|
reznikmm/matreshka | Ada | 16,818 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Literal_Strings is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Literal_String_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Literal_String
(AMF.UML.Literal_Strings.UML_Literal_String_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Literal_String_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Literal_String
(AMF.UML.Literal_Strings.UML_Literal_String_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Literal_String_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Literal_String
(Visitor,
AMF.UML.Literal_Strings.UML_Literal_String_Access (Self),
Control);
end if;
end Visit_Element;
---------------
-- Get_Value --
---------------
overriding function Get_Value
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Value (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Value;
---------------
-- Set_Value --
---------------
overriding procedure Set_Value
(Self : not null access UML_Literal_String_Proxy;
To : AMF.Optional_String) is
begin
if To.Is_Empty then
AMF.Internals.Tables.UML_Attributes.Internal_Set_Value
(Self.Element, null);
else
AMF.Internals.Tables.UML_Attributes.Internal_Set_Value
(Self.Element,
League.Strings.Internals.Internal (To.Value));
end if;
end Set_Value;
--------------
-- Get_Type --
--------------
overriding function Get_Type
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.UML.Types.UML_Type_Access is
begin
return
AMF.UML.Types.UML_Type_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Type
(Self.Element)));
end Get_Type;
--------------
-- Set_Type --
--------------
overriding procedure Set_Type
(Self : not null access UML_Literal_String_Proxy;
To : AMF.UML.Types.UML_Type_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Type
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Type;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Literal_String_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------------------------
-- Get_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter
(Self.Element)));
end Get_Owning_Template_Parameter;
-----------------------------------
-- Set_Owning_Template_Parameter --
-----------------------------------
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Literal_String_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owning_Template_Parameter;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Literal_String_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
-------------------
-- Is_Computable --
-------------------
overriding function Is_Computable
(Self : not null access constant UML_Literal_String_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Computable unimplemented");
raise Program_Error with "Unimplemented procedure UML_Literal_String_Proxy.Is_Computable";
return Is_Computable (Self);
end Is_Computable;
------------------
-- String_Value --
------------------
overriding function String_Value
(Self : not null access constant UML_Literal_String_Proxy)
return League.Strings.Universal_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "String_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_Literal_String_Proxy.String_Value";
return String_Value (Self);
end String_Value;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_Literal_String_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Literal_String_Proxy.Is_Compatible_With";
return Is_Compatible_With (Self, P);
end Is_Compatible_With;
------------------
-- String_Value --
------------------
overriding function String_Value
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.Optional_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "String_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_Literal_String_Proxy.String_Value";
return String_Value (Self);
end String_Value;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Literal_String_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Literal_String_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Literal_String_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Literal_String_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Literal_String_Proxy.Namespace";
return Namespace (Self);
end Namespace;
---------------------------
-- Is_Template_Parameter --
---------------------------
overriding function Is_Template_Parameter
(Self : not null access constant UML_Literal_String_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented");
raise Program_Error with "Unimplemented procedure UML_Literal_String_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
end AMF.Internals.UML_Literal_Strings;
|
damaki/libkeccak | Ada | 6,062 | adb | -------------------------------------------------------------------------------
-- 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 Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_IO;
with Ada.Unchecked_Deallocation;
with Interfaces; use Interfaces;
with Keccak.Types;
with Test_Vectors; use Test_Vectors;
package body TupleHash_Runner
is
procedure Free is new Ada.Unchecked_Deallocation
(Object => Keccak.Types.Byte_Array,
Name => Byte_Array_Access);
procedure Run_Tests (File_Name : in String;
XOF : in Boolean;
Num_Passed : out Natural;
Num_Failed : out Natural)
is
use type Keccak.Types.Byte_Array;
package Integer_IO is new Ada.Text_IO.Integer_IO (Integer);
S_Key : constant Unbounded_String := To_Unbounded_String ("S");
Tuple_Key : constant Unbounded_String := To_Unbounded_String ("Tuple");
OutLen_Key : constant Unbounded_String := To_Unbounded_String ("OutLen");
Out_Key : constant Unbounded_String := To_Unbounded_String ("Out");
Schema : Test_Vectors.Schema_Maps.Map;
Tests : Test_Vectors.Lists.List;
Ctx : TupleHash.Context;
Output : Byte_Array_Access;
OutLen : Natural;
begin
Num_Passed := 0;
Num_Failed := 0;
-- Setup schema
Schema.Insert (Key => S_Key,
New_Item => Schema_Entry'(VType => String_Type,
Required => True,
Is_List => False));
Schema.Insert (Key => Tuple_Key,
New_Item => Schema_Entry'(VType => Hex_Array_Type,
Required => True,
Is_List => True));
Schema.Insert (Key => OutLen_Key,
New_Item => Schema_Entry'(VType => Integer_Type,
Required => True,
Is_List => False));
Schema.Insert (Key => Out_Key,
New_Item => Schema_Entry'(VType => Hex_Array_Type,
Required => True,
Is_List => False));
-- Load the test file using the file name given on the command line
Ada.Text_IO.Put_Line ("Loading file: " & File_Name);
Test_Vectors.Load (File_Name => File_Name,
Schema => Schema,
Vectors_List => Tests);
Ada.Text_IO.Put ("Running ");
Integer_IO.Put (Integer (Tests.Length), Width => 0);
Ada.Text_IO.Put_Line (" tests ...");
-- Run each test.
for C of Tests loop
TupleHash.Init (Ctx => Ctx,
Customization => To_String (C.Element (S_Key).First_Element.Str));
for T of C.Element (Tuple_Key) loop
TupleHash.Update_Tuple_Item (Ctx => Ctx,
Item => T.Hex.all);
end loop;
Output := new Keccak.Types.Byte_Array (C.Element (Out_Key).First_Element.Hex.all'Range);
if XOF then
TupleHash.Extract (Ctx, Output.all);
else
TupleHash.Finish (Ctx, Output.all);
end if;
-- Mask any unused bits from the output.
OutLen := C.Element (OutLen_Key).First_Element.Int;
if OutLen mod 8 /= 0 then
Output.all (Output.all'Last) :=
Output.all (Output.all'Last) and Keccak.Types.Byte ((2**(OutLen mod 8)) - 1);
end if;
-- Check output
if Output.all = C.Element (Out_Key).First_Element.Hex.all then
Num_Passed := Num_Passed + 1;
else
Num_Failed := Num_Failed + 1;
-- Display a message on failure to help with debugging.
Ada.Text_IO.Put_Line ("FAILURE:");
Ada.Text_IO.Put (" Expected MD: ");
Ada.Text_IO.Put (Byte_Array_To_String (C.Element (Out_Key).First_Element.Hex.all));
Ada.Text_IO.New_Line;
Ada.Text_IO.Put (" Actual MD: ");
Ada.Text_IO.Put (Byte_Array_To_String (Output.all));
Ada.Text_IO.New_Line;
end if;
Free (Output);
end loop;
end Run_Tests;
end TupleHash_Runner;
|
reznikmm/matreshka | Ada | 3,664 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Office_Styles_Elements is
pragma Preelaborate;
type ODF_Office_Styles is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Office_Styles_Access is
access all ODF_Office_Styles'Class
with Storage_Size => 0;
end ODF.DOM.Office_Styles_Elements;
|
onox/orka | Ada | 978 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <[email protected]>
--
-- 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 Orka.SIMD.SSE.Singles;
package Orka.SIMD.SSE4_1.Singles.Arithmetic is
pragma Pure;
use Orka.SIMD.SSE.Singles;
function Dot (Left, Right : m128; Mask : Integer_32) return m128
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_dpps";
end Orka.SIMD.SSE4_1.Singles.Arithmetic;
|
zhmu/ananas | Ada | 2,596 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . I M G _ B I U --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package does not require a body, since it is an instantiation. We
-- provide a dummy file containing a No_Body pragma so that previous versions
-- of the body (which did exist) will not interfere.
pragma No_Body;
|
reznikmm/matreshka | Ada | 4,576 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Table.End_Y_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Table_End_Y_Attribute_Node is
begin
return Self : Table_End_Y_Attribute_Node do
Matreshka.ODF_Table.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Table_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Table_End_Y_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.End_Y_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Table_URI,
Matreshka.ODF_String_Constants.End_Y_Attribute,
Table_End_Y_Attribute_Node'Tag);
end Matreshka.ODF_Table.End_Y_Attributes;
|
greifentor/archimedes-legacy | Ada | 26,532 | ads | <Diagramm>
<AdditionalSQLCode>
<SQLCode>
<AdditionalSQLCodePostChanging></AdditionalSQLCodePostChanging>
<AdditionalSQLCodePostReducing></AdditionalSQLCodePostReducing>
<AdditionalSQLCodePreChanging></AdditionalSQLCodePreChanging>
<AdditionalSQLCodePreExtending></AdditionalSQLCodePreExtending>
</SQLCode>
</AdditionalSQLCode>
<Colors>
<Anzahl>23</Anzahl>
<Color0>
<B>255</B>
<G>0</G>
<Name>blau</Name>
<R>0</R>
</Color0>
<Color1>
<B>221</B>
<G>212</G>
<Name>blaugrau</Name>
<R>175</R>
</Color1>
<Color10>
<B>192</B>
<G>192</G>
<Name>hellgrau</Name>
<R>192</R>
</Color10>
<Color11>
<B>255</B>
<G>0</G>
<Name>kamesinrot</Name>
<R>255</R>
</Color11>
<Color12>
<B>0</B>
<G>200</G>
<Name>orange</Name>
<R>255</R>
</Color12>
<Color13>
<B>255</B>
<G>247</G>
<Name>pastell-blau</Name>
<R>211</R>
</Color13>
<Color14>
<B>186</B>
<G>245</G>
<Name>pastell-gelb</Name>
<R>255</R>
</Color14>
<Color15>
<B>234</B>
<G>255</G>
<Name>pastell-gr&uuml;n</Name>
<R>211</R>
</Color15>
<Color16>
<B>255</B>
<G>211</G>
<Name>pastell-lila</Name>
<R>244</R>
</Color16>
<Color17>
<B>191</B>
<G>165</G>
<Name>pastell-rot</Name>
<R>244</R>
</Color17>
<Color18>
<B>175</B>
<G>175</G>
<Name>pink</Name>
<R>255</R>
</Color18>
<Color19>
<B>0</B>
<G>0</G>
<Name>rot</Name>
<R>255</R>
</Color19>
<Color2>
<B>61</B>
<G>125</G>
<Name>braun</Name>
<R>170</R>
</Color2>
<Color20>
<B>0</B>
<G>0</G>
<Name>schwarz</Name>
<R>0</R>
</Color20>
<Color21>
<B>255</B>
<G>255</G>
<Name>t&uuml;rkis</Name>
<R>0</R>
</Color21>
<Color22>
<B>255</B>
<G>255</G>
<Name>wei&szlig;</Name>
<R>255</R>
</Color22>
<Color3>
<B>64</B>
<G>64</G>
<Name>dunkelgrau</Name>
<R>64</R>
</Color3>
<Color4>
<B>84</B>
<G>132</G>
<Name>dunkelgr&uuml;n</Name>
<R>94</R>
</Color4>
<Color5>
<B>0</B>
<G>255</G>
<Name>gelb</Name>
<R>255</R>
</Color5>
<Color6>
<B>0</B>
<G>225</G>
<Name>goldgelb</Name>
<R>255</R>
</Color6>
<Color7>
<B>128</B>
<G>128</G>
<Name>grau</Name>
<R>128</R>
</Color7>
<Color8>
<B>0</B>
<G>255</G>
<Name>gr&uuml;n</Name>
<R>0</R>
</Color8>
<Color9>
<B>255</B>
<G>212</G>
<Name>hellblau</Name>
<R>191</R>
</Color9>
</Colors>
<ComplexIndices>
<IndexCount>0</IndexCount>
</ComplexIndices>
<DataSource>
<Import>
<DBName></DBName>
<Description></Description>
<Domains>false</Domains>
<Driver></Driver>
<Name></Name>
<Referenzen>false</Referenzen>
<User></User>
</Import>
</DataSource>
<DatabaseConnections>
<Count>2</Count>
<DatabaseConnection0>
<DBExecMode>POSTGRESQL</DBExecMode>
<Driver>org.postgresql.Driver</Driver>
<Name>Test-DB (Postgre)</Name>
<Quote>"</Quote>
<SetDomains>false</SetDomains>
<SetNotNull>true</SetNotNull>
<SetReferences>true</SetReferences>
<URL>jdbc:postgresql://mykene/TEST_OLI_ISIS_2</URL>
<UserName>op1</UserName>
</DatabaseConnection0>
<DatabaseConnection1>
<DBExecMode>HSQL</DBExecMode>
<Driver>org.hsqldb.jdbcDriver</Driver>
<Name>Test-DB (HSQL)</Name>
<Quote>"</Quote>
<SetDomains>false</SetDomains>
<SetNotNull>true</SetNotNull>
<SetReferences>true</SetReferences>
<URL>jdbc:hsqldb:unittests/db/tst</URL>
<UserName>sa</UserName>
</DatabaseConnection1>
</DatabaseConnections>
<DefaultComment>
<Anzahl>0</Anzahl>
</DefaultComment>
<Domains>
<Anzahl>6</Anzahl>
<Domain0>
<Datatype>4</Datatype>
<History></History>
<Initialwert>NULL</Initialwert>
<Kommentar></Kommentar>
<Length>0</Length>
<NKS>0</NKS>
<Name>Boolean</Name>
<Parameters></Parameters>
</Domain0>
<Domain1>
<Datatype>-5</Datatype>
<History></History>
<Initialwert>NULL</Initialwert>
<Kommentar></Kommentar>
<Length>0</Length>
<NKS>0</NKS>
<Name>Ident</Name>
<Parameters></Parameters>
</Domain1>
<Domain2>
<Datatype>12</Datatype>
<History></History>
<Initialwert>NULL</Initialwert>
<Kommentar></Kommentar>
<Length>500</Length>
<NKS>0</NKS>
<Name>LongName</Name>
<Parameters></Parameters>
</Domain2>
<Domain3>
<Datatype>12</Datatype>
<History></History>
<Initialwert>NULL</Initialwert>
<Kommentar></Kommentar>
<Length>200</Length>
<NKS>0</NKS>
<Name>Name</Name>
<Parameters></Parameters>
</Domain3>
<Domain4>
<Datatype>8</Datatype>
<History></History>
<Initialwert>NULL</Initialwert>
<Kommentar></Kommentar>
<Length>0</Length>
<NKS>0</NKS>
<Name>Payment</Name>
<Parameters></Parameters>
</Domain4>
<Domain5>
<Datatype>2</Datatype>
<History></History>
<Initialwert>NULL</Initialwert>
<Kommentar></Kommentar>
<Length>8</Length>
<NKS>2</NKS>
<Name>Price</Name>
<Parameters></Parameters>
</Domain5>
</Domains>
<Factories>
<Object>archimedes.legacy.scheme.DefaultObjectFactory</Object>
</Factories>
<Pages>
<PerColumn>5</PerColumn>
<PerRow>10</PerRow>
</Pages>
<Parameter>
<AdditionalSQLScriptListener></AdditionalSQLScriptListener>
<Applicationname></Applicationname>
<AufgehobeneAusblenden>false</AufgehobeneAusblenden>
<Autor>&lt;null&gt;</Autor>
<Basepackagename></Basepackagename>
<CodeFactoryClassName></CodeFactoryClassName>
<Codebasispfad>.\</Codebasispfad>
<DBVersionDBVersionColumn></DBVersionDBVersionColumn>
<DBVersionDescriptionColumn></DBVersionDescriptionColumn>
<DBVersionTablename></DBVersionTablename>
<History></History>
<Kommentar>&lt;null&gt;</Kommentar>
<Name>TST</Name>
<Optionen>
<Anzahl>0</Anzahl>
</Optionen>
<PflichtfelderMarkieren>false</PflichtfelderMarkieren>
<ReferenzierteSpaltenAnzeigen>true</ReferenzierteSpaltenAnzeigen>
<RelationColorExternalTables>hellgrau</RelationColorExternalTables>
<RelationColorRegular>schwarz</RelationColorRegular>
<SchemaName>TST</SchemaName>
<Schriftgroessen>
<Tabelleninhalte>12</Tabelleninhalte>
<Ueberschriften>24</Ueberschriften>
<Untertitel>12</Untertitel>
</Schriftgroessen>
<Scripte>
<AfterWrite>&lt;null&gt;</AfterWrite>
</Scripte>
<TechnischeFelderAusgrauen>false</TechnischeFelderAusgrauen>
<TransienteFelderAusgrauen>false</TransienteFelderAusgrauen>
<UdschebtiBaseClassName></UdschebtiBaseClassName>
<Version>1</Version>
<Versionsdatum>08.12.2015</Versionsdatum>
<Versionskommentar>&lt;null&gt;</Versionskommentar>
</Parameter>
<Sequences>
<Count>0</Count>
</Sequences>
<Stereotype>
<Anzahl>0</Anzahl>
</Stereotype>
<Tabellen>
<Anzahl>1</Anzahl>
<Tabelle0>
<Aufgehoben>false</Aufgehoben>
<Codegenerator>
<AuswahlMembers>
<Anzahl>0</Anzahl>
</AuswahlMembers>
<CompareMembers>
<Anzahl>0</Anzahl>
</CompareMembers>
<Equalsmembers>
<Anzahl>0</Anzahl>
</Equalsmembers>
<HashCodeMembers>
<Anzahl>0</Anzahl>
</HashCodeMembers>
<NReferenzen>
<Anzahl>0</Anzahl>
</NReferenzen>
<OrderMembers>
<Anzahl>0</Anzahl>
</OrderMembers>
<ToComboStringMembers>
<Anzahl>0</Anzahl>
</ToComboStringMembers>
<ToStringMembers>
<Anzahl>0</Anzahl>
</ToStringMembers>
</Codegenerator>
<ExternalTable>false</ExternalTable>
<Farben>
<Hintergrund>wei&szlig;</Hintergrund>
<Schrift>schwarz</Schrift>
</Farben>
<FirstGenerationDone>false</FirstGenerationDone>
<History>@changed OLI - Added.$BR$@changed OLI - Added column: Id.</History>
<InDevelopment>false</InDevelopment>
<Kommentar></Kommentar>
<NMRelation>false</NMRelation>
<Name>Author</Name>
<Options>
<Count>0</Count>
</Options>
<Panels>
<Anzahl>1</Anzahl>
<Panel0>
<PanelClass></PanelClass>
<PanelNumber>0</PanelNumber>
<TabMnemonic>1</TabMnemonic>
<TabTitle>1.Daten</TabTitle>
<TabToolTipText>Hier können Sie die Daten des Objekt warten</TabToolTipText>
</Panel0>
</Panels>
<Spalten>
<Anzahl>6</Anzahl>
<Codegenerator>
<ActiveInApplication>false</ActiveInApplication>
<AdditionalCreateConstraints></AdditionalCreateConstraints>
<Codegeneratoroptionen></Codegeneratoroptionen>
<Codeverzeichnis>.</Codeverzeichnis>
<Codieren>true</Codieren>
<DynamicCode>true</DynamicCode>
<Inherited>false</Inherited>
<Kontextname></Kontextname>
<UniqueFormula></UniqueFormula>
</Codegenerator>
<Spalte0>
<AlterInBatch>false</AlterInBatch>
<Aufgehoben>false</Aufgehoben>
<CanBeReferenced>true</CanBeReferenced>
<Disabled>false</Disabled>
<Domain>Ident</Domain>
<Editordescriptor>
<Editormember>false</Editormember>
<LabelText></LabelText>
<MaxCharacters>0</MaxCharacters>
<Mnemonic></Mnemonic>
<Position>0</Position>
<ReferenceWeight>keine</ReferenceWeight>
<RessourceIdentifier></RessourceIdentifier>
<ToolTipText></ToolTipText>
</Editordescriptor>
<ForeignKey>false</ForeignKey>
<Global>false</Global>
<GlobalId>false</GlobalId>
<HideReference>false</HideReference>
<History>@changed OLI - Added.</History>
<IndexSearchMember>false</IndexSearchMember>
<Indexed>false</Indexed>
<IndividualDefaultValue></IndividualDefaultValue>
<Kodiert>false</Kodiert>
<Kommentar></Kommentar>
<Konsistenz>
<Writeablemember>false</Writeablemember>
</Konsistenz>
<LastModificationField>false</LastModificationField>
<ListItemField>false</ListItemField>
<Name>Author</Name>
<NotNull>false</NotNull>
<PanelNumber>0</PanelNumber>
<Parameter></Parameter>
<PrimaryKey>true</PrimaryKey>
<RemovedStateField>false</RemovedStateField>
<SequenceForKeyGeneration></SequenceForKeyGeneration>
<SuppressForeignKeyConstraints>false</SuppressForeignKeyConstraints>
<TechnicalField>false</TechnicalField>
<Transient>false</Transient>
<Unique>false</Unique>
</Spalte0>
<Spalte1>
<AlterInBatch>false</AlterInBatch>
<Aufgehoben>false</Aufgehoben>
<CanBeReferenced>false</CanBeReferenced>
<Disabled>false</Disabled>
<Domain>Boolean</Domain>
<Editordescriptor>
<Editormember>false</Editormember>
<LabelText></LabelText>
<MaxCharacters>0</MaxCharacters>
<Mnemonic></Mnemonic>
<Position>0</Position>
<ReferenceWeight>keine</ReferenceWeight>
<RessourceIdentifier></RessourceIdentifier>
<ToolTipText></ToolTipText>
</Editordescriptor>
<ForeignKey>false</ForeignKey>
<Global>false</Global>
<GlobalId>false</GlobalId>
<HideReference>false</HideReference>
<History>@changed OLI - Added.</History>
<IndexSearchMember>false</IndexSearchMember>
<Indexed>false</Indexed>
<IndividualDefaultValue></IndividualDefaultValue>
<Kodiert>false</Kodiert>
<Kommentar></Kommentar>
<Konsistenz>
<Writeablemember>false</Writeablemember>
</Konsistenz>
<LastModificationField>false</LastModificationField>
<ListItemField>false</ListItemField>
<Name>Active</Name>
<NotNull>false</NotNull>
<PanelNumber>0</PanelNumber>
<Parameter></Parameter>
<PrimaryKey>false</PrimaryKey>
<RemovedStateField>false</RemovedStateField>
<SequenceForKeyGeneration></SequenceForKeyGeneration>
<SuppressForeignKeyConstraints>false</SuppressForeignKeyConstraints>
<TechnicalField>false</TechnicalField>
<Transient>false</Transient>
<Unique>false</Unique>
</Spalte1>
<Spalte2>
<AlterInBatch>false</AlterInBatch>
<Aufgehoben>false</Aufgehoben>
<CanBeReferenced>false</CanBeReferenced>
<Disabled>false</Disabled>
<Domain>Name</Domain>
<Editordescriptor>
<Editormember>false</Editormember>
<LabelText></LabelText>
<MaxCharacters>0</MaxCharacters>
<Mnemonic></Mnemonic>
<Position>0</Position>
<ReferenceWeight>keine</ReferenceWeight>
<RessourceIdentifier></RessourceIdentifier>
<ToolTipText></ToolTipText>
</Editordescriptor>
<ForeignKey>false</ForeignKey>
<Global>false</Global>
<GlobalId>false</GlobalId>
<HideReference>false</HideReference>
<History>@changed OLI - Added.</History>
<IndexSearchMember>false</IndexSearchMember>
<Indexed>false</Indexed>
<IndividualDefaultValue>'n/a'</IndividualDefaultValue>
<Kodiert>false</Kodiert>
<Kommentar></Kommentar>
<Konsistenz>
<Writeablemember>false</Writeablemember>
</Konsistenz>
<LastModificationField>false</LastModificationField>
<ListItemField>false</ListItemField>
<Name>Address</Name>
<NotNull>true</NotNull>
<PanelNumber>0</PanelNumber>
<Parameter></Parameter>
<PrimaryKey>false</PrimaryKey>
<RemovedStateField>false</RemovedStateField>
<SequenceForKeyGeneration></SequenceForKeyGeneration>
<SuppressForeignKeyConstraints>false</SuppressForeignKeyConstraints>
<TechnicalField>false</TechnicalField>
<Transient>false</Transient>
<Unique>false</Unique>
</Spalte2>
<Spalte3>
<AlterInBatch>false</AlterInBatch>
<Aufgehoben>false</Aufgehoben>
<CanBeReferenced>false</CanBeReferenced>
<Disabled>false</Disabled>
<Domain>Ident</Domain>
<Editordescriptor>
<Editormember>false</Editormember>
<LabelText></LabelText>
<MaxCharacters>0</MaxCharacters>
<Mnemonic></Mnemonic>
<Position>0</Position>
<ReferenceWeight>keine</ReferenceWeight>
<RessourceIdentifier></RessourceIdentifier>
<ToolTipText></ToolTipText>
</Editordescriptor>
<ForeignKey>false</ForeignKey>
<Global>false</Global>
<GlobalId>false</GlobalId>
<HideReference>false</HideReference>
<History>@changed OLI - Added.</History>
<IndexSearchMember>false</IndexSearchMember>
<Indexed>false</Indexed>
<IndividualDefaultValue></IndividualDefaultValue>
<Kodiert>false</Kodiert>
<Kommentar></Kommentar>
<Konsistenz>
<Writeablemember>false</Writeablemember>
</Konsistenz>
<LastModificationField>false</LastModificationField>
<ListItemField>false</ListItemField>
<Name>AuthorId</Name>
<NotNull>false</NotNull>
<PanelNumber>0</PanelNumber>
<Parameter></Parameter>
<PrimaryKey>false</PrimaryKey>
<RemovedStateField>false</RemovedStateField>
<SequenceForKeyGeneration></SequenceForKeyGeneration>
<SuppressForeignKeyConstraints>false</SuppressForeignKeyConstraints>
<TechnicalField>false</TechnicalField>
<Transient>false</Transient>
<Unique>true</Unique>
</Spalte3>
<Spalte4>
<AlterInBatch>false</AlterInBatch>
<Aufgehoben>false</Aufgehoben>
<CanBeReferenced>false</CanBeReferenced>
<Disabled>false</Disabled>
<Domain>Name</Domain>
<Editordescriptor>
<Editormember>false</Editormember>
<LabelText></LabelText>
<MaxCharacters>0</MaxCharacters>
<Mnemonic></Mnemonic>
<Position>0</Position>
<ReferenceWeight>keine</ReferenceWeight>
<RessourceIdentifier></RessourceIdentifier>
<ToolTipText></ToolTipText>
</Editordescriptor>
<ForeignKey>false</ForeignKey>
<Global>false</Global>
<GlobalId>false</GlobalId>
<HideReference>false</HideReference>
<History>@changed OLI - Added.</History>
<IndexSearchMember>false</IndexSearchMember>
<Indexed>false</Indexed>
<IndividualDefaultValue></IndividualDefaultValue>
<Kodiert>false</Kodiert>
<Kommentar></Kommentar>
<Konsistenz>
<Writeablemember>false</Writeablemember>
</Konsistenz>
<LastModificationField>false</LastModificationField>
<ListItemField>false</ListItemField>
<Name>Name</Name>
<NotNull>true</NotNull>
<PanelNumber>0</PanelNumber>
<Parameter></Parameter>
<PrimaryKey>false</PrimaryKey>
<RemovedStateField>false</RemovedStateField>
<SequenceForKeyGeneration></SequenceForKeyGeneration>
<SuppressForeignKeyConstraints>false</SuppressForeignKeyConstraints>
<TechnicalField>false</TechnicalField>
<Transient>false</Transient>
<Unique>false</Unique>
</Spalte4>
<Spalte5>
<AlterInBatch>false</AlterInBatch>
<Aufgehoben>false</Aufgehoben>
<CanBeReferenced>false</CanBeReferenced>
<Disabled>false</Disabled>
<Domain>Payment</Domain>
<Editordescriptor>
<Editormember>false</Editormember>
<LabelText></LabelText>
<MaxCharacters>0</MaxCharacters>
<Mnemonic></Mnemonic>
<Position>0</Position>
<ReferenceWeight>keine</ReferenceWeight>
<RessourceIdentifier></RessourceIdentifier>
<ToolTipText></ToolTipText>
</Editordescriptor>
<ForeignKey>false</ForeignKey>
<Global>false</Global>
<GlobalId>false</GlobalId>
<HideReference>false</HideReference>
<History>@changed OLI - Added.</History>
<IndexSearchMember>false</IndexSearchMember>
<Indexed>false</Indexed>
<IndividualDefaultValue></IndividualDefaultValue>
<Kodiert>false</Kodiert>
<Kommentar></Kommentar>
<Konsistenz>
<Writeablemember>false</Writeablemember>
</Konsistenz>
<LastModificationField>false</LastModificationField>
<ListItemField>false</ListItemField>
<Name>Payment</Name>
<NotNull>false</NotNull>
<PanelNumber>0</PanelNumber>
<Parameter></Parameter>
<PrimaryKey>false</PrimaryKey>
<RemovedStateField>false</RemovedStateField>
<SequenceForKeyGeneration></SequenceForKeyGeneration>
<SuppressForeignKeyConstraints>false</SuppressForeignKeyConstraints>
<TechnicalField>false</TechnicalField>
<Transient>false</Transient>
<Unique>false</Unique>
</Spalte5>
</Spalten>
<Stereotype>
<Anzahl>0</Anzahl>
</Stereotype>
<Views>
<Anzahl>1</Anzahl>
<View0>
<Name>Main</Name>
<X>151</X>
<Y>149</Y>
</View0>
</Views>
</Tabelle0>
</Tabellen>
<Views>
<Anzahl>1</Anzahl>
<View0>
<Beschreibung>Diese Sicht beinhaltet alle Tabellen des Schemas</Beschreibung>
<Name>Main</Name>
<ReferenzierteSpaltenAnzeigen>true</ReferenzierteSpaltenAnzeigen>
<Tabelle0>Author</Tabelle0>
<Tabellenanzahl>1</Tabellenanzahl>
<TechnischeSpaltenVerstecken>false</TechnischeSpaltenVerstecken>
</View0>
</Views>
</Diagramm>
|
reznikmm/matreshka | Ada | 818 | adb |
package body ORM.Fields.Generic_Fields is
---------
-- Get --
---------
function Get (Self : Field'Class) return Data_Type is
begin
return Self.Value;
end Get;
---------
-- Get --
---------
overriding function Get (Self : Field) return League.Holders.Holder is
begin
return To_Holder (Self.Value);
end Get;
---------
-- Set --
---------
procedure Set (Self : in out Field'Class; Value : Data_Type) is
begin
if Self.Value /= Value then
Self.Value := Value;
Self.Is_Modified := True;
end if;
end Set;
---------
-- Set --
---------
overriding procedure Set
(Self : in out Field; Value : League.Holders.Holder) is
begin
Self.Set (Element (Value));
end Set;
end ORM.Fields.Generic_Fields;
|
reznikmm/matreshka | Ada | 152,190 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- 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.
------------------------------------------------------------------------------
package AMF.Internals.Tables.UML_Metamodel.Links is
procedure Initialize;
private
procedure Initialize_1;
procedure Initialize_2;
procedure Initialize_3;
procedure Initialize_4;
procedure Initialize_5;
procedure Initialize_6;
procedure Initialize_7;
procedure Initialize_8;
procedure Initialize_9;
procedure Initialize_10;
procedure Initialize_11;
procedure Initialize_12;
procedure Initialize_13;
procedure Initialize_14;
procedure Initialize_15;
procedure Initialize_16;
procedure Initialize_17;
procedure Initialize_18;
procedure Initialize_19;
procedure Initialize_20;
procedure Initialize_21;
procedure Initialize_22;
procedure Initialize_23;
procedure Initialize_24;
procedure Initialize_25;
procedure Initialize_26;
procedure Initialize_27;
procedure Initialize_28;
procedure Initialize_29;
procedure Initialize_30;
procedure Initialize_31;
procedure Initialize_32;
procedure Initialize_33;
procedure Initialize_34;
procedure Initialize_35;
procedure Initialize_36;
procedure Initialize_37;
procedure Initialize_38;
procedure Initialize_39;
procedure Initialize_40;
procedure Initialize_41;
procedure Initialize_42;
procedure Initialize_43;
procedure Initialize_44;
procedure Initialize_45;
procedure Initialize_46;
procedure Initialize_47;
procedure Initialize_48;
procedure Initialize_49;
procedure Initialize_50;
procedure Initialize_51;
procedure Initialize_52;
procedure Initialize_53;
procedure Initialize_54;
procedure Initialize_55;
procedure Initialize_56;
procedure Initialize_57;
procedure Initialize_58;
procedure Initialize_59;
procedure Initialize_60;
procedure Initialize_61;
procedure Initialize_62;
procedure Initialize_63;
procedure Initialize_64;
procedure Initialize_65;
procedure Initialize_66;
procedure Initialize_67;
procedure Initialize_68;
procedure Initialize_69;
procedure Initialize_70;
procedure Initialize_71;
procedure Initialize_72;
procedure Initialize_73;
procedure Initialize_74;
procedure Initialize_75;
procedure Initialize_76;
procedure Initialize_77;
procedure Initialize_78;
procedure Initialize_79;
procedure Initialize_80;
procedure Initialize_81;
procedure Initialize_82;
procedure Initialize_83;
procedure Initialize_84;
procedure Initialize_85;
procedure Initialize_86;
procedure Initialize_87;
procedure Initialize_88;
procedure Initialize_89;
procedure Initialize_90;
procedure Initialize_91;
procedure Initialize_92;
procedure Initialize_93;
procedure Initialize_94;
procedure Initialize_95;
procedure Initialize_96;
procedure Initialize_97;
procedure Initialize_98;
procedure Initialize_99;
procedure Initialize_100;
procedure Initialize_101;
procedure Initialize_102;
procedure Initialize_103;
procedure Initialize_104;
procedure Initialize_105;
procedure Initialize_106;
procedure Initialize_107;
procedure Initialize_108;
procedure Initialize_109;
procedure Initialize_110;
procedure Initialize_111;
procedure Initialize_112;
procedure Initialize_113;
procedure Initialize_114;
procedure Initialize_115;
procedure Initialize_116;
procedure Initialize_117;
procedure Initialize_118;
procedure Initialize_119;
procedure Initialize_120;
procedure Initialize_121;
procedure Initialize_122;
procedure Initialize_123;
procedure Initialize_124;
procedure Initialize_125;
procedure Initialize_126;
procedure Initialize_127;
procedure Initialize_128;
procedure Initialize_129;
procedure Initialize_130;
procedure Initialize_131;
procedure Initialize_132;
procedure Initialize_133;
procedure Initialize_134;
procedure Initialize_135;
procedure Initialize_136;
procedure Initialize_137;
procedure Initialize_138;
procedure Initialize_139;
procedure Initialize_140;
procedure Initialize_141;
procedure Initialize_142;
procedure Initialize_143;
procedure Initialize_144;
procedure Initialize_145;
procedure Initialize_146;
procedure Initialize_147;
procedure Initialize_148;
procedure Initialize_149;
procedure Initialize_150;
procedure Initialize_151;
procedure Initialize_152;
procedure Initialize_153;
procedure Initialize_154;
procedure Initialize_155;
procedure Initialize_156;
procedure Initialize_157;
procedure Initialize_158;
procedure Initialize_159;
procedure Initialize_160;
procedure Initialize_161;
procedure Initialize_162;
procedure Initialize_163;
procedure Initialize_164;
procedure Initialize_165;
procedure Initialize_166;
procedure Initialize_167;
procedure Initialize_168;
procedure Initialize_169;
procedure Initialize_170;
procedure Initialize_171;
procedure Initialize_172;
procedure Initialize_173;
procedure Initialize_174;
procedure Initialize_175;
procedure Initialize_176;
procedure Initialize_177;
procedure Initialize_178;
procedure Initialize_179;
procedure Initialize_180;
procedure Initialize_181;
procedure Initialize_182;
procedure Initialize_183;
procedure Initialize_184;
procedure Initialize_185;
procedure Initialize_186;
procedure Initialize_187;
procedure Initialize_188;
procedure Initialize_189;
procedure Initialize_190;
procedure Initialize_191;
procedure Initialize_192;
procedure Initialize_193;
procedure Initialize_194;
procedure Initialize_195;
procedure Initialize_196;
procedure Initialize_197;
procedure Initialize_198;
procedure Initialize_199;
procedure Initialize_200;
procedure Initialize_201;
procedure Initialize_202;
procedure Initialize_203;
procedure Initialize_204;
procedure Initialize_205;
procedure Initialize_206;
procedure Initialize_207;
procedure Initialize_208;
procedure Initialize_209;
procedure Initialize_210;
procedure Initialize_211;
procedure Initialize_212;
procedure Initialize_213;
procedure Initialize_214;
procedure Initialize_215;
procedure Initialize_216;
procedure Initialize_217;
procedure Initialize_218;
procedure Initialize_219;
procedure Initialize_220;
procedure Initialize_221;
procedure Initialize_222;
procedure Initialize_223;
procedure Initialize_224;
procedure Initialize_225;
procedure Initialize_226;
procedure Initialize_227;
procedure Initialize_228;
procedure Initialize_229;
procedure Initialize_230;
procedure Initialize_231;
procedure Initialize_232;
procedure Initialize_233;
procedure Initialize_234;
procedure Initialize_235;
procedure Initialize_236;
procedure Initialize_237;
procedure Initialize_238;
procedure Initialize_239;
procedure Initialize_240;
procedure Initialize_241;
procedure Initialize_242;
procedure Initialize_243;
procedure Initialize_244;
procedure Initialize_245;
procedure Initialize_246;
procedure Initialize_247;
procedure Initialize_248;
procedure Initialize_249;
procedure Initialize_250;
procedure Initialize_251;
procedure Initialize_252;
procedure Initialize_253;
procedure Initialize_254;
procedure Initialize_255;
procedure Initialize_256;
procedure Initialize_257;
procedure Initialize_258;
procedure Initialize_259;
procedure Initialize_260;
procedure Initialize_261;
procedure Initialize_262;
procedure Initialize_263;
procedure Initialize_264;
procedure Initialize_265;
procedure Initialize_266;
procedure Initialize_267;
procedure Initialize_268;
procedure Initialize_269;
procedure Initialize_270;
procedure Initialize_271;
procedure Initialize_272;
procedure Initialize_273;
procedure Initialize_274;
procedure Initialize_275;
procedure Initialize_276;
procedure Initialize_277;
procedure Initialize_278;
procedure Initialize_279;
procedure Initialize_280;
procedure Initialize_281;
procedure Initialize_282;
procedure Initialize_283;
procedure Initialize_284;
procedure Initialize_285;
procedure Initialize_286;
procedure Initialize_287;
procedure Initialize_288;
procedure Initialize_289;
procedure Initialize_290;
procedure Initialize_291;
procedure Initialize_292;
procedure Initialize_293;
procedure Initialize_294;
procedure Initialize_295;
procedure Initialize_296;
procedure Initialize_297;
procedure Initialize_298;
procedure Initialize_299;
procedure Initialize_300;
procedure Initialize_301;
procedure Initialize_302;
procedure Initialize_303;
procedure Initialize_304;
procedure Initialize_305;
procedure Initialize_306;
procedure Initialize_307;
procedure Initialize_308;
procedure Initialize_309;
procedure Initialize_310;
procedure Initialize_311;
procedure Initialize_312;
procedure Initialize_313;
procedure Initialize_314;
procedure Initialize_315;
procedure Initialize_316;
procedure Initialize_317;
procedure Initialize_318;
procedure Initialize_319;
procedure Initialize_320;
procedure Initialize_321;
procedure Initialize_322;
procedure Initialize_323;
procedure Initialize_324;
procedure Initialize_325;
procedure Initialize_326;
procedure Initialize_327;
procedure Initialize_328;
procedure Initialize_329;
procedure Initialize_330;
procedure Initialize_331;
procedure Initialize_332;
procedure Initialize_333;
procedure Initialize_334;
procedure Initialize_335;
procedure Initialize_336;
procedure Initialize_337;
procedure Initialize_338;
procedure Initialize_339;
procedure Initialize_340;
procedure Initialize_341;
procedure Initialize_342;
procedure Initialize_343;
procedure Initialize_344;
procedure Initialize_345;
procedure Initialize_346;
procedure Initialize_347;
procedure Initialize_348;
procedure Initialize_349;
procedure Initialize_350;
procedure Initialize_351;
procedure Initialize_352;
procedure Initialize_353;
procedure Initialize_354;
procedure Initialize_355;
procedure Initialize_356;
procedure Initialize_357;
procedure Initialize_358;
procedure Initialize_359;
procedure Initialize_360;
procedure Initialize_361;
procedure Initialize_362;
procedure Initialize_363;
procedure Initialize_364;
procedure Initialize_365;
procedure Initialize_366;
procedure Initialize_367;
procedure Initialize_368;
procedure Initialize_369;
procedure Initialize_370;
procedure Initialize_371;
procedure Initialize_372;
procedure Initialize_373;
procedure Initialize_374;
procedure Initialize_375;
procedure Initialize_376;
procedure Initialize_377;
procedure Initialize_378;
procedure Initialize_379;
procedure Initialize_380;
procedure Initialize_381;
procedure Initialize_382;
procedure Initialize_383;
procedure Initialize_384;
procedure Initialize_385;
procedure Initialize_386;
procedure Initialize_387;
procedure Initialize_388;
procedure Initialize_389;
procedure Initialize_390;
procedure Initialize_391;
procedure Initialize_392;
procedure Initialize_393;
procedure Initialize_394;
procedure Initialize_395;
procedure Initialize_396;
procedure Initialize_397;
procedure Initialize_398;
procedure Initialize_399;
procedure Initialize_400;
procedure Initialize_401;
procedure Initialize_402;
procedure Initialize_403;
procedure Initialize_404;
procedure Initialize_405;
procedure Initialize_406;
procedure Initialize_407;
procedure Initialize_408;
procedure Initialize_409;
procedure Initialize_410;
procedure Initialize_411;
procedure Initialize_412;
procedure Initialize_413;
procedure Initialize_414;
procedure Initialize_415;
procedure Initialize_416;
procedure Initialize_417;
procedure Initialize_418;
procedure Initialize_419;
procedure Initialize_420;
procedure Initialize_421;
procedure Initialize_422;
procedure Initialize_423;
procedure Initialize_424;
procedure Initialize_425;
procedure Initialize_426;
procedure Initialize_427;
procedure Initialize_428;
procedure Initialize_429;
procedure Initialize_430;
procedure Initialize_431;
procedure Initialize_432;
procedure Initialize_433;
procedure Initialize_434;
procedure Initialize_435;
procedure Initialize_436;
procedure Initialize_437;
procedure Initialize_438;
procedure Initialize_439;
procedure Initialize_440;
procedure Initialize_441;
procedure Initialize_442;
procedure Initialize_443;
procedure Initialize_444;
procedure Initialize_445;
procedure Initialize_446;
procedure Initialize_447;
procedure Initialize_448;
procedure Initialize_449;
procedure Initialize_450;
procedure Initialize_451;
procedure Initialize_452;
procedure Initialize_453;
procedure Initialize_454;
procedure Initialize_455;
procedure Initialize_456;
procedure Initialize_457;
procedure Initialize_458;
procedure Initialize_459;
procedure Initialize_460;
procedure Initialize_461;
procedure Initialize_462;
procedure Initialize_463;
procedure Initialize_464;
procedure Initialize_465;
procedure Initialize_466;
procedure Initialize_467;
procedure Initialize_468;
procedure Initialize_469;
procedure Initialize_470;
procedure Initialize_471;
procedure Initialize_472;
procedure Initialize_473;
procedure Initialize_474;
procedure Initialize_475;
procedure Initialize_476;
procedure Initialize_477;
procedure Initialize_478;
procedure Initialize_479;
procedure Initialize_480;
procedure Initialize_481;
procedure Initialize_482;
procedure Initialize_483;
procedure Initialize_484;
procedure Initialize_485;
procedure Initialize_486;
procedure Initialize_487;
procedure Initialize_488;
procedure Initialize_489;
procedure Initialize_490;
procedure Initialize_491;
procedure Initialize_492;
procedure Initialize_493;
procedure Initialize_494;
procedure Initialize_495;
procedure Initialize_496;
procedure Initialize_497;
procedure Initialize_498;
procedure Initialize_499;
procedure Initialize_500;
procedure Initialize_501;
procedure Initialize_502;
procedure Initialize_503;
procedure Initialize_504;
procedure Initialize_505;
procedure Initialize_506;
procedure Initialize_507;
procedure Initialize_508;
procedure Initialize_509;
procedure Initialize_510;
procedure Initialize_511;
procedure Initialize_512;
procedure Initialize_513;
procedure Initialize_514;
procedure Initialize_515;
procedure Initialize_516;
procedure Initialize_517;
procedure Initialize_518;
procedure Initialize_519;
procedure Initialize_520;
procedure Initialize_521;
procedure Initialize_522;
procedure Initialize_523;
procedure Initialize_524;
procedure Initialize_525;
procedure Initialize_526;
procedure Initialize_527;
procedure Initialize_528;
procedure Initialize_529;
procedure Initialize_530;
procedure Initialize_531;
procedure Initialize_532;
procedure Initialize_533;
procedure Initialize_534;
procedure Initialize_535;
procedure Initialize_536;
procedure Initialize_537;
procedure Initialize_538;
procedure Initialize_539;
procedure Initialize_540;
procedure Initialize_541;
procedure Initialize_542;
procedure Initialize_543;
procedure Initialize_544;
procedure Initialize_545;
procedure Initialize_546;
procedure Initialize_547;
procedure Initialize_548;
procedure Initialize_549;
procedure Initialize_550;
procedure Initialize_551;
procedure Initialize_552;
procedure Initialize_553;
procedure Initialize_554;
procedure Initialize_555;
procedure Initialize_556;
procedure Initialize_557;
procedure Initialize_558;
procedure Initialize_559;
procedure Initialize_560;
procedure Initialize_561;
procedure Initialize_562;
procedure Initialize_563;
procedure Initialize_564;
procedure Initialize_565;
procedure Initialize_566;
procedure Initialize_567;
procedure Initialize_568;
procedure Initialize_569;
procedure Initialize_570;
procedure Initialize_571;
procedure Initialize_572;
procedure Initialize_573;
procedure Initialize_574;
procedure Initialize_575;
procedure Initialize_576;
procedure Initialize_577;
procedure Initialize_578;
procedure Initialize_579;
procedure Initialize_580;
procedure Initialize_581;
procedure Initialize_582;
procedure Initialize_583;
procedure Initialize_584;
procedure Initialize_585;
procedure Initialize_586;
procedure Initialize_587;
procedure Initialize_588;
procedure Initialize_589;
procedure Initialize_590;
procedure Initialize_591;
procedure Initialize_592;
procedure Initialize_593;
procedure Initialize_594;
procedure Initialize_595;
procedure Initialize_596;
procedure Initialize_597;
procedure Initialize_598;
procedure Initialize_599;
procedure Initialize_600;
procedure Initialize_601;
procedure Initialize_602;
procedure Initialize_603;
procedure Initialize_604;
procedure Initialize_605;
procedure Initialize_606;
procedure Initialize_607;
procedure Initialize_608;
procedure Initialize_609;
procedure Initialize_610;
procedure Initialize_611;
procedure Initialize_612;
procedure Initialize_613;
procedure Initialize_614;
procedure Initialize_615;
procedure Initialize_616;
procedure Initialize_617;
procedure Initialize_618;
procedure Initialize_619;
procedure Initialize_620;
procedure Initialize_621;
procedure Initialize_622;
procedure Initialize_623;
procedure Initialize_624;
procedure Initialize_625;
procedure Initialize_626;
procedure Initialize_627;
procedure Initialize_628;
procedure Initialize_629;
procedure Initialize_630;
procedure Initialize_631;
procedure Initialize_632;
procedure Initialize_633;
procedure Initialize_634;
procedure Initialize_635;
procedure Initialize_636;
procedure Initialize_637;
procedure Initialize_638;
procedure Initialize_639;
procedure Initialize_640;
procedure Initialize_641;
procedure Initialize_642;
procedure Initialize_643;
procedure Initialize_644;
procedure Initialize_645;
procedure Initialize_646;
procedure Initialize_647;
procedure Initialize_648;
procedure Initialize_649;
procedure Initialize_650;
procedure Initialize_651;
procedure Initialize_652;
procedure Initialize_653;
procedure Initialize_654;
procedure Initialize_655;
procedure Initialize_656;
procedure Initialize_657;
procedure Initialize_658;
procedure Initialize_659;
procedure Initialize_660;
procedure Initialize_661;
procedure Initialize_662;
procedure Initialize_663;
procedure Initialize_664;
procedure Initialize_665;
procedure Initialize_666;
procedure Initialize_667;
procedure Initialize_668;
procedure Initialize_669;
procedure Initialize_670;
procedure Initialize_671;
procedure Initialize_672;
procedure Initialize_673;
procedure Initialize_674;
procedure Initialize_675;
procedure Initialize_676;
procedure Initialize_677;
procedure Initialize_678;
procedure Initialize_679;
procedure Initialize_680;
procedure Initialize_681;
procedure Initialize_682;
procedure Initialize_683;
procedure Initialize_684;
procedure Initialize_685;
procedure Initialize_686;
procedure Initialize_687;
procedure Initialize_688;
procedure Initialize_689;
procedure Initialize_690;
procedure Initialize_691;
procedure Initialize_692;
procedure Initialize_693;
procedure Initialize_694;
procedure Initialize_695;
procedure Initialize_696;
procedure Initialize_697;
procedure Initialize_698;
procedure Initialize_699;
procedure Initialize_700;
procedure Initialize_701;
procedure Initialize_702;
procedure Initialize_703;
procedure Initialize_704;
procedure Initialize_705;
procedure Initialize_706;
procedure Initialize_707;
procedure Initialize_708;
procedure Initialize_709;
procedure Initialize_710;
procedure Initialize_711;
procedure Initialize_712;
procedure Initialize_713;
procedure Initialize_714;
procedure Initialize_715;
procedure Initialize_716;
procedure Initialize_717;
procedure Initialize_718;
procedure Initialize_719;
procedure Initialize_720;
procedure Initialize_721;
procedure Initialize_722;
procedure Initialize_723;
procedure Initialize_724;
procedure Initialize_725;
procedure Initialize_726;
procedure Initialize_727;
procedure Initialize_728;
procedure Initialize_729;
procedure Initialize_730;
procedure Initialize_731;
procedure Initialize_732;
procedure Initialize_733;
procedure Initialize_734;
procedure Initialize_735;
procedure Initialize_736;
procedure Initialize_737;
procedure Initialize_738;
procedure Initialize_739;
procedure Initialize_740;
procedure Initialize_741;
procedure Initialize_742;
procedure Initialize_743;
procedure Initialize_744;
procedure Initialize_745;
procedure Initialize_746;
procedure Initialize_747;
procedure Initialize_748;
procedure Initialize_749;
procedure Initialize_750;
procedure Initialize_751;
procedure Initialize_752;
procedure Initialize_753;
procedure Initialize_754;
procedure Initialize_755;
procedure Initialize_756;
procedure Initialize_757;
procedure Initialize_758;
procedure Initialize_759;
procedure Initialize_760;
procedure Initialize_761;
procedure Initialize_762;
procedure Initialize_763;
procedure Initialize_764;
procedure Initialize_765;
procedure Initialize_766;
procedure Initialize_767;
procedure Initialize_768;
procedure Initialize_769;
procedure Initialize_770;
procedure Initialize_771;
procedure Initialize_772;
procedure Initialize_773;
procedure Initialize_774;
procedure Initialize_775;
procedure Initialize_776;
procedure Initialize_777;
procedure Initialize_778;
procedure Initialize_779;
procedure Initialize_780;
procedure Initialize_781;
procedure Initialize_782;
procedure Initialize_783;
procedure Initialize_784;
procedure Initialize_785;
procedure Initialize_786;
procedure Initialize_787;
procedure Initialize_788;
procedure Initialize_789;
procedure Initialize_790;
procedure Initialize_791;
procedure Initialize_792;
procedure Initialize_793;
procedure Initialize_794;
procedure Initialize_795;
procedure Initialize_796;
procedure Initialize_797;
procedure Initialize_798;
procedure Initialize_799;
procedure Initialize_800;
procedure Initialize_801;
procedure Initialize_802;
procedure Initialize_803;
procedure Initialize_804;
procedure Initialize_805;
procedure Initialize_806;
procedure Initialize_807;
procedure Initialize_808;
procedure Initialize_809;
procedure Initialize_810;
procedure Initialize_811;
procedure Initialize_812;
procedure Initialize_813;
procedure Initialize_814;
procedure Initialize_815;
procedure Initialize_816;
procedure Initialize_817;
procedure Initialize_818;
procedure Initialize_819;
procedure Initialize_820;
procedure Initialize_821;
procedure Initialize_822;
procedure Initialize_823;
procedure Initialize_824;
procedure Initialize_825;
procedure Initialize_826;
procedure Initialize_827;
procedure Initialize_828;
procedure Initialize_829;
procedure Initialize_830;
procedure Initialize_831;
procedure Initialize_832;
procedure Initialize_833;
procedure Initialize_834;
procedure Initialize_835;
procedure Initialize_836;
procedure Initialize_837;
procedure Initialize_838;
procedure Initialize_839;
procedure Initialize_840;
procedure Initialize_841;
procedure Initialize_842;
procedure Initialize_843;
procedure Initialize_844;
procedure Initialize_845;
procedure Initialize_846;
procedure Initialize_847;
procedure Initialize_848;
procedure Initialize_849;
procedure Initialize_850;
procedure Initialize_851;
procedure Initialize_852;
procedure Initialize_853;
procedure Initialize_854;
procedure Initialize_855;
procedure Initialize_856;
procedure Initialize_857;
procedure Initialize_858;
procedure Initialize_859;
procedure Initialize_860;
procedure Initialize_861;
procedure Initialize_862;
procedure Initialize_863;
procedure Initialize_864;
procedure Initialize_865;
procedure Initialize_866;
procedure Initialize_867;
procedure Initialize_868;
procedure Initialize_869;
procedure Initialize_870;
procedure Initialize_871;
procedure Initialize_872;
procedure Initialize_873;
procedure Initialize_874;
procedure Initialize_875;
procedure Initialize_876;
procedure Initialize_877;
procedure Initialize_878;
procedure Initialize_879;
procedure Initialize_880;
procedure Initialize_881;
procedure Initialize_882;
procedure Initialize_883;
procedure Initialize_884;
procedure Initialize_885;
procedure Initialize_886;
procedure Initialize_887;
procedure Initialize_888;
procedure Initialize_889;
procedure Initialize_890;
procedure Initialize_891;
procedure Initialize_892;
procedure Initialize_893;
procedure Initialize_894;
procedure Initialize_895;
procedure Initialize_896;
procedure Initialize_897;
procedure Initialize_898;
procedure Initialize_899;
procedure Initialize_900;
procedure Initialize_901;
procedure Initialize_902;
procedure Initialize_903;
procedure Initialize_904;
procedure Initialize_905;
procedure Initialize_906;
procedure Initialize_907;
procedure Initialize_908;
procedure Initialize_909;
procedure Initialize_910;
procedure Initialize_911;
procedure Initialize_912;
procedure Initialize_913;
procedure Initialize_914;
procedure Initialize_915;
procedure Initialize_916;
procedure Initialize_917;
procedure Initialize_918;
procedure Initialize_919;
procedure Initialize_920;
procedure Initialize_921;
procedure Initialize_922;
procedure Initialize_923;
procedure Initialize_924;
procedure Initialize_925;
procedure Initialize_926;
procedure Initialize_927;
procedure Initialize_928;
procedure Initialize_929;
procedure Initialize_930;
procedure Initialize_931;
procedure Initialize_932;
procedure Initialize_933;
procedure Initialize_934;
procedure Initialize_935;
procedure Initialize_936;
procedure Initialize_937;
procedure Initialize_938;
procedure Initialize_939;
procedure Initialize_940;
procedure Initialize_941;
procedure Initialize_942;
procedure Initialize_943;
procedure Initialize_944;
procedure Initialize_945;
procedure Initialize_946;
procedure Initialize_947;
procedure Initialize_948;
procedure Initialize_949;
procedure Initialize_950;
procedure Initialize_951;
procedure Initialize_952;
procedure Initialize_953;
procedure Initialize_954;
procedure Initialize_955;
procedure Initialize_956;
procedure Initialize_957;
procedure Initialize_958;
procedure Initialize_959;
procedure Initialize_960;
procedure Initialize_961;
procedure Initialize_962;
procedure Initialize_963;
procedure Initialize_964;
procedure Initialize_965;
procedure Initialize_966;
procedure Initialize_967;
procedure Initialize_968;
procedure Initialize_969;
procedure Initialize_970;
procedure Initialize_971;
procedure Initialize_972;
procedure Initialize_973;
procedure Initialize_974;
procedure Initialize_975;
procedure Initialize_976;
procedure Initialize_977;
procedure Initialize_978;
procedure Initialize_979;
procedure Initialize_980;
procedure Initialize_981;
procedure Initialize_982;
procedure Initialize_983;
procedure Initialize_984;
procedure Initialize_985;
procedure Initialize_986;
procedure Initialize_987;
procedure Initialize_988;
procedure Initialize_989;
procedure Initialize_990;
procedure Initialize_991;
procedure Initialize_992;
procedure Initialize_993;
procedure Initialize_994;
procedure Initialize_995;
procedure Initialize_996;
procedure Initialize_997;
procedure Initialize_998;
procedure Initialize_999;
procedure Initialize_1000;
procedure Initialize_1001;
procedure Initialize_1002;
procedure Initialize_1003;
procedure Initialize_1004;
procedure Initialize_1005;
procedure Initialize_1006;
procedure Initialize_1007;
procedure Initialize_1008;
procedure Initialize_1009;
procedure Initialize_1010;
procedure Initialize_1011;
procedure Initialize_1012;
procedure Initialize_1013;
procedure Initialize_1014;
procedure Initialize_1015;
procedure Initialize_1016;
procedure Initialize_1017;
procedure Initialize_1018;
procedure Initialize_1019;
procedure Initialize_1020;
procedure Initialize_1021;
procedure Initialize_1022;
procedure Initialize_1023;
procedure Initialize_1024;
procedure Initialize_1025;
procedure Initialize_1026;
procedure Initialize_1027;
procedure Initialize_1028;
procedure Initialize_1029;
procedure Initialize_1030;
procedure Initialize_1031;
procedure Initialize_1032;
procedure Initialize_1033;
procedure Initialize_1034;
procedure Initialize_1035;
procedure Initialize_1036;
procedure Initialize_1037;
procedure Initialize_1038;
procedure Initialize_1039;
procedure Initialize_1040;
procedure Initialize_1041;
procedure Initialize_1042;
procedure Initialize_1043;
procedure Initialize_1044;
procedure Initialize_1045;
procedure Initialize_1046;
procedure Initialize_1047;
procedure Initialize_1048;
procedure Initialize_1049;
procedure Initialize_1050;
procedure Initialize_1051;
procedure Initialize_1052;
procedure Initialize_1053;
procedure Initialize_1054;
procedure Initialize_1055;
procedure Initialize_1056;
procedure Initialize_1057;
procedure Initialize_1058;
procedure Initialize_1059;
procedure Initialize_1060;
procedure Initialize_1061;
procedure Initialize_1062;
procedure Initialize_1063;
procedure Initialize_1064;
procedure Initialize_1065;
procedure Initialize_1066;
procedure Initialize_1067;
procedure Initialize_1068;
procedure Initialize_1069;
procedure Initialize_1070;
procedure Initialize_1071;
procedure Initialize_1072;
procedure Initialize_1073;
procedure Initialize_1074;
procedure Initialize_1075;
procedure Initialize_1076;
procedure Initialize_1077;
procedure Initialize_1078;
procedure Initialize_1079;
procedure Initialize_1080;
procedure Initialize_1081;
procedure Initialize_1082;
procedure Initialize_1083;
procedure Initialize_1084;
procedure Initialize_1085;
procedure Initialize_1086;
procedure Initialize_1087;
procedure Initialize_1088;
procedure Initialize_1089;
procedure Initialize_1090;
procedure Initialize_1091;
procedure Initialize_1092;
procedure Initialize_1093;
procedure Initialize_1094;
procedure Initialize_1095;
procedure Initialize_1096;
procedure Initialize_1097;
procedure Initialize_1098;
procedure Initialize_1099;
procedure Initialize_1100;
procedure Initialize_1101;
procedure Initialize_1102;
procedure Initialize_1103;
procedure Initialize_1104;
procedure Initialize_1105;
procedure Initialize_1106;
procedure Initialize_1107;
procedure Initialize_1108;
procedure Initialize_1109;
procedure Initialize_1110;
procedure Initialize_1111;
procedure Initialize_1112;
procedure Initialize_1113;
procedure Initialize_1114;
procedure Initialize_1115;
procedure Initialize_1116;
procedure Initialize_1117;
procedure Initialize_1118;
procedure Initialize_1119;
procedure Initialize_1120;
procedure Initialize_1121;
procedure Initialize_1122;
procedure Initialize_1123;
procedure Initialize_1124;
procedure Initialize_1125;
procedure Initialize_1126;
procedure Initialize_1127;
procedure Initialize_1128;
procedure Initialize_1129;
procedure Initialize_1130;
procedure Initialize_1131;
procedure Initialize_1132;
procedure Initialize_1133;
procedure Initialize_1134;
procedure Initialize_1135;
procedure Initialize_1136;
procedure Initialize_1137;
procedure Initialize_1138;
procedure Initialize_1139;
procedure Initialize_1140;
procedure Initialize_1141;
procedure Initialize_1142;
procedure Initialize_1143;
procedure Initialize_1144;
procedure Initialize_1145;
procedure Initialize_1146;
procedure Initialize_1147;
procedure Initialize_1148;
procedure Initialize_1149;
procedure Initialize_1150;
procedure Initialize_1151;
procedure Initialize_1152;
procedure Initialize_1153;
procedure Initialize_1154;
procedure Initialize_1155;
procedure Initialize_1156;
procedure Initialize_1157;
procedure Initialize_1158;
procedure Initialize_1159;
procedure Initialize_1160;
procedure Initialize_1161;
procedure Initialize_1162;
procedure Initialize_1163;
procedure Initialize_1164;
procedure Initialize_1165;
procedure Initialize_1166;
procedure Initialize_1167;
procedure Initialize_1168;
procedure Initialize_1169;
procedure Initialize_1170;
procedure Initialize_1171;
procedure Initialize_1172;
procedure Initialize_1173;
procedure Initialize_1174;
procedure Initialize_1175;
procedure Initialize_1176;
procedure Initialize_1177;
procedure Initialize_1178;
procedure Initialize_1179;
procedure Initialize_1180;
procedure Initialize_1181;
procedure Initialize_1182;
procedure Initialize_1183;
procedure Initialize_1184;
procedure Initialize_1185;
procedure Initialize_1186;
procedure Initialize_1187;
procedure Initialize_1188;
procedure Initialize_1189;
procedure Initialize_1190;
procedure Initialize_1191;
procedure Initialize_1192;
procedure Initialize_1193;
procedure Initialize_1194;
procedure Initialize_1195;
procedure Initialize_1196;
procedure Initialize_1197;
procedure Initialize_1198;
procedure Initialize_1199;
procedure Initialize_1200;
procedure Initialize_1201;
procedure Initialize_1202;
procedure Initialize_1203;
procedure Initialize_1204;
procedure Initialize_1205;
procedure Initialize_1206;
procedure Initialize_1207;
procedure Initialize_1208;
procedure Initialize_1209;
procedure Initialize_1210;
procedure Initialize_1211;
procedure Initialize_1212;
procedure Initialize_1213;
procedure Initialize_1214;
procedure Initialize_1215;
procedure Initialize_1216;
procedure Initialize_1217;
procedure Initialize_1218;
procedure Initialize_1219;
procedure Initialize_1220;
procedure Initialize_1221;
procedure Initialize_1222;
procedure Initialize_1223;
procedure Initialize_1224;
procedure Initialize_1225;
procedure Initialize_1226;
procedure Initialize_1227;
procedure Initialize_1228;
procedure Initialize_1229;
procedure Initialize_1230;
procedure Initialize_1231;
procedure Initialize_1232;
procedure Initialize_1233;
procedure Initialize_1234;
procedure Initialize_1235;
procedure Initialize_1236;
procedure Initialize_1237;
procedure Initialize_1238;
procedure Initialize_1239;
procedure Initialize_1240;
procedure Initialize_1241;
procedure Initialize_1242;
procedure Initialize_1243;
procedure Initialize_1244;
procedure Initialize_1245;
procedure Initialize_1246;
procedure Initialize_1247;
procedure Initialize_1248;
procedure Initialize_1249;
procedure Initialize_1250;
procedure Initialize_1251;
procedure Initialize_1252;
procedure Initialize_1253;
procedure Initialize_1254;
procedure Initialize_1255;
procedure Initialize_1256;
procedure Initialize_1257;
procedure Initialize_1258;
procedure Initialize_1259;
procedure Initialize_1260;
procedure Initialize_1261;
procedure Initialize_1262;
procedure Initialize_1263;
procedure Initialize_1264;
procedure Initialize_1265;
procedure Initialize_1266;
procedure Initialize_1267;
procedure Initialize_1268;
procedure Initialize_1269;
procedure Initialize_1270;
procedure Initialize_1271;
procedure Initialize_1272;
procedure Initialize_1273;
procedure Initialize_1274;
procedure Initialize_1275;
procedure Initialize_1276;
procedure Initialize_1277;
procedure Initialize_1278;
procedure Initialize_1279;
procedure Initialize_1280;
procedure Initialize_1281;
procedure Initialize_1282;
procedure Initialize_1283;
procedure Initialize_1284;
procedure Initialize_1285;
procedure Initialize_1286;
procedure Initialize_1287;
procedure Initialize_1288;
procedure Initialize_1289;
procedure Initialize_1290;
procedure Initialize_1291;
procedure Initialize_1292;
procedure Initialize_1293;
procedure Initialize_1294;
procedure Initialize_1295;
procedure Initialize_1296;
procedure Initialize_1297;
procedure Initialize_1298;
procedure Initialize_1299;
procedure Initialize_1300;
procedure Initialize_1301;
procedure Initialize_1302;
procedure Initialize_1303;
procedure Initialize_1304;
procedure Initialize_1305;
procedure Initialize_1306;
procedure Initialize_1307;
procedure Initialize_1308;
procedure Initialize_1309;
procedure Initialize_1310;
procedure Initialize_1311;
procedure Initialize_1312;
procedure Initialize_1313;
procedure Initialize_1314;
procedure Initialize_1315;
procedure Initialize_1316;
procedure Initialize_1317;
procedure Initialize_1318;
procedure Initialize_1319;
procedure Initialize_1320;
procedure Initialize_1321;
procedure Initialize_1322;
procedure Initialize_1323;
procedure Initialize_1324;
procedure Initialize_1325;
procedure Initialize_1326;
procedure Initialize_1327;
procedure Initialize_1328;
procedure Initialize_1329;
procedure Initialize_1330;
procedure Initialize_1331;
procedure Initialize_1332;
procedure Initialize_1333;
procedure Initialize_1334;
procedure Initialize_1335;
procedure Initialize_1336;
procedure Initialize_1337;
procedure Initialize_1338;
procedure Initialize_1339;
procedure Initialize_1340;
procedure Initialize_1341;
procedure Initialize_1342;
procedure Initialize_1343;
procedure Initialize_1344;
procedure Initialize_1345;
procedure Initialize_1346;
procedure Initialize_1347;
procedure Initialize_1348;
procedure Initialize_1349;
procedure Initialize_1350;
procedure Initialize_1351;
procedure Initialize_1352;
procedure Initialize_1353;
procedure Initialize_1354;
procedure Initialize_1355;
procedure Initialize_1356;
procedure Initialize_1357;
procedure Initialize_1358;
procedure Initialize_1359;
procedure Initialize_1360;
procedure Initialize_1361;
procedure Initialize_1362;
procedure Initialize_1363;
procedure Initialize_1364;
procedure Initialize_1365;
procedure Initialize_1366;
procedure Initialize_1367;
procedure Initialize_1368;
procedure Initialize_1369;
procedure Initialize_1370;
procedure Initialize_1371;
procedure Initialize_1372;
procedure Initialize_1373;
procedure Initialize_1374;
procedure Initialize_1375;
procedure Initialize_1376;
procedure Initialize_1377;
procedure Initialize_1378;
procedure Initialize_1379;
procedure Initialize_1380;
procedure Initialize_1381;
procedure Initialize_1382;
procedure Initialize_1383;
procedure Initialize_1384;
procedure Initialize_1385;
procedure Initialize_1386;
procedure Initialize_1387;
procedure Initialize_1388;
procedure Initialize_1389;
procedure Initialize_1390;
procedure Initialize_1391;
procedure Initialize_1392;
procedure Initialize_1393;
procedure Initialize_1394;
procedure Initialize_1395;
procedure Initialize_1396;
procedure Initialize_1397;
procedure Initialize_1398;
procedure Initialize_1399;
procedure Initialize_1400;
procedure Initialize_1401;
procedure Initialize_1402;
procedure Initialize_1403;
procedure Initialize_1404;
procedure Initialize_1405;
procedure Initialize_1406;
procedure Initialize_1407;
procedure Initialize_1408;
procedure Initialize_1409;
procedure Initialize_1410;
procedure Initialize_1411;
procedure Initialize_1412;
procedure Initialize_1413;
procedure Initialize_1414;
procedure Initialize_1415;
procedure Initialize_1416;
procedure Initialize_1417;
procedure Initialize_1418;
procedure Initialize_1419;
procedure Initialize_1420;
procedure Initialize_1421;
procedure Initialize_1422;
procedure Initialize_1423;
procedure Initialize_1424;
procedure Initialize_1425;
procedure Initialize_1426;
procedure Initialize_1427;
procedure Initialize_1428;
procedure Initialize_1429;
procedure Initialize_1430;
procedure Initialize_1431;
procedure Initialize_1432;
procedure Initialize_1433;
procedure Initialize_1434;
procedure Initialize_1435;
procedure Initialize_1436;
procedure Initialize_1437;
procedure Initialize_1438;
procedure Initialize_1439;
procedure Initialize_1440;
procedure Initialize_1441;
procedure Initialize_1442;
procedure Initialize_1443;
procedure Initialize_1444;
procedure Initialize_1445;
procedure Initialize_1446;
procedure Initialize_1447;
procedure Initialize_1448;
procedure Initialize_1449;
procedure Initialize_1450;
procedure Initialize_1451;
procedure Initialize_1452;
procedure Initialize_1453;
procedure Initialize_1454;
procedure Initialize_1455;
procedure Initialize_1456;
procedure Initialize_1457;
procedure Initialize_1458;
procedure Initialize_1459;
procedure Initialize_1460;
procedure Initialize_1461;
procedure Initialize_1462;
procedure Initialize_1463;
procedure Initialize_1464;
procedure Initialize_1465;
procedure Initialize_1466;
procedure Initialize_1467;
procedure Initialize_1468;
procedure Initialize_1469;
procedure Initialize_1470;
procedure Initialize_1471;
procedure Initialize_1472;
procedure Initialize_1473;
procedure Initialize_1474;
procedure Initialize_1475;
procedure Initialize_1476;
procedure Initialize_1477;
procedure Initialize_1478;
procedure Initialize_1479;
procedure Initialize_1480;
procedure Initialize_1481;
procedure Initialize_1482;
procedure Initialize_1483;
procedure Initialize_1484;
procedure Initialize_1485;
procedure Initialize_1486;
procedure Initialize_1487;
procedure Initialize_1488;
procedure Initialize_1489;
procedure Initialize_1490;
procedure Initialize_1491;
procedure Initialize_1492;
procedure Initialize_1493;
procedure Initialize_1494;
procedure Initialize_1495;
procedure Initialize_1496;
procedure Initialize_1497;
procedure Initialize_1498;
procedure Initialize_1499;
procedure Initialize_1500;
procedure Initialize_1501;
procedure Initialize_1502;
procedure Initialize_1503;
procedure Initialize_1504;
procedure Initialize_1505;
procedure Initialize_1506;
procedure Initialize_1507;
procedure Initialize_1508;
procedure Initialize_1509;
procedure Initialize_1510;
procedure Initialize_1511;
procedure Initialize_1512;
procedure Initialize_1513;
procedure Initialize_1514;
procedure Initialize_1515;
procedure Initialize_1516;
procedure Initialize_1517;
procedure Initialize_1518;
procedure Initialize_1519;
procedure Initialize_1520;
procedure Initialize_1521;
procedure Initialize_1522;
procedure Initialize_1523;
procedure Initialize_1524;
procedure Initialize_1525;
procedure Initialize_1526;
procedure Initialize_1527;
procedure Initialize_1528;
procedure Initialize_1529;
procedure Initialize_1530;
procedure Initialize_1531;
procedure Initialize_1532;
procedure Initialize_1533;
procedure Initialize_1534;
procedure Initialize_1535;
procedure Initialize_1536;
procedure Initialize_1537;
procedure Initialize_1538;
procedure Initialize_1539;
procedure Initialize_1540;
procedure Initialize_1541;
procedure Initialize_1542;
procedure Initialize_1543;
procedure Initialize_1544;
procedure Initialize_1545;
procedure Initialize_1546;
procedure Initialize_1547;
procedure Initialize_1548;
procedure Initialize_1549;
procedure Initialize_1550;
procedure Initialize_1551;
procedure Initialize_1552;
procedure Initialize_1553;
procedure Initialize_1554;
procedure Initialize_1555;
procedure Initialize_1556;
procedure Initialize_1557;
procedure Initialize_1558;
procedure Initialize_1559;
procedure Initialize_1560;
procedure Initialize_1561;
procedure Initialize_1562;
procedure Initialize_1563;
procedure Initialize_1564;
procedure Initialize_1565;
procedure Initialize_1566;
procedure Initialize_1567;
procedure Initialize_1568;
procedure Initialize_1569;
procedure Initialize_1570;
procedure Initialize_1571;
procedure Initialize_1572;
procedure Initialize_1573;
procedure Initialize_1574;
procedure Initialize_1575;
procedure Initialize_1576;
procedure Initialize_1577;
procedure Initialize_1578;
procedure Initialize_1579;
procedure Initialize_1580;
procedure Initialize_1581;
procedure Initialize_1582;
procedure Initialize_1583;
procedure Initialize_1584;
procedure Initialize_1585;
procedure Initialize_1586;
procedure Initialize_1587;
procedure Initialize_1588;
procedure Initialize_1589;
procedure Initialize_1590;
procedure Initialize_1591;
procedure Initialize_1592;
procedure Initialize_1593;
procedure Initialize_1594;
procedure Initialize_1595;
procedure Initialize_1596;
procedure Initialize_1597;
procedure Initialize_1598;
procedure Initialize_1599;
procedure Initialize_1600;
procedure Initialize_1601;
procedure Initialize_1602;
procedure Initialize_1603;
procedure Initialize_1604;
procedure Initialize_1605;
procedure Initialize_1606;
procedure Initialize_1607;
procedure Initialize_1608;
procedure Initialize_1609;
procedure Initialize_1610;
procedure Initialize_1611;
procedure Initialize_1612;
procedure Initialize_1613;
procedure Initialize_1614;
procedure Initialize_1615;
procedure Initialize_1616;
procedure Initialize_1617;
procedure Initialize_1618;
procedure Initialize_1619;
procedure Initialize_1620;
procedure Initialize_1621;
procedure Initialize_1622;
procedure Initialize_1623;
procedure Initialize_1624;
procedure Initialize_1625;
procedure Initialize_1626;
procedure Initialize_1627;
procedure Initialize_1628;
procedure Initialize_1629;
procedure Initialize_1630;
procedure Initialize_1631;
procedure Initialize_1632;
procedure Initialize_1633;
procedure Initialize_1634;
procedure Initialize_1635;
procedure Initialize_1636;
procedure Initialize_1637;
procedure Initialize_1638;
procedure Initialize_1639;
procedure Initialize_1640;
procedure Initialize_1641;
procedure Initialize_1642;
procedure Initialize_1643;
procedure Initialize_1644;
procedure Initialize_1645;
procedure Initialize_1646;
procedure Initialize_1647;
procedure Initialize_1648;
procedure Initialize_1649;
procedure Initialize_1650;
procedure Initialize_1651;
procedure Initialize_1652;
procedure Initialize_1653;
procedure Initialize_1654;
procedure Initialize_1655;
procedure Initialize_1656;
procedure Initialize_1657;
procedure Initialize_1658;
procedure Initialize_1659;
procedure Initialize_1660;
procedure Initialize_1661;
procedure Initialize_1662;
procedure Initialize_1663;
procedure Initialize_1664;
procedure Initialize_1665;
procedure Initialize_1666;
procedure Initialize_1667;
procedure Initialize_1668;
procedure Initialize_1669;
procedure Initialize_1670;
procedure Initialize_1671;
procedure Initialize_1672;
procedure Initialize_1673;
procedure Initialize_1674;
procedure Initialize_1675;
procedure Initialize_1676;
procedure Initialize_1677;
procedure Initialize_1678;
procedure Initialize_1679;
procedure Initialize_1680;
procedure Initialize_1681;
procedure Initialize_1682;
procedure Initialize_1683;
procedure Initialize_1684;
procedure Initialize_1685;
procedure Initialize_1686;
procedure Initialize_1687;
procedure Initialize_1688;
procedure Initialize_1689;
procedure Initialize_1690;
procedure Initialize_1691;
procedure Initialize_1692;
procedure Initialize_1693;
procedure Initialize_1694;
procedure Initialize_1695;
procedure Initialize_1696;
procedure Initialize_1697;
procedure Initialize_1698;
procedure Initialize_1699;
procedure Initialize_1700;
procedure Initialize_1701;
procedure Initialize_1702;
procedure Initialize_1703;
procedure Initialize_1704;
procedure Initialize_1705;
procedure Initialize_1706;
procedure Initialize_1707;
procedure Initialize_1708;
procedure Initialize_1709;
procedure Initialize_1710;
procedure Initialize_1711;
procedure Initialize_1712;
procedure Initialize_1713;
procedure Initialize_1714;
procedure Initialize_1715;
procedure Initialize_1716;
procedure Initialize_1717;
procedure Initialize_1718;
procedure Initialize_1719;
procedure Initialize_1720;
procedure Initialize_1721;
procedure Initialize_1722;
procedure Initialize_1723;
procedure Initialize_1724;
procedure Initialize_1725;
procedure Initialize_1726;
procedure Initialize_1727;
procedure Initialize_1728;
procedure Initialize_1729;
procedure Initialize_1730;
procedure Initialize_1731;
procedure Initialize_1732;
procedure Initialize_1733;
procedure Initialize_1734;
procedure Initialize_1735;
procedure Initialize_1736;
procedure Initialize_1737;
procedure Initialize_1738;
procedure Initialize_1739;
procedure Initialize_1740;
procedure Initialize_1741;
procedure Initialize_1742;
procedure Initialize_1743;
procedure Initialize_1744;
procedure Initialize_1745;
procedure Initialize_1746;
procedure Initialize_1747;
procedure Initialize_1748;
procedure Initialize_1749;
procedure Initialize_1750;
procedure Initialize_1751;
procedure Initialize_1752;
procedure Initialize_1753;
procedure Initialize_1754;
procedure Initialize_1755;
procedure Initialize_1756;
procedure Initialize_1757;
procedure Initialize_1758;
procedure Initialize_1759;
procedure Initialize_1760;
procedure Initialize_1761;
procedure Initialize_1762;
procedure Initialize_1763;
procedure Initialize_1764;
procedure Initialize_1765;
procedure Initialize_1766;
procedure Initialize_1767;
procedure Initialize_1768;
procedure Initialize_1769;
procedure Initialize_1770;
procedure Initialize_1771;
procedure Initialize_1772;
procedure Initialize_1773;
procedure Initialize_1774;
procedure Initialize_1775;
procedure Initialize_1776;
procedure Initialize_1777;
procedure Initialize_1778;
procedure Initialize_1779;
procedure Initialize_1780;
procedure Initialize_1781;
procedure Initialize_1782;
procedure Initialize_1783;
procedure Initialize_1784;
procedure Initialize_1785;
procedure Initialize_1786;
procedure Initialize_1787;
procedure Initialize_1788;
procedure Initialize_1789;
procedure Initialize_1790;
procedure Initialize_1791;
procedure Initialize_1792;
procedure Initialize_1793;
procedure Initialize_1794;
procedure Initialize_1795;
procedure Initialize_1796;
procedure Initialize_1797;
procedure Initialize_1798;
procedure Initialize_1799;
procedure Initialize_1800;
procedure Initialize_1801;
procedure Initialize_1802;
procedure Initialize_1803;
procedure Initialize_1804;
procedure Initialize_1805;
procedure Initialize_1806;
procedure Initialize_1807;
procedure Initialize_1808;
procedure Initialize_1809;
procedure Initialize_1810;
procedure Initialize_1811;
procedure Initialize_1812;
procedure Initialize_1813;
procedure Initialize_1814;
procedure Initialize_1815;
procedure Initialize_1816;
procedure Initialize_1817;
procedure Initialize_1818;
procedure Initialize_1819;
procedure Initialize_1820;
procedure Initialize_1821;
procedure Initialize_1822;
procedure Initialize_1823;
procedure Initialize_1824;
procedure Initialize_1825;
procedure Initialize_1826;
procedure Initialize_1827;
procedure Initialize_1828;
procedure Initialize_1829;
procedure Initialize_1830;
procedure Initialize_1831;
procedure Initialize_1832;
procedure Initialize_1833;
procedure Initialize_1834;
procedure Initialize_1835;
procedure Initialize_1836;
procedure Initialize_1837;
procedure Initialize_1838;
procedure Initialize_1839;
procedure Initialize_1840;
procedure Initialize_1841;
procedure Initialize_1842;
procedure Initialize_1843;
procedure Initialize_1844;
procedure Initialize_1845;
procedure Initialize_1846;
procedure Initialize_1847;
procedure Initialize_1848;
procedure Initialize_1849;
procedure Initialize_1850;
procedure Initialize_1851;
procedure Initialize_1852;
procedure Initialize_1853;
procedure Initialize_1854;
procedure Initialize_1855;
procedure Initialize_1856;
procedure Initialize_1857;
procedure Initialize_1858;
procedure Initialize_1859;
procedure Initialize_1860;
procedure Initialize_1861;
procedure Initialize_1862;
procedure Initialize_1863;
procedure Initialize_1864;
procedure Initialize_1865;
procedure Initialize_1866;
procedure Initialize_1867;
procedure Initialize_1868;
procedure Initialize_1869;
procedure Initialize_1870;
procedure Initialize_1871;
procedure Initialize_1872;
procedure Initialize_1873;
procedure Initialize_1874;
procedure Initialize_1875;
procedure Initialize_1876;
procedure Initialize_1877;
procedure Initialize_1878;
procedure Initialize_1879;
procedure Initialize_1880;
procedure Initialize_1881;
procedure Initialize_1882;
procedure Initialize_1883;
procedure Initialize_1884;
procedure Initialize_1885;
procedure Initialize_1886;
procedure Initialize_1887;
procedure Initialize_1888;
procedure Initialize_1889;
procedure Initialize_1890;
procedure Initialize_1891;
procedure Initialize_1892;
procedure Initialize_1893;
procedure Initialize_1894;
procedure Initialize_1895;
procedure Initialize_1896;
procedure Initialize_1897;
procedure Initialize_1898;
procedure Initialize_1899;
procedure Initialize_1900;
procedure Initialize_1901;
procedure Initialize_1902;
procedure Initialize_1903;
procedure Initialize_1904;
procedure Initialize_1905;
procedure Initialize_1906;
procedure Initialize_1907;
procedure Initialize_1908;
procedure Initialize_1909;
procedure Initialize_1910;
procedure Initialize_1911;
procedure Initialize_1912;
procedure Initialize_1913;
procedure Initialize_1914;
procedure Initialize_1915;
procedure Initialize_1916;
procedure Initialize_1917;
procedure Initialize_1918;
procedure Initialize_1919;
procedure Initialize_1920;
procedure Initialize_1921;
procedure Initialize_1922;
procedure Initialize_1923;
procedure Initialize_1924;
procedure Initialize_1925;
procedure Initialize_1926;
procedure Initialize_1927;
procedure Initialize_1928;
procedure Initialize_1929;
procedure Initialize_1930;
procedure Initialize_1931;
procedure Initialize_1932;
procedure Initialize_1933;
procedure Initialize_1934;
procedure Initialize_1935;
procedure Initialize_1936;
procedure Initialize_1937;
procedure Initialize_1938;
procedure Initialize_1939;
procedure Initialize_1940;
procedure Initialize_1941;
procedure Initialize_1942;
procedure Initialize_1943;
procedure Initialize_1944;
procedure Initialize_1945;
procedure Initialize_1946;
procedure Initialize_1947;
procedure Initialize_1948;
procedure Initialize_1949;
procedure Initialize_1950;
procedure Initialize_1951;
procedure Initialize_1952;
procedure Initialize_1953;
procedure Initialize_1954;
procedure Initialize_1955;
procedure Initialize_1956;
procedure Initialize_1957;
procedure Initialize_1958;
procedure Initialize_1959;
procedure Initialize_1960;
procedure Initialize_1961;
procedure Initialize_1962;
procedure Initialize_1963;
procedure Initialize_1964;
procedure Initialize_1965;
procedure Initialize_1966;
procedure Initialize_1967;
procedure Initialize_1968;
procedure Initialize_1969;
procedure Initialize_1970;
procedure Initialize_1971;
procedure Initialize_1972;
procedure Initialize_1973;
procedure Initialize_1974;
procedure Initialize_1975;
procedure Initialize_1976;
procedure Initialize_1977;
procedure Initialize_1978;
procedure Initialize_1979;
procedure Initialize_1980;
procedure Initialize_1981;
procedure Initialize_1982;
procedure Initialize_1983;
procedure Initialize_1984;
procedure Initialize_1985;
procedure Initialize_1986;
procedure Initialize_1987;
procedure Initialize_1988;
procedure Initialize_1989;
procedure Initialize_1990;
procedure Initialize_1991;
procedure Initialize_1992;
procedure Initialize_1993;
procedure Initialize_1994;
procedure Initialize_1995;
procedure Initialize_1996;
procedure Initialize_1997;
procedure Initialize_1998;
procedure Initialize_1999;
procedure Initialize_2000;
procedure Initialize_2001;
procedure Initialize_2002;
procedure Initialize_2003;
procedure Initialize_2004;
procedure Initialize_2005;
procedure Initialize_2006;
procedure Initialize_2007;
procedure Initialize_2008;
procedure Initialize_2009;
procedure Initialize_2010;
procedure Initialize_2011;
procedure Initialize_2012;
procedure Initialize_2013;
procedure Initialize_2014;
procedure Initialize_2015;
procedure Initialize_2016;
procedure Initialize_2017;
procedure Initialize_2018;
procedure Initialize_2019;
procedure Initialize_2020;
procedure Initialize_2021;
procedure Initialize_2022;
procedure Initialize_2023;
procedure Initialize_2024;
procedure Initialize_2025;
procedure Initialize_2026;
procedure Initialize_2027;
procedure Initialize_2028;
procedure Initialize_2029;
procedure Initialize_2030;
procedure Initialize_2031;
procedure Initialize_2032;
procedure Initialize_2033;
procedure Initialize_2034;
procedure Initialize_2035;
procedure Initialize_2036;
procedure Initialize_2037;
procedure Initialize_2038;
procedure Initialize_2039;
procedure Initialize_2040;
procedure Initialize_2041;
procedure Initialize_2042;
procedure Initialize_2043;
procedure Initialize_2044;
procedure Initialize_2045;
procedure Initialize_2046;
procedure Initialize_2047;
procedure Initialize_2048;
procedure Initialize_2049;
procedure Initialize_2050;
procedure Initialize_2051;
procedure Initialize_2052;
procedure Initialize_2053;
procedure Initialize_2054;
procedure Initialize_2055;
procedure Initialize_2056;
procedure Initialize_2057;
procedure Initialize_2058;
procedure Initialize_2059;
procedure Initialize_2060;
procedure Initialize_2061;
procedure Initialize_2062;
procedure Initialize_2063;
procedure Initialize_2064;
procedure Initialize_2065;
procedure Initialize_2066;
procedure Initialize_2067;
procedure Initialize_2068;
procedure Initialize_2069;
procedure Initialize_2070;
procedure Initialize_2071;
procedure Initialize_2072;
procedure Initialize_2073;
procedure Initialize_2074;
procedure Initialize_2075;
procedure Initialize_2076;
procedure Initialize_2077;
procedure Initialize_2078;
procedure Initialize_2079;
procedure Initialize_2080;
procedure Initialize_2081;
procedure Initialize_2082;
procedure Initialize_2083;
procedure Initialize_2084;
procedure Initialize_2085;
procedure Initialize_2086;
procedure Initialize_2087;
procedure Initialize_2088;
procedure Initialize_2089;
procedure Initialize_2090;
procedure Initialize_2091;
procedure Initialize_2092;
procedure Initialize_2093;
procedure Initialize_2094;
procedure Initialize_2095;
procedure Initialize_2096;
procedure Initialize_2097;
procedure Initialize_2098;
procedure Initialize_2099;
procedure Initialize_2100;
procedure Initialize_2101;
procedure Initialize_2102;
procedure Initialize_2103;
procedure Initialize_2104;
procedure Initialize_2105;
procedure Initialize_2106;
procedure Initialize_2107;
procedure Initialize_2108;
procedure Initialize_2109;
procedure Initialize_2110;
procedure Initialize_2111;
procedure Initialize_2112;
procedure Initialize_2113;
procedure Initialize_2114;
procedure Initialize_2115;
procedure Initialize_2116;
procedure Initialize_2117;
procedure Initialize_2118;
procedure Initialize_2119;
procedure Initialize_2120;
procedure Initialize_2121;
procedure Initialize_2122;
procedure Initialize_2123;
procedure Initialize_2124;
procedure Initialize_2125;
procedure Initialize_2126;
procedure Initialize_2127;
procedure Initialize_2128;
procedure Initialize_2129;
procedure Initialize_2130;
procedure Initialize_2131;
procedure Initialize_2132;
procedure Initialize_2133;
procedure Initialize_2134;
procedure Initialize_2135;
procedure Initialize_2136;
procedure Initialize_2137;
procedure Initialize_2138;
procedure Initialize_2139;
procedure Initialize_2140;
procedure Initialize_2141;
procedure Initialize_2142;
procedure Initialize_2143;
procedure Initialize_2144;
procedure Initialize_2145;
procedure Initialize_2146;
procedure Initialize_2147;
procedure Initialize_2148;
procedure Initialize_2149;
procedure Initialize_2150;
procedure Initialize_2151;
procedure Initialize_2152;
procedure Initialize_2153;
procedure Initialize_2154;
procedure Initialize_2155;
procedure Initialize_2156;
procedure Initialize_2157;
procedure Initialize_2158;
procedure Initialize_2159;
procedure Initialize_2160;
procedure Initialize_2161;
procedure Initialize_2162;
procedure Initialize_2163;
procedure Initialize_2164;
procedure Initialize_2165;
procedure Initialize_2166;
procedure Initialize_2167;
procedure Initialize_2168;
procedure Initialize_2169;
procedure Initialize_2170;
procedure Initialize_2171;
procedure Initialize_2172;
procedure Initialize_2173;
procedure Initialize_2174;
procedure Initialize_2175;
procedure Initialize_2176;
procedure Initialize_2177;
procedure Initialize_2178;
procedure Initialize_2179;
procedure Initialize_2180;
procedure Initialize_2181;
procedure Initialize_2182;
procedure Initialize_2183;
procedure Initialize_2184;
procedure Initialize_2185;
procedure Initialize_2186;
procedure Initialize_2187;
procedure Initialize_2188;
procedure Initialize_2189;
procedure Initialize_2190;
procedure Initialize_2191;
procedure Initialize_2192;
procedure Initialize_2193;
procedure Initialize_2194;
procedure Initialize_2195;
procedure Initialize_2196;
procedure Initialize_2197;
procedure Initialize_2198;
procedure Initialize_2199;
procedure Initialize_2200;
procedure Initialize_2201;
procedure Initialize_2202;
procedure Initialize_2203;
procedure Initialize_2204;
procedure Initialize_2205;
procedure Initialize_2206;
procedure Initialize_2207;
procedure Initialize_2208;
procedure Initialize_2209;
procedure Initialize_2210;
procedure Initialize_2211;
procedure Initialize_2212;
procedure Initialize_2213;
procedure Initialize_2214;
procedure Initialize_2215;
procedure Initialize_2216;
procedure Initialize_2217;
procedure Initialize_2218;
procedure Initialize_2219;
procedure Initialize_2220;
procedure Initialize_2221;
procedure Initialize_2222;
procedure Initialize_2223;
procedure Initialize_2224;
procedure Initialize_2225;
procedure Initialize_2226;
procedure Initialize_2227;
procedure Initialize_2228;
procedure Initialize_2229;
procedure Initialize_2230;
procedure Initialize_2231;
procedure Initialize_2232;
procedure Initialize_2233;
procedure Initialize_2234;
procedure Initialize_2235;
procedure Initialize_2236;
procedure Initialize_2237;
procedure Initialize_2238;
procedure Initialize_2239;
procedure Initialize_2240;
procedure Initialize_2241;
procedure Initialize_2242;
procedure Initialize_2243;
procedure Initialize_2244;
procedure Initialize_2245;
procedure Initialize_2246;
procedure Initialize_2247;
procedure Initialize_2248;
procedure Initialize_2249;
procedure Initialize_2250;
procedure Initialize_2251;
procedure Initialize_2252;
procedure Initialize_2253;
procedure Initialize_2254;
procedure Initialize_2255;
procedure Initialize_2256;
procedure Initialize_2257;
procedure Initialize_2258;
procedure Initialize_2259;
procedure Initialize_2260;
procedure Initialize_2261;
procedure Initialize_2262;
procedure Initialize_2263;
procedure Initialize_2264;
procedure Initialize_2265;
procedure Initialize_2266;
procedure Initialize_2267;
procedure Initialize_2268;
procedure Initialize_2269;
procedure Initialize_2270;
procedure Initialize_2271;
procedure Initialize_2272;
procedure Initialize_2273;
procedure Initialize_2274;
procedure Initialize_2275;
procedure Initialize_2276;
procedure Initialize_2277;
procedure Initialize_2278;
procedure Initialize_2279;
procedure Initialize_2280;
procedure Initialize_2281;
procedure Initialize_2282;
procedure Initialize_2283;
procedure Initialize_2284;
procedure Initialize_2285;
procedure Initialize_2286;
procedure Initialize_2287;
procedure Initialize_2288;
procedure Initialize_2289;
procedure Initialize_2290;
procedure Initialize_2291;
procedure Initialize_2292;
procedure Initialize_2293;
procedure Initialize_2294;
procedure Initialize_2295;
procedure Initialize_2296;
procedure Initialize_2297;
procedure Initialize_2298;
procedure Initialize_2299;
procedure Initialize_2300;
procedure Initialize_2301;
procedure Initialize_2302;
procedure Initialize_2303;
procedure Initialize_2304;
procedure Initialize_2305;
procedure Initialize_2306;
procedure Initialize_2307;
procedure Initialize_2308;
procedure Initialize_2309;
procedure Initialize_2310;
procedure Initialize_2311;
procedure Initialize_2312;
procedure Initialize_2313;
procedure Initialize_2314;
procedure Initialize_2315;
procedure Initialize_2316;
procedure Initialize_2317;
procedure Initialize_2318;
procedure Initialize_2319;
procedure Initialize_2320;
procedure Initialize_2321;
procedure Initialize_2322;
procedure Initialize_2323;
procedure Initialize_2324;
procedure Initialize_2325;
procedure Initialize_2326;
procedure Initialize_2327;
procedure Initialize_2328;
procedure Initialize_2329;
procedure Initialize_2330;
procedure Initialize_2331;
procedure Initialize_2332;
procedure Initialize_2333;
procedure Initialize_2334;
procedure Initialize_2335;
procedure Initialize_2336;
procedure Initialize_2337;
procedure Initialize_2338;
procedure Initialize_2339;
procedure Initialize_2340;
procedure Initialize_2341;
procedure Initialize_2342;
procedure Initialize_2343;
procedure Initialize_2344;
procedure Initialize_2345;
procedure Initialize_2346;
procedure Initialize_2347;
procedure Initialize_2348;
procedure Initialize_2349;
procedure Initialize_2350;
procedure Initialize_2351;
procedure Initialize_2352;
procedure Initialize_2353;
procedure Initialize_2354;
procedure Initialize_2355;
procedure Initialize_2356;
procedure Initialize_2357;
procedure Initialize_2358;
procedure Initialize_2359;
procedure Initialize_2360;
procedure Initialize_2361;
procedure Initialize_2362;
procedure Initialize_2363;
procedure Initialize_2364;
procedure Initialize_2365;
procedure Initialize_2366;
procedure Initialize_2367;
procedure Initialize_2368;
procedure Initialize_2369;
procedure Initialize_2370;
procedure Initialize_2371;
procedure Initialize_2372;
procedure Initialize_2373;
procedure Initialize_2374;
procedure Initialize_2375;
procedure Initialize_2376;
procedure Initialize_2377;
procedure Initialize_2378;
procedure Initialize_2379;
procedure Initialize_2380;
procedure Initialize_2381;
procedure Initialize_2382;
procedure Initialize_2383;
procedure Initialize_2384;
procedure Initialize_2385;
procedure Initialize_2386;
procedure Initialize_2387;
procedure Initialize_2388;
procedure Initialize_2389;
procedure Initialize_2390;
procedure Initialize_2391;
procedure Initialize_2392;
procedure Initialize_2393;
procedure Initialize_2394;
procedure Initialize_2395;
procedure Initialize_2396;
procedure Initialize_2397;
procedure Initialize_2398;
procedure Initialize_2399;
procedure Initialize_2400;
procedure Initialize_2401;
procedure Initialize_2402;
procedure Initialize_2403;
procedure Initialize_2404;
procedure Initialize_2405;
procedure Initialize_2406;
procedure Initialize_2407;
procedure Initialize_2408;
procedure Initialize_2409;
procedure Initialize_2410;
procedure Initialize_2411;
procedure Initialize_2412;
procedure Initialize_2413;
procedure Initialize_2414;
procedure Initialize_2415;
procedure Initialize_2416;
procedure Initialize_2417;
procedure Initialize_2418;
procedure Initialize_2419;
procedure Initialize_2420;
procedure Initialize_2421;
procedure Initialize_2422;
procedure Initialize_2423;
procedure Initialize_2424;
procedure Initialize_2425;
procedure Initialize_2426;
procedure Initialize_2427;
procedure Initialize_2428;
procedure Initialize_2429;
procedure Initialize_2430;
procedure Initialize_2431;
procedure Initialize_2432;
procedure Initialize_2433;
procedure Initialize_2434;
procedure Initialize_2435;
procedure Initialize_2436;
procedure Initialize_2437;
procedure Initialize_2438;
procedure Initialize_2439;
procedure Initialize_2440;
procedure Initialize_2441;
procedure Initialize_2442;
procedure Initialize_2443;
procedure Initialize_2444;
procedure Initialize_2445;
procedure Initialize_2446;
procedure Initialize_2447;
procedure Initialize_2448;
procedure Initialize_2449;
procedure Initialize_2450;
procedure Initialize_2451;
procedure Initialize_2452;
procedure Initialize_2453;
procedure Initialize_2454;
procedure Initialize_2455;
procedure Initialize_2456;
procedure Initialize_2457;
procedure Initialize_2458;
procedure Initialize_2459;
procedure Initialize_2460;
procedure Initialize_2461;
procedure Initialize_2462;
procedure Initialize_2463;
procedure Initialize_2464;
procedure Initialize_2465;
procedure Initialize_2466;
procedure Initialize_2467;
procedure Initialize_2468;
procedure Initialize_2469;
procedure Initialize_2470;
procedure Initialize_2471;
procedure Initialize_2472;
procedure Initialize_2473;
procedure Initialize_2474;
procedure Initialize_2475;
procedure Initialize_2476;
procedure Initialize_2477;
procedure Initialize_2478;
procedure Initialize_2479;
procedure Initialize_2480;
procedure Initialize_2481;
procedure Initialize_2482;
procedure Initialize_2483;
procedure Initialize_2484;
procedure Initialize_2485;
procedure Initialize_2486;
procedure Initialize_2487;
procedure Initialize_2488;
procedure Initialize_2489;
procedure Initialize_2490;
procedure Initialize_2491;
procedure Initialize_2492;
procedure Initialize_2493;
procedure Initialize_2494;
procedure Initialize_2495;
procedure Initialize_2496;
procedure Initialize_2497;
procedure Initialize_2498;
procedure Initialize_2499;
procedure Initialize_2500;
procedure Initialize_2501;
procedure Initialize_2502;
procedure Initialize_2503;
procedure Initialize_2504;
procedure Initialize_2505;
procedure Initialize_2506;
procedure Initialize_2507;
procedure Initialize_2508;
procedure Initialize_2509;
procedure Initialize_2510;
procedure Initialize_2511;
procedure Initialize_2512;
procedure Initialize_2513;
procedure Initialize_2514;
procedure Initialize_2515;
procedure Initialize_2516;
procedure Initialize_2517;
procedure Initialize_2518;
procedure Initialize_2519;
procedure Initialize_2520;
procedure Initialize_2521;
procedure Initialize_2522;
procedure Initialize_2523;
procedure Initialize_2524;
procedure Initialize_2525;
procedure Initialize_2526;
procedure Initialize_2527;
procedure Initialize_2528;
procedure Initialize_2529;
procedure Initialize_2530;
procedure Initialize_2531;
procedure Initialize_2532;
procedure Initialize_2533;
procedure Initialize_2534;
procedure Initialize_2535;
procedure Initialize_2536;
procedure Initialize_2537;
procedure Initialize_2538;
procedure Initialize_2539;
procedure Initialize_2540;
procedure Initialize_2541;
procedure Initialize_2542;
procedure Initialize_2543;
procedure Initialize_2544;
procedure Initialize_2545;
procedure Initialize_2546;
procedure Initialize_2547;
procedure Initialize_2548;
procedure Initialize_2549;
procedure Initialize_2550;
procedure Initialize_2551;
procedure Initialize_2552;
procedure Initialize_2553;
procedure Initialize_2554;
procedure Initialize_2555;
procedure Initialize_2556;
procedure Initialize_2557;
procedure Initialize_2558;
procedure Initialize_2559;
procedure Initialize_2560;
procedure Initialize_2561;
procedure Initialize_2562;
procedure Initialize_2563;
procedure Initialize_2564;
procedure Initialize_2565;
procedure Initialize_2566;
procedure Initialize_2567;
procedure Initialize_2568;
procedure Initialize_2569;
procedure Initialize_2570;
procedure Initialize_2571;
procedure Initialize_2572;
procedure Initialize_2573;
procedure Initialize_2574;
procedure Initialize_2575;
procedure Initialize_2576;
procedure Initialize_2577;
procedure Initialize_2578;
procedure Initialize_2579;
procedure Initialize_2580;
procedure Initialize_2581;
procedure Initialize_2582;
procedure Initialize_2583;
procedure Initialize_2584;
procedure Initialize_2585;
procedure Initialize_2586;
procedure Initialize_2587;
procedure Initialize_2588;
procedure Initialize_2589;
procedure Initialize_2590;
procedure Initialize_2591;
procedure Initialize_2592;
procedure Initialize_2593;
procedure Initialize_2594;
procedure Initialize_2595;
procedure Initialize_2596;
procedure Initialize_2597;
procedure Initialize_2598;
procedure Initialize_2599;
procedure Initialize_2600;
procedure Initialize_2601;
procedure Initialize_2602;
procedure Initialize_2603;
procedure Initialize_2604;
procedure Initialize_2605;
procedure Initialize_2606;
procedure Initialize_2607;
procedure Initialize_2608;
procedure Initialize_2609;
procedure Initialize_2610;
procedure Initialize_2611;
procedure Initialize_2612;
procedure Initialize_2613;
procedure Initialize_2614;
procedure Initialize_2615;
procedure Initialize_2616;
procedure Initialize_2617;
procedure Initialize_2618;
procedure Initialize_2619;
procedure Initialize_2620;
procedure Initialize_2621;
procedure Initialize_2622;
procedure Initialize_2623;
procedure Initialize_2624;
procedure Initialize_2625;
procedure Initialize_2626;
procedure Initialize_2627;
procedure Initialize_2628;
procedure Initialize_2629;
procedure Initialize_2630;
procedure Initialize_2631;
procedure Initialize_2632;
procedure Initialize_2633;
procedure Initialize_2634;
procedure Initialize_2635;
procedure Initialize_2636;
procedure Initialize_2637;
procedure Initialize_2638;
procedure Initialize_2639;
procedure Initialize_2640;
procedure Initialize_2641;
procedure Initialize_2642;
procedure Initialize_2643;
procedure Initialize_2644;
procedure Initialize_2645;
procedure Initialize_2646;
procedure Initialize_2647;
procedure Initialize_2648;
procedure Initialize_2649;
procedure Initialize_2650;
procedure Initialize_2651;
procedure Initialize_2652;
procedure Initialize_2653;
procedure Initialize_2654;
procedure Initialize_2655;
procedure Initialize_2656;
procedure Initialize_2657;
procedure Initialize_2658;
procedure Initialize_2659;
procedure Initialize_2660;
procedure Initialize_2661;
procedure Initialize_2662;
procedure Initialize_2663;
procedure Initialize_2664;
procedure Initialize_2665;
procedure Initialize_2666;
procedure Initialize_2667;
procedure Initialize_2668;
procedure Initialize_2669;
procedure Initialize_2670;
procedure Initialize_2671;
procedure Initialize_2672;
procedure Initialize_2673;
procedure Initialize_2674;
procedure Initialize_2675;
procedure Initialize_2676;
procedure Initialize_2677;
procedure Initialize_2678;
procedure Initialize_2679;
procedure Initialize_2680;
procedure Initialize_2681;
procedure Initialize_2682;
procedure Initialize_2683;
procedure Initialize_2684;
procedure Initialize_2685;
procedure Initialize_2686;
procedure Initialize_2687;
procedure Initialize_2688;
procedure Initialize_2689;
procedure Initialize_2690;
procedure Initialize_2691;
procedure Initialize_2692;
procedure Initialize_2693;
procedure Initialize_2694;
procedure Initialize_2695;
procedure Initialize_2696;
procedure Initialize_2697;
procedure Initialize_2698;
procedure Initialize_2699;
procedure Initialize_2700;
procedure Initialize_2701;
procedure Initialize_2702;
procedure Initialize_2703;
procedure Initialize_2704;
procedure Initialize_2705;
procedure Initialize_2706;
procedure Initialize_2707;
procedure Initialize_2708;
procedure Initialize_2709;
procedure Initialize_2710;
procedure Initialize_2711;
procedure Initialize_2712;
procedure Initialize_2713;
procedure Initialize_2714;
procedure Initialize_2715;
procedure Initialize_2716;
procedure Initialize_2717;
procedure Initialize_2718;
procedure Initialize_2719;
procedure Initialize_2720;
procedure Initialize_2721;
procedure Initialize_2722;
procedure Initialize_2723;
procedure Initialize_2724;
procedure Initialize_2725;
procedure Initialize_2726;
procedure Initialize_2727;
procedure Initialize_2728;
procedure Initialize_2729;
procedure Initialize_2730;
procedure Initialize_2731;
procedure Initialize_2732;
procedure Initialize_2733;
procedure Initialize_2734;
procedure Initialize_2735;
procedure Initialize_2736;
procedure Initialize_2737;
procedure Initialize_2738;
procedure Initialize_2739;
procedure Initialize_2740;
procedure Initialize_2741;
procedure Initialize_2742;
procedure Initialize_2743;
procedure Initialize_2744;
procedure Initialize_2745;
procedure Initialize_2746;
procedure Initialize_2747;
procedure Initialize_2748;
procedure Initialize_2749;
procedure Initialize_2750;
procedure Initialize_2751;
procedure Initialize_2752;
procedure Initialize_2753;
procedure Initialize_2754;
procedure Initialize_2755;
procedure Initialize_2756;
procedure Initialize_2757;
procedure Initialize_2758;
procedure Initialize_2759;
procedure Initialize_2760;
procedure Initialize_2761;
procedure Initialize_2762;
procedure Initialize_2763;
procedure Initialize_2764;
procedure Initialize_2765;
procedure Initialize_2766;
procedure Initialize_2767;
procedure Initialize_2768;
procedure Initialize_2769;
procedure Initialize_2770;
procedure Initialize_2771;
procedure Initialize_2772;
procedure Initialize_2773;
procedure Initialize_2774;
procedure Initialize_2775;
procedure Initialize_2776;
procedure Initialize_2777;
procedure Initialize_2778;
procedure Initialize_2779;
procedure Initialize_2780;
procedure Initialize_2781;
procedure Initialize_2782;
procedure Initialize_2783;
procedure Initialize_2784;
procedure Initialize_2785;
procedure Initialize_2786;
procedure Initialize_2787;
procedure Initialize_2788;
procedure Initialize_2789;
procedure Initialize_2790;
procedure Initialize_2791;
procedure Initialize_2792;
procedure Initialize_2793;
procedure Initialize_2794;
procedure Initialize_2795;
procedure Initialize_2796;
procedure Initialize_2797;
procedure Initialize_2798;
procedure Initialize_2799;
procedure Initialize_2800;
procedure Initialize_2801;
procedure Initialize_2802;
procedure Initialize_2803;
procedure Initialize_2804;
procedure Initialize_2805;
procedure Initialize_2806;
procedure Initialize_2807;
procedure Initialize_2808;
procedure Initialize_2809;
procedure Initialize_2810;
procedure Initialize_2811;
procedure Initialize_2812;
procedure Initialize_2813;
procedure Initialize_2814;
procedure Initialize_2815;
procedure Initialize_2816;
procedure Initialize_2817;
procedure Initialize_2818;
procedure Initialize_2819;
procedure Initialize_2820;
procedure Initialize_2821;
procedure Initialize_2822;
procedure Initialize_2823;
procedure Initialize_2824;
procedure Initialize_2825;
procedure Initialize_2826;
procedure Initialize_2827;
procedure Initialize_2828;
procedure Initialize_2829;
procedure Initialize_2830;
procedure Initialize_2831;
procedure Initialize_2832;
procedure Initialize_2833;
procedure Initialize_2834;
procedure Initialize_2835;
procedure Initialize_2836;
procedure Initialize_2837;
procedure Initialize_2838;
procedure Initialize_2839;
procedure Initialize_2840;
procedure Initialize_2841;
procedure Initialize_2842;
procedure Initialize_2843;
procedure Initialize_2844;
procedure Initialize_2845;
procedure Initialize_2846;
procedure Initialize_2847;
procedure Initialize_2848;
procedure Initialize_2849;
procedure Initialize_2850;
procedure Initialize_2851;
procedure Initialize_2852;
procedure Initialize_2853;
procedure Initialize_2854;
procedure Initialize_2855;
procedure Initialize_2856;
procedure Initialize_2857;
procedure Initialize_2858;
procedure Initialize_2859;
procedure Initialize_2860;
procedure Initialize_2861;
procedure Initialize_2862;
procedure Initialize_2863;
procedure Initialize_2864;
procedure Initialize_2865;
procedure Initialize_2866;
procedure Initialize_2867;
procedure Initialize_2868;
procedure Initialize_2869;
procedure Initialize_2870;
procedure Initialize_2871;
procedure Initialize_2872;
procedure Initialize_2873;
procedure Initialize_2874;
procedure Initialize_2875;
procedure Initialize_2876;
procedure Initialize_2877;
procedure Initialize_2878;
procedure Initialize_2879;
procedure Initialize_2880;
procedure Initialize_2881;
procedure Initialize_2882;
procedure Initialize_2883;
procedure Initialize_2884;
procedure Initialize_2885;
procedure Initialize_2886;
procedure Initialize_2887;
procedure Initialize_2888;
procedure Initialize_2889;
procedure Initialize_2890;
procedure Initialize_2891;
procedure Initialize_2892;
procedure Initialize_2893;
procedure Initialize_2894;
procedure Initialize_2895;
procedure Initialize_2896;
procedure Initialize_2897;
procedure Initialize_2898;
procedure Initialize_2899;
procedure Initialize_2900;
procedure Initialize_2901;
procedure Initialize_2902;
procedure Initialize_2903;
procedure Initialize_2904;
procedure Initialize_2905;
procedure Initialize_2906;
procedure Initialize_2907;
procedure Initialize_2908;
procedure Initialize_2909;
procedure Initialize_2910;
procedure Initialize_2911;
procedure Initialize_2912;
procedure Initialize_2913;
procedure Initialize_2914;
procedure Initialize_2915;
procedure Initialize_2916;
procedure Initialize_2917;
procedure Initialize_2918;
procedure Initialize_2919;
procedure Initialize_2920;
procedure Initialize_2921;
procedure Initialize_2922;
procedure Initialize_2923;
procedure Initialize_2924;
procedure Initialize_2925;
procedure Initialize_2926;
procedure Initialize_2927;
procedure Initialize_2928;
procedure Initialize_2929;
procedure Initialize_2930;
procedure Initialize_2931;
procedure Initialize_2932;
procedure Initialize_2933;
procedure Initialize_2934;
procedure Initialize_2935;
procedure Initialize_2936;
procedure Initialize_2937;
procedure Initialize_2938;
procedure Initialize_2939;
procedure Initialize_2940;
procedure Initialize_2941;
procedure Initialize_2942;
procedure Initialize_2943;
procedure Initialize_2944;
procedure Initialize_2945;
procedure Initialize_2946;
procedure Initialize_2947;
procedure Initialize_2948;
procedure Initialize_2949;
procedure Initialize_2950;
procedure Initialize_2951;
procedure Initialize_2952;
procedure Initialize_2953;
procedure Initialize_2954;
procedure Initialize_2955;
procedure Initialize_2956;
procedure Initialize_2957;
procedure Initialize_2958;
procedure Initialize_2959;
procedure Initialize_2960;
procedure Initialize_2961;
procedure Initialize_2962;
procedure Initialize_2963;
procedure Initialize_2964;
procedure Initialize_2965;
procedure Initialize_2966;
procedure Initialize_2967;
procedure Initialize_2968;
procedure Initialize_2969;
procedure Initialize_2970;
procedure Initialize_2971;
procedure Initialize_2972;
procedure Initialize_2973;
procedure Initialize_2974;
procedure Initialize_2975;
procedure Initialize_2976;
procedure Initialize_2977;
procedure Initialize_2978;
procedure Initialize_2979;
procedure Initialize_2980;
procedure Initialize_2981;
procedure Initialize_2982;
procedure Initialize_2983;
procedure Initialize_2984;
procedure Initialize_2985;
procedure Initialize_2986;
procedure Initialize_2987;
procedure Initialize_2988;
procedure Initialize_2989;
procedure Initialize_2990;
procedure Initialize_2991;
procedure Initialize_2992;
procedure Initialize_2993;
procedure Initialize_2994;
procedure Initialize_2995;
procedure Initialize_2996;
procedure Initialize_2997;
procedure Initialize_2998;
procedure Initialize_2999;
procedure Initialize_3000;
procedure Initialize_3001;
procedure Initialize_3002;
procedure Initialize_3003;
procedure Initialize_3004;
procedure Initialize_3005;
procedure Initialize_3006;
procedure Initialize_3007;
procedure Initialize_3008;
procedure Initialize_3009;
procedure Initialize_3010;
procedure Initialize_3011;
procedure Initialize_3012;
procedure Initialize_3013;
procedure Initialize_3014;
procedure Initialize_3015;
procedure Initialize_3016;
procedure Initialize_3017;
procedure Initialize_3018;
procedure Initialize_3019;
procedure Initialize_3020;
procedure Initialize_3021;
procedure Initialize_3022;
procedure Initialize_3023;
procedure Initialize_3024;
procedure Initialize_3025;
procedure Initialize_3026;
procedure Initialize_3027;
procedure Initialize_3028;
procedure Initialize_3029;
procedure Initialize_3030;
procedure Initialize_3031;
procedure Initialize_3032;
procedure Initialize_3033;
procedure Initialize_3034;
procedure Initialize_3035;
procedure Initialize_3036;
procedure Initialize_3037;
procedure Initialize_3038;
procedure Initialize_3039;
procedure Initialize_3040;
procedure Initialize_3041;
procedure Initialize_3042;
procedure Initialize_3043;
procedure Initialize_3044;
procedure Initialize_3045;
procedure Initialize_3046;
procedure Initialize_3047;
procedure Initialize_3048;
procedure Initialize_3049;
procedure Initialize_3050;
procedure Initialize_3051;
procedure Initialize_3052;
procedure Initialize_3053;
procedure Initialize_3054;
procedure Initialize_3055;
procedure Initialize_3056;
procedure Initialize_3057;
procedure Initialize_3058;
procedure Initialize_3059;
procedure Initialize_3060;
procedure Initialize_3061;
procedure Initialize_3062;
procedure Initialize_3063;
procedure Initialize_3064;
procedure Initialize_3065;
procedure Initialize_3066;
procedure Initialize_3067;
procedure Initialize_3068;
procedure Initialize_3069;
procedure Initialize_3070;
procedure Initialize_3071;
procedure Initialize_3072;
procedure Initialize_3073;
procedure Initialize_3074;
procedure Initialize_3075;
procedure Initialize_3076;
procedure Initialize_3077;
procedure Initialize_3078;
procedure Initialize_3079;
procedure Initialize_3080;
procedure Initialize_3081;
procedure Initialize_3082;
procedure Initialize_3083;
procedure Initialize_3084;
procedure Initialize_3085;
procedure Initialize_3086;
procedure Initialize_3087;
procedure Initialize_3088;
procedure Initialize_3089;
procedure Initialize_3090;
procedure Initialize_3091;
procedure Initialize_3092;
procedure Initialize_3093;
procedure Initialize_3094;
procedure Initialize_3095;
procedure Initialize_3096;
procedure Initialize_3097;
procedure Initialize_3098;
procedure Initialize_3099;
procedure Initialize_3100;
procedure Initialize_3101;
procedure Initialize_3102;
procedure Initialize_3103;
procedure Initialize_3104;
procedure Initialize_3105;
procedure Initialize_3106;
procedure Initialize_3107;
procedure Initialize_3108;
procedure Initialize_3109;
procedure Initialize_3110;
procedure Initialize_3111;
procedure Initialize_3112;
procedure Initialize_3113;
procedure Initialize_3114;
procedure Initialize_3115;
procedure Initialize_3116;
procedure Initialize_3117;
procedure Initialize_3118;
procedure Initialize_3119;
procedure Initialize_3120;
procedure Initialize_3121;
procedure Initialize_3122;
procedure Initialize_3123;
procedure Initialize_3124;
procedure Initialize_3125;
procedure Initialize_3126;
procedure Initialize_3127;
procedure Initialize_3128;
procedure Initialize_3129;
procedure Initialize_3130;
procedure Initialize_3131;
procedure Initialize_3132;
procedure Initialize_3133;
procedure Initialize_3134;
procedure Initialize_3135;
procedure Initialize_3136;
procedure Initialize_3137;
procedure Initialize_3138;
procedure Initialize_3139;
procedure Initialize_3140;
procedure Initialize_3141;
procedure Initialize_3142;
procedure Initialize_3143;
procedure Initialize_3144;
procedure Initialize_3145;
procedure Initialize_3146;
procedure Initialize_3147;
procedure Initialize_3148;
procedure Initialize_3149;
procedure Initialize_3150;
procedure Initialize_3151;
procedure Initialize_3152;
procedure Initialize_3153;
procedure Initialize_3154;
procedure Initialize_3155;
procedure Initialize_3156;
procedure Initialize_3157;
procedure Initialize_3158;
procedure Initialize_3159;
procedure Initialize_3160;
procedure Initialize_3161;
procedure Initialize_3162;
procedure Initialize_3163;
procedure Initialize_3164;
procedure Initialize_3165;
procedure Initialize_3166;
procedure Initialize_3167;
procedure Initialize_3168;
procedure Initialize_3169;
procedure Initialize_3170;
procedure Initialize_3171;
procedure Initialize_3172;
procedure Initialize_3173;
procedure Initialize_3174;
procedure Initialize_3175;
procedure Initialize_3176;
procedure Initialize_3177;
procedure Initialize_3178;
procedure Initialize_3179;
procedure Initialize_3180;
procedure Initialize_3181;
procedure Initialize_3182;
procedure Initialize_3183;
procedure Initialize_3184;
procedure Initialize_3185;
procedure Initialize_3186;
procedure Initialize_3187;
procedure Initialize_3188;
procedure Initialize_3189;
procedure Initialize_3190;
procedure Initialize_3191;
procedure Initialize_3192;
procedure Initialize_3193;
procedure Initialize_3194;
procedure Initialize_3195;
procedure Initialize_3196;
procedure Initialize_3197;
procedure Initialize_3198;
procedure Initialize_3199;
procedure Initialize_3200;
procedure Initialize_3201;
procedure Initialize_3202;
procedure Initialize_3203;
procedure Initialize_3204;
procedure Initialize_3205;
procedure Initialize_3206;
procedure Initialize_3207;
procedure Initialize_3208;
procedure Initialize_3209;
procedure Initialize_3210;
procedure Initialize_3211;
procedure Initialize_3212;
procedure Initialize_3213;
procedure Initialize_3214;
procedure Initialize_3215;
procedure Initialize_3216;
procedure Initialize_3217;
procedure Initialize_3218;
procedure Initialize_3219;
procedure Initialize_3220;
procedure Initialize_3221;
procedure Initialize_3222;
procedure Initialize_3223;
procedure Initialize_3224;
procedure Initialize_3225;
procedure Initialize_3226;
procedure Initialize_3227;
procedure Initialize_3228;
procedure Initialize_3229;
procedure Initialize_3230;
procedure Initialize_3231;
procedure Initialize_3232;
procedure Initialize_3233;
procedure Initialize_3234;
procedure Initialize_3235;
procedure Initialize_3236;
procedure Initialize_3237;
procedure Initialize_3238;
procedure Initialize_3239;
procedure Initialize_3240;
procedure Initialize_3241;
procedure Initialize_3242;
procedure Initialize_3243;
procedure Initialize_3244;
procedure Initialize_3245;
procedure Initialize_3246;
procedure Initialize_3247;
procedure Initialize_3248;
procedure Initialize_3249;
procedure Initialize_3250;
procedure Initialize_3251;
procedure Initialize_3252;
procedure Initialize_3253;
procedure Initialize_3254;
procedure Initialize_3255;
procedure Initialize_3256;
procedure Initialize_3257;
procedure Initialize_3258;
procedure Initialize_3259;
procedure Initialize_3260;
procedure Initialize_3261;
procedure Initialize_3262;
procedure Initialize_3263;
procedure Initialize_3264;
procedure Initialize_3265;
procedure Initialize_3266;
procedure Initialize_3267;
procedure Initialize_3268;
procedure Initialize_3269;
procedure Initialize_3270;
procedure Initialize_3271;
procedure Initialize_3272;
procedure Initialize_3273;
procedure Initialize_3274;
procedure Initialize_3275;
procedure Initialize_3276;
procedure Initialize_3277;
procedure Initialize_3278;
procedure Initialize_3279;
procedure Initialize_3280;
procedure Initialize_3281;
procedure Initialize_3282;
procedure Initialize_3283;
procedure Initialize_3284;
procedure Initialize_3285;
procedure Initialize_3286;
procedure Initialize_3287;
procedure Initialize_3288;
procedure Initialize_3289;
procedure Initialize_3290;
procedure Initialize_3291;
procedure Initialize_3292;
procedure Initialize_3293;
procedure Initialize_3294;
procedure Initialize_3295;
procedure Initialize_3296;
procedure Initialize_3297;
procedure Initialize_3298;
procedure Initialize_3299;
procedure Initialize_3300;
procedure Initialize_3301;
procedure Initialize_3302;
procedure Initialize_3303;
procedure Initialize_3304;
procedure Initialize_3305;
procedure Initialize_3306;
procedure Initialize_3307;
procedure Initialize_3308;
procedure Initialize_3309;
procedure Initialize_3310;
procedure Initialize_3311;
procedure Initialize_3312;
procedure Initialize_3313;
procedure Initialize_3314;
procedure Initialize_3315;
procedure Initialize_3316;
procedure Initialize_3317;
procedure Initialize_3318;
procedure Initialize_3319;
procedure Initialize_3320;
procedure Initialize_3321;
procedure Initialize_3322;
procedure Initialize_3323;
procedure Initialize_3324;
procedure Initialize_3325;
procedure Initialize_3326;
procedure Initialize_3327;
procedure Initialize_3328;
procedure Initialize_3329;
procedure Initialize_3330;
procedure Initialize_3331;
procedure Initialize_3332;
procedure Initialize_3333;
procedure Initialize_3334;
procedure Initialize_3335;
procedure Initialize_3336;
procedure Initialize_3337;
procedure Initialize_3338;
procedure Initialize_3339;
procedure Initialize_3340;
procedure Initialize_3341;
procedure Initialize_3342;
procedure Initialize_3343;
procedure Initialize_3344;
procedure Initialize_3345;
procedure Initialize_3346;
procedure Initialize_3347;
procedure Initialize_3348;
procedure Initialize_3349;
procedure Initialize_3350;
procedure Initialize_3351;
procedure Initialize_3352;
procedure Initialize_3353;
procedure Initialize_3354;
procedure Initialize_3355;
procedure Initialize_3356;
procedure Initialize_3357;
procedure Initialize_3358;
procedure Initialize_3359;
procedure Initialize_3360;
procedure Initialize_3361;
procedure Initialize_3362;
procedure Initialize_3363;
procedure Initialize_3364;
procedure Initialize_3365;
procedure Initialize_3366;
procedure Initialize_3367;
procedure Initialize_3368;
procedure Initialize_3369;
procedure Initialize_3370;
procedure Initialize_3371;
procedure Initialize_3372;
procedure Initialize_3373;
procedure Initialize_3374;
procedure Initialize_3375;
procedure Initialize_3376;
procedure Initialize_3377;
procedure Initialize_3378;
procedure Initialize_3379;
procedure Initialize_3380;
procedure Initialize_3381;
procedure Initialize_3382;
procedure Initialize_3383;
procedure Initialize_3384;
procedure Initialize_3385;
procedure Initialize_3386;
procedure Initialize_3387;
procedure Initialize_3388;
procedure Initialize_3389;
procedure Initialize_3390;
procedure Initialize_3391;
procedure Initialize_3392;
procedure Initialize_3393;
procedure Initialize_3394;
procedure Initialize_3395;
procedure Initialize_3396;
procedure Initialize_3397;
procedure Initialize_3398;
procedure Initialize_3399;
procedure Initialize_3400;
procedure Initialize_3401;
procedure Initialize_3402;
procedure Initialize_3403;
procedure Initialize_3404;
procedure Initialize_3405;
procedure Initialize_3406;
procedure Initialize_3407;
procedure Initialize_3408;
procedure Initialize_3409;
procedure Initialize_3410;
procedure Initialize_3411;
procedure Initialize_3412;
procedure Initialize_3413;
procedure Initialize_3414;
procedure Initialize_3415;
procedure Initialize_3416;
procedure Initialize_3417;
procedure Initialize_3418;
procedure Initialize_3419;
procedure Initialize_3420;
procedure Initialize_3421;
procedure Initialize_3422;
procedure Initialize_3423;
procedure Initialize_3424;
procedure Initialize_3425;
procedure Initialize_3426;
procedure Initialize_3427;
procedure Initialize_3428;
procedure Initialize_3429;
procedure Initialize_3430;
procedure Initialize_3431;
procedure Initialize_3432;
procedure Initialize_3433;
procedure Initialize_3434;
procedure Initialize_3435;
procedure Initialize_3436;
procedure Initialize_3437;
procedure Initialize_3438;
procedure Initialize_3439;
procedure Initialize_3440;
procedure Initialize_3441;
procedure Initialize_3442;
procedure Initialize_3443;
procedure Initialize_3444;
procedure Initialize_3445;
procedure Initialize_3446;
procedure Initialize_3447;
procedure Initialize_3448;
procedure Initialize_3449;
procedure Initialize_3450;
procedure Initialize_3451;
procedure Initialize_3452;
procedure Initialize_3453;
procedure Initialize_3454;
procedure Initialize_3455;
procedure Initialize_3456;
procedure Initialize_3457;
procedure Initialize_3458;
procedure Initialize_3459;
procedure Initialize_3460;
procedure Initialize_3461;
procedure Initialize_3462;
procedure Initialize_3463;
procedure Initialize_3464;
procedure Initialize_3465;
procedure Initialize_3466;
procedure Initialize_3467;
procedure Initialize_3468;
procedure Initialize_3469;
procedure Initialize_3470;
procedure Initialize_3471;
procedure Initialize_3472;
procedure Initialize_3473;
procedure Initialize_3474;
procedure Initialize_3475;
procedure Initialize_3476;
procedure Initialize_3477;
procedure Initialize_3478;
procedure Initialize_3479;
procedure Initialize_3480;
procedure Initialize_3481;
procedure Initialize_3482;
procedure Initialize_3483;
procedure Initialize_3484;
procedure Initialize_3485;
procedure Initialize_3486;
procedure Initialize_3487;
procedure Initialize_3488;
procedure Initialize_3489;
procedure Initialize_3490;
procedure Initialize_3491;
procedure Initialize_3492;
procedure Initialize_3493;
procedure Initialize_3494;
procedure Initialize_3495;
procedure Initialize_3496;
procedure Initialize_3497;
procedure Initialize_3498;
procedure Initialize_3499;
procedure Initialize_3500;
procedure Initialize_3501;
procedure Initialize_3502;
procedure Initialize_3503;
procedure Initialize_3504;
procedure Initialize_3505;
procedure Initialize_3506;
procedure Initialize_3507;
procedure Initialize_3508;
procedure Initialize_3509;
procedure Initialize_3510;
procedure Initialize_3511;
procedure Initialize_3512;
procedure Initialize_3513;
procedure Initialize_3514;
procedure Initialize_3515;
procedure Initialize_3516;
procedure Initialize_3517;
procedure Initialize_3518;
procedure Initialize_3519;
procedure Initialize_3520;
procedure Initialize_3521;
procedure Initialize_3522;
procedure Initialize_3523;
procedure Initialize_3524;
procedure Initialize_3525;
procedure Initialize_3526;
procedure Initialize_3527;
procedure Initialize_3528;
procedure Initialize_3529;
procedure Initialize_3530;
procedure Initialize_3531;
procedure Initialize_3532;
procedure Initialize_3533;
procedure Initialize_3534;
procedure Initialize_3535;
procedure Initialize_3536;
procedure Initialize_3537;
procedure Initialize_3538;
procedure Initialize_3539;
procedure Initialize_3540;
procedure Initialize_3541;
procedure Initialize_3542;
procedure Initialize_3543;
procedure Initialize_3544;
procedure Initialize_3545;
procedure Initialize_3546;
procedure Initialize_3547;
procedure Initialize_3548;
procedure Initialize_3549;
procedure Initialize_3550;
procedure Initialize_3551;
procedure Initialize_3552;
procedure Initialize_3553;
procedure Initialize_3554;
procedure Initialize_3555;
procedure Initialize_3556;
procedure Initialize_3557;
procedure Initialize_3558;
procedure Initialize_3559;
procedure Initialize_3560;
procedure Initialize_3561;
procedure Initialize_3562;
procedure Initialize_3563;
procedure Initialize_3564;
procedure Initialize_3565;
procedure Initialize_3566;
procedure Initialize_3567;
procedure Initialize_3568;
procedure Initialize_3569;
procedure Initialize_3570;
procedure Initialize_3571;
procedure Initialize_3572;
procedure Initialize_3573;
procedure Initialize_3574;
procedure Initialize_3575;
procedure Initialize_3576;
procedure Initialize_3577;
procedure Initialize_3578;
procedure Initialize_3579;
procedure Initialize_3580;
procedure Initialize_3581;
procedure Initialize_3582;
procedure Initialize_3583;
procedure Initialize_3584;
procedure Initialize_3585;
procedure Initialize_3586;
procedure Initialize_3587;
procedure Initialize_3588;
procedure Initialize_3589;
procedure Initialize_3590;
procedure Initialize_3591;
procedure Initialize_3592;
procedure Initialize_3593;
procedure Initialize_3594;
procedure Initialize_3595;
procedure Initialize_3596;
procedure Initialize_3597;
procedure Initialize_3598;
procedure Initialize_3599;
procedure Initialize_3600;
procedure Initialize_3601;
procedure Initialize_3602;
procedure Initialize_3603;
procedure Initialize_3604;
procedure Initialize_3605;
procedure Initialize_3606;
procedure Initialize_3607;
procedure Initialize_3608;
procedure Initialize_3609;
procedure Initialize_3610;
procedure Initialize_3611;
procedure Initialize_3612;
procedure Initialize_3613;
procedure Initialize_3614;
procedure Initialize_3615;
procedure Initialize_3616;
procedure Initialize_3617;
procedure Initialize_3618;
procedure Initialize_3619;
procedure Initialize_3620;
procedure Initialize_3621;
procedure Initialize_3622;
procedure Initialize_3623;
procedure Initialize_3624;
procedure Initialize_3625;
procedure Initialize_3626;
procedure Initialize_3627;
procedure Initialize_3628;
procedure Initialize_3629;
procedure Initialize_3630;
procedure Initialize_3631;
procedure Initialize_3632;
procedure Initialize_3633;
procedure Initialize_3634;
procedure Initialize_3635;
procedure Initialize_3636;
procedure Initialize_3637;
procedure Initialize_3638;
procedure Initialize_3639;
procedure Initialize_3640;
procedure Initialize_3641;
procedure Initialize_3642;
procedure Initialize_3643;
procedure Initialize_3644;
procedure Initialize_3645;
procedure Initialize_3646;
procedure Initialize_3647;
procedure Initialize_3648;
procedure Initialize_3649;
procedure Initialize_3650;
procedure Initialize_3651;
procedure Initialize_3652;
procedure Initialize_3653;
procedure Initialize_3654;
procedure Initialize_3655;
procedure Initialize_3656;
procedure Initialize_3657;
procedure Initialize_3658;
procedure Initialize_3659;
procedure Initialize_3660;
procedure Initialize_3661;
procedure Initialize_3662;
procedure Initialize_3663;
procedure Initialize_3664;
procedure Initialize_3665;
procedure Initialize_3666;
procedure Initialize_3667;
procedure Initialize_3668;
procedure Initialize_3669;
procedure Initialize_3670;
procedure Initialize_3671;
procedure Initialize_3672;
procedure Initialize_3673;
procedure Initialize_3674;
procedure Initialize_3675;
procedure Initialize_3676;
procedure Initialize_3677;
procedure Initialize_3678;
procedure Initialize_3679;
procedure Initialize_3680;
procedure Initialize_3681;
procedure Initialize_3682;
procedure Initialize_3683;
procedure Initialize_3684;
procedure Initialize_3685;
procedure Initialize_3686;
procedure Initialize_3687;
procedure Initialize_3688;
procedure Initialize_3689;
procedure Initialize_3690;
procedure Initialize_3691;
procedure Initialize_3692;
procedure Initialize_3693;
procedure Initialize_3694;
procedure Initialize_3695;
procedure Initialize_3696;
procedure Initialize_3697;
procedure Initialize_3698;
procedure Initialize_3699;
procedure Initialize_3700;
procedure Initialize_3701;
procedure Initialize_3702;
procedure Initialize_3703;
procedure Initialize_3704;
procedure Initialize_3705;
procedure Initialize_3706;
procedure Initialize_3707;
procedure Initialize_3708;
procedure Initialize_3709;
procedure Initialize_3710;
procedure Initialize_3711;
procedure Initialize_3712;
procedure Initialize_3713;
procedure Initialize_3714;
procedure Initialize_3715;
procedure Initialize_3716;
procedure Initialize_3717;
procedure Initialize_3718;
procedure Initialize_3719;
procedure Initialize_3720;
procedure Initialize_3721;
procedure Initialize_3722;
procedure Initialize_3723;
procedure Initialize_3724;
procedure Initialize_3725;
procedure Initialize_3726;
procedure Initialize_3727;
procedure Initialize_3728;
procedure Initialize_3729;
procedure Initialize_3730;
procedure Initialize_3731;
procedure Initialize_3732;
procedure Initialize_3733;
procedure Initialize_3734;
procedure Initialize_3735;
procedure Initialize_3736;
procedure Initialize_3737;
procedure Initialize_3738;
procedure Initialize_3739;
procedure Initialize_3740;
procedure Initialize_3741;
procedure Initialize_3742;
procedure Initialize_3743;
procedure Initialize_3744;
procedure Initialize_3745;
procedure Initialize_3746;
procedure Initialize_3747;
procedure Initialize_3748;
procedure Initialize_3749;
procedure Initialize_3750;
procedure Initialize_3751;
procedure Initialize_3752;
procedure Initialize_3753;
procedure Initialize_3754;
procedure Initialize_3755;
procedure Initialize_3756;
procedure Initialize_3757;
procedure Initialize_3758;
procedure Initialize_3759;
procedure Initialize_3760;
procedure Initialize_3761;
procedure Initialize_3762;
procedure Initialize_3763;
procedure Initialize_3764;
procedure Initialize_3765;
procedure Initialize_3766;
procedure Initialize_3767;
procedure Initialize_3768;
procedure Initialize_3769;
procedure Initialize_3770;
procedure Initialize_3771;
procedure Initialize_3772;
procedure Initialize_3773;
procedure Initialize_3774;
procedure Initialize_3775;
procedure Initialize_3776;
procedure Initialize_3777;
procedure Initialize_3778;
procedure Initialize_3779;
procedure Initialize_3780;
procedure Initialize_3781;
procedure Initialize_3782;
procedure Initialize_3783;
procedure Initialize_3784;
procedure Initialize_3785;
procedure Initialize_3786;
procedure Initialize_3787;
procedure Initialize_3788;
procedure Initialize_3789;
procedure Initialize_3790;
procedure Initialize_3791;
procedure Initialize_3792;
procedure Initialize_3793;
procedure Initialize_3794;
procedure Initialize_3795;
procedure Initialize_3796;
procedure Initialize_3797;
procedure Initialize_3798;
procedure Initialize_3799;
procedure Initialize_3800;
procedure Initialize_3801;
procedure Initialize_3802;
procedure Initialize_3803;
procedure Initialize_3804;
procedure Initialize_3805;
procedure Initialize_3806;
procedure Initialize_3807;
procedure Initialize_3808;
procedure Initialize_3809;
procedure Initialize_3810;
procedure Initialize_3811;
procedure Initialize_3812;
procedure Initialize_3813;
procedure Initialize_3814;
procedure Initialize_3815;
procedure Initialize_3816;
procedure Initialize_3817;
procedure Initialize_3818;
procedure Initialize_3819;
procedure Initialize_3820;
procedure Initialize_3821;
procedure Initialize_3822;
procedure Initialize_3823;
procedure Initialize_3824;
procedure Initialize_3825;
procedure Initialize_3826;
procedure Initialize_3827;
procedure Initialize_3828;
procedure Initialize_3829;
procedure Initialize_3830;
procedure Initialize_3831;
procedure Initialize_3832;
procedure Initialize_3833;
procedure Initialize_3834;
procedure Initialize_3835;
procedure Initialize_3836;
procedure Initialize_3837;
procedure Initialize_3838;
procedure Initialize_3839;
procedure Initialize_3840;
procedure Initialize_3841;
procedure Initialize_3842;
procedure Initialize_3843;
procedure Initialize_3844;
procedure Initialize_3845;
procedure Initialize_3846;
procedure Initialize_3847;
procedure Initialize_3848;
procedure Initialize_3849;
procedure Initialize_3850;
procedure Initialize_3851;
procedure Initialize_3852;
procedure Initialize_3853;
procedure Initialize_3854;
procedure Initialize_3855;
procedure Initialize_3856;
procedure Initialize_3857;
procedure Initialize_3858;
procedure Initialize_3859;
procedure Initialize_3860;
procedure Initialize_3861;
procedure Initialize_3862;
procedure Initialize_3863;
procedure Initialize_3864;
procedure Initialize_3865;
procedure Initialize_3866;
procedure Initialize_3867;
procedure Initialize_3868;
procedure Initialize_3869;
procedure Initialize_3870;
procedure Initialize_3871;
procedure Initialize_3872;
procedure Initialize_3873;
procedure Initialize_3874;
procedure Initialize_3875;
procedure Initialize_3876;
procedure Initialize_3877;
procedure Initialize_3878;
procedure Initialize_3879;
procedure Initialize_3880;
procedure Initialize_3881;
procedure Initialize_3882;
procedure Initialize_3883;
procedure Initialize_3884;
procedure Initialize_3885;
procedure Initialize_3886;
procedure Initialize_3887;
procedure Initialize_3888;
procedure Initialize_3889;
procedure Initialize_3890;
procedure Initialize_3891;
procedure Initialize_3892;
procedure Initialize_3893;
procedure Initialize_3894;
procedure Initialize_3895;
procedure Initialize_3896;
procedure Initialize_3897;
procedure Initialize_3898;
procedure Initialize_3899;
procedure Initialize_3900;
procedure Initialize_3901;
procedure Initialize_3902;
procedure Initialize_3903;
procedure Initialize_3904;
procedure Initialize_3905;
procedure Initialize_3906;
procedure Initialize_3907;
procedure Initialize_3908;
procedure Initialize_3909;
procedure Initialize_3910;
procedure Initialize_3911;
procedure Initialize_3912;
procedure Initialize_3913;
procedure Initialize_3914;
procedure Initialize_3915;
procedure Initialize_3916;
procedure Initialize_3917;
procedure Initialize_3918;
procedure Initialize_3919;
procedure Initialize_3920;
procedure Initialize_3921;
procedure Initialize_3922;
procedure Initialize_3923;
procedure Initialize_3924;
procedure Initialize_3925;
procedure Initialize_3926;
procedure Initialize_3927;
procedure Initialize_3928;
procedure Initialize_3929;
procedure Initialize_3930;
procedure Initialize_3931;
procedure Initialize_3932;
procedure Initialize_3933;
procedure Initialize_3934;
procedure Initialize_3935;
procedure Initialize_3936;
procedure Initialize_3937;
procedure Initialize_3938;
procedure Initialize_3939;
procedure Initialize_3940;
procedure Initialize_3941;
procedure Initialize_3942;
procedure Initialize_3943;
procedure Initialize_3944;
procedure Initialize_3945;
procedure Initialize_3946;
procedure Initialize_3947;
procedure Initialize_3948;
procedure Initialize_3949;
procedure Initialize_3950;
procedure Initialize_3951;
procedure Initialize_3952;
procedure Initialize_3953;
procedure Initialize_3954;
procedure Initialize_3955;
procedure Initialize_3956;
procedure Initialize_3957;
procedure Initialize_3958;
procedure Initialize_3959;
procedure Initialize_3960;
procedure Initialize_3961;
procedure Initialize_3962;
procedure Initialize_3963;
procedure Initialize_3964;
procedure Initialize_3965;
procedure Initialize_3966;
procedure Initialize_3967;
procedure Initialize_3968;
procedure Initialize_3969;
procedure Initialize_3970;
procedure Initialize_3971;
procedure Initialize_3972;
procedure Initialize_3973;
procedure Initialize_3974;
procedure Initialize_3975;
procedure Initialize_3976;
procedure Initialize_3977;
procedure Initialize_3978;
procedure Initialize_3979;
procedure Initialize_3980;
procedure Initialize_3981;
procedure Initialize_3982;
procedure Initialize_3983;
procedure Initialize_3984;
procedure Initialize_3985;
procedure Initialize_3986;
procedure Initialize_3987;
procedure Initialize_3988;
procedure Initialize_3989;
procedure Initialize_3990;
procedure Initialize_3991;
procedure Initialize_3992;
procedure Initialize_3993;
procedure Initialize_3994;
procedure Initialize_3995;
procedure Initialize_3996;
procedure Initialize_3997;
procedure Initialize_3998;
procedure Initialize_3999;
procedure Initialize_4000;
procedure Initialize_4001;
procedure Initialize_4002;
procedure Initialize_4003;
procedure Initialize_4004;
procedure Initialize_4005;
procedure Initialize_4006;
procedure Initialize_4007;
procedure Initialize_4008;
procedure Initialize_4009;
procedure Initialize_4010;
procedure Initialize_4011;
procedure Initialize_4012;
procedure Initialize_4013;
procedure Initialize_4014;
procedure Initialize_4015;
procedure Initialize_4016;
procedure Initialize_4017;
procedure Initialize_4018;
procedure Initialize_4019;
procedure Initialize_4020;
procedure Initialize_4021;
procedure Initialize_4022;
procedure Initialize_4023;
procedure Initialize_4024;
procedure Initialize_4025;
procedure Initialize_4026;
procedure Initialize_4027;
procedure Initialize_4028;
procedure Initialize_4029;
procedure Initialize_4030;
procedure Initialize_4031;
procedure Initialize_4032;
procedure Initialize_4033;
procedure Initialize_4034;
procedure Initialize_4035;
procedure Initialize_4036;
procedure Initialize_4037;
procedure Initialize_4038;
procedure Initialize_4039;
procedure Initialize_4040;
procedure Initialize_4041;
procedure Initialize_4042;
procedure Initialize_4043;
procedure Initialize_4044;
procedure Initialize_4045;
procedure Initialize_4046;
procedure Initialize_4047;
procedure Initialize_4048;
procedure Initialize_4049;
procedure Initialize_4050;
procedure Initialize_4051;
procedure Initialize_4052;
procedure Initialize_4053;
procedure Initialize_4054;
procedure Initialize_4055;
procedure Initialize_4056;
procedure Initialize_4057;
procedure Initialize_4058;
procedure Initialize_4059;
procedure Initialize_4060;
procedure Initialize_4061;
procedure Initialize_4062;
procedure Initialize_4063;
procedure Initialize_4064;
procedure Initialize_4065;
procedure Initialize_4066;
procedure Initialize_4067;
procedure Initialize_4068;
procedure Initialize_4069;
procedure Initialize_4070;
procedure Initialize_4071;
procedure Initialize_4072;
procedure Initialize_4073;
procedure Initialize_4074;
procedure Initialize_4075;
procedure Initialize_4076;
procedure Initialize_4077;
procedure Initialize_4078;
procedure Initialize_4079;
procedure Initialize_4080;
procedure Initialize_4081;
procedure Initialize_4082;
procedure Initialize_4083;
procedure Initialize_4084;
procedure Initialize_4085;
procedure Initialize_4086;
procedure Initialize_4087;
procedure Initialize_4088;
procedure Initialize_4089;
procedure Initialize_4090;
procedure Initialize_4091;
procedure Initialize_4092;
procedure Initialize_4093;
procedure Initialize_4094;
procedure Initialize_4095;
procedure Initialize_4096;
procedure Initialize_4097;
procedure Initialize_4098;
procedure Initialize_4099;
procedure Initialize_4100;
procedure Initialize_4101;
procedure Initialize_4102;
procedure Initialize_4103;
procedure Initialize_4104;
procedure Initialize_4105;
procedure Initialize_4106;
procedure Initialize_4107;
procedure Initialize_4108;
procedure Initialize_4109;
procedure Initialize_4110;
procedure Initialize_4111;
procedure Initialize_4112;
procedure Initialize_4113;
procedure Initialize_4114;
procedure Initialize_4115;
procedure Initialize_4116;
procedure Initialize_4117;
procedure Initialize_4118;
procedure Initialize_4119;
procedure Initialize_4120;
procedure Initialize_4121;
procedure Initialize_4122;
procedure Initialize_4123;
procedure Initialize_4124;
procedure Initialize_4125;
procedure Initialize_4126;
procedure Initialize_4127;
procedure Initialize_4128;
procedure Initialize_4129;
procedure Initialize_4130;
procedure Initialize_4131;
procedure Initialize_4132;
procedure Initialize_4133;
procedure Initialize_4134;
procedure Initialize_4135;
procedure Initialize_4136;
procedure Initialize_4137;
procedure Initialize_4138;
procedure Initialize_4139;
procedure Initialize_4140;
procedure Initialize_4141;
procedure Initialize_4142;
procedure Initialize_4143;
procedure Initialize_4144;
procedure Initialize_4145;
procedure Initialize_4146;
procedure Initialize_4147;
procedure Initialize_4148;
procedure Initialize_4149;
procedure Initialize_4150;
procedure Initialize_4151;
procedure Initialize_4152;
procedure Initialize_4153;
procedure Initialize_4154;
procedure Initialize_4155;
procedure Initialize_4156;
procedure Initialize_4157;
procedure Initialize_4158;
procedure Initialize_4159;
procedure Initialize_4160;
procedure Initialize_4161;
procedure Initialize_4162;
procedure Initialize_4163;
procedure Initialize_4164;
procedure Initialize_4165;
procedure Initialize_4166;
procedure Initialize_4167;
procedure Initialize_4168;
procedure Initialize_4169;
procedure Initialize_4170;
procedure Initialize_4171;
procedure Initialize_4172;
procedure Initialize_4173;
procedure Initialize_4174;
procedure Initialize_4175;
procedure Initialize_4176;
procedure Initialize_4177;
procedure Initialize_4178;
procedure Initialize_4179;
procedure Initialize_4180;
procedure Initialize_4181;
procedure Initialize_4182;
procedure Initialize_4183;
procedure Initialize_4184;
procedure Initialize_4185;
procedure Initialize_4186;
procedure Initialize_4187;
procedure Initialize_4188;
procedure Initialize_4189;
procedure Initialize_4190;
procedure Initialize_4191;
procedure Initialize_4192;
procedure Initialize_4193;
procedure Initialize_4194;
procedure Initialize_4195;
procedure Initialize_4196;
procedure Initialize_4197;
procedure Initialize_4198;
procedure Initialize_4199;
procedure Initialize_4200;
procedure Initialize_4201;
procedure Initialize_4202;
procedure Initialize_4203;
procedure Initialize_4204;
procedure Initialize_4205;
procedure Initialize_4206;
procedure Initialize_4207;
procedure Initialize_4208;
procedure Initialize_4209;
procedure Initialize_4210;
procedure Initialize_4211;
procedure Initialize_4212;
procedure Initialize_4213;
procedure Initialize_4214;
procedure Initialize_4215;
procedure Initialize_4216;
procedure Initialize_4217;
procedure Initialize_4218;
procedure Initialize_4219;
procedure Initialize_4220;
procedure Initialize_4221;
procedure Initialize_4222;
procedure Initialize_4223;
procedure Initialize_4224;
procedure Initialize_4225;
procedure Initialize_4226;
procedure Initialize_4227;
procedure Initialize_4228;
procedure Initialize_4229;
procedure Initialize_4230;
procedure Initialize_4231;
procedure Initialize_4232;
procedure Initialize_4233;
procedure Initialize_4234;
procedure Initialize_4235;
procedure Initialize_4236;
procedure Initialize_4237;
procedure Initialize_4238;
procedure Initialize_4239;
procedure Initialize_4240;
procedure Initialize_4241;
procedure Initialize_4242;
procedure Initialize_4243;
procedure Initialize_4244;
procedure Initialize_4245;
procedure Initialize_4246;
procedure Initialize_4247;
procedure Initialize_4248;
procedure Initialize_4249;
procedure Initialize_4250;
procedure Initialize_4251;
procedure Initialize_4252;
procedure Initialize_4253;
procedure Initialize_4254;
procedure Initialize_4255;
procedure Initialize_4256;
procedure Initialize_4257;
procedure Initialize_4258;
procedure Initialize_4259;
procedure Initialize_4260;
procedure Initialize_4261;
procedure Initialize_4262;
procedure Initialize_4263;
procedure Initialize_4264;
procedure Initialize_4265;
procedure Initialize_4266;
procedure Initialize_4267;
procedure Initialize_4268;
procedure Initialize_4269;
procedure Initialize_4270;
procedure Initialize_4271;
procedure Initialize_4272;
procedure Initialize_4273;
procedure Initialize_4274;
procedure Initialize_4275;
procedure Initialize_4276;
procedure Initialize_4277;
procedure Initialize_4278;
procedure Initialize_4279;
procedure Initialize_4280;
procedure Initialize_4281;
procedure Initialize_4282;
procedure Initialize_4283;
procedure Initialize_4284;
procedure Initialize_4285;
procedure Initialize_4286;
procedure Initialize_4287;
procedure Initialize_4288;
procedure Initialize_4289;
procedure Initialize_4290;
procedure Initialize_4291;
procedure Initialize_4292;
procedure Initialize_4293;
procedure Initialize_4294;
procedure Initialize_4295;
procedure Initialize_4296;
procedure Initialize_4297;
procedure Initialize_4298;
procedure Initialize_4299;
procedure Initialize_4300;
procedure Initialize_4301;
procedure Initialize_4302;
procedure Initialize_4303;
procedure Initialize_4304;
procedure Initialize_4305;
procedure Initialize_4306;
procedure Initialize_4307;
procedure Initialize_4308;
procedure Initialize_4309;
procedure Initialize_4310;
procedure Initialize_4311;
procedure Initialize_4312;
procedure Initialize_4313;
procedure Initialize_4314;
procedure Initialize_4315;
procedure Initialize_4316;
procedure Initialize_4317;
procedure Initialize_4318;
procedure Initialize_4319;
procedure Initialize_4320;
procedure Initialize_4321;
procedure Initialize_4322;
procedure Initialize_4323;
procedure Initialize_4324;
procedure Initialize_4325;
procedure Initialize_4326;
procedure Initialize_4327;
procedure Initialize_4328;
procedure Initialize_4329;
procedure Initialize_4330;
procedure Initialize_4331;
procedure Initialize_4332;
procedure Initialize_4333;
procedure Initialize_4334;
procedure Initialize_4335;
procedure Initialize_4336;
procedure Initialize_4337;
procedure Initialize_4338;
procedure Initialize_4339;
procedure Initialize_4340;
procedure Initialize_4341;
procedure Initialize_4342;
procedure Initialize_4343;
procedure Initialize_4344;
procedure Initialize_4345;
procedure Initialize_4346;
procedure Initialize_4347;
procedure Initialize_4348;
procedure Initialize_4349;
procedure Initialize_4350;
procedure Initialize_4351;
procedure Initialize_4352;
procedure Initialize_4353;
procedure Initialize_4354;
procedure Initialize_4355;
procedure Initialize_4356;
procedure Initialize_4357;
procedure Initialize_4358;
procedure Initialize_4359;
procedure Initialize_4360;
procedure Initialize_4361;
procedure Initialize_4362;
procedure Initialize_4363;
procedure Initialize_4364;
procedure Initialize_4365;
procedure Initialize_4366;
procedure Initialize_4367;
procedure Initialize_4368;
procedure Initialize_4369;
procedure Initialize_4370;
procedure Initialize_4371;
procedure Initialize_4372;
procedure Initialize_4373;
procedure Initialize_4374;
procedure Initialize_4375;
procedure Initialize_4376;
procedure Initialize_4377;
procedure Initialize_4378;
procedure Initialize_4379;
procedure Initialize_4380;
procedure Initialize_4381;
procedure Initialize_4382;
procedure Initialize_4383;
procedure Initialize_4384;
procedure Initialize_4385;
procedure Initialize_4386;
procedure Initialize_4387;
procedure Initialize_4388;
procedure Initialize_4389;
procedure Initialize_4390;
procedure Initialize_4391;
procedure Initialize_4392;
procedure Initialize_4393;
procedure Initialize_4394;
procedure Initialize_4395;
procedure Initialize_4396;
procedure Initialize_4397;
procedure Initialize_4398;
procedure Initialize_4399;
procedure Initialize_4400;
procedure Initialize_4401;
procedure Initialize_4402;
procedure Initialize_4403;
procedure Initialize_4404;
procedure Initialize_4405;
procedure Initialize_4406;
procedure Initialize_4407;
procedure Initialize_4408;
procedure Initialize_4409;
procedure Initialize_4410;
procedure Initialize_4411;
procedure Initialize_4412;
procedure Initialize_4413;
procedure Initialize_4414;
procedure Initialize_4415;
procedure Initialize_4416;
procedure Initialize_4417;
procedure Initialize_4418;
procedure Initialize_4419;
procedure Initialize_4420;
procedure Initialize_4421;
procedure Initialize_4422;
procedure Initialize_4423;
procedure Initialize_4424;
procedure Initialize_4425;
procedure Initialize_4426;
procedure Initialize_4427;
procedure Initialize_4428;
procedure Initialize_4429;
procedure Initialize_4430;
procedure Initialize_4431;
procedure Initialize_4432;
procedure Initialize_4433;
procedure Initialize_4434;
procedure Initialize_4435;
procedure Initialize_4436;
procedure Initialize_4437;
procedure Initialize_4438;
procedure Initialize_4439;
procedure Initialize_4440;
procedure Initialize_4441;
procedure Initialize_4442;
procedure Initialize_4443;
procedure Initialize_4444;
procedure Initialize_4445;
procedure Initialize_4446;
procedure Initialize_4447;
procedure Initialize_4448;
procedure Initialize_4449;
procedure Initialize_4450;
procedure Initialize_4451;
procedure Initialize_4452;
procedure Initialize_4453;
procedure Initialize_4454;
procedure Initialize_4455;
procedure Initialize_4456;
procedure Initialize_4457;
procedure Initialize_4458;
procedure Initialize_4459;
procedure Initialize_4460;
procedure Initialize_4461;
procedure Initialize_4462;
procedure Initialize_4463;
procedure Initialize_4464;
procedure Initialize_4465;
procedure Initialize_4466;
procedure Initialize_4467;
procedure Initialize_4468;
procedure Initialize_4469;
procedure Initialize_4470;
procedure Initialize_4471;
procedure Initialize_4472;
procedure Initialize_4473;
procedure Initialize_4474;
procedure Initialize_4475;
procedure Initialize_4476;
procedure Initialize_4477;
procedure Initialize_4478;
procedure Initialize_4479;
procedure Initialize_4480;
procedure Initialize_4481;
procedure Initialize_4482;
procedure Initialize_4483;
procedure Initialize_4484;
procedure Initialize_4485;
procedure Initialize_4486;
procedure Initialize_4487;
procedure Initialize_4488;
procedure Initialize_4489;
procedure Initialize_4490;
procedure Initialize_4491;
procedure Initialize_4492;
procedure Initialize_4493;
procedure Initialize_4494;
procedure Initialize_4495;
procedure Initialize_4496;
procedure Initialize_4497;
procedure Initialize_4498;
procedure Initialize_4499;
procedure Initialize_4500;
procedure Initialize_4501;
procedure Initialize_4502;
procedure Initialize_4503;
procedure Initialize_4504;
procedure Initialize_4505;
procedure Initialize_4506;
procedure Initialize_4507;
procedure Initialize_4508;
procedure Initialize_4509;
procedure Initialize_4510;
procedure Initialize_4511;
procedure Initialize_4512;
procedure Initialize_4513;
procedure Initialize_4514;
procedure Initialize_4515;
procedure Initialize_4516;
procedure Initialize_4517;
procedure Initialize_4518;
procedure Initialize_4519;
procedure Initialize_4520;
procedure Initialize_4521;
procedure Initialize_4522;
procedure Initialize_4523;
procedure Initialize_4524;
procedure Initialize_4525;
procedure Initialize_4526;
procedure Initialize_4527;
procedure Initialize_4528;
procedure Initialize_4529;
procedure Initialize_4530;
procedure Initialize_4531;
procedure Initialize_4532;
procedure Initialize_4533;
procedure Initialize_4534;
procedure Initialize_4535;
procedure Initialize_4536;
procedure Initialize_4537;
procedure Initialize_4538;
procedure Initialize_4539;
procedure Initialize_4540;
procedure Initialize_4541;
procedure Initialize_4542;
procedure Initialize_4543;
procedure Initialize_4544;
procedure Initialize_4545;
procedure Initialize_4546;
procedure Initialize_4547;
procedure Initialize_4548;
procedure Initialize_4549;
procedure Initialize_4550;
procedure Initialize_4551;
procedure Initialize_4552;
procedure Initialize_4553;
procedure Initialize_4554;
procedure Initialize_4555;
procedure Initialize_4556;
procedure Initialize_4557;
procedure Initialize_4558;
procedure Initialize_4559;
procedure Initialize_4560;
procedure Initialize_4561;
procedure Initialize_4562;
procedure Initialize_4563;
procedure Initialize_4564;
procedure Initialize_4565;
procedure Initialize_4566;
procedure Initialize_4567;
procedure Initialize_4568;
procedure Initialize_4569;
procedure Initialize_4570;
procedure Initialize_4571;
procedure Initialize_4572;
procedure Initialize_4573;
procedure Initialize_4574;
procedure Initialize_4575;
procedure Initialize_4576;
procedure Initialize_4577;
procedure Initialize_4578;
procedure Initialize_4579;
procedure Initialize_4580;
procedure Initialize_4581;
procedure Initialize_4582;
procedure Initialize_4583;
procedure Initialize_4584;
procedure Initialize_4585;
procedure Initialize_4586;
procedure Initialize_4587;
procedure Initialize_4588;
procedure Initialize_4589;
procedure Initialize_4590;
procedure Initialize_4591;
procedure Initialize_4592;
procedure Initialize_4593;
procedure Initialize_4594;
procedure Initialize_4595;
procedure Initialize_4596;
procedure Initialize_4597;
procedure Initialize_4598;
procedure Initialize_4599;
procedure Initialize_4600;
procedure Initialize_4601;
procedure Initialize_4602;
procedure Initialize_4603;
procedure Initialize_4604;
procedure Initialize_4605;
procedure Initialize_4606;
procedure Initialize_4607;
procedure Initialize_4608;
procedure Initialize_4609;
procedure Initialize_4610;
procedure Initialize_4611;
procedure Initialize_4612;
procedure Initialize_4613;
procedure Initialize_4614;
procedure Initialize_4615;
procedure Initialize_4616;
procedure Initialize_4617;
procedure Initialize_4618;
procedure Initialize_4619;
procedure Initialize_4620;
procedure Initialize_4621;
procedure Initialize_4622;
procedure Initialize_4623;
procedure Initialize_4624;
procedure Initialize_4625;
procedure Initialize_4626;
procedure Initialize_4627;
procedure Initialize_4628;
procedure Initialize_4629;
procedure Initialize_4630;
procedure Initialize_4631;
procedure Initialize_4632;
procedure Initialize_4633;
procedure Initialize_4634;
procedure Initialize_4635;
procedure Initialize_4636;
procedure Initialize_4637;
procedure Initialize_4638;
procedure Initialize_4639;
procedure Initialize_4640;
procedure Initialize_4641;
procedure Initialize_4642;
procedure Initialize_4643;
procedure Initialize_4644;
procedure Initialize_4645;
procedure Initialize_4646;
procedure Initialize_4647;
procedure Initialize_4648;
procedure Initialize_4649;
procedure Initialize_4650;
procedure Initialize_4651;
procedure Initialize_4652;
procedure Initialize_4653;
procedure Initialize_4654;
procedure Initialize_4655;
procedure Initialize_4656;
procedure Initialize_4657;
procedure Initialize_4658;
procedure Initialize_4659;
procedure Initialize_4660;
procedure Initialize_4661;
procedure Initialize_4662;
procedure Initialize_4663;
procedure Initialize_4664;
procedure Initialize_4665;
procedure Initialize_4666;
procedure Initialize_4667;
procedure Initialize_4668;
procedure Initialize_4669;
procedure Initialize_4670;
procedure Initialize_4671;
procedure Initialize_4672;
procedure Initialize_4673;
procedure Initialize_4674;
procedure Initialize_4675;
procedure Initialize_4676;
procedure Initialize_4677;
procedure Initialize_4678;
procedure Initialize_4679;
procedure Initialize_4680;
procedure Initialize_4681;
procedure Initialize_4682;
procedure Initialize_4683;
procedure Initialize_4684;
procedure Initialize_4685;
procedure Initialize_4686;
procedure Initialize_4687;
procedure Initialize_4688;
procedure Initialize_4689;
procedure Initialize_4690;
procedure Initialize_4691;
procedure Initialize_4692;
procedure Initialize_4693;
procedure Initialize_4694;
procedure Initialize_4695;
procedure Initialize_4696;
procedure Initialize_4697;
procedure Initialize_4698;
procedure Initialize_4699;
procedure Initialize_4700;
procedure Initialize_4701;
procedure Initialize_4702;
procedure Initialize_4703;
procedure Initialize_4704;
procedure Initialize_4705;
procedure Initialize_4706;
procedure Initialize_4707;
procedure Initialize_4708;
procedure Initialize_4709;
procedure Initialize_4710;
procedure Initialize_4711;
procedure Initialize_4712;
procedure Initialize_4713;
procedure Initialize_4714;
procedure Initialize_4715;
procedure Initialize_4716;
procedure Initialize_4717;
procedure Initialize_4718;
procedure Initialize_4719;
procedure Initialize_4720;
procedure Initialize_4721;
procedure Initialize_4722;
procedure Initialize_4723;
procedure Initialize_4724;
procedure Initialize_4725;
procedure Initialize_4726;
procedure Initialize_4727;
procedure Initialize_4728;
procedure Initialize_4729;
procedure Initialize_4730;
procedure Initialize_4731;
procedure Initialize_4732;
procedure Initialize_4733;
procedure Initialize_4734;
procedure Initialize_4735;
procedure Initialize_4736;
procedure Initialize_4737;
procedure Initialize_4738;
procedure Initialize_4739;
procedure Initialize_4740;
procedure Initialize_4741;
procedure Initialize_4742;
procedure Initialize_4743;
procedure Initialize_4744;
procedure Initialize_4745;
procedure Initialize_4746;
procedure Initialize_4747;
procedure Initialize_4748;
procedure Initialize_4749;
procedure Initialize_4750;
procedure Initialize_4751;
procedure Initialize_4752;
procedure Initialize_4753;
procedure Initialize_4754;
procedure Initialize_4755;
procedure Initialize_4756;
procedure Initialize_4757;
procedure Initialize_4758;
procedure Initialize_4759;
procedure Initialize_4760;
procedure Initialize_4761;
procedure Initialize_4762;
procedure Initialize_4763;
procedure Initialize_4764;
procedure Initialize_4765;
procedure Initialize_4766;
procedure Initialize_4767;
procedure Initialize_4768;
procedure Initialize_4769;
procedure Initialize_4770;
procedure Initialize_4771;
procedure Initialize_4772;
procedure Initialize_4773;
procedure Initialize_4774;
procedure Initialize_4775;
procedure Initialize_4776;
procedure Initialize_4777;
procedure Initialize_4778;
procedure Initialize_4779;
procedure Initialize_4780;
procedure Initialize_4781;
procedure Initialize_4782;
procedure Initialize_4783;
procedure Initialize_4784;
procedure Initialize_4785;
procedure Initialize_4786;
procedure Initialize_4787;
procedure Initialize_4788;
procedure Initialize_4789;
procedure Initialize_4790;
procedure Initialize_4791;
procedure Initialize_4792;
procedure Initialize_4793;
procedure Initialize_4794;
procedure Initialize_4795;
procedure Initialize_4796;
procedure Initialize_4797;
procedure Initialize_4798;
procedure Initialize_4799;
procedure Initialize_4800;
procedure Initialize_4801;
procedure Initialize_4802;
procedure Initialize_4803;
procedure Initialize_4804;
procedure Initialize_4805;
procedure Initialize_4806;
procedure Initialize_4807;
procedure Initialize_4808;
procedure Initialize_4809;
procedure Initialize_4810;
procedure Initialize_4811;
procedure Initialize_4812;
procedure Initialize_4813;
procedure Initialize_4814;
procedure Initialize_4815;
procedure Initialize_4816;
procedure Initialize_4817;
procedure Initialize_4818;
procedure Initialize_4819;
procedure Initialize_4820;
procedure Initialize_4821;
procedure Initialize_4822;
procedure Initialize_4823;
procedure Initialize_4824;
procedure Initialize_4825;
procedure Initialize_4826;
procedure Initialize_4827;
procedure Initialize_4828;
procedure Initialize_4829;
end AMF.Internals.Tables.UML_Metamodel.Links;
|
KLOC-Karsten/ada_projects | Ada | 2,653 | ads | -- Copyright (c) 2021, Karsten Lueth ([email protected])
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- 1. Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- 2. Redistributions in binary form must reproduce the above copyright notice,
-- this list of conditions and the following disclaimer in the documentation
-- and/or other materials provided with the distribution.
--
-- 3. 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.
--
--
-- Initial contribution by:
-- AdaCore
-- Ada Drivers Library (https://github.com/AdaCore/Ada_Drivers_Library)
-- Package: MMA8653
with HAL; use HAL;
with HAL.I2C; use HAL.I2C;
with Interfaces; use Interfaces;
package BMX055 is
type BMX055_Accelerometer (Port : not null Any_I2C_Port)
is tagged limited private;
procedure Soft_Reset (This : BMX055_Accelerometer);
function Check_Device_Id (This : BMX055_Accelerometer) return Boolean;
subtype Temp_Celsius is Integer_8;
function Read_Temperature
(This : BMX055_Accelerometer) return Temp_Celsius;
private
type BMX055_Accelerometer (Port : not null Any_I2C_Port) is tagged limited
null record;
type Register_Addresss is new UInt8;
Device_Id : constant := 16#FA#;
Who_Am_I : constant Register_Addresss := 16#00#;
ACCD_TEMP : constant Register_Addresss := 16#08#;
BGW_SOFTRESET : constant Register_Addresss := 16#14#;
Device_Address : constant I2C_Address := 16#30#;
end BMX055;
|
skill-lang/adaCommon | Ada | 5,319 | adb | -- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ unknown base pools --
-- |___/_|\_\_|_|____| by: Timm Felden --
-- --
pragma Ada_2012;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with Skill.Equals;
with Skill.Errors;
with Skill.Field_Declarations;
with Skill.Field_Types;
with Skill.Field_Types.Builtin;
with Skill.Files;
with Skill.Internal.File_Parsers;
with Skill.Internal.Parts;
with Skill.Streams;
with Skill.String_Pools;
with Skill.Types.Pools;
with Skill.Types;
with Skill.Containers.Vectors;
-- instantiated pool packages
-- GNAT Bug workaround; should be "new Base(...)" instead
package body Skill.Types.Pools.Sub is
-- API methods
function Get (This : access Pool_T; ID : Skill_ID_T) return P is
begin
if 0 = ID then
return null;
else
return To_P (This.Base.Data (ID));
end if;
end Get;
overriding function Make_Boxed_Instance (This : access Pool_T) return Box is
begin
raise Constraint_Error
with "one must not reflectively allocate an instance of an unknown type!";
return null;
end Make_Boxed_Instance;
----------------------
-- internal methods --
----------------------
-- constructor invoked by new_pool
function Make
(Super : Skill.Types.Pools.Pool;
Type_Id : Natural;
Name : String_Access) return Pools.Pool
is
function Convert is new Ada.Unchecked_Conversion
(Source => Pool,
Target => Skill.Types.Pools.Sub_Pool);
function Convert is new Ada.Unchecked_Conversion
(Source => Pool,
Target => Skill.Types.Pools.Pool);
This : Pool;
begin
This :=
new Pool_T'
(Name => Name,
Type_Id => Type_Id,
Super => Super,
Base => Super.Base,
Sub_Pools => Sub_Pool_Vector_P.Empty_Vector,
Next => null, -- can only be calculated after all types are known
Super_Type_Count => 1 + Super.Super_Type_Count,
Data_Fields_F =>
Skill.Field_Declarations.Field_Vector_P.Empty_Vector,
Known_Fields => No_Known_Fields,
Blocks => Skill.Internal.Parts.Blocks_P.Empty_Vector,
Cached_Size => 0,
Static_Data_Instances => 0,
New_Objects => New_Objects_P.Empty_Vector,
others => <>);
This.Super.Sub_Pools.Append (Convert (This));
return Convert (This);
exception
when E : others =>
raise Skill.Errors.Skill_Error
with "Generic sub pool allocation failed";
end Make;
procedure Free (This : access Pool_T) is
procedure Delete (This : Skill.Field_Declarations.Field_Declaration) is
begin
This.Free;
end Delete;
type P is access all Pool_T;
procedure Delete is new Ada.Unchecked_Deallocation (Pool_T, P);
D : P := P (This);
begin
This.Sub_Pools.Free;
This.Data_Fields_F.Foreach (Delete'Access);
This.Data_Fields_F.Free;
This.Blocks.Free;
This.Book.Free;
This.New_Objects.Free;
Delete (D);
end Free;
function Add_Field
(This : access Pool_T;
ID : Natural;
T : Field_Types.Field_Type;
Name : String_Access;
Restrictions : Field_Restrictions.Vector)
return Skill.Field_Declarations.Field_Declaration
is
type Super is access all Sub_Pool_T;
begin
return Super (This).Add_Field (ID, T, Name, Restrictions);
end Add_Field;
overriding procedure Resize_Pool (This : access Pool_T) is
ID : Skill_ID_T := 1 + Skill_ID_T (This.Blocks.Last_Element.BPO);
Size : Skill_ID_T := This.Blocks.Last_Element.Static_Count;
Data : Skill.Types.Annotation_Array := This.Base.Data;
SD : Book_P.Page;
R : P;
use Interfaces;
begin
This.Static_Data_Instances := This.Static_Data_Instances + Size;
if 0 = Size then
return;
end if;
SD := This.Book.Make_Page (Size);
-- set skill IDs and insert into data
for I in SD'Range loop
R := SD (I)'Access;
R.Skill_ID := ID;
Data (ID) := R.To_Annotation;
ID := ID + 1;
end loop;
end Resize_Pool;
function Offset_Box
(This : access Pool_T;
Target : Types.Box) return Types.v64
is
begin
if null = Unboxed (Target) then
return 1;
else
return Field_Types.Builtin.Offset_Single_V64
(Types.v64 (Unboxed (Target).Skill_ID));
end if;
end Offset_Box;
procedure Write_Box
(This : access Pool_T;
Output : Streams.Writer.Sub_Stream;
Target : Types.Box)
is
begin
if null = Unboxed (Target) then
Output.I8 (0);
else
Output.V64 (Types.v64 (Unboxed (Target).Skill_ID));
end if;
end Write_Box;
end Skill.Types.Pools.Sub;
|
reznikmm/matreshka | Ada | 3,749 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Attributes;
package ODF.DOM.Draw_Stroke_Dash_Names_Attributes is
pragma Preelaborate;
type ODF_Draw_Stroke_Dash_Names_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Draw_Stroke_Dash_Names_Attribute_Access is
access all ODF_Draw_Stroke_Dash_Names_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Draw_Stroke_Dash_Names_Attributes;
|
AaronC98/PlaneSystem | Ada | 3,362 | ads | ------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2003-2012, AdaCore --
-- --
-- This library 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 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- 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/>. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
------------------------------------------------------------------------------
-- Dispatch to the user's callback, if a 404 (Page Not Found) is returned it
-- checks if the resource is a transient page and return it if found.
with AWS.Dispatchers;
with AWS.Response;
with AWS.Status;
package AWS.Services.Dispatchers.Transient_Pages is
type Handler is new AWS.Dispatchers.Handler with private;
procedure Register
(Dispatcher : in out Handler;
Action : AWS.Dispatchers.Handler'Class);
-- Register callback to use for a specific request method
procedure Register
(Dispatcher : in out Handler;
Action : Response.Callback);
-- Idem as above but takes a callback procedure as parameter
private
overriding function Dispatch
(Dispatcher : Handler;
Request : Status.Data) return Response.Data;
-- Returns an error message (code 404) if no transient page were found
overriding function Clone
(Dispatcher : Handler) return Handler;
-- Returns a deep copy of the dispatcher
type Handler is new AWS.Dispatchers.Handler with record
Action : AWS.Dispatchers.Handler_Class_Access;
end record;
end AWS.Services.Dispatchers.Transient_Pages;
|
reznikmm/matreshka | Ada | 3,689 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Attributes;
package ODF.DOM.Draw_Angle_Attributes is
pragma Preelaborate;
type ODF_Draw_Angle_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Draw_Angle_Attribute_Access is
access all ODF_Draw_Angle_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Draw_Angle_Attributes;
|
reznikmm/markdown | Ada | 1,350 | ads | -- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Tags;
with League.String_Vectors;
with Markdown.Blocks;
limited with Markdown.Visitors;
package Markdown.Paragraphs is
type Paragraph is new Markdown.Blocks.Block with private;
overriding function Create
(Line : not null access Markdown.Blocks.Text_Line) return Paragraph;
overriding procedure Append_Line
(Self : in out Paragraph;
Line : Markdown.Blocks.Text_Line;
CIP : Can_Interrupt_Paragraph;
Ok : in out Boolean);
overriding procedure Visit
(Self : in out Paragraph;
Visitor : in out Markdown.Visitors.Visitor'Class);
procedure Filter
(Line : Markdown.Blocks.Text_Line;
Tag : in out Ada.Tags.Tag;
CIP : out Can_Interrupt_Paragraph);
function Lines (Self : Paragraph'Class)
return League.String_Vectors.Universal_String_Vector;
subtype Heading_Level is Natural range 0 .. 2;
function Setext_Heading (Self : Paragraph'Class) return Heading_Level;
private
type Paragraph is new Markdown.Blocks.Block with record
Lines : League.String_Vectors.Universal_String_Vector;
Setext_Level : Heading_Level := 0;
end record;
end Markdown.Paragraphs;
|
vikasbidhuri1995/DW1000 | Ada | 26,591 | adb | -------------------------------------------------------------------------------
-- Copyright (c) 2019 Daniel King
--
-- 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 DW1000.Constants; use DW1000.Constants;
with DW1000.Registers; use DW1000.Registers;
with DW1000.Register_Driver; use DW1000.Register_Driver;
with DW1000.Reception_Quality; use DW1000.Reception_Quality;
with Interfaces; use Interfaces;
package body DecaDriver
with SPARK_Mode => On
is
use Implementation;
Default_SFD_Timeout : constant DW1000.Driver.SFD_Timeout_Number := 16#1041#;
Null_Frame_Info : constant Frame_Info_Type
:= (RX_TIME_Reg => (others => <>),
RX_FINFO_Reg => (others => <>),
RX_FQUAL_Reg => (STD_NOISE => 0,
FP_AMPL2 => 0,
FP_AMPL3 => 0,
CIR_PWR => 0),
RXPACC_NOSAT_Reg => (RXPACC_NOSAT => 0),
RX_TTCKI_Reg => (RXTTCKI => 0),
RX_TTCKO_Reg => (RXTOFS => 0,
RSMPDEL => 0,
RCPHASE => 0.0,
Reserved_1 => 0,
Reserved_2 => 0),
SFD_LENGTH => 64,
Non_Standard_SFD => False);
-------------------------
-- Receive_Timestamp --
-------------------------
function Receive_Timestamp (Frame_Info : in Frame_Info_Type)
return Fine_System_Time is
begin
return Frame_Info.RX_TIME_Reg.RX_STAMP;
end Receive_Timestamp;
----------------------------
-- Receive_Signal_Power --
----------------------------
function Receive_Signal_Power (Frame_Info : in Frame_Info_Type)
return Float is
RXBR : RX_FINFO_RXBR_Field;
SFD_LENGTH : Bits_8;
RXPACC : RX_FINFO_RXPACC_Field;
begin
RXBR := Frame_Info.RX_FINFO_Reg.RXBR;
if RXBR = Reserved then -- Detect reserved value
RXBR := Data_Rate_6M8; -- default to 6.8 Mbps
end if;
SFD_LENGTH := Frame_Info.SFD_LENGTH;
if Frame_Info.Non_Standard_SFD and SFD_LENGTH not in 8 | 16 then
SFD_LENGTH := 8; -- default to length 8
end if;
RXPACC := Adjust_RXPACC
(RXPACC => Frame_Info.RX_FINFO_Reg.RXPACC,
RXPACC_NOSAT => Frame_Info.RXPACC_NOSAT_Reg.RXPACC_NOSAT,
RXBR => RXBR,
SFD_LENGTH => SFD_LENGTH,
Non_Standard_SFD => Frame_Info.Non_Standard_SFD);
return Receive_Signal_Power
(Use_16MHz_PRF => Frame_Info.RX_FINFO_Reg.RXPRF = PRF_16MHz,
RXPACC => RXPACC,
CIR_PWR => Frame_Info.RX_FQUAL_Reg.CIR_PWR);
end Receive_Signal_Power;
-------------------------------
-- First_Path_Signal_Power --
-------------------------------
function First_Path_Signal_Power (Frame_Info : in Frame_Info_Type)
return Float is
RXBR : RX_FINFO_RXBR_Field;
SFD_LENGTH : Bits_8;
RXPACC : RX_FINFO_RXPACC_Field;
begin
RXBR := Frame_Info.RX_FINFO_Reg.RXBR;
if RXBR = Reserved then -- Detect reserved value
RXBR := Data_Rate_6M8; -- default to 6.8 Mbps
end if;
SFD_LENGTH := Frame_Info.SFD_LENGTH;
if Frame_Info.Non_Standard_SFD and SFD_LENGTH not in 8 | 16 then
SFD_LENGTH := 8; -- default to length 8
end if;
RXPACC := Adjust_RXPACC
(RXPACC => Frame_Info.RX_FINFO_Reg.RXPACC,
RXPACC_NOSAT => Frame_Info.RXPACC_NOSAT_Reg.RXPACC_NOSAT,
RXBR => RXBR,
SFD_LENGTH => SFD_LENGTH,
Non_Standard_SFD => Frame_Info.Non_Standard_SFD);
return First_Path_Signal_Power
(Use_16MHz_PRF => Frame_Info.RX_FINFO_Reg.RXPRF = PRF_16MHz,
F1 => Frame_Info.RX_TIME_Reg.FP_AMPL1,
F2 => Frame_Info.RX_FQUAL_Reg.FP_AMPL2,
F3 => Frame_Info.RX_FQUAL_Reg.FP_AMPL3,
RXPACC => RXPACC);
end First_Path_Signal_Power;
--------------------------------
-- Transmitter_Clock_Offset --
--------------------------------
function Transmitter_Clock_Offset (Frame_Info : in Frame_Info_Type)
return Long_Float is
begin
return Transmitter_Clock_Offset
(RXTOFS => Frame_Info.RX_TTCKO_Reg.RXTOFS,
RXTTCKI => Frame_Info.RX_TTCKI_Reg.RXTTCKI);
end Transmitter_Clock_Offset;
--------------
-- Driver --
--------------
protected body Driver is
------------------
-- Initialize --
------------------
procedure Initialize (Load_Antenna_Delay : in Boolean;
Load_XTAL_Trim : in Boolean;
Load_UCode_From_ROM : in Boolean) is
Word : Bits_32;
PMSC_CTRL1_Reg : DW1000.Register_Types.PMSC_CTRL1_Type;
SYS_MASK_Reg : DW1000.Register_Types.SYS_MASK_Type;
begin
DW1000.Driver.Enable_Clocks (DW1000.Driver.Force_Sys_XTI);
DW1000.Driver.Read_OTP (OTP_ADDR_CHIP_ID, Part_ID);
DW1000.Driver.Read_OTP (OTP_ADDR_LOT_ID, Lot_ID);
if Load_Antenna_Delay then
DW1000.Driver.Read_OTP (OTP_ADDR_ANTENNA_DELAY,
Word);
-- High 16 bits are the antenna delay with a 64 MHz PRF.
-- Low 16 bits are the antenna delay with a 16 MHz PRF.
Antenna_Delay_PRF_16 := To_Antenna_Delay_Time (Bits_16 (Word and 16#FFFF#));
Word := Shift_Right (Word, 16);
Antenna_Delay_PRF_64 := To_Antenna_Delay_Time (Bits_16 (Word and 16#FFFF#));
else
Antenna_Delay_PRF_16 := 0.0;
Antenna_Delay_PRF_64 := 0.0;
end if;
if Load_XTAL_Trim then
DW1000.Driver.Read_OTP (OTP_ADDR_XTAL_TRIM, Word);
XTAL_Trim := FS_XTALT_Field (Word and 2#1_1111#);
else
XTAL_Trim := 2#1_0000#; -- Set to midpoint
end if;
if Load_UCode_From_ROM then
DW1000.Driver.Load_LDE_From_ROM;
else
-- Should disable LDERUN bit, since the LDE isn't loaded.
DW1000.Registers.PMSC_CTRL1.Read (PMSC_CTRL1_Reg);
PMSC_CTRL1_Reg.LDERUNE := Disabled;
DW1000.Registers.PMSC_CTRL1.Write (PMSC_CTRL1_Reg);
end if;
DW1000.Driver.Enable_Clocks (Force_Sys_PLL);
DW1000.Driver.Enable_Clocks (Enable_All_Seq);
-- Store a local copy of the SYS_CFG register
DW1000.Registers.SYS_CFG.Read (SYS_CFG_Reg);
-- Configure IRQs
DW1000.Registers.SYS_MASK.Read (SYS_MASK_Reg);
SYS_MASK_Reg.MRXRFTO := Not_Masked;
SYS_MASK_Reg.MRXSFDTO := Not_Masked;
SYS_MASK_Reg.MRXPHE := Not_Masked;
SYS_MASK_Reg.MRXRFSL := Not_Masked;
SYS_MASK_Reg.MRXDFR := Not_Masked; -- Always detect frame received
SYS_MASK_Reg.MTXFRS := Not_Masked; -- Always detect frame sent
DW1000.Registers.SYS_MASK.Write (SYS_MASK_Reg);
Detect_Frame_Timeout := True;
Detect_SFD_Timeout := True;
Detect_PHR_Error := True;
Detect_RS_Error := True;
Detect_FCS_Error := True;
end Initialize;
-----------------
-- Configure --
-----------------
procedure Configure (Config : in Configuration_Type) is
begin
-- 110 kbps data rate has special handling
if Config.Data_Rate = DW1000.Driver.Data_Rate_110k then
SYS_CFG_Reg.RXM110K := SFD_110K;
else
SYS_CFG_Reg.RXM110K := SFD_850K_6M8;
end if;
-- Set physical header mode (standard or extended frames)
Long_Frames := Config.PHR_Mode = Extended_Frames;
SYS_CFG_Reg.PHR_MODE := SYS_CFG_PHR_MODE_Field'Val
(Physical_Header_Modes'Pos (Config.PHR_Mode));
DW1000.Registers.SYS_CFG.Write (SYS_CFG_Reg);
DW1000.Driver.Configure_LDE (Config.PRF,
Config.Rx_Preamble_Code,
Config.Data_Rate);
DW1000.Driver.Configure_PLL (Config.Channel);
DW1000.Driver.Configure_RF (Config.Channel);
DW1000.Driver.Configure_DRX
(PRF => Config.PRF,
Data_Rate => Config.Data_Rate,
Tx_Preamble_Length => Config.Tx_Preamble_Length,
PAC => Config.Rx_PAC,
SFD_Timeout => (if Config.SFD_Timeout = 0
then Default_SFD_Timeout
else Config.SFD_Timeout),
Nonstandard_SFD => Config.Use_Nonstandard_SFD);
DW1000.Driver.Configure_AGC (Config.PRF);
DW1000.Driver.Configure_TC (Config.Channel);
-- If a non-std SFD is used then the SFD length must be programmed
-- for the DecaWave SFD, based on the data rate.
if Config.Use_Nonstandard_SFD then
Configure_Nonstandard_SFD_Length (Config.Data_Rate);
end if;
-- Configure the channel, Rx PRF, non-std SFD, and preamble codes
DW1000.Registers.CHAN_CTRL.Write
(DW1000.Register_Types.CHAN_CTRL_Type'
(TX_CHAN => CHAN_CTRL_Channel_Field (Config.Channel),
RX_CHAN => CHAN_CTRL_Channel_Field (Config.Channel),
DWSFD => (if Config.Use_Nonstandard_SFD
then Enabled
else Disabled),
RXPRF => (if Config.PRF = PRF_16MHz
then PRF_16MHz
else PRF_64MHz),
TNSSFD => (if Config.Use_Nonstandard_SFD
then Enabled
else Disabled),
RNSSFD => (if Config.Use_Nonstandard_SFD
then Enabled
else Disabled),
TX_PCODE => CHAN_CTRL_PCODE_Field (Config.Tx_Preamble_Code),
RX_PCODE => CHAN_CTRL_PCODE_Field (Config.Rx_Preamble_Code),
Reserved => 0));
-- Set the Tx frame control (transmit data rate, PRF, ranging bit)
DW1000.Registers.TX_FCTRL.Write
(DW1000.Register_Types.TX_FCTRL_Type'
(TFLEN => 0,
TFLE => 0,
R => 0,
TXBR => (case Config.Data_Rate is
when Data_Rate_110k => Data_Rate_110K,
when Data_Rate_850k => Data_Rate_850K,
when Data_Rate_6M8 => Data_Rate_6M8),
TR => Enabled,
TXPRF => (if Config.PRF = PRF_16MHz then PRF_16MHz else PRF_64MHz),
TXPSR =>
(case Config.Tx_Preamble_Length is
when PLEN_64 | PLEN_128 | PLEN_256 | PLEN_512 => PLEN_64,
when PLEN_1024 | PLEN_1536 | PLEN_2048 => PLEN_1024,
when others => PLEN_4096),
PE =>
(case Config.Tx_Preamble_Length is
when PLEN_64 | PLEN_1024 | PLEN_4096 => 2#00#,
when PLEN_128 | PLEN_1536 => 2#01#,
when PLEN_256 | PLEN_2048 => 2#10#,
when others => 2#11#),
TXBOFFS => 0,
IFSDELAY => 0));
-- Load the crystal trim (if requested)
if Use_OTP_XTAL_Trim then
DW1000.Driver.Set_XTAL_Trim (XTAL_Trim);
end if;
-- Load the antenna delay (if requested)
if Use_OTP_Antenna_Delay then
if Config.PRF = PRF_16MHz then
DW1000.Driver.Write_Tx_Antenna_Delay (Antenna_Delay_PRF_16);
DW1000.Driver.Write_Rx_Antenna_Delay (Antenna_Delay_PRF_16);
else
DW1000.Driver.Write_Tx_Antenna_Delay (Antenna_Delay_PRF_64);
DW1000.Driver.Write_Rx_Antenna_Delay (Antenna_Delay_PRF_64);
end if;
end if;
end Configure;
------------------------
-- Configure_Errors --
------------------------
procedure Configure_Errors (Enable_Frame_Timeout : in Boolean;
Enable_SFD_Timeout : in Boolean;
Enable_PHR_Error : in Boolean;
Enable_RS_Error : in Boolean;
Enable_FCS_Error : in Boolean) is
begin
Detect_Frame_Timeout := Enable_Frame_Timeout;
Detect_SFD_Timeout := Enable_SFD_Timeout;
Detect_PHR_Error := Enable_PHR_Error;
Detect_RS_Error := Enable_RS_Error;
Detect_FCS_Error := Enable_FCS_Error;
end Configure_Errors;
-----------------------
-- Force_Tx_Rx_Off --
-----------------------
procedure Force_Tx_Rx_Off is
begin
DW1000.Driver.Force_Tx_Rx_Off;
-- Set the Tx Complete flag to True to ensure any task waiting for
-- the current transmission to complete.
Ada.Synchronous_Task_Control.Set_True (Tx_Complete_Flag);
end Force_Tx_Rx_Off;
-------------------
-- Get_Part_ID --
-------------------
function Get_Part_ID return Bits_32 is
begin
return Part_ID;
end Get_Part_ID;
------------------
-- Get_Lot_ID --
------------------
function Get_Lot_ID return Bits_32 is
begin
return Lot_ID;
end Get_Lot_ID;
----------------
-- PHR_Mode --
----------------
function PHR_Mode return DW1000.Driver.Physical_Header_Modes is
begin
if Long_Frames then
return Extended_Frames;
else
return Standard_Frames;
end if;
end PHR_Mode;
--------------------------
-- Start_Tx_Immediate --
--------------------------
procedure Start_Tx_Immediate (Rx_After_Tx : in Boolean;
Auto_Append_FCS : in Boolean) is
begin
DW1000.Driver.Start_Tx_Immediate (Rx_After_Tx, Auto_Append_FCS);
Ada.Synchronous_Task_Control.Set_False (Tx_Complete_Flag);
end Start_Tx_Immediate;
------------------------
-- Start_Tx_Delayed --
------------------------
procedure Start_Tx_Delayed
(Rx_After_Tx : in Boolean;
Result : out DW1000.Driver.Result_Type) is
begin
DW1000.Driver.Start_Tx_Delayed (Rx_After_Tx => Rx_After_Tx,
Result => Result);
if Result = DW1000.Driver.Success then
Ada.Synchronous_Task_Control.Set_False (Tx_Complete_Flag);
else
Ada.Synchronous_Task_Control.Set_True (Tx_Complete_Flag);
end if;
end Start_Tx_Delayed;
---------------
-- Rx_Wait --
---------------
entry Rx_Wait (Frame : in out DW1000.Types.Byte_Array;
Length : out Frame_Length_Number;
Frame_Info : out Frame_Info_Type;
Status : out Rx_Status_Type;
Overrun : out Boolean)
when Frame_Ready is
begin
pragma Assume (Frame_Ready,
"barrier condition is true on entry");
pragma Assume ((if Frame_Ready then Rx_Count > 0),
"Invariant for the Receiver protected object");
Length := Frame_Queue (Queue_Head).Length;
Frame_Info := Frame_Queue (Queue_Head).Frame_Info;
Status := Frame_Queue (Queue_Head).Status;
Overrun := Frame_Queue (Queue_Head).Overrun;
if Status = No_Error then
if Length > 0 then
if Frame'Length >= Length then
Frame (Frame'First .. Frame'First + Integer (Length - 1))
:= Frame_Queue (Queue_Head).Frame (1 .. Length);
else
Frame := Frame_Queue (Queue_Head).Frame (1 .. Frame'Length);
end if;
end if;
else
Length := 0;
end if;
Queue_Head := Queue_Head + 1;
Rx_Count := Rx_Count - 1;
Frame_Ready := Rx_Count > 0;
end Rx_Wait;
----------------------------
-- Pending_Frames_Count --
----------------------------
function Pending_Frames_Count return Natural is
begin
return Rx_Count;
end Pending_Frames_Count;
------------------------------
-- Discard_Pending_Frames --
------------------------------
procedure Discard_Pending_Frames is
begin
Rx_Count := 0;
end Discard_Pending_Frames;
--------------------------
-- Start_Rx_Immediate --
--------------------------
procedure Start_Rx_Immediate is
begin
DW1000.Driver.Start_Rx_Immediate;
end Start_Rx_Immediate;
------------------------
-- Start_Rx_Delayed --
------------------------
procedure Start_Rx_Delayed (Result : out Result_Type) is
begin
DW1000.Driver.Start_Rx_Delayed (Result);
end Start_Rx_Delayed;
----------------------
-- Frame_Received --
----------------------
procedure Frame_Received is
RX_FINFO_Reg : DW1000.Register_Types.RX_FINFO_Type;
Frame_Length : Natural;
Next_Idx : Rx_Frame_Queue_Index;
begin
-- Read the frame length from the DW1000
DW1000.Registers.RX_FINFO.Read (RX_FINFO_Reg);
Frame_Length := Natural (RX_FINFO_Reg.RXFLEN) +
Natural (RX_FINFO_Reg.RXFLE) * 2**7;
-- If a frame is received whose length is larger than the configured
-- maximum frame size, then truncate the frame length.
if Frame_Length > Frame_Length_Number'Last then
Frame_Length := Frame_Length_Number'Last;
end if;
pragma Assert (Frame_Length in Frame_Length_Number);
if Frame_Length > 0 then
if Rx_Count = Frame_Queue'Length then
Overrun_Occurred := True;
else
Next_Idx := Queue_Head + Rx_Frame_Queue_Index (Rx_Count);
Rx_Count := Rx_Count + 1;
Frame_Queue (Next_Idx).Status := No_Error;
Frame_Queue (Next_Idx).Length := Frame_Length;
Frame_Queue (Next_Idx).Overrun := Overrun_Occurred;
DW1000.Register_Driver.Read_Register
(Register_ID => DW1000.Registers.RX_BUFFER_Reg_ID,
Sub_Address => 0,
Data =>
Frame_Queue (Next_Idx).Frame (1 .. Frame_Length));
Overrun_Occurred := False;
DW1000.Registers.RX_FINFO.Read
(Frame_Queue (Next_Idx).Frame_Info.RX_FINFO_Reg);
DW1000.Registers.RX_FQUAL.Read
(Frame_Queue (Next_Idx).Frame_Info.RX_FQUAL_Reg);
DW1000.Registers.RX_TIME.Read
(Frame_Queue (Next_Idx).Frame_Info.RX_TIME_Reg);
DW1000.Registers.RX_TTCKI.Read
(Frame_Queue (Next_Idx).Frame_Info.RX_TTCKI_Reg);
DW1000.Registers.RX_TTCKO.Read
(Frame_Queue (Next_Idx).Frame_Info.RX_TTCKO_Reg);
declare
Byte : Byte_Array (1 .. 1);
begin
-- Don't read the entire USR_SFD register. We only need to
-- read the first byte (the SFD_LENGTH field).
DW1000.Register_Driver.Read_Register
(Register_ID => DW1000.Registers.USR_SFD_Reg_ID,
Sub_Address => 0,
Data => Byte);
Frame_Queue (Next_Idx).Frame_Info.SFD_LENGTH := Byte (1);
end;
-- Check the CHAN_CTRL register to determine whether or not a
-- non-standard SFD is being used.
declare
CHAN_CTRL_Reg : CHAN_CTRL_Type;
begin
DW1000.Registers.CHAN_CTRL.Read (CHAN_CTRL_Reg);
Frame_Queue (Next_Idx).Frame_Info.Non_Standard_SFD
:= CHAN_CTRL_Reg.DWSFD = Enabled;
end;
end if;
Frame_Ready := True;
end if;
DW1000.Driver.Toggle_Host_Side_Rx_Buffer_Pointer;
end Frame_Received;
---------------------
-- Receive_Error --
---------------------
procedure Receive_Error (Result : in Rx_Status_Type) is
Next_Idx : Rx_Frame_Queue_Index;
begin
if Rx_Count = Frame_Queue'Length then
Overrun_Occurred := True;
else
Next_Idx := Queue_Head + Rx_Frame_Queue_Index (Rx_Count);
Rx_Count := Rx_Count + 1;
Frame_Queue (Next_Idx).Length := 0;
Frame_Queue (Next_Idx).Status := Result;
Frame_Queue (Next_Idx).Overrun := Overrun_Occurred;
Frame_Queue (Next_Idx).Frame_Info := Null_Frame_Info;
Overrun_Occurred := False;
end if;
Frame_Ready := True;
end Receive_Error;
------------------
-- DW1000_IRQ --
------------------
procedure DW1000_IRQ is
SYS_STATUS_Reg : DW1000.Register_Types.SYS_STATUS_Type;
SYS_STATUS_Clear : DW1000.Register_Types.SYS_STATUS_Type
:= (Reserved_1 => 0,
Reserved_2 => 0,
others => 0);
begin
DW1000.BSP.Acknowledge_DW1000_IRQ;
DW1000.Registers.SYS_STATUS.Read (SYS_STATUS_Reg);
-- The DW1000 User Manual, Section 4.1.6, states that after certain
-- types of errors the receiver should be reset to ensure that the
-- next good frame has the correct timestamp. To handle this, we
-- use the Reset_Rx procedure.
-- Frame timeout?
if SYS_STATUS_Reg.RXRFTO = 1 then
DW1000.Driver.Reset_Rx;
if Detect_Frame_Timeout then
Receive_Error (Frame_Timeout);
else
DW1000.Driver.Start_Rx_Immediate;
end if;
SYS_STATUS_Clear.RXRFTO := 1;
end if;
-- SFD timeout?
if SYS_STATUS_Reg.RXSFDTO = 1 then
if Detect_SFD_Timeout then
Receive_Error (SFD_Timeout);
else
DW1000.Driver.Start_Rx_Immediate;
end if;
SYS_STATUS_Clear.RXSFDTO := 1;
end if;
-- Physical header error?
if SYS_STATUS_Reg.RXPHE = 1 then
DW1000.Driver.Reset_Rx;
if Detect_PHR_Error then
Receive_Error (PHR_Error);
else
DW1000.Driver.Start_Rx_Immediate;
end if;
SYS_STATUS_Clear.RXPHE := 1;
end if;
-- Reed-Solomon error correction error?
if SYS_STATUS_Reg.RXRFSL = 1 then
DW1000.Driver.Reset_Rx;
if Detect_RS_Error then
Receive_Error (RS_Error);
else
DW1000.Driver.Start_Rx_Immediate;
end if;
SYS_STATUS_Clear.RXRFSL := 1;
end if;
-- Packet received?
if SYS_STATUS_Reg.RXDFR = 1 then
if SYS_STATUS_Reg.RXFCE = 1 then
if Detect_FCS_Error then
Receive_Error (FCS_Error);
else
DW1000.Driver.Start_Rx_Immediate;
end if;
else
Frame_Received;
end if;
-- Clear RX flags
SYS_STATUS_Clear.RXDFR := 1;
SYS_STATUS_Clear.RXFCG := 1;
SYS_STATUS_Clear.RXFCE := 1;
SYS_STATUS_Clear.RXPRD := 1;
SYS_STATUS_Clear.RXSFDD := 1;
SYS_STATUS_Clear.LDEDONE := 1;
SYS_STATUS_Clear.RXPHD := 1;
end if;
-- Transmit complete?
if SYS_STATUS_Reg.TXFRS = 1 then
-- Frame sent
Ada.Synchronous_Task_Control.Set_True (Tx_Complete_Flag);
-- Clear all TX events
SYS_STATUS_Clear.AAT := 1;
SYS_STATUS_Clear.TXFRS := 1;
SYS_STATUS_Clear.TXFRB := 1;
SYS_STATUS_Clear.TXPHS := 1;
SYS_STATUS_Clear.TXPRS := 1;
end if;
SYS_STATUS_Clear.AFFREJ := 1;
-- Clear all events that we have seen.
DW1000.Registers.SYS_STATUS.Write (SYS_STATUS_Clear);
end DW1000_IRQ;
end Driver;
pragma Annotate
(GNATprove, False_Positive,
"call to potentially blocking subprogram ""dw1000.bsp.",
"Procedures in DW1000.BSP are not blocking");
pragma Annotate
(GNATprove, False_Positive,
"call to potentially blocking subprogram ""Acknowledge_DW1000_IRQ",
"DW1000.BSP.Acknowledge_DW1000_IRQ is not blocking");
end DecaDriver;
|
PThierry/ewok-kernel | Ada | 1,213 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - 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 m4.cpu.instructions;
package body m4.scb
with spark_mode => on
is
procedure reset
is
aircr_value : t_SCB_AIRCR;
begin
aircr_value := SCB.AIRCR;
aircr_value.VECTKEY := 16#5FA#;
aircr_value.SYSRESETREQ := 1;
m4.cpu.instructions.DSB;
SCB.AIRCR := aircr_value;
m4.cpu.instructions.DSB;
loop
null; -- Wait until reset
end loop;
end reset;
end m4.scb;
|
reznikmm/matreshka | Ada | 4,623 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Form.Bound_Column_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Form_Bound_Column_Attribute_Node is
begin
return Self : Form_Bound_Column_Attribute_Node do
Matreshka.ODF_Form.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Form_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Form_Bound_Column_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Bound_Column_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Form_URI,
Matreshka.ODF_String_Constants.Bound_Column_Attribute,
Form_Bound_Column_Attribute_Node'Tag);
end Matreshka.ODF_Form.Bound_Column_Attributes;
|
OneWingedShark/Byron | Ada | 3,617 | adb | With
Ada.Strings.Wide_Wide_Unbounded,
Ada.Characters.Wide_Wide_Latin_1;
Package Body Byron.Internals.Expressions.Instances is
use type Ada.Containers.Count_Type;
use all type Expression_Holder_Pkg.Holder;
Function Tag( Name : Wide_Wide_String ) return Wide_Wide_String is
(Name & " -> ");
Function Print( Object : String_Holder_Pkg.Holder ) return Wide_Wide_String is
( '[' & (+Object) & ']');
Function Print( Object : Holder ) return Wide_Wide_String is
( '[' & (+Object) & ']');
Function Print( Object : Wide_Wide_String ) return Wide_Wide_String is
( '[' & Object & ']');
Function Print( Object : Wide_Wide_String;
Level : Ada.Containers.Count_Type ) return Wide_Wide_String is
( (1..Natural(Level) => '.') & Print(Object) );
Function Print( Object : Expressions.List.Vector;
Level : Ada.Containers.Count_Type := 0 ) return Wide_Wide_String is
use Ada.Strings.Wide_Wide_Unbounded, Expressions.List;
Working : Unbounded_Wide_Wide_String;
Last : Natural renames Object.Last_Index;
begin
For Cursor in Object.Iterate loop
Append( Working, Element(Cursor).Print(Level) &
(if To_Index(Cursor) /= Last then EOL else "/")
);
end loop;
Return To_Wide_Wide_String( Working );
end Print;
Function Print( Object : Lexington.Aux.Token_ID;
Level : Ada.Containers.Count_Type := 0 ) return Wide_Wide_String is
( (1..Natural(Level) => TAB) & Lexington.Aux.Token_ID'Wide_Wide_Image(Object) );
Function Print( Object : Conditional_Expression;
Level : Ada.Containers.Count_Type := 0 ) return Wide_Wide_String is
(Tag("if")& Element(Object.Condition).Print(Level) & EOL &
Tag("then")& Element(Object.Then_Arm).Print(Level+1) & EOL &
Tag("else")& Element(Object.Else_Arm).Print(Level+1)
);
Function Print( Object : Assignment_Expression;
Level : Ada.Containers.Count_Type := 0 ) return Wide_Wide_String is
(Tag("Name")& Element(Object.Name).Print(Level) & EOL &
Tag("gets:")& Element(Object.Value).Print(Level+1)
);
Function Print( Object : Call_Expression;
Level : Ada.Containers.Count_Type := 0
) return Wide_Wide_String is
(Tag("Func")& Element(Object.Fn).Print(Level) & EOL &
Tag("args")& Print(Object.Arguments, Level+1)
);
Function Print( Object : Name_Expression;
Level : Ada.Containers.Count_Type := 0 ) return Wide_Wide_String is
(Tag("Name")& Print(+Object.Name, Level)
);
Function Print( Object : Operator_Expression;
Level : Ada.Containers.Count_Type := 0
) return Wide_Wide_String is
(Tag("Op")& Print(Object.Operator, Level) & EOL &
Tag("L")& Element(Object.Left).Print(Level+1) & EOL &
Tag("R")& Element(Object.Right).Print(Level+1)
);
Function Print( Object : Postfix_Expression;
Level : Ada.Containers.Count_Type := 0
) return Wide_Wide_String is
(Tag("Op")& Print(Object.Operator, Level) & ':' &
Tag("L")& Element(Object.Left).Print(Level+1)
);
Function Print( Object : Prefix_Expression;
Level : Ada.Containers.Count_Type := 0
) return Wide_Wide_String is
(Tag("Op")& Print(Object.Operator, Level) & ':' &
Tag("R")& Element(Object.Right).Print(Level+1)
);
End Byron.Internals.Expressions.Instances;
|
reznikmm/matreshka | Ada | 3,709 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Presentation_Hide_Text_Elements is
pragma Preelaborate;
type ODF_Presentation_Hide_Text is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Presentation_Hide_Text_Access is
access all ODF_Presentation_Hide_Text'Class
with Storage_Size => 0;
end ODF.DOM.Presentation_Hide_Text_Elements;
|
ekoeppen/MSP430_Generic_Ada_Drivers | Ada | 545 | ads | -- This spec has been automatically generated from out.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
package MSP430_SVD.INTERRUPTS is
pragma Preelaborate;
-----------------
-- Peripherals --
-----------------
type INTERRUPTS_Peripheral is record
end record
with Volatile;
for INTERRUPTS_Peripheral use record
end record;
INTERRUPTS_Periph : aliased _INTERRUPTS_Peripheral
with Import, Address => _INTERRUPTS_Base;
end MSP430_SVD.INTERRUPTS;
|
reznikmm/matreshka | Ada | 4,384 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2017, Vadim Godunko <[email protected]> --
-- 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 body WUI.Widgets.Buttons is
-----------------
-- Click_Event --
-----------------
overriding procedure Click_Event
(Self : in out Abstract_Button;
Event : in out WUI.Events.Mouse.Click.Click_Event'Class) is
begin
Self.Clicked.Emit;
end Click_Event;
--------------------
-- Clicked_Signal --
--------------------
not overriding function Clicked_Signal
(Self : in out Abstract_Button)
return not null access Core.Slots_0.Signal'Class is
begin
return Self.Clicked'Unchecked_Access;
end Clicked_Signal;
------------------
-- Constructors --
------------------
package body Constructors is
----------------
-- Initialize --
----------------
procedure Initialize
(Self : in out Abstract_Button'Class;
Element : not null WebAPI.HTML.Elements.HTML_Element_Access) is
begin
WUI.Widgets.Constructors.Initialize (Self, Element);
end Initialize;
end Constructors;
end WUI.Widgets.Buttons;
|
reznikmm/matreshka | Ada | 3,768 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Holders.Booleans;
separate (AMF.Internals.Factories.Primitive_Types_Factories)
function Convert_Boolean_To_String
(Value : League.Holders.Holder) return League.Strings.Universal_String is
begin
if League.Holders.Booleans.Element (Value) then
return League.Strings.To_Universal_String ("true");
else
return League.Strings.To_Universal_String ("false");
end if;
end Convert_Boolean_To_String;
|
pvrego/adaino | Ada | 741 | ads | with AVR.TIMERS;
-- =============================================================================
-- Package AVR.PWM_SIMPLEST
--
-- Implements Pulsed Wavelength Modulation for MCU in a simple way.
-- =============================================================================
package AVR.PWM_SIMPLEST is
-- ======================
-- General Public Section
-- ======================
-- Initialize the general parameters of the PWM on the Timer
procedure Initialize
(Timer : TIMERS.Timer_Type);
-- Set the value of the counter which defines the Duty_Cycle
procedure Set_Counter
(Timer : in TIMERS.Timer_Type;
Channel : in TIMERS.Channel_Type;
Counter : in Unsigned_8);
end AVR.PWM_SIMPLEST;
|
kontena/ruby-packer | Ada | 6,695 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <[email protected]> 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2011/03/23 00:39:28 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
procedure ncurses2.menu_test is
function menu_virtualize (c : Key_Code) return Key_Code;
procedure xAdd (l : Line_Position; c : Column_Position; s : String);
function menu_virtualize (c : Key_Code) return Key_Code is
begin
case c is
when Character'Pos (newl) | Key_Exit =>
return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO
when Character'Pos ('u') =>
return M_ScrollUp_Line;
when Character'Pos ('d') =>
return M_ScrollDown_Line;
when Character'Pos ('b') | Key_Next_Page =>
return M_ScrollUp_Page;
when Character'Pos ('f') | Key_Previous_Page =>
return M_ScrollDown_Page;
when Character'Pos ('n') | Key_Cursor_Down =>
return M_Next_Item;
when Character'Pos ('p') | Key_Cursor_Up =>
return M_Previous_Item;
when Character'Pos (' ') =>
return M_Toggle_Item;
when Key_Mouse =>
return c;
when others =>
Beep;
return c;
end case;
end menu_virtualize;
MENU_Y : constant Line_Count := 8;
MENU_X : constant Column_Count := 8;
type String_Access is access String;
animals : constant array (Positive range <>) of String_Access :=
(new String'("Lions"),
new String'("Tigers"),
new String'("Bears"),
new String'("(Oh my!)"),
new String'("Newts"),
new String'("Platypi"),
new String'("Lemurs"));
items_a : constant Item_Array_Access :=
new Item_Array (1 .. animals'Last + 1);
tmp : Event_Mask;
procedure xAdd (l : Line_Position; c : Column_Position; s : String) is
begin
Add (Line => l, Column => c, Str => s);
end xAdd;
mrows : Line_Count;
mcols : Column_Count;
menuwin : Window;
m : Menu;
c1 : Key_Code;
c : Driver_Result;
r : Key_Code;
begin
tmp := Start_Mouse;
xAdd (0, 0, "This is the menu test:");
xAdd (2, 0, " Use up and down arrow to move the select bar.");
xAdd (3, 0, " 'n' and 'p' act like arrows.");
xAdd (4, 0, " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line).");
xAdd (5, 0, " Press return to exit.");
Refresh;
for i in animals'Range loop
items_a.all (i) := New_Item (animals (i).all);
end loop;
items_a.all (animals'Last + 1) := Null_Item;
m := New_Menu (items_a);
Set_Format (m, Line_Position (animals'Last + 1) / 2, 1);
Scale (m, mrows, mcols);
menuwin := Create (mrows + 2, mcols + 2, MENU_Y, MENU_X);
Set_Window (m, menuwin);
Set_KeyPad_Mode (menuwin, True);
Box (menuwin); -- 0,0?
Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1));
Post (m);
loop
c1 := Getchar (menuwin);
r := menu_virtualize (c1);
c := Driver (m, r);
exit when c = Unknown_Request; -- E_UNKNOWN_COMMAND?
if c = Request_Denied then
Beep;
end if;
-- continue ?
end loop;
Move_Cursor (Line => Lines - 2, Column => 0);
Add (Str => "You chose: ");
Add (Str => Name (Current (m)));
Add (Ch => newl);
Pause; -- the C version didn't use Pause, it spelled it out
Post (m, False); -- unpost, not clear :-(
declare begin
Delete (menuwin);
exception when Curses_Exception => null; end;
-- menuwin has children so will raise the exception.
Delete (m);
End_Mouse (tmp);
end ncurses2.menu_test;
|
mfkiwl/ewok-kernel-security-OS | Ada | 2,823 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - 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.tasks_shared; use ewok.tasks_shared;
package body ewok.sleep
with spark_mode => off
is
package TSK renames ewok.tasks;
procedure sleeping
(task_id : in t_real_task_id;
ms : in milliseconds;
mode : in t_sleep_mode)
is
begin
awakening_time(task_id) :=
m4.systick.get_ticks + m4.systick.to_ticks (ms);
if mode = SLEEP_MODE_INTERRUPTIBLE then
TSK.set_state (task_id, TASK_MODE_MAINTHREAD, TASK_STATE_SLEEPING);
else -- SLEEP_MODE_DEEP
TSK.set_state (task_id, TASK_MODE_MAINTHREAD, TASK_STATE_SLEEPING_DEEP);
end if;
end sleeping;
procedure check_is_awoke
is
t : constant m4.systick.t_tick := m4.systick.get_ticks;
begin
for id in config.applications.list'range loop
if (TSK.tasks_list(id).state = TASK_STATE_SLEEPING or
TSK.tasks_list(id).state = TASK_STATE_SLEEPING_DEEP) and then
t > awakening_time(id)
then
TSK.set_state (id, TASK_MODE_MAINTHREAD, TASK_STATE_RUNNABLE);
end if;
end loop;
end check_is_awoke;
procedure try_waking_up
(task_id : in t_real_task_id)
is
begin
if TSK.tasks_list(task_id).state = TASK_STATE_SLEEPING or else
awakening_time(task_id) < m4.systick.get_ticks
then
TSK.set_state (task_id, TASK_MODE_MAINTHREAD, TASK_STATE_RUNNABLE);
end if;
end try_waking_up;
function is_sleeping
(task_id : in t_real_task_id)
return boolean
is
begin
if TSK.tasks_list(task_id).state = TASK_STATE_SLEEPING or
TSK.tasks_list(task_id).state = TASK_STATE_SLEEPING_DEEP
then
if awakening_time(task_id) > m4.systick.get_ticks then
return true;
else
TSK.set_state (task_id, TASK_MODE_MAINTHREAD, TASK_STATE_RUNNABLE);
return false;
end if;
else
return false;
end if;
end is_sleeping;
end ewok.sleep;
|
reznikmm/matreshka | Ada | 3,694 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Text_Changed_Region_Elements is
pragma Preelaborate;
type ODF_Text_Changed_Region is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Text_Changed_Region_Access is
access all ODF_Text_Changed_Region'Class
with Storage_Size => 0;
end ODF.DOM.Text_Changed_Region_Elements;
|
jwarwick/aoc_2020 | Ada | 1,118 | ads | -- AOC 2020, Day 16
with Ada.Containers.Vectors;
with Ada.Containers; use Ada.Containers;
package Day is
type Tickets is private;
function load_file(filename : in String) return Tickets;
function sum_error_rate(t : in Tickets) return Natural;
function departure_fields(t : in Tickets) return Long_Integer;
private
type Field_Rule is record
Min, Max : Natural;
end record;
type Combined_Rules is array(1..2) of Field_Rule;
package Rule_Vectors is new Ada.Containers.Vectors
(Index_Type => Natural,
Element_Type => Combined_Rules);
use Rule_Vectors;
package Value_Vectors is new Ada.Containers.Vectors
(Index_Type => Natural,
Element_Type => Natural);
use Value_Vectors;
package Nested_Vectors is new Ada.Containers.Vectors
(Index_Type => Natural,
Element_Type => Value_Vectors.Vector);
use Nested_Vectors;
type Tickets is record
Rules : Rule_Vectors.Vector := Rule_Vectors.Empty_Vector;
Values : Nested_Vectors.Vector := Nested_Vectors.Empty_Vector;
Ticket : Value_Vectors.Vector := Value_Vectors.Empty_Vector;
end record;
end Day;
|
M1nified/Ada-Samples | Ada | 11,667 | adb | pragma Ada_95;
pragma Warnings (Off);
pragma Source_File_Name (ada_main, Spec_File_Name => "b__main.ads");
pragma Source_File_Name (ada_main, Body_File_Name => "b__main.adb");
pragma Suppress (Overflow_Check);
with System.Restrictions;
with Ada.Exceptions;
package body ada_main is
E135 : Short_Integer; pragma Import (Ada, E135, "system__os_lib_E");
E013 : Short_Integer; pragma Import (Ada, E013, "system__soft_links_E");
E023 : Short_Integer; pragma Import (Ada, E023, "system__exception_table_E");
E128 : Short_Integer; pragma Import (Ada, E128, "ada__io_exceptions_E");
E046 : Short_Integer; pragma Import (Ada, E046, "ada__strings_E");
E048 : Short_Integer; pragma Import (Ada, E048, "ada__strings__maps_E");
E052 : Short_Integer; pragma Import (Ada, E052, "ada__strings__maps__constants_E");
E117 : Short_Integer; pragma Import (Ada, E117, "ada__tags_E");
E127 : Short_Integer; pragma Import (Ada, E127, "ada__streams_E");
E063 : Short_Integer; pragma Import (Ada, E063, "interfaces__c_E");
E090 : Short_Integer; pragma Import (Ada, E090, "interfaces__c__strings_E");
E025 : Short_Integer; pragma Import (Ada, E025, "system__exceptions_E");
E138 : Short_Integer; pragma Import (Ada, E138, "system__file_control_block_E");
E130 : Short_Integer; pragma Import (Ada, E130, "system__file_io_E");
E133 : Short_Integer; pragma Import (Ada, E133, "system__finalization_root_E");
E131 : Short_Integer; pragma Import (Ada, E131, "ada__finalization_E");
E105 : Short_Integer; pragma Import (Ada, E105, "system__task_info_E");
E061 : Short_Integer; pragma Import (Ada, E061, "system__object_reader_E");
E041 : Short_Integer; pragma Import (Ada, E041, "system__dwarf_lines_E");
E017 : Short_Integer; pragma Import (Ada, E017, "system__secondary_stack_E");
E146 : Short_Integer; pragma Import (Ada, E146, "system__tasking__initialization_E");
E036 : Short_Integer; pragma Import (Ada, E036, "system__traceback__symbolic_E");
E006 : Short_Integer; pragma Import (Ada, E006, "ada__real_time_E");
E125 : Short_Integer; pragma Import (Ada, E125, "ada__text_io_E");
E154 : Short_Integer; pragma Import (Ada, E154, "system__tasking__protected_objects_E");
E158 : Short_Integer; pragma Import (Ada, E158, "system__tasking__protected_objects__entries_E");
E162 : Short_Integer; pragma Import (Ada, E162, "system__tasking__queuing_E");
E168 : Short_Integer; pragma Import (Ada, E168, "system__tasking__stages_E");
Local_Priority_Specific_Dispatching : constant String := "";
Local_Interrupt_States : constant String := "";
Is_Elaborated : Boolean := False;
procedure finalize_library is
begin
E158 := E158 - 1;
declare
procedure F1;
pragma Import (Ada, F1, "system__tasking__protected_objects__entries__finalize_spec");
begin
F1;
end;
E125 := E125 - 1;
declare
procedure F2;
pragma Import (Ada, F2, "ada__text_io__finalize_spec");
begin
F2;
end;
declare
procedure F3;
pragma Import (Ada, F3, "system__file_io__finalize_body");
begin
E130 := E130 - 1;
F3;
end;
declare
procedure Reraise_Library_Exception_If_Any;
pragma Import (Ada, Reraise_Library_Exception_If_Any, "__gnat_reraise_library_exception_if_any");
begin
Reraise_Library_Exception_If_Any;
end;
end finalize_library;
procedure adafinal is
procedure s_stalib_adafinal;
pragma Import (C, s_stalib_adafinal, "system__standard_library__adafinal");
procedure Runtime_Finalize;
pragma Import (C, Runtime_Finalize, "__gnat_runtime_finalize");
begin
if not Is_Elaborated then
return;
end if;
Is_Elaborated := False;
Runtime_Finalize;
s_stalib_adafinal;
end adafinal;
type No_Param_Proc is access procedure;
procedure adainit is
Main_Priority : Integer;
pragma Import (C, Main_Priority, "__gl_main_priority");
Time_Slice_Value : Integer;
pragma Import (C, Time_Slice_Value, "__gl_time_slice_val");
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
Locking_Policy : Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
Queuing_Policy : Character;
pragma Import (C, Queuing_Policy, "__gl_queuing_policy");
Task_Dispatching_Policy : Character;
pragma Import (C, Task_Dispatching_Policy, "__gl_task_dispatching_policy");
Priority_Specific_Dispatching : System.Address;
pragma Import (C, Priority_Specific_Dispatching, "__gl_priority_specific_dispatching");
Num_Specific_Dispatching : Integer;
pragma Import (C, Num_Specific_Dispatching, "__gl_num_specific_dispatching");
Main_CPU : Integer;
pragma Import (C, Main_CPU, "__gl_main_cpu");
Interrupt_States : System.Address;
pragma Import (C, Interrupt_States, "__gl_interrupt_states");
Num_Interrupt_States : Integer;
pragma Import (C, Num_Interrupt_States, "__gl_num_interrupt_states");
Unreserve_All_Interrupts : Integer;
pragma Import (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
Detect_Blocking : Integer;
pragma Import (C, Detect_Blocking, "__gl_detect_blocking");
Default_Stack_Size : Integer;
pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
Leap_Seconds_Support : Integer;
pragma Import (C, Leap_Seconds_Support, "__gl_leap_seconds_support");
Bind_Env_Addr : System.Address;
pragma Import (C, Bind_Env_Addr, "__gl_bind_env_addr");
procedure Runtime_Initialize (Install_Handler : Integer);
pragma Import (C, Runtime_Initialize, "__gnat_runtime_initialize");
Finalize_Library_Objects : No_Param_Proc;
pragma Import (C, Finalize_Library_Objects, "__gnat_finalize_library_objects");
begin
if Is_Elaborated then
return;
end if;
Is_Elaborated := True;
Main_Priority := -1;
Time_Slice_Value := -1;
WC_Encoding := 'b';
Locking_Policy := ' ';
Queuing_Policy := ' ';
Task_Dispatching_Policy := ' ';
System.Restrictions.Run_Time_Restrictions :=
(Set =>
(False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, True, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False),
Value => (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
Violated =>
(False, False, False, True, True, False, False, False,
False, False, False, True, True, True, False, False,
True, False, False, True, True, False, True, True,
False, True, True, True, True, False, False, False,
False, False, True, False, False, True, False, False,
False, False, True, False, False, False, True, False,
False, True, True, False, False, True, False, False,
True, False, True, False, True, True, True, False,
False, True, False, True, True, True, False, True,
True, False, True, True, True, True, False, False,
True, False, False, False, False, False, True, True,
False, False, False),
Count => (0, 0, 0, 0, 0, 2, 1, 0, 0, 0),
Unknown => (False, False, False, False, False, False, True, False, False, False));
Priority_Specific_Dispatching :=
Local_Priority_Specific_Dispatching'Address;
Num_Specific_Dispatching := 0;
Main_CPU := -1;
Interrupt_States := Local_Interrupt_States'Address;
Num_Interrupt_States := 0;
Unreserve_All_Interrupts := 0;
Detect_Blocking := 0;
Default_Stack_Size := -1;
Leap_Seconds_Support := 0;
Runtime_Initialize (1);
Finalize_Library_Objects := finalize_library'access;
System.Soft_Links'Elab_Spec;
System.Exception_Table'Elab_Body;
E023 := E023 + 1;
Ada.Io_Exceptions'Elab_Spec;
E128 := E128 + 1;
Ada.Strings'Elab_Spec;
E046 := E046 + 1;
Ada.Strings.Maps'Elab_Spec;
Ada.Strings.Maps.Constants'Elab_Spec;
E052 := E052 + 1;
Ada.Tags'Elab_Spec;
Ada.Streams'Elab_Spec;
E127 := E127 + 1;
Interfaces.C'Elab_Spec;
Interfaces.C.Strings'Elab_Spec;
System.Exceptions'Elab_Spec;
E025 := E025 + 1;
System.File_Control_Block'Elab_Spec;
E138 := E138 + 1;
System.Finalization_Root'Elab_Spec;
E133 := E133 + 1;
Ada.Finalization'Elab_Spec;
E131 := E131 + 1;
System.Task_Info'Elab_Spec;
E105 := E105 + 1;
System.Object_Reader'Elab_Spec;
System.Dwarf_Lines'Elab_Spec;
System.File_Io'Elab_Body;
E130 := E130 + 1;
E090 := E090 + 1;
E063 := E063 + 1;
Ada.Tags'Elab_Body;
E117 := E117 + 1;
E048 := E048 + 1;
System.Soft_Links'Elab_Body;
E013 := E013 + 1;
System.Os_Lib'Elab_Body;
E135 := E135 + 1;
System.Secondary_Stack'Elab_Body;
E017 := E017 + 1;
E041 := E041 + 1;
E061 := E061 + 1;
System.Traceback.Symbolic'Elab_Body;
E036 := E036 + 1;
System.Tasking.Initialization'Elab_Body;
E146 := E146 + 1;
Ada.Real_Time'Elab_Spec;
Ada.Real_Time'Elab_Body;
E006 := E006 + 1;
Ada.Text_Io'Elab_Spec;
Ada.Text_Io'Elab_Body;
E125 := E125 + 1;
System.Tasking.Protected_Objects'Elab_Body;
E154 := E154 + 1;
System.Tasking.Protected_Objects.Entries'Elab_Spec;
E158 := E158 + 1;
System.Tasking.Queuing'Elab_Body;
E162 := E162 + 1;
System.Tasking.Stages'Elab_Body;
E168 := E168 + 1;
end adainit;
procedure Ada_Main_Program;
pragma Import (Ada, Ada_Main_Program, "_ada_main");
function main
(argc : Integer;
argv : System.Address;
envp : System.Address)
return Integer
is
procedure Initialize (Addr : System.Address);
pragma Import (C, Initialize, "__gnat_initialize");
procedure Finalize;
pragma Import (C, Finalize, "__gnat_finalize");
SEH : aliased array (1 .. 2) of Integer;
Ensure_Reference : aliased System.Address := Ada_Main_Program_Name'Address;
pragma Volatile (Ensure_Reference);
begin
gnat_argc := argc;
gnat_argv := argv;
gnat_envp := envp;
Initialize (SEH'Address);
adainit;
Ada_Main_Program;
adafinal;
Finalize;
return (gnat_exit_status);
end;
-- BEGIN Object file/option list
-- D:\AGH - EAIIIB - INFORMATYKA\PWiR\Ada\Ada-Samples\MergeSort\main.o
-- -LD:\AGH - EAIIIB - INFORMATYKA\PWiR\Ada\Ada-Samples\MergeSort\
-- -LD:\AGH - EAIIIB - INFORMATYKA\PWiR\Ada\Ada-Samples\MergeSort\
-- -LD:/gnat/2016/lib/gcc/i686-pc-mingw32/4.9.4/adalib/
-- -static
-- -lgnarl
-- -lgnat
-- -Xlinker
-- --stack=0x200000,0x1000
-- -mthreads
-- -Wl,--stack=0x2000000
-- END Object file/option list
end ada_main;
|
skordal/ada-regex | Ada | 807 | ads | -- Ada regular expression library
-- (c) Kristian Klomsten Skordal 2020 <[email protected]>
-- Report bugs and issues on <https://github.com/skordal/ada-regex>
with Regex.Regular_Expressions; use Regex.Regular_Expressions;
package Regex.Matchers is
-- Checks if a string matches a regular expression:
function Matches (Input : in Regular_Expression; Query : in String; Match_Id : out Natural)
return Boolean;
-- Checks if a string matches a regular expression:
function Matches (Input : in Regular_Expression; Query : in String) return Boolean;
-- Gets the first part of a string that matches a regular expression:
function Get_Match (Input : in Regular_Expression; Query : in String; Complete_Match : out Boolean)
return String;
end Regex.Matchers;
|
micahwelf/FLTK-Ada | Ada | 1,656 | ads |
with
FLTK.Images;
package FLTK.Devices.Graphics is
type Graphics_Driver is new Device with private;
type Graphics_Driver_Reference (Data : not null access Graphics_Driver'Class) is
limited null record with Implicit_Dereference => Data;
function Get_Color
(This : in Graphics_Driver)
return Color;
function Get_Text_Descent
(This : in Graphics_Driver)
return Integer;
function Get_Line_Height
(This : in Graphics_Driver)
return Integer;
function Get_Width
(This : in Graphics_Driver;
Char : in Character)
return Long_Float;
function Get_Width
(This : in Graphics_Driver;
Str : in String)
return Long_Float;
function Get_Font_Kind
(This : in Graphics_Driver)
return Font_Kind;
function Get_Font_Size
(This : in Graphics_Driver)
return Font_Size;
procedure Set_Font
(This : in Graphics_Driver;
Face : in Font_Kind;
Size : in Font_Size);
procedure Draw_Scaled_Image
(This : in Graphics_Driver;
Img : in FLTK.Images.Image'Class;
X, Y, W, H : in Integer);
private
type Graphics_Driver is new Device with null record;
pragma Inline (Get_Color);
pragma Inline (Get_Text_Descent);
pragma Inline (Get_Line_Height);
pragma Inline (Get_Width);
pragma Inline (Get_Font_Kind);
pragma Inline (Get_Font_Size);
pragma Inline (Set_Font);
pragma Inline (Draw_Scaled_Image);
end FLTK.Devices.Graphics;
|
jscparker/math_packages | Ada | 10,821 | adb |
--------------------------------------------------------------------------
-- package body Jacobi_Eigen, Jacobi iterative eigen-decomposition
-- Copyright (C) 2008-2018 Jonathan S. Parker
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------------------------
with Hypot;
package body Jacobi_Eigen is
Zero : constant Real := +0.0;
One : constant Real := +1.0;
Two : constant Real := +2.0;
Half : constant Real := +0.5;
package Hyp is new Hypot (Real); use Hyp;
Min_Exp : constant Integer := Real'Machine_Emin;
Min_Allowed_Real : constant Real := Two ** (Min_Exp - Min_Exp/4);
---------------------------------
-- Get_Jacobi_Rotation_Factors --
---------------------------------
-- underflows OK here. No overflows are OK.
procedure Get_Jacobi_Rotation_Factors
(P, Q : in Real;
s : out Real;
tau : out Real;
Del_D : out Real)
is
t, Alpha, A, B, Denom : Real; -- t is Q / P
begin
s := Zero;
tau := Zero;
Del_D := Zero;
if Abs (P) < Min_Allowed_Real then
return; -- use default vals of s, tau, del_d
end if;
if Abs (Q) > Abs (P) then
-- Abs (P) > 0 (tested before arrival also), which implies Abs (Q) > 0.
t := P / Q;
Alpha := Half * t * (t / (One + Hypotenuse (One, t)));
A := Half * t;
B := One + Alpha;
else -- if Abs (P) >= Abs (Q) then
t := Q / P;
Alpha := Abs (t) + t * (t / (One + Hypotenuse (One, t)));
A := One;
B := One + Alpha;
if t < Zero then A := -A; end if;
end if;
--s := A / Sqrt(B*B + A*A); -- Sine
--c := B / Sqrt(B*B + A*A); -- Cosine
Denom := Hypotenuse (A, B);
s := A / Denom;
tau := A / (B + Denom); -- -(cos - 1) / sin
Del_D := (P * A) / B;
end Get_Jacobi_Rotation_Factors;
---------------------
-- Eigen_Decompose --
---------------------
procedure Eigen_Decompose
(A : in out Matrix;
Q_tr : out Matrix;
Eigenvals : out Col_Vector;
No_of_Sweeps_Performed : out Natural;
Total_No_of_Rotations : out Natural;
Start_Col : in Index := Index'First;
Final_Col : in Index := Index'Last;
Eigenvectors_Desired : in Boolean := True)
is
D : Col_Vector renames Eigenvals;
Z, B : Col_Vector;
Max_Allowed_No_of_Sweeps : constant Positive := 256; -- badly scaled A needs lots
No_of_Preliminary_Sweeps : constant Positive := 14; -- use 14; don't change.
subtype Sweep_Range is Positive range 1 .. Max_Allowed_No_of_Sweeps;
Reciprocal_Epsilon : constant Real := One / (Real'Epsilon * Two**(-3));
-- Bst stnd setting for accuracy seems to be about: Real'Epsilon * Two**(-3).
-- Matrices with clustered eigvals seem to need the more accurate setting (3).
-- Usually, Real'Epsilon := 2.0**(-50) for 15 digit Reals.
Matrix_Size : constant Real := Real (Final_Col) - Real (Start_Col) + One;
No_of_Off_Diag_Elements : constant Real := Half*Matrix_Size*(Matrix_Size-One);
Exp : Integer;
Factor : Real;
s, g, h, tau : Real; -- Rutishauser variable names.
Q, Del_D : Real;
Sum, Mean_Off_Diagonal_Element_Size, Threshold : Real;
Pivot : Real;
begin
-- Initialize all out parameters. D renames Eigenvals.
-- Q_tr starts as Identity; is rotated into set of Eigenvectors of A.
if Eigenvectors_Desired then
Q_tr := (others => (others => Zero));
for j in Index loop
Q_tr(j, j) := One;
end loop;
end if;
-- Don't fill (potentially) giant array with 0's unless it's needed.
-- If Eigenvectors_Desired=False, we can free up much memory if
-- this is never touched.
Z := (others => Zero);
B := (others => Zero);
D := (others => Zero);
for j in Start_Col .. Final_Col loop -- assume A not all init
D(j) := A(j, j);
B(j) := A(j, j);
end loop;
No_of_Sweeps_Performed := 0;
Total_No_of_Rotations := 0;
if Matrix_Size <= One then return; end if; -- right answer for Size=1.
Sweep_Upper_Triangle:
for Sweep_id in Sweep_Range loop
No_of_Sweeps_Performed := Sweep_id - Sweep_Range'First;
Sum := Zero;
for Row in Start_Col .. Final_Col-1 loop --sum off-diagonal elements
for Col in Row+1 .. Final_Col loop
Sum := Sum + Abs (A(Row, Col));
end loop;
end loop;
Mean_Off_Diagonal_Element_Size := Sum / No_of_Off_Diag_Elements;
exit Sweep_Upper_Triangle when Mean_Off_Diagonal_Element_Size < Min_Allowed_Real;
-- Program does Threshold pivoting.
--
-- If a Pivot (an off-diagonal matrix element) satisfies
-- Abs (Pivot) > Threshold, then do a Jacobi rotation to zero it out.
--
-- Next calculate size of Threshold:
if Sweep_id > No_of_Preliminary_Sweeps then
Threshold := Zero;
elsif Standard_Threshold_Policy then
Threshold := One * Mean_Off_Diagonal_Element_Size;
-- On average, fewer overall rotations done here, at slight
-- expense of accuracy.
else
Exp := 11 - Sweep_id;
Factor := One + (+1.666)**Exp;
Threshold := Factor * Mean_Off_Diagonal_Element_Size;
-- The big Threshold here helps with badly scaled matrices.
-- May improve accuracy a bit if scaling is bad. Policy
-- here is closer to that of the original Jacobi, which
-- always rotates away the largest Pivots 1st.
end if;
Pivots_Row_id: for Pivot_Row in Start_Col .. Final_Col-1 loop
sum := 0.0;
Pivots_Col_id: for Pivot_Col in Pivot_Row+1 .. Final_Col loop
Pivot := A(Pivot_Row, Pivot_Col);
-- Have to zero-out sufficiently small A(Pivot_Col, Pivot_Row) to get convergence,
-- ie, to get Mean_Off_Diagonal_Element_Size -> 0.0. The test is:
--
-- A(Pivot_Col, Pivot_Row) / Epsilon <= Abs D(Pivot_Col) and
-- A(Pivot_Col, Pivot_Row) / Epsilon <= Abs D(Pivot_Row).
if (Sweep_id > No_of_Preliminary_Sweeps) and then
(Abs (Pivot) * Reciprocal_Epsilon <= Abs D(Pivot_Row)) and then
(Abs (Pivot) * Reciprocal_Epsilon <= Abs D(Pivot_Col)) then
A(Pivot_Row, Pivot_Col) := Zero;
elsif Abs (Pivot) > Threshold then
Q := Half * (D(Pivot_Col) - D(Pivot_Row));
Get_Jacobi_Rotation_Factors (Pivot, Q, s, tau, Del_D);
D(Pivot_Row) := D(Pivot_Row) - Del_D; -- Locally D is only used for threshold test.
D(Pivot_Col) := D(Pivot_Col) + Del_D;
Z(Pivot_Row) := Z(Pivot_Row) - Del_D; -- Z is reinitialized to 0 each sweep, so
Z(Pivot_Col) := Z(Pivot_Col) + Del_D; -- it sums the small d's 1st. Helps a tad.
A(Pivot_Row, Pivot_Col) := Zero;
if Pivot_Row > Start_Col then
for j in Start_Col .. Pivot_Row-1 loop
g := A(j, Pivot_Row);
h := A(j, Pivot_Col);
A(j, Pivot_Row) := g-s*(h+g*tau);
A(j, Pivot_Col) := h+s*(g-h*tau);
end loop;
end if;
for j in Pivot_Row+1 .. Pivot_Col-1 loop
g := A(Pivot_Row, j);
h := A(j, Pivot_Col);
A(Pivot_Row, j) := g-s*(h+g*tau);
A(j, Pivot_Col) := h+s*(g-h*tau);
end loop;
if Pivot_Col < Final_Col then
for j in Pivot_Col+1 .. Final_Col loop
g := A(Pivot_Row, j);
h := A(Pivot_Col, j);
A(Pivot_Row, j) := g-s*(h+g*tau);
A(Pivot_Col, j) := h+s*(g-h*tau);
end loop;
end if;
if Eigenvectors_Desired then
for j in Start_Col .. Final_Col loop
g := Q_tr(Pivot_Row, j);
h := Q_tr(Pivot_Col, j);
Q_tr(Pivot_Row, j) := g-s*(h+g*tau);
Q_tr(Pivot_Col, j) := h+s*(g-h*tau);
end loop;
end if;
Total_No_of_Rotations := Total_No_of_Rotations + 1;
end if; -- if (Sweep_id > No_of_Preliminary_Sweeps)
end loop Pivots_Col_id;
end loop Pivots_Row_id;
for j in Start_Col .. Final_Col loop -- assume A not all initialized
B(j) := B(j) + Z(j);
D(j) := B(j);
Z(j) := Zero;
end loop;
end loop Sweep_Upper_Triangle;
end Eigen_Decompose;
---------------
-- Sort_Eigs --
---------------
procedure Sort_Eigs
(Eigenvals : in out Col_Vector;
Q_tr : in out Matrix; -- rows are the eigvectors
Start_Col : in Index := Index'First;
Final_Col : in Index := Index'Last;
Sort_Eigvecs_Also : in Boolean := True)
is
Max_Eig, tmp : Real;
Max_id : Index;
begin
if Start_Col < Final_Col then
for i in Start_Col .. Final_Col-1 loop
Max_Eig := Eigenvals(i); Max_id := i;
for j in i+1 .. Final_Col loop
if Eigenvals(j) > Max_Eig then
Max_Eig := Eigenvals(j); Max_id := j;
end if;
end loop;
tmp := Eigenvals(i);
Eigenvals(i) := Max_Eig;
Eigenvals(Max_id) := tmp;
-- swap rows of Q_tr:
if Sort_Eigvecs_Also then
for k in Start_Col .. Final_Col loop
tmp := Q_tr(i, k);
Q_tr(i, k) := Q_tr(Max_id, k);
Q_tr(Max_id, k) := tmp;
end loop;
end if;
end loop;
end if;
end Sort_Eigs;
end Jacobi_Eigen;
|
AdaCore/Ada_Drivers_Library | Ada | 8,211 | adb | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017-2020, 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 NRF_SVD.TIMER; use NRF_SVD.TIMER;
package body nRF.Timers is
-----------
-- Start --
-----------
procedure Start (This : in out Timer) is
begin
This.Periph.TASKS_START := 1;
end Start;
----------
-- Stop --
----------
procedure Stop (This : in out Timer) is
begin
This.Periph.TASKS_STOP := 1;
end Stop;
-----------
-- Clear --
-----------
procedure Clear (This : in out Timer) is
begin
This.Periph.TASKS_CLEAR := 1;
end Clear;
-------------------
-- Set_Prescaler --
-------------------
procedure Set_Prescaler
(This : in out Timer;
Prescaler : UInt4)
is
begin
This.Periph.PRESCALER.PRESCALER := Prescaler;
end Set_Prescaler;
--------------
-- Set_Mode --
--------------
procedure Set_Mode
(This : in out Timer;
Mode : Timer_Mode)
is
begin
This.Periph.MODE.MODE :=
(case Mode is
when Mode_Timer => NRF_SVD.TIMER.Timer,
when Mode_Counter => NRF_SVD.TIMER.Counter);
end Set_Mode;
-----------------
-- Set_Bitmode --
-----------------
procedure Set_Bitmode
(This : in out Timer;
Mode : Timer_Bitmode)
is
begin
This.Periph.BITMODE.BITMODE :=
(case Mode is
when Bitmode_8bit => Val_08Bit,
when Bitmode_16bit => Val_16Bit,
when Bitmode_24bit => Val_24Bit,
when Bitmode_32bit => Val_32Bit);
end Set_Bitmode;
-------------
-- Bitmode --
-------------
function Bitmode (This : Timer) return Timer_Bitmode is
begin
return
(case This.Periph.BITMODE.BITMODE is
when Val_08Bit => Bitmode_8bit,
when Val_16Bit => Bitmode_16bit,
when Val_24Bit => Bitmode_24bit,
when Val_32Bit => Bitmode_32bit);
end Bitmode;
-----------------------
-- Compare_Interrupt --
-----------------------
procedure Compare_Interrupt (This : in out Timer;
Chan : Timer_Channel;
Enable : Boolean)
is
begin
if Enable then
This.Periph.INTENSET.COMPARE.Arr (Integer (Chan)) := Set;
else
This.Periph.INTENSET.COMPARE.Arr (Integer (Chan)) := Intenset_Compare0_Field_Reset;
end if;
end Compare_Interrupt;
----------------------
-- Compare_Shortcut --
----------------------
procedure Compare_Shortcut (This : in out Timer;
Chan : Timer_Channel;
Stop : Boolean;
Clear : Boolean)
is
begin
case Chan is
when 0 =>
This.Periph.SHORTS.COMPARE0_CLEAR := (if Clear then Enabled else Disabled);
This.Periph.SHORTS.COMPARE0_STOP := (if Stop then Enabled else Disabled);
when 1 =>
This.Periph.SHORTS.COMPARE1_CLEAR := (if Clear then Enabled else Disabled);
This.Periph.SHORTS.COMPARE1_STOP := (if Stop then Enabled else Disabled);
when 2 =>
This.Periph.SHORTS.COMPARE2_CLEAR := (if Clear then Enabled else Disabled);
This.Periph.SHORTS.COMPARE2_STOP := (if Stop then Enabled else Disabled);
when 3 =>
This.Periph.SHORTS.COMPARE3_CLEAR := (if Clear then Enabled else Disabled);
This.Periph.SHORTS.COMPARE3_STOP := (if Stop then Enabled else Disabled);
end case;
end Compare_Shortcut;
-----------------
-- Set_Compare --
-----------------
procedure Set_Compare
(This : in out Timer;
Chan : Timer_Channel;
Compare : UInt32)
is
begin
This.Periph.CC (Integer (Chan)) := Compare;
end Set_Compare;
-------------
-- Capture --
-------------
procedure Capture (This : in out Timer;
Chan : Timer_Channel) is
begin
This.Periph.TASKS_CAPTURE (Integer (Chan)) := 1;
end Capture;
-------------
-- Capture --
-------------
function Capture
(This : in out Timer;
Chan : Timer_Channel)
return UInt32
is
begin
This.Capture (Chan);
return This.CC_Register (Chan);
end Capture;
-----------------
-- CC_Register --
-----------------
function CC_Register (This : in out Timer;
Chan : Timer_Channel)
return UInt32
is
begin
return This.Periph.CC (Integer (Chan));
end CC_Register;
----------------
-- Start_Task --
----------------
function Start_Task (This : Timer)
return Task_Type
is (Task_Type (This.Periph.TASKS_START'Address));
---------------
-- Stop_Task --
---------------
function Stop_Task (This : Timer)
return Task_Type
is (Task_Type (This.Periph.TASKS_STOP'Address));
----------------
-- Count_Task --
----------------
function Count_Task (This : Timer)
return Task_Type
is (Task_Type (This.Periph.TASKS_COUNT'Address));
----------------
-- Clear_Task --
----------------
function Clear_Task (This : Timer)
return Task_Type
is (Task_Type (This.Periph.TASKS_CLEAR'Address));
------------------
-- Capture_Task --
------------------
function Capture_Task (This : Timer;
Chan : Timer_Channel)
return Task_Type
is (Task_Type (This.Periph.TASKS_CAPTURE (Integer (Chan))'Address));
-------------------
-- Compare_Event --
-------------------
function Compare_Event (This : Timer;
Chan : Timer_Channel)
return Event_Type
is (Event_Type (This.Periph.EVENTS_COMPARE (Integer (Chan))'Address));
end nRF.Timers;
|
reznikmm/matreshka | Ada | 4,728 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Visitors;
with ODF.DOM.Text_Table_Count_Elements;
package Matreshka.ODF_Text.Table_Count_Elements is
type Text_Table_Count_Element_Node is
new Matreshka.ODF_Text.Abstract_Text_Element_Node
and ODF.DOM.Text_Table_Count_Elements.ODF_Text_Table_Count
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Text_Table_Count_Element_Node;
overriding function Get_Local_Name
(Self : not null access constant Text_Table_Count_Element_Node)
return League.Strings.Universal_String;
overriding procedure Enter_Node
(Self : not null access Text_Table_Count_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Leave_Node
(Self : not null access Text_Table_Count_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Visit_Node
(Self : not null access Text_Table_Count_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
end Matreshka.ODF_Text.Table_Count_Elements;
|
AaronC98/PlaneSystem | Ada | 42,098 | adb | ------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2000-2018, AdaCore --
-- --
-- This library 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 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- 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/>. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
------------------------------------------------------------------------------
pragma Ada_2012;
with Ada.Streams.Stream_IO;
with Ada.Strings.Fixed;
with Ada.Text_IO;
with AWS.Client.HTTP_Utils;
with AWS.Messages;
with AWS.MIME;
with AWS.Net.Buffered;
with AWS.Net.SSL;
with AWS.Translator;
with AWS.URL.Set;
package body AWS.Client is
use AWS.Client.HTTP_Utils;
------------------------
-- Cipher_Description --
------------------------
function Cipher_Description (Connection : HTTP_Connection) return String is
use type AWS.Net.Socket_Access;
begin
if Connection.Socket = null then
return "";
end if;
return Connection.Socket.Cipher_Description;
end Cipher_Description;
-----------------------
-- Clear_SSL_Session --
-----------------------
procedure Clear_SSL_Session (Connection : in out HTTP_Connection) is
begin
Net.SSL.Free (Connection.SSL_Session);
end Clear_SSL_Session;
-----------
-- Close --
-----------
procedure Close (Connection : in out HTTP_Connection) is
begin
Disconnect (Connection);
if Connection.Default_SSL_Config then
Net.SSL.Release (Connection.SSL_Config);
end if;
if ZLib.Is_Open (Connection.Decode_Filter) then
ZLib.Close (Connection.Decode_Filter, Ignore_Error => True);
end if;
Utils.Unchecked_Free (Connection.Decode_Buffer);
Net.SSL.Free (Connection.SSL_Session);
end Close;
---------------------
-- Connect_Timeout --
---------------------
function Connect_Timeout (T : Timeouts_Values) return Duration is
begin
return T.Connect;
end Connect_Timeout;
-----------------
-- Copy_Cookie --
-----------------
procedure Copy_Cookie
(Source : HTTP_Connection;
Destination : in out HTTP_Connection) is
begin
Destination.Cookie := Source.Cookie;
end Copy_Cookie;
------------
-- Create --
------------
function Create
(Host : String;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Retry : Natural := Retry_Default;
Persistent : Boolean := True;
Timeouts : Timeouts_Values := No_Timeout;
Server_Push : Boolean := False;
Certificate : String := Default.Client_Certificate;
User_Agent : String := Default.User_Agent)
return HTTP_Connection is
begin
return Connection : HTTP_Connection do
Create (Connection, Host,
User, Pwd,
Proxy, Proxy_User, Proxy_Pwd,
Retry, Persistent, Timeouts,
Server_Push,
Net.SSL.Null_Config, Certificate, User_Agent);
end return;
end Create;
procedure Create
(Connection : in out HTTP_Connection;
Host : String;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Retry : Natural := Retry_Default;
Persistent : Boolean := True;
Timeouts : Timeouts_Values := No_Timeout;
Server_Push : Boolean := False;
SSL_Config : Net.SSL.Config := Net.SSL.Null_Config;
Certificate : String := Default.Client_Certificate;
User_Agent : String := Default.User_Agent)
is
use type Net.SSL.Config;
Host_URL : constant AWS.URL.Object := AWS.URL.Parse (Host);
Proxy_URL : constant AWS.URL.Object := AWS.URL.Parse (Proxy);
Connect_URL : AWS.URL.Object;
begin
-- If there is a proxy, the host to connect to is the proxy otherwise
-- we connect to the Web server.
if URL.Host (Host_URL) = "" then
raise URL.URL_Error with "wrong host specified or missing protocol.";
end if;
if Proxy = No_Data then
Connect_URL := Host_URL;
else
Connect_URL := Proxy_URL;
end if;
Connection.Host := To_Unbounded_String (Host);
Connection.Host_URL := Host_URL;
Connection.Connect_URL := Connect_URL;
Connection.Auth (WWW).User := Value (User);
Connection.Auth (WWW).Pwd := Value (Pwd);
Connection.Proxy := Value (Proxy);
Connection.Proxy_URL := Proxy_URL;
Connection.Auth (Client.Proxy).User := Value (Proxy_User);
Connection.Auth (Client.Proxy).Pwd := Value (Proxy_Pwd);
Connection.Retry := Create.Retry;
Connection.Persistent := Persistent;
Connection.Streaming := Server_Push;
Connection.Certificate := To_Unbounded_String (Certificate);
Connection.Timeouts := Timeouts;
Connection.User_Agent := To_Unbounded_String (User_Agent);
-- If we have set the proxy or standard authentication we must set the
-- authentication mode to Basic.
if Proxy_User /= No_Data then
Connection.Auth (Client.Proxy).Work_Mode := Basic;
end if;
if User /= No_Data then
Connection.Auth (WWW).Work_Mode := Basic;
end if;
if URL.Security (Host_URL) then
-- This is a secure connection, initialize the SSL layer
Connection.Default_SSL_Config := SSL_Config = Net.SSL.Null_Config;
if Connection.Default_SSL_Config then
Net.SSL.Initialize
(Connection.SSL_Config, Certificate, Net.SSL.TLS_Client);
else
Connection.SSL_Config := SSL_Config;
end if;
end if;
if Persistent and then Connection.Retry = 0 then
-- In this case the connection termination can be initiated by the
-- server or the client after a period. So the connection could be
-- closed while trying to get some data from the server. To be nicer
-- from user's point of view just make sure we retry at least one
-- time before reporting an error.
Connection.Retry := 1;
end if;
end Create;
---------------------
-- Debug_Exception --
---------------------
procedure Debug_Exception (E : Ada.Exceptions.Exception_Occurrence) is
begin
Debug_Message ("! ", Ada.Exceptions.Exception_Message (E));
end Debug_Exception;
-------------------
-- Debug_Message --
-------------------
procedure Debug_Message (Prefix, Message : String) is
begin
if Debug_On then
Text_IO.Put_Line (Prefix & Message);
end if;
end Debug_Message;
------------
-- Delete --
------------
function Delete
(URL : String;
Data : String;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Headers : Header_List := Empty_Header_List;
User_Agent : String := Default.User_Agent) return Response.Data
is
begin
return Delete
(URL, Translator.To_Stream_Element_Array (Data),
User, Pwd, Proxy, Proxy_User, Proxy_Pwd, Timeouts,
Headers, User_Agent);
end Delete;
function Delete
(URL : String;
Data : Stream_Element_Array;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Headers : Header_List := Empty_Header_List;
User_Agent : String := Default.User_Agent) return Response.Data
is
Connection : HTTP_Connection;
Result : Response.Data;
begin
Create (Connection,
URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
Persistent => False,
Timeouts => Timeouts,
User_Agent => User_Agent);
Delete (Connection, Result, Data, Headers => Headers);
Close (Connection);
return Result;
exception
when others =>
Close (Connection);
raise;
end Delete;
procedure Delete
(Connection : in out HTTP_Connection;
Result : out Response.Data;
Data : Stream_Element_Array;
URI : String := No_Data;
Headers : Header_List := Empty_Header_List) is
begin
Send_Request
(Connection, HTTP_Utils.DELETE, Result, URI, Data, Headers);
end Delete;
procedure Delete
(Connection : in out HTTP_Connection;
Result : out Response.Data;
Data : String;
URI : String := No_Data;
Headers : Header_List := Empty_Header_List) is
begin
Delete
(Connection => Connection,
Result => Result,
Data => Translator.To_Stream_Element_Array (Data),
URI => URI,
Headers => Headers);
end Delete;
----------------------
-- Error_Processing --
----------------------
procedure Error_Processing
(Connection : in out HTTP_Connection;
Try_Count : in out Natural;
Result : out Response.Data;
Context : String;
E : Ada.Exceptions.Exception_Occurrence;
Stamp : Ada.Real_Time.Time)
is
use Real_Time;
Message : constant String := Ada.Exceptions.Exception_Information (E);
begin
Debug_Exception (E);
if Real_Time.Clock - Stamp >= Connection.Timeouts.Response
or else Net.Is_Timeout (Connection.Socket.all, E)
then
Result := Response.Build
(MIME.Text_Plain, Context & " Timeout", Messages.S408);
elsif Try_Count = 0 then
Result := Response.Build
(MIME.Text_Plain,
Context & " request error. " & Message,
Messages.S400);
else
Result := Response.Empty;
Try_Count := Try_Count - 1;
end if;
Disconnect (Connection);
end Error_Processing;
--------------
-- Finalize --
--------------
overriding procedure Finalize (Connection : in out HTTP_Connection) is
begin
Close (Connection);
end Finalize;
---------
-- Get --
---------
function Get
(URL : String;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Data_Range : Content_Range := No_Range;
Follow_Redirection : Boolean := False;
Certificate : String := Default.Client_Certificate;
Headers : Header_List := Empty_Header_List;
User_Agent : String := Default.User_Agent)
return Response.Data
is
use type Messages.Status_Code;
Result : Response.Data;
Host_URL : AWS.URL.Object;
begin
declare
Connection : HTTP_Connection;
begin
Create (Connection,
URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
Persistent => False,
Certificate => Certificate,
Timeouts => Timeouts,
User_Agent => User_Agent);
Host_URL := Connection.Host_URL; -- For the redirection case
Get (Connection, Result,
Data_Range => Data_Range, Headers => Headers);
Close (Connection);
exception
when others =>
Close (Connection);
raise;
end;
declare
SC : constant Messages.Status_Code := Response.Status_Code (Result);
begin
if Follow_Redirection and then SC = Messages.S305 then
-- This is "Use Proxy" message, Location point to the proxy to
-- use. We do not have the login/password for the proxy.
return Get
(URL, User, Pwd, Response.Location (Result),
Timeouts => Timeouts,
Follow_Redirection => Follow_Redirection,
Certificate => Certificate,
Headers => Headers,
User_Agent => User_Agent);
elsif Follow_Redirection
and then SC in Messages.Redirection
and then SC /= Messages.S300 -- multiple choices
and then SC /= Messages.S304 -- not modified, no redirection
then
declare
use AWS.URL;
Location : AWS.URL.Object :=
AWS.URL.Parse (Response.Location (Result));
begin
if Host (Location) = "" then
Set.Connection_Data
(Location,
Host (Host_URL),
Port (Host_URL),
Security (Host_URL));
end if;
return Get
(AWS.URL.URL (Location), User, Pwd,
Proxy, Proxy_User, Proxy_Pwd, Timeouts,
Data_Range, Follow_Redirection,
Certificate => Certificate,
Headers => Headers,
User_Agent => User_Agent);
end;
else
return Result;
end if;
end;
end Get;
---------
-- Get --
---------
procedure Get
(Connection : in out HTTP_Connection;
Result : out Response.Data;
URI : String := No_Data;
Data_Range : Content_Range := No_Range;
Headers : Header_List := Empty_Header_List)
is
begin
Connection.Data_Range := Data_Range;
Send_Request
(Connection, HTTP_Utils.GET, Result, URI, HTTP_Utils.No_Data, Headers);
end Get;
---------------------
-- Get_Certificate --
---------------------
function Get_Certificate
(Connection : HTTP_Connection) return Net.SSL.Certificate.Object is
begin
if not Connection.Opened then
-- SSL socket have to be created to get certificate
Connect (Connection.Self.all);
end if;
if Connection.Socket.all in AWS.Net.SSL.Socket_Type'Class then
return Net.SSL.Certificate.Get
(Net.SSL.Socket_Type (Connection.Socket.all));
else
return Net.SSL.Certificate.Undefined;
end if;
end Get_Certificate;
----------------
-- Get_Cookie --
----------------
function Get_Cookie (Connection : HTTP_Connection) return String is
begin
return To_String (Connection.Cookie);
end Get_Cookie;
----------
-- Head --
----------
function Head
(URL : String;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Headers : Header_List := Empty_Header_List;
User_Agent : String := Default.User_Agent)
return Response.Data
is
Connection : HTTP_Connection;
Result : Response.Data;
begin
Create (Connection,
URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
Persistent => False,
Timeouts => Timeouts,
User_Agent => User_Agent);
Head (Connection, Result, Headers => Headers);
Close (Connection);
return Result;
exception
when others =>
Close (Connection);
raise;
end Head;
----------
-- Head --
----------
procedure Head
(Connection : in out HTTP_Connection;
Result : out Response.Data;
URI : String := No_Data;
Headers : Header_List := Empty_Header_List)
is
begin
Send_Request
(Connection, HTTP_Utils.HEAD,
Result, URI, HTTP_Utils.No_Data, Headers);
end Head;
----------
-- Host --
----------
function Host (Connection : HTTP_Connection) return String is
begin
return To_String (Connection.Host);
end Host;
----------
-- Post --
----------
function Post
(URL : String;
Data : String;
Content_Type : String := No_Data;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Attachments : Attachment_List := Empty_Attachment_List;
Headers : Header_List := Empty_Header_List;
User_Agent : String := Default.User_Agent)
return Response.Data
is
Connection : HTTP_Connection;
Result : Response.Data;
begin
Create (Connection,
URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
Persistent => False,
Timeouts => Timeouts,
User_Agent => User_Agent);
Post (Connection, Result, Data, Content_Type,
Attachments => Attachments,
Headers => Headers);
Close (Connection);
return Result;
exception
when others =>
Close (Connection);
raise;
end Post;
function Post
(URL : String;
Data : Stream_Element_Array;
Content_Type : String := No_Data;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Attachments : Attachment_List := Empty_Attachment_List;
Headers : Header_List := Empty_Header_List;
User_Agent : String := Default.User_Agent)
return Response.Data
is
Connection : HTTP_Connection;
Result : Response.Data;
begin
Create (Connection,
URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
Persistent => False,
Timeouts => Timeouts,
User_Agent => User_Agent);
Post (Connection, Result, Data, Content_Type,
Attachments => Attachments,
Headers => Headers);
Close (Connection);
return Result;
exception
when others =>
Close (Connection);
raise;
end Post;
procedure Post
(Connection : in out HTTP_Connection;
Result : out Response.Data;
Data : Stream_Element_Array;
Content_Type : String := No_Data;
URI : String := No_Data;
Attachments : Attachment_List := Empty_Attachment_List;
Headers : Header_List := Empty_Header_List) is
begin
Internal_Post
(Connection,
Result,
Data,
URI,
SOAPAction => No_Data,
Content_Type => (if Content_Type = No_Data
then MIME.Application_Octet_Stream
else Content_Type),
Attachments => Attachments,
Headers => Headers);
end Post;
procedure Post
(Connection : in out HTTP_Connection;
Result : out Response.Data;
Data : String;
Content_Type : String := No_Data;
URI : String := No_Data;
Attachments : Attachment_List := Empty_Attachment_List;
Headers : Header_List := Empty_Header_List) is
begin
Internal_Post
(Connection,
Result,
Translator.To_Stream_Element_Array (Data),
URI,
SOAPAction => No_Data,
Content_Type => (if Content_Type = No_Data
then MIME.Application_Form_Data
else Content_Type),
Attachments => Attachments,
Headers => Headers);
end Post;
---------
-- Put --
---------
function Put
(URL : String;
Data : String;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Headers : Header_List := Empty_Header_List;
User_Agent : String := Default.User_Agent) return Response.Data
is
Connection : HTTP_Connection;
Result : Response.Data;
begin
Create (Connection,
URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
Persistent => False,
Timeouts => Timeouts,
User_Agent => User_Agent);
Put (Connection, Result, Data, Headers => Headers);
Close (Connection);
return Result;
exception
when others =>
Close (Connection);
raise;
end Put;
---------
-- Put --
---------
procedure Put
(Connection : in out HTTP_Connection;
Result : out Response.Data;
Data : Stream_Element_Array;
URI : String := No_Data;
Headers : Header_List := Empty_Header_List) is
begin
Send_Request (Connection, HTTP_Utils.PUT, Result, URI, Data, Headers);
end Put;
procedure Put
(Connection : in out HTTP_Connection;
Result : out Response.Data;
Data : String;
URI : String := No_Data;
Headers : Header_List := Empty_Header_List) is
begin
Put
(Connection => Connection,
Result => Result,
Data => Translator.To_Stream_Element_Array (Data),
URI => URI,
Headers => Headers);
end Put;
----------
-- Read --
----------
procedure Read
(Connection : in out HTTP_Connection;
Data : out Stream_Element_Array;
Last : out Stream_Element_Offset)
is
First : Stream_Element_Offset := Data'First;
begin
loop
Read_Some (Connection, Data (First .. Data'Last), Last);
exit when Last = Data'Last or else Last < First;
First := Last + 1;
end loop;
end Read;
---------------
-- Read_Some --
---------------
procedure Read_Some
(Connection : in out HTTP_Connection;
Data : out Stream_Element_Array;
Last : out Stream_Element_Offset)
is
procedure Read_Internal
(Data : out Stream_Element_Array;
Last : out Stream_Element_Offset);
-- Read the encoded data as is from HTTP connection
-------------------
-- Read_Internal --
-------------------
procedure Read_Internal
(Data : out Stream_Element_Array;
Last : out Stream_Element_Offset)
is
Sock : Net.Socket_Type'Class renames Connection.Socket.all;
procedure Skip_Line;
-- Skip a line in the sock stream
procedure Read_Limited;
-- Read Connection.Length characters if it can be contained in Data
-- buffer otherwise just fill the remaining space in Data.
------------------
-- Read_Limited --
------------------
procedure Read_Limited is
Limit : constant Stream_Element_Offset :=
Stream_Element_Offset'Min
(Data'Last,
Data'First
+ Stream_Element_Offset (Connection.Length) - 1);
begin
Net.Buffered.Read (Sock, Data (Data'First .. Limit), Last);
Connection.Length := Connection.Length - (Last - Data'First + 1);
end Read_Limited;
---------------
-- Skip_Line --
---------------
procedure Skip_Line is
D : constant String := Net.Buffered.Get_Line (Sock)
with Warnings => Off;
begin
null;
end Skip_Line;
begin
case Connection.Transfer is
when End_Response =>
Last := Data'First - 1;
when Until_Close =>
begin
Net.Buffered.Read (Sock, Data, Last);
exception
when E : Net.Socket_Error =>
Debug_Exception (E);
Connection.Transfer := End_Response;
Last := Data'First - 1;
end;
when Content_Length =>
if Connection.Length = 0 then
Connection.Transfer := End_Response;
Last := Data'First - 1;
return;
end if;
Read_Limited;
when Chunked =>
if Connection.Length = 0 then
Connection.Length :=
Response.Content_Length_Type
(Utils.Hex_Value
(Strings.Fixed.Trim
(Net.Buffered.Get_Line (Sock), Strings.Both)));
if Connection.Length = 0 then
Skip_Line;
Connection.Transfer := End_Response;
Last := Data'First - 1;
return;
end if;
end if;
Read_Limited;
if Connection.Length = 0 then
Skip_Line;
end if;
when None =>
raise Constraint_Error;
end case;
end Read_Internal;
begin
if ZLib.Is_Open (Connection.Decode_Filter) then
declare
procedure Read is new ZLib.Read
(Read_Internal, Connection.Decode_Buffer.all,
Connection.Decode_First, Connection.Decode_Last,
Allow_Read_Some => True);
-- Decompress gzip or deflate encoded data
begin
Read (Connection.Decode_Filter, Data, Last);
end;
if Last < Data'First and then Connection.Transfer = Chunked then
-- When the 4 byte check sum is in the last chunk
-- external routines could think that data is over,
-- and would not call Read_Some any more. We have to
-- read the last chunk of a chunked stream.
Read_Internal (Data, Last);
if Data'First <= Last
or else Connection.Transfer /= End_Response
then
raise Protocol_Error;
end if;
end if;
else
Read_Internal (Data, Last);
end if;
end Read_Some;
----------------
-- Read_Until --
----------------
function Read_Until
(Connection : HTTP_Connection;
Delimiter : String;
Wait : Boolean := True) return String is
begin
Net.Set_Timeout (Connection.Socket.all, Connection.Timeouts.Receive);
return Translator.To_String
(Net.Buffered.Read_Until
(Connection.Socket.all,
Translator.To_Stream_Element_Array (Delimiter),
Wait));
end Read_Until;
procedure Read_Until
(Connection : in out HTTP_Connection;
Delimiter : String;
Result : in out Ada.Strings.Unbounded.Unbounded_String;
Wait : Boolean := True) is
begin
Result := Ada.Strings.Unbounded.To_Unbounded_String
(Read_Until (Connection, Delimiter, Wait));
end Read_Until;
---------------------
-- Receive_Timeout --
---------------------
function Receive_Timeout (T : Timeouts_Values) return Duration is
begin
return T.Receive;
end Receive_Timeout;
----------------------
-- Response_Timeout --
----------------------
function Response_Timeout (T : Timeouts_Values) return Duration is
begin
return Ada.Real_Time.To_Duration (T.Response);
end Response_Timeout;
------------------
-- Send_Timeout --
------------------
function Send_Timeout (T : Timeouts_Values) return Duration is
begin
return T.Send;
end Send_Timeout;
----------------
-- Set_Cookie --
----------------
procedure Set_Cookie
(Connection : in out HTTP_Connection; Cookie : String) is
begin
Connection.Cookie := To_Unbounded_String (Cookie);
end Set_Cookie;
---------------
-- Set_Debug --
---------------
procedure Set_Debug (On : Boolean) is
begin
Debug_On := On;
AWS.Headers.Debug (On);
end Set_Debug;
-----------------
-- Set_Headers --
-----------------
procedure Set_Headers
(Connection : in out HTTP_Connection; Headers : Header_List) is
begin
Connection.Headers := Headers;
end Set_Headers;
--------------------
-- Set_Persistent --
--------------------
procedure Set_Persistent
(Connection : in out HTTP_Connection; Value : Boolean) is
begin
Connection.Persistent := Value;
end Set_Persistent;
------------------------------
-- Set_Proxy_Authentication --
------------------------------
procedure Set_Proxy_Authentication
(Connection : in out HTTP_Connection;
User : String;
Pwd : String;
Mode : Authentication_Mode) is
begin
Set_Authentication
(Auth => Connection.Auth (Proxy),
User => User,
Pwd => Pwd,
Mode => Mode);
end Set_Proxy_Authentication;
--------------------------
-- Set_Streaming_Output --
--------------------------
procedure Set_Streaming_Output
(Connection : in out HTTP_Connection;
Value : Boolean) is
begin
Connection.Streaming := Value;
end Set_Streaming_Output;
----------------------------
-- Set_WWW_Authentication --
----------------------------
procedure Set_WWW_Authentication
(Connection : in out HTTP_Connection;
User : String;
Pwd : String;
Mode : Authentication_Mode) is
begin
Set_Authentication
(Auth => Connection.Auth (WWW),
User => User,
Pwd => Pwd,
Mode => Mode);
end Set_WWW_Authentication;
---------------
-- SOAP_Post --
---------------
function SOAP_Post
(URL : String;
Data : String;
SOAPAction : String;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Attachments : Attachment_List := Empty_Attachment_List;
Headers : Header_List := Empty_Header_List;
User_Agent : String := Default.User_Agent) return Response.Data
is
Connection : HTTP_Connection;
Result : Response.Data;
begin
Create (Connection,
URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
Persistent => False,
Timeouts => Timeouts,
User_Agent => User_Agent);
SOAP_Post (Connection, Result, SOAPAction,
Data => Data,
Attachments => Attachments,
Headers => Headers);
Close (Connection);
return Result;
exception
when others =>
Close (Connection);
raise;
end SOAP_Post;
procedure SOAP_Post
(Connection : HTTP_Connection;
Result : out Response.Data;
SOAPAction : String;
Data : String;
Streaming : Boolean := False;
Attachments : Attachment_List := Empty_Attachment_List;
Headers : Header_List := Empty_Header_List)
is
Save_Streaming : constant Boolean := Connection.Streaming;
begin
Connection.Self.Streaming := Streaming;
Internal_Post
(Connection => Connection.Self.all,
Result => Result,
Data => AWS.Translator.To_Stream_Element_Array (Data),
URI => No_Data,
SOAPAction => SOAPAction,
Content_Type => MIME.Text_XML,
Attachments => Attachments,
Headers => Headers);
Connection.Self.Streaming := Save_Streaming;
end SOAP_Post;
--------------------
-- SSL_Session_Id --
--------------------
function SSL_Session_Id (Connection : HTTP_Connection) return String is
begin
return Net.SSL.Session_Id_Image (Connection.SSL_Session);
end SSL_Session_Id;
--------------
-- Timeouts --
--------------
function Timeouts
(Connect : Duration := Net.Forever;
Send : Duration := Net.Forever;
Receive : Duration := Net.Forever;
Response : Duration := Net.Forever) return Timeouts_Values is
begin
return (Connect => Connect,
Send => Send,
Receive => Receive,
Response => Ada.Real_Time.To_Time_Span (Response));
end Timeouts;
function Timeouts (Each : Duration) return Timeouts_Values is
begin
return (Response => Ada.Real_Time.To_Time_Span (Each), others => Each);
end Timeouts;
------------
-- Upload --
------------
procedure Upload
(Connection : in out HTTP_Connection;
Result : out Response.Data;
Filename : String;
URI : String := No_Data;
Headers : Header_List := Empty_Header_List;
Progress : access procedure
(Total, Sent : Stream_Element_Offset) := null)
is
use Ada.Real_Time;
Stamp : constant Time := Clock;
Pref_Suf : constant String := "--";
Boundary : constant String :=
"AWS_File_Upload-" & Utils.Random_String (8);
CT : constant String :=
Messages.Content_Type (MIME.Content_Type (Filename));
CD : constant String :=
Messages.Content_Disposition
("form-data", "filename", Filename);
File_Size : constant Stream_Element_Offset :=
Stream_Element_Offset (Utils.File_Size (Filename));
Try_Count : Natural := Connection.Retry;
Auth_Attempts : Auth_Attempts_Count := (others => 2);
Auth_Is_Over : Boolean;
function Content_Length return Stream_Element_Offset;
-- Returns the total message content length
procedure Send_File;
-- Send file content to the server
--------------------
-- Content_Length --
--------------------
function Content_Length return Stream_Element_Offset is
begin
return 2 * Boundary'Length -- 2 boundaries
+ 4 -- two boundaries start with "--"
+ 2 -- second one ends with "--"
+ 10 -- 5 lines with CR+LF
+ CT'Length -- content type header
+ CD'Length -- content disposition header
+ File_Size
+ 2; -- CR+LF after file data
end Content_Length;
---------------
-- Send_File --
---------------
procedure Send_File is
Sock : Net.Socket_Type'Class renames Connection.Socket.all;
Buffer : Stream_Element_Array (1 .. 4_096);
Last : Stream_Element_Offset;
File : Stream_IO.File_Type;
Sent : Stream_Element_Offset := 0;
begin
-- Send multipart message start boundary
Net.Buffered.Put_Line (Sock, Pref_Suf & Boundary);
-- Send Content-Disposition header
Net.Buffered.Put_Line (Sock, CD);
-- Send Content-Type: header
Net.Buffered.Put_Line (Sock, CT);
Net.Buffered.New_Line (Sock);
-- Send file content
Stream_IO.Open (File, Stream_IO.In_File, Filename);
while not Stream_IO.End_Of_File (File) loop
Stream_IO.Read (File, Buffer, Last);
Net.Buffered.Write (Sock, Buffer (1 .. Last));
if Progress /= null then
Sent := Sent + Last;
Progress (File_Size, Sent);
end if;
end loop;
Stream_IO.Close (File);
Net.Buffered.New_Line (Sock);
-- Send multipart message end boundary
Net.Buffered.Put_Line (Sock, Pref_Suf & Boundary & Pref_Suf);
exception
when Net.Socket_Error =>
-- Properly close the file if needed
if Stream_IO.Is_Open (File) then
Stream_IO.Close (File);
end if;
raise;
end Send_File;
begin
Retry : loop
begin
Open_Send_Common_Header (Connection, "POST", URI, Headers);
declare
Sock : Net.Socket_Type'Class renames Connection.Socket.all;
begin
-- Send message Content-Type (Multipart/form-data)
Send_Header
(Sock,
Messages.Content_Type (MIME.Multipart_Form_Data, Boundary));
-- Send message Content-Length
Send_Header (Sock, Messages.Content_Length (Content_Length));
Net.Buffered.New_Line (Sock);
-- Send message body
Send_File;
end;
-- Get answer from server
Get_Response
(Connection, Result, Get_Body => not Connection.Streaming);
Decrement_Authentication_Attempt
(Connection, Auth_Attempts, Auth_Is_Over);
if Auth_Is_Over then
return;
elsif Connection.Streaming then
Read_Body (Connection, Result, Store => False);
end if;
exception
when E : Net.Socket_Error | Connection_Error =>
Error_Processing
(Connection, Try_Count, Result, "Upload", E, Stamp);
exit Retry when not Response.Is_Empty (Result);
end;
end loop Retry;
end Upload;
function Upload
(URL : String;
Filename : String;
User : String := No_Data;
Pwd : String := No_Data;
Proxy : String := No_Data;
Proxy_User : String := No_Data;
Proxy_Pwd : String := No_Data;
Timeouts : Timeouts_Values := No_Timeout;
Headers : Header_List := Empty_Header_List;
Progress : access procedure
(Total, Sent : Stream_Element_Offset) := null;
User_Agent : String := Default.User_Agent) return Response.Data
is
Connection : HTTP_Connection;
Result : Response.Data;
begin
Create (Connection,
URL, User, Pwd, Proxy, Proxy_User, Proxy_Pwd,
Persistent => False,
Timeouts => Timeouts,
User_Agent => User_Agent);
Upload
(Connection, Result, Filename,
Headers => Headers, Progress => Progress);
Close (Connection);
return Result;
exception
when others =>
Close (Connection);
raise;
end Upload;
end AWS.Client;
|
zhmu/ananas | Ada | 22,389 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . C H A R A C T E R S . H A N D L I N G --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, 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. --
-- --
------------------------------------------------------------------------------
-- Loop invariants in this unit are meant for analysis only, not for run-time
-- checking, as it would be too costly otherwise. This is enforced by setting
-- the assertion policy to Ignore.
pragma Assertion_Policy (Loop_Invariant => Ignore);
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Ada.Strings.Maps; use Ada.Strings.Maps;
with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants;
package body Ada.Characters.Handling
with SPARK_Mode
is
------------------------------------
-- Character Classification Table --
------------------------------------
type Character_Flags is mod 256;
for Character_Flags'Size use 8;
Control : constant Character_Flags := 1;
Lower : constant Character_Flags := 2;
Upper : constant Character_Flags := 4;
Basic : constant Character_Flags := 8;
Hex_Digit : constant Character_Flags := 16;
Digit : constant Character_Flags := 32;
Special : constant Character_Flags := 64;
Line_Term : constant Character_Flags := 128;
Letter : constant Character_Flags := Lower or Upper;
Alphanum : constant Character_Flags := Letter or Digit;
Graphic : constant Character_Flags := Alphanum or Special;
Char_Map : constant array (Character) of Character_Flags :=
[
NUL => Control,
SOH => Control,
STX => Control,
ETX => Control,
EOT => Control,
ENQ => Control,
ACK => Control,
BEL => Control,
BS => Control,
HT => Control,
LF => Control + Line_Term,
VT => Control + Line_Term,
FF => Control + Line_Term,
CR => Control + Line_Term,
SO => Control,
SI => Control,
DLE => Control,
DC1 => Control,
DC2 => Control,
DC3 => Control,
DC4 => Control,
NAK => Control,
SYN => Control,
ETB => Control,
CAN => Control,
EM => Control,
SUB => Control,
ESC => Control,
FS => Control,
GS => Control,
RS => Control,
US => Control,
Space => Special,
Exclamation => Special,
Quotation => Special,
Number_Sign => Special,
Dollar_Sign => Special,
Percent_Sign => Special,
Ampersand => Special,
Apostrophe => Special,
Left_Parenthesis => Special,
Right_Parenthesis => Special,
Asterisk => Special,
Plus_Sign => Special,
Comma => Special,
Hyphen => Special,
Full_Stop => Special,
Solidus => Special,
'0' .. '9' => Digit + Hex_Digit,
Colon => Special,
Semicolon => Special,
Less_Than_Sign => Special,
Equals_Sign => Special,
Greater_Than_Sign => Special,
Question => Special,
Commercial_At => Special,
'A' .. 'F' => Upper + Basic + Hex_Digit,
'G' .. 'Z' => Upper + Basic,
Left_Square_Bracket => Special,
Reverse_Solidus => Special,
Right_Square_Bracket => Special,
Circumflex => Special,
Low_Line => Special,
Grave => Special,
'a' .. 'f' => Lower + Basic + Hex_Digit,
'g' .. 'z' => Lower + Basic,
Left_Curly_Bracket => Special,
Vertical_Line => Special,
Right_Curly_Bracket => Special,
Tilde => Special,
DEL => Control,
Reserved_128 => Control,
Reserved_129 => Control,
BPH => Control,
NBH => Control,
Reserved_132 => Control,
NEL => Control + Line_Term,
SSA => Control,
ESA => Control,
HTS => Control,
HTJ => Control,
VTS => Control,
PLD => Control,
PLU => Control,
RI => Control,
SS2 => Control,
SS3 => Control,
DCS => Control,
PU1 => Control,
PU2 => Control,
STS => Control,
CCH => Control,
MW => Control,
SPA => Control,
EPA => Control,
SOS => Control,
Reserved_153 => Control,
SCI => Control,
CSI => Control,
ST => Control,
OSC => Control,
PM => Control,
APC => Control,
No_Break_Space => Special,
Inverted_Exclamation => Special,
Cent_Sign => Special,
Pound_Sign => Special,
Currency_Sign => Special,
Yen_Sign => Special,
Broken_Bar => Special,
Section_Sign => Special,
Diaeresis => Special,
Copyright_Sign => Special,
Feminine_Ordinal_Indicator => Special,
Left_Angle_Quotation => Special,
Not_Sign => Special,
Soft_Hyphen => Special,
Registered_Trade_Mark_Sign => Special,
Macron => Special,
Degree_Sign => Special,
Plus_Minus_Sign => Special,
Superscript_Two => Special,
Superscript_Three => Special,
Acute => Special,
Micro_Sign => Special,
Pilcrow_Sign => Special,
Middle_Dot => Special,
Cedilla => Special,
Superscript_One => Special,
Masculine_Ordinal_Indicator => Special,
Right_Angle_Quotation => Special,
Fraction_One_Quarter => Special,
Fraction_One_Half => Special,
Fraction_Three_Quarters => Special,
Inverted_Question => Special,
UC_A_Grave => Upper,
UC_A_Acute => Upper,
UC_A_Circumflex => Upper,
UC_A_Tilde => Upper,
UC_A_Diaeresis => Upper,
UC_A_Ring => Upper,
UC_AE_Diphthong => Upper + Basic,
UC_C_Cedilla => Upper,
UC_E_Grave => Upper,
UC_E_Acute => Upper,
UC_E_Circumflex => Upper,
UC_E_Diaeresis => Upper,
UC_I_Grave => Upper,
UC_I_Acute => Upper,
UC_I_Circumflex => Upper,
UC_I_Diaeresis => Upper,
UC_Icelandic_Eth => Upper + Basic,
UC_N_Tilde => Upper,
UC_O_Grave => Upper,
UC_O_Acute => Upper,
UC_O_Circumflex => Upper,
UC_O_Tilde => Upper,
UC_O_Diaeresis => Upper,
Multiplication_Sign => Special,
UC_O_Oblique_Stroke => Upper,
UC_U_Grave => Upper,
UC_U_Acute => Upper,
UC_U_Circumflex => Upper,
UC_U_Diaeresis => Upper,
UC_Y_Acute => Upper,
UC_Icelandic_Thorn => Upper + Basic,
LC_German_Sharp_S => Lower + Basic,
LC_A_Grave => Lower,
LC_A_Acute => Lower,
LC_A_Circumflex => Lower,
LC_A_Tilde => Lower,
LC_A_Diaeresis => Lower,
LC_A_Ring => Lower,
LC_AE_Diphthong => Lower + Basic,
LC_C_Cedilla => Lower,
LC_E_Grave => Lower,
LC_E_Acute => Lower,
LC_E_Circumflex => Lower,
LC_E_Diaeresis => Lower,
LC_I_Grave => Lower,
LC_I_Acute => Lower,
LC_I_Circumflex => Lower,
LC_I_Diaeresis => Lower,
LC_Icelandic_Eth => Lower + Basic,
LC_N_Tilde => Lower,
LC_O_Grave => Lower,
LC_O_Acute => Lower,
LC_O_Circumflex => Lower,
LC_O_Tilde => Lower,
LC_O_Diaeresis => Lower,
Division_Sign => Special,
LC_O_Oblique_Stroke => Lower,
LC_U_Grave => Lower,
LC_U_Acute => Lower,
LC_U_Circumflex => Lower,
LC_U_Diaeresis => Lower,
LC_Y_Acute => Lower,
LC_Icelandic_Thorn => Lower + Basic,
LC_Y_Diaeresis => Lower
];
---------------------
-- Is_Alphanumeric --
---------------------
function Is_Alphanumeric (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Alphanum) /= 0;
end Is_Alphanumeric;
--------------
-- Is_Basic --
--------------
function Is_Basic (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Basic) /= 0;
end Is_Basic;
------------------
-- Is_Character --
------------------
function Is_Character (Item : Wide_Character) return Boolean is
(Wide_Character'Pos (Item) < 256);
----------------
-- Is_Control --
----------------
function Is_Control (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Control) /= 0;
end Is_Control;
--------------
-- Is_Digit --
--------------
function Is_Digit (Item : Character) return Boolean is
begin
return Item in '0' .. '9';
end Is_Digit;
----------------
-- Is_Graphic --
----------------
function Is_Graphic (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Graphic) /= 0;
end Is_Graphic;
--------------------------
-- Is_Hexadecimal_Digit --
--------------------------
function Is_Hexadecimal_Digit (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Hex_Digit) /= 0;
end Is_Hexadecimal_Digit;
----------------
-- Is_ISO_646 --
----------------
function Is_ISO_646 (Item : Character) return Boolean is
(Item in ISO_646);
-- Note: much more efficient coding of the following function is possible
-- by testing several 16#80# bits in a complete word in a single operation
function Is_ISO_646 (Item : String) return Boolean is
begin
for J in Item'Range loop
if Item (J) not in ISO_646 then
return False;
end if;
pragma Loop_Invariant
(for all K in Item'First .. J => Is_ISO_646 (Item (K)));
end loop;
return True;
end Is_ISO_646;
---------------
-- Is_Letter --
---------------
function Is_Letter (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Letter) /= 0;
end Is_Letter;
------------------------
-- Is_Line_Terminator --
------------------------
function Is_Line_Terminator (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Line_Term) /= 0;
end Is_Line_Terminator;
--------------
-- Is_Lower --
--------------
function Is_Lower (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Lower) /= 0;
end Is_Lower;
-------------
-- Is_Mark --
-------------
function Is_Mark (Item : Character) return Boolean is
pragma Unreferenced (Item);
begin
return False;
end Is_Mark;
-------------
-- Is_NFKC --
-------------
function Is_NFKC (Item : Character) return Boolean is
begin
return Character'Pos (Item) not in
160 | 168 | 170 | 175 | 178 | 179 | 180 | 181 | 184 | 185 | 186 |
188 | 189 | 190;
end Is_NFKC;
---------------------
-- Is_Other_Format --
---------------------
function Is_Other_Format (Item : Character) return Boolean is
begin
return Item = Soft_Hyphen;
end Is_Other_Format;
------------------------------
-- Is_Punctuation_Connector --
------------------------------
function Is_Punctuation_Connector (Item : Character) return Boolean is
begin
return Item = '_';
end Is_Punctuation_Connector;
--------------
-- Is_Space --
--------------
function Is_Space (Item : Character) return Boolean is
begin
return Item = ' ' or else Item = No_Break_Space;
end Is_Space;
----------------
-- Is_Special --
----------------
function Is_Special (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Special) /= 0;
end Is_Special;
---------------
-- Is_String --
---------------
function Is_String (Item : Wide_String) return Boolean is
begin
for J in Item'Range loop
if Wide_Character'Pos (Item (J)) >= 256 then
return False;
end if;
pragma Loop_Invariant
(for all K in Item'First .. J => Is_Character (Item (K)));
end loop;
return True;
end Is_String;
--------------
-- Is_Upper --
--------------
function Is_Upper (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Upper) /= 0;
end Is_Upper;
--------------
-- To_Basic --
--------------
function To_Basic (Item : Character) return Character is
(Value (Basic_Map, Item));
function To_Basic (Item : String) return String is
begin
return Result : String (1 .. Item'Length) with Relaxed_Initialization do
for J in Item'Range loop
Result (J - (Item'First - 1)) := Value (Basic_Map, Item (J));
pragma Loop_Invariant
(Result (1 .. J - Item'First + 1)'Initialized);
pragma Loop_Invariant
(for all K in Item'First .. J =>
Result (K - (Item'First - 1)) = To_Basic (Item (K)));
end loop;
end return;
end To_Basic;
------------------
-- To_Character --
------------------
function To_Character
(Item : Wide_Character;
Substitute : Character := ' ') return Character
is
begin
if Is_Character (Item) then
return Character'Val (Wide_Character'Pos (Item));
else
return Substitute;
end if;
end To_Character;
----------------
-- To_ISO_646 --
----------------
function To_ISO_646
(Item : Character;
Substitute : ISO_646 := ' ') return ISO_646
is (if Item in ISO_646 then Item else Substitute);
function To_ISO_646
(Item : String;
Substitute : ISO_646 := ' ') return String
is
begin
return Result : String (1 .. Item'Length) with Relaxed_Initialization do
for J in Item'Range loop
Result (J - (Item'First - 1)) :=
(if Item (J) in ISO_646 then Item (J) else Substitute);
pragma Loop_Invariant
(Result (1 .. J - Item'First + 1)'Initialized);
pragma Loop_Invariant
(for all K in Item'First .. J =>
Result (K - (Item'First - 1)) =
To_ISO_646 (Item (K), Substitute));
end loop;
end return;
end To_ISO_646;
--------------
-- To_Lower --
--------------
function To_Lower (Item : Character) return Character is
(Value (Lower_Case_Map, Item));
function To_Lower (Item : String) return String is
begin
return Result : String (1 .. Item'Length) with Relaxed_Initialization do
for J in Item'Range loop
Result (J - (Item'First - 1)) := Value (Lower_Case_Map, Item (J));
pragma Loop_Invariant
(Result (1 .. J - Item'First + 1)'Initialized);
pragma Loop_Invariant
(for all K in Item'First .. J =>
Result (K - (Item'First - 1)) = To_Lower (Item (K)));
end loop;
end return;
end To_Lower;
---------------
-- To_String --
---------------
function To_String
(Item : Wide_String;
Substitute : Character := ' ') return String
is
begin
return Result : String (1 .. Item'Length) with Relaxed_Initialization do
for J in Item'Range loop
Result (J - (Item'First - 1)) :=
To_Character (Item (J), Substitute);
pragma Loop_Invariant
(Result (1 .. J - (Item'First - 1))'Initialized);
pragma Loop_Invariant
(for all K in Item'First .. J =>
Result (K - (Item'First - 1)) =
To_Character (Item (K), Substitute));
end loop;
end return;
end To_String;
--------------
-- To_Upper --
--------------
function To_Upper (Item : Character) return Character is
(Value (Upper_Case_Map, Item));
function To_Upper
(Item : String) return String
is
begin
return Result : String (1 .. Item'Length) with Relaxed_Initialization do
for J in Item'Range loop
Result (J - (Item'First - 1)) := Value (Upper_Case_Map, Item (J));
pragma Loop_Invariant
(Result (1 .. J - Item'First + 1)'Initialized);
pragma Loop_Invariant
(for all K in Item'First .. J =>
Result (K - (Item'First - 1)) = To_Upper (Item (K)));
end loop;
end return;
end To_Upper;
-----------------------
-- To_Wide_Character --
-----------------------
function To_Wide_Character
(Item : Character) return Wide_Character
is
begin
return Wide_Character'Val (Character'Pos (Item));
end To_Wide_Character;
--------------------
-- To_Wide_String --
--------------------
function To_Wide_String
(Item : String) return Wide_String
is
begin
return Result : Wide_String (1 .. Item'Length)
with Relaxed_Initialization
do
for J in Item'Range loop
Result (J - (Item'First - 1)) := To_Wide_Character (Item (J));
pragma Loop_Invariant
(Result (1 .. J - (Item'First - 1))'Initialized);
pragma Loop_Invariant
(for all K in Item'First .. J =>
Result (K - (Item'First - 1)) = To_Wide_Character (Item (K)));
end loop;
end return;
end To_Wide_String;
end Ada.Characters.Handling;
|
damaki/Verhoeff | Ada | 1,524 | adb | -------------------------------------------------------------------------------
-- Copyright (c) 2016 Daniel King
--
-- 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 AUnit.Reporter.Text;
with AUnit.Run;
with Verhoeff_Suite;
procedure Tests_Main
is
procedure Runner is new AUnit.Run.Test_Runner(Verhoeff_Suite.Suite);
Reporter : AUnit.Reporter.Text.Text_Reporter;
begin
Runner(Reporter);
end Tests_Main;
|
zhmu/ananas | Ada | 327 | adb | -- { dg-do compile }
-- { dg-options "-gnatwa" }
package body no_exc_prop is
protected body Simple_Barrier is
entry Wait when Signaled is
begin
Signaled := False;
end Wait;
procedure Signal is
begin
Signaled := True;
end Signal;
end Simple_Barrier;
end no_exc_prop;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 1,270 | adb | with System; use System;
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Synchronous_Task_Control; use Ada.Synchronous_Task_Control;
with Ada.Unchecked_Conversion;
with Last_Chance_Handler;
with STM32GD.Board;
with STM32GD.USART;
with Peripherals;
with Modem;
with Controller;
procedure Main is
Next_Release : Time := Clock;
Period : constant Time_Span := Milliseconds (100);
Minimum_Storage_Size : Integer := 256;
pragma Export (
Convention => C,
Entity => Minimum_Storage_Size,
External_Name => "_minimum_storage_size");
Main_Task_Storage_Size : Integer := 1024;
pragma Export (
Convention => C,
Entity => Main_Task_Storage_Size,
External_Name => "_environment_task_storage_size");
Secondary_Stack_Size : Integer := 16;
pragma Export (
Convention => C,
Entity => Secondary_Stack_Size,
External_Name => "_gnat_default_ss_size");
begin
STM32GD.Board.Init;
Peripherals.Init;
Controller.Send_Log_Message ("Ready");
while True loop
Controller.Handle_Host_Data;
Controller.Handle_RF_Data;
Controller.Periodic_Tasks;
Next_Release := Next_Release + Period;
delay until Next_Release;
end loop;
end Main;
|
mirror/ncurses | Ada | 3,937 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Float_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 1999-2003,2009 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;
package body Terminal_Interface.Curses.Text_IO.Float_IO is
package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
package FIO is new Ada.Text_IO.Float_IO (Num);
procedure Put
(Win : Window;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
Buf : String (1 .. Field'Last);
Len : Field := Fore + 1 + Aft;
begin
if Exp > 0 then
Len := Len + 1 + Exp;
end if;
FIO.Put (Buf, Item, Aft, Exp);
Aux.Put_Buf (Win, Buf, Len, False);
end Put;
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
Put (Get_Window, Item, Fore, Aft, Exp);
end Put;
end Terminal_Interface.Curses.Text_IO.Float_IO;
|
sebsgit/textproc | Ada | 1,941 | ads | with Ada.Containers.Vectors;
with Ada.Finalization;
with Tensor;
package NN2 is
pragma Elaborate_Body(NN2);
pragma Assertion_Policy (Pre => Check,
Post => Check,
Type_Invariant => Check);
type Model is tagged limited private;
type Activation is (RELU, LOGISTIC);
type Layer is tagged limited record
activator: Activation;
end record;
function Forward(lay: in out Layer; values: in Tensor.Var) return Tensor.Var;
function Input_Size(lay: in Layer) return Positive;
function Output_Size(lay: in Layer) return Positive;
type DenseLayer is new Layer with
record
weights: Tensor.Var;
biases: Tensor.Var;
-- cache for backpropagation
weighted_output: Tensor.Var;
activations: Tensor.Var;
end record;
type Layer_Access is access Layer'Class;
type Dense_Layer_Access is access all DenseLayer;
function Create(input_size: in Positive) return Model;
procedure Add_Dense_Layer(m: in out Model; neuron_count: in Positive; act: in Activation := RELU);
function Add_Dense_Layer(m: in out Model; neuron_count: in Positive; act: in Activation := RELU) return Dense_Layer_Access;
function Forward(m: in Model; values: in Tensor.Var) return Tensor.Var;
overriding
function Forward(lay: in out DenseLayer; values: in Tensor.Var) return Tensor.Var;
overriding
function Input_Size(lay: in DenseLayer) return Positive;
overriding
function Output_Size(lay: in DenseLayer) return Positive;
private
package Layer_Vec is new Ada.Containers.Vectors(Index_Type => Positive,
Element_Type => Layer_Access);
type Model is new Ada.Finalization.Limited_Controlled with record
input_size: Positive;
layers: Layer_Vec.Vector;
end record;
overriding procedure Finalize(This: in out Model);
end NN2;
|
faelys/natools | Ada | 1,469 | ads | ------------------------------------------------------------------------------
-- Copyright (c) 2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with GNAT.SHA256;
with Natools.HMAC;
package Natools.GNAT_HMAC.SHA256 is new Natools.HMAC
(Hash_Context => GNAT.SHA256.Context,
Initial_Context => GNAT.SHA256.Initial_Context,
Update => GNAT.SHA256.Update,
Digest => Natools.GNAT_HMAC.Digest,
Block_Size_In_SE => 64);
|
riccardo-bernardini/eugen | Ada | 1,193 | adb | with Ada.Text_IO; use Ada.Text_IO;
package body EU_Projects.Node_Tables is
procedure Dump (T : Node_Table) is
use Node_Maps;
begin
for Pos in T.Table.Iterate loop
Put_Line (EU_Projects.Nodes.To_String(Key (Pos)) & ":");
end loop;
end Dump;
------------
-- Insert --
------------
procedure Insert
(T : in out Node_Table;
ID : Nodes.Node_Label;
Item : Nodes.Node_Access)
is
begin
T.Table.Insert (Key => ID,
New_Item => Item);
exception
when Constraint_Error =>
raise Duplicated_Label;
end Insert;
---------------
-- Labels_Of --
---------------
function Labels_Of (T : Node_Table;
Class : Nodes.Node_Class)
return Nodes.Node_Label_Lists.Vector
is
use Node_Maps;
use type Nodes.Node_Class;
Result : Nodes.Node_Label_Lists.Vector;
begin
for Pos in T.Table.Iterate loop
if Nodes.Class (Element (Pos).all) = Class then
Result.Append (Key (Pos));
end if;
end loop;
return Result;
end Labels_Of;
end EU_Projects.Node_Tables;
|
tum-ei-rcs/StratoX | Ada | 5,000 | adb | with Simulation;
with Ada.Text_IO; use Ada.Text_IO;
package body MPU6000.Driver with SPARK_Mode,
Refined_State => (State => (Is_Init))
is
procedure Init is null;
-- Test if the MPU6000 is initialized and connected.
function Test return Boolean is (True);
-- Test if we are connected to MPU6000 via I2C.
procedure Test_Connection (success : out Boolean) is null;
-- MPU6000 self test.
procedure Self_Test (Test_Status : out Boolean) is null;
procedure Self_Test_Extended (Test_Status : out Boolean) is null;
-- Reset the MPU6000 device.
-- A small delay of ~50ms may be desirable after triggering a reset.
procedure Reset is null;
-- Get raw 6-axis motion sensor readings (accel/gyro).
-- Retrieves all currently available motion sensor values.
procedure Get_Motion_6
(Acc_X : out Integer_16;
Acc_Y : out Integer_16;
Acc_Z : out Integer_16;
Gyro_X : out Integer_16;
Gyro_Y : out Integer_16;
Gyro_Z : out Integer_16) is
SCALE_ACC : constant := (2.0**15-1.0)/(8.0 * 9.819); -- Acc: map -8g...+8g => -2^15-1 .. 2^15
SCALE_GYR : constant := (1.0/3.1416*180.0)/2000.0 * (2.0**15-1.0); -- Gyr: map +/- 35 rad/s => -2^15-1 .. 2^15
begin
Acc_X := Integer_16 (Simulation.CSV_here.Get_Column ("accY") * (-SCALE_ACC));
Acc_Y := Integer_16 (Simulation.CSV_here.Get_Column ("accX") * SCALE_ACC);
Acc_Z := Integer_16 (Simulation.CSV_here.Get_Column ("accZ") * SCALE_ACC);
Gyro_X := Integer_16 (Simulation.CSV_here.Get_Column ("gyroY") * (-SCALE_GYR));
Gyro_Y := Integer_16 (Simulation.CSV_here.Get_Column ("gyroX") * SCALE_GYR);
Gyro_Z := Integer_16 (Simulation.CSV_here.Get_Column ("gyroZ") * SCALE_GYR);
-- Gyro_Y = 17.9
end Get_Motion_6;
-- Set clock source setting.
-- 3 bits allowed to choose the source. The different
-- clock sources are enumerated in the MPU6000 register map.
procedure Set_Clock_Source (Clock_Source : MPU6000_Clock_Source) is null;
-- Set digital low-pass filter configuration.
procedure Set_DLPF_Mode (DLPF_Mode : MPU6000_DLPF_Bandwidth_Mode) is null;
-- Set full-scale gyroscope range.
procedure Set_Full_Scale_Gyro_Range
(FS_Range : MPU6000_FS_Gyro_Range) is null;
-- Set full-scale acceler range.
procedure Set_Full_Scale_Accel_Range
(FS_Range : MPU6000_FS_Accel_Range) is null;
-- Set I2C bypass enabled status.
-- When this bit is equal to 1 and I2C_MST_EN (Register 106 bit[5]) is
-- equal to 0, the host application processor
-- will be able to directly access the
-- auxiliary I2C bus of the MPU-60X0. When this bit is equal to 0,
-- the host application processor will not be able to directly
-- access the auxiliary I2C bus of the MPU-60X0 regardless of the state
-- of I2C_MST_EN (Register 106 bit[5]).
procedure Set_I2C_Bypass_Enabled (Value : Boolean) is null;
-- Set interrupts enabled status.
procedure Set_Int_Enabled (Value : Boolean) is null;
-- Set gyroscope sample rate divider
procedure Set_Rate (Rate_Div : HIL.Byte) is null;
-- Set sleep mode status.
procedure Set_Sleep_Enabled (Value : Boolean) is null;
-- Set temperature sensor enabled status.
procedure Set_Temp_Sensor_Enabled (Value : Boolean) is null;
-- Get temperature sensor enabled status.
procedure Get_Temp_Sensor_Enabled (ret : out Boolean) is null;
function Evaluate_Self_Test
(Low : Float;
High : Float;
Value : Float;
Debug_String : String) return Boolean is (True);
-- Read data to the specified MPU6000 register
procedure Read_Register
(Reg_Addr : Byte;
Data : in out Data_Type) is null;
-- Read one byte at the specified MPU6000 register
procedure Read_Byte_At_Register
(Reg_Addr : Byte;
Data : in out Byte) is null;
-- Read one but at the specified MPU6000 register
procedure Read_Bit_At_Register
(Reg_Addr : Byte;
Bit_Pos : Unsigned_8_Bit_Index;
Bit_Value : out Boolean) is null;
-- Write data to the specified MPU6000 register
procedure Write_Register
(Reg_Addr : Byte;
Data : Data_Type) is null;
-- Write one byte at the specified MPU6000 register
procedure Write_Byte_At_Register
(Reg_Addr : Byte;
Data : Byte) is null;
-- Write one bit at the specified MPU6000 register
procedure Write_Bit_At_Register
(Reg_Addr : Byte;
Bit_Pos : Unsigned_8_Bit_Index;
Bit_Value : Boolean) is null;
-- Write data in the specified register, starting from the
-- bit specified in Start_Bit_Pos
procedure Write_Bits_At_Register
(Reg_Addr : Byte;
Start_Bit_Pos : Unsigned_8_Bit_Index;
Data : Byte;
Length : Unsigned_8_Bit_Index) is null;
function Fuse_Low_And_High_Register_Parts
(High : Byte;
Low : Byte) return Integer_16 is (0);
end MPU6000.Driver;
|
wookey-project/ewok-legacy | Ada | 943 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - 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.
--
--
package body ewok.devices.interfaces
with spark_mode => off
is
procedure init
is begin
ewok.devices.init;
end init;
end ewok.devices.interfaces;
|
zhmu/ananas | Ada | 638 | adb | -- { dg-do run }
with Equal11_Record;
procedure Equal11 is
use Equal11_Record;
R : My_Record_Type;
L : My_Record_Type_List_Pck.List;
begin
-- Single record
R.F := 42;
R.Put;
if Put_Result /= 42 then
raise Program_Error;
end if;
-- List of records
L.Append ((F => 3));
L.Append ((F => 2));
L.Append ((F => 1));
declare
Expected : constant array (Positive range <>) of Integer :=
(3, 2, 1);
I : Positive := 1;
begin
for LR of L loop
LR.Put;
if Put_Result /= Expected (I) then
raise Program_Error;
end if;
I := I + 1;
end loop;
end;
end Equal11;
|
ohenley/COVID-19_Simulator | Ada | 243 | adb | with Qt; use Qt;
with Qt.QApplication; use Qt.QApplication;
with Qt.QWidget; use Qt.QWidget;
with CovidSimForm; use CovidSimForm;
procedure covidsim is
begin
covidsim_form_init;
QWidget_show(covidsim_form);
QApplication_invoke;
end;
|
YaoFei509/iusbdaq | Ada | 5,597 | adb | --------------------------------------------------------------------------------
-- * Prog name datalogging.adb
-- * Project name datalogging
-- *
-- * Version 1.0
-- * Last update 12/2/08
-- *
-- * Created by Kheng-Yin Beh on 12/2/08.
-- * Copyright (c) 2008 __MyCompanyName__.
-- * All rights reserved.
-- * or (keep only one line or write your own)
-- * GNAT modified GNU General Public License
-- *
--------------------------------------------------------------------------------
with Ada.Text_IO;
with Ada.Calendar;
with Interfaces.C;
with Iusbdaq;
use Ada.Text_IO, Ada.Calendar;
use Interfaces, Interfaces.C;
procedure Datalogging is
package DAQ renames Iusbdaq;
package F_IO is new Ada.Text_IO.Float_IO ( Float );
package I_IO is new Ada.Text_IO.Integer_IO ( Integer );
Device_Session : DAQ.Device_Session_Record;
Sensor_Analog_Data : DAQ.Analog_Data_Array ( 1 .. 8 );
Error, Reserved : C.Int;
Count : C.Unsigned_Long := 0;
N : Integer;
Start_Time, End_Time : Time;
Year, Month, Day,
Hour, Minute, Second : Integer;
Total_Time : Duration;
Split_Second : Duration;
Target_A1, Target_M1,
Target_A2, Target_M2,
Target_A3, Target_M3,
Target_A4, Target_M4 : File_Type;
File_Name : String ( 1 .. 2 );
Target_A1_Prefix : constant String := "-a1";
Target_A2_Prefix : constant String := "-a2";
Target_A3_Prefix : constant String := "-a3";
Target_A4_Prefix : constant String := "-a4";
Target_M1_Prefix : constant String := "-m1";
Target_M2_Prefix : constant String := "-m2";
Target_M3_Prefix : constant String := "-m3";
Target_M4_Prefix : constant String := "-m4";
Extension : constant String := ".dat";
begin
DAQ.Enumerate_Device ( Count => Count, Error => Error );
if Count > 0 then
DAQ.Open_Device ( Device_Index => 0,
Session => Device_Session,
Error => Error );
if Error = 0 then
N := 1;
delay 5.0;
Start_Time := Clock;
Split ( Date => Start_Time,
Year => Year,
Month => Month,
Day => Day,
Seconds => Split_Second );
Second := Integer ( Split_Second ) mod 60;
Minute := Integer ( Split_Second ) mod ( 60 * 60 );
Hour := Integer ( Split_Second ) / ( 60 * 60 );
File_Name := Integer'Image ( Year ) & Integer'Image ( Month ) & Integer'Image ( Day )
& Integer'Image ( Hour ) & Integer'Image ( Minute ) & Integer'Image ( Second );
Create ( File => Target_A1,
Name => File_Name & Target_A1_Prefix & Extension );
Create ( File => Target_A2,
Name => File_Name & Target_A2_Prefix & Extension );
Create ( File => Target_A3,
Name => File_Name & Target_A3_Prefix & Extension );
Create ( File => Target_A4,
Name => File_Name & Target_A4_Prefix & Extension );
Create ( File => Target_M1,
Name => File_Name & Target_M1_Prefix & Extension );
Create ( File => Target_M2,
Name => File_Name & Target_M2_Prefix & Extension );
Create ( File => Target_M3,
Name => File_Name & Target_M3_Prefix & Extension );
Create ( File => Target_M4,
Name => File_Name & Target_M4_Prefix & Extension );
loop
Sensor_Analog_Data := ( others => 0.0 );
DAQ.Read_Multi_Analog_In ( Session => Device_Session,
Start_Ch => 0,
No_Of_Ch => 8,
Voltages => Sensor_Analog_Data,
Reserved => Reserved,
Error => Error );
exit when N > 5000 or Error > 0;
Put ( File => Target_A1, Item => Float ( Sensor_Analog_Data ( 1 )), Aft => 8, Exp => 0 );
New_Line ( File => Target_A1 );
Put ( File => Target_M1, Item => Float ( Sensor_Analog_Data ( 2 )), Aft => 8, Exp => 0 );
New_Line ( File => Target_M1 );
Put ( File => Target_A2, Item => Float ( Sensor_Analog_Data ( 3 )), Aft => 8, Exp => 0 );
New_Line ( File => Target_A2 );
Put ( File => Target_M2, Item => Float ( Sensor_Analog_Data ( 4 )), Aft => 8, Exp => 0 );
New_Line ( File => Target_M2 );
Put ( File => Target_A3, Item => Float ( Sensor_Analog_Data ( 5 )), Aft => 8, Exp => 0 );
New_Line ( File => Target_A3 );
Put ( File => Target_M3, Item => Float ( Sensor_Analog_Data ( 6 )), Aft => 8, Exp => 0 );
New_Line ( File => Target_M3 );
Put ( File => Target_A4, Item => Float ( Sensor_Analog_Data ( 7 )), Aft => 8, Exp => 0 );
New_Line ( File => Target_A4 );
Put ( File => Target_M4, Item => Float ( Sensor_Analog_Data ( 8 )), Aft => 8, Exp => 0 );
New_Line ( File => Target_M4 );
F_IO.Put ( Float ( Sensor_Analog_Data ( 1 )), Aft => 8, Exp => 0 );
Put (", ");
F_IO.Put ( Float ( Sensor_Analog_Data ( 2 )), Aft => 8, Exp => 0 );
Put (", ");
F_IO.Put ( Float ( Sensor_Analog_Data ( 3 )), Aft => 8, Exp => 0 );
Put (", ");
F_IO.Put ( Float ( Sensor_Analog_Data ( 4 )), Aft => 8, Exp => 0 );
Put (", ");
F_IO.Put ( Float ( Sensor_Analog_Data ( 5 )), Aft => 8, Exp => 0 );
Put (", ");
F_IO.Put ( Float ( Sensor_Analog_Data ( 6 )), Aft => 8, Exp => 0 );
Put (", ");
F_IO.Put ( Float ( Sensor_Analog_Data ( 7 )), Aft => 8, Exp => 0 );
Put (", ");
F_IO.Put ( Float ( Sensor_Analog_Data ( 8 )), Aft => 8, Exp => 0 );
New_Line;
N := N + 1;
end loop;
Close ( Target_A1 );
Close ( Target_M1 );
Close ( Target_A2 );
Close ( Target_M2 );
Close ( Target_A3 );
Close ( Target_M3 );
Close ( Target_A4 );
Close ( Target_M4 );
else
Put ( Integer'Image ( Integer ( Error )) & ": Error opening device." );
end if;
end if;
end Datalogging;
|
mirror/ncurses | Ada | 4,229 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Termcap --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 2000-2002,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.5 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Termcap is
pragma Preelaborate (Terminal_Interface.Curses.Termcap);
-- |=====================================================================
-- | Man page curs_termcap.3x
-- |=====================================================================
-- Not implemented: tputs (see curs_terminfo)
type Termcap_String is new String;
-- |
function TGoto (Cap : String;
Col : Column_Position;
Row : Line_Position) return Termcap_String;
-- AKA: tgoto()
-- |
function Get_Entry (Name : String) return Boolean;
-- AKA: tgetent()
-- |
function Get_Flag (Name : String) return Boolean;
-- AKA: tgetflag()
-- |
procedure Get_Number (Name : String;
Value : out Integer;
Result : out Boolean);
-- AKA: tgetnum()
-- |
procedure Get_String (Name : String;
Value : out String;
Result : out Boolean);
function Get_String (Name : String) return Boolean;
-- Returns True if the string is found.
-- AKA: tgetstr()
end Terminal_Interface.Curses.Termcap;
|
docandrew/sdlada | Ada | 63,366 | adb | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- Gen_Keyboard
--------------------------------------------------------------------------------------------------------------------
-- Generates the SDL.Events.Keyboards.ads file.
-- Makefile should call this and redirect the output to the correct file in $TOP/gen_src/sdl-events-keyboards.ads.
--------------------------------------------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Characters.Latin_1;
with Utils; use Utils;
with Scancodes; use Scancodes;
procedure Gen_Keyboard is
package Latin_1 renames Ada.Characters.Latin_1;
function To_US (Str : in String) return Unbounded_String renames To_Unbounded_String;
License : constant array (Positive range <>) of Unbounded_String :=
(To_US ("Copyright (c) 2013-2020, Luke A. Guest"),
To_US (""),
To_US ("This software is provided 'as-is', without any express or implied"),
To_US ("warranty. In no event will the authors be held liable for any damages"),
To_US ("arising from the use of this software."),
To_US (""),
To_US ("Permission is granted to anyone to use this software for any purpose,"),
To_US ("including commercial applications, and to alter it and redistribute it"),
To_US ("freely, subject to the following restrictions:"),
To_US (""),
To_US (" 1. The origin of this software must not be misrepresented; you must not"),
To_US (" claim that you wrote the original software. If you use this software"),
To_US (" in a product, an acknowledgment in the product documentation would be"),
To_US (" appreciated but is not required."),
To_US (""),
To_US (" 2. Altered source versions must be plainly marked as such, and must not be"),
To_US (" misrepresented as being the original software."),
To_US (""),
To_US (" 3. This notice may not be removed or altered from any source"),
To_US (" distribution."));
Package_Description : constant array (Positive range <>) of Unbounded_String :=
(To_US ("SDL.Events.Keyboards"),
To_US (""),
To_US ("Keyboard specific events."));
type Mapping_States is (Output, New_Line, Comment);
package Scan_Codes_IO is new Integer_IO (Scan_Codes);
use Scan_Codes_IO;
type Scan_Code_Mapping is
record
State : Mapping_States := Output;
Name : Unbounded_String := Null_Unbounded_String;
Code : Scan_Codes := Scan_Codes'Last;
Comment : Unbounded_String := Null_Unbounded_String;
end record;
New_Line_Scan_Code : constant Scan_Code_Mapping := (New_Line,
Null_Unbounded_String,
Scan_Codes'Last,
Null_Unbounded_String);
type Scan_Code_Tables is array (Positive range <>) of Scan_Code_Mapping;
Scan_Code_Table : constant Scan_Code_Tables :=
((Output, To_US ("Scan_Code_Unknown"), 0, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_A"), 4, Null_Unbounded_String),
(Output, To_US ("Scan_Code_B"), 5, Null_Unbounded_String),
(Output, To_US ("Scan_Code_C"), 6, Null_Unbounded_String),
(Output, To_US ("Scan_Code_D"), 7, Null_Unbounded_String),
(Output, To_US ("Scan_Code_E"), 8, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F"), 9, Null_Unbounded_String),
(Output, To_US ("Scan_Code_G"), 10, Null_Unbounded_String),
(Output, To_US ("Scan_Code_H"), 11, Null_Unbounded_String),
(Output, To_US ("Scan_Code_I"), 12, Null_Unbounded_String),
(Output, To_US ("Scan_Code_J"), 13, Null_Unbounded_String),
(Output, To_US ("Scan_Code_K"), 14, Null_Unbounded_String),
(Output, To_US ("Scan_Code_L"), 15, Null_Unbounded_String),
(Output, To_US ("Scan_Code_M"), 16, Null_Unbounded_String),
(Output, To_US ("Scan_Code_N"), 17, Null_Unbounded_String),
(Output, To_US ("Scan_Code_O"), 18, Null_Unbounded_String),
(Output, To_US ("Scan_Code_P"), 19, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Q"), 20, Null_Unbounded_String),
(Output, To_US ("Scan_Code_R"), 21, Null_Unbounded_String),
(Output, To_US ("Scan_Code_S"), 22, Null_Unbounded_String),
(Output, To_US ("Scan_Code_T"), 23, Null_Unbounded_String),
(Output, To_US ("Scan_Code_U"), 24, Null_Unbounded_String),
(Output, To_US ("Scan_Code_V"), 25, Null_Unbounded_String),
(Output, To_US ("Scan_Code_W"), 26, Null_Unbounded_String),
(Output, To_US ("Scan_Code_X"), 27, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Y"), 28, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Z"), 29, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_1"), 30, Null_Unbounded_String),
(Output, To_US ("Scan_Code_2"), 31, Null_Unbounded_String),
(Output, To_US ("Scan_Code_3"), 32, Null_Unbounded_String),
(Output, To_US ("Scan_Code_4"), 33, Null_Unbounded_String),
(Output, To_US ("Scan_Code_5"), 34, Null_Unbounded_String),
(Output, To_US ("Scan_Code_6"), 35, Null_Unbounded_String),
(Output, To_US ("Scan_Code_7"), 36, Null_Unbounded_String),
(Output, To_US ("Scan_Code_8"), 37, Null_Unbounded_String),
(Output, To_US ("Scan_Code_9"), 38, Null_Unbounded_String),
(Output, To_US ("Scan_Code_0"), 39, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Return"), 40, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Escape"), 41, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Backspace"), 42, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Tab"), 43, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Space"), 44, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Minus"), 45, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Equals"), 46, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Left_Bracket"), 47, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Right_Bracket"), 48, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Back_Slash"), 49, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Non_US_Hash"), 50, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Semi_Colon"), 51, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Apostrophe"), 52, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Grave"), 53, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Comma"), 54, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Period"), 55, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Slash"), 56, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Caps_Lock"), 57, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_F1"), 58, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F2"), 59, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F3"), 60, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F4"), 61, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F5"), 62, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F6"), 63, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F7"), 64, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F8"), 65, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F9"), 66, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F10"), 67, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F11"), 68, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F12"), 69, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Print_Screen"), 70, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Scroll_Lock"), 71, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Pause"), 72, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Insert"), 73, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Home"), 74, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Page_Up"), 75, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Delete"), 76, Null_Unbounded_String),
(Output, To_US ("Scan_Code_End"), 77, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Page_Down"), 78, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Right"), 79, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Left"), 80, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Down"), 81, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Up"), 82, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Num_Lock_Clear"), 83, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_KP_Divide"), 84, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Multiply"), 85, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Minus"), 86, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Plus"), 87, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Enter"), 88, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_1"), 89, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_2"), 90, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_3"), 91, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_4"), 92, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_5"), 93, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_6"), 94, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_7"), 95, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_8"), 96, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_9"), 97, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_0"), 98, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Period"), 99, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Non_US_Back_Slash"), 100, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Application"), 101, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Power"), 102, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Equals"), 103, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F13"), 104, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F14"), 105, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F15"), 106, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F16"), 107, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F17"), 108, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F18"), 109, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F19"), 110, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F20"), 111, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F21"), 112, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F22"), 113, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F23"), 114, Null_Unbounded_String),
(Output, To_US ("Scan_Code_F24"), 115, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Execute"), 116, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Help"), 117, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Menu"), 118, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Select"), 119, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Stop"), 120, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Again"), 121, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Undo"), 122, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Cut"), 123, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Copy"), 124, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Paste"), 125, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Find"), 126, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Mute"), 127, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Volume_Up"), 128, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Volume_Down"), 129, Null_Unbounded_String),
(Comment, Null_Unbounded_String, Scan_Codes'Last,
To_US ("Scan_Code_Locking_Caps_Lock : constant Scan_Codes := 130;")),
(Comment, Null_Unbounded_String, Scan_Codes'Last,
To_US ("Scan_Code_Locking_Num_Lock : constant Scan_Codes := 131;")),
(Comment, Null_Unbounded_String, Scan_Codes'Last,
To_US ("Scan_Code_Locking_Scroll_Lock : constant Scan_Codes := 132;")),
(Output, To_US ("Scan_Code_KP_Comma"), 133, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Equals_AS400"), 134, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_International_1"), 135, To_US ("Used on Asian keyboards.")),
(Output, To_US ("Scan_Code_International_2"), 136, Null_Unbounded_String),
(Output, To_US ("Scan_Code_International_3"), 137, To_US ("Yen")),
(Output, To_US ("Scan_Code_International_4"), 138, Null_Unbounded_String),
(Output, To_US ("Scan_Code_International_5"), 139, Null_Unbounded_String),
(Output, To_US ("Scan_Code_International_6"), 140, Null_Unbounded_String),
(Output, To_US ("Scan_Code_International_7"), 141, Null_Unbounded_String),
(Output, To_US ("Scan_Code_International_8"), 142, Null_Unbounded_String),
(Output, To_US ("Scan_Code_International_9"), 143, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Language_1"), 144, To_US ("Hangul/En")),
(Output, To_US ("Scan_Code_Language_2"), 145, To_US ("Hanja con")),
(Output, To_US ("Scan_Code_Language_3"), 146, To_US ("Katakana.")),
(Output, To_US ("Scan_Code_Language_4"), 147, To_US ("Hiragana.")),
(Output, To_US ("Scan_Code_Language_5"), 148, To_US ("Zenkaku/H")),
(Output, To_US ("Scan_Code_Language_6"), 149, To_US ("Reserved.")),
(Output, To_US ("Scan_Code_Language_7"), 150, To_US ("Reserved.")),
(Output, To_US ("Scan_Code_Language_8"), 151, To_US ("Reserved.")),
(Output, To_US ("Scan_Code_Language_9"), 152, To_US ("Reserved.")),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Alt_Erase"), 153, To_US ("Erase-ease.")),
(Output, To_US ("Scan_Code_Sys_Req"), 154, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Cancel"), 155, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Clear"), 156, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Prior"), 157, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Return_2"), 158, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Separator"), 159, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Out"), 160, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Oper"), 161, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Clear_Again"), 162, Null_Unbounded_String),
(Output, To_US ("Scan_Code_CR_Sel"), 163, Null_Unbounded_String),
(Output, To_US ("Scan_Code_EX_Sel"), 164, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_KP_00"), 176, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_000"), 177, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Thousands_Separator"), 178, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Decimal_Separator"), 179, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Currency_Unit"), 180, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Currency_Subunit"), 181, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Left_Parenthesis"), 182, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Right_Parentheesis"), 183, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Left_Brace"), 184, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Right_Brace"), 185, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Tab"), 186, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Backspace"), 187, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_A"), 188, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_B"), 189, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_C"), 190, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_D"), 191, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_E"), 192, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_F"), 193, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_XOR"), 194, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Power"), 195, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Percent"), 196, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Less"), 197, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Greater"), 198, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Ampersand"), 199, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Double_Ampersand"), 200, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Vertical_Bar"), 201, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Double_Vertical_Bar"), 202, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Colon"), 203, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Hash"), 204, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Space"), 205, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_At"), 206, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Exclamation"), 207, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Memory_Store"), 208, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Memory_Recall"), 209, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Memory_Clear"), 210, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Memory_Add"), 211, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Memory_Subtract"), 212, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Memory_Multiply"), 213, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Memory_Divide"), 214, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Plus_Minus"), 215, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Clear"), 216, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Clear_Entry"), 217, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Binary"), 218, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Octal"), 219, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Decimal"), 220, Null_Unbounded_String),
(Output, To_US ("Scan_Code_KP_Hexadecimal"), 221, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Left_Control"), 224, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Left_Shift"), 225, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Left_Alt"), 226, To_US ("Alt, option, etc.")),
(Output, To_US ("Scan_Code_Left_GUI"), 227,
To_US ("Windows, Command (Apple), Meta, etc.")),
(Output, To_US ("Scan_Code_Right_Control"), 228, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Right_Shift"), 229, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Right_Alt"), 230,
To_US ("Alt gr, option, etc.")),
(Output, To_US ("Scan_Code_Right_GUI"), 231,
To_US ("Windows, Command (Apple), Meta, etc.")),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Mode"), 257, Null_Unbounded_String),
(New_Line_Scan_Code),
(Comment, Null_Unbounded_String, Scan_Codes'Last, To_US ("Usage page in USB document.")),
(Output, To_US ("Scan_Code_Audio_Next"), 258, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Audio_Previous"), 259, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Audio_Stop"), 260, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Audio_Play"), 261, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Audio_Mute"), 262, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Media_Select"), 263, Null_Unbounded_String),
(Output, To_US ("Scan_Code_WWW"), 264, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Mail"), 265, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Calculator"), 266, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Computer"), 267, Null_Unbounded_String),
(Output, To_US ("Scan_Code_AC_Search"), 268, Null_Unbounded_String),
(Output, To_US ("Scan_Code_AC_Home"), 269, Null_Unbounded_String),
(Output, To_US ("Scan_Code_AC_Back"), 270, Null_Unbounded_String),
(Output, To_US ("Scan_Code_AC_Forward"), 271, Null_Unbounded_String),
(Output, To_US ("Scan_Code_AC_Stop"), 272, Null_Unbounded_String),
(Output, To_US ("Scan_Code_AC_Refresh"), 273, Null_Unbounded_String),
(Output, To_US ("Scan_Code_AC_Bookmarks"), 274, Null_Unbounded_String),
(New_Line_Scan_Code),
(Comment, Null_Unbounded_String, Scan_Codes'Last, To_US ("Walther keys (for Mac?).")),
(Output, To_US ("Scan_Code_Brightness_Up"), 275, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Brightness_Down"), 276, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Display_Switch"), 277, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Illumination_Toggle"), 278, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Illumination_Down"), 279, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Illumination_Up"), 280, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Eject"), 281, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Sleep"), 282, Null_Unbounded_String),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Application_1"), 283, Null_Unbounded_String),
(Output, To_US ("Scan_Code_Application_2"), 284, Null_Unbounded_String),
(New_Line_Scan_Code),
(Comment, Null_Unbounded_String, Scan_Codes'Last, To_US ("All other scan codes go here.")),
(New_Line_Scan_Code),
(Output, To_US ("Scan_Code_Total"), 512, Null_Unbounded_String));
-- See SDL_SCANCODE_TO_KEYCODE in include/SDL_keycode.h
type Key_Codes is mod 2 ** 32 with
Convention => C,
Size => 32;
Internal_To_Key_Code_Mask : constant Key_Codes := 16#4000_0000#;
package Key_Codes_IO is new Modular_IO (Key_Codes);
use Key_Codes_IO;
function Convert is new Ada.Unchecked_Conversion (Source => Scan_Codes, Target => Key_Codes);
function To_Key_Code (Code : in Scan_Codes) return Key_Codes is
(Internal_To_Key_Code_Mask or Convert (Code));
type Key_Code_Mapping is
record
State : Mapping_States := Output;
Name : Unbounded_String := Null_Unbounded_String;
Code : Key_Codes := Key_Codes'Last;
end record;
New_Line_Code : constant Key_Code_Mapping := (New_Line, Null_Unbounded_String, Key_Codes'Last);
type Key_Code_Tables is array (Positive range <>) of Key_Code_Mapping;
Key_Code_Table : constant Key_Code_Tables :=
((Output, To_US ("Code_Return"), Character'Pos (Latin_1.CR)),
(Output, To_US ("Code_Escape"), Character'Pos (Latin_1.ESC)),
(Output, To_US ("Code_Backspace"), Character'Pos (Latin_1.BS)),
(Output, To_US ("Code_Tab"), Character'Pos (Latin_1.HT)),
(Output, To_US ("Code_Space"), Character'Pos (Latin_1.Space)),
(Output, To_US ("Code_Exclamation"), Character'Pos (Latin_1.Exclamation)),
(Output, To_US ("Code_Double_Quote"), Character'Pos (Latin_1.Quotation)),
(Output, To_US ("Code_Hash"), Character'Pos (Latin_1.Number_Sign)),
(Output, To_US ("Code_Percent"), Character'Pos (Latin_1.Percent_Sign)),
(Output, To_US ("Code_Dollar"), Character'Pos (Latin_1.Dollar_Sign)),
(Output, To_US ("Code_Ampersand"), Character'Pos (Latin_1.Ampersand)),
(Output, To_US ("Code_Quote"), Character'Pos (Latin_1.Apostrophe)),
(Output, To_US ("Code_Left_Parenthesis"), Character'Pos (Latin_1.Left_Parenthesis)),
(Output, To_US ("Code_Right_Parenthesis"), Character'Pos (Latin_1.Right_Parenthesis)),
(Output, To_US ("Code_Asterisk"), Character'Pos (Latin_1.Asterisk)),
(Output, To_US ("Code_Plus"), Character'Pos (Latin_1.Plus_Sign)),
(Output, To_US ("Code_Comma"), Character'Pos (Latin_1.Comma)),
(Output, To_US ("Code_Minus"), Character'Pos (Latin_1.Minus_Sign)),
(Output, To_US ("Code_Period"), Character'Pos (Latin_1.Full_Stop)),
(Output, To_US ("Code_Slash"), Character'Pos (Latin_1.Solidus)),
(Output, To_US ("Code_0"), Character'Pos ('0')),
(Output, To_US ("Code_1"), Character'Pos ('1')),
(Output, To_US ("Code_2"), Character'Pos ('2')),
(Output, To_US ("Code_3"), Character'Pos ('3')),
(Output, To_US ("Code_4"), Character'Pos ('4')),
(Output, To_US ("Code_5"), Character'Pos ('5')),
(Output, To_US ("Code_6"), Character'Pos ('6')),
(Output, To_US ("Code_7"), Character'Pos ('7')),
(Output, To_US ("Code_8"), Character'Pos ('8')),
(Output, To_US ("Code_9"), Character'Pos ('9')),
(Output, To_US ("Code_Colon"), Character'Pos (Latin_1.Colon)),
(Output, To_US ("Code_Semi_Colon"), Character'Pos (Latin_1.Semicolon)),
(Output, To_US ("Code_Less"), Character'Pos (Latin_1.Less_Than_Sign)),
(Output, To_US ("Code_Equals"), Character'Pos (Latin_1.Equals_Sign)),
(Output, To_US ("Code_Greater"), Character'Pos (Latin_1.Greater_Than_Sign)),
(Output, To_US ("Code_Question"), Character'Pos (Latin_1.Question)),
(Output, To_US ("Code_At"), Character'Pos (Latin_1.Commercial_At)),
(New_Line_Code),
(Comment, To_US ("Skip the uppercase letters."), Key_Codes'Last),
(New_Line_Code),
(Output, To_US ("Code_Left_Bracket"), Character'Pos (Latin_1.Left_Square_Bracket)),
(Output, To_US ("Code_Back_Slash"), Character'Pos (Latin_1.Reverse_Solidus)),
(Output, To_US ("Code_Right_Bracket"), Character'Pos (Latin_1.Right_Square_Bracket)),
(Output, To_US ("Code_Caret"), Character'Pos (Latin_1.Circumflex)),
(Output, To_US ("Code_Underscore"), Character'Pos (Latin_1.Low_Line)),
(Output, To_US ("Code_Back_Quote"), Character'Pos (Latin_1.Grave)),
(Output, To_US ("Code_A"), Character'Pos ('a')),
(Output, To_US ("Code_B"), Character'Pos ('b')),
(Output, To_US ("Code_C"), Character'Pos ('c')),
(Output, To_US ("Code_D"), Character'Pos ('d')),
(Output, To_US ("Code_E"), Character'Pos ('e')),
(Output, To_US ("Code_F"), Character'Pos ('f')),
(Output, To_US ("Code_G"), Character'Pos ('g')),
(Output, To_US ("Code_H"), Character'Pos ('h')),
(Output, To_US ("Code_I"), Character'Pos ('i')),
(Output, To_US ("Code_J"), Character'Pos ('j')),
(Output, To_US ("Code_K"), Character'Pos ('k')),
(Output, To_US ("Code_L"), Character'Pos ('l')),
(Output, To_US ("Code_M"), Character'Pos ('m')),
(Output, To_US ("Code_N"), Character'Pos ('n')),
(Output, To_US ("Code_O"), Character'Pos ('o')),
(Output, To_US ("Code_P"), Character'Pos ('p')),
(Output, To_US ("Code_Q"), Character'Pos ('q')),
(Output, To_US ("Code_R"), Character'Pos ('r')),
(Output, To_US ("Code_S"), Character'Pos ('s')),
(Output, To_US ("Code_T"), Character'Pos ('t')),
(Output, To_US ("Code_U"), Character'Pos ('u')),
(Output, To_US ("Code_V"), Character'Pos ('v')),
(Output, To_US ("Code_W"), Character'Pos ('w')),
(Output, To_US ("Code_X"), Character'Pos ('x')),
(Output, To_US ("Code_Y"), Character'Pos ('y')),
(Output, To_US ("Code_Z"), Character'Pos ('z')),
(New_Line_Code),
(Output, To_US ("Code_Caps_Lock"), To_Key_Code (Scan_Code_Caps_Lock)),
(Output, To_US ("Code_F1"), To_Key_Code (Scan_Code_F1)),
(Output, To_US ("Code_F2"), To_Key_Code (Scan_Code_F2)),
(Output, To_US ("Code_F3"), To_Key_Code (Scan_Code_F3)),
(Output, To_US ("Code_F4"), To_Key_Code (Scan_Code_F4)),
(Output, To_US ("Code_F5"), To_Key_Code (Scan_Code_F5)),
(Output, To_US ("Code_F6"), To_Key_Code (Scan_Code_F6)),
(Output, To_US ("Code_F7"), To_Key_Code (Scan_Code_F7)),
(Output, To_US ("Code_F8"), To_Key_Code (Scan_Code_F8)),
(Output, To_US ("Code_F9"), To_Key_Code (Scan_Code_F9)),
(Output, To_US ("Code_F10"), To_Key_Code (Scan_Code_F10)),
(Output, To_US ("Code_F11"), To_Key_Code (Scan_Code_F11)),
(Output, To_US ("Code_F12"), To_Key_Code (Scan_Code_F12)),
(New_Line_Code),
(Output, To_US ("Code_Print_Screen"), To_Key_Code (Scan_Code_Print_Screen)),
(Output, To_US ("Code_Scroll_Lock"), To_Key_Code (Scan_Code_Scroll_Lock)),
(Output, To_US ("Code_Pause"), To_Key_Code (Scan_Code_Pause)),
(Output, To_US ("Code_Insert"), To_Key_Code (Scan_Code_Insert)),
(Output, To_US ("Code_Home"), To_Key_Code (Scan_Code_Home)),
(Output, To_US ("Code_Page_Up"), To_Key_Code (Scan_Code_Page_Up)),
(Output, To_US ("Code_Delete"), Character'Pos (Latin_1.DEL)),
(Output, To_US ("Code_End"), To_Key_Code (Scan_Code_End)),
(Output, To_US ("Code_Page_Down"), To_Key_Code (Scan_Code_Page_Down)),
(Output, To_US ("Code_Right"), To_Key_Code (Scan_Code_Right)),
(Output, To_US ("Code_Left"), To_Key_Code (Scan_Code_Left)),
(Output, To_US ("Code_Down"), To_Key_Code (Scan_Code_Down)),
(Output, To_US ("Code_Up"), To_Key_Code (Scan_Code_Up)),
(New_Line_Code),
(Output, To_US ("Code_Num_Lock_Clear"), To_Key_Code (Scan_Code_Num_Lock_Clear)),
(Output, To_US ("Code_KP_Divide"), To_Key_Code (Scan_Code_KP_Divide)),
(Output, To_US ("Code_KP_Multiply"), To_Key_Code (Scan_Code_KP_Multiply)),
(Output, To_US ("Code_KP_Minus"), To_Key_Code (Scan_Code_KP_Minus)),
(Output, To_US ("Code_KP_Plus"), To_Key_Code (Scan_Code_KP_Plus)),
(Output, To_US ("Code_KP_Enter"), To_Key_Code (Scan_Code_KP_Enter)),
(Output, To_US ("Code_KP_1"), To_Key_Code (Scan_Code_KP_1)),
(Output, To_US ("Code_KP_2"), To_Key_Code (Scan_Code_KP_2)),
(Output, To_US ("Code_KP_3"), To_Key_Code (Scan_Code_KP_3)),
(Output, To_US ("Code_KP_4"), To_Key_Code (Scan_Code_KP_4)),
(Output, To_US ("Code_KP_5"), To_Key_Code (Scan_Code_KP_5)),
(Output, To_US ("Code_KP_6"), To_Key_Code (Scan_Code_KP_6)),
(Output, To_US ("Code_KP_7"), To_Key_Code (Scan_Code_KP_7)),
(Output, To_US ("Code_KP_8"), To_Key_Code (Scan_Code_KP_8)),
(Output, To_US ("Code_KP_9"), To_Key_Code (Scan_Code_KP_9)),
(Output, To_US ("Code_KP_0"), To_Key_Code (Scan_Code_KP_0)),
(Output, To_US ("Code_KP_Period"), To_Key_Code (Scan_Code_KP_Period)),
(New_Line_Code),
(Output, To_US ("Code_Application"), To_Key_Code (Scan_Code_Application)),
(Output, To_US ("Code_Power"), To_Key_Code (Scan_Code_Power)),
(Output, To_US ("Code_KP_Equals"), To_Key_Code (Scan_Code_KP_Equals)),
(Output, To_US ("Code_F13"), To_Key_Code (Scan_Code_F13)),
(Output, To_US ("Code_F14"), To_Key_Code (Scan_Code_F14)),
(Output, To_US ("Code_F15"), To_Key_Code (Scan_Code_F15)),
(Output, To_US ("Code_F16"), To_Key_Code (Scan_Code_F16)),
(Output, To_US ("Code_F17"), To_Key_Code (Scan_Code_F17)),
(Output, To_US ("Code_F18"), To_Key_Code (Scan_Code_F18)),
(Output, To_US ("Code_F19"), To_Key_Code (Scan_Code_F19)),
(Output, To_US ("Code_F20"), To_Key_Code (Scan_Code_F20)),
(Output, To_US ("Code_F21"), To_Key_Code (Scan_Code_F21)),
(Output, To_US ("Code_F22"), To_Key_Code (Scan_Code_F22)),
(Output, To_US ("Code_F23"), To_Key_Code (Scan_Code_F23)),
(Output, To_US ("Code_F24"), To_Key_Code (Scan_Code_F24)),
(Output, To_US ("Code_Execute"), To_Key_Code (Scan_Code_Execute)),
(Output, To_US ("Code_Help"), To_Key_Code (Scan_Code_Help)),
(Output, To_US ("Code_Menu"), To_Key_Code (Scan_Code_Menu)),
(Output, To_US ("Code_Select"), To_Key_Code (Scan_Code_Select)),
(Output, To_US ("Code_Stop"), To_Key_Code (Scan_Code_Stop)),
(Output, To_US ("Code_Again"), To_Key_Code (Scan_Code_Again)),
(Output, To_US ("Code_Undo"), To_Key_Code (Scan_Code_Undo)),
(Output, To_US ("Code_Cut"), To_Key_Code (Scan_Code_Cut)),
(Output, To_US ("Code_Copy"), To_Key_Code (Scan_Code_Copy)),
(Output, To_US ("Code_Paste"), To_Key_Code (Scan_Code_Paste)),
(Output, To_US ("Code_Find"), To_Key_Code (Scan_Code_Find)),
(Output, To_US ("Code_Mute"), To_Key_Code (Scan_Code_Mute)),
(Output, To_US ("Code_Volume_Up"), To_Key_Code (Scan_Code_Volume_Up)),
(Output, To_US ("Code_Volume_Down"), To_Key_Code (Scan_Code_Volume_Down)),
(Output, To_US ("Code_KP_Comma"), To_Key_Code (Scan_Code_KP_Comma)),
(Output, To_US ("Code_KP_Equals_AS400"), To_Key_Code (Scan_Code_KP_Equals_AS400)),
(New_Line_Code),
(Output, To_US ("Code_Alt_Erase"), To_Key_Code (Scan_Code_Alt_Erase)),
(Output, To_US ("Code_Sys_Req"), To_Key_Code (Scan_Code_Sys_Req)),
(Output, To_US ("Code_Cancel"), To_Key_Code (Scan_Code_Cancel)),
(Output, To_US ("Code_Clear"), To_Key_Code (Scan_Code_Clear)),
(Output, To_US ("Code_Prior"), To_Key_Code (Scan_Code_Prior)),
(Output, To_US ("Code_Return_2"), To_Key_Code (Scan_Code_Return_2)),
(Output, To_US ("Code_Separator"), To_Key_Code (Scan_Code_Separator)),
(Output, To_US ("Code_Out"), To_Key_Code (Scan_Code_Out)),
(Output, To_US ("Code_Oper"), To_Key_Code (Scan_Code_Oper)),
(Output, To_US ("Code_Clear_Again"), To_Key_Code (Scan_Code_Clear_Again)),
(Output, To_US ("Code_CR_Sel"), To_Key_Code (Scan_Code_CR_Sel)),
(Output, To_US ("Code_Ex_Sel"), To_Key_Code (Scan_Code_EX_Sel)),
(New_Line_Code),
(Output, To_US ("Code_KP_00"), To_Key_Code (Scan_Code_KP_00)),
(Output, To_US ("Code_KP_000"), To_Key_Code (Scan_Code_KP_000)),
(Output, To_US ("Code_Thousands_Separator"), To_Key_Code (Scan_Code_Thousands_Separator)),
(Output, To_US ("Code_Decimal_Separator"), To_Key_Code (Scan_Code_Decimal_Separator)),
(Output, To_US ("Code_Currency_Unit"), To_Key_Code (Scan_Code_Currency_Unit)),
(Output, To_US ("Code_Currency_Subunit"), To_Key_Code (Scan_Code_Currency_Subunit)),
(Output, To_US ("Code_KP_Left_Parenthesis"), To_Key_Code (Scan_Code_KP_Left_Parenthesis)),
(Output, To_US ("Code_KP_Right_Parentheesis"), To_Key_Code (Scan_Code_KP_Right_Parentheesis)),
(Output, To_US ("Code_KP_Left_Brace"), To_Key_Code (Scan_Code_KP_Left_Brace)),
(Output, To_US ("Code_KP_Right_Brace"), To_Key_Code (Scan_Code_KP_Right_Brace)),
(Output, To_US ("Code_KP_Tab"), To_Key_Code (Scan_Code_KP_Tab)),
(Output, To_US ("Code_KP_Backspace"), To_Key_Code (Scan_Code_KP_Backspace)),
(Output, To_US ("Code_KP_A"), To_Key_Code (Scan_Code_KP_A)),
(Output, To_US ("Code_KP_B"), To_Key_Code (Scan_Code_KP_B)),
(Output, To_US ("Code_KP_C"), To_Key_Code (Scan_Code_KP_C)),
(Output, To_US ("Code_KP_D"), To_Key_Code (Scan_Code_KP_D)),
(Output, To_US ("Code_KP_E"), To_Key_Code (Scan_Code_KP_E)),
(Output, To_US ("Code_KP_F"), To_Key_Code (Scan_Code_KP_F)),
(Output, To_US ("Code_KP_XOR"), To_Key_Code (Scan_Code_KP_XOR)),
(Output, To_US ("Code_KP_Power"), To_Key_Code (Scan_Code_KP_Power)),
(Output, To_US ("Code_KP_Percent"), To_Key_Code (Scan_Code_KP_Percent)),
(Output, To_US ("Code_KP_Less"), To_Key_Code (Scan_Code_KP_Less)),
(Output, To_US ("Code_KP_Greater"), To_Key_Code (Scan_Code_KP_Greater)),
(Output, To_US ("Code_KP_Ampersand"), To_Key_Code (Scan_Code_KP_Ampersand)),
(Output, To_US ("Code_KP_Double_Ampersand"), To_Key_Code (Scan_Code_KP_Double_Ampersand)),
(Output, To_US ("Code_KP_Vertical_Bar"), To_Key_Code (Scan_Code_KP_Vertical_Bar)),
(Output, To_US ("Code_KP_Double_Vertical_Bar"), To_Key_Code (Scan_Code_KP_Double_Vertical_Bar)),
(Output, To_US ("Code_KP_Colon"), To_Key_Code (Scan_Code_KP_Colon)),
(Output, To_US ("Code_KP_Hash"), To_Key_Code (Scan_Code_KP_Hash)),
(Output, To_US ("Code_KP_Space"), To_Key_Code (Scan_Code_KP_Space)),
(Output, To_US ("Code_KP_At"), To_Key_Code (Scan_Code_KP_At)),
(Output, To_US ("Code_KP_Exclamation"), To_Key_Code (Scan_Code_KP_Exclamation)),
(Output, To_US ("Code_KP_Memory_Store"), To_Key_Code (Scan_Code_KP_Memory_Store)),
(Output, To_US ("Code_KP_Memory_Recall"), To_Key_Code (Scan_Code_KP_Memory_Recall)),
(Output, To_US ("Code_KP_Memory_Clear"), To_Key_Code (Scan_Code_KP_Memory_Clear)),
(Output, To_US ("Code_KP_Memory_Add"), To_Key_Code (Scan_Code_KP_Memory_Add)),
(Output, To_US ("Code_KP_Memory_Subtract"), To_Key_Code (Scan_Code_KP_Memory_Subtract)),
(Output, To_US ("Code_KP_Memory_Multiply"), To_Key_Code (Scan_Code_KP_Memory_Multiply)),
(Output, To_US ("Code_KP_Memory_Divide"), To_Key_Code (Scan_Code_KP_Memory_Divide)),
(Output, To_US ("Code_KP_Plus_Minus"), To_Key_Code (Scan_Code_KP_Plus_Minus)),
(Output, To_US ("Code_KP_Clear"), To_Key_Code (Scan_Code_KP_Clear)),
(Output, To_US ("Code_KP_Clear_Entry"), To_Key_Code (Scan_Code_KP_Clear_Entry)),
(Output, To_US ("Code_KP_Binary"), To_Key_Code (Scan_Code_KP_Binary)),
(Output, To_US ("Code_KP_Octal"), To_Key_Code (Scan_Code_KP_Octal)),
(Output, To_US ("Code_KP_Decimal"), To_Key_Code (Scan_Code_KP_Decimal)),
(Output, To_US ("Code_KP_Hexadecimal"), To_Key_Code (Scan_Code_KP_Hexadecimal)),
(New_Line_Code),
(Output, To_US ("Code_Left_Control"), To_Key_Code (Scan_Code_Left_Control)),
(Output, To_US ("Code_Left_Shift"), To_Key_Code (Scan_Code_Left_Shift)),
(Output, To_US ("Code_Left_Alt"), To_Key_Code (Scan_Code_Left_Alt)),
(Output, To_US ("Code_Left_GUI"), To_Key_Code (Scan_Code_Left_GUI)),
(Output, To_US ("Code_Right_Control"), To_Key_Code (Scan_Code_Right_Control)),
(Output, To_US ("Code_Right_Shift"), To_Key_Code (Scan_Code_Right_Shift)),
(Output, To_US ("Code_Right_Alt"), To_Key_Code (Scan_Code_Right_Alt)),
(Output, To_US ("Code_Right_GUI"), To_Key_Code (Scan_Code_Right_GUI)),
(New_Line_Code),
(Output, To_US ("Code_Mode"), To_Key_Code (Scan_Code_Mode)),
(New_Line_Code),
(Output, To_US ("Code_Audio_Next"), To_Key_Code (Scan_Code_Audio_Next)),
(Output, To_US ("Code_Audio_Previous"), To_Key_Code (Scan_Code_Audio_Previous)),
(Output, To_US ("Code_Audio_Stop"), To_Key_Code (Scan_Code_Audio_Stop)),
(Output, To_US ("Code_Audio_Play"), To_Key_Code (Scan_Code_Audio_Play)),
(Output, To_US ("Code_Audio_Mute"), To_Key_Code (Scan_Code_Audio_Mute)),
(Output, To_US ("Code_Media_Select"), To_Key_Code (Scan_Code_Media_Select)),
(Output, To_US ("Code_WWW"), To_Key_Code (Scan_Code_WWW)),
(Output, To_US ("Code_Mail"), To_Key_Code (Scan_Code_Mail)),
(Output, To_US ("Code_Calculator"), To_Key_Code (Scan_Code_Calculator)),
(Output, To_US ("Code_Computer"), To_Key_Code (Scan_Code_Computer)),
(Output, To_US ("Code_AC_Search"), To_Key_Code (Scan_Code_AC_Search)),
(Output, To_US ("Code_AC_Home"), To_Key_Code (Scan_Code_AC_Home)),
(Output, To_US ("Code_AC_Back"), To_Key_Code (Scan_Code_AC_Back)),
(Output, To_US ("Code_AC_Forward"), To_Key_Code (Scan_Code_AC_Forward)),
(Output, To_US ("Code_AC_Stop"), To_Key_Code (Scan_Code_AC_Stop)),
(Output, To_US ("Code_AC_Refresh"), To_Key_Code (Scan_Code_AC_Refresh)),
(Output, To_US ("Code_AC_Bookmarks"), To_Key_Code (Scan_Code_AC_Bookmarks)),
(New_Line_Code),
(Output, To_US ("Code_Brightness_Down"), To_Key_Code (Scan_Code_Brightness_Down)),
(Output, To_US ("Code_Brightness_Up"), To_Key_Code (Scan_Code_Brightness_Up)),
(Output, To_US ("Code_Display_Switch"), To_Key_Code (Scan_Code_Display_Switch)),
(Output, To_US ("Code_Illumination_Toggle"), To_Key_Code (Scan_Code_Illumination_Toggle)),
(Output, To_US ("Code_Illumination_Down"), To_Key_Code (Scan_Code_Illumination_Down)),
(Output, To_US ("Code_Illumination_Up"), To_Key_Code (Scan_Code_Illumination_Up)),
(Output, To_US ("Code_Eject"), To_Key_Code (Scan_Code_Eject)),
(Output, To_US ("Code_Sleep"), To_Key_Code (Scan_Code_Sleep)));
begin
Comment (Indent => 0,
Text => "Automatically generated, do not edit.");
Comment_Dash (117);
for Line of License loop
Comment (Indent => 0, Text => To_String (Line));
end loop;
Comment_Dash (117);
for Line of Package_Description loop
Comment (Indent => 0, Text => To_String (Line));
end loop;
Comment_Dash (117);
Put_Line ("package SDL.Events.Keyboards is");
Put_Line (" -- Keyboard events.");
Put_Line (" Key_Down : constant Event_Types := 16#0000_0300#;");
Put_Line (" Key_Up : constant Event_Types := Key_Down + 1;");
Put_Line (" Text_Editing : constant Event_Types := Key_Down + 2;");
Put_Line (" Text_Input : constant Event_Types := Key_Down + 3;");
New_Line;
-- Output the scan codes.
Comment_Dash (Total => 114, Indent => 3);
Put_Line (" -- Scan codes.");
Comment_Dash (Total => 114, Indent => 3);
Put_Line (" type Scan_Codes is range 0 .. 512 with");
Put_Line (" Convention => C,");
Put_Line (" Size => 32;");
New_Line;
for Code of Scan_Code_Table loop
case Code.State is
when Output =>
Output_Field (Text => To_String (Code.Name), Width => 33, Indent => 3);
Put (": constant Scan_Codes := ");
Put (Code.Code, Width => 0);
Put (Latin_1.Semicolon);
if Code.Comment /= Null_Unbounded_String then
Put (" -- " & To_String (Code.Comment));
end if;
New_Line;
when New_Line =>
New_Line;
when Comment =>
Comment (Indent => 3, Text => To_String (Code.Comment));
end case;
end loop;
New_Line;
Put_Line (" function Value (Name : in String) return SDL.Events.Keyboards.Scan_Codes with");
Put_Line (" Inline => True;");
New_Line;
Put_Line (" function Image (Scan_Code : in SDL.Events.Keyboards.Scan_Codes) return String with");
Put_Line (" Inline => True;");
New_Line;
Comment_Dash (Total => 114, Indent => 3);
Comment (Indent => 3, Text => "Key codes.");
Comment_Dash (Total => 114, Indent => 3);
Put_Line (" type Key_Codes is mod 2 ** 32 with");
Put_Line (" Convention => C,");
Put_Line (" Size => 32;");
New_Line;
for Code of Key_Code_Table loop
case Code.State is
when Output =>
Output_Field (Text => To_String (Code.Name), Width => 33, Indent => 3);
Put (": constant Key_Codes := ");
Put (Code.Code, Width => 12, Base => 16);
Put (Latin_1.Semicolon);
New_Line;
when New_Line =>
New_Line;
when Comment =>
Comment (Indent => 3, Text => To_String (Code.Name));
end case;
end loop;
New_Line;
Put_Line (" function Value (Name : in String) return SDL.Events.Keyboards.Key_Codes with");
Put_Line (" Inline => True;");
New_Line;
Put_Line (" function Image (Key_Code : in SDL.Events.Keyboards.Key_Codes) return String with");
Put_Line (" Inline => True;");
New_Line;
Put_Line (" function To_Key_Code (Scan_Code : in SDL.Events.Keyboards.Scan_Codes) return " &
"SDL.Events.Keyboards.Key_Codes with");
Put_Line (" Inline => True;");
New_Line;
Put_Line (" function To_Scan_Code (Key_Code : in SDL.Events.Keyboards.Key_Codes) return " &
"SDL.Events.Keyboards.Scan_Codes with");
Put_Line (" Inline => True;");
New_Line;
Comment_Dash (Total => 114, Indent => 3);
Comment (Indent => 3, Text => "Key modifiers.");
Comment_Dash (Total => 114, Indent => 3);
Put_Line (" type Key_Modifiers is mod 2 ** 16 with");
Put_Line (" Convention => C,");
Put_Line (" Size => 16;");
New_Line;
Put_Line (" Modifier_None : constant Key_Modifiers := 16#00_00#;");
Put_Line (" Modifier_Left_Shift : constant Key_Modifiers := 16#00_01#;");
Put_Line (" Modifier_Right_Shift : constant Key_Modifiers := 16#00_02#;");
Put_Line (" Modifier_Left_Control : constant Key_Modifiers := 16#00_40#;");
Put_Line (" Modifier_Right_Control : constant Key_Modifiers := 16#00_80#;");
Put_Line (" Modifier_Left_Alt : constant Key_Modifiers := 16#01_00#;");
Put_Line (" Modifier_Right_Alt : constant Key_Modifiers := 16#02_00#;");
Put_Line (" Modifier_Left_GUI : constant Key_Modifiers := 16#04_00#;");
Put_Line (" Modifier_Right_GUI : constant Key_Modifiers := 16#08_00#;");
Put_Line (" Modifier_Num : constant Key_Modifiers := 16#10_00#;");
Put_Line (" Modifier_Caps : constant Key_Modifiers := 16#20_00#;");
Put_Line (" Modifier_Mode : constant Key_Modifiers := 16#40_00#;");
Put_Line (" Modifier_Control : constant Key_Modifiers := Modifier_Left_Control or Modifier_Right_Control;");
Put_Line (" Modifier_Shift : constant Key_Modifiers := Modifier_Left_Shift or Modifier_Right_Shift;");
Put_Line (" Modifier_Alt : constant Key_Modifiers := Modifier_Left_Alt or Modifier_Right_Alt;");
Put_Line (" Modifier_GUI : constant Key_Modifiers := Modifier_Left_GUI or Modifier_Right_GUI;");
Put_Line (" Modifier_Reserved : constant Key_Modifiers := 16#80_00#;");
New_Line;
Put_Line (" type Key_Syms is");
Put_Line (" record");
Put_Line (" Scan_Code : Scan_Codes;");
Put_Line (" Key_Code : Key_Codes;");
Put_Line (" Modifiers : Key_Modifiers;");
Put_Line (" Unused : Interfaces.Unsigned_32;");
Put_Line (" end record with");
Put_Line (" Convention => C;");
New_Line;
Put_Line (" type Keyboard_Events is");
Put_Line (" record");
Put_Line (" Event_Type : Event_Types; -- Will be set to Key_Up/Down.");
Put_Line (" Time_Stamp : Time_Stamps;");
New_Line;
Put_Line (" ID : SDL.Video.Windows.ID;");
Put_Line (" State : Button_State;");
Put_Line (" Repeat : Interfaces.Unsigned_8;");
Put_Line (" Padding_2 : Padding_8;");
Put_Line (" Padding_3 : Padding_8;");
Put_Line (" Key_Sym : Key_Syms;");
Put_Line (" end record with");
Put_Line (" Convention => C;");
New_Line;
Comment_Dash (Total => 114, Indent => 3);
Comment (Indent => 3, Text => "Text editing events.");
Comment_Dash (Total => 114, Indent => 3);
Put_Line (" Max_UTF8_Elements : constant := 31;");
Put_Line (" Max_UTF8_Element_Storage_Bits : constant := ((Max_UTF8_Elements + 1) * 8) - 1;");
New_Line;
Put_Line (" subtype UTF8_Text_Buffers is Interfaces.C.char_array (0 .. Max_UTF8_Elements);");
New_Line;
Put_Line (" type Cursor_Positions is range -2 ** 31 .. 2 ** 31 - 1 with");
Put_Line (" Convention => C,");
Put_Line (" Size => 32;");
New_Line;
Put_Line (" type Text_Lengths is range -2 ** 31 .. 2 ** 31 - 1 with");
Put_Line (" Convention => C,");
Put_Line (" Size => 32;");
New_Line;
Put_Line (" type Text_Editing_Events is");
Put_Line (" record");
Put_Line (" Event_Type : Event_Types; -- Will be set to Text_Editing.");
Put_Line (" Time_Stamp : Time_Stamps;");
New_Line;
Put_Line (" ID : SDL.Video.Windows.ID;");
Put_Line (" Text : UTF8_Text_Buffers;");
Put_Line (" Start : Cursor_Positions; -- TODO: Find out why this needs to be a signed value!");
Put_Line (" Length : Text_Lengths; -- TODO: Again, signed, why?");
Put_Line (" end record with");
Put_Line (" Convention => C;");
New_Line;
Comment_Dash (Total => 114, Indent => 3);
Comment (Indent => 3, Text => "Text input events.");
Comment_Dash (Total => 114, Indent => 3);
Put_Line (" type Text_Input_Events is");
Put_Line (" record");
Put_Line (" Event_Type : Event_Types; -- Will be set to Text_Editing.");
Put_Line (" Time_Stamp : Time_Stamps;");
New_Line;
Put_Line (" ID : SDL.Video.Windows.ID;");
Put_Line (" Text : UTF8_Text_Buffers;");
Put_Line (" end record with");
Put_Line (" Convention => C;");
New_Line;
Put_Line ("private");
Put_Line (" for Key_Syms use");
Put_Line (" record");
Put_Line (" Scan_Code at 0 * SDL.Word range 0 .. 31;");
Put_Line (" Key_Code at 1 * SDL.Word range 0 .. 31;");
Put_Line (" Modifiers at 2 * SDL.Word range 0 .. 15;");
Put_Line (" Unused at 3 * SDL.Word range 0 .. 31;");
Put_Line (" end record;");
New_Line;
Put_Line (" for Keyboard_Events use");
Put_Line (" record");
Put_Line (" Event_Type at 0 * SDL.Word range 0 .. 31;");
Put_Line (" Time_Stamp at 1 * SDL.Word range 0 .. 31;");
New_Line;
Put_Line (" ID at 2 * SDL.Word range 0 .. 31;");
Put_Line (" State at 3 * SDL.Word range 0 .. 7;");
Put_Line (" Repeat at 3 * SDL.Word range 8 .. 15;");
Put_Line (" Padding_2 at 3 * SDL.Word range 16 .. 23;");
Put_Line (" Padding_3 at 3 * SDL.Word range 24 .. 31;");
Put_Line (" end record;");
New_Line;
Put_Line (" for Text_Editing_Events use");
Put_Line (" record");
Put_Line (" Event_Type at 0 * SDL.Word range 0 .. 31;");
Put_Line (" Time_Stamp at 1 * SDL.Word range 0 .. 31;");
New_Line;
Put_Line (" ID at 2 * SDL.Word range 0 .. 31;");
Put_Line (" Text at 3 * SDL.Word range 0 .. Max_UTF8_Element_Storage_Bits; -- 31 characters.");
Put_Line (" Start at 11 * SDL.Word range 0 .. 31;");
Put_Line (" Length at 12 * SDL.Word range 0 .. 31;");
Put_Line (" end record;");
New_Line;
Put_Line (" for Text_Input_Events use");
Put_Line (" record");
Put_Line (" Event_Type at 0 * SDL.Word range 0 .. 31;");
Put_Line (" Time_Stamp at 1 * SDL.Word range 0 .. 31;");
New_Line;
Put_Line (" ID at 2 * SDL.Word range 0 .. 31;");
Put_Line (" Text at 3 * SDL.Word range 0 .. Max_UTF8_Element_Storage_Bits; -- 31 characters.");
Put_Line (" end record;");
Put_Line ("end SDL.Events.Keyboards;");
end Gen_Keyboard;
|
sudoadminservices/bugbountyservices | Ada | 1,880 | ads | -- 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 = "Spyse"
type = "api"
function start()
setratelimit(2)
end
function check()
local c
local cfg = datasrc_config()
if cfg ~= nil then
c = cfg.credentials
end
if (c ~= nil and c.key ~= nil and c.key ~= "") 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.key == nil or c.key == "") 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={['Authorization']="Bearer " .. c.key},
})
if (err ~= nil and err ~= "") then
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['data'].items) == 0) then
return
end
for i, item in pairs(d['data'].items) do
sendnames(ctx, item.name)
end
end
function buildurl(domain)
return "https://api.spyse.com/v3/data/domain/subdomain?limit=100&domain=" .. domain
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
|
sungyeon/drake | Ada | 1,635 | adb | package body System.Interrupts is
procedure Install_Handlers (
Object : not null access Static_Interrupt_Protection;
New_Handlers : New_Handler_Array)
is
Length : constant Natural := New_Handlers'Length;
begin
for I in 0 .. Length - 1 loop
declare
New_Item : New_Handler_Item
renames New_Handlers (New_Handlers'First + I);
begin
if Ada.Interrupts.Is_Reserved (New_Item.Interrupt) then
raise Program_Error; -- CXC3002
end if;
declare
Previous_Item : Previous_Handler_Item
renames Object.Previous_Handlers (
Object.Previous_Handlers'First + I);
begin
Previous_Item.Interrupt := New_Item.Interrupt;
Interrupt_Handlers.Set_Static_Handler (
New_Item.Handler);
Ada.Interrupts.Unchecked_Exchange_Handler (
Previous_Item.Handler,
New_Item.Handler,
New_Item.Interrupt);
end;
end;
end loop;
end Install_Handlers;
overriding procedure Finalize (
Object : in out Static_Interrupt_Protection) is
begin
for I in Object.Previous_Handlers'Range loop
declare
Previous_Item : Previous_Handler_Item
renames Object.Previous_Handlers (I);
begin
Ada.Interrupts.Unchecked_Attach_Handler (
Previous_Item.Handler,
Previous_Item.Interrupt);
end;
end loop;
end Finalize;
end System.Interrupts;
|
Ingen-ear/Formica | Ada | 117 | ads | package Ant_Handler with SPARK_Mode => On
is
function Do_Something (Text : String) return String;
end Ant_Handler;
|
zhmu/ananas | Ada | 3,227 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 4 7 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, 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 = 47
package System.Pack_47 is
pragma Preelaborate;
Bits : constant := 47;
type Bits_47 is mod 2 ** Bits;
for Bits_47'Size use Bits;
-- In all subprograms below, Rev_SSO is set True if the array has the
-- non-default scalar storage order.
function Get_47
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_47 with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_47
(Arr : System.Address;
N : Natural;
E : Bits_47;
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_47;
|
ohenley/ada-util | Ada | 4,422 | adb | -----------------------------------------------------------------------
-- Util.Beans.Objects.Time -- Helper conversion for Ada Calendar Time
-- Copyright (C) 2010, 2013, 2016 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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 Interfaces.C;
with Ada.Calendar.Formatting;
with Ada.Calendar.Conversions;
package body Util.Beans.Objects.Time is
use Ada.Calendar;
Epoch : constant Ada.Calendar.Time :=
Ada.Calendar.Time_Of (Year => Year_Number'First,
Month => 1,
Day => 1,
Seconds => 12 * 3600.0);
-- ------------------------------
-- Time Type
-- ------------------------------
type Time_Type_Def is new Duration_Type_Def with null record;
-- Get the type name
function Get_Name (Type_Def : Time_Type_Def) return String;
-- Convert the value into a string.
function To_String (Type_Def : in Time_Type_Def;
Value : in Object_Value) return String;
Time_Type : aliased constant Time_Type_Def := Time_Type_Def '(null record);
-- ------------------------------
-- Get the type name
-- ------------------------------
function Get_Name (Type_Def : in Time_Type_Def) return String is
pragma Unreferenced (Type_Def);
begin
return "Time";
end Get_Name;
-- ------------------------------
-- Convert the value into a string.
-- ------------------------------
function To_String (Type_Def : in Time_Type_Def;
Value : in Object_Value) return String is
pragma Unreferenced (Type_Def);
begin
return Ada.Calendar.Formatting.Image (Epoch + Value.Time_Value);
end To_String;
-- ------------------------------
-- Create an object from the given value.
-- ------------------------------
function To_Object (Value : in Ada.Calendar.Time) return Object is
begin
return Object '(Controlled with
V => Object_Value '(Of_Type => TYPE_TIME,
Time_Value => Value - Epoch),
Type_Def => Time_Type'Access);
end To_Object;
-- ------------------------------
-- Convert the object into a time.
-- Raises Constraint_Error if the object cannot be converter to the target type.
-- ------------------------------
function To_Time (Value : in Object) return Ada.Calendar.Time is
begin
case Value.V.Of_Type is
when TYPE_TIME =>
return Value.V.Time_Value + Epoch;
when TYPE_STRING | TYPE_WIDE_STRING =>
declare
T : constant String := Value.Type_Def.To_String (Value.V);
begin
return Ada.Calendar.Formatting.Value (T);
exception
-- Last chance, try to convert a Unix time displayed as an integer.
when Constraint_Error =>
return Ada.Calendar.Conversions.To_Ada_Time (Interfaces.C.long'Value (T));
end;
when others =>
raise Constraint_Error with "Conversion to a date is not possible";
end case;
end To_Time;
-- ------------------------------
-- Force the object to be a time.
-- ------------------------------
function Cast_Time (Value : Object) return Object is
begin
case Value.V.Of_Type is
when TYPE_TIME =>
return Value;
when TYPE_STRING | TYPE_WIDE_STRING =>
return Time.To_Object (Formatting.Value (Value.Type_Def.To_String (Value.V)));
when others =>
raise Constraint_Error with "Conversion to a date is not possible";
end case;
end Cast_Time;
end Util.Beans.Objects.Time;
|
stcarrez/ada-ado | Ada | 4,046 | ads | -----------------------------------------------------------------------
-- ado-cache-discrete -- Simple cache management for discrete types
-- Copyright (C) 2017 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- 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;
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Hash;
with ADO.Sessions;
generic
type Element_Type is (<>);
package ADO.Caches.Discrete is
pragma Elaborate_Body;
-- The cache type that maintains a cache of name/value pairs.
type Cache_Type is new ADO.Caches.Cache_Type with private;
type Cache_Type_Access is access all Cache_Type'Class;
-- Expand the name into a target parameter value to be used in the SQL query.
-- The Expander can return a T_NULL when a value is not found or
-- it may also raise some exception.
overriding
function Expand (Instance : in out Cache_Type;
Name : in String) return ADO.Parameters.Parameter;
-- Find the value associated with the given name.
-- Raises the No_Value exception if no such mapping exist.
function Find (Cache : in out Cache_Type;
Name : in String) return Element_Type;
-- Insert the value associated with the given name in the cache.
-- When <tt>Override</tt> is set, override existing values otherwise raise an exception.
procedure Insert (Cache : in out Cache_Type;
Name : in String;
Value : in Element_Type;
Override : in Boolean := False);
-- Delete the value associated with the given name in the cache.
-- Raise the No_Value exception if the value is not found and <tt>Ignore</tt> is not set.
procedure Delete (Cache : in out Cache_Type;
Name : in String;
Ignore : in Boolean := False);
-- Initialize the entity cache by reading the database entity table.
procedure Initialize (Cache : in out Cache_Type;
Session : in out ADO.Sessions.Session'Class);
private
package Cache_Map is new
Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String,
Element_Type => Element_Type,
Hash => Ada.Strings.Hash,
Equivalent_Keys => "=");
protected type Cache_Controller is
-- Find the value associated with the given name.
-- Raises the No_Value exception if no such mapping exist.
function Find (Name : in String) return Element_Type;
-- Insert the value associated with the given name in the cache.
-- When <tt>Override</tt> is set, override existing values otherwise raise an exception.
procedure Insert (Name : in String;
Value : in Element_Type;
Override : in Boolean := False);
-- Delete the value associated with the given name in the cache.
-- Raise the No_Value exception if the value is not found and <tt>Ignore</tt> is not set.
procedure Delete (Name : in String;
Ignore : in Boolean := False);
private
Values : Cache_Map.Map;
end Cache_Controller;
type Cache_Type is new ADO.Caches.Cache_Type with record
Controller : Cache_Controller;
end record;
end ADO.Caches.Discrete;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.