repo_name
stringlengths
9
74
language
stringclasses
1 value
length_bytes
int64
11
9.34M
extension
stringclasses
2 values
content
stringlengths
11
9.34M
reznikmm/matreshka
Ada
5,764
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. ------------------------------------------------------------------------------ -- An interaction is a unit of behavior that focuses on the observable -- exchange of information between connectable elements. ------------------------------------------------------------------------------ limited with AMF.UML.Actions.Collections; with AMF.UML.Behaviors; limited with AMF.UML.Gates.Collections; with AMF.UML.Interaction_Fragments; limited with AMF.UML.Interaction_Fragments.Collections; limited with AMF.UML.Lifelines.Collections; limited with AMF.UML.Messages.Collections; package AMF.UML.Interactions is pragma Preelaborate; type UML_Interaction is limited interface and AMF.UML.Behaviors.UML_Behavior and AMF.UML.Interaction_Fragments.UML_Interaction_Fragment; type UML_Interaction_Access is access all UML_Interaction'Class; for UML_Interaction_Access'Storage_Size use 0; not overriding function Get_Action (Self : not null access constant UML_Interaction) return AMF.UML.Actions.Collections.Set_Of_UML_Action is abstract; -- Getter of Interaction::action. -- -- Actions owned by the Interaction. not overriding function Get_Formal_Gate (Self : not null access constant UML_Interaction) return AMF.UML.Gates.Collections.Set_Of_UML_Gate is abstract; -- Getter of Interaction::formalGate. -- -- Specifies the gates that form the message interface between this -- Interaction and any InteractionUses which reference it. not overriding function Get_Fragment (Self : not null access constant UML_Interaction) return AMF.UML.Interaction_Fragments.Collections.Ordered_Set_Of_UML_Interaction_Fragment is abstract; -- Getter of Interaction::fragment. -- -- The ordered set of fragments in the Interaction. not overriding function Get_Lifeline (Self : not null access constant UML_Interaction) return AMF.UML.Lifelines.Collections.Set_Of_UML_Lifeline is abstract; -- Getter of Interaction::lifeline. -- -- Specifies the participants in this Interaction. not overriding function Get_Message (Self : not null access constant UML_Interaction) return AMF.UML.Messages.Collections.Set_Of_UML_Message is abstract; -- Getter of Interaction::message. -- -- The Messages contained in this Interaction. end AMF.UML.Interactions;
reznikmm/matreshka
Ada
5,114
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 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$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A data type is a type whose instances are identified only by their value. -- A data type may contain attributes to support the modeling of structured -- data types. ------------------------------------------------------------------------------ with AMF.CMOF.Classifiers; limited with AMF.CMOF.Named_Elements.Collections; limited with AMF.CMOF.Operations.Collections; limited with AMF.CMOF.Properties.Collections; package AMF.CMOF.Data_Types is pragma Preelaborate; type CMOF_Data_Type is limited interface and AMF.CMOF.Classifiers.CMOF_Classifier; type CMOF_Data_Type_Access is access all CMOF_Data_Type'Class; for CMOF_Data_Type_Access'Storage_Size use 0; not overriding function Get_Owned_Attribute (Self : not null access constant CMOF_Data_Type) return AMF.CMOF.Properties.Collections.Ordered_Set_Of_CMOF_Property is abstract; -- Getter of DataType::ownedAttribute. -- -- The Attributes owned by the DataType. not overriding function Get_Owned_Operation (Self : not null access constant CMOF_Data_Type) return AMF.CMOF.Operations.Collections.Ordered_Set_Of_CMOF_Operation is abstract; -- Getter of DataType::ownedOperation. -- -- The Operations owned by the DataType. overriding function Inherit (Self : not null access constant CMOF_Data_Type; Inhs : AMF.CMOF.Named_Elements.Collections.Set_Of_CMOF_Named_Element) return AMF.CMOF.Named_Elements.Collections.Set_Of_CMOF_Named_Element is abstract; -- Operation DataType::inherit. -- -- The inherit operation is overridden to exclude redefined properties. end AMF.CMOF.Data_Types;
reznikmm/matreshka
Ada
4,712
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_Style.Text_Line_Through_Text_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Style_Text_Line_Through_Text_Attribute_Node is begin return Self : Style_Text_Line_Through_Text_Attribute_Node do Matreshka.ODF_Style.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Style_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Style_Text_Line_Through_Text_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Text_Line_Through_Text_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Style_URI, Matreshka.ODF_String_Constants.Text_Line_Through_Text_Attribute, Style_Text_Line_Through_Text_Attribute_Node'Tag); end Matreshka.ODF_Style.Text_Line_Through_Text_Attributes;
msrLi/portingSources
Ada
1,036
adb
-- Copyright 2014 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pack is Global_Command : aliased My_Command := My_Command'(menu_name => null); function New_Command return Interactive_Command_Access is begin return Global_Command'access; end New_Command; procedure Id (C : in out Interactive_Command_Access) is begin null; end Id; end Pack;
twdroeger/ada-awa
Ada
11,291
adb
----------------------------------------------------------------------- -- awa-wikis-tests -- Unit tests for wikis module -- Copyright (C) 2018, 2019 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.Test_Caller; with Util.Strings; with Servlet.Streams; with ASF.Requests.Mockup; with ASF.Responses.Mockup; with ASF.Tests; with AWA.Tests.Helpers.Users; package body AWA.Wikis.Tests is use Ada.Strings.Unbounded; use AWA.Tests; package Caller is new Util.Test_Caller (Test, "Wikis.Beans"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test AWA.Wikis.Beans.Load_List (Anonymous)", Test_Anonymous_Access'Access); Caller.Add_Test (Suite, "Test AWA.Wikis.Beans.Save", Test_Create_Wiki'Access); Caller.Add_Test (Suite, "Test AWA.Wikis.Beans.Load (missing)", Test_Missing_Page'Access); end Add_Tests; -- ------------------------------ -- Get some access on the wiki as anonymous users. -- ------------------------------ procedure Verify_Anonymous (T : in out Test; Page : in String; Title : in String) is pragma Unreferenced (Title); function Get_Link (Title : in String) return String; Wiki : constant String := To_String (T.Wiki_Ident); Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; function Get_Link (Title : in String) return String is Stream : Servlet.Streams.Print_Stream := Reply.Get_Output_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; begin Reply.Read_Content (Content); Stream.Write (Content); return AWA.Tests.Helpers.Extract_Link (To_String (Content), Title); end Get_Link; begin ASF.Tests.Do_Get (Request, Reply, "/wikis/list/" & Wiki & "/recent", "wiki-list-recent.html"); ASF.Tests.Assert_Contains (T, "List of pages", Reply, "Wiki list recent page is invalid"); ASF.Tests.Do_Get (Request, Reply, "/wikis/tags/" & Wiki, "wiki-list-tagged.html"); ASF.Tests.Assert_Contains (T, "List of pages", Reply, "Wiki tag page is invalid"); if Page'Length > 0 then ASF.Tests.Do_Get (Request, Reply, "/wikis/view/" & Wiki & "/" & Page, "wiki-page-" & Page & ".html"); ASF.Tests.Assert_Contains (T, "The wiki page content", Reply, "Wiki page " & Page & " is invalid"); declare Info : constant String := Get_Link ("Info"); History : constant String := Get_Link ("History"); begin Util.Tests.Assert_Matches (T, "/asfunit/wikis/info/[0-9]+/[0-9]+$", Info, "Invalid wiki info link in the response"); Util.Tests.Assert_Matches (T, "/asfunit/wikis/history/[0-9]+/[0-9]+$", History, "Invalid wiki history link in the response"); -- Get the information page. ASF.Tests.Do_Get (Request, Reply, Info (Info'First + 8 .. Info'Last), "wiki-info-" & Page & ".html"); ASF.Tests.Assert_Contains (T, "wiki-word-list", Reply, "Wiki info page " & Page & " is invalid"); -- Get the history page. ASF.Tests.Do_Get (Request, Reply, History (History'First + 8 .. History'Last), "wiki-history-" & Page & ".html"); ASF.Tests.Assert_Contains (T, "wiki-page-version", Reply, "Wiki history page " & Page & " is invalid"); end; end if; end Verify_Anonymous; -- ------------------------------ -- Verify that the wiki lists contain the given page. -- ------------------------------ procedure Verify_List_Contains (T : in out Test; Page : in String) is Wiki : constant String := To_String (T.Wiki_Ident); Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; begin ASF.Tests.Do_Get (Request, Reply, "/wikis/list/" & Wiki & "/recent", "wiki-list-recent.html"); ASF.Tests.Assert_Contains (T, "List of pages", Reply, "Wiki list recent page is invalid"); ASF.Tests.Assert_Contains (T, "/wikis/view/" & To_String (T.Wiki_Ident) & "/" & Page, Reply, "Wiki list recent page does not reference the page"); ASF.Tests.Do_Get (Request, Reply, "/wikis/list/" & Wiki & "/popular", "wiki-list-popular.html"); ASF.Tests.Assert_Contains (T, "List of pages", Reply, "Wiki list popular page is invalid"); ASF.Tests.Assert_Contains (T, "/wikis/view/" & To_String (T.Wiki_Ident) & "/" & Page, Reply, "Wiki list popular page does not reference the page"); ASF.Tests.Do_Get (Request, Reply, "/wikis/list/" & Wiki & "/name", "wiki-list-name.html"); ASF.Tests.Assert_Contains (T, "List of pages", Reply, "Wiki list name page is invalid"); ASF.Tests.Assert_Contains (T, "/wikis/view/" & To_String (T.Wiki_Ident) & "/" & Page, Reply, "Wiki list name page does not reference the page"); ASF.Tests.Do_Get (Request, Reply, "/wikis/list/" & Wiki & "/name/grid", "wiki-list-name-grid.html"); ASF.Tests.Assert_Contains (T, "List of pages", Reply, "Wiki list name/grid page is invalid"); ASF.Tests.Assert_Contains (T, "/wikis/view/" & To_String (T.Wiki_Ident) & "/" & Page, Reply, "Wiki list name/grid page does not reference the page"); end Verify_List_Contains; -- ------------------------------ -- Test access to the blog as anonymous user. -- ------------------------------ procedure Test_Anonymous_Access (T : in out Test) is begin T.Verify_Anonymous ("", ""); end Test_Anonymous_Access; -- ------------------------------ -- Test creation of blog by simulating web requests. -- ------------------------------ procedure Test_Create_Wiki (T : in out Test) is procedure Create_Page (Name : in String; Title : in String); Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; procedure Create_Page (Name : in String; Title : in String) is begin Request.Set_Parameter ("page-wiki-id", To_String (T.Wiki_Ident)); Request.Set_Parameter ("post", "1"); Request.Set_Parameter ("page-title", Title); Request.Set_Parameter ("text", "# Main title" & ASCII.LF & "* The wiki page content." & ASCII.LF & "* Second item." & ASCII.LF); Request.Set_Parameter ("name", Name); Request.Set_Parameter ("comment", "Created wiki page " & Name); Request.Set_Parameter ("save", "1"); Request.Set_Parameter ("page-is-public", "1"); Request.Set_Parameter ("wiki-format", "FORMAT_MARKDOWN"); ASF.Tests.Do_Post (Request, Reply, "/wikis/create.html", "create-wiki.html"); T.Page_Ident := Helpers.Extract_Redirect (Reply, "/asfunit/wikis/view/" & To_String (T.Wiki_Ident) & "/"); Util.Tests.Assert_Equals (T, Name, To_String (T.Page_Ident), "Invalid redirect after wiki page creation"); -- Remove the 'wikiPage' bean from the request so that we get a new instance -- for the next call. Request.Remove_Attribute ("wikiPage"); end Create_Page; begin AWA.Tests.Helpers.Users.Login ("[email protected]", Request); Request.Set_Parameter ("title", "The Wiki Space Title"); Request.Set_Parameter ("post", "1"); Request.Set_Parameter ("create", "1"); ASF.Tests.Do_Post (Request, Reply, "/wikis/setup.html", "setup-wiki.html"); T.Assert (Reply.Get_Status = ASF.Responses.SC_MOVED_TEMPORARILY, "Invalid response after wiki space creation"); declare Ident : constant String := Helpers.Extract_Redirect (Reply, "/asfunit/wikis/list/"); Pos : constant Natural := Util.Strings.Index (Ident, '/'); begin Util.Tests.Assert_Matches (T, "^[0-9]+/recent/grid$", Ident, "Invalid wiki space identifier in the response"); T.Wiki_Ident := To_Unbounded_String (Ident (Ident'First .. Pos - 1)); end; Create_Page ("WikiPageTestName", "Wiki page title1"); T.Verify_List_Contains (To_String (T.Page_Ident)); Create_Page ("WikiSecondPageName", "Wiki page title2"); T.Verify_List_Contains (To_String (T.Page_Ident)); Create_Page ("WikiThirdPageName", "Wiki page title3"); T.Verify_Anonymous ("WikiPageTestName", "Wiki page title1"); T.Verify_Anonymous ("WikiSecondPageName", "Wiki page title2"); T.Verify_Anonymous ("WikiThirdPageName", "Wiki page title3"); end Test_Create_Wiki; -- ------------------------------ -- Test getting a wiki page which does not exist. -- ------------------------------ procedure Test_Missing_Page (T : in out Test) is Wiki : constant String := To_String (T.Wiki_Ident); Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; begin ASF.Tests.Do_Get (Request, Reply, "/wikis/view/" & Wiki & "/MissingPage", "wiki-page-missing.html"); ASF.Tests.Assert_Matches (T, ".title.Wiki page does not exist./title.", Reply, "Wiki page 'MissingPage' is invalid", ASF.Responses.SC_NOT_FOUND); ASF.Tests.Assert_Matches (T, ".h2.MissingPage./h2.", Reply, "Wiki page 'MissingPage' header is invalid", ASF.Responses.SC_NOT_FOUND); end Test_Missing_Page; end AWA.Wikis.Tests;
reznikmm/matreshka
Ada
4,144
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Tools 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 Ada.Strings.Wide_Wide_Fixed; with Ada.Wide_Wide_Text_IO; package body WSDL.Diagnoses is ------------ -- Report -- ------------ procedure Report (File : League.Strings.Universal_String; Line : Line_Number; Column : Column_Number; Message : League.Strings.Universal_String) is begin Ada.Wide_Wide_Text_IO.Put_Line (Ada.Wide_Wide_Text_IO.Standard_Error, File.To_Wide_Wide_String & ':' & Ada.Strings.Wide_Wide_Fixed.Trim (Line_Number'Wide_Wide_Image (Line), Ada.Strings.Both) & ':' & Ada.Strings.Wide_Wide_Fixed.Trim (Column_Number'Wide_Wide_Image (Column), Ada.Strings.Both) & ": " & Message.To_Wide_Wide_String); end Report; end WSDL.Diagnoses;
reznikmm/matreshka
Ada
3,945
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.Text_Url_Attributes; package Matreshka.ODF_Text.Url_Attributes is type Text_Url_Attribute_Node is new Matreshka.ODF_Text.Abstract_Text_Attribute_Node and ODF.DOM.Text_Url_Attributes.ODF_Text_Url_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Text_Url_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Text_Url_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Text.Url_Attributes;
reznikmm/matreshka
Ada
10,983
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. ------------------------------------------------------------------------------ with AMF.CMOF.Associations; with AMF.CMOF.Classes; with AMF.CMOF.Data_Types; with AMF.Factories.UMLDI_Factories; with AMF.Links; with AMF.UMLDI.UML_Activity_Diagrams; with AMF.UMLDI.UML_Association_End_Labels; with AMF.UMLDI.UML_Association_Or_Connector_Or_Link_Shapes; with AMF.UMLDI.UML_Class_Diagrams; with AMF.UMLDI.UML_Classifier_Shapes; with AMF.UMLDI.UML_Compartmentable_Shapes; with AMF.UMLDI.UML_Compartments; with AMF.UMLDI.UML_Component_Diagrams; with AMF.UMLDI.UML_Composite_Structure_Diagrams; with AMF.UMLDI.UML_Deployment_Diagrams; with AMF.UMLDI.UML_Edges; with AMF.UMLDI.UML_Interaction_Diagrams; with AMF.UMLDI.UML_Interaction_Table_Labels; with AMF.UMLDI.UML_Keyword_Labels; with AMF.UMLDI.UML_Labels; with AMF.UMLDI.UML_Multiplicity_Labels; with AMF.UMLDI.UML_Name_Labels; with AMF.UMLDI.UML_Object_Diagrams; with AMF.UMLDI.UML_Package_Diagrams; with AMF.UMLDI.UML_Profile_Diagrams; with AMF.UMLDI.UML_Redefines_Labels; with AMF.UMLDI.UML_Shapes; with AMF.UMLDI.UML_State_Machine_Diagrams; with AMF.UMLDI.UML_State_Shapes; with AMF.UMLDI.UML_Stereotype_Property_Value_Labels; with AMF.UMLDI.UML_Styles; with AMF.UMLDI.UML_Typed_Element_Labels; with AMF.UMLDI.UML_Use_Case_Diagrams; with League.Holders; package AMF.Internals.Factories.UMLDI_Factories is type UMLDI_Factory is limited new AMF.Internals.Factories.Metamodel_Factory_Base and AMF.Factories.UMLDI_Factories.UMLDI_Factory with null record; overriding function Convert_To_String (Self : not null access UMLDI_Factory; Data_Type : not null access AMF.CMOF.Data_Types.CMOF_Data_Type'Class; Value : League.Holders.Holder) return League.Strings.Universal_String; overriding function Create (Self : not null access UMLDI_Factory; Meta_Class : not null access AMF.CMOF.Classes.CMOF_Class'Class) return not null AMF.Elements.Element_Access; overriding function Create_From_String (Self : not null access UMLDI_Factory; Data_Type : not null access AMF.CMOF.Data_Types.CMOF_Data_Type'Class; Image : League.Strings.Universal_String) return League.Holders.Holder; overriding function Create_Link (Self : not null access UMLDI_Factory; Association : not null access AMF.CMOF.Associations.CMOF_Association'Class; First_Element : not null AMF.Elements.Element_Access; Second_Element : not null AMF.Elements.Element_Access) return not null AMF.Links.Link_Access; overriding function Get_Package (Self : not null access constant UMLDI_Factory) return AMF.CMOF.Packages.Collections.Set_Of_CMOF_Package; function Constructor (Extent : AMF.Internals.AMF_Extent) return not null AMF.Factories.Factory_Access; function Get_Package return not null AMF.CMOF.Packages.CMOF_Package_Access; function Create_UML_Activity_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Activity_Diagrams.UMLDI_UML_Activity_Diagram_Access; function Create_UML_Association_End_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Association_End_Labels.UMLDI_UML_Association_End_Label_Access; function Create_UML_Association_Or_Connector_Or_Link_Shape (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Association_Or_Connector_Or_Link_Shapes.UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Access; function Create_UML_Class_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Class_Diagrams.UMLDI_UML_Class_Diagram_Access; function Create_UML_Classifier_Shape (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Classifier_Shapes.UMLDI_UML_Classifier_Shape_Access; function Create_UML_Compartment (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Compartments.UMLDI_UML_Compartment_Access; function Create_UML_Compartmentable_Shape (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Compartmentable_Shapes.UMLDI_UML_Compartmentable_Shape_Access; function Create_UML_Component_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Component_Diagrams.UMLDI_UML_Component_Diagram_Access; function Create_UML_Composite_Structure_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Composite_Structure_Diagrams.UMLDI_UML_Composite_Structure_Diagram_Access; function Create_UML_Deployment_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Deployment_Diagrams.UMLDI_UML_Deployment_Diagram_Access; function Create_UML_Edge (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Edges.UMLDI_UML_Edge_Access; function Create_UML_Interaction_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Interaction_Diagrams.UMLDI_UML_Interaction_Diagram_Access; function Create_UML_Interaction_Table_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Interaction_Table_Labels.UMLDI_UML_Interaction_Table_Label_Access; function Create_UML_Keyword_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Keyword_Labels.UMLDI_UML_Keyword_Label_Access; function Create_UML_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Labels.UMLDI_UML_Label_Access; function Create_UML_Multiplicity_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Multiplicity_Labels.UMLDI_UML_Multiplicity_Label_Access; function Create_UML_Name_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Name_Labels.UMLDI_UML_Name_Label_Access; function Create_UML_Object_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Object_Diagrams.UMLDI_UML_Object_Diagram_Access; function Create_UML_Package_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Package_Diagrams.UMLDI_UML_Package_Diagram_Access; function Create_UML_Profile_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Profile_Diagrams.UMLDI_UML_Profile_Diagram_Access; function Create_UML_Redefines_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Redefines_Labels.UMLDI_UML_Redefines_Label_Access; function Create_UML_Shape (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Shapes.UMLDI_UML_Shape_Access; function Create_UML_State_Machine_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_State_Machine_Diagrams.UMLDI_UML_State_Machine_Diagram_Access; function Create_UML_State_Shape (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_State_Shapes.UMLDI_UML_State_Shape_Access; function Create_UML_Stereotype_Property_Value_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Stereotype_Property_Value_Labels.UMLDI_UML_Stereotype_Property_Value_Label_Access; function Create_UML_Style (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access; function Create_UML_Typed_Element_Label (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Typed_Element_Labels.UMLDI_UML_Typed_Element_Label_Access; function Create_UML_Use_Case_Diagram (Self : not null access UMLDI_Factory) return AMF.UMLDI.UML_Use_Case_Diagrams.UMLDI_UML_Use_Case_Diagram_Access; end AMF.Internals.Factories.UMLDI_Factories;
faelys/natools
Ada
817
adb
-- Generated at 2014-11-09 20:46:38 +0000 by Natools.Static_Hash_Maps -- from src/natools-static_hash_maps-s_expressions-hash_maps.sx with Natools.Static_Hash_Maps.S_Expressions.Command_Pkg; with Natools.Static_Hash_Maps.S_Expressions.Command_Map; function Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test return Boolean is begin for I in Map_1_Keys'Range loop if Natools.Static_Hash_Maps.S_Expressions.Command_Pkg.Hash (Map_1_Keys (I).all) /= I then return False; end if; end loop; for I in Map_2_Keys'Range loop if Natools.Static_Hash_Maps.S_Expressions.Command_Map.Hash (Map_2_Keys (I).all) /= I then return False; end if; end loop; return True; end Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test;
stcarrez/jason
Ada
1,316
adb
----------------------------------------------------------------------- -- jason-tickets-tests -- Tests for tickets -- Copyright (C) 2016, 2019 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.Test_Caller; package body Jason.Tickets.Tests is package Caller is new Util.Test_Caller (Test, "tickets"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test jason.tickets.Foo", Test_Create'Access); end Add_Tests; procedure Test_Create (T : in out Test) is begin T.Assert (True, "Foo is ok"); end Test_Create; end Jason.Tickets.Tests;
charlie5/cBound
Ada
1,375
ads
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces.C; with xcb.xcb_arc_t; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_arc_iterator_t is -- Item -- type Item is record data : access xcb.xcb_arc_t.Item; the_rem : aliased Interfaces.C.int; index : aliased Interfaces.C.int; end record; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_arc_iterator_t.Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_arc_iterator_t.Item, Element_Array => xcb.xcb_arc_iterator_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_arc_iterator_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_arc_iterator_t.Pointer, Element_Array => xcb.xcb_arc_iterator_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_arc_iterator_t;
Lucretia/Cherry
Ada
1,634
adb
-- -- The author disclaims copyright to this source code. In place of -- a legal notice, here is a blessing: -- -- May you do good and not evil. -- May you find forgiveness for yourself and forgive others. -- May you share freely, not taking more than you give. -- with Ada.Text_IO; with DK8543.Text_IO; with Auxiliary; package body Text_Out is File_Out : Ada.Text_IO.File_Type; Line_Number : Line_Number_Index := 1; procedure Implementation_Open (File_Name : in String) is begin DK8543.Text_IO.Recreate (File_Out, Ada.Text_IO.Out_File, File_Name); end Implementation_Open; procedure Close_Out is begin Ada.Text_IO.Close (File_Out); end Close_Out; procedure Put_Int (Item : in Integer) is use Auxiliary; begin Put (Image (Item)); end Put_Int; procedure Put (Item : in String) is begin Ada.Text_IO.Put (File_Out, Item); end Put; procedure Put_Line (Item : in String) is begin Ada.Text_IO.Put_Line (File_Out, Item); Line_Number := Line_Number + 1; end Put_Line; procedure New_Line is begin Put_Line (""); end New_Line; procedure Put_Line_Directive (File_Name : in String) is begin Ada.Text_IO.Put_Line ("Write_line_directive 616 ca"); Put ("#line "); -- Put_Int (Line_Number_Index (Line_Number)); Put_Int (Integer (Line_Number)); Put (" """); -- while( *filename ){ -- if( *filename == '\\' ) putc('\\',out); -- putc(*filename,out); -- filename++; -- } Put (File_Name); Put_Line (""""); end Put_Line_Directive; end Text_Out;
pdaxrom/Kino2
Ada
3,086
ads
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Text_IO_Demo -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998 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 -- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control -- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Text_IO_Demo is procedure Demo; end Sample.Text_IO_Demo;
ficorax/PortAudioAda
Ada
2,565
adb
with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions; with Ada.Unchecked_Conversion; with Interfaces.C.Pointers; with PaTest_TooManySines_Types; use PaTest_TooManySines_Types; package body PaTest_TooManySines_Callbacks is package Float_Ptrs is new Interfaces.C.Pointers (Index => Integer, Element => Float, Element_Array => Float_Array, Default_Terminator => 0.0); use type Float_Ptrs.Pointer; subtype Float_Star is Float_Ptrs.Pointer; function Convert is new Ada.Unchecked_Conversion (System.Address, Float_Star); function Convert is new Ada.Unchecked_Conversion (System.Address, paTestData_Ptr); -------------------- -- paTestCallback -- -------------------- function paTestCallback (inputBuffer : System.Address; outputBuffer : System.Address; framesPerBuffer : Interfaces.C.unsigned_long; timeInfo : access PA_Stream_Callback_Time_Info; statusFlags : PA_Stream_Callback_Flags; userData : System.Address) return PA_Stream_Callback_Result is pragma Unreferenced (inputBuffer); pragma Unreferenced (timeInfo); pragma Unreferenced (statusFlags); oBuff : Float_Star := Convert (outputBuffer); lData : constant paTestData_Ptr := Convert (userData); begin for i in 1 .. Integer (framesPerBuffer) loop declare output : Float := 0.0; phaseInc : Long_Float := 0.02; phase : Long_Float; begin for j in 1 .. lData.all.numSines loop -- Advance phase of next oscillator. phase := lData.all.phases (j); phase := phase + phaseInc; if phase > Two_Pi then phase := phase - Two_Pi; end if; phaseInc := phaseInc * 1.02; if phaseInc > 0.5 then phaseInc := phaseInc * 0.5; end if; -- This is not a very efficient way to calc sines. output := output + Sin (Float (phase)); lData.all.phases (j) := phase; end loop; oBuff.all := output / Float (lData.all.numSines); Float_Ptrs.Increment (oBuff); end; end loop; return paContinue; end paTestCallback; end PaTest_TooManySines_Callbacks;
renekroka/Amass
Ada
930
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 = "HackerTarget" type = "api" function start() setratelimit(1) end function vertical(ctx, domain) scrape(ctx, {url=buildurl(domain)}) end function buildurl(domain) return "http://api.hackertarget.com/hostsearch/?q=" .. domain end function asn(ctx, addr) local page, err = request({url=asnurl(addr)}) if (err ~= nil and err ~= "") then return end local j = json.decode("{\"results\": [" .. page .. "]}") if (j == nil or #(j.results) < 4) then return end newasn(ctx, { ['addr']=addr, asn=tonumber(j.results[2]), prefix=j.results[3], desc=j.results[4], }) end function asnurl(addr) return "https://api.hackertarget.com/aslookup/?q=" .. addr end
reznikmm/matreshka
Ada
45
ads
package Demo is pragma Pure; end Demo;
AdaCore/libadalang
Ada
82
ads
package Pkg is procedure Foo is null; end Pkg; --% node.p_next_part_for_decl()
zhmu/ananas
Ada
3,373
adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . S T O R A G E _ P O O L S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2009-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. -- -- -- ------------------------------------------------------------------------------ package body System.Storage_Pools is ------------------ -- Allocate_Any -- ------------------ procedure Allocate_Any (Pool : in out Root_Storage_Pool'Class; Storage_Address : out System.Address; Size_In_Storage_Elements : System.Storage_Elements.Storage_Count; Alignment : System.Storage_Elements.Storage_Count) is begin Allocate (Pool, Storage_Address, Size_In_Storage_Elements, Alignment); end Allocate_Any; -------------------- -- Deallocate_Any -- -------------------- procedure Deallocate_Any (Pool : in out Root_Storage_Pool'Class; Storage_Address : System.Address; Size_In_Storage_Elements : System.Storage_Elements.Storage_Count; Alignment : System.Storage_Elements.Storage_Count) is begin Deallocate (Pool, Storage_Address, Size_In_Storage_Elements, Alignment); end Deallocate_Any; end System.Storage_Pools;
vikasbidhuri1995/DW1000
Ada
6,371
ads
------------------------------------------------------------------------------- -- 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 DW1000.Types; -- This package defines low-level procedures for interfacing with the DW1000 -- at the physical layer. -- -- The body for this package is not included in this project as it is very -- specific to the target hardware. Therefore, the body for this package -- must be implemented by the user for their target board. package DW1000.BSP with SPARK_Mode => On, Abstract_State => (Device_State with Synchronous, External), Initializes => Device_State is procedure Reset_DW1000 with Global => (Output => Device_State), Depends => (Device_State => null); -- Resets the DW1000 via the RSTn line. procedure Get_Reset_State (State : out DW1000.Types.Bits_1) with Global => (Input => Device_State), Depends => (State => Device_State); -- Read the current state of the RSTn line. -- -- The State is 0 when the RSTn line is asserted (low), and 1 when the -- RSTn line is de-asserted (high). -- -- Reading the state of the RSTn is useful when waking up from the SLEEP -- or DEEPSLEEP states, as the DW1000 asserts the RSTn line whilst it is in -- the WAKEUP state. RSTn is de-asserted once it has entered the INIT -- state. procedure Acknowledge_DW1000_IRQ with Global => (In_Out => Device_State); -- Acknowledge the IRQ request from the DW1000. -- -- This should be called from the interrupt handler of the DW1000 IRQ line -- to acknowledge the interrupt. -- --- Failure to call this procedure from the interrupt handler may result in -- an infinite interrupt loop. procedure Disable_DW1000_IRQ with Global => (In_Out => Device_State); -- Disables the DW1000 IRQ to prevent the DW1000 interrupt from being -- triggered. -- -- Any IRQs requested after calling this function should be held pending -- until Enable_DW1000_IRQ is called. procedure Enable_DW1000_IRQ with Global => (In_Out => Device_State); -- Enables the DW1000 IRQ. procedure Use_Slow_SPI_Clock with Global => (In_Out => Device_State); -- Switch the BSP to use a slow SPI clock speed (no faster than 3 MHz). -- -- The slow SPI clock speed should be used when the DW1000 is in the INIT -- state. procedure Use_Fast_SPI_Clock with Global => (In_Out => Device_State); -- Switch the BSP to use a faster SPI clock speed (no faster than 20 MHz). -- -- The fast SPI clock speed can be used when the DW1000 has left the INIT -- state. procedure Wakeup (Wait_For_INIT : in Boolean) with Global => (In_Out => Device_State); -- Perform the Wakeup sequence. -- -- This asserts the WAKEUP condition for a minimum of 500 microseconds. -- -- If Wait_For_INIT is True, then this function will then also wait for up -- to an additional 4 milliseconds for the DW1000 to enter the INIT state. -- This guarantees that the SPI interface is ready after the return of this -- procedure. -- -- This is a non-blocking function (the Ada 'delay' statement is not used). -- Instead, a busy wait is be used for the delays. procedure Write_Transaction (Header : in DW1000.Types.Byte_Array; Data : in DW1000.Types.Byte_Array) with Global => (In_Out => Device_State), Depends => (Device_State =>+ (Header, Data)), Pre => (Header'Length in 1 .. 3 and Data'Length > 0); -- Perform a "write" transaction to the DW1000. -- -- This procedure executes a write transaction by performing the following -- steps:z -- 1. Select the DW1000 on the SPI bus. -- 2. Send the transaction header bytes (1 .. 3 bytes) via the SPI -- interface. -- 3. Send the transaction data (variable length) to the DW1000 via the -- SPI interface. -- 4. Deselect the DW1000 on the SPI bus. -- -- Note: This procedure must not block. I.e. the procedure must not use -- the 'delay until' statement, nor call any protected entries. procedure Read_Transaction (Header : in DW1000.Types.Byte_Array; Data : out DW1000.Types.Byte_Array) with Global => (In_Out => Device_State), Depends => (Device_State =>+ (Header, Data), Data => (Header, Device_State)), Pre => (Header'Length in 1 .. 3 and Data'Length > 0); -- Perform a "read" transaction from the DW1000. -- -- This procedure executes a write transaction by performing the following -- steps: -- 1. Select the DW1000 on the SPI bus. -- 2. Send the transaction header bytes (1 .. 3 bytes) via the SPI -- interface. -- 3. Read the transaction data (variable length) from the DW1000 via -- the SPI interface, and write the received bytes to the 'Data' byte -- array. -- 4. Deselect the DW1000 on the SPI bus. -- -- Note: This procedure must not block. I.e. the procedure must not use -- the 'delay until' statement, nor call any protected entries. end DW1000.BSP;
AdaCore/Ada_Drivers_Library
Ada
15,240
adb
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2016, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics 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. -- -- -- -- -- -- This file is based on: -- -- -- -- @file stm32f429i_discovery_ts.c -- -- @author MCD Application Team -- -- @version V1.1.0 -- -- @date 19-June-2014 -- -- @brief This file provides a set of functions needed to manage Touch -- -- screen available with STMPE811 IO Expander device mounted on -- -- STM32F429I-Discovery Kit. -- -- -- -- COPYRIGHT(c) 2014 STMicroelectronics -- ------------------------------------------------------------------------------ package body STMPE811 is pragma Warnings (Off, "constant * is not referenced"); -- Control Registers IOE_REG_SYS_CTRL1 : constant UInt8 := 16#03#; IOE_REG_SYS_CTRL2 : constant UInt8 := 16#04#; IOE_REG_SPI_CFG : constant UInt8 := 16#08#; -- Touch Panel Registers IOE_REG_TSC_CTRL : constant UInt8 := 16#40#; IOE_REG_TSC_CFG : constant UInt8 := 16#41#; IOE_REG_WDM_TR_X : constant UInt8 := 16#42#; IOE_REG_WDM_TR_Y : constant UInt8 := 16#44#; IOE_REG_WDM_BL_X : constant UInt8 := 16#46#; IOE_REG_WDM_BL_Y : constant UInt8 := 16#48#; IOE_REG_FIFO_TH : constant UInt8 := 16#4A#; IOE_REG_FIFO_STA : constant UInt8 := 16#4B#; IOE_REG_FIFO_SIZE : constant UInt8 := 16#4C#; IOE_REG_TSC_DATA_X : constant UInt8 := 16#4D#; IOE_REG_TSC_DATA_Y : constant UInt8 := 16#4F#; IOE_REG_TSC_DATA_Z : constant UInt8 := 16#51#; IOE_REG_TSC_DATA_XYZ : constant UInt8 := 16#52#; IOE_REG_TSC_FRACT_Z : constant UInt8 := 16#56#; IOE_REG_TSC_DATA : constant UInt8 := 16#57#; IOE_REG_TSC_I_DRIVE : constant UInt8 := 16#58#; IOE_REG_TSC_SHIELD : constant UInt8 := 16#59#; -- IOE GPIO Registers IOE_REG_GPIO_SET_PIN : constant UInt8 := 16#10#; IOE_REG_GPIO_CLR_PIN : constant UInt8 := 16#11#; IOE_REG_GPIO_MP_STA : constant UInt8 := 16#12#; IOE_REG_GPIO_DIR : constant UInt8 := 16#13#; IOE_REG_GPIO_ED : constant UInt8 := 16#14#; IOE_REG_GPIO_RE : constant UInt8 := 16#15#; IOE_REG_GPIO_FE : constant UInt8 := 16#16#; IOE_REG_GPIO_AF : constant UInt8 := 16#17#; -- IOE Functions IOE_ADC_FCT : constant UInt8 := 16#01#; IOE_TSC_FCT : constant UInt8 := 16#02#; IOE_IO_FCT : constant UInt8 := 16#04#; -- ADC Registers IOE_REG_ADC_INT_EN : constant UInt8 := 16#0E#; IOE_REG_ADC_INT_STA : constant UInt8 := 16#0F#; IOE_REG_ADC_CTRL1 : constant UInt8 := 16#20#; IOE_REG_ADC_CTRL2 : constant UInt8 := 16#21#; IOE_REG_ADC_CAPT : constant UInt8 := 16#22#; IOE_REG_ADC_DATA_CH0 : constant UInt8 := 16#30#; IOE_REG_ADC_DATA_CH1 : constant UInt8 := 16#32#; IOE_REG_ADC_DATA_CH2 : constant UInt8 := 16#34#; IOE_REG_ADC_DATA_CH3 : constant UInt8 := 16#36#; IOE_REG_ADC_DATA_CH4 : constant UInt8 := 16#38#; IOE_REG_ADC_DATA_CH5 : constant UInt8 := 16#3A#; IOE_REG_ADC_DATA_CH6 : constant UInt8 := 16#3B#; IOE_REG_ADC_DATA_CH7 : constant UInt8 := 16#3C#; -- Interrupt Control Registers IOE_REG_INT_CTRL : constant UInt8 := 16#09#; IOE_REG_INT_EN : constant UInt8 := 16#0A#; IOE_REG_INT_STA : constant UInt8 := 16#0B#; IOE_REG_GPIO_INT_EN : constant UInt8 := 16#0C#; IOE_REG_GPIO_INT_STA : constant UInt8 := 16#0D#; -- touch Panel Pins TOUCH_YD : constant UInt8 := 16#02#; TOUCH_XD : constant UInt8 := 16#04#; TOUCH_YU : constant UInt8 := 16#08#; TOUCH_XU : constant UInt8 := 16#10#; TOUCH_IO_ALL : constant UInt8 := TOUCH_YD or TOUCH_XD or TOUCH_YU or TOUCH_XU; pragma Warnings (On, "constant * is not referenced"); --------------- -- Read_Data -- --------------- function Read_Data (This : in out STMPE811_Device; Data_Addr : UInt8; Length : Natural) return TSC_Data is Data : TSC_Data (1 .. Length); Status : I2C_Status; begin This.Port.Mem_Read (This.I2C_Addr, UInt16 (Data_Addr), Memory_Size_8b, Data, Status); if Status /= Ok then raise Program_Error with "Timeout while reading TC data"; end if; return Data; end Read_Data; ------------------- -- Read_Register -- ------------------- function Read_Register (This : STMPE811_Device; Reg_Addr : UInt8) return UInt8 is Data : TSC_Data (1 .. 1); Status : I2C_Status; begin This.Port.Mem_Read (This.I2C_Addr, UInt16 (Reg_Addr), Memory_Size_8b, Data, Status); if Status /= Ok then raise Program_Error with "Timeout while reading TC data"; end if; return Data (1); end Read_Register; -------------------- -- Write_Register -- -------------------- procedure Write_Register (This : in out STMPE811_Device; Reg_Addr : UInt8; Data : UInt8) is Status : I2C_Status; begin This.Port.Mem_Write (This.I2C_Addr, UInt16 (Reg_Addr), Memory_Size_8b, (1 => Data), Status); if Status /= Ok then raise Program_Error with "Timeout while reading TC data"; end if; end Write_Register; --------------- -- IOE_Reset -- --------------- procedure IOE_Reset (This : in out STMPE811_Device) is begin This.Write_Register (IOE_REG_SYS_CTRL1, 16#02#); -- Give some time for the reset This.Time.Delay_Milliseconds (2); This.Write_Register (IOE_REG_SYS_CTRL1, 16#00#); end IOE_Reset; -------------------------- -- IOE_Function_Command -- -------------------------- procedure IOE_Function_Command (This : in out STMPE811_Device; Func : UInt8; Enabled : Boolean) is Reg : UInt8 := This.Read_Register (IOE_REG_SYS_CTRL2); begin -- CTRL2 functions are disabled when corresponding bit is set if Enabled then Reg := Reg and (not Func); else Reg := Reg or Func; end if; This.Write_Register (IOE_REG_SYS_CTRL2, Reg); end IOE_Function_Command; ------------------- -- IOE_AF_Config -- ------------------- procedure IOE_AF_Config (This : in out STMPE811_Device; Pin : UInt8; Enabled : Boolean) is Reg : UInt8 := This.Read_Register (IOE_REG_GPIO_AF); begin if Enabled then Reg := Reg or Pin; else Reg := Reg and (not Pin); end if; This.Write_Register (IOE_REG_GPIO_AF, Reg); end IOE_AF_Config; ---------------- -- Get_IOE_ID -- ---------------- function Get_IOE_ID (This : in out STMPE811_Device) return UInt16 is begin return (UInt16 (This.Read_Register (0)) * (2**8)) or UInt16 (This.Read_Register (1)); end Get_IOE_ID; ---------------- -- Initialize -- ---------------- function Initialize (This : in out STMPE811_Device) return Boolean is begin This.Time.Delay_Milliseconds (100); if This.Get_IOE_ID /= 16#0811# then return False; end if; This.IOE_Reset; This.IOE_Function_Command (IOE_ADC_FCT, True); This.IOE_Function_Command (IOE_TSC_FCT, True); This.Write_Register (IOE_REG_ADC_CTRL1, 16#49#); This.Time.Delay_Milliseconds (2); This.Write_Register (IOE_REG_ADC_CTRL2, 16#01#); This.IOE_AF_Config (TOUCH_IO_ALL, False); This.Write_Register (IOE_REG_TSC_CFG, 16#9A#); This.Write_Register (IOE_REG_FIFO_TH, 16#01#); This.Write_Register (IOE_REG_FIFO_STA, 16#01#); This.Write_Register (IOE_REG_FIFO_TH, 16#00#); This.Write_Register (IOE_REG_TSC_FRACT_Z, 16#00#); This.Write_Register (IOE_REG_TSC_I_DRIVE, 16#01#); This.Write_Register (IOE_REG_TSC_CTRL, 16#01#); This.Write_Register (IOE_REG_INT_STA, 16#FF#); return True; end Initialize; ---------------- -- Set_Bounds -- ---------------- overriding procedure Set_Bounds (This : in out STMPE811_Device; Width : Natural; Height : Natural; Swap : HAL.Touch_Panel.Swap_State) is begin This.LCD_Natural_Width := Width; This.LCD_Natural_Height := Height; This.Swap := Swap; end Set_Bounds; ------------------------- -- Active_Touch_Points -- ------------------------- overriding function Active_Touch_Points (This : in out STMPE811_Device) return Touch_Identifier is Val : constant UInt8 := This.Read_Register (IOE_REG_TSC_CTRL) and 16#80#; begin if Val = 0 then This.Write_Register (IOE_REG_FIFO_STA, 16#01#); This.Write_Register (IOE_REG_FIFO_STA, 16#00#); return 0; else return 1; end if; end Active_Touch_Points; --------------------- -- Get_Touch_Point -- --------------------- overriding function Get_Touch_Point (This : in out STMPE811_Device; Touch_Id : Touch_Identifier) return TP_Touch_State is State : TP_Touch_State; Raw_X : UInt32; Raw_Y : UInt32; Raw_Z : UInt32; X : Integer; Y : Integer; Tmp : Integer; begin -- Check Touch detected bit in CTRL register if Touch_Id /= 1 or else This.Active_Touch_Points = 0 then return (0, 0, 0); end if; declare Data_X : constant TSC_Data := This.Read_Data (IOE_REG_TSC_DATA_X, 2); Data_Y : constant TSC_Data := This.Read_Data (IOE_REG_TSC_DATA_Y, 2); Data_Z : constant TSC_Data := This.Read_Data (IOE_REG_TSC_DATA_Z, 1); Z_Frac : constant TSC_Data := This.Read_Data (IOE_REG_TSC_FRACT_Z, 1); begin Raw_X := 2 ** 12 - (Shift_Left (UInt32 (Data_X (1)) and 16#0F#, 8) or UInt32 (Data_X (2))); Raw_Y := Shift_Left (UInt32 (Data_Y (1)) and 16#0F#, 8) or UInt32 (Data_Y (2)); Raw_Z := Shift_Right (UInt32 (Data_Z (1)), Natural (Z_Frac (1) and 2#111#)); end; -- Now we adapt the 12 bit resolution to the LCD width. X := Integer (Shift_Right (Raw_X * (UInt32 (This.LCD_Natural_Width) + 32), 12)); X := X - 16; X := Integer'Max (X, 0); X := Integer'Min (X, This.LCD_Natural_Width - 1); -- Do the same for Y Y := Integer (Raw_Y); Y := Y - 360; Y := Y / 11; Y := Integer'Max (Y, 0); Y := Integer'Min (Y, This.LCD_Natural_Height - 1); -- ??? There seems to be a strange behavior of this touch panel where -- sometimes it reports dummy points at X = LCD_Natural_Width. -- Let's filter this out if X = This.LCD_Natural_Width - 1 then return (0, 0, 0); end if; if (This.Swap and Invert_X) /= 0 then X := This.LCD_Natural_Width - X - 1; end if; if (This.Swap and Invert_Y) /= 0 then Y := This.LCD_Natural_Height - Y - 1; end if; if (This.Swap and Swap_XY) /= 0 then Tmp := X; X := Y; Y := Tmp; end if; State.X := X; State.Y := Y; State.Weight := Integer'Max (Integer (Raw_Z), 8); This.Write_Register (IOE_REG_FIFO_STA, 16#01#); This.Write_Register (IOE_REG_FIFO_STA, 16#00#); return State; end Get_Touch_Point; -------------------------- -- Get_All_Touch_Points -- -------------------------- overriding function Get_All_Touch_Points (This : in out STMPE811_Device) return HAL.Touch_Panel.TP_State is N_Touch : constant Natural := This.Active_Touch_Points; State : TP_State (1 .. N_Touch); begin if N_Touch = 0 then return (1 .. 0 => <>); end if; for J in State'Range loop State (J) := This.Get_Touch_Point (J); end loop; return State; end Get_All_Touch_Points; end STMPE811;
gspu/synth
Ada
4,450
ads
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt with Ada.Strings.Unbounded; with Ada.Strings; with Ada.Strings.Maps; package JohnnyText is package AS renames Ada.Strings; package SU renames Ada.Strings.Unbounded; package SM renames Ada.Strings.Maps; subtype Text is SU.Unbounded_String; type Line_Markers is private; blank : constant Text := SU.Null_Unbounded_String; -- converters : Text <==> String function USS (US : Text) return String; function SUS (S : String) return Text; -- True if the string is zero length function IsBlank (US : Text) return Boolean; function IsBlank (S : String) return Boolean; -- True if strings are identical function equivalent (A, B : Text) return Boolean; function equivalent (A : Text; B : String) return Boolean; -- Trim both sides function trim (US : Text) return Text; function trim (S : String) return String; function trimtab (US : Text) return Text; function trimtab (S : String) return String; -- unpadded numeric image function int2str (A : Integer) return String; function int2text (A : Integer) return Text; -- convert boolean to lowercase string function bool2str (A : Boolean) return String; function bool2text (A : Boolean) return Text; -- Return first line of block of lines (line is removed from block) procedure nextline (lineblock, firstline : out Text); -- shorthand for index function contains (S : String; fragment : String) return Boolean; function contains (US : Text; fragment : String) return Boolean; -- Return half of a string split by separator function part_1 (S : String; separator : String := "/") return String; function part_2 (S : String; separator : String := "/") return String; -- Replace a single character with another single character (first found) function replace (S : String; reject, shiny : Character) return String; -- Numeric image with left-padded zeros function zeropad (N : Natural; places : Positive) return String; -- Returns number of instances of a given character in a given string function count_char (S : String; focus : Character) return Natural; -- Search entire string S for focus character and replace all instances with substring function replace_char (S : String; focus : Character; substring : String) return String; -- Filters out control characters from String S function strip_control (S : String) return String; -- Given a single line (presumably no line feeds) with data separated by <delimited>, -- return the field given by field_number (starts counting at 1). function specific_field (S : String; field_number : Positive; delimiter : String := " ") return String; -- Return True if S leads with fragment exactly function leads (S : String; fragment : String) return Boolean; function leads (US : Text; fragment : String) return Boolean; -- Iterate though block of text, LF is delimiter procedure initialize_markers (block_text : in String; shuttle : out Line_Markers); function next_line_present (block_text : in String; shuttle : in out Line_Markers) return Boolean; function next_line_with_content_present (block_text : in String; start_with : in String; shuttle : in out Line_Markers) return Boolean; function extract_line (block_text : in String; shuttle : in Line_Markers) return String; -- Head (keep all but last delimiter and field) function head (US : Text; delimiter : Text) return Text; function head (S : String; delimiter : String) return String; -- Tail (keep only last field) function tail (US : Text; delimiter : Text) return Text; function tail (S : String; delimiter : String) return String; -- Replaces 2 or more consecutive spaces with a single space function strip_excessive_spaces (S : String) return String; private single_LF : constant String (1 .. 1) := (1 => ASCII.LF); space_and_HT : constant SM.Character_Set := SM.To_Set (" " & ASCII.HT); type Line_Markers is record back_marker : Natural := 0; front_marker : Natural := 0; zero_length : Boolean := False; utilized : Boolean := False; end record; end JohnnyText;
reznikmm/matreshka
Ada
2,756
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010 Vadim Godunko <[email protected]> -- -- -- -- Matreshka is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. Matreshka is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with Matreshka; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, -- -- Fifth Floor, Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package Matreshka.Internals.Regexps.Compiler.Debug is pragma Preelaborate; function Dump (Pattern : not null Shared_Pattern_Access) return String; end Matreshka.Internals.Regexps.Compiler.Debug;
reznikmm/matreshka
Ada
9,362
adb
------------------------------------------------------------------------------ -- -- -- 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. ------------------------------------------------------------------------------ with AMF.Holders.Elements; with AMF.Internals.Helpers; with AMF.Internals.Holders.UML_Holders; with AMF.Internals.Tables.MOFEXT_Element_Table; with AMF.Internals.Tables.MOFEXT_Types; with AMF.Internals.Tables.MOF_Metamodel; with AMF.Internals.Tables.UML_Metamodel; with AMF.MOF.Tags; with AMF.UML.Comments.Collections; with AMF.UML.Elements.Collections; with League.Holders; package body AMF.Internals.Tables.MOFEXT_Reflection is --------- -- Get -- --------- function Get (Self : AMF.Internals.AMF_Element; Property : CMOF_Element) return League.Holders.Holder is function MOF_Tag_Get return League.Holders.Holder; -- Returns attribute's value of instance of Tag class. ----------------- -- MOF_Tag_Get -- ----------------- function MOF_Tag_Get return League.Holders.Holder is begin if Property = AMF.Internals.Tables.MOF_Metamodel.MP_MOF_Tag_Element_A_Tag then -- Tag::element : Element return AMF.UML.Elements.Collections.UML_Element_Collections.Internals.To_Holder (AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Get_Element); elsif Property = AMF.Internals.Tables.MOF_Metamodel.MP_MOF_Tag_Name then -- Tag::name : String return League.Holders.To_Holder (AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Get_Name); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Comment_A_Owning_Element then -- Element::ownedComment : Comment return AMF.UML.Comments.Collections.UML_Comment_Collections.Internals.To_Holder (AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Get_Owned_Comment); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owned_Element_Element_Owner then -- Element::ownedElement : Element return AMF.UML.Elements.Collections.UML_Element_Collections.Internals.To_Holder (AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Get_Owned_Element); elsif Property = AMF.Internals.Tables.UML_Metamodel.MP_UML_Element_Owner_Element_Owned_Element then -- Element::owner : Element return AMF.Internals.Holders.UML_Holders.To_Holder (AMF.UML.Elements.UML_Element_Access' (AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Get_Owner)); elsif Property = AMF.Internals.Tables.MOF_Metamodel.MP_MOF_Tag_Tag_Owner_A_Owned_Tag then -- Tag::tagOwner : Element return AMF.Internals.Holders.UML_Holders.To_Holder (AMF.UML.Elements.UML_Element_Access' (AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Get_Tag_Owner)); elsif Property = AMF.Internals.Tables.MOF_Metamodel.MP_MOF_Tag_Value then -- Tag::value : String return League.Holders.To_Holder (AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Get_Value); else raise Program_Error; end if; end MOF_Tag_Get; begin case AMF.Internals.Tables.MOFEXT_Element_Table.Table (Self).Kind is when AMF.Internals.Tables.MOFEXT_Types.E_None => raise Program_Error; when AMF.Internals.Tables.MOFEXT_Types.E_MOF_Tag => return MOF_Tag_Get; end case; end Get; -------------------- -- Get_Meta_Class -- -------------------- function Get_Meta_Class (Self : AMF.Internals.AMF_Element) return CMOF_Element is begin case MOFEXT_Element_Table.Table (Self).Kind is when AMF.Internals.Tables.MOFEXT_Types.E_None => return 0; when AMF.Internals.Tables.MOFEXT_Types.E_MOF_Tag => return AMF.Internals.Tables.MOF_Metamodel.MC_MOF_Tag; end case; end Get_Meta_Class; --------- -- Set -- --------- procedure Set (Self : AMF.Internals.AMF_Element; Property : CMOF_Element; Value : League.Holders.Holder) is procedure MOF_Tag_Set; -- Sets attribute's value of instance of Tag class. ----------------- -- MOF_Tag_Set -- ----------------- procedure MOF_Tag_Set is begin if Property = AMF.Internals.Tables.MOF_Metamodel.MP_MOF_Tag_Name then -- Tag::name : String AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Set_Name (League.Holders.Element (Value)); elsif Property = AMF.Internals.Tables.MOF_Metamodel.MP_MOF_Tag_Tag_Owner_A_Owned_Tag then -- Tag::tagOwner : Element AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Set_Tag_Owner (AMF.UML.Elements.UML_Element_Access (AMF.Holders.Elements.Element (Value))); elsif Property = AMF.Internals.Tables.MOF_Metamodel.MP_MOF_Tag_Value then -- Tag::value : String AMF.MOF.Tags.MOF_Tag_Access (AMF.Internals.Helpers.To_Element (Self)).Set_Value (League.Holders.Element (Value)); else raise Program_Error; end if; end MOF_Tag_Set; begin case MOFEXT_Element_Table.Table (Self).Kind is when AMF.Internals.Tables.MOFEXT_Types.E_None => raise Program_Error; when AMF.Internals.Tables.MOFEXT_Types.E_MOF_Tag => MOF_Tag_Set; end case; end Set; end AMF.Internals.Tables.MOFEXT_Reflection;
charlie5/lace
Ada
9,732
adb
with openGL.Geometry.lit_colored_textured, openGL.GlyphImpl.Texture, openGL.Primitive.indexed, openGL.Texture, ada.Directories; package body openGL.Model.Text.lit_colored is --------- --- Forge -- function new_Text (Text : in String; Font : in openGL.Font.font_Id; Color : in lucid_Color; Centered : in Boolean := True) return View is Font_Name : constant String := to_String (Font.Name); Exists : constant Boolean := ada.Directories.Exists (Font_Name); begin if not Exists then raise no_such_Font with Font_Name; end if; declare Self : constant View := new Item; begin Self.Text := new String' (Text); Self.Font_Id := Font; Self.Color := +Color; Self.Centered := Centered; Self.Bounds := null_Bounds; return Self; end; end new_Text; -------------- --- Attributes -- overriding procedure Text_is (Self : in out Item; Now : in String) is begin Self.Text := new String (1 .. Now'Length); Self.Text.all := Now; -- NB: This results in Text'First = 1. Self.needs_Rebuild := True; end Text_is; overriding function Text (Self : in Item) return String is begin return Self.Text.all; end Text; overriding function Font (Self : in Item) return openGL.Font.view is begin return Self.Font.all'Access; end Font; overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in openGL.Font.font_id_Map_of_font) return Geometry.views is pragma unreferenced (Textures); text_Scale : constant Vector_3 := [2.0 * 4.0 / 78.0, -- TODO: Fix scaling. 2.0 * 4.0 / 95.0, 1.0 / 1.0]; begin if Self.Text.all = "" then return [1 .. 0 => <>]; end if; declare use Geometry, Geometry.lit_colored_textured, Texture; num_Characters : constant Positive := Self.Text.all'Length; num_Indices : constant long_Index_t := long_Index_t (num_Characters) * 2 * 3; -- For each character, 2 triangles each with 3 indices. num_Vertices : constant Index_t := Index_t (num_Characters) * 4; -- For each character, 2 triangles sharing 4 vertices. the_Indices : aliased Indices (1 .. num_Indices); the_Vertices : aliased Geometry.lit_colored_textured.Vertex_array := [1 .. num_Vertices => <>]; --- Procedure to 'add' a character. -- pen_Site : Vector_3 := Origin_3D; indices_Count : long_Index_t := 0; vertex_Count : Index_t := 0; procedure add (the_Character : in Character; Next : in Character) is pragma unreferenced (Next); the_Quad : GlyphImpl.Texture.Quad_t := Self.Font.Quad (the_Character); begin --- Add indices. -- -- Triangle 1. indices_Count := indices_Count + 1; the_Indices (indices_Count) := vertex_Count + 1; indices_Count := indices_Count + 1; the_Indices (indices_Count) := vertex_Count + 2; indices_Count := indices_Count + 1; the_Indices (indices_Count) := vertex_Count + 3; -- Triangle 2. indices_Count := indices_Count + 1; the_Indices (indices_Count) := vertex_Count + 3; indices_Count := indices_Count + 1; the_Indices (indices_Count) := vertex_Count + 4; indices_Count := indices_Count + 1; the_Indices (indices_Count) := vertex_Count + 1; --- Scale the Quad sites and advance to pixel units. -- the_Quad.NW.Site (1) := the_Quad.NW.Site (1) * text_Scale (1); -- TODO: Scaling should be done by the shader. the_Quad.NW.Site (2) := the_Quad.NW.Site (2) * text_Scale (2); the_Quad.NE.Site (1) := the_Quad.NE.Site (1) * text_Scale (1); the_Quad.NE.Site (2) := the_Quad.NE.Site (2) * text_Scale (2); the_Quad.SW.Site (1) := the_Quad.SW.Site (1) * text_Scale (1); the_Quad.SW.Site (2) := the_Quad.SW.Site (2) * text_Scale (2); the_Quad.SE.Site (1) := the_Quad.SE.Site (1) * text_Scale (1); the_Quad.SE.Site (2) := the_Quad.SE.Site (2) * text_Scale (2); the_Quad.Advance (1) := the_Quad.Advance (1) * text_Scale (1); the_Quad.Advance (2) := the_Quad.Advance (2) * text_Scale (2); --- Add vertices. -- -- top left (NW) -- vertex_Count := vertex_Count + 1; declare the_Vertex : Geometry.lit_colored_textured.Vertex renames the_Vertices (vertex_Count); begin the_Vertex.Site := pen_Site + the_Quad.NW.Site; the_Vertex.Normal := [0.0, 0.0, 1.0]; the_Vertex.Shine := 0.5; the_Vertex.Color := Self.Color; the_Vertex.Coords := the_Quad.NW.Coords; Self.Bounds.Box := Self.Bounds.Box or the_Vertex.Site; end; -- bottom left (SW) -- vertex_Count := vertex_Count + 1; declare the_Vertex : Geometry.lit_colored_textured.Vertex renames the_Vertices (vertex_Count); begin the_Vertex.Site := pen_Site + the_Quad.SW.Site; the_Vertex.Normal := [0.0, 0.0, 1.0]; the_Vertex.Shine := 0.5; the_Vertex.Color := Self.Color; the_Vertex.Coords := the_Quad.SW.Coords; Self.Bounds.Box := Self.Bounds.Box or the_Vertex.Site; end; -- bottom right (SE) -- vertex_Count := vertex_Count + 1; declare the_Vertex : Geometry.lit_colored_textured.Vertex renames the_Vertices (vertex_Count); begin the_Vertex.Site := pen_Site + the_Quad.SE.Site; the_Vertex.Normal := [0.0, 0.0, 1.0]; the_Vertex.Shine := 0.5; the_Vertex.Color := Self.Color; the_Vertex.Coords := the_Quad.SE.Coords; Self.Bounds.Box := Self.Bounds.Box or the_Vertex.Site; end; -- top right (NE) -- vertex_Count := vertex_Count + 1; declare the_Vertex : Geometry.lit_colored_textured.Vertex renames the_Vertices (vertex_Count); begin the_Vertex.Site := pen_Site + the_Quad.NE.Site; the_Vertex.Normal := [0.0, 0.0, 1.0]; the_Vertex.Shine := 0.5; the_Vertex.Color := Self.Color; the_Vertex.Coords := the_Quad.NE.Coords; Self.Bounds.Box := Self.Bounds.Box or the_Vertex.Site; end; pen_Site := pen_Site + the_Quad.Advance; Self.Bounds.Box := Self.Bounds.Box or pen_Site; end add; use Primitive; use type openGL.Font.texture.view; the_Geometry : Geometry.lit_colored_textured.view; the_Primitive : Primitive.indexed.view; unused : Vector_3; next_Character : Character; begin if Self.Font = null then Self.Font := openGL.Font.texture.view (Fonts.Element (Self.Font_Id)); end if; -- Add vertices and indices for each character in the text. -- unused := Self.Font.check_Glyphs (Self.Text.all); -- Make sure the glyphs, for each character in 'Self.Text' exist in the font. for i in Self.Text'Range loop if i /= Self.Text'Last then next_Character := Self.Text (i + 1); else next_Character := ' '; end if; add (Self.Text (i), next_Character); end loop; -- Center the vertex sites, if requested. -- if Self.Centered then declare the_Bounds : constant openGL.Bounds := Self.Font.BBox (Self.Text.all); begin for i in the_Vertices'Range loop the_Vertices (i).Site (1) := the_Vertices (i).Site (1) - (the_Bounds.Box.Upper (1) / 2.0) * text_Scale (1); the_Vertices (i).Site (2) := the_Vertices (i).Site (2) - (the_Bounds.Box.Upper (2) / 2.0) * text_Scale (2); end loop; end; end if; set_Ball_from_Box (Self.Bounds); -- Setup the geometry. -- the_Primitive := Primitive.indexed .new_Primitive (Triangles, the_Indices); the_Geometry := Geometry.lit_colored_textured.new_Geometry (texture_is_Alpha => True); the_Geometry.add (Primitive.view (the_Primitive)); the_Geometry.Vertices_are (the_Vertices); the_Geometry.Texture_is (Texture.Forge.to_Texture (Self.Font.gl_Texture)); the_Geometry.is_Transparent; return [1 => Geometry.view (the_Geometry)]; end; end to_GL_Geometries; end openGL.Model.Text.lit_colored;
RREE/ada-util
Ada
7,313
adb
----------------------------------------------------------------------- -- util-system-os -- Windows system operations -- Copyright (C) 2011, 2012, 2015, 2018, 2019 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; package body Util.Systems.Os is use type Interfaces.Unsigned_32; use type Interfaces.Unsigned_64; use type Interfaces.C.size_t; function To_WSTR (Value : in String) return Wchar_Ptr is Result : constant Wchar_Ptr := new Interfaces.C.wchar_array (0 .. Value'Length + 1); Pos : Interfaces.C.size_t := 0; begin for C of Value loop Result (Pos) := Interfaces.C.To_C (Ada.Characters.Conversions.To_Wide_Character (C)); Pos := Pos + 1; end loop; Result (Pos) := Interfaces.C.wide_nul; return Result; end To_WSTR; function Sys_SetFilePointerEx (Fs : in File_Type; Offset : in Util.Systems.Types.off_t; Result : access Util.Systems.Types.off_t; Mode : in Util.Systems.Types.Seek_Mode) return BOOL with Import => True, Convention => Stdcall, Link_Name => "SetFilePointerEx"; function Sys_Lseek (Fs : in File_Type; Offset : in Util.Systems.Types.off_t; Mode : in Util.Systems.Types.Seek_Mode) return Util.Systems.Types.off_t is Result : aliased Util.Systems.Types.off_t; begin if Sys_SetFilePointerEx (Fs, Offset, Result'Access, Mode) /= 0 then return Result; else return -1; end if; end Sys_Lseek; function Sys_GetFileSizeEx (Fs : in File_Type; Result : access Util.Systems.Types.off_t) return BOOL with Import => True, Convention => Stdcall, Link_Name => "GetFileSizeEx"; function Sys_GetFileTime (Fs : in File_Type; Create : access FileTime; AccessTime : access FileTime; ModifyTime : access FileTime) return BOOL with Import => True, Convention => Stdcall, Link_Name => "GetFileTime"; TICKS_PER_SECOND : constant := 10000000; EPOCH_DIFFERENCE : constant := 11644473600; function To_Time (Time : in FileTime) return Types.Time_Type is Value : Interfaces.Unsigned_64; begin Value := Interfaces.Shift_Left (Interfaces.Unsigned_64 (Time.dwHighDateTime), 32); Value := Value + Interfaces.Unsigned_64 (Time.dwLowDateTime); Value := Value / TICKS_PER_SECOND; Value := Value - EPOCH_DIFFERENCE; return Types.Time_Type (Value); end To_Time; function Sys_Fstat (Fs : in File_Type; Stat : access Util.Systems.Types.Stat_Type) return Integer is Size : aliased Util.Systems.Types.off_t; Creation_Time : aliased FileTime; Access_Time : aliased FileTime; Write_Time : aliased FileTime; begin Stat.st_dev := 0; Stat.st_ino := 0; Stat.st_mode := 0; Stat.st_nlink := 0; Stat.st_uid := 0; Stat.st_gid := 0; Stat.st_rdev := 0; Stat.st_atime := 0; Stat.st_mtime := 0; Stat.st_ctime := 0; if Sys_GetFileSizeEx (Fs, Size'Access) = 0 then return -1; end if; if Sys_GetFileTime (Fs, Creation_Time'Access, Access_Time'Access, Write_Time'Access) = 0 then return -1; end if; Stat.st_size := Size; Stat.st_ctime := To_Time (Creation_Time); Stat.st_mtime := To_Time (Write_Time); Stat.st_atime := To_Time (Access_Time); return 0; end Sys_Fstat; -- Open a file function Sys_Open (Path : in Ptr; Flags : in Interfaces.C.int; Mode : in Util.Systems.Types.mode_t) return File_Type is pragma Unreferenced (Mode); function Has_Flag (M : in Interfaces.C.int; F : in Interfaces.C.int) return Boolean is ((Interfaces.Unsigned_32 (M) and Interfaces.Unsigned_32 (F)) /= 0); Sec : aliased Security_Attributes; Result : File_Type; Desired_Access : DWORD; Share_Mode : DWORD := FILE_SHARE_READ + FILE_SHARE_WRITE; Creation : DWORD; WPath : Wchar_Ptr; begin WPath := To_WSTR (Interfaces.C.Strings.Value (Path)); Sec.Length := Security_Attributes'Size / 8; Sec.Security_Descriptor := System.Null_Address; Sec.Inherit := (if Has_Flag (Flags, Util.Systems.Constants.O_CLOEXEC) then 0 else 1); if Has_Flag (Flags, O_WRONLY) then Desired_Access := GENERIC_WRITE; elsif Has_Flag (Flags, O_RDWR) then Desired_Access := GENERIC_READ + GENERIC_WRITE; else Desired_Access := GENERIC_READ; end if; if Has_Flag (Flags, O_CREAT) then if Has_Flag (Flags, O_EXCL) then Creation := CREATE_NEW; else Creation := CREATE_ALWAYS; end if; else Creation := OPEN_EXISTING; end if; if Has_Flag (Flags, O_APPEND) then Desired_Access := FILE_APPEND_DATA; end if; if Has_Flag (Flags, O_EXCL) then Share_Mode := 0; end if; Result := Create_File (WPath.all'Address, Desired_Access, Share_Mode, Sec'Unchecked_Access, Creation, FILE_ATTRIBUTE_NORMAL, NO_FILE); Free (WPath); return (if Result = INVALID_HANDLE_VALUE then NO_FILE else Result); end Sys_Open; function Sys_SetEndOfFile (Fs : in File_Type) return BOOL with Import => True, Convention => Stdcall, Link_Name => "SetEndOfFile"; function Sys_Ftruncate (Fs : in File_Type; Length : in Util.Systems.Types.off_t) return Integer is begin if Sys_Lseek (Fs, Length, Util.Systems.Types.SEEK_SET) < 0 then return -1; end if; if Sys_SetEndOfFile (Fs) = 0 then return -1; end if; return 0; end Sys_Ftruncate; function Sys_Fchmod (Fd : in File_Type; Mode : in Util.Systems.Types.mode_t) return Integer is pragma Unreferenced (Fd, Mode); begin return 0; end Sys_Fchmod; -- Close a file function Sys_Close (Fd : in File_Type) return Integer is begin if Close_Handle (Fd) = 0 then return -1; else return 0; end if; end Sys_Close; end Util.Systems.Os;
reznikmm/matreshka
Ada
4,239
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 Matreshka.DOM_Nodes; with XML.DOM.Attributes.Internals; package body ODF.DOM.Attributes.FO.Text_Indent.Internals is ------------ -- Create -- ------------ function Create (Node : Matreshka.ODF_Attributes.FO.Text_Indent.FO_Text_Indent_Access) return ODF.DOM.Attributes.FO.Text_Indent.ODF_FO_Text_Indent is begin return (XML.DOM.Attributes.Internals.Create (Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record); end Create; ---------- -- Wrap -- ---------- function Wrap (Node : Matreshka.ODF_Attributes.FO.Text_Indent.FO_Text_Indent_Access) return ODF.DOM.Attributes.FO.Text_Indent.ODF_FO_Text_Indent is begin return (XML.DOM.Attributes.Internals.Wrap (Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record); end Wrap; end ODF.DOM.Attributes.FO.Text_Indent.Internals;
mirror/ncurses
Ada
3,678
adb
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright 2020 Thomas E. Dickey -- -- Copyright 1999-2011,2014 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.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; use Interfaces.C; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is procedure Set_Field_Type (Fld : Field; Typ : Regular_Expression_Field) is function Set_Ftyp (F : Field := Fld; Arg1 : char_array) return Eti_Error; pragma Import (C, Set_Ftyp, "set_field_type_regexp"); begin Eti_Exception (Set_Ftyp (Arg1 => To_C (Typ.Regular_Expression.all))); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
reznikmm/matreshka
Ada
4,123
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.Style_Rfc_Language_Tag_Complex_Attributes; package Matreshka.ODF_Style.Rfc_Language_Tag_Complex_Attributes is type Style_Rfc_Language_Tag_Complex_Attribute_Node is new Matreshka.ODF_Style.Abstract_Style_Attribute_Node and ODF.DOM.Style_Rfc_Language_Tag_Complex_Attributes.ODF_Style_Rfc_Language_Tag_Complex_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Style_Rfc_Language_Tag_Complex_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Style_Rfc_Language_Tag_Complex_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Style.Rfc_Language_Tag_Complex_Attributes;
reznikmm/matreshka
Ada
5,526
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.OCL.Ocl_Expressions; limited with AMF.OCL.Ocl_Expressions.Collections; limited with AMF.UML.Call_Operation_Actions; limited with AMF.UML.Send_Signal_Actions; package AMF.OCL.Message_Exps is pragma Preelaborate; type OCL_Message_Exp is limited interface and AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression; type OCL_Message_Exp_Access is access all OCL_Message_Exp'Class; for OCL_Message_Exp_Access'Storage_Size use 0; not overriding function Get_Target (Self : not null access constant OCL_Message_Exp) return AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access is abstract; -- Getter of MessageExp::target. -- not overriding procedure Set_Target (Self : not null access OCL_Message_Exp; To : AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access) is abstract; -- Setter of MessageExp::target. -- not overriding function Get_Argument (Self : not null access constant OCL_Message_Exp) return AMF.OCL.Ocl_Expressions.Collections.Ordered_Set_Of_OCL_Ocl_Expression is abstract; -- Getter of MessageExp::argument. -- not overriding function Get_Called_Operation (Self : not null access constant OCL_Message_Exp) return AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access is abstract; -- Getter of MessageExp::calledOperation. -- not overriding procedure Set_Called_Operation (Self : not null access OCL_Message_Exp; To : AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access) is abstract; -- Setter of MessageExp::calledOperation. -- not overriding function Get_Sent_Signal (Self : not null access constant OCL_Message_Exp) return AMF.UML.Send_Signal_Actions.UML_Send_Signal_Action_Access is abstract; -- Getter of MessageExp::sentSignal. -- not overriding procedure Set_Sent_Signal (Self : not null access OCL_Message_Exp; To : AMF.UML.Send_Signal_Actions.UML_Send_Signal_Action_Access) is abstract; -- Setter of MessageExp::sentSignal. -- end AMF.OCL.Message_Exps;
stcarrez/ada-util
Ada
2,222
adb
----------------------------------------------------------------------- -- encodes -- Encodes strings -- Copyright (C) 2010 - 2023 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.Text_IO; with Ada.Command_Line; with Util.Encoders; procedure Encodes is use Util.Encoders; Encode : Boolean := True; Count : constant Natural := Ada.Command_Line.Argument_Count; begin if Count <= 1 then Ada.Text_IO.Put_Line ("Usage: encodes {encoder} [-d|-e] string..."); Ada.Text_IO.Put_Line ("Encoders: " & Util.Encoders.BASE_64 & ", " & Util.Encoders.BASE_64_URL & ", " & Util.Encoders.BASE_32 & ", " & Util.Encoders.BASE_16 & ", " & Util.Encoders.HASH_SHA1); return; end if; declare Name : constant String := Ada.Command_Line.Argument (1); C : constant Encoder := Util.Encoders.Create (Name); D : constant Decoder := Util.Encoders.Create (Name); begin for I in 2 .. Count loop declare S : constant String := Ada.Command_Line.Argument (I); begin if S = "-d" then Encode := False; elsif S = "-e" then Encode := True; elsif Encode then Ada.Text_IO.Put_Line ("Encodes " & Name & ": " & C.Encode (S)); else Ada.Text_IO.Put_Line ("Decodes " & Name & ": " & D.Decode (S)); end if; end; end loop; end; end Encodes;
AdaCore/training_material
Ada
2,632
adb
with STM32_SVD.RCC; use STM32_SVD.RCC; with STM32_SVD.RNG; use STM32_SVD.RNG; package body STM32.RNG is ---------------------- -- Enable_RNG_Clock -- ---------------------- procedure Enable_RNG_Clock is begin RCC_Periph.AHB2ENR.RNGEN := True; end Enable_RNG_Clock; ---------------- -- Enable_RNG -- ---------------- procedure Enable_RNG is begin RNG_Periph.CR.RNGEN := True; end Enable_RNG; ----------------- -- Disable_RNG -- ----------------- procedure Disable_RNG is begin RNG_Periph.CR.RNGEN := False; end Disable_RNG; --------------- -- Reset_RNG -- --------------- procedure Reset_RNG is begin RCC_Periph.AHB2RSTR.RNGRST := True; RCC_Periph.AHB2RSTR.RNGRST := False; end Reset_RNG; ----------------- -- RNG_Enabled -- ----------------- function RNG_Enabled return Boolean is (RNG_Periph.CR.RNGEN); -------------------------- -- Enable_RNG_Interrupt -- -------------------------- procedure Enable_RNG_Interrupt is begin RNG_Periph.CR.IE := True; end Enable_RNG_Interrupt; --------------------------- -- Disable_RNG_Interrupt -- --------------------------- procedure Disable_RNG_Interrupt is begin RNG_Periph.CR.IE := False; end Disable_RNG_Interrupt; --------------------------- -- RNG_Interrupt_Enabled -- --------------------------- function RNG_Interrupt_Enabled return Boolean is (RNG_Periph.CR.IE); -------------- -- RNG_Data -- -------------- function RNG_Data return UInt32 is (RNG_Periph.DR); -------------------- -- RNG_Data_Ready -- -------------------- function RNG_Data_Ready return Boolean is (RNG_Periph.SR.DRDY); --------------------------- -- RNG_Seed_Error_Status -- --------------------------- function RNG_Seed_Error_Status return Boolean is (RNG_Periph.SR.SECS); ---------------------------- -- RNG_Clock_Error_Status -- ---------------------------- function RNG_Clock_Error_Status return Boolean is (RNG_Periph.SR.CECS); --------------------------------- -- Clear_RNG_Seed_Error_Status -- --------------------------------- procedure Clear_RNG_Seed_Error_Status is begin RNG_Periph.SR.SECS := False; end Clear_RNG_Seed_Error_Status; ---------------------------------- -- Clear_RNG_Clock_Error_Status -- ---------------------------------- procedure Clear_RNG_Clock_Error_Status is begin RNG_Periph.SR.CECS := False; end Clear_RNG_Clock_Error_Status; end STM32.RNG;
charlie5/cBound
Ada
31,058
ads
-- This file is generated by SWIG. Please do *not* modify by hand. -- with fann_c.Pointers; with fann_c.fann; with fann_c.fann_callback_type; with fann_c.fann_connection; with fann_c.fann_error; with fann_c.fann_train_data; with fann_c.user_function; with interfaces.c; with interfaces.c.strings; with swig; with swig.pointers; with interfaces.C; package fann_c.Binding is procedure fann_set_error_log (errdat : in fann_c.fann_error.Pointer; log_file : in fann_c.Pointers.FILE_Pointer); function fann_get_errno (errdat : in fann_c.fann_error.Pointer) return fann_c.fann_errno_enum; procedure fann_reset_errno (errdat : in fann_c.fann_error.Pointer); procedure fann_reset_errstr (errdat : in fann_c.fann_error.Pointer); function fann_get_errstr (errdat : in fann_c.fann_error.Pointer) return interfaces.c.strings.chars_ptr; procedure fann_print_error (errdat : in fann_c.fann_error.Pointer); function create_train_from_callback (num_data : in interfaces.c.unsigned; num_input : in interfaces.c.unsigned; num_output : in interfaces.c.unsigned; the_user_function : in fann_c.user_function.Item) return fann_c.fann_train_data.Pointer; procedure fann_train (ann : in fann_c.fann.Pointer; input : in fann_c.Pointers.fann_type_Pointer; desired_output : in fann_c.Pointers.fann_type_Pointer); function fann_test (ann : in fann_c.fann.Pointer; input : in fann_c.Pointers.fann_type_Pointer; desired_output : in fann_c.Pointers.fann_type_Pointer) return fann_c.Pointers.fann_type_Pointer; function fann_get_MSE (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; function fann_get_bit_fail (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_reset_MSE (ann : in fann_c.fann.Pointer); procedure fann_train_on_data (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer; max_epochs : in interfaces.c.unsigned; epochs_between_reports : in interfaces.c.unsigned; desired_error : in interfaces.c.c_float); procedure fann_train_on_file (ann : in fann_c.fann.Pointer; filename : in interfaces.c.strings.chars_ptr; max_epochs : in interfaces.c.unsigned; epochs_between_reports : in interfaces.c.unsigned; desired_error : in interfaces.c.c_float); function fann_train_epoch (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer) return interfaces.c.c_float; function fann_test_data (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer) return interfaces.c.c_float; function fann_read_train_from_file (filename : in interfaces.c.strings.chars_ptr) return fann_c.fann_train_data.Pointer; function fann_create_train (num_data : in interfaces.c.unsigned; num_input : in interfaces.c.unsigned; num_output : in interfaces.c.unsigned) return fann_c.fann_train_data.Pointer; procedure fann_destroy_train (train_data : in fann_c.fann_train_data.Pointer); procedure fann_shuffle_train_data (train_data : in fann_c.fann_train_data.Pointer); procedure fann_scale_train (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer); procedure fann_descale_train (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer); function fann_set_input_scaling_params (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer; new_input_min : in interfaces.c.c_float; new_input_max : in interfaces.c.c_float) return interfaces.c.int; function fann_set_output_scaling_params (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer; new_output_min : in interfaces.c.c_float; new_output_max : in interfaces.c.c_float) return interfaces.c.int; function fann_set_scaling_params (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer; new_input_min : in interfaces.c.c_float; new_input_max : in interfaces.c.c_float; new_output_min : in interfaces.c.c_float; new_output_max : in interfaces.c.c_float) return interfaces.c.int; function fann_clear_scaling_params (ann : in fann_c.fann.Pointer) return interfaces.c.int; procedure fann_scale_input (ann : in fann_c.fann.Pointer; input_vector : in fann_c.Pointers.fann_type_Pointer); procedure fann_scale_output (ann : in fann_c.fann.Pointer; output_vector : in fann_c.Pointers.fann_type_Pointer); procedure fann_descale_input (ann : in fann_c.fann.Pointer; input_vector : in fann_c.Pointers.fann_type_Pointer); procedure fann_descale_output (ann : in fann_c.fann.Pointer; output_vector : in fann_c.Pointers.fann_type_Pointer); procedure fann_scale_input_train_data (train_data : in fann_c.fann_train_data.Pointer; new_min : in fann_c.fann_type; new_max : in fann_c.fann_type); procedure fann_scale_output_train_data (train_data : in fann_c.fann_train_data.Pointer; new_min : in fann_c.fann_type; new_max : in fann_c.fann_type); procedure fann_scale_train_data (train_data : in fann_c.fann_train_data.Pointer; new_min : in fann_c.fann_type; new_max : in fann_c.fann_type); function fann_merge_train_data (data1 : in fann_c.fann_train_data.Pointer; data2 : in fann_c.fann_train_data.Pointer) return fann_c.fann_train_data.Pointer; function fann_duplicate_train_data (data : in fann_c.fann_train_data.Pointer) return fann_c.fann_train_data.Pointer; function fann_subset_train_data (data : in fann_c.fann_train_data.Pointer; pos : in interfaces.c.unsigned; length : in interfaces.c.unsigned) return fann_c.fann_train_data.Pointer; function fann_length_train_data (data : in fann_c.fann_train_data.Pointer) return interfaces.c.unsigned; function fann_num_input_train_data (data : in fann_c.fann_train_data.Pointer) return interfaces.c.unsigned; function fann_num_output_train_data (data : in fann_c.fann_train_data.Pointer) return interfaces.c.unsigned; function fann_save_train (data : in fann_c.fann_train_data.Pointer; filename : in interfaces.c.strings.chars_ptr) return interfaces.c.int; function fann_save_train_to_fixed (data : in fann_c.fann_train_data.Pointer; filename : in interfaces.c.strings.chars_ptr; decimal_point : in interfaces.c.unsigned) return interfaces.c.int; function fann_get_training_algorithm (ann : in fann_c.fann.Pointer) return fann_c.fann_train_enum; procedure fann_set_training_algorithm (ann : in fann_c.fann.Pointer; training_algorithm : in fann_c.fann_train_enum); function fann_get_learning_rate (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_learning_rate (ann : in fann_c.fann.Pointer; learning_rate : in interfaces.c.c_float); function fann_get_learning_momentum (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_learning_momentum (ann : in fann_c.fann.Pointer; learning_momentum : in interfaces.c.c_float); function fann_get_activation_function (ann : in fann_c.fann.Pointer; layer : in interfaces.c.int; neuron : in interfaces.c.int) return fann_c.fann_activationfunc_enum; procedure fann_set_activation_function (ann : in fann_c.fann.Pointer; activation_function : in fann_c.fann_activationfunc_enum; layer : in interfaces.c.int; neuron : in interfaces.c.int); procedure fann_set_activation_function_layer (ann : in fann_c.fann.Pointer; activation_function : in fann_c.fann_activationfunc_enum; layer : in interfaces.c.int); procedure fann_set_activation_function_hidden (ann : in fann_c.fann.Pointer; activation_function : in fann_c.fann_activationfunc_enum); procedure fann_set_activation_function_output (ann : in fann_c.fann.Pointer; activation_function : in fann_c.fann_activationfunc_enum); function fann_get_activation_steepness (ann : in fann_c.fann.Pointer; layer : in interfaces.c.int; neuron : in interfaces.c.int) return fann_c.fann_type; procedure fann_set_activation_steepness (ann : in fann_c.fann.Pointer; steepness : in fann_c.fann_type; layer : in interfaces.c.int; neuron : in interfaces.c.int); procedure fann_set_activation_steepness_layer (ann : in fann_c.fann.Pointer; steepness : in fann_c.fann_type; layer : in interfaces.c.int); procedure fann_set_activation_steepness_hidden (ann : in fann_c.fann.Pointer; steepness : in fann_c.fann_type); procedure fann_set_activation_steepness_output (ann : in fann_c.fann.Pointer; steepness : in fann_c.fann_type); function fann_get_train_error_function (ann : in fann_c.fann.Pointer) return fann_c.fann_errorfunc_enum; procedure fann_set_train_error_function (ann : in fann_c.fann.Pointer; train_error_function : in fann_c.fann_errorfunc_enum); function fann_get_train_stop_function (ann : in fann_c.fann.Pointer) return fann_c.fann_stopfunc_enum; procedure fann_set_train_stop_function (ann : in fann_c.fann.Pointer; train_stop_function : in fann_c.fann_stopfunc_enum); function fann_get_bit_fail_limit (ann : in fann_c.fann.Pointer) return fann_c.fann_type; procedure fann_set_bit_fail_limit (ann : in fann_c.fann.Pointer; bit_fail_limit : in fann_c.fann_type); procedure fann_set_callback (ann : in fann_c.fann.Pointer; callback : in fann_c.fann_callback_type.Item); function fann_get_quickprop_decay (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_quickprop_decay (ann : in fann_c.fann.Pointer; quickprop_decay : in interfaces.c.c_float); function fann_get_quickprop_mu (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_quickprop_mu (ann : in fann_c.fann.Pointer; quickprop_mu : in interfaces.c.c_float); function fann_get_rprop_increase_factor (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_rprop_increase_factor (ann : in fann_c.fann.Pointer; rprop_increase_factor : in interfaces.c.c_float); function fann_get_rprop_decrease_factor (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_rprop_decrease_factor (ann : in fann_c.fann.Pointer; rprop_decrease_factor : in interfaces.c.c_float); function fann_get_rprop_delta_min (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_rprop_delta_min (ann : in fann_c.fann.Pointer; rprop_delta_min : in interfaces.c.c_float); function fann_get_rprop_delta_max (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_rprop_delta_max (ann : in fann_c.fann.Pointer; rprop_delta_max : in interfaces.c.c_float); function fann_get_rprop_delta_zero (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_rprop_delta_zero (ann : in fann_c.fann.Pointer; rprop_delta_max : in interfaces.c.c_float); function fann_get_sarprop_weight_decay_shift (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_sarprop_weight_decay_shift (ann : in fann_c.fann.Pointer; sarprop_weight_decay_shift : in interfaces.c.c_float); function fann_get_sarprop_step_error_threshold_factor (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_sarprop_step_error_threshold_factor (ann : in fann_c.fann.Pointer; sarprop_step_error_threshold_factor : in interfaces.c.c_float); function fann_get_sarprop_step_error_shift (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_sarprop_step_error_shift (ann : in fann_c.fann.Pointer; sarprop_step_error_shift : in interfaces.c.c_float); function fann_get_sarprop_temperature (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_sarprop_temperature (ann : in fann_c.fann.Pointer; sarprop_temperature : in interfaces.c.c_float); procedure fann_cascadetrain_on_data (ann : in fann_c.fann.Pointer; data : in fann_c.fann_train_data.Pointer; max_neurons : in interfaces.c.unsigned; neurons_between_reports : in interfaces.c.unsigned; desired_error : in interfaces.c.c_float); procedure fann_cascadetrain_on_file (ann : in fann_c.fann.Pointer; filename : in interfaces.c.strings.chars_ptr; max_neurons : in interfaces.c.unsigned; neurons_between_reports : in interfaces.c.unsigned; desired_error : in interfaces.c.c_float); function fann_get_cascade_output_change_fraction (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_cascade_output_change_fraction (ann : in fann_c.fann.Pointer; cascade_output_change_fraction : in interfaces.c.c_float); function fann_get_cascade_output_stagnation_epochs (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_set_cascade_output_stagnation_epochs (ann : in fann_c.fann.Pointer; cascade_output_stagnation_epochs : in interfaces.c.unsigned); function fann_get_cascade_candidate_change_fraction (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; procedure fann_set_cascade_candidate_change_fraction (ann : in fann_c.fann.Pointer; cascade_candidate_change_fraction : in interfaces.c.c_float); function fann_get_cascade_candidate_stagnation_epochs (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_set_cascade_candidate_stagnation_epochs (ann : in fann_c.fann.Pointer; cascade_candidate_stagnation_epochs : in interfaces.c.unsigned); function fann_get_cascade_weight_multiplier (ann : in fann_c.fann.Pointer) return fann_c.fann_type; procedure fann_set_cascade_weight_multiplier (ann : in fann_c.fann.Pointer; cascade_weight_multiplier : in fann_c.fann_type); function fann_get_cascade_candidate_limit (ann : in fann_c.fann.Pointer) return fann_c.fann_type; procedure fann_set_cascade_candidate_limit (ann : in fann_c.fann.Pointer; cascade_candidate_limit : in fann_c.fann_type); function fann_get_cascade_max_out_epochs (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_set_cascade_max_out_epochs (ann : in fann_c.fann.Pointer; cascade_max_out_epochs : in interfaces.c.unsigned); function fann_get_cascade_min_out_epochs (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_set_cascade_min_out_epochs (ann : in fann_c.fann.Pointer; cascade_min_out_epochs : in interfaces.c.unsigned); function fann_get_cascade_max_cand_epochs (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_set_cascade_max_cand_epochs (ann : in fann_c.fann.Pointer; cascade_max_cand_epochs : in interfaces.c.unsigned); function fann_get_cascade_min_cand_epochs (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_set_cascade_min_cand_epochs (ann : in fann_c.fann.Pointer; cascade_min_cand_epochs : in interfaces.c.unsigned); function fann_get_cascade_num_candidates (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; function fann_get_cascade_activation_functions_count (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; function fann_get_cascade_activation_functions (ann : in fann_c.fann.Pointer) return fann_c.Pointers.fann_activationfunc_enum_Pointer; procedure fann_set_cascade_activation_functions (ann : in fann_c.fann.Pointer; cascade_activation_functions : in fann_c.Pointers.fann_activationfunc_enum_Pointer; cascade_activation_functions_count : in interfaces.c.unsigned); function fann_get_cascade_activation_steepnesses_count (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; function fann_get_cascade_activation_steepnesses (ann : in fann_c.fann.Pointer) return fann_c.Pointers.fann_type_Pointer; procedure fann_set_cascade_activation_steepnesses (ann : in fann_c.fann.Pointer; cascade_activation_steepnesses : in fann_c.Pointers.fann_type_Pointer; cascade_activation_steepnesses_count : in interfaces.c.unsigned); function fann_get_cascade_num_candidate_groups (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_set_cascade_num_candidate_groups (ann : in fann_c.fann.Pointer; cascade_num_candidate_groups : in interfaces.c.unsigned); function fann_create_from_file (configuration_file : in interfaces.c.strings.chars_ptr) return fann_c.fann.Pointer; function fann_save (ann : in fann_c.fann.Pointer; configuration_file : in interfaces.c.strings.chars_ptr) return interfaces.c.int; function fann_save_to_fixed (ann : in fann_c.fann.Pointer; configuration_file : in interfaces.c.strings.chars_ptr) return interfaces.c.int; function fann_create_standard (num_layers : in interfaces.c.unsigned) return fann_c.fann.Pointer; function fann_create_standard_array (num_layers : in interfaces.c.unsigned; layers : in swig.pointers.unsigned_Pointer) return fann_c.fann.Pointer; function fann_create_sparse (connection_rate : in interfaces.c.c_float; num_layers : in interfaces.c.unsigned) return fann_c.fann.Pointer; function fann_create_sparse_array (connection_rate : in interfaces.c.c_float; num_layers : in interfaces.c.unsigned; layers : in swig.pointers.unsigned_Pointer) return fann_c.fann.Pointer; function fann_create_shortcut (num_layers : in interfaces.c.unsigned) return fann_c.fann.Pointer; function fann_create_shortcut_array (num_layers : in interfaces.c.unsigned; layers : in swig.pointers.unsigned_Pointer) return fann_c.fann.Pointer; procedure fann_destroy (ann : in fann_c.fann.Pointer); function fann_copy (ann : in fann_c.fann.Pointer) return fann_c.fann.Pointer; function fann_run (ann : in fann_c.fann.Pointer; input : in fann_c.Pointers.fann_type_Pointer) return fann_c.Pointers.fann_type_Pointer; procedure fann_randomize_weights (ann : in fann_c.fann.Pointer; min_weight : in fann_c.fann_type; max_weight : in fann_c.fann_type); procedure fann_init_weights (ann : in fann_c.fann.Pointer; train_data : in fann_c.fann_train_data.Pointer); procedure fann_print_connections (ann : in fann_c.fann.Pointer); procedure fann_print_parameters (ann : in fann_c.fann.Pointer); function fann_get_num_input (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; function fann_get_num_output (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; function fann_get_total_neurons (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; function fann_get_total_connections (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; function fann_get_network_type (ann : in fann_c.fann.Pointer) return fann_c.fann_nettype_enum; function fann_get_connection_rate (ann : in fann_c.fann.Pointer) return interfaces.c.c_float; function fann_get_num_layers (ann : in fann_c.fann.Pointer) return interfaces.c.unsigned; procedure fann_get_layer_array (ann : in fann_c.fann.Pointer; layers : in swig.pointers.unsigned_Pointer); procedure fann_get_bias_array (ann : in fann_c.fann.Pointer; bias : in swig.pointers.unsigned_Pointer); procedure fann_get_connection_array (ann : in fann_c.fann.Pointer; connections : in fann_c.fann_connection.Pointer); procedure fann_set_weight_array (ann : in fann_c.fann.Pointer; connections : in fann_c.fann_connection.Pointer; num_connections : in interfaces.c.unsigned); procedure fann_set_weight (ann : in fann_c.fann.Pointer; from_neuron : in interfaces.c.unsigned; to_neuron : in interfaces.c.unsigned; weight : in fann_c.fann_type); procedure fann_set_user_data (ann : in fann_c.fann.Pointer; user_data : in swig.void_ptr); function fann_get_user_data (ann : in fann_c.fann.Pointer) return swig.void_ptr; private pragma Import (C, fann_set_error_log, "fann_set_error_log"); pragma Import (C, fann_get_errno, "fann_get_errno"); pragma Import (C, fann_reset_errno, "fann_reset_errno"); pragma Import (C, fann_reset_errstr, "fann_reset_errstr"); pragma Import (C, fann_get_errstr, "fann_get_errstr"); pragma Import (C, fann_print_error, "fann_print_error"); pragma Import (C, create_train_from_callback, "create_train_from_callback"); pragma Import (C, fann_train, "fann_train"); pragma Import (C, fann_test, "fann_test"); pragma Import (C, fann_get_MSE, "fann_get_MSE"); pragma Import (C, fann_get_bit_fail, "fann_get_bit_fail"); pragma Import (C, fann_reset_MSE, "fann_reset_MSE"); pragma Import (C, fann_train_on_data, "fann_train_on_data"); pragma Import (C, fann_train_on_file, "fann_train_on_file"); pragma Import (C, fann_train_epoch, "fann_train_epoch"); pragma Import (C, fann_test_data, "fann_test_data"); pragma Import (C, fann_read_train_from_file, "fann_read_train_from_file"); pragma Import (C, fann_create_train, "fann_create_train"); pragma Import (C, fann_destroy_train, "fann_destroy_train"); pragma Import (C, fann_shuffle_train_data, "fann_shuffle_train_data"); pragma Import (C, fann_scale_train, "fann_scale_train"); pragma Import (C, fann_descale_train, "fann_descale_train"); pragma Import (C, fann_set_input_scaling_params, "fann_set_input_scaling_params"); pragma Import (C, fann_set_output_scaling_params, "fann_set_output_scaling_params"); pragma Import (C, fann_set_scaling_params, "fann_set_scaling_params"); pragma Import (C, fann_clear_scaling_params, "fann_clear_scaling_params"); pragma Import (C, fann_scale_input, "fann_scale_input"); pragma Import (C, fann_scale_output, "fann_scale_output"); pragma Import (C, fann_descale_input, "fann_descale_input"); pragma Import (C, fann_descale_output, "fann_descale_output"); pragma Import (C, fann_scale_input_train_data, "fann_scale_input_train_data"); pragma Import (C, fann_scale_output_train_data, "fann_scale_output_train_data"); pragma Import (C, fann_scale_train_data, "fann_scale_train_data"); pragma Import (C, fann_merge_train_data, "fann_merge_train_data"); pragma Import (C, fann_duplicate_train_data, "fann_duplicate_train_data"); pragma Import (C, fann_subset_train_data, "fann_subset_train_data"); pragma Import (C, fann_length_train_data, "fann_length_train_data"); pragma Import (C, fann_num_input_train_data, "fann_num_input_train_data"); pragma Import (C, fann_num_output_train_data, "fann_num_output_train_data"); pragma Import (C, fann_save_train, "fann_save_train"); pragma Import (C, fann_save_train_to_fixed, "fann_save_train_to_fixed"); pragma Import (C, fann_get_training_algorithm, "fann_get_training_algorithm"); pragma Import (C, fann_set_training_algorithm, "fann_set_training_algorithm"); pragma Import (C, fann_get_learning_rate, "fann_get_learning_rate"); pragma Import (C, fann_set_learning_rate, "fann_set_learning_rate"); pragma Import (C, fann_get_learning_momentum, "fann_get_learning_momentum"); pragma Import (C, fann_set_learning_momentum, "fann_set_learning_momentum"); pragma Import (C, fann_get_activation_function, "fann_get_activation_function"); pragma Import (C, fann_set_activation_function, "fann_set_activation_function"); pragma Import (C, fann_set_activation_function_layer, "fann_set_activation_function_layer"); pragma Import (C, fann_set_activation_function_hidden, "fann_set_activation_function_hidden"); pragma Import (C, fann_set_activation_function_output, "fann_set_activation_function_output"); pragma Import (C, fann_get_activation_steepness, "fann_get_activation_steepness"); pragma Import (C, fann_set_activation_steepness, "fann_set_activation_steepness"); pragma Import (C, fann_set_activation_steepness_layer, "fann_set_activation_steepness_layer"); pragma Import (C, fann_set_activation_steepness_hidden, "fann_set_activation_steepness_hidden"); pragma Import (C, fann_set_activation_steepness_output, "fann_set_activation_steepness_output"); pragma Import (C, fann_get_train_error_function, "fann_get_train_error_function"); pragma Import (C, fann_set_train_error_function, "fann_set_train_error_function"); pragma Import (C, fann_get_train_stop_function, "fann_get_train_stop_function"); pragma Import (C, fann_set_train_stop_function, "fann_set_train_stop_function"); pragma Import (C, fann_get_bit_fail_limit, "fann_get_bit_fail_limit"); pragma Import (C, fann_set_bit_fail_limit, "fann_set_bit_fail_limit"); pragma Import (C, fann_set_callback, "fann_set_callback"); pragma Import (C, fann_get_quickprop_decay, "fann_get_quickprop_decay"); pragma Import (C, fann_set_quickprop_decay, "fann_set_quickprop_decay"); pragma Import (C, fann_get_quickprop_mu, "fann_get_quickprop_mu"); pragma Import (C, fann_set_quickprop_mu, "fann_set_quickprop_mu"); pragma Import (C, fann_get_rprop_increase_factor, "fann_get_rprop_increase_factor"); pragma Import (C, fann_set_rprop_increase_factor, "fann_set_rprop_increase_factor"); pragma Import (C, fann_get_rprop_decrease_factor, "fann_get_rprop_decrease_factor"); pragma Import (C, fann_set_rprop_decrease_factor, "fann_set_rprop_decrease_factor"); pragma Import (C, fann_get_rprop_delta_min, "fann_get_rprop_delta_min"); pragma Import (C, fann_set_rprop_delta_min, "fann_set_rprop_delta_min"); pragma Import (C, fann_get_rprop_delta_max, "fann_get_rprop_delta_max"); pragma Import (C, fann_set_rprop_delta_max, "fann_set_rprop_delta_max"); pragma Import (C, fann_get_rprop_delta_zero, "fann_get_rprop_delta_zero"); pragma Import (C, fann_set_rprop_delta_zero, "fann_set_rprop_delta_zero"); pragma Import (C, fann_get_sarprop_weight_decay_shift, "fann_get_sarprop_weight_decay_shift"); pragma Import (C, fann_set_sarprop_weight_decay_shift, "fann_set_sarprop_weight_decay_shift"); pragma Import (C, fann_get_sarprop_step_error_threshold_factor, "fann_get_sarprop_step_error_threshold_factor"); pragma Import (C, fann_set_sarprop_step_error_threshold_factor, "fann_set_sarprop_step_error_threshold_factor"); pragma Import (C, fann_get_sarprop_step_error_shift, "fann_get_sarprop_step_error_shift"); pragma Import (C, fann_set_sarprop_step_error_shift, "fann_set_sarprop_step_error_shift"); pragma Import (C, fann_get_sarprop_temperature, "fann_get_sarprop_temperature"); pragma Import (C, fann_set_sarprop_temperature, "fann_set_sarprop_temperature"); pragma Import (C, fann_cascadetrain_on_data, "fann_cascadetrain_on_data"); pragma Import (C, fann_cascadetrain_on_file, "fann_cascadetrain_on_file"); pragma Import (C, fann_get_cascade_output_change_fraction, "fann_get_cascade_output_change_fraction"); pragma Import (C, fann_set_cascade_output_change_fraction, "fann_set_cascade_output_change_fraction"); pragma Import (C, fann_get_cascade_output_stagnation_epochs, "fann_get_cascade_output_stagnation_epochs"); pragma Import (C, fann_set_cascade_output_stagnation_epochs, "fann_set_cascade_output_stagnation_epochs"); pragma Import (C, fann_get_cascade_candidate_change_fraction, "fann_get_cascade_candidate_change_fraction"); pragma Import (C, fann_set_cascade_candidate_change_fraction, "fann_set_cascade_candidate_change_fraction"); pragma Import (C, fann_get_cascade_candidate_stagnation_epochs, "fann_get_cascade_candidate_stagnation_epochs"); pragma Import (C, fann_set_cascade_candidate_stagnation_epochs, "fann_set_cascade_candidate_stagnation_epochs"); pragma Import (C, fann_get_cascade_weight_multiplier, "fann_get_cascade_weight_multiplier"); pragma Import (C, fann_set_cascade_weight_multiplier, "fann_set_cascade_weight_multiplier"); pragma Import (C, fann_get_cascade_candidate_limit, "fann_get_cascade_candidate_limit"); pragma Import (C, fann_set_cascade_candidate_limit, "fann_set_cascade_candidate_limit"); pragma Import (C, fann_get_cascade_max_out_epochs, "fann_get_cascade_max_out_epochs"); pragma Import (C, fann_set_cascade_max_out_epochs, "fann_set_cascade_max_out_epochs"); pragma Import (C, fann_get_cascade_min_out_epochs, "fann_get_cascade_min_out_epochs"); pragma Import (C, fann_set_cascade_min_out_epochs, "fann_set_cascade_min_out_epochs"); pragma Import (C, fann_get_cascade_max_cand_epochs, "fann_get_cascade_max_cand_epochs"); pragma Import (C, fann_set_cascade_max_cand_epochs, "fann_set_cascade_max_cand_epochs"); pragma Import (C, fann_get_cascade_min_cand_epochs, "fann_get_cascade_min_cand_epochs"); pragma Import (C, fann_set_cascade_min_cand_epochs, "fann_set_cascade_min_cand_epochs"); pragma Import (C, fann_get_cascade_num_candidates, "fann_get_cascade_num_candidates"); pragma Import (C, fann_get_cascade_activation_functions_count, "fann_get_cascade_activation_functions_count"); pragma Import (C, fann_get_cascade_activation_functions, "fann_get_cascade_activation_functions"); pragma Import (C, fann_set_cascade_activation_functions, "fann_set_cascade_activation_functions"); pragma Import (C, fann_get_cascade_activation_steepnesses_count, "fann_get_cascade_activation_steepnesses_count"); pragma Import (C, fann_get_cascade_activation_steepnesses, "fann_get_cascade_activation_steepnesses"); pragma Import (C, fann_set_cascade_activation_steepnesses, "fann_set_cascade_activation_steepnesses"); pragma Import (C, fann_get_cascade_num_candidate_groups, "fann_get_cascade_num_candidate_groups"); pragma Import (C, fann_set_cascade_num_candidate_groups, "fann_set_cascade_num_candidate_groups"); pragma Import (C, fann_create_from_file, "fann_create_from_file"); pragma Import (C, fann_save, "fann_save"); pragma Import (C, fann_save_to_fixed, "fann_save_to_fixed"); pragma Import (C, fann_create_standard, "fann_create_standard"); pragma Import (C, fann_create_standard_array, "fann_create_standard_array"); pragma Import (C, fann_create_sparse, "fann_create_sparse"); pragma Import (C, fann_create_sparse_array, "fann_create_sparse_array"); pragma Import (C, fann_create_shortcut, "fann_create_shortcut"); pragma Import (C, fann_create_shortcut_array, "fann_create_shortcut_array"); pragma Import (C, fann_destroy, "fann_destroy"); pragma Import (C, fann_copy, "fann_copy"); pragma Import (C, fann_run, "fann_run"); pragma Import (C, fann_randomize_weights, "fann_randomize_weights"); pragma Import (C, fann_init_weights, "fann_init_weights"); pragma Import (C, fann_print_connections, "fann_print_connections"); pragma Import (C, fann_print_parameters, "fann_print_parameters"); pragma Import (C, fann_get_num_input, "fann_get_num_input"); pragma Import (C, fann_get_num_output, "fann_get_num_output"); pragma Import (C, fann_get_total_neurons, "fann_get_total_neurons"); pragma Import (C, fann_get_total_connections, "fann_get_total_connections"); pragma Import (C, fann_get_network_type, "fann_get_network_type"); pragma Import (C, fann_get_connection_rate, "fann_get_connection_rate"); pragma Import (C, fann_get_num_layers, "fann_get_num_layers"); pragma Import (C, fann_get_layer_array, "fann_get_layer_array"); pragma Import (C, fann_get_bias_array, "fann_get_bias_array"); pragma Import (C, fann_get_connection_array, "fann_get_connection_array"); pragma Import (C, fann_set_weight_array, "fann_set_weight_array"); pragma Import (C, fann_set_weight, "fann_set_weight"); pragma Import (C, fann_set_user_data, "fann_set_user_data"); pragma Import (C, fann_get_user_data, "fann_get_user_data"); end fann_c.Binding;
reznikmm/matreshka
Ada
3,724
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_Opacity_Name_Attributes is pragma Preelaborate; type ODF_Draw_Opacity_Name_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Draw_Opacity_Name_Attribute_Access is access all ODF_Draw_Opacity_Name_Attribute'Class with Storage_Size => 0; end ODF.DOM.Draw_Opacity_Name_Attributes;
zhmu/ananas
Ada
15,566
adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . D Y N A M I C _ T A B L E S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2000-2022, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with GNAT.Heap_Sort_G; with Ada.Unchecked_Deallocation; with System; package body GNAT.Dynamic_Tables is ----------------------- -- Local Subprograms -- ----------------------- function Last_Allocated (T : Instance) return Table_Last_Type; pragma Inline (Last_Allocated); -- Return the index of the last allocated element procedure Grow (T : in out Instance; New_Last : Table_Last_Type); -- This is called when we are about to set the value of Last to a value -- that is larger than Last_Allocated. This reallocates the table to the -- larger size, as indicated by New_Last. At the time this is called, -- Last (T) is still the old value, and this does not modify it. -------------- -- Allocate -- -------------- procedure Allocate (T : in out Instance; Num : Integer := 1) is begin -- Note that Num can be negative pragma Assert (not T.Locked); Set_Last (T, Last (T) + Table_Index_Type'Base (Num)); end Allocate; ------------ -- Append -- ------------ procedure Append (T : in out Instance; New_Val : Table_Component_Type) is pragma Assert (not T.Locked); New_Last : constant Table_Last_Type := Last (T) + 1; begin if New_Last <= Last_Allocated (T) then -- Fast path T.P.Last := New_Last; T.Table (New_Last) := New_Val; else Set_Item (T, New_Last, New_Val); end if; end Append; ---------------- -- Append_All -- ---------------- procedure Append_All (T : in out Instance; New_Vals : Table_Type) is begin for J in New_Vals'Range loop Append (T, New_Vals (J)); end loop; end Append_All; -------------------- -- Decrement_Last -- -------------------- procedure Decrement_Last (T : in out Instance) is begin pragma Assert (not T.Locked); Allocate (T, -1); end Decrement_Last; ----------- -- First -- ----------- function First return Table_Index_Type is begin return Table_Low_Bound; end First; -------------- -- For_Each -- -------------- procedure For_Each (Table : Instance) is Quit : Boolean := False; begin for Index in First .. Last (Table) loop Action (Index, Table.Table (Index), Quit); exit when Quit; end loop; end For_Each; ---------- -- Grow -- ---------- procedure Grow (T : in out Instance; New_Last : Table_Last_Type) is -- Note: Type Alloc_Ptr below needs to be declared locally so we know -- the bounds. That means that the collection is local, so is finalized -- when leaving Grow. That's why this package doesn't support controlled -- types; the table elements would be finalized prematurely. An Ada -- implementation would also be within its rights to reclaim the -- storage. Fortunately, GNAT doesn't do that. pragma Assert (not T.Locked); pragma Assert (New_Last > Last_Allocated (T)); subtype Table_Length_Type is Table_Index_Type'Base range 0 .. Table_Index_Type'Base'Last; Old_Last_Allocated : constant Table_Last_Type := Last_Allocated (T); Old_Allocated_Length : constant Table_Length_Type := Old_Last_Allocated - First + 1; New_Length : constant Table_Length_Type := New_Last - First + 1; New_Allocated_Length : Table_Length_Type; begin if T.Table = Empty_Table_Ptr then New_Allocated_Length := Table_Length_Type (Table_Initial); else New_Allocated_Length := Table_Length_Type (Long_Long_Integer (Old_Allocated_Length) * (100 + Long_Long_Integer (Table_Increment)) / 100); end if; -- Make sure it really did grow if New_Allocated_Length <= Old_Allocated_Length then New_Allocated_Length := Old_Allocated_Length + 10; end if; if New_Allocated_Length <= New_Length then New_Allocated_Length := New_Length + 10; end if; pragma Assert (New_Allocated_Length > Old_Allocated_Length); pragma Assert (New_Allocated_Length > New_Length); T.P.Last_Allocated := First + New_Allocated_Length - 1; declare subtype Old_Alloc_Type is Table_Type (First .. Old_Last_Allocated); type Old_Alloc_Ptr is access all Old_Alloc_Type; procedure Free is new Ada.Unchecked_Deallocation (Old_Alloc_Type, Old_Alloc_Ptr); function To_Old_Alloc_Ptr is new Ada.Unchecked_Conversion (Table_Ptr, Old_Alloc_Ptr); subtype Alloc_Type is Table_Type (First .. First + New_Allocated_Length - 1); type Alloc_Ptr is access all Alloc_Type; function To_Table_Ptr is new Ada.Unchecked_Conversion (Alloc_Ptr, Table_Ptr); Old_Table : Old_Alloc_Ptr := To_Old_Alloc_Ptr (T.Table); New_Table : constant Alloc_Ptr := new Alloc_Type; begin if T.Table /= Empty_Table_Ptr then New_Table (First .. Last (T)) := Old_Table (First .. Last (T)); Free (Old_Table); end if; T.Table := To_Table_Ptr (New_Table); end; pragma Assert (New_Last <= Last_Allocated (T)); pragma Assert (T.Table /= null); pragma Assert (T.Table /= Empty_Table_Ptr); end Grow; -------------------- -- Increment_Last -- -------------------- procedure Increment_Last (T : in out Instance) is begin pragma Assert (not T.Locked); Allocate (T, 1); end Increment_Last; ---------- -- Init -- ---------- procedure Init (T : in out Instance) is pragma Assert (not T.Locked); subtype Alloc_Type is Table_Type (First .. Last_Allocated (T)); type Alloc_Ptr is access all Alloc_Type; procedure Free is new Ada.Unchecked_Deallocation (Alloc_Type, Alloc_Ptr); function To_Alloc_Ptr is new Ada.Unchecked_Conversion (Table_Ptr, Alloc_Ptr); Temp : Alloc_Ptr := To_Alloc_Ptr (T.Table); begin if T.Table = Empty_Table_Ptr then pragma Assert (T.P = (Last_Allocated | Last => First - 1)); null; else Free (Temp); T.Table := Empty_Table_Ptr; T.P := (Last_Allocated | Last => First - 1); end if; end Init; -------------- -- Is_Empty -- -------------- function Is_Empty (T : Instance) return Boolean is begin return Last (T) = First - 1; end Is_Empty; ---------- -- Last -- ---------- function Last (T : Instance) return Table_Last_Type is begin return T.P.Last; end Last; -------------------- -- Last_Allocated -- -------------------- function Last_Allocated (T : Instance) return Table_Last_Type is begin return T.P.Last_Allocated; end Last_Allocated; ---------- -- Move -- ---------- procedure Move (From, To : in out Instance) is begin pragma Assert (not From.Locked); pragma Assert (not To.Locked); pragma Assert (Is_Empty (To)); To := From; From.Table := Empty_Table_Ptr; From.Locked := False; From.P.Last_Allocated := First - 1; From.P.Last := First - 1; pragma Assert (Is_Empty (From)); end Move; ------------- -- Release -- ------------- procedure Release (T : in out Instance) is pragma Assert (not T.Locked); Old_Last_Allocated : constant Table_Last_Type := Last_Allocated (T); function New_Last_Allocated return Table_Last_Type; -- Compute the new value of Last_Allocated. This is normally equal to -- Last, but if Release_Threshold /= 0, then we need to take that into -- account. ------------------------ -- New_Last_Allocated -- ------------------------ function New_Last_Allocated return Table_Last_Type is subtype Table_Length_Type is Table_Index_Type'Base range 0 .. Table_Index_Type'Base'Last; Length : constant Table_Length_Type := Last (T) - First + 1; Comp_Size_In_Bytes : constant Table_Length_Type := Table_Type'Component_Size / System.Storage_Unit; Length_Threshold : constant Table_Length_Type := Table_Length_Type (Release_Threshold) / Comp_Size_In_Bytes; begin if Release_Threshold = 0 or else Length < Length_Threshold then return Last (T); else declare Extra_Length : constant Table_Length_Type := Length / 1000; begin return (Length + Extra_Length) - 1 + First; end; end if; end New_Last_Allocated; -- Local variables New_Last_Alloc : constant Table_Last_Type := New_Last_Allocated; -- Start of processing for Release begin if New_Last_Alloc < Last_Allocated (T) then pragma Assert (Last (T) < Last_Allocated (T)); pragma Assert (T.Table /= Empty_Table_Ptr); declare subtype Old_Alloc_Type is Table_Type (First .. Old_Last_Allocated); type Old_Alloc_Ptr is access all Old_Alloc_Type; procedure Free is new Ada.Unchecked_Deallocation (Old_Alloc_Type, Old_Alloc_Ptr); function To_Old_Alloc_Ptr is new Ada.Unchecked_Conversion (Table_Ptr, Old_Alloc_Ptr); subtype Alloc_Type is Table_Type (First .. New_Last_Alloc); type Alloc_Ptr is access all Alloc_Type; function To_Table_Ptr is new Ada.Unchecked_Conversion (Alloc_Ptr, Table_Ptr); Old_Table : Old_Alloc_Ptr := To_Old_Alloc_Ptr (T.Table); New_Table : constant Alloc_Ptr := new Alloc_Type; begin New_Table (First .. Last (T)) := Old_Table (First .. Last (T)); T.P.Last_Allocated := New_Last_Alloc; Free (Old_Table); T.Table := To_Table_Ptr (New_Table); end; end if; end Release; -------------- -- Set_Item -- -------------- procedure Set_Item (T : in out Instance; Index : Valid_Table_Index_Type; Item : Table_Component_Type) is begin pragma Assert (not T.Locked); -- If Set_Last is going to reallocate the table, we make a copy of Item, -- in case the call was "Set_Item (T, X, T.Table (Y));", and Item is -- passed by reference. Without the copy, we would deallocate the array -- containing Item, leaving a dangling pointer. if Index > Last_Allocated (T) then declare Item_Copy : constant Table_Component_Type := Item; begin Set_Last (T, Index); T.Table (Index) := Item_Copy; end; else if Index > Last (T) then Set_Last (T, Index); end if; T.Table (Index) := Item; end if; end Set_Item; -------------- -- Set_Last -- -------------- procedure Set_Last (T : in out Instance; New_Val : Table_Last_Type) is begin pragma Assert (not T.Locked); if New_Val > Last_Allocated (T) then Grow (T, New_Val); end if; T.P.Last := New_Val; end Set_Last; ---------------- -- Sort_Table -- ---------------- procedure Sort_Table (Table : in out Instance) is Temp : Table_Component_Type; -- A temporary position to simulate index 0 -- Local subprograms function Index_Of (Idx : Natural) return Table_Index_Type'Base; -- Return index of Idx'th element of table function Lower_Than (Op1, Op2 : Natural) return Boolean; -- Compare two components procedure Move (From : Natural; To : Natural); -- Move one component package Heap_Sort is new GNAT.Heap_Sort_G (Move, Lower_Than); -------------- -- Index_Of -- -------------- function Index_Of (Idx : Natural) return Table_Index_Type'Base is J : constant Integer'Base := Table_Index_Type'Base'Pos (First) + Idx - 1; begin return Table_Index_Type'Base'Val (J); end Index_Of; ---------- -- Move -- ---------- procedure Move (From : Natural; To : Natural) is begin if From = 0 then Table.Table (Index_Of (To)) := Temp; elsif To = 0 then Temp := Table.Table (Index_Of (From)); else Table.Table (Index_Of (To)) := Table.Table (Index_Of (From)); end if; end Move; ---------------- -- Lower_Than -- ---------------- function Lower_Than (Op1, Op2 : Natural) return Boolean is begin if Op1 = 0 then return Lt (Temp, Table.Table (Index_Of (Op2))); elsif Op2 = 0 then return Lt (Table.Table (Index_Of (Op1)), Temp); else return Lt (Table.Table (Index_Of (Op1)), Table.Table (Index_Of (Op2))); end if; end Lower_Than; -- Start of processing for Sort_Table begin Heap_Sort.Sort (Natural (Last (Table) - First) + 1); end Sort_Table; end GNAT.Dynamic_Tables;
reznikmm/matreshka
Ada
4,889
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Tools Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2015, 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 test detects parameters to link with SQLite3 library. -- -- It sets following substitutions variables: -- - HAS_SQLITE3 -- - SQLITE3_LIBRARY_OPTIONS ------------------------------------------------------------------------------ with Configure.Abstract_Tests; private with Configure.Component_Switches; with Configure.Tests.Operating_System; package Configure.Tests.SQLite3 is type SQLite3_Test (Operating_System_Test : not null access Configure.Tests.Operating_System.Operating_System_Test'Class) is new Configure.Abstract_Tests.Abstract_Test with private; overriding function Name (Self : SQLite3_Test) return String; -- Returns name of the test to be used in reports. overriding function Help (Self : SQLite3_Test) return Unbounded_String_Vector; -- Returns help information for test. overriding procedure Execute (Self : in out SQLite3_Test; Arguments : in out Unbounded_String_Vector); -- Executes test's actions. All used arguments must be removed from -- Arguments. private type SQLite3_Test (Operating_System_Test : not null access Configure.Tests.Operating_System.Operating_System_Test'Class) is new Configure.Abstract_Tests.Abstract_Test with record Switches : Configure.Component_Switches.Component_Switches := Configure.Component_Switches.Create (Name => "sqlite3", Description => "SQLite3 support", Libdir_Enabled => True); end record; end Configure.Tests.SQLite3;
AdaCore/libadalang
Ada
118
adb
package Test is type Type_T is tagged null record; procedure Bar (T: Type_T) with Post'Class => True; end Test;
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.Attributes; package ODF.DOM.Style_Color_Attributes is pragma Preelaborate; type ODF_Style_Color_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Style_Color_Attribute_Access is access all ODF_Style_Color_Attribute'Class with Storage_Size => 0; end ODF.DOM.Style_Color_Attributes;
reznikmm/matreshka
Ada
5,405
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. ------------------------------------------------------------------------------ -- The implementation of a class in some programming language (e.g., C++, -- Smalltalk, Java) in which an instance may not have more than one class. -- This is in contrast to Class, for which an instance may have multiple -- classes at one time and may gain or lose classes over time, and an object -- (a child of instance) may dynamically have multiple classes. An -- Implementation class is said to realize a Classifier if it provides all of -- the operations defined for the Classifier with the same behavior as -- specified for the Classifier's operations. An Implementation Class may -- realize a number of different Types. Note that the physical attributes and -- associations of the Implementation class do not have to be the same as -- those of any Classifier it realizes and that the Implementation Class may -- provide methods for its operations in terms of its physical attributes and -- associations. See also: «Type». ------------------------------------------------------------------------------ limited with AMF.UML.Classes; package AMF.Standard_Profile_L2.Implementation_Classes is pragma Preelaborate; type Standard_Profile_L2_Implementation_Class is limited interface; type Standard_Profile_L2_Implementation_Class_Access is access all Standard_Profile_L2_Implementation_Class'Class; for Standard_Profile_L2_Implementation_Class_Access'Storage_Size use 0; not overriding function Get_Base_Class (Self : not null access constant Standard_Profile_L2_Implementation_Class) return AMF.UML.Classes.UML_Class_Access is abstract; -- Getter of ImplementationClass::base_Class. -- not overriding procedure Set_Base_Class (Self : not null access Standard_Profile_L2_Implementation_Class; To : AMF.UML.Classes.UML_Class_Access) is abstract; -- Setter of ImplementationClass::base_Class. -- end AMF.Standard_Profile_L2.Implementation_Classes;
annexi-strayline/AURA
Ada
9,230
adb
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- ANNEXI-STRAYLINE Reference Implementation -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2023, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with Ada.Directories; with Ada.Exceptions; with Ada.Containers.Vectors; with Ada.Strings.Unbounded; with Registrar.Source_Files; with Registrar.Registration.Unchecked_Deregister_Unit; separate (Depreciation_Handlers.AURA_Subdirectory) procedure Process_Changes is -- This procedure is invoked when we -- 1. Do have aura subsystem library units in the project root; and, -- 2. Have the go-ahead from the user to act use Ada.Directories; use Registrar.Library_Units; use CLI; use UI_Primitives; use type Registrar.Source_Files.Source_File_Access; package LUKO renames Registrar.Library_Units.Library_Unit_Sets_Keyed_Operations; type Move_Registration is record From, To: Ada.Strings.Unbounded.Unbounded_String; end record; package Move_Registration_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Move_Registration); Move_Registrations: Move_Registration_Vectors.Vector; AURA_Subsys: constant Registrar.Subsystems.Subsystem := Registrar.Queries.Lookup_Subsystem (AURA_Subsystem_Name); AURA_Units: Library_Unit_Sets.Set := Registrar.Queries.Subsystem_Library_Units (AURA_Subsys); AURA_Target_Directory: constant String := Compose (Containing_Directory => Current_Directory, Name => "aura"); procedure Bad_Unit_Notice (Unit : Library_Unit; Message: String) is begin Put_Fail_Tag; Put_Line (" Bad AURA Unit: " & Unit.Name.TO_UTF8_String); Put_Empty_Tag; Put_Line (' ' & Message); end; procedure Register_Move (Source: not null Registrar.Source_Files.Source_File_Access) is use Ada.Strings.Unbounded; use Registrar.Source_Files; Source_Full_Name: constant String := Source.Full_Name; Target_Full_Name: constant String := Compose (Containing_Directory => AURA_Target_Directory, Name => Simple_Name (Source_Full_Name)); begin Move_Registrations.Append ((From => To_Unbounded_String (Source_Full_Name), To => To_Unbounded_String (Target_Full_Name))); end Register_Move; procedure Execute_Move (Registration: Move_Registration) is use Ada.Strings.Unbounded; Source_Full_Name: constant String := To_String (Registration.From); begin Rename (Old_Name => Source_Full_Name, New_Name => To_String (Registration.To)); exception when e: others => OK_To_Proceed := False; Put_Fail_Tag; Put_Line (" Unable to move " & Simple_Name (Source_Full_Name)); Put_Empty_Tag; Put_Line (' ' & Ada.Exceptions.Exception_Information (e)); end Execute_Move; begin OK_To_Proceed := False; if Exists (AURA_Target_Directory) then if Kind (AURA_Target_Directory) /= Directory then Put_Fail_Tag; Put_Line (" File named 'aura' exists in the project root and is not " & "a directory."); Put_Empty_Tag; Put_Line (" Remove that file and try again."); return; else Put_Warn_Tag; Put_Line (" 'aura' directory already exists in project root."); Put_Empty_Tag; Put_Line (" you will be prompted to overwrite files if needed."); end if; else Create_Directory (AURA_Target_Directory); Put_Info_Tag; Put_Line (" created 'aura' directory in project root to contain all " & "aura subsystem files."); end if; -- Note that all units registered to the aura subsystem have gone through -- all the checks of normal unit regisration, which includes special checks -- just for members of the AURA subsystem, and implies that either Spec_File -- and/or Body_File are non-null -- Before we can move a file, we need to delink the source file associated -- with it, or we can cause an exception when a checkout is attempted during -- Unchecked_Deregister_Unit process. Unit_Loop: for Unit of AURA_Units loop if Unit.Spec_File /= null then Register_Move (Unit.Spec_File); end if; if Unit.Body_File /= null then Register_Move (Unit.Body_File); end if; for Subunit of Unit.Subunit_Bodies loop -- If any of these are null, that would be a program error Register_Move (Subunit); end loop; end loop Unit_Loop; -- With all file moves registered, we can Deregister all registered AURA -- units before proceeding with the actual file move for C in AURA_Units.Iterate loop if AURA_Units(C).State = Available then LUKO.Update_Element_Preserving_Key (Container => AURA_Units, Position => C, Process => Registrar.Registration .Unchecked_Deregister_Unit'Access); end if; end loop; -- Finally attempt to move as many (hopefully all) of the files as possible. OK_To_Proceed := True; for Registration of Move_Registrations loop Execute_Move (Registration); end loop; if OK_To_Proceed then Put_OK_Tag; Put_Line (Ada.Containers.Count_Type'Image (Move_Registrations.Length) & " AURA subsystem files relocated to the 'aura' " & "subdirectory."); else Put_Fail_Tag; Put_Line (" AURA subsystem relocation failed or incomplete."); Put_Empty_Tag; Put_Line (" Please try again after correcting the above errors, or else"); Put_Empty_Tag; Put_Line (" manually relocate all AURA subsystem units to the 'aura'"); Put_Empty_Tag; Put_Line (" subdirectory, and then re-run AURA."); end if; end Process_Changes;
gabemgem/LITEC
Ada
13,646
adb
M:LAB3RANGER F:G$SYSCLK_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$UART0_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$Sys_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$putchar$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$getchar$0$0({2}DF,SC:U),C,0,0,0,0,0 F:G$getchar_nw$0$0({2}DF,SC:U),C,0,0,0,0,0 F:G$lcd_print$0$0({2}DF,SV:S),Z,0,0,0,0,0 S:LLAB3RANGER.lcd_print$fmt$1$80({3}DG,SC:U),B,1,-5 S:LLAB3RANGER.lcd_print$len$1$81({1}SC:U),R,0,0,[r6] S:LLAB3RANGER.lcd_print$i$1$81({1}SC:U),R,0,0,[] S:LLAB3RANGER.lcd_print$ap$1$81({1}DD,SC:U),R,0,0,[] F:G$lcd_clear$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$read_keypad$0$0({2}DF,SC:U),C,0,0,0,0,0 F:G$kpd_input$0$0({2}DF,SI:U),Z,0,0,0,0,0 F:G$delay_time$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_start$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_write$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_write_and_stop$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_read$0$0({2}DF,SC:U),Z,0,0,0,0,0 F:G$i2c_read_and_stop$0$0({2}DF,SC:U),Z,0,0,0,0,0 F:G$i2c_write_data$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_read_data$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$Accel_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$Accel_Init_C$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$main$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$Ranger$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$ReadRanger$0$0({2}DF,SI:U),Z,0,0,0,0,0 F:G$Port_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$Interrupt_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$XBR0_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$SMBUS_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$PCA_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$PCA_ISR$0$0({2}DF,SV:S),C,0,0,1,9,0 S:LLAB3RANGER.getchar$c$1$10({1}SC:U),R,0,0,[] S:LLAB3RANGER.getchar_nw$c$1$12({1}SC:U),R,0,0,[] S:G$Data2$0$0({3}DA3d,SC:U),E,0,0 S:LLAB3RANGER.aligned_alloc$size$1$39({2}SI:U),E,0,0 S:LLAB3RANGER.aligned_alloc$alignment$1$39({2}SI:U),E,0,0 S:LLAB3RANGER.lcd_clear$NumBytes$1$85({1}SC:U),E,0,0 S:LLAB3RANGER.lcd_clear$Cmd$1$85({2}DA2d,SC:U),E,0,0 S:LLAB3RANGER.read_keypad$i$1$86({1}SC:U),R,0,0,[r7] S:LLAB3RANGER.read_keypad$Data$1$86({2}DA2d,SC:U),E,0,0 S:LLAB3RANGER.kpd_input$mode$1$88({1}SC:U),R,0,0,[r7] S:LLAB3RANGER.kpd_input$sum$1$89({2}SI:U),R,0,0,[r5,r6] S:LLAB3RANGER.kpd_input$key$1$89({1}SC:U),R,0,0,[r3] S:LLAB3RANGER.kpd_input$i$1$89({1}SC:U),R,0,0,[] S:LLAB3RANGER.i2c_write_data$start_reg$1$105({1}SC:U),E,0,0 S:LLAB3RANGER.i2c_write_data$buffer$1$105({3}DG,SC:U),E,0,0 S:LLAB3RANGER.i2c_write_data$num_bytes$1$105({1}SC:U),E,0,0 S:LLAB3RANGER.i2c_write_data$addr$1$105({1}SC:U),R,0,0,[r7] S:LLAB3RANGER.i2c_write_data$i$1$106({1}SC:U),R,0,0,[] S:LLAB3RANGER.i2c_read_data$start_reg$1$107({1}SC:U),E,0,0 S:LLAB3RANGER.i2c_read_data$buffer$1$107({3}DG,SC:U),E,0,0 S:LLAB3RANGER.i2c_read_data$num_bytes$1$107({1}SC:U),E,0,0 S:LLAB3RANGER.i2c_read_data$addr$1$107({1}SC:U),R,0,0,[r7] S:LLAB3RANGER.i2c_read_data$j$1$108({1}SC:U),R,0,0,[] S:G$PCA_Start$0$0({2}SI:U),E,0,0 S:G$count$0$0({2}SI:U),E,0,0 S:G$read_count$0$0({2}SI:U),E,0,0 S:G$Data$0$0({2}DA2d,SC:U),E,0,0 S:LLAB3RANGER.Ranger$read_result$1$124({2}SI:U),R,0,0,[r6,r7] S:LLAB3RANGER.ReadRanger$Data$1$127({2}DA2d,SC:U),E,0,0 S:LLAB3RANGER.ReadRanger$range$1$127({2}SI:U),R,0,0,[] S:LLAB3RANGER.ReadRanger$addr$1$127({1}SC:U),R,0,0,[] S:LLAB3RANGER.lcd_print$text$1$81({80}DA80d,SC:U),F,0,0 S:G$P0$0$0({1}SC:U),I,0,0 S:G$SP$0$0({1}SC:U),I,0,0 S:G$DPL$0$0({1}SC:U),I,0,0 S:G$DPH$0$0({1}SC:U),I,0,0 S:G$P4$0$0({1}SC:U),I,0,0 S:G$P5$0$0({1}SC:U),I,0,0 S:G$P6$0$0({1}SC:U),I,0,0 S:G$PCON$0$0({1}SC:U),I,0,0 S:G$TCON$0$0({1}SC:U),I,0,0 S:G$TMOD$0$0({1}SC:U),I,0,0 S:G$TL0$0$0({1}SC:U),I,0,0 S:G$TL1$0$0({1}SC:U),I,0,0 S:G$TH0$0$0({1}SC:U),I,0,0 S:G$TH1$0$0({1}SC:U),I,0,0 S:G$CKCON$0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OE$0$0({1}SX:U),J,0,0 S:G$BUS_SCL$0$0({1}SX:U),J,0,0 S:G$SYSCLK_Init$0$0({2}DF,SV:S),C,0,0 S:G$UART0_Init$0$0({2}DF,SV:S),C,0,0 S:G$Sys_Init$0$0({2}DF,SV:S),C,0,0 S:G$getchar_nw$0$0({2}DF,SC:U),C,0,0 S:G$_print_format$0$0({2}DF,SI:S),C,0,0 S:G$printf_small$0$0({2}DF,SV:S),C,0,0 S:G$printf$0$0({2}DF,SI:S),C,0,0 S:G$vprintf$0$0({2}DF,SI:S),C,0,0 S:G$sprintf$0$0({2}DF,SI:S),C,0,0 S:G$vsprintf$0$0({2}DF,SI:S),C,0,0 S:G$puts$0$0({2}DF,SI:S),C,0,0 S:G$getchar$0$0({2}DF,SC:U),C,0,0 S:G$putchar$0$0({2}DF,SV:S),C,0,0 S:G$printf_fast$0$0({2}DF,SV:S),C,0,0 S:G$printf_fast_f$0$0({2}DF,SV:S),C,0,0 S:G$printf_tiny$0$0({2}DF,SV:S),C,0,0 S:G$atof$0$0({2}DF,SF:S),C,0,0 S:G$atoi$0$0({2}DF,SI:S),C,0,0 S:G$atol$0$0({2}DF,SL:S),C,0,0 S:G$_uitoa$0$0({2}DF,SV:S),C,0,0 S:G$_itoa$0$0({2}DF,SV:S),C,0,0 S:G$_ultoa$0$0({2}DF,SV:S),C,0,0 S:G$_ltoa$0$0({2}DF,SV:S),C,0,0 S:G$rand$0$0({2}DF,SI:S),C,0,0 S:G$srand$0$0({2}DF,SV:S),C,0,0 S:G$calloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$malloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$realloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$aligned_alloc$0$0({2}DF,DG,SV:S),C,0,0 S:G$free$0$0({2}DF,SV:S),C,0,0 S:G$abs$0$0({2}DF,SI:S),C,0,0 S:G$labs$0$0({2}DF,SL:S),C,0,0 S:G$mblen$0$0({2}DF,SI:S),C,0,0 S:G$mbtowc$0$0({2}DF,SI:S),C,0,0 S:G$wctomb$0$0({2}DF,SI:S),C,0,0 S:G$memcpy$0$0({2}DF,DG,SV:S),C,0,0 S:G$memmove$0$0({2}DF,DG,SV:S),C,0,0 S:G$strcpy$0$0({2}DF,DG,SC:U),C,0,0 S:G$strncpy$0$0({2}DF,DG,SC:U),C,0,0 S:G$strcat$0$0({2}DF,DG,SC:U),C,0,0 S:G$strncat$0$0({2}DF,DG,SC:U),C,0,0 S:G$memcmp$0$0({2}DF,SI:S),C,0,0 S:G$strcmp$0$0({2}DF,SI:S),C,0,0 S:G$strncmp$0$0({2}DF,SI:S),C,0,0 S:G$strxfrm$0$0({2}DF,SI:U),C,0,0 S:G$memchr$0$0({2}DF,DG,SV:S),C,0,0 S:G$strchr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strcspn$0$0({2}DF,SI:U),C,0,0 S:G$strpbrk$0$0({2}DF,DG,SC:U),C,0,0 S:G$strrchr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strspn$0$0({2}DF,SI:U),C,0,0 S:G$strstr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strtok$0$0({2}DF,DG,SC:U),C,0,0 S:G$memset$0$0({2}DF,DG,SV:S),C,0,0 S:G$strlen$0$0({2}DF,SI:U),C,0,0 S:G$key_test$0$0({2}DF,SV:S),C,0,0 S:G$i2c_stop_and_read$0$0({2}DF,SC:U),C,0,0 S:G$read_keypad$0$0({2}DF,SC:U),C,0,0 S:G$main$0$0({2}DF,SV:S),C,0,0 S:G$PCA_ISR$0$0({2}DF,SV:S),C,0,0 S:FLAB3RANGER$__str_0$0$0({22}DA22d,SC:S),D,0,0 S:FLAB3RANGER$__str_1$0$0({16}DA16d,SC:S),D,0,0 S:FLAB3RANGER$__str_2$0$0({3}DA3d,SC:S),D,0,0 S:FLAB3RANGER$__str_3$0$0({22}DA22d,SC:S),D,0,0 S:FLAB3RANGER$__str_4$0$0({12}DA12d,SC:S),D,0,0
reznikmm/matreshka
Ada
4,849
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_Index_Entry_Link_Start_Elements; package Matreshka.ODF_Text.Index_Entry_Link_Start_Elements is type Text_Index_Entry_Link_Start_Element_Node is new Matreshka.ODF_Text.Abstract_Text_Element_Node and ODF.DOM.Text_Index_Entry_Link_Start_Elements.ODF_Text_Index_Entry_Link_Start with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Text_Index_Entry_Link_Start_Element_Node; overriding function Get_Local_Name (Self : not null access constant Text_Index_Entry_Link_Start_Element_Node) return League.Strings.Universal_String; overriding procedure Enter_Node (Self : not null access Text_Index_Entry_Link_Start_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_Index_Entry_Link_Start_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_Index_Entry_Link_Start_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.Index_Entry_Link_Start_Elements;
msrLi/portingSources
Ada
867
adb
-- Copyright 2012-2014 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pck; use Pck; procedure Foo is I : Integer := Ident (10); -- STOP Obj : Base; begin Obj.X := I; Do_Nothing (Obj.X'Address); end Foo;
AdaCore/libadalang
Ada
24
ads
package Ext is end Ext;
reznikmm/matreshka
Ada
7,522
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014-2015, 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$ ------------------------------------------------------------------------------ -- Defines methods that all servlets must implement. -- -- A servlet is a small Java program that runs within a Web server. Servlets -- receive and respond to requests from Web clients, usually across HTTP, the -- HyperText Transfer Protocol. -- -- To implement this interface, you can write a generic servlet that extends -- javax.servlet.GenericServlet or an HTTP servlet that extends -- javax.servlet.http.HttpServlet. -- -- This interface defines methods to initialize a servlet, to service -- requests, and to remove a servlet from the server. These are known as -- life-cycle methods and are called in the following sequence: -- -- 1. The servlet is constructed, then initialized with the init method. -- 2. Any calls from clients to the service method are handled. -- 3. The servlet is taken out of service, then destroyed with the destroy -- method, then garbage collected and finalized. -- -- In addition to the life-cycle methods, this interface provides the -- getServletConfig method, which the servlet can use to get any startup -- information, and the getServletInfo method, which allows the servlet to -- return basic information about itself, such as author, version, and -- copyright. ------------------------------------------------------------------------------ with League.Strings; with Servlet.Configs; with Servlet.Requests; with Servlet.Responses; package Servlet.Servlets is pragma Preelaborate; type Servlet is limited interface; not overriding procedure Destroy (Self : in out Servlet) is null; -- Called by the servlet container to indicate to a servlet that the -- servlet is being taken out of service. This method is only called once -- all threads within the servlet's service method have exited or after a -- timeout period has passed. After the servlet container calls this -- method, it will not call the service method again on this servlet. -- -- This method gives the servlet an opportunity to clean up any resources -- that are being held (for example, memory, file handles, threads) and -- make sure that any persistent state is synchronized with the servlet's -- current state in memory. not overriding function Get_Servlet_Config (Self : Servlet) return access Standard.Servlet.Configs.Servlet_Config'Class is abstract; -- Returns a ServletConfig object, which contains initialization and -- startup parameters for this servlet. The ServletConfig object returned -- is the one passed to the init method. -- -- Implementations of this interface are responsible for storing the -- ServletConfig object so that this method can return it. The -- GenericServlet class, which implements this interface, already does -- this. not overriding function Get_Servlet_Info (Self : Servlet) return League.Strings.Universal_String is abstract; -- Returns information about the servlet, such as author, version, and -- copyright. -- -- The string that this method returns should be plain text and not markup -- of any kind (such as HTML, XML, etc.). not overriding procedure Initialize (Self : in out Servlet; Config : not null access Standard.Servlet.Configs.Servlet_Config'Class) is abstract; -- Called by the servlet container to indicate to a servlet that the -- servlet is being placed into service. -- -- The servlet container calls the init method exactly once after -- instantiating the servlet. The init method must complete successfully -- before the servlet can receive any requests. -- -- The servlet container cannot place the servlet into service if the init -- method -- -- 1. Throws a ServletException -- 2. Does not return within a time period defined by the Web server not overriding procedure Service (Self : in out Servlet; Request : Standard.Servlet.Requests.Servlet_Request'Class; Response : in out Standard.Servlet.Responses.Servlet_Response'Class) is abstract; -- Called by the servlet container to allow the servlet to respond to a -- request. end Servlet.Servlets;
VitalijBondarenko/Formatted_Output_NG
Ada
15,605
adb
------------------------------------------------------------------------------ -- -- -- Copyright (c) 2016-2022 Vitalii Bondarenko <[email protected]> -- -- -- ------------------------------------------------------------------------------ -- -- -- The MIT License (MIT) -- -- -- -- 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.Text_IO; use Ada.Text_IO; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Unchecked_Conversion; with Interfaces; use Interfaces; with System; package body Formatted_Output.Integer_Output is package Item_Type_IO is new Ada.Text_IO.Integer_IO (Item_Type'Base); use Item_Type_IO; type Neg_Number_Represent is (Sign_Magnitude, Twos_Complement); subtype Base_Type is Integer range 2 .. 16; generic type Int is range <>; type Uns is mod <>; procedure Int_To_Str (To : out String; Value : Int; Base : Base_Type; Neg_Style : Neg_Number_Represent); function Separate_Integer_Digit_Groups (Text_Value : String; Separator : String; Group_Size : Integer) return String; function Format (Value : Item_Type'Base; Initial_Width : Integer; Leading_Zero : Boolean; Base : Integer; Justification : Alignment; Force_Sign : Boolean; Base_Style : Base_Style_Kind; Digit_Groups : Digit_Grouping) return String; ---------------- -- Int_To_Str -- ---------------- procedure Int_To_Str (To : out String; Value : Int; Base : Base_Type; Neg_Style : Neg_Number_Represent) is function To_Unsigned is new Ada.Unchecked_Conversion (Int, Uns); Digit_Symbols : constant String := "0123456789ABCDEF"; Result : String (1 .. 255) := (others => ' '); Index : Natural := Result'Last; Divider : Int := 0; Quotient : Int := 0; Remainder : Int := 0; Uns_Q : Uns := 0; Uns_D : Uns := 0; Uns_R : Uns := 0; begin if Value = 0 then Result (Index) := '0'; elsif Value > 0 then Quotient := Value; Divider := Int (Base); while Quotient /= 0 loop Remainder := Quotient rem Divider; Quotient := Quotient / Divider; Result (Index) := Digit_Symbols (Natural (Remainder) + 1); Index := Index - 1; end loop; Index := Index + 1; else case Neg_Style is when Sign_Magnitude => Uns_Q := To_Unsigned (abs (Value + 1)) + 1; when Twos_Complement => Uns_Q := To_Unsigned (Value); end case; Uns_D := To_Unsigned (Int (Base)); while Uns_Q /= 0 loop Uns_R := Uns_Q rem Uns_D; Uns_Q := Uns_Q / Uns_D; Result (Index) := Digit_Symbols (Natural (Uns_R) + 1); Index := Index - 1; end loop; if Neg_Style = Sign_Magnitude then Result (Index) := '-'; else Index := Index + 1; end if; end if; if Result'Last - Index + 1 > To'Length then raise Layout_Error; else To (To'First .. To'Last - (Result'Length - Index)) := (others => ' '); To (To'Last - (Result'Length - Index) .. To'Last) := Result (Index .. Result'Last); end if; end Int_To_Str; ------------------ -- Int_xx_To_Str -- ------------------ procedure Int_8_To_Str is new Int_To_Str (Integer_8, Unsigned_8); procedure Int_16_To_Str is new Int_To_Str (Integer_16, Unsigned_16); procedure Int_32_To_Str is new Int_To_Str (Integer_32, Unsigned_32); procedure Int_64_To_Str is new Int_To_Str (Integer_64, Unsigned_64); type Longest_Integer is range System.Min_Int .. System.Max_Int; type Longest_Unsigned is mod System.Max_Binary_Modulus; procedure Int_Max_To_Str is new Int_To_Str (Longest_Integer, Longest_Unsigned); ----------------------------------- -- Separate_Integer_Digit_Groups -- ----------------------------------- function Separate_Integer_Digit_Groups (Text_Value : String; Separator : String; Group_Size : Integer) return String is FD : Natural := Index_Non_Blank (Text_Value, Forward); LD : Natural := Index_Non_Blank (Text_Value, Backward); SP : Natural := 0; Res : Unbounded_String := Null_Unbounded_String; begin if Separator'Length = 0 then return Text_Value; end if; if Text_Value (FD) = '-' or else Text_Value (FD) = '+' then SP := FD; FD := FD + 1; end if; if SP > 0 then Res := Text_Value (Text_Value'First .. SP) & Res; else Res := Text_Value (Text_Value'First .. FD - 1) & Res; end if; Res := Res & Separate_Digit_Groups (Text_Value (FD .. LD), Separator, Group_Size) & Text_Value (LD + 1 .. Text_Value'Last); return To_String (Res); end Separate_Integer_Digit_Groups; ------------ -- Format -- ------------ function Format (Value : Item_Type'Base; Initial_Width : Integer; Leading_Zero : Boolean; Base : Integer; Justification : Alignment; Force_Sign : Boolean; Base_Style : Base_Style_Kind; Digit_Groups : Digit_Grouping) return String is Img : String (1 .. Maximal_Item_Length); Width : Integer; Real_Width : Integer; Pre_First : Natural; Last : Natural; Neg_Num : Neg_Number_Represent; begin if Base_Style = C_Base_Style then Neg_Num := Twos_Complement; else Neg_Num := Sign_Magnitude; end if; if Item_Type'Base'Size > 64 then Int_Max_To_Str (Img, Longest_Integer (Value), Base, Neg_Num); elsif Item_Type'Base'Size > 32 then Int_64_To_Str (Img, Integer_64 (Value), Base, Neg_Num); elsif Item_Type'Base'Size > 16 then Int_32_To_Str (Img, Integer_32 (Value), Base, Neg_Num); elsif Item_Type'Base'Size > 8 then Int_16_To_Str (Img, Integer_16 (Value), Base, Neg_Num); else Int_8_To_Str (Img, Integer_8 (Value), Base, Neg_Num); end if; Last := Img'Last; Pre_First := Last; while Img (Pre_First) /= ' ' loop Pre_First := Pre_First - 1; end loop; if Value < 0 and then Img (Pre_First + 1) = '-' then Pre_First := Pre_First + 1; Img (Pre_First) := ' '; end if; Real_Width := Last - Pre_First; Width := Integer'Max (Initial_Width, Real_Width); declare S : String (1 .. Width); V : String := Img (Pre_First + 1 .. Last); T : Unbounded_String; L : String := (if Digit_Groups = NLS_Grouping_Style then Thousands_Sep_Character elsif Digit_Groups = Ada_Grouping_Style then Ada_Sep_Character else ""); G : Integer := (if Digit_Groups = NLS_Grouping_Style or Base = 10 then 3 else 4); begin case Digit_Groups is when None => T := To_Unbounded_String (V); when Ada_Grouping_Style => T := To_Unbounded_String (Separate_Integer_Digit_Groups (V, L, G)); when NLS_Grouping_Style => if Base = 10 then T := To_Unbounded_String (Separate_Integer_Digit_Groups (V, L, G)); else T := To_Unbounded_String (V); end if; end case; case Base_Style is when None => if Value < 0 then -- and Base = 10 then T := "-" & T; elsif Value > 0 and then Force_Sign then T := "+" & T; end if; when C_Base_Style => case Base is when 8 => T := "0" & T; when 16 => T := "0x" & T; when others => null; end case; when Ada_Base_Style => case Base is when 2 => T := "2#" & T & "#"; when 8 => T := "8#" & T & "#"; when 16 => T := "16#" & T & "#"; when others => null; end case; if Value < 0 and Base /= 10 then T := "-" & T; elsif Value > 0 and then Force_Sign then T := "+" & T; end if; end case; if Length (T) > Width then return To_String (T); else Move (To_String (T), S, Justify => Justification, Pad => Filler); if Leading_Zero then S := Set_Leading_Zero (S, L, G); end if; return S; end if; end; end Format; --------- -- "&" -- --------- function "&" (Fmt : Format_Type; Value : Item_Type'Base) return Format_Type is Command_Start : constant Integer := Scan_To_Percent_Sign (Fmt); Leading_Zero : Boolean := False; Width : Integer := 0; Digit_Occured : Boolean := False; Justification_Changed : Boolean := False; Justification : Alignment := Right; Force_Sign : Boolean := False; Force_Base : Boolean := False; Base_Style : Base_Style_Kind := None; Digit_Groups : Digit_Grouping := None; Fmt_Copy : Unbounded_String; begin if Command_Start /= 0 then Fmt_Copy := Unbounded_String (Fmt); for I in Command_Start + 1 .. Length (Fmt_Copy) loop case Element (Fmt_Copy, I) is when 'd' => Replace_Slice (Fmt_Copy, Command_Start, I, Format (Value, Width, Leading_Zero, 10, Justification, Force_Sign, None, Digit_Groups)); return Format_Type (Fmt_Copy); when 'x' => Replace_Slice (Fmt_Copy, Command_Start, I, To_Lower ( Format (Value, Width, Leading_Zero, 16, Justification, Force_Sign, Base_Style, Digit_Groups))); return Format_Type (Fmt_Copy); when 'X' => Replace_Slice (Fmt_Copy, Command_Start, I, To_Upper ( Format (Value, Width, Leading_Zero, 16, Justification, Force_Sign, Base_Style, Digit_Groups))); return Format_Type (Fmt_Copy); when 'o' => Replace_Slice (Fmt_Copy, Command_Start, I, Format (Value, Width, Leading_Zero, 8, Justification, Force_Sign, Base_Style, Digit_Groups)); return Format_Type (Fmt_Copy); when 'b' => Replace_Slice (Fmt_Copy, Command_Start, I, Format (Value, Width, Leading_Zero, 2, Justification, Force_Sign, Base_Style, Digit_Groups)); return Format_Type (Fmt_Copy); when '_' => Digit_Groups := Ada_Grouping_Style; when ''' => Digit_Groups := NLS_Grouping_Style; when '+' => Force_Sign := True; when '#' => Base_Style := C_Base_Style; when '~' => Base_Style := Ada_Base_Style; when '-' | '*' => if Justification_Changed or else Digit_Occured then raise Format_Error; end if; Justification_Changed := True; case Element (Fmt_Copy, I) is when '-' => Justification := Left; when '*' => Justification := Center; when others => null; end case; when '0' .. '9' => Digit_Occured := True; if Width = 0 and then Element (Fmt_Copy, I) = '0' then Leading_Zero := True; else Width := Width * 10 + Character'Pos (Element (Fmt_Copy, I)) - Character'Pos ('0'); end if; when others => raise Format_Error; end case; end loop; end if; raise Format_Error; end "&"; end Formatted_Output.Integer_Output;
reznikmm/increment
Ada
1,305
adb
-- Copyright (c) 2015-2017 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Ada.Command_Line; with Anagram.Grammars.Constructors; with Anagram.Grammars.LR.LALR; with Anagram.Grammars.LR_Tables; with Anagram.Grammars.Reader; with Anagram.Grammars_Convertors; with Anagram.Grammars_Debug; with Gen.Write_Parser_Data; with Gen.Write_XML; procedure Gen.Driver is File : constant String := Ada.Command_Line.Argument (1); G : constant Anagram.Grammars.Grammar := Anagram.Grammars.Reader.Read (File); Plain : constant Anagram.Grammars.Grammar := Anagram.Grammars_Convertors.Convert (G, False); AG : constant Anagram.Grammars.Grammar := Anagram.Grammars.Constructors.To_Augmented (Plain); Table : constant Anagram.Grammars.LR_Tables.Table_Access := Anagram.Grammars.LR.LALR.Build (AG, False); begin if Ada.Command_Line.Argument_Count = 1 then Gen.Write_Parser_Data (Plain, Table.all); elsif Ada.Command_Line.Argument_Count = 2 then Gen.Write_XML (Ada.Command_Line.Argument (2), Plain, Table.all); elsif Ada.Command_Line.Argument_Count > 2 then Anagram.Grammars_Debug.Print_Conflicts (AG, Table.all); end if; end Gen.Driver;
skordal/cupcake
Ada
1,273
ads
-- The Cupcake GUI Toolkit -- (c) Kristian Klomsten Skordal 2012 <[email protected]> -- Report bugs and issues on <http://github.com/skordal/cupcake/issues> -- vim:ts=3:sw=3:et:si:sta package Cupcake.Primitives is -- Simple point type: type Point is record X, Y : Integer; end record; -- Point operators: function "+" (Left, Right : in Point) return Point with Inline, Pure_Function; function "-" (Left, Right : in Point) return Point with Inline, Pure_Function; function "=" (Left, Right : in Point) return Boolean with Inline, Pure_Function; -- Type for specifying dimensions: type Dimension is record Width, Height : Natural; end record; -- Dimension operators: function "<" (Left, Right : in Dimension) return Boolean with Inline, Pure_Function; function ">" (Left, Right : in Dimension) return Boolean with Inline, Pure_Function; function "=" (Left, Right : in Dimension) return Boolean with Inline, Pure_Function; -- Rectangle type: type Rectangle is record Origin : Point; Size : Dimension; end record; -- Line type: type Line is record Start : Point; Endpoint : Point; end record; end Cupcake.Primitives;
msrLi/portingSources
Ada
1,144
ads
-- Copyright 2014 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Pack is type Interactive_Command is abstract tagged null record; type Interactive_Command_Access is access all Interactive_Command'Class; type String_Access is access all String; type My_Command is new Interactive_Command with record menu_name : String_Access; end record; function New_Command return Interactive_Command_Access; procedure Id (C : in out Interactive_Command_Access); end Pack;
JohnYang97/Space-Convoy
Ada
1,271
ads
-- -- Jan & Uwe R. Zimmer, Australia, July 2011 -- with Real_Type; use Real_Type; with Vectors_xD; pragma Elaborate_All (Vectors_xD); package Vectors_2D is type xy_Coordinates is (x, y); package Vectors_2Di is new Vectors_xD (Real, xy_Coordinates); subtype Vector_2D is Vectors_2Di.Vector_xD; Zero_Vector_2D : constant Vector_2D := Vectors_2Di.Zero_Vector_xD; function Image (V : Vector_2D) return String renames Vectors_2Di.Image; function Norm (V : Vector_2D) return Vector_2D renames Vectors_2Di.Norm; function "*" (Scalar : Real; V : Vector_2D) return Vector_2D renames Vectors_2Di."*"; function "*" (V : Vector_2D; Scalar : Real) return Vector_2D renames Vectors_2Di."*"; function "/" (V : Vector_2D; Scalar : Real) return Vector_2D renames Vectors_2Di."/"; function "*" (V_Left, V_Right : Vector_2D) return Real renames Vectors_2Di."*"; function Angle_Between (V_Left, V_Right : Vector_2D) return Real renames Vectors_2Di.Angle_Between; function "+" (V_Left, V_Right : Vector_2D) return Vector_2D renames Vectors_2Di."+"; function "-" (V_Left, V_Right : Vector_2D) return Vector_2D renames Vectors_2Di."-"; function "abs" (V : Vector_2D) return Real renames Vectors_2Di."abs"; end Vectors_2D;
Tim-Tom/project-euler
Ada
58
ads
package Problem_09 is procedure Solve; end Problem_09;
reznikmm/matreshka
Ada
4,691
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$ ------------------------------------------------------------------------------ package Matreshka.ODF_Elements.Table.Table_Cell is type Table_Table_Cell_Node is new Matreshka.ODF_Elements.Table.Table_Node_Base with null record; type Table_Table_Cell_Access is access all Table_Table_Cell_Node'Class; overriding procedure Enter_Element (Self : not null access Table_Table_Cell_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding function Get_Local_Name (Self : not null access constant Table_Table_Cell_Node) return League.Strings.Universal_String; overriding procedure Leave_Element (Self : not null access Table_Table_Cell_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access Table_Table_Cell_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); -- Dispatch call to corresponding subprogram of iterator interface. end Matreshka.ODF_Elements.Table.Table_Cell;
AaronC98/PlaneSystem
Ada
17,976
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.Calendar.Formatting; with Ada.Calendar.Time_Zones; with Ada.Calendar; with Ada.Characters.Handling; with Ada.Strings.Fixed; with Ada.Strings.Maps; with Ada.Unchecked_Deallocation; with Unicode.CES.Basic_8bit; with Unicode.CES.Utf8; with AWS.Utils; with SOAP.Message.XML; package body SOAP.Utils is --------- -- Any -- --------- function Any (V : Types.XSD_Any_Type; Name : String := "item"; Type_Name : String := Types.XML_String; NS : Name_Space.Object := Name_Space.No_Name_Space) return Types.XSD_Any_Type is begin return SOAP.Types.Any (Types.Object'Class (V), Name, Type_Name, NS); end Any; ------- -- C -- ------- function C (V : Character; Name : String := "item"; Type_Name : String := "Character"; NS : Name_Space.Object := Name_Space.No_Name_Space) return Types.XSD_String is begin return Types.S (String'(1 => V), Name, Type_Name, NS); end C; ------------ -- Encode -- ------------ procedure Encode (S : Unbounded_String; Result : in out Unbounded_String) is Ch : Character; begin for K in 1 .. Length (S) loop Ch := Element (S, K); case Ch is when '<' => Append (Result, "&lt;"); when '>' => Append (Result, "&gt;"); when '&' => Append (Result, "&amp;"); when ''' => Append (Result, "&apos;"); when '"' => Append (Result, "&quot;"); when Character'Val (0) .. Character'Val (31) => Append (Result, "&#"); Append (Result, AWS.Utils.Image (Natural (Character'Pos (Ch)))); Append (Result, ';'); when others => Append (Result, Ch); end case; end loop; end Encode; function Encode (Str : String) return String is Result : Unbounded_String; begin Encode (To_Unbounded_String (Str), Result); return To_String (Result); end Encode; --------------- -- From_Utf8 -- --------------- function From_Utf8 (Str : String) return String is begin return Unicode.CES.Basic_8bit.From_Utf32 (Unicode.CES.Utf8.To_Utf32 (Str)); end From_Utf8; function From_Utf8 (Str : Unbounded_String) return Unbounded_String is Idx : Integer := 1; Buf : String (1 .. 6); Buf_Last : Integer := 0; Ch32 : Unicode.Unicode_Char; W : Integer; Result : Unbounded_String; begin loop while Idx <= Length (Str) and then Buf_Last < Buf'Last loop Buf (Buf_Last + 1) := Element (Str, Idx); Idx := Idx + 1; Buf_Last := Buf_Last + 1; end loop; exit when Buf_Last = 0; W := 1; Unicode.CES.Utf8.Read (Buf, W, Ch32); W := W - 1; for I in 1 .. Buf_Last - W loop Buf (I) := Buf (I + W); end loop; Buf_Last := Buf_Last - W; Append (Result, Character'Val (Ch32)); end loop; return Result; end From_Utf8; function From_Utf8 (Str : String) return String_Access is Result : String_Access := new String (1 .. 2000); Last : Integer := 0; procedure Append (Ch : Character) with Inline; -- Append Ch into Result, adjust Result size if needed procedure Adjust_Result with Inline; -- Adjust final Result to the right size ------------------- -- Adjust_Result -- ------------------- procedure Adjust_Result is Old : String_Access; begin if Last /= Result'Last then Old := Result; Result := new String (1 .. Last); Result.all := Old (1 .. Last); Free (Old); end if; end Adjust_Result; ------------ -- Append -- ------------ procedure Append (Ch : Character) is Old : String_Access; begin if Last >= Result'Last then Old := Result; Result := new String (1 .. Old'Last * 2); Result (1 .. Old'Last) := Old.all; Free (Old); end if; Last := Last + 1; Result (Last) := Ch; end Append; Idx : Integer := Str'First; Buf : String (1 .. 6); Buf_Last : Integer := 0; Ch32 : Unicode.Unicode_Char; W : Integer; begin loop while Idx <= Str'Last and then Buf_Last < Buf'Last loop Buf (Buf_Last + 1) := Str (Idx); Idx := Idx + 1; Buf_Last := Buf_Last + 1; end loop; exit when Buf_Last = 0; W := 1; Unicode.CES.Utf8.Read (Buf, W, Ch32); W := W - 1; for I in 1 .. Buf_Last - W loop Buf (I) := Buf (I + W); end loop; Buf_Last := Buf_Last - W; Append (Character'Val (Ch32)); end loop; Adjust_Result; return Result; end From_Utf8; --------- -- Get -- --------- function Get (Item : Types.Object'Class) return Unbounded_String is begin return To_Unbounded_String (String'(Types.Get (Item))); end Get; function Get (Item : Types.Object'Class) return Character is Str : constant String := String'(Types.Get (Item)); begin return Str (1); end Get; function Get (Item : Types.Object'Class) return String is Enum : constant Types.SOAP_Enumeration := Types.SOAP_Enumeration (Item); begin return Types.Image (Enum); end Get; -------------------------- -- Is_Ada_Reserved_Word -- -------------------------- function Is_Ada_Reserved_Word (Name : String) return Boolean is N : constant String := Ada.Characters.Handling.To_Lower (Name); begin if N in "abort" | "else" | "new" | "return" | "abs" | "elsif" | "not" | "reverse" | "abstract" | "end" | "null" | "accept" | "entry" | "select" | "access" | "exception" | "separate" | "aliased" | "exit" | "of" | "subtype" | "all" | "or" | "and" | "for" | "others" | "tagged" | "array" | "function" | "out" | "task" | "at" | "terminate" | "generic" | "package" | "then" | "begin" | "goto" | "pragma" | "type" | "body" | "private" | "if" | "procedure" | "case" | "in" | "protected" | "until" | "constant" | "is" | "use" | "raise" | "declare" | "range" | "when" | "delay" | "limited" | "record" | "while" | "delta" | "loop" | "rem" | "with" | "digits" | "renames" | "do" | "mod" | "requeue" | "xor" | "synchronized" | "overriding" | "interface" | "some" then return True; else return False; end if; end Is_Ada_Reserved_Word; ----------- -- No_NS -- ----------- function No_NS (Name : String) return String is K : constant Natural := Ada.Strings.Fixed.Index (Name, ":"); begin if K = 0 then return Name; else return Name (K + 1 .. Name'Last); end if; end No_NS; -------- -- NS -- -------- function NS (Name : String) return String is K : constant Natural := Ada.Strings.Fixed.Index (Name, ":"); begin if K = 0 then return ""; else return Name (Name'First .. K - 1); end if; end NS; ------------------- -- Safe_Pointers -- ------------------- package body Safe_Pointers is procedure Unchecked_Free is new Ada.Unchecked_Deallocation (T, T_Access); procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Natural, Ref_Counter); ------------ -- Adjust -- ------------ overriding procedure Adjust (SP : in out Safe_Pointer) is begin SP.Ref.all := SP.Ref.all + 1; end Adjust; -------------- -- Finalize -- -------------- overriding procedure Finalize (SP : in out Safe_Pointer) is Ref : Ref_Counter := SP.Ref; begin -- Ensure call is idempotent SP.Ref := null; if Ref /= null then Ref.all := Ref.all - 1; if Ref.all = 0 then Unchecked_Free (SP.Item); Unchecked_Free (Ref); end if; end if; end Finalize; ---------------- -- Initialize -- ---------------- overriding procedure Initialize (SP : in out Safe_Pointer) is begin SP.Ref := new Natural'(1); end Initialize; ---------------------- -- To_Safe_Pointer -- ---------------------- function To_Safe_Pointer (Item : T) return Safe_Pointer is begin return (Ada.Finalization.Controlled with new T'(Item), new Natural'(1)); end To_Safe_Pointer; end Safe_Pointers; ------------------ -- SOAP_Wrapper -- ------------------ function SOAP_Wrapper (Request : AWS.Status.Data; Schema : WSDL.Schema.Definition := WSDL.Schema.Empty) return AWS.Response.Data is SOAPAction : constant String := AWS.Status.SOAPAction (Request); begin if SOAPAction /= No_SOAPAction then declare Payload_Data : constant Unbounded_String := AWS.Status.Payload (Request); Payload : constant Message.Payload.Object := Message.XML.Load_Payload (Payload_Data, Schema => Schema); begin return SOAP_CB (SOAPAction, Payload, Request); end; else raise Constraint_Error; end if; end SOAP_Wrapper; --------- -- Tag -- --------- function Tag (Name : String; Start : Boolean) return String is begin if Start then return '<' & Name & '>'; else return "</" & Name & '>'; end if; end Tag; ------------------ -- Time_Instant -- ------------------ function Time_Instant (TI, Name : String; Type_Name : String := Types.XML_Time_Instant) return Types.XSD_Time_Instant is use Ada.Calendar; use Ada.Calendar.Formatting; use type Ada.Calendar.Time_Zones.Time_Offset; subtype Year_Range is Positive range TI'First .. TI'First + 3; subtype Month_Range is Positive range TI'First + 5 .. TI'First + 6; subtype Day_Range is Positive range TI'First + 8 .. TI'First + 9; subtype Hour_Range is Positive range TI'First + 11 .. TI'First + 12; subtype Minute_Range is Positive range TI'First + 14 .. TI'First + 15; subtype Second_Range is Positive range TI'First + 17 .. TI'First + 18; subtype TZ_Type_Range is Positive range TI'First + 19 .. TI'First + 19; subtype TZ_Hour_Range is Positive range TI'First + 20 .. TI'First + 21; subtype TZ_Minute_Range is Positive range TI'First + 23 .. TI'First + 24; T : Types.Local_Time; TZ : Time_Zones.Time_Offset := 0; begin -- timeInstant format is CCYY-MM-DDThh:mm:ss[[+|-]hh:mm | Z] if TI'Last >= TZ_Type_Range'Last then -- Time zone specified if TI'Last >= TZ_Hour_Range'Last then TZ := Time_Zones.Time_Offset'Value (TI (TZ_Hour_Range)) * 60; if TI'Last = TZ_Minute_Range'Last then TZ := TZ + Time_Zones.Time_Offset'Value (TI (TZ_Minute_Range)); end if; if TI (TZ_Type_Range) = "-" then TZ := -TZ; end if; end if; end if; T := Time_Of (Year => Year_Number'Value (TI (Year_Range)), Month => Month_Number'Value (TI (Month_Range)), Day => Day_Number'Value (TI (Day_Range)), Hour => Hour_Number'Value (TI (Hour_Range)), Minute => Minute_Number'Value (TI (Minute_Range)), Second => Second_Number'Value (TI (Second_Range)), Time_Zone => TZ); return Types.T (T, Name, Type_Name => Type_Name); end Time_Instant; ------------- -- To_Name -- ------------- function To_Name (Q_Name : String) return String is use Ada; begin return Strings.Fixed.Translate (Q_Name, Strings.Maps.To_Mapping (":", "_")); end To_Name; ------------------- -- To_Object_Set -- ------------------- function To_Object_Set (From : T_Array; NS : Name_Space.Object) return Types.Object_Set is use SOAP.Types; Result : Types.Object_Set (From'Range); begin for K in From'Range loop Result (K) := +Get (From (K), Name => E_Name, Type_Name => Type_Name, NS => NS); end loop; return Result; end To_Object_Set; --------------------- -- To_Object_Set_C -- --------------------- function To_Object_Set_C (From : T_Array; NS : Name_Space.Object) return Types.Object_Set is use SOAP.Types; Result : Types.Object_Set (1 .. Integer (From'Last)); begin for K in From'Range loop Result (Integer (K)) := +Get (From (K), Name => E_Name, Type_Name => Type_Name, NS => NS); end loop; return Result; end To_Object_Set_C; ---------------- -- To_T_Array -- ---------------- function To_T_Array (From : Types.Object_Set) return T_Array is use SOAP.Types; Result : T_Array (From'Range); begin for K in From'Range loop Result (K) := Get (-From (K)); end loop; return T_Array'(Result); end To_T_Array; ------------------ -- To_T_Array_C -- ------------------ function To_T_Array_C (From : Types.Object_Set) return T_Array is use SOAP.Types; Result : T_Array; begin for K in Result'Range loop Result (K) := Get (-From (Integer (K))); end loop; return Result; end To_T_Array_C; ------------- -- To_Utf8 -- ------------- function To_Utf8 (Str : String) return String is begin return Unicode.CES.Utf8.From_Utf32 (Unicode.CES.Basic_8bit.To_Utf32 (Str)); end To_Utf8; function To_Utf8 (Str : Unbounded_String) return Unbounded_String is Chars : String (1 .. 6); Idx : Integer; Result : Unbounded_String; begin for I in 1 .. Length (Str) loop Idx := 0; Unicode.CES.Utf8.Encode (Character'Pos (Element (Str, I)), Chars, Idx); Append (Result, Chars (1 .. Idx)); end loop; return Result; end To_Utf8; -------- -- US -- -------- function US (V : Unbounded_String; Name : String := "item"; Type_Name : String := Types.XML_String; NS : Name_Space.Object := Name_Space.No_Name_Space) return Types.XSD_String is begin return Types.S (To_String (V), Name, Type_Name, NS); end US; ------- -- V -- ------- function V (O : Types.XSD_String) return Unbounded_String is begin return To_Unbounded_String (Types.V (O)); end V; function V (O : Types.XSD_String) return Character is begin return Types.V (O) (1); end V; ------------- -- With_NS -- ------------- function With_NS (NS, Name : String) return String is use Ada; K : Natural; begin if NS = "" then return Name; else K := Strings.Fixed.Index (Name, ":"); if K = 0 then K := Name'First; else K := K + 1; end if; return NS & ':' & Name (K .. Name'Last); end if; end With_NS; end SOAP.Utils;
AdaCore/langkit
Ada
276
ads
-- -- Copyright (C) 2014-2022, AdaCore -- SPDX-License-Identifier: Apache-2.0 -- package Langkit_Support with Pure is External_Name_Prefix : constant String := "langkit_support__int__"; -- Prefix for explicit external names in Langkit_Support end Langkit_Support;
databuzzword/ai-api-marketplace
Ada
3,621
adb
-- FastAPI -- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -- -- The version of the OpenAPI document: 0.1.0 -- -- -- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0. -- https://openapi-generator.tech -- Do not edit the class manually. package body .Models is use Swagger.Streams; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in ValidationErrorType) is begin Into.Start_Entity (Name); Serialize (Into, "loc", Value.Loc); Into.Write_Entity ("msg", Value.Msg); Into.Write_Entity ("type", Value.P_Type); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in ValidationErrorType_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out ValidationErrorType) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "loc", Value.Loc); Swagger.Streams.Deserialize (Object, "msg", Value.Msg); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out ValidationErrorType_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : ValidationErrorType; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in HTTPValidationErrorType) is begin Into.Start_Entity (Name); Serialize (Into, "detail", Value.Detail); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in HTTPValidationErrorType_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out HTTPValidationErrorType) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "detail", Value.Detail); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out HTTPValidationErrorType_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : HTTPValidationErrorType; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; end .Models;
HeisenbugLtd/msg_passing
Ada
3,537
ads
------------------------------------------------------------------------ -- Copyright (C) 2010-2020 by Heisenbug Ltd. ([email protected]) -- -- 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); ------------------------------------------------------------------------ -- Msg_Passing.Whiteboard -- -- This package provides message passing based on whiteboard semantics. -- -- This means, there is only one sender, and one message at a time, but -- there can be multiple receivers (including none!) of the same -- message. The message must be erased explicitely. In other words, -- it's like posting a message and anyone passing by may read it until -- it disappears again. -- ------------------------------------------------------------------------ generic package Msg_Passing.Whiteboard is pragma Pure; --------------------------------------------------------------------- -- Whiteboard messaging object --------------------------------------------------------------------- type Object is new Msg_Passing.Object with private; --------------------------------------------------------------------- -- Object.Read --------------------------------------------------------------------- procedure Read (Instance : in out Object; Message : out Letter); --------------------------------------------------------------------- -- Object.Write --------------------------------------------------------------------- procedure Write (Instance : in out Object; Message : in Letter); private --------------------------------------------------------------------- -- protected spec Mutex --------------------------------------------------------------------- protected type Mutex is ------------------------------------------------------------------ -- Whiteboard.Put -- -- Writes a message to the whiteboard. If the last message hasn't -- been erased yet, the calling task is blocked until the -- previous message has been erased. -- ------------------------------------------------------------------ entry Put (Message : in Letter); ------------------------------------------------------------------ -- Whiteboard.Get -- -- Reads the message on the whiteboard. If there is no message, -- the calling task is blocked until a new message is written on -- the whiteboard. -- ------------------------------------------------------------------ entry Get (Message : out Letter); ------------------------------------------------------------------ -- Whiteboard.Erase -- -- Erases the message on the whiteboard. -- ------------------------------------------------------------------ procedure Erase; private Msg_Available : Boolean := False; The_Message : Letter; end Mutex; --------------------------------------------------------------------- -- Object type completion --------------------------------------------------------------------- type Object is new Msg_Passing.Object with record Locked : Mutex; end record; end Msg_Passing.Whiteboard;
GregTrevellick/FilesForEveryExtension
Ada
11
ads
Foo bar ADS
flyx/OpenGLAda
Ada
204
ads
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" procedure GL.Load_Function_Pointers; pragma Preelaborate (GL.Load_Function_Pointers);
onox/sdlada
Ada
2,280
adb
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2018 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. -------------------------------------------------------------------------------------------------------------------- with Interfaces.C; package body SDL.Events.Joysticks.Game_Controllers is package C renames Interfaces.C; use type C.int; Query : constant C.int := -1; Ignore : constant C.int := 0; Enable : constant C.int := 1; function SDL_Game_Controller_Event_State (State : in C.int) return C.int with Import => True, Convention => C, External_Name => "SDL_GameControllerEventState"; procedure SDL_Game_Controller_Event_State (State : in C.int) with Import => True, Convention => C, External_Name => "SDL_GameControllerEventState"; function Is_Polling_Enabled return Boolean is Result : C.int := SDL_Game_Controller_Event_State (Query); begin if Result = Enable then return True; end if; return False; end Is_Polling_Enabled; procedure Enable_Polling is begin SDL_Game_Controller_Event_State (Enable); end Enable_Polling; procedure Disable_Polling is begin SDL_Game_Controller_Event_State (Ignore); end Disable_Polling; end SDL.Events.Joysticks.Game_Controllers;
psyomn/ash
Ada
939
adb
-- Copyright 2019 Simon Symeonidis (psyomn) -- -- 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 Common_Utils_Suite; with File_Utils_Suite; package body Ash_Suite is function Suite return Access_Test_Suite is Ret : constant Access_Test_Suite := new Test_Suite; begin Ret.Add_Test (Common_Utils_Suite.Suite); Ret.Add_Test (File_Utils_Suite.Suite); return Ret; end Suite; end Ash_Suite;
kjseefried/coreland-cgbc
Ada
1,666
adb
with BOHT_Support; with CGBC.Bounded_Hashed_Maps; with CGBC; with Test; procedure T_BOHT_06 is TC : Test.Context_t; use type CGBC.Hash_Type; -- -- Deliberately hash all keys to the first index, to -- invoke linear probing. -- pragma Warnings (Off); function First_Index_Hash (Key : in BOHT_Support.Key_Type4) return CGBC.Hash_Type is pragma Warnings (On); begin return 1; end First_Index_Hash; package BST4 is new CGBC.Bounded_Hashed_Maps (Key_Type => BOHT_Support.Key_Type4, Element_Type => Natural, Hash => First_Index_Hash, Equivalent_Keys => "="); Map : BST4.Map (4); Deleted : Boolean; Inserted : Boolean; begin Test.Initialize (Test_Context => TC, Program => "t_boht_06", Test_DB => "TEST_DB", Test_Results => "TEST_RESULTS"); BST4.Insert (Map, "AAAA", 1, Inserted); pragma Assert (Inserted); BST4.Insert (Map, "BBBB", 2, Inserted); pragma Assert (Inserted); BST4.Insert (Map, "CCCC", 3, Inserted); pragma Assert (Inserted); BST4.Delete (Map, "BBBB", Deleted); pragma Assert (Deleted); Test.Check (Test_Context => TC, Test => 416, Condition => BST4.Contains (Map, "AAAA"), Statement => "BST4.Contains (Map, ""AAAA"")"); Test.Check (Test_Context => TC, Test => 417, Condition => BST4.Contains (Map, "CCCC"), Statement => "BST4.Contains (Map, ""CCCC"")"); Test.Check (Test_Context => TC, Test => 418, Condition => not BST4.Contains (Map, "BBBB"), Statement => "not BST4.Contains (Map, ""BBBB"")"); end T_BOHT_06;
reznikmm/spawn
Ada
3,863
ads
-- -- Copyright (C) 2018-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -- with Ada.Streams; with Spawn.Windows_API; pragma Warnings (Off); with System.Win32; pragma Warnings (On); with Spawn.Common; private package Spawn.Internal is package Environments is function To_Key (Text : UTF_8_String) return Wide_String; function "=" (Left, Right : UTF_8_String) return Boolean; function "<" (Left, Right : UTF_8_String) return Boolean; end Environments; procedure Loop_Cycle (Timeout : Duration); -- See Spawn.Internal.Monitor type Process is tagged; subtype Pipe_Kinds is Spawn.Common.Pipe_Kinds; Buffer_Size : constant Ada.Streams.Stream_Element_Count := 512; subtype Stream_Element_Buffer is Ada.Streams.Stream_Element_Array (1 .. Buffer_Size); type Context is limited record lpOverlapped : Windows_API.OVERLAPPED; Process : access Spawn.Internal.Process'Class; Kind : Pipe_Kinds; Handle : Windows_API.HANDLE := System.Win32.INVALID_HANDLE_VALUE; Waiting_IO : Boolean := False; -- ReadFileEx/WriteFileEx overlapped operation in progress Close_IO : Boolean := False; -- User closed the pipe while overlapped operation in progress Buffer : Stream_Element_Buffer; Last : Ada.Streams.Stream_Element_Count := 0; -- If Last = 0 that means the Buffer is free and no I/O operation in -- progress. -- If Last in Buffer'Range that means a I/O operation in progress -- (we are writing Buffer (1 .. Last) or we have filled it during the -- low-level read). -- For Stdin, when Last > Buffer'Last that means write operation in -- progress (for Buffer (1 .. Last-Buffer'Length)) and we should send a -- notification on complete. end record; type Pipe_Array is array (Pipe_Kinds) of aliased Context; -- Context for each pipe kind type Process is new Spawn.Common.Process with record pid : aliased Windows_API.PROCESS_INFORMATION; pipe : Pipe_Array; Index : Natural := 0; end record; -- Process implementation type provides the same interface as -- Spawn.Processes.Process type. overriding procedure Finalize (Self : in out Process); procedure Start (Self : in out Process'Class); -- See documentation in Spawn.Processes. procedure Terminate_Process (Self : in out Process'Class); -- See documentation in Spawn.Processes. procedure Kill_Process (Self : in out Process'Class); -- See documentation in Spawn.Processes. function Identifier (Self : Process'Class) return String; -- See documentation in Spawn.Processes. procedure Close_Standard_Input (Self : in out Process'Class); -- See documentation in Spawn.Processes. procedure Write_Standard_Input (Self : in out Process'Class; Data : Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset; Success : in out Boolean); -- See documentation in Spawn.Processes. procedure Close_Standard_Output (Self : in out Process'Class); -- See documentation in Spawn.Processes. procedure Read_Standard_Output (Self : in out Process'Class; Data : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset; Success : in out Boolean); -- See documentation in Spawn.Processes. procedure Close_Standard_Error (Self : in out Process'Class); -- See documentation in Spawn.Processes. procedure Read_Standard_Error (Self : in out Process'Class; Data : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset; Success : in out Boolean); -- See documentation in Spawn.Processes. end Spawn.Internal;
sungyeon/drake
Ada
1,167
ads
pragma License (Unrestricted); -- implementation unit package System.Formatting.Literals is pragma Pure; -- parsing Ada-form literals procedure Skip_Spaces (Item : String; Last : in out Natural); procedure Check_Last (Item : String; Last : Natural; Error : out Boolean); procedure Get_Exponent ( Item : String; Last : in out Natural; Result : out Integer; Positive_Only : Boolean; Error : out Boolean); -- for integer types procedure Get_Literal ( Item : String; Last : out Natural; Result : out Long_Long_Integer_Types.Word_Integer; Error : out Boolean); procedure Get_Literal ( Item : String; Last : out Natural; Result : out Long_Long_Integer; Error : out Boolean); -- for modular types procedure Get_Literal ( Item : String; Last : out Natural; Result : out Long_Long_Integer_Types.Word_Unsigned; Error : out Boolean); procedure Get_Literal ( Item : String; Last : out Natural; Result : out Long_Long_Integer_Types.Long_Long_Unsigned; Error : out Boolean); end System.Formatting.Literals;
michalkonecny/polypaver
Ada
5,592
adb
with Ada.Wide_Text_IO; use Ada.Wide_Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Asis; with Asis.Compilation_Units; with Asis.Elements; with Asis.Declarations; with Asis.Definitions; with Asis.Expressions; with Asis.Exceptions; package body FP_Detect is function Is_PP_Elem_Fn(Element : Asis.Element) return Boolean is Decl : Asis.Element := Asis.Expressions.Corresponding_Name_Declaration(Element); Unit : Asis.Compilation_Unit := Asis.Elements.Enclosing_Compilation_Unit(Decl); Unit_Name : Wide_String := Asis.Compilation_Units.Unit_Full_Name(Unit); begin Put("Unit_Name = "); Put(Unit_Name); New_Line; return Unit_Name = "PP_F_Elementary" or Unit_Name = "PP_LF_Elementary" or Unit_Name = "PP_SF_Elementary"; exception when others => return False; end Is_PP_Elem_Fn; function Is_ElemFn_Instance(Element : Asis.Element) return Boolean is Generic_Element : Asis.Element := Asis.Declarations.Corresponding_Generic_Element(Element); Generic_Unit : Asis.Compilation_Unit := Asis.Elements.Enclosing_Compilation_Unit(Generic_Element); Generic_Unit_Name : Wide_String := Asis.Compilation_Units.Unit_Full_Name(Generic_Unit); begin return Generic_Unit_Name = "Ada.Numerics.Generic_Elementary_Functions"; exception when others => return False; end Is_ElemFn_Instance; function Is_FP_Operator_Expression(Element : Asis.Element) return Maybe_FP_Operator is Root : Asis.Element; Type_Info : FP_Type; Result_Field_Op : Maybe_FP_Operator(Field_Op); Result_Elem_Fn : Maybe_FP_Operator(Elementary_Fn); begin -- try to obtain FP precision: Type_Info := FP_Type_Of(Element); -- store the precision in potential result records: Result_Field_Op.Type_Info := Type_Info; Result_Elem_Fn.Type_Info := Type_Info; -- try to extract the root of the expression tree: Root := Asis.Expressions.Prefix(Element); -- investigate the kind of the root expression: case Asis.Elements.Expression_Kind(Root) is when Asis.An_Operator_Symbol => -- check whether the operator is a rounded FP operator: Result_Field_Op.Op_Kind := Asis.Elements.Operator_Kind(Root); case Result_Field_Op.Op_Kind is when Asis.A_Divide_Operator | Asis.A_Multiply_Operator | Asis.A_Plus_Operator | Asis.A_Minus_Operator | Asis.An_Exponentiate_Operator => return Result_Field_Op; when others => return No_FP_Operator; end case; when Asis.A_Selected_Component => -- check whether the function refers to one of the functions from -- Ada.Numerics.Generic_Elementary_Functions: if Is_PP_Elem_Fn(Asis.Expressions.Selector(Root)) then Result_Elem_Fn.Fn_Name := Asis.Expressions.Selector(Root); return Result_Elem_Fn; else return No_FP_Operator; end if; when Asis.An_Identifier => if Is_PP_Elem_Fn(Root) then Result_Elem_Fn.Fn_Name := Root; return Result_Elem_Fn; else return No_FP_Operator; end if; when others => return No_FP_Operator; end case; exception when Ex : Asis.Exceptions.ASIS_Inappropriate_Element => return No_FP_Operator; end Is_FP_Operator_Expression; function FP_Type_Of(Expr : Asis.Element) return FP_Type is Expr_Type_Decl : Asis.Declaration := Asis.Expressions.Corresponding_Expression_Type(Expr); Expr_Type_Def : Asis.Definition := Asis.Declarations.Type_Declaration_View(Expr_Type_Decl); Expr_Root_Type_Decl : Asis.Declaration; Expr_Root_Type_Def : Asis.Definition; Result : FP_Type; begin -- determine the root type so that we can get its precision: begin Expr_Root_Type_Decl := Asis.Definitions.Corresponding_Root_Type(Expr_Type_Def); Expr_Root_Type_Def := Asis.Declarations.Type_Declaration_View(Expr_Root_Type_Decl); exception when Ex : others => -- failed to find a root, assume already got the root: Expr_Root_Type_Decl := Expr_Type_Decl; Expr_Root_Type_Def := Expr_Type_Def; end; -- extract precision from the root type: declare Digits_Expr : Asis.Expression := Asis.Definitions.Digits_Expression(Expr_Root_Type_Def); Digits_String : Wide_String := Asis.Expressions.Value_Image(Digits_Expr); begin Result.Precision := Integer'Value(To_String(Digits_String)); end; -- extract the type name: Result.Name := Asis.Declarations.Names(Expr_Type_Decl)(1); -- check if the name is standard: declare Name : Wide_String := Asis.Declarations.Defining_Name_Image(Result.Name); begin if Name = "Float" then Result.Is_Standard := True; Result.Code := F; elsif Name = "Long_Float" then Result.Is_Standard := True; Result.Code := LF; elsif Name = "Short_Float" then Result.Is_Standard := True; Result.Code := SF; else Result.Is_Standard := False; Result.Code := LF; end if; end; return Result; end FP_Type_Of; end FP_Detect;
peterfrankjohnson/assembler
Ada
306
ads
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Opcode is type Object is tagged record Value : Unbounded_String; end record; function getOpcode (This : Object) return Unbounded_String; procedure setOpcode (This : in out Object; V : Unbounded_String); end Opcode;
reznikmm/matreshka
Ada
4,671
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_Presentation.Show_Logo_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Presentation_Show_Logo_Attribute_Node is begin return Self : Presentation_Show_Logo_Attribute_Node do Matreshka.ODF_Presentation.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Presentation_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Presentation_Show_Logo_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Show_Logo_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Presentation_URI, Matreshka.ODF_String_Constants.Show_Logo_Attribute, Presentation_Show_Logo_Attribute_Node'Tag); end Matreshka.ODF_Presentation.Show_Logo_Attributes;
reznikmm/matreshka
Ada
4,081
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.Presentation_Visibility_Attributes; package Matreshka.ODF_Presentation.Visibility_Attributes is type Presentation_Visibility_Attribute_Node is new Matreshka.ODF_Presentation.Abstract_Presentation_Attribute_Node and ODF.DOM.Presentation_Visibility_Attributes.ODF_Presentation_Visibility_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Presentation_Visibility_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Presentation_Visibility_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Presentation.Visibility_Attributes;
AdaCore/training_material
Ada
366
adb
package body Counter is task body Counter_T is begin accept Initialize (Register : Datastore.Register_T; Value : Integer; Increment : Integer; Delay_Time : Duration); delay 0.0; Datastore.Write (Register => Datastore.Register_T'first, Value => 0); end Counter_T; end Counter;
RREE/ada-util
Ada
2,940
ads
----------------------------------------------------------------------- -- util-events-channel -- Event Channels -- Copyright (C) 2001, 2002, 2003, 2009, 2010, 2018 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.Strings.Unbounded; with Ada.Containers.Doubly_Linked_Lists; -- The <b>Util.Events.Channels</b> package implements a publish/subscribe event -- channel. It is inspired from Event pattern and CosEvent service. package Util.Events.Channels is type Subscriber is limited interface; type Subscriber_Access is access all Subscriber'Class; procedure Receive_Event (Sub : in out Subscriber; Item : in Event'Class) is abstract; ---------------------- -- Event Channel ---------------------- -- Channel on which events are pushed. type Channel is tagged limited private; type Channel_Access is access all Channel'Class; -- Get the name of this event channel. function Get_Name (C : Channel) return String; -- Post an event (may be asynchronous) procedure Post (To : in out Channel; Item : in Event'Class); -- Subscribe to events sent on the event channel. procedure Subscribe (To : in out Channel; Client : in Subscriber_Access); -- Unsubscribe to events sent on the event channel. procedure Unsubscribe (To : in out Channel; Client : in Subscriber_Access); type Channel_Creator is access function (Name : String) return Channel_Access; -- Create an event channel with the given name. The type of channel -- is controlled by <b>Kind</b>. function Create (Name : String; Kind : String) return Channel_Access; -- Create an event channel that post the event immediately. -- This is similar to calling <b>Create</b> with <b>"direct"</b> as kind. function Create_Direct_Channel (Name : String) return Channel_Access; private package Containers is new Ada.Containers.Doubly_Linked_Lists (Element_Type => Subscriber_Access); subtype List is Containers.List; type Channel is tagged limited record Name : Ada.Strings.Unbounded.Unbounded_String; Clients : List; end record; end Util.Events.Channels;
reznikmm/matreshka
Ada
4,139
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.Table_Drill_Down_On_Double_Click_Attributes; package Matreshka.ODF_Table.Drill_Down_On_Double_Click_Attributes is type Table_Drill_Down_On_Double_Click_Attribute_Node is new Matreshka.ODF_Table.Abstract_Table_Attribute_Node and ODF.DOM.Table_Drill_Down_On_Double_Click_Attributes.ODF_Table_Drill_Down_On_Double_Click_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Table_Drill_Down_On_Double_Click_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Table_Drill_Down_On_Double_Click_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Table.Drill_Down_On_Double_Click_Attributes;
zhmu/ananas
Ada
2,156
ads
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E X P _ C H 2 -- -- -- -- 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. 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. -- -- -- ------------------------------------------------------------------------------ -- Expand routines for chapter 2 constructs with Types; use Types; package Exp_Ch2 is procedure Expand_N_Expanded_Name (N : Node_Id); procedure Expand_N_Identifier (N : Node_Id); procedure Expand_N_Real_Literal (N : Node_Id); end Exp_Ch2;
zhmu/ananas
Ada
2,598
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T . U T F _ 3 2 -- -- -- -- B o d y -- -- -- -- Copyright (C) 2005-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 a package renaming. 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;
AdaCore/langkit
Ada
2,118
adb
with Ada.Text_IO; use Ada.Text_IO; with Libfoolang.Analysis; use Libfoolang.Analysis; with Libfoolang.Common; use Libfoolang.Common; procedure Main is procedure Try_Node (N : Foo_Node; Label : String); -------------- -- Try_Node -- -------------- procedure Try_Node (N : Foo_Node; Label : String) is begin Put_Line (Label); Put_Line (N.Image); Put_Line (" ... did not get the expected stale reference error"); exception when Stale_Reference_Error => Put_Line (" ... got the expected stale reference error"); end Try_Node; begin declare Dummy : constant Analysis_Context := Create_Context; begin null; -- Ctx is supposed to be destroyed when leaving the scope end; declare U : Analysis_Unit; begin declare C : constant Analysis_Context := Create_Context; begin U := C.Get_From_Buffer ("main.txt", "ASCII", "example"); end; -- U keeps a reference to C, so C must be still alive at this point if U.Context.Get_From_File ("main.txt") /= U then raise Program_Error; end if; -- When leaving this scope, the context reference that U owns dies, so -- the context will be destroyed. end; declare U : constant Analysis_Unit := Create_Context.Get_From_Buffer (Filename => "main.txt", Buffer => "example"); R : constant Foo_Node := U.Root; begin U.Reparse ("example"); Try_Node (R, "Using node after unit reparse"); end; declare N : Foo_Node; begin declare U : constant Analysis_Unit := Create_Context.Get_From_Buffer (Filename => "main.txt", Buffer => "example"); begin N := U.Root; end; Try_Node (N, "Using node after context destruction"); declare Dummy_Unit : constant Analysis_Unit := Create_Context.Get_From_Buffer (Filename => "main.txt", Buffer => "example"); begin Try_Node (N, "Using node after context re-use"); end; end; Put_Line ("Done."); end Main;
Letractively/ada-el
Ada
2,359
ads
----------------------------------------------------------------------- -- EL testsuite - EL Testsuite -- Copyright (C) 2009, 2010, 2011 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.Tests; with EL.Contexts.Default; package EL.Expressions.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with record Context : EL.Contexts.Default.Default_Context_Access; end record; -- Set up performed before each test case procedure Set_Up (T : in out Test); -- Tear down performed after each test case procedure Tear_Down (T : in out Test); procedure Test_Bean_Evaluation (T : in out Test); procedure Test_Parse_Error (T : in out Test); procedure Test_Method_Evaluation (T : in out Test); procedure Test_Invalid_Method (T : in out Test); procedure Test_Simple_Evaluation (T : in out Test); procedure Test_Function_Evaluation (T : in out Test); procedure Test_Object_Sizes (T : in out Test); -- Test to verify the Is_Valid operation procedure Test_Method_Is_Valid (T : in out Test); -- Test function namespace procedure Test_Function_Namespace (T : in out Test); -- Test the use of a value expression. procedure Test_Value_Expression (T : in out Test); -- Test the invalid value expression procedure Test_Invalid_Value_Expression (T : in out Test); procedure Check (T : in out Test; Expr : in String; Expect : in String); -- Test some reductions. procedure Test_Reduce_Expression (T : in out Test); procedure Test_Reduce_Expression_Variable (T : in out Test); end EL.Expressions.Tests;
annexi-strayline/ASAP-Unicode
Ada
20,960
adb
------------------------------------------------------------------------------ -- -- -- Unicode Utilities -- -- -- -- Unicode Character Database (UCD) Facilities -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Ada.Characters.Latin_1; with Ada.Streams.Stream_IO; with Hex; with Hex.Unsigned_8; with Hex.Unsigned_24; with Unicode.General_Category; use Unicode.General_Category; with Unicode.General_Category.Alias; procedure Unicode.UCD.Generate_General_Category_Body (UnicodeData_Path: in String := "UnicodeData.txt"; Body_Path : in String := "aura-unicode-general_category.adb") is package SIO renames Ada.Streams.Stream_IO; package GC_Alias renames Unicode.General_Category.Alias; subtype Set_Case is Hex.Set_Case; use all type Set_Case; subtype General_Category_Type is Unicode.General_Category.General_Category_Type; use all type General_Category_Type; -- Codepoint Value (0 - 16#10FFFF#, (up to FFFFFF is fine also in this -- implementation) use type Hex.Unsigned_24.Unsigned_24; subtype Codepoint_Value is Hex.Unsigned_24.Unsigned_24; procedure Encode_Codepoint (Value : in Codepoint_Value; Buffer : out String; Use_Case: in Set_Case := Upper_Case) renames Hex.Unsigned_24.Encode; -- Hash Key use type Hex.Unsigned_8.Unsigned_8; subtype Key_Hash is Hex.Unsigned_8.Unsigned_8 range 0 .. 16#10#; procedure Encode_Hash (Value : in Key_Hash; Buffer : out String; Use_Case: in Set_Case := Upper_Case) renames Hex.Unsigned_8.Encode; -- Reference Hash Table ---------------------------------------------------- type Bucket_Item; type Bucket_Item_Access is access Bucket_Item; type Codepoint_Range is record First: Codepoint_Value; Last : Codepoint_Value; end record; type Bucket_Item is record Codepoints: Codepoint_Range; Category : General_Category_Type; Next : Bucket_Item_Access := null; end record; procedure Free is new Ada.Unchecked_Deallocation (Object => Bucket_Item, Name => Bucket_Item_Access); type Bucket is record First, Last: Bucket_Item_Access := null; end record; type Hash_Table is array (Key_Hash) of Bucket; ---------------------- -- Deallocate_Table -- ---------------------- procedure Deallocate_Table (Table: in out Hash_Table) is I,N: Bucket_Item_Access; begin for B of Table loop I := B.First; while I /= null loop N := I.Next; Free (I); I := N; end loop; B.First := null; B.Last := null; end loop; end Deallocate_Table; ---------- -- Hash -- ---------- -- Numerous approaches were tried, but simply going by Unicode planes as the -- hash keeps the rages as cohesive as possible (no wonder) function Hash (Codepoint: Codepoint_Value) return Key_Hash is (Key_Hash (Codepoint / 16#1_0000#)) with Inline; ----------------- -- Append_Item -- ----------------- procedure Append_Item (To : in out Bucket; Codepoint: in Codepoint_Value; Category : in General_Category_Type) with Inline is New_Item: Bucket_Item_Access := new Bucket_Item' (Codepoints => (others => Codepoint), Category => Category, Next => null); begin if To.First = null then To.First := New_Item; To.Last := New_Item; else To.Last.Next := New_Item; To.Last := New_Item; end if; end Append_Item; -- UnicodeData.txt Parsing ------------------------------------------------- type UnicodeData_Range is (First, Last, Single); -------------------------- -- Identify_Point_Range -- -------------------------- -- UnicodeData.txt encodes codepoint ranges unusually. Instead of having a -- range in Property 0 (P0), it has a special tag in P1, where the tag is -- in angle brackets, and always ends with either ", First>" or, ", Last>". -- -- This subprogram gives a quick answer to for each entry function Identify_Point_Range (E: UCD_Entry) return UnicodeData_Range with Inline is P1: constant String := E.Property(1); P_First: constant String := ", First>"; P_Last : constant String := ", Last>"; begin if P1(P1'Last) = '>' and then P1'Length >= P_First'Length then if P1(P1'Last - P_First'Length + 1 .. P1'Last) = P_First then return First; elsif P1(P1'Last - P_Last'Length + 1 .. P1'Last) = P_Last then return Last; else return Single; end if; else return Single; end if; end Identify_Point_Range; ---------------- -- Load_Table -- ---------------- -- Parses the UnicodeData.txt file and loads the data into the hash table, -- including filling in any ranges encountered procedure Load_Table (File : in SIO.File_Type; Table: in out Hash_Table; Total: out Natural) is E: UCD_Entry; Stream: constant SIO.Stream_Access := SIO.Stream (File); Codepoint: Codepoint_Value; Category : General_Category_Type; pragma Assertion_Policy (Check); begin Total := 0; while not SIO.End_Of_File (File) loop E := Next_Entry (Stream); pragma Assert (E.First_Codepoint = E.Last_Codepoint); -- If this fails, the data is either bad, or Unicode changed the -- format, either way we wouldn't handle this properly, since -- we're expecting ranges to be expressed via P1 Codepoint := Codepoint_Value (Wide_Wide_Character'Pos (E.First_Codepoint)); Category := GC_Alias.Category_By_Alias (E.Property(2)); Append_Item (To => Table(Hash (Codepoint)), Codepoint => Codepoint, Category => Category); Total := Total + 1; -- Check for a range and add those too if Identify_Point_Range (E) = First then declare Start, Finish: Codepoint_Value; begin Start := Codepoint_Value (Wide_Wide_Character'Pos (Wide_Wide_Character'Succ (E.First_Codepoint))); -- The next entry had better be a "Last" range E := Next_Entry (Stream); pragma Assert (Identify_Point_Range (E) = Last); Finish := Codepoint_Value (Wide_Wide_Character'Pos (E.First_Codepoint)); for C in Start .. Finish loop Append_Item (To => Table(Hash (C)), Codepoint => C, Category => Category); Total := Total + 1; end loop; end; end if; end loop; end Load_Table; --------------------- -- Collapse_Ranges -- --------------------- -- Scans each bucket of contiguous ranges of the same category and collapses -- them into single entries procedure Collapse_Ranges (Table: in out Hash_Table) is begin for K in Key_Hash loop declare B: Bucket renames Table(K); Base : Bucket_Item_Access := B.First; Reach: Bucket_Item_Access; begin while Base /= null loop Reach := Base.Next; while Reach /= null loop exit when (Reach.Category /= Base.category or else (Reach.Codepoints.First /= (Base.Codepoints.Last + 1))); -- Absorb Reach Base.Codepoints.Last := Reach.Codepoints.Last; -- Isolate & Free Reach Base.Next := Reach.Next; Free (Reach); Reach := Base.Next; end loop; Base := Reach; end loop; end; end loop; end Collapse_Ranges; -- Main -------------------------------------------------------------------- UnicodeData: SIO.File_Type; Ada_File : SIO.File_Type; Ada_Stream : SIO.Stream_Access; Table: Hash_Table; Loaded_Codepoints: Natural; -- Formatting Tab : constant String := (1 .. 3 => ' '); New_Line_Sequence: constant String := (1 => Ada.Characters.Latin_1.LF); Indent: Natural := 0; procedure Put (S: in String) with Inline is begin String'Write (Ada_Stream, S); end Put; procedure Do_Indent with Inline is begin for I in 1 .. Indent loop Put (Tab); end loop; end Do_Indent; procedure Put_Line (S: in String) with Inline is begin Do_Indent; Put (S & New_Line_Sequence); end Put_Line; procedure New_Line (Count: Natural := 1) with Inline is begin for I in 1 .. Count loop Put (New_Line_Sequence); end loop; end New_Line; begin declare use SIO; begin Open (File => UnicodeData, Mode => In_File, Name => UnicodeData_Path); end; Load_Table (File => UnicodeData, Table => Table, Total => Loaded_Codepoints); SIO.Close (UnicodeData); -- Let's get to it SIO.Create (File => Ada_File, Name => Body_Path); Ada_Stream := SIO.Stream (Ada_File); -- Some stats Put_Line ("-- ******* " & "THIS FILE IS AUTOMATICALLY GENERATED " & "******* --"); Put_Line ("-- " & "- See Unicode.UCD.Generate_General_Category_Body -" & " --"); New_Line (2); Put_Line ("-- UnicodeData.txt Load Statistics --"); declare Totals: array (General_Category_Type) of Natural := (others => 0); Loaded_Calc: Natural := 0; Grand_Total: Natural := 0; I: Bucket_Item_Access; begin for B of Table loop I := B.First; while I /= null loop Totals(I.Category) := Totals(I.Category) + 1; I := I.Next; end loop; end loop; -- Confirm our totals for N of Totals loop Loaded_Calc := Loaded_Calc + N; end loop; -- UnicodeData.txt does not contain "Other_Not_Assigned (Cn)" -- so we need to calculate it ourselves Totals(Other_Not_Assigned) := 16#110000# - Loaded_Calc; for N of Totals loop Grand_Total := Grand_Total + N; end loop; declare Target_Length: constant := 26; begin for C in General_Category_Type loop declare C_Image: constant String := General_Category_Type'Image (C); Padding: constant String(1 .. (Target_Length - C_Image'Length)) := (others => ' '); begin Put_Line ("-- " & C_Image & Padding & '(' & GC_Alias.General_Category_Aliases(C) & ") =" & Natural'Image (Totals(C))); end; end loop; declare GT: constant String := "Grand Total"; Padding: constant String(1 .. (Target_Length - GT'Length)) := (others => ' '); begin Put_Line (String'(1 .. Target_Length + 20 => '-')); Put_Line ("-- " & GT & Padding & " =" & Natural'Image(Grand_Total)); end; end; Put_Line ("--"); Put_Line ("-- Sanity Checks --"); if Grand_Total = 16#110000# then Put ("-- [PASS] "); else Put ("-- [FAIL] "); end if; Put_Line ("Grand total = 16#110000# (U+000000 .. U+10FFFF)"); if Loaded_Codepoints = Loaded_Calc then Put ("-- [PASS] "); else Put ("-- [FAIL] "); end if; Put_Line ("Total loaded (" & Natural'Image (Loaded_Codepoints) & " ) = Hash table totals excluding Cn (" & Natural'Image (Loaded_Calc) & " )"); end; -- Collapse the table Collapse_Ranges (Table); -- OK, now lets do the actual file New_Line (2); Put_Line ("package body Unicode.General_Category is"); Indent := 1; -- Types and hash function Put_Line ("type Codepoint is mod 2**24;"); New_Line; -- Now we need to insert a function for each plane (bucket) with it's own -- case statement for all the ranges in that bucket declare procedure Generate_Plane_Table (Table: Hash_Table; Key: Key_Hash) is B: Bucket renames Table(Key); Hash_Hex: String (1 .. 4); Plane: String renames Hash_Hex (3 .. 4); Codepoint_Hex: String (1 .. 6); I: Bucket_Item_Access := B.First; begin Encode_Hash (Value => Key, Buffer => Hash_Hex); Indent := 1; New_Line; Put_Line ("function Plane_" & Plane & "_Lookup (C: Codepoint) " & "return General_Category_Type is"); Indent := 2; if I = null then -- Nothing here, this is just a direct return Put_Line ("(" & General_Category_Type'Image (Other_Not_Assigned) & ") with Inline;"); return; end if; Put_Line ("(case C is"); Indent := 3; while I /= null loop Do_Indent; Put ("when "); Encode_Codepoint (Value => I.Codepoints.First, Buffer => Codepoint_Hex); Put ("16#" & Codepoint_Hex & "# "); if I.Codepoints.Last > I.Codepoints.First then Encode_Codepoint (Value => I.Codepoints.Last, Buffer => Codepoint_Hex); Put (".. 16#" & Codepoint_Hex & "# "); else Put (" " & " " & " "); end if; Put ("=> " & General_Category_Type'Image (I.Category) & ','); New_Line; I := I.Next; end loop; New_Line; Put_Line ("when others => " & General_Category_Type'Image (Other_Not_Assigned) & ")"); Indent := 2; Put_Line ("with Inline;"); end Generate_Plane_Table; begin for K in Key_Hash loop Generate_Plane_Table (Table, K); end loop; end; -- Finally, The actual body for General_Category Indent := 1; New_Line (2); Put_Line ("----------------------"); Put_Line ("-- General_Category --"); Put_Line ("----------------------"); Indent := 1; Put_Line ("function General_Category (C: Wide_Wide_Character)"); Put_Line (" return General_Category_Type"); Put_Line ("is"); Indent := 2; Put_Line ("CP: constant Codepoint " & ":= Codepoint (Wide_Wide_Character'Pos(C));"); Indent := 1; Put_Line ("begin"); Indent := 2; Put_Line ("return"); Indent := 3; Put_Line ("(case CP is"); declare procedure Generate_Dispatch_Line (Key: Key_Hash) is Hash_Hex: String (1 .. 4); Plane: String renames Hash_Hex (3 .. 4); Start_Hex, End_Hex: String (1 .. 6); C: Codepoint_Value := ((Codepoint_Value(Key) + 1) * 16#1_0000#) - 1; begin Encode_Hash (Value => Key, Buffer => Hash_Hex); Encode_Codepoint (Value => C and 16#FF_0000#, Buffer => Start_Hex); Encode_Codepoint (Value => C, Buffer => End_Hex); Indent := 4; Put_Line ("when 16#" & Start_Hex & "# .. " & "16#" & End_Hex & "# => " & "Plane_" & Plane & "_Lookup (CP),"); end Generate_Dispatch_Line; begin for K in Key_Hash loop Generate_Dispatch_Line (K); end loop; New_Line; Put_Line ("when others => " & General_Category_Type'Image (Other_Not_Assigned) & ");"); end; Indent := 1; Put_Line ("end General_Category;"); Indent := 0; New_Line; Put_Line ("end Unicode.General_Category;"); SIO.Close (Ada_File); Deallocate_Table (Table); exception when others => Deallocate_Table (Table); SIO.Close (UnicodeData); SIO.Close (Ada_File); raise; end Unicode.UCD.Generate_General_Category_Body;
reznikmm/webidl
Ada
2,328
ads
-- SPDX-FileCopyrightText: 2010-2021 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with WebIDL.Abstract_Sources; with League.Strings; with WebIDL.Scanner_Handlers; with WebIDL.Tokens; with WebIDL.Scanner_Types; use WebIDL.Scanner_Types; package WebIDL.Scanners is pragma Preelaborate; subtype Token is WebIDL.Tokens.Token; type Scanner is tagged limited private; procedure Set_Source (Self : in out Scanner'Class; Source : not null WebIDL.Abstract_Sources.Source_Access); procedure Set_Handler (Self : in out Scanner'Class; Handler : not null WebIDL.Scanner_Handlers.Handler_Access); subtype Start_Condition is State; procedure Set_Start_Condition (Self : in out Scanner'Class; Condition : Start_Condition); function Get_Start_Condition (Self : Scanner'Class) return Start_Condition; procedure Get_Token (Self : access Scanner'Class; Result : out Token); function Get_Text (Self : Scanner'Class) return League.Strings.Universal_String; function Get_Token_Length (Self : Scanner'Class) return Positive; function Get_Token_Position (Self : Scanner'Class) return Positive; private Buffer_Half_Size : constant := 2048; subtype Buffer_Index is Positive range 1 .. 2 * Buffer_Half_Size; type Character_Class_Array is array (Buffer_Index) of Character_Class; Error_Character : constant Character_Class := 0; Error_State : constant State := State'Last; type Buffer_Half is (Low, High); type Buffer_Offset is array (Buffer_Half) of Natural; type Scanner is tagged limited record Handler : WebIDL.Scanner_Handlers.Handler_Access; Source : WebIDL.Abstract_Sources.Source_Access; Start : State := INITIAL; Next : Buffer_Index := 1; From : Buffer_Index := 1; To : Natural := 0; Rule : Scanner_Types.Rule_Index; Offset : Buffer_Offset := (0, 0); Buffer : Wide_Wide_String (Buffer_Index) := (1 => Wide_Wide_Character'Val (WebIDL.Abstract_Sources.End_Of_Buffer), others => <>); Classes : Character_Class_Array := (1 => Error_Character, others => <>); end record; procedure Read_Buffer (Self : in out Scanner'Class); end WebIDL.Scanners;
sungyeon/drake
Ada
1,517
ads
pragma License (Unrestricted); -- separated and auto-loaded by compiler private generic type Num is digits <>; package Ada.Text_IO.Float_IO is Default_Fore : Field := 2; Default_Aft : Field := Num'Digits - 1; Default_Exp : Field := 3; procedure Get ( File : File_Type; -- Input_File_Type Item : out Num; Width : Field := 0); procedure Get ( Item : out Num; Width : Field := 0); procedure Get ( File : not null File_Access; Item : out Num; Width : Field := 0); -- alt procedure Put ( File : File_Type; -- Output_File_Type Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Put ( Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Put ( File : not null File_Access; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); -- alt procedure Get ( From : String; Item : out Num; Last : out Positive); procedure Put ( To : out String; Item : Num; Aft : Field := Default_Aft; Exp : Field := Default_Exp); -- extended -- This subprogram is used in Complex_IO. procedure Put ( To : out String; Last : out Natural; Item : Num; Aft : Field := Default_Aft; Exp : Field := Default_Exp); end Ada.Text_IO.Float_IO;
persan/a-vulkan
Ada
1,702
ads
pragma Ada_2012; pragma Style_Checks (Off); with System; package Vulkan.Low_Level.vulkan_wayland_h is VULKAN_WAYLAND_H_u : constant := 1; -- vulkan_wayland.h:2 VK_KHR_wayland_surface : constant := 1; -- vulkan_wayland.h:32 VK_KHR_WAYLAND_SURFACE_SPEC_VERSION : constant := 6; -- vulkan_wayland.h:33 VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME : aliased constant String := "VK_KHR_wayland_surface" & ASCII.NUL; -- vulkan_wayland.h:34 --** Copyright (c) 2015-2019 The Khronos Group Inc. --** --** 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. -- --** This header is generated from the Khronos Vulkan XML API Registry. --** -- type wl_display; type wl_surface; type VkWaylandSurfaceCreateInfoKHR is record pNext : System.Address; -- vulkan_wayland.h:38 display : access wl_display; -- vulkan_wayland.h:40 surface : access wl_surface; -- vulkan_wayland.h:41 end record with Convention => C_Pass_By_Copy; -- vulkan_wayland.h:36 type wl_display is null record; -- incomplete struct type wl_surface is null record; -- incomplete struct end Vulkan.Low_Level.vulkan_wayland_h;
reznikmm/matreshka
Ada
15,392
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- SQL Database Access -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-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 Interfaces.C; with League.Strings.Internals; with Matreshka.Internals.Strings; with Matreshka.Internals.Strings.C; with Matreshka.Internals.SQL_Parameter_Rewriters.SQLite3; package body Matreshka.Internals.SQL_Drivers.SQLite3.Queries is use type Interfaces.C.int; use type Matreshka.Internals.Utf16.Utf16_String_Index; procedure Call (Self : not null access SQLite3_Query'Class; Code : Interfaces.C.int); -- Process return code, constructs error message when code is error. Last_Insert_Rowid_Parameter : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("last_insert_rowid"); -- Name of the pseudo-parameter to obtain value of identifier of last -- inserted row. This name must be in casefolded form to pass parameter -- name check. Rewriter : SQL_Parameter_Rewriters.SQLite3.SQLite3_Parameter_Rewriter; -- SQL statement parameter rewriter. ---------------- -- Bind_Value -- ---------------- overriding procedure Bind_Value (Self : not null access SQLite3_Query; Name : League.Strings.Universal_String; Value : League.Holders.Holder; Direction : SQL.Parameter_Directions) is pragma Unreferenced (Direction); -- SQLite3 supports 'in' parameters only. begin Self.Parameters.Set_Value (Name, Value); end Bind_Value; ----------------- -- Bound_Value -- ----------------- overriding function Bound_Value (Self : not null access SQLite3_Query; Name : League.Strings.Universal_String) return League.Holders.Holder is use type League.Strings.Universal_String; begin if Name = Last_Insert_Rowid_Parameter then -- Handle LAST_INSERT_ROWID pseudo-parameter. return Result : League.Holders.Holder do League.Holders.Set_Tag (Result, League.Holders.Universal_Integer_Tag); League.Holders.Replace_Element (Result, Self.Last_Row_Id); end return; end if; return League.Holders.Empty_Holder; end Bound_Value; ---------- -- Call -- ---------- procedure Call (Self : not null access SQLite3_Query'Class; Code : Interfaces.C.int) is begin -- Clear previous error state. Self.Success := True; Self.Error.Clear; case Code is when SQLITE_OK => -- Operation executed successfully. null; when SQLITE_DONE => -- When operation can retrieve row this reasult means that there -- is no row retrived. Self.Has_Row := False; when SQLITE_ROW => -- When operation can retrieve row this reasult means that there -- is row retrived. Self.Has_Row := True; when others => -- All others return codes are errors. Self.Success := False; Self.Error := Matreshka.Internals.Strings.C.To_Valid_Universal_String (sqlite3_errmsg16 (Databases.SQLite3_Database'Class (Self.Database.all).Database_Handle)); end case; end Call; ------------------- -- Error_Message -- ------------------- overriding function Error_Message (Self : not null access SQLite3_Query) return League.Strings.Universal_String is begin return Self.Error; end Error_Message; ------------- -- Execute -- ------------- overriding function Execute (Self : not null access SQLite3_Query) return Boolean is Value : League.Holders.Holder; begin if Self.Handle = null then -- Statement was not prepared. return False; end if; if Self.Is_Active then -- Finish execution of the current statement when it is active. Self.Finish; end if; -- Bind parameters. for J in 1 .. Self.Parameters.Number_Of_Positional loop Value := Self.Parameters.Value (J); if League.Holders.Is_Empty (Value) then -- Bind NULL value of any type (SQLite3 doesn't distinguish type -- of NULL value). Self.Call (sqlite3_bind_null (Self.Handle, Interfaces.C.int (J))); elsif League.Holders.Is_Universal_String (Value) then -- Bind text value. Self.Call (sqlite3_bind_text16 (Self.Handle, Interfaces.C.int (J), League.Strings.Internals.Internal (League.Holders.Element (Value)).Value (0)'Access, Interfaces.C.int (League.Strings.Internals.Internal (League.Holders.Element (Value)).Unused * 2), null)); -- Copy of string value is stored in the parameters map, so -- provides warranty that it will not be deallocated/modified till -- another value will be bind. As result, copy of string data is -- not needed. elsif League.Holders.Is_Abstract_Integer (Value) then -- Bind integer value. Self.Call (sqlite3_bind_int64 (Self.Handle, Interfaces.C.int (J), League.Holders.Element (Value))); elsif League.Holders.Is_Abstract_Float (Value) then -- Bind float value. Self.Call (sqlite3_bind_double (Self.Handle, Interfaces.C.int (J), Interfaces.C.double (League.Holders.Universal_Float' (League.Holders.Element (Value))))); end if; end loop; -- Execute statement. Self.Call (sqlite3_step (Self.Handle)); Self.Skip_Step := Self.Has_Row; if Self.Success then Self.Is_Active := True; end if; -- Store value of last_insert_rowid, it is accessible through -- LAST_INSERT_ROWID output parameter. Self.Last_Row_Id := League.Holders.Universal_Integer (sqlite3_last_insert_rowid (Databases.SQLite3_Database'Class (Self.Database.all).Database_Handle)); return Self.Success; end Execute; ------------ -- Finish -- ------------ overriding procedure Finish (Self : not null access SQLite3_Query) is begin if not Self.Is_Active then -- Returns when query is not active. return; end if; Self.Call (sqlite3_reset (Self.Handle)); Self.Is_Active := False; end Finish; ---------------- -- Initialize -- ---------------- procedure Initialize (Self : not null access SQLite3_Query'Class; Database : not null access Databases.SQLite3_Database'Class) is begin SQL_Drivers.Initialize (Self, Database_Access (Database)); end Initialize; ---------------- -- Invalidate -- ---------------- overriding procedure Invalidate (Self : not null access SQLite3_Query) is begin if Self.Database /= null then if Self.Handle /= null then Self.Call (sqlite3_finalize (Self.Handle)); Self.Handle := null; end if; end if; -- Call Invalidate of parent tagged type. Abstract_Query (Self.all).Invalidate; end Invalidate; --------------- -- Is_Active -- --------------- overriding function Is_Active (Self : not null access SQLite3_Query) return Boolean is begin return Self.Is_Active; end Is_Active; -------------- -- Is_Valid -- -------------- overriding function Is_Valid (Self : not null access SQLite3_Query) return Boolean is begin return Self.Has_Row and not Self.Skip_Step; end Is_Valid; ---------- -- Next -- ---------- overriding function Next (Self : not null access SQLite3_Query) return Boolean is begin if not Self.Is_Active then -- Returns immidiatly when statement is not active. return False; end if; if Self.Skip_Step then Self.Skip_Step := False; elsif Self.Has_Row then Self.Call (sqlite3_step (Self.Handle)); end if; return Self.Has_Row; end Next; ------------- -- Prepare -- ------------- overriding function Prepare (Self : not null access SQLite3_Query; Query : League.Strings.Universal_String) return Boolean is Rewritten : League.Strings.Universal_String; Aux : aliased Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access; begin if Self.Handle /= null then -- Release existing handle. Self.Call (sqlite3_finalize (Self.Handle)); Self.Handle := null; end if; -- Rewrite statement and prepare set of parameters. Rewriter.Rewrite (Query, Rewritten, Self.Parameters); -- Note: http://www.sqlite.org/c3ref/prepare.html -- -- "If the caller knows that the supplied string is nul-terminated, then -- there is a small performance advantage to be gained by passing an -- nByte parameter that is equal to the number of bytes in the input -- string including the nul-terminator bytes." -- -- And it's exactly our case. Self.Call (sqlite3_prepare16_v2 (Databases.SQLite3_Database'Class (Self.Database.all).Database_Handle, League.Strings.Internals.Internal (Rewritten).Value, Interfaces.C.int ((League.Strings.Internals.Internal (Rewritten).Unused + 1) * 2), Self.Handle'Unchecked_Access, Aux'Unchecked_Access)); Self.Is_Active := False; return Self.Success; end Prepare; ----------- -- Value -- ----------- overriding function Value (Self : not null access SQLite3_Query; Index : Positive) return League.Holders.Holder is Text : Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access; Length : Matreshka.Internals.Utf16.Utf16_String_Index; Value : League.Holders.Holder; begin case sqlite3_column_type (Self.Handle, Interfaces.C.int (Index - 1)) is when SQLITE_INTEGER => -- Create universal integer value. League.Holders.Set_Tag (Value, League.Holders.Universal_Integer_Tag); League.Holders.Replace_Element (Value, sqlite3_column_int64 (Self.Handle, Interfaces.C.int (Index - 1))); when SQLITE_FLOAT => -- Create universal float value. League.Holders.Set_Tag (Value, League.Holders.Universal_Float_Tag); League.Holders.Replace_Element (Value, League.Holders.Universal_Float (sqlite3_column_double (Self.Handle, Interfaces.C.int (Index - 1)))); when SQLITE_TEXT => -- Create universal string value. Text := sqlite3_column_text16 (Self.Handle, Interfaces.C.int (Index - 1)); Length := Matreshka.Internals.Utf16.Utf16_String_Index (sqlite3_column_bytes16 (Self.Handle, Interfaces.C.int (Index - 1))); League.Holders.Set_Tag (Value, League.Holders.Universal_String_Tag); if Length = 0 then League.Holders.Replace_Element (Value, League.Strings.Empty_Universal_String); else League.Holders.Replace_Element (Value, Matreshka.Internals.Strings.C.To_Valid_Universal_String (Text, Length / 2)); end if; when SQLITE_BLOB => -- Not supported yet. null; when SQLITE_NULL => -- Value is initialized to be empty by default. null; when others => null; end case; return Value; end Value; end Matreshka.Internals.SQL_Drivers.SQLite3.Queries;
reznikmm/matreshka
Ada
4,672
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_Style.Print_Orientation_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Style_Print_Orientation_Attribute_Node is begin return Self : Style_Print_Orientation_Attribute_Node do Matreshka.ODF_Style.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Style_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Style_Print_Orientation_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Print_Orientation_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Style_URI, Matreshka.ODF_String_Constants.Print_Orientation_Attribute, Style_Print_Orientation_Attribute_Node'Tag); end Matreshka.ODF_Style.Print_Orientation_Attributes;
reznikmm/matreshka
Ada
4,702
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013-2016, 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 XML.SAX.Output_Destinations.Strings is pragma Preelaborate; type String_Output_Destination is limited new XML.SAX.Output_Destinations.SAX_Output_Destination with private; function Get_Text (Self : String_Output_Destination) return League.Strings.Universal_String; -- Returns accumulated text. procedure Clear (Self : in out String_Output_Destination); -- Reset Self to empty state overriding function Get_Encoding (Self : String_Output_Destination) return League.Strings.Universal_String; -- Returns character encoding used to convert Unicode character code point -- into the external items. overriding procedure Put (Self : in out String_Output_Destination; Text : League.Strings.Universal_String); overriding procedure Put (Self : in out String_Output_Destination; Text : Wide_Wide_String); overriding procedure Put (Self : in out String_Output_Destination; Char : League.Characters.Universal_Character); overriding procedure Put (Self : in out String_Output_Destination; Char : Wide_Wide_Character); private type String_Output_Destination is limited new XML.SAX.Output_Destinations.SAX_Output_Destination with record Text : League.Strings.Universal_String; end record; end XML.SAX.Output_Destinations.Strings;
Rodeo-McCabe/orka
Ada
10,818
ads
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2013 Felix Krause <[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.Buffers; with GL.Low_Level.Enums; with GL.Objects.Textures; with GL.Pixels.Extensions; with GL.Types.Colors; private with GL.Enums; package GL.Objects.Framebuffers is pragma Preelaborate; use all type GL.Low_Level.Enums.Texture_Kind; type Framebuffer_Status is (Undefined, Complete, Incomplete_Attachment, Incomplete_Missing_Attachment, Incomplete_Draw_Buffer, Incomplete_Read_Buffer, Unsupported, Incomplete_Multisample, Incomplete_Layer_Targets); type Attachment_Point is (Depth_Stencil_Attachment, Color_Attachment_0, Color_Attachment_1, Color_Attachment_2, Color_Attachment_3, Color_Attachment_4, Color_Attachment_5, Color_Attachment_6, Color_Attachment_7, Color_Attachment_8, Color_Attachment_9, Color_Attachment_10, Color_Attachment_11, Color_Attachment_12, Color_Attachment_13, Color_Attachment_14, Color_Attachment_15, Depth_Attachment, Stencil_Attachment); type Default_Attachment_Point is (Front_Left, Front_Right, Back_Left, Back_Right, Depth, Stencil); type Attachment_List is array (Positive range <>) of Attachment_Point; type Default_Attachment_List is array (Positive range <>) of Default_Attachment_Point; function Valid_Attachment (Attachment : Attachment_Point; Texture : Textures.Texture) return Boolean with Pre => not Texture.Compressed and Texture.Allocated; type Framebuffer is new GL_Object with private; overriding procedure Initialize_Id (Object : in out Framebuffer); overriding procedure Delete_Id (Object : in out Framebuffer); overriding function Identifier (Object : Framebuffer) return Types.Debug.Identifier is (Types.Debug.Framebuffer); procedure Set_Draw_Buffer (Object : Framebuffer; Selector : Buffers.Color_Buffer_Selector) with Pre => (if Object = Default_Framebuffer then Selector in Buffers.Default_Color_Buffer_Selector | Buffers.None else Selector in Buffers.Explicit_Color_Buffer_Selector | Buffers.None); procedure Set_Draw_Buffers (Object : Framebuffer; List : Buffers.Color_Buffer_List) with Pre => (if Object = Default_Framebuffer then (for all S of List => S in Buffers.Default_Color_Buffer_Selector | Buffers.None) else (for all S of List => S in Buffers.Explicit_Color_Buffer_Selector | Buffers.None)); procedure Set_Read_Buffer (Object : Framebuffer; Selector : Buffers.Color_Buffer_Selector) with Pre => (if Object = Default_Framebuffer then Selector in Buffers.Default_Color_Buffer_Selector | Buffers.None else Selector in Buffers.Explicit_Color_Buffer_Selector | Buffers.None); procedure Attach_Texture (Object : Framebuffer; Attachment : Attachment_Point; Texture : Textures.Texture; Level : Textures.Mipmap_Level) with Pre => Object /= Default_Framebuffer and Valid_Attachment (Attachment, Texture) and (if Texture.Kind in Texture_2D_Multisample | Texture_2D_Multisample_Array then Level = 0); procedure Attach_Texture_Layer (Object : Framebuffer; Attachment : Attachment_Point; Texture : Textures.Texture; Level : Textures.Mipmap_Level; Layer : Natural) with Pre => Object /= Default_Framebuffer and Valid_Attachment (Attachment, Texture) and Texture.Layered; procedure Detach (Object : Framebuffer; Attachment : Attachment_Point) with Pre => Object /= Default_Framebuffer; procedure Invalidate_Data (Object : Framebuffer; Attachments : Attachment_List) with Pre => Object /= Default_Framebuffer; procedure Invalidate_Sub_Data (Object : Framebuffer; Attachments : Attachment_List; X, Y : Int; Width, Height : Size) with Pre => Object /= Default_Framebuffer; procedure Invalidate_Data (Object : Framebuffer; Attachments : Default_Attachment_List) with Pre => Object = Default_Framebuffer; procedure Invalidate_Sub_Data (Object : Framebuffer; Attachments : Default_Attachment_List; X, Y : Int; Width, Height : Size) with Pre => Object = Default_Framebuffer; procedure Set_Default_Width (Object : Framebuffer; Value : Size); procedure Set_Default_Height (Object : Framebuffer; Value : Size); procedure Set_Default_Layers (Object : Framebuffer; Value : Size); procedure Set_Default_Samples (Object : Framebuffer; Value : Size); procedure Set_Default_Fixed_Sample_Locations (Object : Framebuffer; Value : Boolean); function Default_Width (Object : Framebuffer) return Size; function Default_Height (Object : Framebuffer) return Size; function Default_Layers (Object : Framebuffer) return Size; function Default_Samples (Object : Framebuffer) return Size; function Default_Fixed_Sample_Locations (Object : Framebuffer) return Boolean; function Max_Framebuffer_Width return Size with Post => Max_Framebuffer_Width'Result >= 16_384; function Max_Framebuffer_Height return Size with Post => Max_Framebuffer_Height'Result >= 16_384; function Max_Framebuffer_Layers return Size with Post => Max_Framebuffer_Layers'Result >= 2_048; function Max_Framebuffer_Samples return Size with Post => Max_Framebuffer_Samples'Result >= 4; procedure Blit (Read_Object, Draw_Object : Framebuffer; Src_X0, Src_Y0, Src_X1, Src_Y1, Dst_X0, Dst_Y0, Dst_X1, Dst_Y1 : Int; Mask : Buffers.Buffer_Bits; Filter : Textures.Magnifying_Function); -- Copy a rectangle of pixels in Read_Object framebuffer to a region -- in Draw_Object framebuffer procedure Clear_Color_Buffer (Object : Framebuffer; Index : Buffers.Draw_Buffer_Index; Format_Type : Pixels.Extensions.Format_Type; Value : Colors.Color); procedure Clear_Depth_Buffer (Object : Framebuffer; Value : Buffers.Depth); procedure Clear_Stencil_Buffer (Object : Framebuffer; Value : Buffers.Stencil_Index); procedure Clear_Depth_And_Stencil_Buffer (Object : Framebuffer; Depth_Value : Buffers.Depth; Stencil_Value : Buffers.Stencil_Index); type Framebuffer_Target (<>) is tagged limited private; procedure Bind (Target : Framebuffer_Target; Object : Framebuffer'Class); function Status (Object : Framebuffer; Target : Framebuffer_Target'Class) return Framebuffer_Status; Read_Target : constant Framebuffer_Target; Draw_Target : constant Framebuffer_Target; function Default_Framebuffer return Framebuffer; private for Framebuffer_Status use (Undefined => 16#8219#, Complete => 16#8CD5#, Incomplete_Attachment => 16#8CD6#, Incomplete_Missing_Attachment => 16#8CD7#, Incomplete_Draw_Buffer => 16#8CDB#, Incomplete_Read_Buffer => 16#8CDC#, Unsupported => 16#8CDD#, Incomplete_Multisample => 16#8D56#, Incomplete_Layer_Targets => 16#8DA8#); for Framebuffer_Status'Size use Low_Level.Enum'Size; for Attachment_Point use (Depth_Stencil_Attachment => 16#821A#, Color_Attachment_0 => 16#8CE0#, Color_Attachment_1 => 16#8CE1#, Color_Attachment_2 => 16#8CE2#, Color_Attachment_3 => 16#8CE3#, Color_Attachment_4 => 16#8CE4#, Color_Attachment_5 => 16#8CE5#, Color_Attachment_6 => 16#8CE6#, Color_Attachment_7 => 16#8CE7#, Color_Attachment_8 => 16#8CE8#, Color_Attachment_9 => 16#8CE9#, Color_Attachment_10 => 16#8CEA#, Color_Attachment_11 => 16#8CEB#, Color_Attachment_12 => 16#8CEC#, Color_Attachment_13 => 16#8CED#, Color_Attachment_14 => 16#8CEE#, Color_Attachment_15 => 16#8CEF#, Depth_Attachment => 16#8D00#, Stencil_Attachment => 16#8D20#); for Attachment_Point'Size use Low_Level.Enum'Size; for Default_Attachment_Point use (Front_Left => 16#0400#, Front_Right => 16#0401#, Back_Left => 16#0402#, Back_Right => 16#0403#, Depth => 16#1801#, Stencil => 16#1802#); for Default_Attachment_Point'Size use Low_Level.Enum'Size; pragma Convention (C, Attachment_List); pragma Convention (C, Default_Attachment_List); type Framebuffer is new GL_Object with null record; type Framebuffer_Target (Kind : Enums.Framebuffer_Kind) is tagged limited null record; Read_Target : constant Framebuffer_Target := Framebuffer_Target'(Kind => Enums.Read); Draw_Target : constant Framebuffer_Target := Framebuffer_Target'(Kind => Enums.Draw); end GL.Objects.Framebuffers;
gabemgem/LITEC
Ada
10,375
adb
M:lab3servo F:G$SYSCLK_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$UART0_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$Sys_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$putchar$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$getchar$0$0({2}DF,SC:U),C,0,0,0,0,0 F:G$getchar_nw$0$0({2}DF,SC:U),C,0,0,0,0,0 F:G$main$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$Port_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$XBR0_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$PCA_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$PCA_ISR$0$0({2}DF,SV:S),Z,0,0,1,9,0 F:G$Steering_Servo$0$0({2}DF,SV:S),Z,0,0,0,0,0 S:Llab3servo.getchar$c$1$10({1}SC:U),R,0,0,[] S:Llab3servo.getchar_nw$c$1$12({1}SC:U),R,0,0,[] S:G$PW_CENTER$0$0({2}SI:U),E,0,0 S:G$PW_RIGHT$0$0({2}SI:U),E,0,0 S:G$PW_LEFT$0$0({2}SI:U),E,0,0 S:G$SERVO_PW$0$0({2}SI:U),E,0,0 S:G$PCA_start$0$0({2}SI:U),E,0,0 S:G$input$0$0({1}SC:U),E,0,0 S:Llab3servo.aligned_alloc$size$1$39({2}SI:U),E,0,0 S:Llab3servo.aligned_alloc$alignment$1$39({2}SI:U),E,0,0 S:Llab3servo.main$input$1$52({1}SC:U),R,0,0,[r7] S:G$P0$0$0({1}SC:U),I,0,0 S:G$SP$0$0({1}SC:U),I,0,0 S:G$DPL$0$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1}SX:U),J,0,0 S:G$MODF$0$0({1}SX:U),J,0,0 S:G$WCOL$0$0({1}SX:U),J,0,0 S:G$SPIF$0$0({1}SX:U),J,0,0 S:G$SYSCLK_Init$0$0({2}DF,SV:S),C,0,0 S:G$UART0_Init$0$0({2}DF,SV:S),C,0,0 S:G$Sys_Init$0$0({2}DF,SV:S),C,0,0 S:G$getchar_nw$0$0({2}DF,SC:U),C,0,0 S:G$_print_format$0$0({2}DF,SI:S),C,0,0 S:G$printf_small$0$0({2}DF,SV:S),C,0,0 S:G$printf$0$0({2}DF,SI:S),C,0,0 S:G$vprintf$0$0({2}DF,SI:S),C,0,0 S:G$sprintf$0$0({2}DF,SI:S),C,0,0 S:G$vsprintf$0$0({2}DF,SI:S),C,0,0 S:G$puts$0$0({2}DF,SI:S),C,0,0 S:G$getchar$0$0({2}DF,SC:U),C,0,0 S:G$putchar$0$0({2}DF,SV:S),C,0,0 S:G$printf_fast$0$0({2}DF,SV:S),C,0,0 S:G$printf_fast_f$0$0({2}DF,SV:S),C,0,0 S:G$printf_tiny$0$0({2}DF,SV:S),C,0,0 S:G$atof$0$0({2}DF,SF:S),C,0,0 S:G$atoi$0$0({2}DF,SI:S),C,0,0 S:G$atol$0$0({2}DF,SL:S),C,0,0 S:G$_uitoa$0$0({2}DF,SV:S),C,0,0 S:G$_itoa$0$0({2}DF,SV:S),C,0,0 S:G$_ultoa$0$0({2}DF,SV:S),C,0,0 S:G$_ltoa$0$0({2}DF,SV:S),C,0,0 S:G$rand$0$0({2}DF,SI:S),C,0,0 S:G$srand$0$0({2}DF,SV:S),C,0,0 S:G$calloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$malloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$realloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$aligned_alloc$0$0({2}DF,DG,SV:S),C,0,0 S:G$free$0$0({2}DF,SV:S),C,0,0 S:G$abs$0$0({2}DF,SI:S),C,0,0 S:G$labs$0$0({2}DF,SL:S),C,0,0 S:G$mblen$0$0({2}DF,SI:S),C,0,0 S:G$mbtowc$0$0({2}DF,SI:S),C,0,0 S:G$wctomb$0$0({2}DF,SI:S),C,0,0 S:G$main$0$0({2}DF,SV:S),C,0,0 S:Flab3servo$__str_0$0$0({39}DA39d,SC:S),D,0,0 S:Flab3servo$__str_1$0$0({97}DA97d,SC:S),D,0,0 S:Flab3servo$__str_2$0$0({79}DA79d,SC:S),D,0,0 S:Flab3servo$__str_3$0$0({49}DA49d,SC:S),D,0,0 S:Flab3servo$__str_4$0$0({80}DA80d,SC:S),D,0,0 S:Flab3servo$__str_5$0$0({14}DA14d,SC:S),D,0,0
reznikmm/matreshka
Ada
4,899
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.Generic_Collections; package AMF.OCL.Variables.Collections is pragma Preelaborate; package OCL_Variable_Collections is new AMF.Generic_Collections (OCL_Variable, OCL_Variable_Access); type Set_Of_OCL_Variable is new OCL_Variable_Collections.Set with null record; Empty_Set_Of_OCL_Variable : constant Set_Of_OCL_Variable; type Ordered_Set_Of_OCL_Variable is new OCL_Variable_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_OCL_Variable : constant Ordered_Set_Of_OCL_Variable; type Bag_Of_OCL_Variable is new OCL_Variable_Collections.Bag with null record; Empty_Bag_Of_OCL_Variable : constant Bag_Of_OCL_Variable; type Sequence_Of_OCL_Variable is new OCL_Variable_Collections.Sequence with null record; Empty_Sequence_Of_OCL_Variable : constant Sequence_Of_OCL_Variable; private Empty_Set_Of_OCL_Variable : constant Set_Of_OCL_Variable := (OCL_Variable_Collections.Set with null record); Empty_Ordered_Set_Of_OCL_Variable : constant Ordered_Set_Of_OCL_Variable := (OCL_Variable_Collections.Ordered_Set with null record); Empty_Bag_Of_OCL_Variable : constant Bag_Of_OCL_Variable := (OCL_Variable_Collections.Bag with null record); Empty_Sequence_Of_OCL_Variable : constant Sequence_Of_OCL_Variable := (OCL_Variable_Collections.Sequence with null record); end AMF.OCL.Variables.Collections;
stcarrez/ada-wiki
Ada
6,634
ads
----------------------------------------------------------------------- -- wiki-filters-html -- Wiki HTML filters -- Copyright (C) 2015, 2016, 2020 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. ----------------------------------------------------------------------- private with Ada.Containers.Vectors; -- === HTML Filters === -- The `Wiki.Filters.Html` package implements a customizable HTML filter that verifies -- the HTML content embedded in the Wiki text. The HTML filter can be customized to indicate -- the HTML tags that must be accepted or ignored. By default, the filter accepts all HTML -- tags except 'script', 'noscript', 'style'. -- -- * A tag can be `Forbidden` in which case it is not passed to the document. -- If this tag contains inner HTML elements, they are passed to the document. -- By default, the `html`, `head`, `meta`, `title`, `script`, `body` are not -- passed to the document. -- * A tag can be `Hidden` in which case it is not passed to the document and -- the inner HTML elements it contains are also silently ignored. -- By default this is the case for `script`, `noscript` and `style`. -- -- The HTML filter may be declared and configured as follows: -- -- F : aliased Wiki.Filters.Html.Html_Filter_Type; -- ... -- F.Forbidden (Wiki.Filters.Html.A_TAG); -- -- With this configuration the HTML links will be ignored by the parser. -- The following configuration: -- -- F.Hide (Wiki.Filters.Html.TABLE_TAG); -- -- will remove the table and its content. -- -- The filter is added to the Wiki parser filter chain by using the <tt>Add_Filter</tt> -- operation: -- -- Engine.Add_Filter (F'Unchecked_Access); -- -- package Wiki.Filters.Html is -- ------------------------------ -- Filter type -- ------------------------------ type Html_Filter_Type is new Filter_Type with private; -- Add a simple node such as N_LINE_BREAK, N_HORIZONTAL_RULE or N_PARAGRAPH to the document. overriding procedure Add_Node (Filter : in out Html_Filter_Type; Document : in out Wiki.Documents.Document; Kind : in Wiki.Nodes.Simple_Node_Kind); -- Add a text content with the given format to the document. overriding procedure Add_Text (Filter : in out Html_Filter_Type; Document : in out Wiki.Documents.Document; Text : in Wiki.Strings.WString; Format : in Wiki.Format_Map); -- Push a HTML node with the given tag to the document. overriding procedure Push_Node (Filter : in out Html_Filter_Type; Document : in out Wiki.Documents.Document; Tag : in Wiki.Html_Tag; Attributes : in out Wiki.Attributes.Attribute_List); -- Pop a HTML node with the given tag. overriding procedure Pop_Node (Filter : in out Html_Filter_Type; Document : in out Wiki.Documents.Document; Tag : in Wiki.Html_Tag); -- Add a link. overriding procedure Add_Link (Filter : in out Html_Filter_Type; Document : in out Wiki.Documents.Document; Name : in Wiki.Strings.WString; Attributes : in out Wiki.Attributes.Attribute_List); -- Add an image. overriding procedure Add_Image (Filter : in out Html_Filter_Type; Document : in out Wiki.Documents.Document; Name : in Wiki.Strings.WString; Attributes : in out Wiki.Attributes.Attribute_List); -- Finish the document after complete wiki text has been parsed. overriding procedure Finish (Filter : in out Html_Filter_Type; Document : in out Wiki.Documents.Document); -- Mark the HTML tag as being forbidden. procedure Forbidden (Filter : in out Html_Filter_Type; Tag : in Html_Tag); -- Mark the HTML tag as being allowed. procedure Allowed (Filter : in out Html_Filter_Type; Tag : in Html_Tag); -- Mark the HTML tag as being hidden. The tag and its inner content including the text -- will be removed and not passed to the final document. procedure Hide (Filter : in out Html_Filter_Type; Tag : in Html_Tag); -- Mark the HTML tag as being visible. procedure Visible (Filter : in out Html_Filter_Type; Tag : in Html_Tag); -- Flush the HTML element that have not yet been closed. procedure Flush_Stack (Filter : in out Html_Filter_Type; Document : in out Wiki.Documents.Document); private use Wiki.Nodes; package Tag_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Html_Tag); subtype Tag_Vector is Tag_Vectors.Vector; subtype Tag_Cursor is Tag_Vectors.Cursor; type Html_Filter_Type is new Filter_Type with record Allowed : Tag_Boolean_Array := (UNKNOWN_TAG => False, SCRIPT_TAG => False, ROOT_HTML_TAG => False, HEAD_TAG => False, BODY_TAG => False, META_TAG => False, TITLE_TAG => False, others => True); Hidden : Tag_Boolean_Array := (UNKNOWN_TAG => False, SCRIPT_TAG => True, STYLE_TAG => True, NOSCRIPT_TAG => True, others => False); Stack : Tag_Vector; Hide_Level : Natural := 0; end record; end Wiki.Filters.Html;
your-diary/FizzBuzz_with_50_languages
Ada
505
adb
-- This is a comment. with Ada.Text_IO; with Ada.Integer_Text_IO; procedure FizzBuzz is begin for i in 1 .. 100 loop if (i mod 3 = 0 and i mod 5 = 0) then Ada.Text_IO.Put_Line("FizzBuzz"); elsif (i mod 3 = 0) then Ada.Text_IO.Put_Line("Fizz"); elsif (i mod 5 = 0) then Ada.Text_IO.Put_Line("Buzz"); else Ada.Integer_Text_IO.Put(i, 0); Ada.Text_IO.Put_Line(""); end if; end loop; end FizzBuzz;
charlie5/cBound
Ada
1,070
ads
-- This file is generated by SWIG. Please do *not* modify by hand. -- with interfaces.c; with interfaces.c.strings; with swig; with interfaces.C; package Festival is -- FILE -- subtype FILE is swig.opaque_structure; type FILE_array is array (interfaces.C.Size_t range <>) of aliased festival.FILE; -- ostream -- subtype ostream is swig.incomplete_class; type ostream_array is array (interfaces.C.Size_t range <>) of aliased festival.ostream; -- ModuleDescription -- subtype ModuleDescription is swig.opaque_structure; type ModuleDescription_array is array (interfaces.C.Size_t range <>) of aliased festival.ModuleDescription; ft_server_socket : aliased interfaces.c.int; festival_version : aliased interfaces.c.strings.chars_ptr; FESTIVAL_DEFAULT_PORT : constant := 1314; FESTIVAL_HEAP_SIZE : constant := 1000000; private pragma import (CPP, ft_server_socket, "_ZN8festival16ft_server_socketE"); pragma import (CPP, festival_version, "_ZN8festival16festival_versionE"); end Festival;
AdaCore/libadalang
Ada
49
ads
with Types; use Types; procedure Foo (I : Int);
SilasX/quine-relay
Ada
18,735
adb
with Ada.Text_Io;procedure QR is begin Ada.Text_Io.Put_Line("BEGIN print(""BEGIN{s=(""""for b in System.Text.ASCIIEncoding().GetBytes((\""""#include<stdio.h>!nint main(){puts(!\""""#include<iostream>!!nint main(){std::cout<<(!!!\""""using System;class Program{public static void Main(){Console.Write((!!!!!!!\""""(defn f[l r](if(>(count r)45)(lazy-seq(cons(str!!!!!!!!!!!!!!!\"""" ~!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""r!!!!!!!!!!!!!!!\""""~!!!!!!!!!!!!!!!\""""&!!!!!!!!!!!!!!!\"""")(f l!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\"""")))(let[c(first l)](if c(f(next l)(if(= c ~!!!!!!!!!!!!!!!\"""")(str r c c)(str r c)))[(str!!!!!!!!!!!!!!!\"""" ~!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""r!!!!!!!!!!!!!!!\""""~!!!!!!!!!!!!!!!\"""".!!!!!!!!!!!!!!!\"""")]))))(doall(map #(println(str!!!!!!!!!!!!!!!\"""" !!!!!!!!!!!!!!!\""""%1))(lazy-cat[!!!!!!!!!!!!!!!\""""IDENTIFICATION DIVISION.!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""PROGRAM-ID. QR.!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""PROCEDURE DIVISION.!!!!!!!!!!!!!!!\""""](cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""s=(~!!!!!!!!!!!!!!!\""""package main;import(~~~!!!!!!!!!!!!!!!\""""fmt~~~!!!!!!!!!!!!!!!\"""";~~~!!!!!!!!!!!!!!!\""""strings~~~!!!!!!!!!!!!!!!\"""");func main(){fmt.Print(~~~!!!!!!!!!!!!!!!\""""print~~~~x27~~~!!!!!!!!!!!!!!!\""""+strings.Replace(~~~!!!!!!!!!!!!!!!\""""import Data.Char@nmain=putStrLn!$@~~~~~~~!!!!!!!!!!!!!!!\""""procedure main();write(@@@~~~~~~~!!!!!!!!!!!!!!!\""""DO,1<-#@~~~~~~~!!!!!!!!!!!!!!!\""""++show(length s)++f s 1 0;f(x:t)i c=let v=foldl(@@a x->a*2+(mod x 2))0!$take 8!$iterate(flip div 2)!$Data.Char.ord x in(if mod i 4<1then@~~~~~~~!!!!!!!!!!!!!!!\""""PLEASE@~~~~~~~!!!!!!!!!!!!!!!\""""else@~~~~~~~!!!!!!!!!!!!!!!\""""@~~~~~~~!!!!!!!!!!!!!!!\"""")++@~~~~~~~!!!!!!!!!!!!!!!\""""DO,1SUB#@~~~~~~~!!!!!!!!!!!!!!!\""""++show i++@~~~~~~~!!!!!!!!!!!!!!!\""""<-#@~~~~~~~!!!!!!!!!!!!!!!\""""++show(mod(c-v)256)++@~~~~~~~!!!!!!!!!!!!!!!\""""@@@@n@~~~~~~~!!!!!!!!!!!!!!!\""""++f t(i+1)v;f[]_ _=@~~~~~~~!!!!!!!!!!!!!!!\""""PLEASEREADOUT,1@@@@nPLEASEGIVEUP@@@~~~~~~~!!!!!!!!!!!!!!!\"""");end@~~~~~~~!!!!!!!!!!!!!!!\"""";s=(@~~~~~~~!!!!!!!!!!!!!!!\"""".class public QR@@n.super java/lang/Object@@n.method public static main([Ljava/lang/String;)V@@n.limit stack 2@@ngetstatic java/lang/System/out Ljava/io/PrintStream;@@nldc @@@~~~~~~~!!!!!!!!!!!!!!!\""""class QR{public static void main(String[]v){String c[]=new String[8000],y=@@@@@@@~~~~~~~!!!!!!!!!!!!!!!\""""@@@@@@@~~~~~~~!!!!!!!!!!!!!!!\"""",z=y,s=@@@@@@@~~~~~~~!!!!!!!!!!!!!!!\""""+q,T+n,J,O,U,F,S,O,B,M+L,D,P,O,T,U,B,i,;+d+j+e+g+d+L,Y+L,J+i,=,D+N,0,2+z,.,4+L,<+c+c,Q,S,h,U,<+f+t+T-C+t-;+c,n,M+k-G-G,O-G+4+q->-A,G-G+L+Q,T-W-N-D-N-<+Z,B,T,T,F,N,C,M,Z-W-B-D,a-G,c+Z,N,F,U,I,P,E-W,t,B,U,J,D-W,W,P,J-z-D+L,-,B,h-G-F-D+U-G,a+Z,F,i,S,Z,Q.2,i-W,M,E,t,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,x,z-+---/-1+V,e+X,J+d+c+L+a+X,J+d+c+L+a+U+U.[,U-/+d+c+L+a,c@@@@@@@~~~~~~~!!!!!!!!!!!!!!!\"""";int i,n,q=0,t;for(n=0;++n<126;)c[n]=@@@@@@@~~~~~~~!!!!!!!!!!!!!!!\""""@@@@@@@~~~~~~~!!!!!!!!!!!!!!!\""""+(char)n;for(i=0;++i<s.length();){t=s.charAt(i);q=q*75+t-t/64-t/92*5-43;if(i%2>0){y=q<n?c[q]:y;c[n++]=z+=y.charAt(0);System.out.print(z=c[q]);q=0;}}}}@@@~~~~~~~!!!!!!!!!!!!!!!\""""@@ninvokevirtual java/io/PrintStream/println(Ljava/lang/String;)V@@nreturn@@n.end method@@n@~~~~~~~!!!!!!!!!!!!!!!\"""")~~~~x27~~~~n~~~!!!!!!!!!!!!!!!\"""",~~~!!!!!!!!!!!!!!!\""""@~~~!!!!!!!!!!!!!!!\"""",~~~!!!!!!!!!!!!!!!\""""~~~~~~~~~~~!!!!!!!!!!!!!!!\"""",-1))}~!!!!!!!!!!!!!!!\"""");u=~!!!!!!!!!!!!!!!\"""" ~!!!!!!!!!!!!!!!\"""";g=(l)->l.replace(/[~~~~~!!!!!!!!!!!!!!!\""""]/g,(x)->~!!!!!!!!!!!!!!!\""""~~~~~!!!!!!!!!!!!!!!\""""+x)!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))!!!!!!!!n(cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""f=(l)->console.log(~!!!!!!!!!!!!!!!\""""(write-line ~~~!!!!!!!!!!!!!!!\""""~!!!!!!!!!!!!!!!\""""+g(l)+~!!!!!!!!!!!!!!!\""""~~~!!!!!!!!!!!!!!!\"""")~!!!!!!!!!!!!!!!\"""")!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))!!!!!!!!n(cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""e=(l)->f(~!!!!!!!!!!!!!!!\"""".~~~~~~~!!!!!!!!!!!!!!!\""""~!!!!!!!!!!!!!!!\""""+u+g(l)+~!!!!!!!!!!!!!!!\""""~~~!!!!!!!!!!!!!!!\"""" cr~!!!!!!!!!!!!!!!\"""")!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))!!!!!!!!n(cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""d=(l)->e(~!!!!!!!!!!!!!!!\""""WRITE(*,*)'~!!!!!!!!!!!!!!!\""""+u+l+~!!!!!!!!!!!!!!!\""""'~!!!!!!!!!!!!!!!\"""");d!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))!!!!!!!!n(cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""d(~!!!!!!!!!!!!!!!\""""program QR~!!!!!!!!!!!!!!!\"""")(~!!!!!!!!!!!!!!!\""""print ~~~!!!!!!!!!!!!!!!\""""(&~!!!!!!!!!!!!!!!\"""");i=0!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))!!!!!!!!n(cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""d(~!!!!!!!!!!!!!!!\""""&A,&~!!!!!!!!!!!!!!!\"""")while i++<s.length!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))!!!!!!!!n(cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""d(~!!!!!!!!!!!!!!!\""""&A)~~~!!!!!!!!!!!!!!!\"""",&~!!!!!!!!!!!!!!!\"""");i=0!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))!!!!!!!!n(cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""d(~!!!!!!!!!!!!!!!\""""&char(~!!!!!!!!!!!!!!!\""""+s.charCodeAt(i++)+~!!!!!!!!!!!!!!!\""""),&~!!!!!!!!!!!!!!!\"""")while i<s.length!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))!!!!!!!!n(cons!!!!!!!!!!!!!!!\""""DISPLAY!!!!!!!!!!!!!!!\""""(f!!!!!!!!!!!!!!!\""""d(~!!!!!!!!!!!!!!!\""""&~~~!!!!!!!!!!!!!!!\""""~~~!!!!!!!!!!!!!!!\""""~!!!!!!!!!!!!!!!\"""")(~!!!!!!!!!!!!!!!\""""end program QR~!!!!!!!!!!!!!!!\"""");e(~!!!!!!!!!!!!!!!\""""STOP~!!!!!!!!!!!!!!!\"""");e(~!!!!!!!!!!!!!!!\""""END~!!!!!!!!!!!!!!!\"""");f(~!!!!!!!!!!!!!!!\""""bye~!!!!!!!!!!!!!!!\"""")!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""!!!!!!!!!!!!!!!\""""))[!!!!!!!!!!!!!!!\""""STOP RUN.!!!!!!!!!!!!!!!\""""])))!!!!!!!\"""").Replace(!!!!!!!\""""~!!!!!!!\"""",!!!!!!!\""""!!!!!!!!!!!!!!!!!!!!!!!\""""));}}!!!\"""");}!\"""");return 0;}\"""")):print join(['+'for i in range(0,b)],\""""\"""")+\"""".>\"""""""");gsub(/!/,""""\\"""",s);print s}"")END");end QR;
AdaCore/ada-traits-containers
Ada
1,695
ads
-- -- Copyright (C) 2016, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -- -- Maps indexed by indefinite elements (strings for instance), containing -- definite elements (records for instance). pragma Ada_2012; with Conts.Elements.Definite; with Conts.Elements.Indefinite; with Conts.Maps.Generics; generic type Key_Type (<>) is private; type Element_Type is private; type Container_Base_Type is abstract tagged limited private; with function Hash (Key : Key_Type) return Hash_Type; with function "=" (Left, Right : Key_Type) return Boolean is <>; with procedure Free (E : in out Key_Type) is null; with procedure Free (E : in out Element_Type) is null; package Conts.Maps.Indef_Def_Unbounded is pragma Assertion_Policy (Pre => Suppressible, Ghost => Suppressible, Post => Ignore); package Keys is new Conts.Elements.Indefinite (Key_Type, Pool => Conts.Global_Pool, Free => Free); package Elements is new Conts.Elements.Definite (Element_Type, Free => Free); function "=" (Left : Key_Type; Right : Keys.Traits.Stored) return Boolean is (Left = Right.all) with Inline; package Impl is new Conts.Maps.Generics (Keys => Keys.Traits, Elements => Elements.Traits, Hash => Hash, "=" => "=", Probing => Conts.Maps.Perturbation_Probing, Pool => Conts.Global_Pool, Container_Base_Type => Container_Base_Type); subtype Cursor is Impl.Cursor; subtype Map is Impl.Map; package Cursors renames Impl.Cursors; package Maps renames Impl.Maps; end Conts.Maps.Indef_Def_Unbounded;
optikos/oasis
Ada
1,811
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Element_Vectors; with Program.Elements.Defining_Names; with Program.Lexical_Elements; package Program.Elements.Defining_Identifiers is pragma Pure (Program.Elements.Defining_Identifiers); type Defining_Identifier is limited interface and Program.Elements.Defining_Names.Defining_Name; type Defining_Identifier_Access is access all Defining_Identifier'Class with Storage_Size => 0; type Defining_Identifier_Text is limited interface; type Defining_Identifier_Text_Access is access all Defining_Identifier_Text'Class with Storage_Size => 0; not overriding function To_Defining_Identifier_Text (Self : aliased in out Defining_Identifier) return Defining_Identifier_Text_Access is abstract; not overriding function Identifier_Token (Self : Defining_Identifier_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; type Defining_Identifier_Vector is limited interface and Program.Element_Vectors.Element_Vector; type Defining_Identifier_Vector_Access is access all Defining_Identifier_Vector'Class with Storage_Size => 0; overriding function Element (Self : Defining_Identifier_Vector; Index : Positive) return not null Program.Elements.Element_Access is abstract with Post'Class => Element'Result.Is_Defining_Identifier; function To_Defining_Identifier (Self : Defining_Identifier_Vector'Class; Index : Positive) return not null Defining_Identifier_Access is (Self.Element (Index).To_Defining_Identifier); end Program.Elements.Defining_Identifiers;
onox/sdlada
Ada
1,596
ads
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2018 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. -------------------------------------------------------------------------------------------------------------------- -- SDL.Inputs.Joysticks.Game_Controllers.Makers -------------------------------------------------------------------------------------------------------------------- package SDL.Inputs.Joysticks.Game_Controllers.Makers is function Create (Device : in Devices) return Game_Controller; procedure Create (Device : in Devices; Actual_Controller : out Game_Controller); end SDL.Inputs.Joysticks.Game_Controllers.Makers;
tsoding/ada-probe
Ada
705
ads
with Ada.Containers.Hashed_Maps; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Unbounded.Hash; -- Basic support for .env files in Ada everyone was waiting for package Aids.Env is Syntax_Error : exception; package Env_Hashed_Map is new Ada.Containers.Hashed_Maps (Key_Type => Unbounded_String, Element_Type => Unbounded_String, Hash => Ada.Strings.Unbounded.Hash, Equivalent_Keys => "="); subtype Typ is Env_Hashed_Map.Map; function Slurp(File_Path: String) return Typ; function Find(Env: in Typ; Key: in Unbounded_String; Value: out Unbounded_String) return Boolean; end Aids.Env;
onox/orka
Ada
3,058
adb
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2012 Felix Krause <[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.Strings; with GL.API; with GL.Enums; package body GL.Objects.Shaders is procedure Set_Source (Subject : Shader; Source : String) is C_Shader_Source : C.Strings.chars_ptr := C.Strings.New_String (Source); C_Source : constant Low_Level.CharPtr_Array := (1 => C_Shader_Source); Lengths : constant Low_Level.Int_Array := (1 => Source'Length); begin API.Shader_Source.Ref (Subject.Reference.GL_Id, 1, C_Source, Lengths); C.Strings.Free (C_Shader_Source); end Set_Source; function Source (Subject : Shader) return String is Source_Length : Size := 0; begin API.Get_Shader_Param.Ref (Subject.Reference.GL_Id, Enums.Shader_Source_Length, Source_Length); if Source_Length = 0 then return ""; end if; declare Shader_Source : String (1 .. Integer (Source_Length)); begin API.Get_Shader_Source.Ref (Subject.Reference.GL_Id, Source_Length, Source_Length, Shader_Source); return Shader_Source (1 .. Integer (Source_Length)); end; end Source; procedure Compile (Subject : Shader) is begin API.Compile_Shader.Ref (Subject.Reference.GL_Id); end Compile; function Compile_Status (Subject : Shader) return Boolean is Value : Int := 0; begin API.Get_Shader_Param.Ref (Subject.Reference.GL_Id, Enums.Compile_Status, Value); return Value /= 0; end Compile_Status; function Info_Log (Subject : Shader) return String is Log_Length : Size := 0; begin API.Get_Shader_Param.Ref (Subject.Reference.GL_Id, Enums.Info_Log_Length, Log_Length); if Log_Length = 0 then return ""; end if; declare Info_Log : String (1 .. Integer (Log_Length)); begin API.Get_Shader_Info_Log.Ref (Subject.Reference.GL_Id, Log_Length, Log_Length, Info_Log); return Info_Log (1 .. Integer (Log_Length)); end; end Info_Log; overriding procedure Initialize_Id (Object : in out Shader) is begin Object.Reference.GL_Id := API.Create_Shader.Ref (Object.Kind); end Initialize_Id; overriding procedure Delete_Id (Object : in out Shader) is begin API.Delete_Shader.Ref (Object.Reference.GL_Id); Object.Reference.GL_Id := 0; end Delete_Id; end GL.Objects.Shaders;
francesco-bongiovanni/ewok-kernel
Ada
8,706
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; with ewok.devices_shared; use ewok.devices_shared; with ewok.exported.devices; use ewok.exported.devices; with ewok.devices; with ewok.sanitize; with ewok.dma; with ewok.syscalls.dma; with ewok.mpu; with ewok.sched; with debug; package body ewok.syscalls.init with spark_mode => off is package TSK renames ewok.tasks; procedure init_do_reg_devaccess (caller_id : in ewok.tasks_shared.t_task_id; params : in t_parameters; mode : in ewok.tasks_shared.t_task_mode) is udev : aliased ewok.exported.devices.t_user_device with import, address => to_address (params(1)); descriptor : unsigned_8 range 0 .. ewok.tasks.MAX_DEVS_PER_TASK with address => to_address (params(2)); dev_id : ewok.devices_shared.t_device_id; ok : boolean; begin -- Forbidden after end of task initialization if TSK.is_init_done (caller_id) then goto ret_denied; end if; -- Note: The kernel might register some devices using this syscall if TSK.is_user (caller_id) and then (not ewok.sanitize.is_range_in_data_slot (to_system_address (udev'address), udev'size/8, caller_id, mode) or not ewok.sanitize.is_word_in_data_slot (to_system_address (descriptor'address), caller_id, mode)) then debug.log (debug.WARNING, "init_do_reg_devaccess(): udev not in task's memory space"); goto ret_denied; end if; -- Ada based sanitation using on types compliance if not udev'valid_scalars then debug.log (debug.WARNING, "init_do_reg_devaccess(): invalid udev"); goto ret_inval; end if; if TSK.is_user (caller_id) and then not ewok.devices.sanitize_user_defined_device (udev'unchecked_access, caller_id) then debug.log (debug.WARNING, "init_do_reg_devaccess(): invalid udev"); goto ret_inval; end if; if udev.size > 0 and udev.map_mode = DEV_MAP_AUTO and TSK.tasks_list(caller_id).num_devs_mmapped = ewok.mpu.MPU_MAX_EMPTY_REGIONS then debug.log (debug.WARNING, "init_do_reg_devaccess(): no free region left to map the device"); goto ret_busy; end if; if TSK.tasks_list(caller_id).num_devs = TSK.MAX_DEVS_PER_TASK then debug.log (debug.WARNING, "init_do_reg_devaccess(): no space left to register the device"); goto ret_busy; end if; -- -- Registering the device -- ewok.devices.register_device (caller_id, udev'unchecked_access, dev_id, ok); if not ok then debug.log (debug.WARNING, "init_do_reg_devaccess(): failed to register the device"); goto ret_denied; end if; TSK.tasks_list(caller_id).num_devs := TSK.tasks_list(caller_id).num_devs + 1; TSK.tasks_list(caller_id).device_id(TSK.tasks_list(caller_id).num_devs) := dev_id; -- Descriptor transmitted to userspace descriptor := TSK.tasks_list(caller_id).num_devs; if udev.size > 0 and udev.map_mode = DEV_MAP_AUTO then TSK.tasks_list(caller_id).num_devs_mmapped := TSK.tasks_list(caller_id).num_devs_mmapped + 1; end if; set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_busy>> set_return_value (caller_id, mode, SYS_E_BUSY); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_inval>> set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_denied>> set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end init_do_reg_devaccess; procedure init_do_done (caller_id : in ewok.tasks_shared.t_task_id; mode : in ewok.tasks_shared.t_task_mode) is ok : boolean; begin -- Forbidden after end of task initialization if TSK.is_init_done (caller_id) then set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end if; for i in 1 .. TSK.tasks_list(caller_id).num_devs loop ewok.devices.enable_device (TSK.tasks_list(caller_id).device_id(i), ok); if not ok then raise program_error; end if; end loop; #if CONFIG_KERNEL_DMA_ENABLE for i in 1 .. TSK.tasks_list(caller_id).num_dma_id loop ewok.dma.enable_dma_irq (TSK.tasks_list(caller_id).dma_id(i)); end loop; #end if; TSK.tasks_list(caller_id).init_done := true; set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); -- Request a schedule to ensure that the task has its devices mapped -- afterward ewok.sched.request_schedule; end init_do_done; procedure init_do_get_taskid (caller_id : in ewok.tasks_shared.t_task_id; params : in t_parameters; mode : in ewok.tasks_shared.t_task_mode) is target_name : TSK.t_task_name with address => to_address (params(1)); target_id : ewok.tasks_shared.t_task_id with address => to_address (params(2)); begin -- Forbidden after end of task initialization if TSK.is_init_done (caller_id) then goto ret_denied; end if; -- Does &target_id is in the caller address space ? if not ewok.sanitize.is_word_in_data_slot (to_system_address (target_id'address), caller_id, mode) then goto ret_denied; end if; target_id := TSK.get_task_id (target_name); #if CONFIG_KERNEL_DOMAIN if TSK.get_domain (target_id) /= TSK.get_domain (caller_id) then target_id := ID_UNUSED; end if; #end if; if target_id = ID_UNUSED then goto ret_inval; end if; set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_inval>> set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_denied>> set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end init_do_get_taskid; procedure sys_init (caller_id : in ewok.tasks_shared.t_task_id; params : in out t_parameters; mode : in ewok.tasks_shared.t_task_mode) is syscall : t_syscalls_init with import, address => params(0)'address; begin if not syscall'valid then set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end if; case syscall is when INIT_DEVACCESS => init_do_reg_devaccess (caller_id, params, mode); #if CONFIG_KERNEL_DMA_ENABLE when INIT_DMA => ewok.syscalls.dma.init_do_reg_dma (caller_id, params, mode); when INIT_DMA_SHM => ewok.syscalls.dma.init_do_reg_dma_shm (caller_id, params, mode); #end if; when INIT_GETTASKID => init_do_get_taskid (caller_id, params, mode); when INIT_DONE => init_do_done (caller_id, mode); end case; end sys_init; end ewok.syscalls.init;
MinimSecure/unum-sdk
Ada
798
ads
-- Copyright 2015-2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with System; package Pck is procedure Do_Nothing (A : System.Address); end Pck;
onox/orka
Ada
3,398
adb
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2022 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 Ada.Unchecked_Conversion; with Orka.SIMD.AVX.Integers.Swizzle; with Orka.SIMD.SSE2.Integers; with Orka.SIMD.SSE2.Longs.Logical; package body Orka.SIMD.AVX.Longs.Logical.Emulation is use SIMD.AVX.Integers; use SIMD.AVX.Integers.Swizzle; use SIMD.SSE2.Integers; use SIMD.SSE2.Longs; use SIMD.SSE2.Longs.Logical; function Convert is new Ada.Unchecked_Conversion (m256i, m256l); function Convert is new Ada.Unchecked_Conversion (m256l, m256i); function Convert is new Ada.Unchecked_Conversion (m128i, m128l); function Convert is new Ada.Unchecked_Conversion (m128l, m128i); function And_Not (Left, Right : m256l) return m256l is Left_Low : constant m128l := Convert (Extract (Convert (Left), 0)); Left_High : constant m128l := Convert (Extract (Convert (Left), 1)); Right_Low : constant m128l := Convert (Extract (Convert (Right), 0)); Right_High : constant m128l := Convert (Extract (Convert (Right), 1)); begin return Convert (Pack (High => Convert (And_Not (Left_High, Right_High)), Low => Convert (And_Not (Left_Low, Right_Low)))); end And_Not; function "and" (Left, Right : m256l) return m256l is Left_Low : constant m128l := Convert (Extract (Convert (Left), 0)); Left_High : constant m128l := Convert (Extract (Convert (Left), 1)); Right_Low : constant m128l := Convert (Extract (Convert (Right), 0)); Right_High : constant m128l := Convert (Extract (Convert (Right), 1)); begin return Convert (Pack (High => Convert (Left_High and Right_High), Low => Convert (Left_Low and Right_Low))); end "and"; function "or" (Left, Right : m256l) return m256l is Left_Low : constant m128l := Convert (Extract (Convert (Left), 0)); Left_High : constant m128l := Convert (Extract (Convert (Left), 1)); Right_Low : constant m128l := Convert (Extract (Convert (Right), 0)); Right_High : constant m128l := Convert (Extract (Convert (Right), 1)); begin return Convert (Pack (High => Convert (Left_High or Right_High), Low => Convert (Left_Low or Right_Low))); end "or"; function "xor" (Left, Right : m256l) return m256l is Left_Low : constant m128l := Convert (Extract (Convert (Left), 0)); Left_High : constant m128l := Convert (Extract (Convert (Left), 1)); Right_Low : constant m128l := Convert (Extract (Convert (Right), 0)); Right_High : constant m128l := Convert (Extract (Convert (Right), 1)); begin return Convert (Pack (High => Convert (Left_High xor Right_High), Low => Convert (Left_Low xor Right_Low))); end "xor"; end Orka.SIMD.AVX.Longs.Logical.Emulation;
redparavoz/ada-wiki
Ada
8,276
adb
----------------------------------------------------------------------- -- wiki-filters-collectors -- Wiki word and link collectors -- Copyright (C) 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. ----------------------------------------------------------------------- package body Wiki.Filters.Collectors is procedure Add_String (Into : in out WString_Maps.Map; Item : in Wiki.Strings.WString); procedure Add_String (Into : in out WString_Maps.Map; Item : in Wiki.Strings.WString) is procedure Increment (Key : in Wiki.Strings.WString; Value : in out Natural); procedure Increment (Key : in Wiki.Strings.WString; Value : in out Natural) is pragma Unreferenced (Key); begin Value := Value + 1; end Increment; Pos : constant WString_Maps.Cursor := Into.Find (Item); begin if WString_Maps.Has_Element (Pos) then Into.Update_Element (Pos, Increment'Access); else Into.Insert (Item, 1); end if; end Add_String; function Find (Map : in Collector_Type; Item : in Wiki.Strings.WString) return Cursor is begin return Map.Items.Find (Item); end Find; function Contains (Map : in Collector_Type; Item : in Wiki.Strings.WString) return Boolean is begin return Map.Items.Contains (Item); end Contains; procedure Iterate (Map : in Collector_Type; Process : not null access procedure (Pos : in Cursor)) is begin Map.Items.Iterate (Process); end Iterate; -- ------------------------------ -- Word Collector type -- ------------------------------ procedure Collect_Words (Filter : in out Word_Collector_Type; Content : in Wiki.Strings.WString) is Pos : Natural := Content'First; Start : Natural := Content'First; C : Wiki.Strings.WChar; begin while Pos <= Content'Last loop C := Content (Pos); if Wiki.Strings.Is_Alphanumeric (C) then null; else if Start + 1 < Pos - 1 then Add_String (Filter.Items, Content (Start .. Pos - 1)); end if; Start := Pos + 1; end if; Pos := Pos + 1; end loop; if Start < Content'Last then Add_String (Filter.Items, Content (Start .. Content'Last)); end if; end Collect_Words; -- ------------------------------ -- Add a text content with the given format to the document. -- ------------------------------ procedure Add_Text (Filter : in out Word_Collector_Type; Document : in out Wiki.Documents.Document; Text : in Wiki.Strings.WString; Format : in Wiki.Format_Map) is begin Filter.Collect_Words (Text); Filter_Type (Filter).Add_Text (Document, Text, Format); end Add_Text; -- ------------------------------ -- Add a section header with the given level in the document. -- ------------------------------ procedure Add_Header (Filter : in out Word_Collector_Type; Document : in out Wiki.Documents.Document; Header : in Wiki.Strings.WString; Level : in Natural) is begin Filter.Collect_Words (Header); Filter_Type (Filter).Add_Header (Document, Header, Level); end Add_Header; -- ------------------------------ -- Add a link. -- ------------------------------ procedure Add_Link (Filter : in out Word_Collector_Type; Document : in out Wiki.Documents.Document; Name : in Wiki.Strings.WString; Attributes : in out Wiki.Attributes.Attribute_List) is begin Filter_Type (Filter).Add_Link (Document, Name, Attributes); end Add_Link; -- ------------------------------ -- Add an image. -- ------------------------------ procedure Add_Image (Filter : in out Word_Collector_Type; Document : in out Wiki.Documents.Document; Name : in Wiki.Strings.WString; Attributes : in out Wiki.Attributes.Attribute_List) is begin Filter_Type (Filter).Add_Image (Document, Name, Attributes); end Add_Image; -- ------------------------------ -- Add a quote. -- ------------------------------ procedure Add_Quote (Filter : in out Word_Collector_Type; Document : in out Wiki.Documents.Document; Name : in Wiki.Strings.WString; Attributes : in out Wiki.Attributes.Attribute_List) is begin Filter_Type (Filter).Add_Quote (Document, Name, Attributes); end Add_Quote; -- ------------------------------ -- Add a text block that is pre-formatted. -- ------------------------------ procedure Add_Preformatted (Filter : in out Word_Collector_Type; Document : in out Wiki.Documents.Document; Text : in Wiki.Strings.WString; Format : in Wiki.Strings.WString) is begin Filter.Collect_Words (Text); Filter_Type (Filter).Add_Preformatted (Document, Text, Format); end Add_Preformatted; procedure Collect_Link (Filter : in out Link_Collector_Type; Attributes : in Wiki.Attributes.Attribute_List; Name : in String) is Href : constant Wiki.Strings.WString := Wiki.Attributes.Get_Attribute (Attributes, Name); begin if Href'Length > 0 then Add_String (Filter.Items, Href); end if; end Collect_Link; -- ------------------------------ -- Add a link. -- ------------------------------ overriding procedure Add_Link (Filter : in out Link_Collector_Type; Document : in out Wiki.Documents.Document; Name : in Wiki.Strings.WString; Attributes : in out Wiki.Attributes.Attribute_List) is begin Collect_Link (Filter, Attributes, "href"); Filter_Type (Filter).Add_Link (Document, Name, Attributes); end Add_Link; -- ------------------------------ -- Push a HTML node with the given tag to the document. -- ------------------------------ overriding procedure Push_Node (Filter : in out Link_Collector_Type; Document : in out Wiki.Documents.Document; Tag : in Wiki.Html_Tag; Attributes : in out Wiki.Attributes.Attribute_List) is begin if Tag = A_TAG then Collect_Link (Filter, Attributes, "href"); end if; Filter_Type (Filter).Push_Node (Document, Tag, Attributes); end Push_Node; -- ------------------------------ -- Add an image. -- ------------------------------ overriding procedure Add_Image (Filter : in out Image_Collector_Type; Document : in out Wiki.Documents.Document; Name : in Wiki.Strings.WString; Attributes : in out Wiki.Attributes.Attribute_List) is Src : constant Wiki.Strings.WString := Wiki.Attributes.Get_Attribute (Attributes, "src"); begin Add_String (Filter.Items, Src); Filter_Type (Filter).Add_Image (Document, Name, Attributes); end Add_Image; end Wiki.Filters.Collectors;
reznikmm/matreshka
Ada
3,993
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_End_Angle_Attributes; package Matreshka.ODF_Dr3d.End_Angle_Attributes is type Dr3d_End_Angle_Attribute_Node is new Matreshka.ODF_Dr3d.Abstract_Dr3d_Attribute_Node and ODF.DOM.Dr3d_End_Angle_Attributes.ODF_Dr3d_End_Angle_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Dr3d_End_Angle_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Dr3d_End_Angle_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Dr3d.End_Angle_Attributes;
AdaCore/gpr
Ada
1,648
adb
------------------------------------------------------------------------------ -- -- -- GPR2 PROJECT MANAGER -- -- -- -- Copyright (C) 2019-2023, AdaCore -- -- -- -- This 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. This software is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- -- License for more details. You should have received a copy of the GNU -- -- General Public License distributed with GNAT; see file COPYING. If not, -- -- see <http://www.gnu.org/licenses/>. -- -- -- ------------------------------------------------------------------------------ package body GPR2.Compilation.Slave is ------------ -- Create -- ------------ function Create (Host : Name_Type; Port : GNAT.Sockets.Port_Type) return Object is begin return Object'(To_Unbounded_String (String (Host)), Port); end Create; end GPR2.Compilation.Slave;
reznikmm/matreshka
Ada
20,099
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_Named_Elements; with AMF.UML.Activities; with AMF.UML.Activity_Edges.Collections; with AMF.UML.Activity_Groups.Collections; with AMF.UML.Activity_Nodes.Collections; with AMF.UML.Activity_Partitions.Collections; with AMF.UML.Classifiers.Collections; with AMF.UML.Constraints.Collections; with AMF.UML.Dependencies.Collections; with AMF.UML.Exception_Handlers.Collections; with AMF.UML.Input_Pins.Collections; with AMF.UML.Interruptible_Activity_Regions.Collections; with AMF.UML.Named_Elements; with AMF.UML.Namespaces; with AMF.UML.Output_Pins.Collections; with AMF.UML.Packages.Collections; with AMF.UML.Read_Structural_Feature_Actions; with AMF.UML.Redefinable_Elements.Collections; with AMF.UML.String_Expressions; with AMF.UML.Structural_Features; with AMF.UML.Structured_Activity_Nodes; with AMF.Visitors; package AMF.Internals.UML_Read_Structural_Feature_Actions is type UML_Read_Structural_Feature_Action_Proxy is limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy and AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action with null record; overriding function Get_Result (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Output_Pins.UML_Output_Pin_Access; -- Getter of ReadStructuralFeatureAction::result. -- -- Gives the output pin on which the result is put. overriding procedure Set_Result (Self : not null access UML_Read_Structural_Feature_Action_Proxy; To : AMF.UML.Output_Pins.UML_Output_Pin_Access); -- Setter of ReadStructuralFeatureAction::result. -- -- Gives the output pin on which the result is put. overriding function Get_Object (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Input_Pins.UML_Input_Pin_Access; -- Getter of StructuralFeatureAction::object. -- -- Gives the input pin from which the object whose structural feature is -- to be read or written is obtained. overriding procedure Set_Object (Self : not null access UML_Read_Structural_Feature_Action_Proxy; To : AMF.UML.Input_Pins.UML_Input_Pin_Access); -- Setter of StructuralFeatureAction::object. -- -- Gives the input pin from which the object whose structural feature is -- to be read or written is obtained. overriding function Get_Structural_Feature (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Structural_Features.UML_Structural_Feature_Access; -- Getter of StructuralFeatureAction::structuralFeature. -- -- Structural feature to be read. overriding procedure Set_Structural_Feature (Self : not null access UML_Read_Structural_Feature_Action_Proxy; To : AMF.UML.Structural_Features.UML_Structural_Feature_Access); -- Setter of StructuralFeatureAction::structuralFeature. -- -- Structural feature to be read. overriding function Get_Context (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Getter of Action::context. -- -- The classifier that owns the behavior of which this action is a part. overriding function Get_Input (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin; -- Getter of Action::input. -- -- The ordered set of input pins connected to the Action. These are among -- the total set of inputs. overriding function Get_Is_Locally_Reentrant (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return Boolean; -- Getter of Action::isLocallyReentrant. -- -- If true, the action can begin a new, concurrent execution, even if -- there is already another execution of the action ongoing. If false, the -- action cannot begin a new execution until any previous execution has -- completed. overriding procedure Set_Is_Locally_Reentrant (Self : not null access UML_Read_Structural_Feature_Action_Proxy; To : Boolean); -- Setter of Action::isLocallyReentrant. -- -- If true, the action can begin a new, concurrent execution, even if -- there is already another execution of the action ongoing. If false, the -- action cannot begin a new execution until any previous execution has -- completed. overriding function Get_Local_Postcondition (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Action::localPostcondition. -- -- Constraint that must be satisfied when executed is completed. overriding function Get_Local_Precondition (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Action::localPrecondition. -- -- Constraint that must be satisfied when execution is started. overriding function Get_Output (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin; -- Getter of Action::output. -- -- The ordered set of output pins connected to the Action. The action -- places its results onto pins in this set. overriding function Get_Handler (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler; -- Getter of ExecutableNode::handler. -- -- A set of exception handlers that are examined if an uncaught exception -- propagates to the outer level of the executable node. overriding function Get_Activity (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Activities.UML_Activity_Access; -- Getter of ActivityNode::activity. -- -- Activity containing the node. overriding procedure Set_Activity (Self : not null access UML_Read_Structural_Feature_Action_Proxy; To : AMF.UML.Activities.UML_Activity_Access); -- Setter of ActivityNode::activity. -- -- Activity containing the node. overriding function Get_In_Group (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group; -- Getter of ActivityNode::inGroup. -- -- Groups containing the node. overriding function Get_In_Interruptible_Region (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region; -- Getter of ActivityNode::inInterruptibleRegion. -- -- Interruptible regions containing the node. overriding function Get_In_Partition (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition; -- Getter of ActivityNode::inPartition. -- -- Partitions containing the node. overriding function Get_In_Structured_Node (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access; -- Getter of ActivityNode::inStructuredNode. -- -- Structured activity node containing the node. overriding procedure Set_In_Structured_Node (Self : not null access UML_Read_Structural_Feature_Action_Proxy; To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access); -- Setter of ActivityNode::inStructuredNode. -- -- Structured activity node containing the node. overriding function Get_Incoming (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge; -- Getter of ActivityNode::incoming. -- -- Edges that have the node as target. overriding function Get_Outgoing (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge; -- Getter of ActivityNode::outgoing. -- -- Edges that have the node as source. overriding function Get_Redefined_Node (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node; -- Getter of ActivityNode::redefinedNode. -- -- Inherited nodes replaced by this node in a specialization of the -- activity. overriding function Get_Is_Leaf (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return Boolean; -- Getter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding procedure Set_Is_Leaf (Self : not null access UML_Read_Structural_Feature_Action_Proxy; To : Boolean); -- Setter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding function Get_Redefined_Element (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element; -- Getter of RedefinableElement::redefinedElement. -- -- The redefinable element that is being redefined by this element. overriding function Get_Redefinition_Context (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of RedefinableElement::redefinitionContext. -- -- References the contexts that this element may be redefined from. overriding function Get_Client_Dependency (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; -- Getter of NamedElement::clientDependency. -- -- Indicates the dependencies that reference the client. overriding function Get_Name_Expression (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access; -- Getter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding procedure Set_Name_Expression (Self : not null access UML_Read_Structural_Feature_Action_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access); -- Setter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding function Get_Namespace (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. overriding function Get_Qualified_Name (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.Optional_String; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. overriding function Context (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Operation Action::context. -- -- Missing derivation for Action::/context : Classifier overriding function Is_Consistent_With (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy; Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isConsistentWith. -- -- The query isConsistentWith() specifies, for any two RedefinableElements -- in a context in which redefinition is possible, whether redefinition -- would be logically consistent. By default, this is false; this -- operation must be overridden for subclasses of RedefinableElement to -- define the consistency conditions. overriding function Is_Redefinition_Context_Valid (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy; Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isRedefinitionContextValid. -- -- The query isRedefinitionContextValid() specifies whether the -- redefinition contexts of this RedefinableElement are properly related -- to the redefinition contexts of the specified RedefinableElement to -- allow this element to redefine the other. By default at least one of -- the redefinition contexts of this element must be a specialization of -- at least one of the redefinition contexts of the specified element. overriding function All_Owning_Packages (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package; -- Operation NamedElement::allOwningPackages. -- -- The query allOwningPackages() returns all the directly or indirectly -- owning packages. overriding function Is_Distinguishable_From (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. overriding function Namespace (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Operation NamedElement::namespace. -- -- Missing derivation for NamedElement::/namespace : Namespace overriding procedure Enter_Element (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Leave_Element (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access constant UML_Read_Structural_Feature_Action_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of iterator interface. end AMF.Internals.UML_Read_Structural_Feature_Actions;