repo_name
stringlengths
9
74
language
stringclasses
1 value
length_bytes
int64
11
9.34M
extension
stringclasses
2 values
content
stringlengths
11
9.34M
AdaCore/Ada_Drivers_Library
Ada
5,162
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 the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with STM32.Device; use STM32.Device; with STM32.GPIO; use STM32.GPIO; package body Framebuffer_RK043FN48H is LCD_BL_CTRL : GPIO_Point renames PK3; LCD_ENABLE : GPIO_Point renames PI12; LCD_HSYNC : GPIO_Point renames PI10; LCD_VSYNC : GPIO_Point renames PI9; LCD_CLK : GPIO_Point renames PI14; LCD_DE : GPIO_Point renames PK7; LCD_INT : GPIO_Point renames PI13; NC1 : GPIO_Point renames PI8; LCD_CTRL_PINS : constant GPIO_Points := (LCD_VSYNC, LCD_HSYNC, LCD_INT, LCD_CLK, LCD_DE, NC1); LCD_RGB_AF14 : constant GPIO_Points := (PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, -- Red PJ7, PJ8, PJ9, PJ10, PJ11, PK0, PK1, PK2, -- Green PE4, PJ13, PJ14, PJ15, PK4, PK5, PK6); -- Blue LCD_RGB_AF9 : constant GPIO_Points := (1 => PG12); -- B4 procedure Init_Pins; --------------- -- Init_Pins -- --------------- procedure Init_Pins is LTDC_Pins : constant GPIO_Points := LCD_CTRL_PINS & LCD_RGB_AF14 & LCD_RGB_AF9; begin Enable_Clock (LTDC_Pins); Configure_IO (Points => LTDC_Pins, Config => (Mode => Mode_AF, AF => GPIO_AF_LTDC_14, AF_Speed => Speed_50MHz, AF_Output_Type => Push_Pull, Resistors => Floating)); Configure_Alternate_Function (LCD_RGB_AF9, GPIO_AF_LTDC_9); Lock (LTDC_Pins); Configure_IO (GPIO_Points'(LCD_ENABLE, LCD_BL_CTRL), Config => (Speed => Speed_2MHz, Mode => Mode_Out, Output_Type => Push_Pull, Resistors => Pull_Down)); Lock (LCD_ENABLE & LCD_BL_CTRL); end Init_Pins; ---------------- -- Initialize -- ---------------- procedure Initialize (Display : in out Frame_Buffer; Orientation : HAL.Framebuffer.Display_Orientation := Default; Mode : HAL.Framebuffer.Wait_Mode := Interrupt) is begin Init_Pins; Display.Initialize (Width => LCD_Natural_Width, Height => LCD_Natural_Height, H_Sync => 41, H_Back_Porch => 13, H_Front_Porch => 32, V_Sync => 10, V_Back_Porch => 2, V_Front_Porch => 2, PLLSAI_N => 192, PLLSAI_R => 5, DivR => 4, Orientation => Orientation, Mode => Mode); STM32.GPIO.Set (LCD_ENABLE); STM32.GPIO.Set (LCD_BL_CTRL); end Initialize; end Framebuffer_RK043FN48H;
AdaCore/Ada_Drivers_Library
Ada
3,998
ads
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017-2022, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with System; use System; with HAL; use HAL; with STM32.DMA; use STM32.DMA; with STM32.Device; use STM32.Device; with Ada.Interrupts; with Ada.Interrupts.Names; use Ada.Interrupts.Names; package Audio_Stream is protected type Double_Buffer_Controller (Controller : not null access DMA_Controller; Stream : DMA_Stream_Selector; IRQ : Ada.Interrupts.Interrupt_ID) is procedure Start (Destination : Address; Source_0 : Address; Source_1 : Address; Data_Count : UInt16) with Pre => Destination /= Null_Address and then Source_0 /= Null_Address and then Source_1 /= Null_Address and then Source_0 /= Destination and then Source_1 /= Destination and then Source_0 /= Source_1; entry Wait_For_Transfer_Complete; function Not_In_Transfer return Address; private procedure Interrupt_Handler with Attach_Handler => IRQ; Interrupt_Triggered : Boolean := False; Buffer_0 : Address := Null_Address; Buffer_1 : Address := Null_Address; end Double_Buffer_Controller; Audio_TX_DMA : DMA_Controller renames DMA_1; Audio_TX_DMA_Chan : DMA_Channel_Selector renames STM32.DMA.Channel_0; Audio_TX_DMA_Stream : DMA_Stream_Selector renames STM32.DMA.Stream_5; Audio_TX_DMA_Int : Double_Buffer_Controller (Audio_TX_DMA'Access, Audio_TX_DMA_Stream, DMA1_Stream5_Interrupt); end Audio_Stream;
reznikmm/matreshka
Ada
4,693
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_Db.Append_Table_Alias_Name_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Db_Append_Table_Alias_Name_Attribute_Node is begin return Self : Db_Append_Table_Alias_Name_Attribute_Node do Matreshka.ODF_Db.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Db_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Db_Append_Table_Alias_Name_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Append_Table_Alias_Name_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Db_URI, Matreshka.ODF_String_Constants.Append_Table_Alias_Name_Attribute, Db_Append_Table_Alias_Name_Attribute_Node'Tag); end Matreshka.ODF_Db.Append_Table_Alias_Name_Attributes;
stcarrez/ada-ado
Ada
4,374
adb
----------------------------------------------------------------------- -- ado-schemas-entities -- Entity types cache -- Copyright (C) 2011, 2012, 2017, 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 Util.Log.Loggers; with Util.Strings; with ADO.SQL; with ADO.Statements; with ADO.Model; package body ADO.Schemas.Entities is Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("ADO.Schemas.Entities"); -- ------------------------------ -- Expand the name into a target parameter value to be used in the SQL query. -- The Expander can return a T_NULL when a value is not found or -- it may also raise some exception. -- ------------------------------ overriding function Expand (Instance : in out Entity_Cache; Name : in String) return ADO.Parameters.Parameter is Pos : constant Entity_Map.Cursor := Instance.Entities.Find (Name); begin if not Entity_Map.Has_Element (Pos) then Log.Error ("No entity type associated with table {0}", Name); raise No_Entity_Type with "No entity type associated with table " & Name; end if; return ADO.Parameters.Parameter '(T => ADO.Parameters.T_INTEGER, Len => 0, Value_Len => 0, Position => 0, Name => "", Num => Entity_Type'Pos (Entity_Map.Element (Pos))); end Expand; -- ------------------------------ -- Find the entity type index associated with the given database table. -- Raises the No_Entity_Type exception if no such mapping exist. -- ------------------------------ function Find_Entity_Type (Cache : in Entity_Cache; Table : in Class_Mapping_Access) return ADO.Entity_Type is begin return Find_Entity_Type (Cache, Table.Table); end Find_Entity_Type; -- ------------------------------ -- Find the entity type index associated with the given database table. -- Raises the No_Entity_Type exception if no such mapping exist. -- ------------------------------ function Find_Entity_Type (Cache : in Entity_Cache; Name : in Util.Strings.Name_Access) return ADO.Entity_Type is Pos : constant Entity_Map.Cursor := Cache.Entities.Find (Name.all); begin if not Entity_Map.Has_Element (Pos) then Log.Error ("No entity type associated with table {0}", Name.all); raise No_Entity_Type with "No entity type associated with table " & Name.all; end if; return Entity_Type (Entity_Map.Element (Pos)); end Find_Entity_Type; -- ------------------------------ -- Initialize the entity cache by reading the database entity table. -- ------------------------------ procedure Initialize (Cache : in out Entity_Cache; Session : in out ADO.Sessions.Session'Class) is Query : ADO.SQL.Query; Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (ADO.Model.ENTITY_TYPE_TABLE'Access); Count : Natural := 0; begin Stmt.Set_Parameters (Query); Stmt.Execute; while Stmt.Has_Elements loop declare Id : constant ADO.Entity_Type := ADO.Entity_Type (Stmt.Get_Integer (0)); Name : constant String := Stmt.Get_String (1); begin Cache.Entities.Insert (Key => Name, New_Item => Id); end; Count := Count + 1; Stmt.Next; end loop; Log.Info ("Loaded {0} table entities", Util.Strings.Image (Count)); exception when others => null; end Initialize; end ADO.Schemas.Entities;
faelys/natools
Ada
975
adb
with Interfaces; use Interfaces; package body Natools.S_Expressions.Printers.Pretty.Config.Atom_Enc is P : constant array (0 .. 3) of Natural := (1, 4, 5, 10); T1 : constant array (0 .. 3) of Unsigned_8 := (10, 8, 8, 20); T2 : constant array (0 .. 3) of Unsigned_8 := (15, 16, 8, 6); G : constant array (0 .. 20) of Unsigned_8 := (0, 0, 7, 0, 0, 3, 4, 2, 0, 0, 5, 0, 0, 1, 8, 0, 0, 0, 0, 4, 6); function Hash (S : String) return Natural is F : constant Natural := S'First - 1; L : constant Natural := S'Length; F1, F2 : Natural := 0; J : Natural; begin for K in P'Range loop exit when L < P (K); J := Character'Pos (S (P (K) + F)); F1 := (F1 + Natural (T1 (K)) * J) mod 21; F2 := (F2 + Natural (T2 (K)) * J) mod 21; end loop; return (Natural (G (F1)) + Natural (G (F2))) mod 10; end Hash; end Natools.S_Expressions.Printers.Pretty.Config.Atom_Enc;
zrmyers/VulkanAda
Ada
6,617
ads
-------------------------------------------------------------------------------- -- MIT License -- -- Copyright (c) 2020 Zane Myers -- -- 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 Vulkan.Math.GenIType; with Vulkan.Math.Ivec2; use Vulkan.Math.GenIType; use Vulkan.Math.Ivec2; -------------------------------------------------------------------------------- --< @group Vulkan Math Basic Types -------------------------------------------------------------------------------- --< @summary --< This package defines a 32-bit signed integer vector type with 3 components. -------------------------------------------------------------------------------- package Vulkan.Math.Ivec3 is pragma Preelaborate; pragma Pure; --< A 3 component vector of 32-bit signed integers. subtype Vkm_Ivec3 is Vkm_GenIType(Last_Index => 2); ---------------------------------------------------------------------------- -- Ada does not have the concept of constructors in the sense that they exist -- in C++. For this reason, we will instead define multiple methods for -- instantiating a dvec3 here. ---------------------------------------------------------------------------- -- The following are explicit constructors for Ivec3: ---------------------------------------------------------------------------- --< @summary --< Constructor for Vkm_Ivec3 type. --< --< @description --< Produce a default vector with all components set to 0. -- --< @return a Ivec3 with all components set to 0.0. ---------------------------------------------------------------------------- function Make_Ivec3 return Vkm_Ivec3 is (GIT.Make_GenType(Last_Index => 2, value => 0)) with Inline; ---------------------------------------------------------------------------- --< @summary --< Constructor for Vkm_Ivec3 type. --< --< @description --< Produce a vector with all components set to the same value. -- --< @param scalar_value --< The value to set all components to. -- --< @return --<An Ivec3 with all components set to scalar_value. ---------------------------------------------------------------------------- function Make_Ivec3 (scalar_value : in Vkm_Int) return Vkm_Ivec3 is (GIT.Make_GenType(Last_Index => 2, value => scalar_value)) with Inline; ---------------------------------------------------------------------------- --< @summary --< Constructor for Vkm_Ivec3 type. --< --< @description --< Produce a vector by copying components from an existing vector. -- --< @param vec3_value --< The Ivec3 to copy components from. -- --< @return --< An Ivec3 with all of its components set equal to the corresponding --< components of vec3_value. ---------------------------------------------------------------------------- function Make_Ivec3 (vec3_value : in Vkm_Ivec3) return Vkm_Ivec3 is (GIT.Make_GenType(vec3_value.data(0),vec3_value.data(1), vec3_value.data(2))) with Inline; ---------------------------------------------------------------------------- --< @summary --< Constructor for Vkm_Ivec3 type. --< --< @description --< Produce a vector by specifying the values for each of its components. -- --< @param value1 Value for component 1. --< @param value2 Value for component 2. --< @param value3 Value for componetn 3. -- --< @return An Ivec3 with all components set as specified. ---------------------------------------------------------------------------- function Make_Ivec3 (value1, value2, value3 : in Vkm_Int) return Vkm_Ivec3 renames GIT.Make_GenType; ---------------------------------------------------------------------------- --< @summary --< Constructor for Vkm_Ivec3 type. --< --< @description --< Produce a vector by concatenating a scalar float with a vec2. -- --< Ivec3 = [scalar_value, vec2_value] -- --< @param scalar_value The scalar value to concatenate with the Ivec3. --< @param vec2_value The vec2 to concatenate to the scalar value. -- --< @return The instance of Ivec3. ---------------------------------------------------------------------------- function Make_Ivec3 (scalar_value : in Vkm_Int; vec2_value : in Vkm_Ivec2 ) return Vkm_Ivec3 is (Make_Ivec3(scalar_value, vec2_value.x, vec2_value.y)) with Inline; ---------------------------------------------------------------------------- --< @summary --< Constructor for Vkm_Ivec3 type. --< --< @description --< Produce a vector by concatenating a scalar float with a vec2. -- --< Ivec3 = [vec2_value, scalar_value] -- --< @param vec2_value The vec2 to concatenate to the scalar value. --< @param scalar_value The scalar value to concatenate with the Ivec3. -- --< @return The instance of Ivec3. ---------------------------------------------------------------------------- function Make_Ivec3 (vec2_value : in Vkm_Ivec2; scalar_value : in Vkm_Int ) return Vkm_Ivec3 is (Make_Ivec3(vec2_value.x, vec2_value.y, scalar_value)) with Inline; end Vulkan.Math.Ivec3;
zhmu/ananas
Ada
6,246
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 9 3 -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System.Storage_Elements; with System.Unsigned_Types; package body System.Pack_93 is subtype Bit_Order is System.Bit_Order; Reverse_Bit_Order : constant Bit_Order := Bit_Order'Val (1 - Bit_Order'Pos (System.Default_Bit_Order)); subtype Ofs is System.Storage_Elements.Storage_Offset; subtype Uns is System.Unsigned_Types.Unsigned; subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7; use type System.Storage_Elements.Storage_Offset; use type System.Unsigned_Types.Unsigned; type Cluster is record E0, E1, E2, E3, E4, E5, E6, E7 : Bits_93; end record; for Cluster use record E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1; E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1; E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1; E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1; E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1; E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1; E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1; E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1; end record; for Cluster'Size use Bits * 8; for Cluster'Alignment use Integer'Min (Standard'Maximum_Alignment, 1 + 1 * Boolean'Pos (Bits mod 2 = 0) + 2 * Boolean'Pos (Bits mod 4 = 0)); -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. type Cluster_Ref is access Cluster; type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; type Rev_Cluster_Ref is access Rev_Cluster; ------------ -- Get_93 -- ------------ function Get_93 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_93 is A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); C : Cluster_Ref with Address => A'Address, Import; RC : Rev_Cluster_Ref with Address => A'Address, Import; begin if Rev_SSO then case N07 (Uns (N) mod 8) is when 0 => return RC.E0; when 1 => return RC.E1; when 2 => return RC.E2; when 3 => return RC.E3; when 4 => return RC.E4; when 5 => return RC.E5; when 6 => return RC.E6; when 7 => return RC.E7; end case; else case N07 (Uns (N) mod 8) is when 0 => return C.E0; when 1 => return C.E1; when 2 => return C.E2; when 3 => return C.E3; when 4 => return C.E4; when 5 => return C.E5; when 6 => return C.E6; when 7 => return C.E7; end case; end if; end Get_93; ------------ -- Set_93 -- ------------ procedure Set_93 (Arr : System.Address; N : Natural; E : Bits_93; Rev_SSO : Boolean) is A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); C : Cluster_Ref with Address => A'Address, Import; RC : Rev_Cluster_Ref with Address => A'Address, Import; begin if Rev_SSO then case N07 (Uns (N) mod 8) is when 0 => RC.E0 := E; when 1 => RC.E1 := E; when 2 => RC.E2 := E; when 3 => RC.E3 := E; when 4 => RC.E4 := E; when 5 => RC.E5 := E; when 6 => RC.E6 := E; when 7 => RC.E7 := E; end case; else case N07 (Uns (N) mod 8) is when 0 => C.E0 := E; when 1 => C.E1 := E; when 2 => C.E2 := E; when 3 => C.E3 := E; when 4 => C.E4 := E; when 5 => C.E5 := E; when 6 => C.E6 := E; when 7 => C.E7 := E; end case; end if; end Set_93; end System.Pack_93;
cborao/Ada-P2
Ada
1,300
ads
with Ada.Strings.Unbounded; with Lower_Layer_UDP; package Client_Collections is package ASU renames Ada.Strings.Unbounded; package LLU renames Lower_Layer_UDP; type Collection_Type is limited private; Client_Collection_Error: exception; procedure Add_Client (Collection: in out Collection_Type; EP: in LLU.End_Point_Type; Nick: in ASU.Unbounded_String; Unique: in Boolean); procedure Delete_Client (Collection: in out Collection_Type; Nick: in ASU.Unbounded_String); function Search_Client (Collection: in Collection_Type; EP: in LLU.End_Point_Type) return ASU.Unbounded_String; procedure Send_To_All (Collection: in Collection_Type; P_Buffer: access LLU.Buffer_Type); function Collection_Image (Collection: in Collection_Type) return String; private type Cell; type Cell_A is access Cell; type Cell is record Client_EP: LLU.End_Point_Type; Nick: ASU.Unbounded_String; Next: Cell_A; end record; type Collection_Type is record P_First: Cell_A; Total: Natural := 0; end record; end Client_Collections;
Tim-Tom/project-euler
Ada
58
ads
package Problem_30 is procedure Solve; end Problem_30;
AdaCore/langkit
Ada
3,141
adb
-- Test that the Equivalence function for lexical envs works properly with Ada.Text_IO; use Ada.Text_IO; with Langkit_Support.Lexical_Envs; use Langkit_Support.Lexical_Envs; with Langkit_Support.Symbols; use Langkit_Support.Symbols; with Support; use Support; procedure Main is use Envs; function "+" (S : String) return String_Access is (new String'(S)); Name_Old_Env_1 : String_Access := +"Old_Env_1"; Name_New_Env_1 : String_Access := +"New_Env_1"; Name_Old_Env_2 : String_Access := +"Old_Env_2"; Name_New_Env_2 : String_Access := +"New_Env_2"; Name_Prim_A : String_Access := +"Prim_A"; Name_Prim_B : String_Access := +"Prim_B"; Name_Item_X1 : String_Access := +"Item(X1)"; Name_Item_X2 : String_Access := +"Item(X2)"; Name_Item_Y1 : String_Access := +"Item(Y1)"; Name_Item_Y2 : String_Access := +"Item(Y2)"; Symbols : Symbol_Table := Create_Symbol_Table; Key_X : constant Symbol_Type := Find (Symbols, "X"); Key_Y : constant Symbol_Type := Find (Symbols, "Y"); Old_Env_1 : Lexical_Env := Create_Lexical_Env (Null_Lexical_Env, Name_Old_Env_1, Owner => No_Generic_Unit); New_Env_1 : Lexical_Env := Create_Lexical_Env (Null_Lexical_Env, Name_New_Env_1, Owner => No_Generic_Unit); Old_Env_2 : Lexical_Env := Create_Lexical_Env (Null_Lexical_Env, Name_Old_Env_2, Owner => No_Generic_Unit); New_Env_2 : Lexical_Env := Create_Lexical_Env (Null_Lexical_Env, Name_New_Env_2, Owner => No_Generic_Unit); R1 : Env_Rebindings := Append (null, Old_Env_1, New_Env_1); R2 : Env_Rebindings := Append (R1, Old_Env_2, New_Env_2); Prim_A : Lexical_Env := Create_Lexical_Env (Null_Lexical_Env, Name_Prim_A, Owner => No_Generic_Unit); Prim_B : Lexical_Env := Create_Lexical_Env (Prim_A, Name_Prim_B, Owner => No_Generic_Unit); Orphaned_1 : Lexical_Env := Orphan (Prim_B); Orphaned_2 : Lexical_Env := Orphan (Orphaned_1); Grouped: Lexical_Env := Group ((Orphaned_1, Orphaned_2), (I => 1)); Rebound : Lexical_Env := Rebind_Env (Prim_B, R2); begin Add (Prim_A, Key_X, Name_Item_X1); Add (Prim_A, Key_X, Name_Item_X2); Add (Prim_A, Key_Y, Name_Item_Y1); Add (Prim_B, Key_Y, Name_Item_Y2); Put (Lexical_Env_Image (Prim_A)); Put (Lexical_Env_Image (Prim_B)); New_Line; Put (Lexical_Env_Image (Orphaned_1)); Put (Lexical_Env_Image (Orphaned_2)); New_Line; Put (Lexical_Env_Image (Grouped)); New_Line; Put (Lexical_Env_Image (Rebound)); Dec_Ref (Orphaned_1); Dec_Ref (Orphaned_2); Dec_Ref (Grouped); Dec_Ref (Rebound); Destroy (Old_Env_1); Destroy (New_Env_1); Destroy (Old_Env_2); Destroy (New_Env_2); Destroy (Prim_A); Destroy (Prim_B); R1.Children.Destroy; Destroy (R1); Destroy (R2); Destroy (Symbols); Destroy (Name_Old_Env_1); Destroy (Name_New_Env_1); Destroy (Name_Old_Env_2); Destroy (Name_New_Env_2); Destroy (Name_Prim_A); Destroy (Name_Prim_B); Destroy (Name_Item_X1); Destroy (Name_Item_X2); Destroy (Name_Item_Y1); Destroy (Name_Item_Y2); New_Line; Put_Line ("Done."); end Main;
AdaCore/gpr
Ada
2,687
adb
with GPR2; use GPR2; with GPR2.Project.Tree; with GPR2.Context; use GPR2.Context; with GPR2.Log; with Ada.Strings.Fixed; with Ada.Text_IO; procedure Main is Ctx : Context.Object := Context.Empty; Project_Tree : Project.Tree.Object; procedure Check_Messages (Name : Boolean := False; Path : Boolean := False; Version : Boolean := False); procedure Check_Messages (Name : Boolean := False; Path : Boolean := False; Version : Boolean := False) is use Ada.Strings.Fixed; begin for C in Project_Tree.Log_Messages.Iterate (Information => False, Warning => True, Error => True, Read => True, Unread => True) loop declare Msg : constant String := GPR2.Log.Element (C).Format; Expected : Boolean := False; begin if Index (Msg, "can't find a toolchain") > 0 then if not (Index (Msg, "name '") > 0 xor Name) and then not (Index (Msg, "path '") > 0 xor Path) and then not (Index (Msg, "version '") > 0 xor Version) then Expected := True; end if; end if; if Expected then Ada.Text_IO.Put_Line (Msg (Index (Msg, "default runtime") + 17 .. Msg'Last)); else Ada.Text_IO.Put_Line ("unexpected message: " & Msg); end if; end; end loop; end Check_Messages; begin Project_Tree.Load_Autoconf (Filename => Project.Create ("prj.gpr"), Context => Ctx); Check_Messages; Project_Tree.Unload; Ctx.Include ("TC_NAME", "toto"); Project_Tree.Load_Autoconf (Filename => Project.Create ("prj.gpr"), Context => Ctx); Check_Messages (Name => True); Project_Tree.Unload; Ctx.Clear; Ctx.Include ("TC_PATH", "toto"); Project_Tree.Load_Autoconf (Filename => Project.Create ("prj.gpr"), Context => Ctx); Check_Messages (Path => True); Project_Tree.Unload; Ctx.Clear; Ctx.Include ("TC_VERSION", "toto"); Project_Tree.Load_Autoconf (Filename => Project.Create ("prj.gpr"), Context => Ctx); Check_Messages (Version => True); Project_Tree.Unload; Ctx.Include ("TC_NAME", "toto"); Ctx.Include ("TC_PATH", "toto"); Project_Tree.Load_Autoconf (Filename => Project.Create ("prj.gpr"), Context => Ctx); Check_Messages (True, True, True); Project_Tree.Unload; end Main;
docandrew/sdlada
Ada
5,806
ads
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- -- SDL.Events.Events -- -- Combines all of the various event types into a single variant record to match the union in the SDL library. Not -- the nicest of names for the package, but it works. -------------------------------------------------------------------------------------------------------------------- with SDL.Events.Windows; with SDL.Events.Keyboards; with SDL.Events.Mice; with SDL.Events.Joysticks; with SDL.Events.Controllers; with SDL.Events.Touches; with SDL.Events.Files; package SDL.Events.Events is type Event_Selector is (Is_Event, Is_Window_Event, Is_Keyboard_Event, Is_Text_Editing_Event, Is_Text_Input_Event, Is_Mouse_Motion_Event, Is_Mouse_Button_Event, Is_Mouse_Wheel_Event, Is_Joystick_Axis_Event, Is_Joystick_Ball_Event, Is_Joystick_Hat_Event, Is_Joystick_Button_Event, Is_Joystick_Device_Event, Is_Controller_Axis_Event, Is_Controller_Button_Event, Is_Controller_Device_Event, Is_Touch_Finger_Event, Is_Touch_Multi_Gesture_Event, Is_Touch_Dollar_Gesture, Is_Drop_Event); type Events (Event_Type : Event_Selector := Is_Event) is record case Event_Type is when Is_Window_Event => Window : SDL.Events.Windows.Window_Events; when Is_Keyboard_Event => Keyboard : SDL.Events.Keyboards.Keyboard_Events; when Is_Text_Editing_Event => Text_Editing : SDL.Events.Keyboards.Text_Editing_Events; when Is_Text_Input_Event => Text_Input : SDL.Events.Keyboards.Text_Input_Events; when Is_Mouse_Motion_Event => Mouse_Motion : SDL.Events.Mice.Motion_Events; when Is_Mouse_Button_Event => Mouse_Button : SDL.Events.Mice.Button_Events; when Is_Mouse_Wheel_Event => Mouse_Wheel : SDL.Events.Mice.Wheel_Events; when Is_Joystick_Axis_Event => Joystick_Axis : SDL.Events.Joysticks.Axis_Events; when Is_Joystick_Ball_Event => Joystick_Ball : SDL.Events.Joysticks.Ball_Events; when Is_Joystick_Hat_Event => Joystick_Hat : SDL.Events.Joysticks.Hat_Events; when Is_Joystick_Button_Event => Joystick_Button : SDL.Events.Joysticks.Button_Events; when Is_Joystick_Device_Event => Joystick_Device : SDL.Events.Joysticks.Device_Events; when Is_Controller_Axis_Event => Controller_Axis : SDL.Events.Controllers.Axis_Events; when Is_Controller_Button_Event => Controller_Button : SDL.Events.Controllers.Button_Events; when Is_Controller_Device_Event => Controller_Device : SDL.Events.Controllers.Device_Events; when Is_Touch_Finger_Event => Touch_Finger : SDL.Events.Touches.Finger_Events; when Is_Touch_Multi_Gesture_Event => Touch_Multi_Gesture : SDL.Events.Touches.Multi_Gesture_Events; when Is_Touch_Dollar_Gesture => Touch_Dollar_Gesture : SDL.Events.Touches.Dollar_Events; when Is_Drop_Event => Drop : SDL.Events.Files.Drop_Events; when others => Common : Common_Events; end case; end record with Unchecked_Union, Convention => C; -- Some error occurred while polling/waiting for events. Event_Error : exception; -- Poll for currently pending events. -- -- If the are any pending events, the next event is removed from the queue -- and stored in Event, and then this returns True. Otherwise, this does -- nothing and returns False. function Poll (Event : out Events) return Boolean with Inline => True; -- Wait until an event is pending. -- -- If there are any pending events, the next event is removed from -- the queue and stored in Event. procedure Wait (Event : out Events); end SDL.Events.Events;
leo-brewin/adm-bssn-numerical
Ada
1,588
ads
with Support; use Support; with BSSNBase; use BSSNBase; package Metric.Kasner is ---------------------------------------------------------------------------- -- ADM data function set_3d_lapse (t, x, y, z : Real) return Real; function set_3d_metric (t, x, y, z : Real) return MetricPointArray; function set_3d_extcurv (t, x, y, z : Real) return ExtcurvPointArray; function set_3d_lapse (t : Real; point : GridPoint) return Real; function set_3d_metric (t : Real; point : GridPoint) return MetricPointArray; function set_3d_extcurv (t : Real; point : GridPoint) return ExtcurvPointArray; ---------------------------------------------------------------------------- -- BSSN data function set_3d_phi (t, x, y, z : Real) return Real; function set_3d_trK (t, x, y, z : Real) return Real; function set_3d_gBar (t, x, y, z : Real) return MetricPointArray; function set_3d_Abar (t, x, y, z : Real) return ExtcurvPointArray; function set_3d_Gi (t, x, y, z : Real) return GammaPointArray; function set_3d_phi (t : Real; point : GridPoint) return Real; function set_3d_trK (t : Real; point : GridPoint) return Real; function set_3d_gBar (t : Real; point : GridPoint) return MetricPointArray; function set_3d_Abar (t : Real; point : GridPoint) return ExtcurvPointArray; function set_3d_Gi (t : Real; point : GridPoint) return GammaPointArray; ---------------------------------------------------------------------------- procedure get_pi (p1, p2, p3 : out Real); procedure report_kasner_params; end Metric.Kasner;
reznikmm/matreshka
Ada
4,631
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Form.Current_Value_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Form_Current_Value_Attribute_Node is begin return Self : Form_Current_Value_Attribute_Node do Matreshka.ODF_Form.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Form_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Form_Current_Value_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Current_Value_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Form_URI, Matreshka.ODF_String_Constants.Current_Value_Attribute, Form_Current_Value_Attribute_Node'Tag); end Matreshka.ODF_Form.Current_Value_Attributes;
zhmu/ananas
Ada
234
adb
-- { dg-do compile } with Ada.Unchecked_Conversion; package body SSO2 is function Conv is new Ada.Unchecked_Conversion (Arr1, Arr2); procedure Proc (A1 : Arr1; A2 : out Arr2) is begin A2 := Conv (A1); end; end SSO2;
AdaCore/libadalang
Ada
475
adb
procedure T925_008 is generic type TP is private; procedure G(T : TP); procedure Test is procedure G_Instance is new G(TP => Integer); begin G_Instance(42); --% node[0].p_referenced_decl().p_subp_spec_or_null(follow_generic=True) --% node[0].p_is_dispatching_call() -- ^ -- is_dispatching_call uses subp_spec_or_null. end Test; procedure G(T : TP) is begin null; end G; begin null; end T925_008;
jhumphry/PRNG_Zoo
Ada
3,149
ads
-- -- PRNG Zoo -- Copyright (c) 2014 - 2015, James Humphry -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -- PERFORMANCE OF THIS SOFTWARE. with PRNG_Zoo.Tests; package PRNG_Zoo.Stats is -- Returns the adjusted p-value to use for testing n results so that the -- overall chance of a false positive is p. function Adjusted_alpha(alpha : Long_Float; N : Positive) return Long_Float; -- Returns the error function -- Based on (Abramowitz and Stegun, 1972) 7.1.26 function erf(x : Long_Float) return Long_Float; -- Returns the inverse error function -- Based on the note by (Winitzki, 2008) -- Not quite as accurate as the erf function given above function erfi(x : Long_Float) return Long_Float; -- Returns the p-value corresponding to the probability of the null -- hypothesis function Z_Score(Z : Long_Float; Two_Tailed: Boolean := True) return Long_Float; -- Returns True if the test statistic Z indicates that the null hypothesis -- is not ruled out to a confidence level of alpha function Z_Score(Z : Long_Float; alpha : Long_Float := 0.05; Two_Tailed: Boolean := True) return Boolean; -- Returns True if the test statistic Chi2 indicates that the null hypothesis -- is not ruled out to a confidence level of alpha with df degrees of freedom -- Based on a version of (Abramowitz and Stegun, 1972) 26.4.6, see notes function Chi2_Test(Chi2 : Long_Float; df : Positive; alpha : Long_Float := 0.05) return Boolean; function Chi2_CDF(X : Long_Float; K : Positive; epsilon : Long_Float := 1.0E-6) return Long_Float; -- Return the Gamma function for N/2 function Gamma_HalfN(N : Positive) return Long_Float; -- Return the logarithm of the Gamma function for N/2 function Log_Gamma_HalfN(N : Positive) return Long_Float; -- Compute the Chi2 test for an array of counters representing the binned -- results of some sort of test function Chi2_Value_Bins(B : Tests.Binned) return Long_Float; function Chi2_CDF_Bins(B : Tests.Binned) return Long_Float; function Chi2_Bins_Test(B : Tests.Binned; alpha : Long_Float := 0.05) return Boolean; -- Make a set of bins suitable for testing variates that are supposed to -- be from the normal distribution procedure Make_Normal_Bins(B : in out Tests.Binned); end PRNG_Zoo.Stats;
reznikmm/matreshka
Ada
4,093
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2018, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package body WUI.Applications is Global_Instance : Application_Access; -------------------------- -- Focus_Changed_Signal -- -------------------------- not overriding function Focus_Changed_Signal (Self : in out Application) return not null access WUI.Widgets_Widgets_Slots.Signal'Class is begin return Self.Focus_Changed'Unchecked_Access; end Focus_Changed_Signal; ---------------- -- Initialize -- ---------------- procedure Initialize is begin Global_Instance := new Application; end Initialize; -------------- -- Instance -- -------------- function Instance return Application_Access is begin return Global_Instance; end Instance; end WUI.Applications;
sungyeon/drake
Ada
541
ads
pragma License (Unrestricted); -- extended unit package Ada.Exception_Identification.From_Here is -- For shorthand. pragma Pure; procedure Raise_Exception ( E : Exception_Id; File : String := Debug.File; Line : Integer := Debug.Line) renames Raise_Exception_From_Here; procedure Raise_Exception ( E : Exception_Id; File : String := Debug.File; Line : Integer := Debug.Line; Message : String) renames Raise_Exception_From_Here; end Ada.Exception_Identification.From_Here;
reznikmm/matreshka
Ada
3,744
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_Dynamic_Spacing_Attributes is pragma Preelaborate; type ODF_Style_Dynamic_Spacing_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Style_Dynamic_Spacing_Attribute_Access is access all ODF_Style_Dynamic_Spacing_Attribute'Class with Storage_Size => 0; end ODF.DOM.Style_Dynamic_Spacing_Attributes;
reznikmm/matreshka
Ada
3,674
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_Cy_Attributes is pragma Preelaborate; type ODF_Draw_Cy_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Draw_Cy_Attribute_Access is access all ODF_Draw_Cy_Attribute'Class with Storage_Size => 0; end ODF.DOM.Draw_Cy_Attributes;
zhmu/ananas
Ada
266
adb
-- { dg-do compile } -- { dg-options "-gnata" } procedure Loop_Entry2 (S : String) is J : Integer := S'First; begin while S(J..J+1) = S(J..J+1) loop pragma Loop_Invariant (for all K in J'Loop_Entry .. J => K <= J); J := J + 1; end loop; end;
reznikmm/matreshka
Ada
4,164
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2015-2019, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package body Servlet.HTTP_Responses is ---------------- -- Get_Header -- ---------------- function Get_Header (Self : in out HTTP_Servlet_Response'Class; Name : League.Strings.Universal_String) return League.Strings.Universal_String is Aux : constant League.String_Vectors.Universal_String_Vector := Self.Get_Headers (Name); begin if Aux.Is_Empty then return League.Strings.Empty_Universal_String; else return Aux (1); end if; end Get_Header; ---------------- -- Send_Error -- ---------------- procedure Send_Error (Self : in out HTTP_Servlet_Response'Class; Code : Status_Code) is begin Self.Send_Error (Code, League.Strings.Empty_Universal_String); end Send_Error; end Servlet.HTTP_Responses;
sparre/Ada-2012-Examples
Ada
364
adb
package body Classes.Parent is function Name (Item : in Instance) return String is begin return Ada.Strings.Unbounded.To_String (Item.Name); end Name; procedure Set (Item : in out Instance; Name : in String) is begin Item.Name := Ada.Strings.Unbounded.To_Unbounded_String (Name); end Set; end Classes.Parent;
Vikash-Kothary/swagger-aem
Ada
244,572
adb
-- Adobe Experience Manager (AEM) API -- Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API -- -- OpenAPI spec version: 3.2.0_pre.0 -- Contact: [email protected] -- -- NOTE: This package is auto generated by the swagger code generator 3.2.1-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. with Swagger.Streams; with Swagger.Servers.Operation; package body .Skeletons is package body Skeleton is package API_Get_Aem_Product_Info is new Swagger.Servers.Operation (Handler => Get_Aem_Product_Info, Method => Swagger.Servers.GET, URI => "/system/console/status-productinfo.json"); -- procedure Get_Aem_Product_Info (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Result : Swagger.UString_Vectors.Vector; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Impl.Get_Aem_Product_Info (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Aem_Product_Info; package API_Get_Config_Mgr is new Swagger.Servers.Operation (Handler => Get_Config_Mgr, Method => Swagger.Servers.GET, URI => "/system/console/configMgr"); -- procedure Get_Config_Mgr (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Impl.Get_Config_Mgr (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Config_Mgr; package API_Post_Bundle is new Swagger.Servers.Operation (Handler => Post_Bundle, Method => Swagger.Servers.POST, URI => "/system/console/bundles/{name}"); -- procedure Post_Bundle (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Name : Swagger.UString; Action : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "action", Action); Swagger.Servers.Get_Path_Parameter (Req, 1, Name); Impl.Post_Bundle (Name, Action, Context); end Post_Bundle; package API_Post_Jmx_Repository is new Swagger.Servers.Operation (Handler => Post_Jmx_Repository, Method => Swagger.Servers.POST, URI => "/system/console/jmx/com.adobe.granite:type=Repository/op/{action}"); -- procedure Post_Jmx_Repository (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Action : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 1, Action); Impl.Post_Jmx_Repository (Action, Context); end Post_Jmx_Repository; package API_Post_Saml_Configuration is new Swagger.Servers.Operation (Handler => Post_Saml_Configuration, Method => Swagger.Servers.POST, URI => "/system/console/configMgr/com.adobe.granite.auth.saml.SamlAuthenticationHandler"); -- procedure Post_Saml_Configuration (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Post : Swagger.Nullable_Boolean; Apply : Swagger.Nullable_Boolean; Delete : Swagger.Nullable_Boolean; Action : Swagger.Nullable_UString; Dollarlocation : Swagger.Nullable_UString; Path : Swagger.UString_Vectors.Vector; Service_Periodranking : Swagger.Nullable_Integer; Idp_Url : Swagger.Nullable_UString; Idp_Cert_Alias : Swagger.Nullable_UString; Idp_Http_Redirect : Swagger.Nullable_Boolean; Service_Provider_Entity_Id : Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L : Swagger.Nullable_UString; Sp_Private_Key_Alias : Swagger.Nullable_UString; Key_Store_Password : Swagger.Nullable_UString; Default_Redirect_Url : Swagger.Nullable_UString; User_I_D_Attribute : Swagger.Nullable_UString; Use_Encryption : Swagger.Nullable_Boolean; Create_User : Swagger.Nullable_Boolean; Add_Group_Memberships : Swagger.Nullable_Boolean; Group_Membership_Attribute : Swagger.Nullable_UString; Default_Groups : Swagger.UString_Vectors.Vector; Name_Id_Format : Swagger.Nullable_UString; Synchronize_Attributes : Swagger.UString_Vectors.Vector; Handle_Logout : Swagger.Nullable_Boolean; Logout_Url : Swagger.Nullable_UString; Clock_Tolerance : Swagger.Nullable_Integer; Digest_Method : Swagger.Nullable_UString; Signature_Method : Swagger.Nullable_UString; User_Intermediate_Path : Swagger.Nullable_UString; Propertylist : Swagger.UString_Vectors.Vector; Result : .Models.SamlConfigurationInfo_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "post", Post); Swagger.Servers.Get_Query_Parameter (Req, "apply", Apply); Swagger.Servers.Get_Query_Parameter (Req, "delete", Delete); Swagger.Servers.Get_Query_Parameter (Req, "action", Action); Swagger.Servers.Get_Query_Parameter (Req, "$location", Dollarlocation); Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "service.ranking", Service_Periodranking); Swagger.Servers.Get_Query_Parameter (Req, "idpUrl", Idp_Url); Swagger.Servers.Get_Query_Parameter (Req, "idpCertAlias", Idp_Cert_Alias); Swagger.Servers.Get_Query_Parameter (Req, "idpHttpRedirect", Idp_Http_Redirect); Swagger.Servers.Get_Query_Parameter (Req, "serviceProviderEntityId", Service_Provider_Entity_Id); Swagger.Servers.Get_Query_Parameter (Req, "assertionConsumerServiceURL", Assertion_Consumer_Service_U_R_L); Swagger.Servers.Get_Query_Parameter (Req, "spPrivateKeyAlias", Sp_Private_Key_Alias); Swagger.Servers.Get_Query_Parameter (Req, "keyStorePassword", Key_Store_Password); Swagger.Servers.Get_Query_Parameter (Req, "defaultRedirectUrl", Default_Redirect_Url); Swagger.Servers.Get_Query_Parameter (Req, "userIDAttribute", User_I_D_Attribute); Swagger.Servers.Get_Query_Parameter (Req, "useEncryption", Use_Encryption); Swagger.Servers.Get_Query_Parameter (Req, "createUser", Create_User); Swagger.Servers.Get_Query_Parameter (Req, "addGroupMemberships", Add_Group_Memberships); Swagger.Servers.Get_Query_Parameter (Req, "groupMembershipAttribute", Group_Membership_Attribute); Swagger.Servers.Get_Query_Parameter (Req, "defaultGroups", Default_Groups); Swagger.Servers.Get_Query_Parameter (Req, "nameIdFormat", Name_Id_Format); Swagger.Servers.Get_Query_Parameter (Req, "synchronizeAttributes", Synchronize_Attributes); Swagger.Servers.Get_Query_Parameter (Req, "handleLogout", Handle_Logout); Swagger.Servers.Get_Query_Parameter (Req, "logoutUrl", Logout_Url); Swagger.Servers.Get_Query_Parameter (Req, "clockTolerance", Clock_Tolerance); Swagger.Servers.Get_Query_Parameter (Req, "digestMethod", Digest_Method); Swagger.Servers.Get_Query_Parameter (Req, "signatureMethod", Signature_Method); Swagger.Servers.Get_Query_Parameter (Req, "userIntermediatePath", User_Intermediate_Path); Swagger.Servers.Get_Query_Parameter (Req, "propertylist", Propertylist); Impl.Post_Saml_Configuration (Post, Apply, Delete, Action, Dollarlocation, Path, Service_Periodranking, Idp_Url, Idp_Cert_Alias, Idp_Http_Redirect, Service_Provider_Entity_Id, Assertion_Consumer_Service_U_R_L, Sp_Private_Key_Alias, Key_Store_Password, Default_Redirect_Url, User_I_D_Attribute, Use_Encryption, Create_User, Add_Group_Memberships, Group_Membership_Attribute, Default_Groups, Name_Id_Format, Synchronize_Attributes, Handle_Logout, Logout_Url, Clock_Tolerance, Digest_Method, Signature_Method, User_Intermediate_Path, Propertylist, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Saml_Configuration; package API_Get_Login_Page is new Swagger.Servers.Operation (Handler => Get_Login_Page, Method => Swagger.Servers.GET, URI => "/libs/granite/core/content/login.html"); -- procedure Get_Login_Page (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Result : Swagger.UString; begin Impl.Get_Login_Page (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Login_Page; package API_Post_Cq_Actions is new Swagger.Servers.Operation (Handler => Post_Cq_Actions, Method => Swagger.Servers.POST, URI => "/.cqactions.html"); -- procedure Post_Cq_Actions (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Authorizable_Id : Swagger.UString; Changelog : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "authorizableId", Authorizable_Id); Swagger.Servers.Get_Query_Parameter (Req, "changelog", Changelog); Impl.Post_Cq_Actions (Authorizable_Id, Changelog, Context); end Post_Cq_Actions; package API_Get_Crxde_Status is new Swagger.Servers.Operation (Handler => Get_Crxde_Status, Method => Swagger.Servers.GET, URI => "/crx/server/crx.default/jcr:root/.1.json"); -- procedure Get_Crxde_Status (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Impl.Get_Crxde_Status (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Crxde_Status; package API_Get_Install_Status is new Swagger.Servers.Operation (Handler => Get_Install_Status, Method => Swagger.Servers.GET, URI => "/crx/packmgr/installstatus.jsp"); -- procedure Get_Install_Status (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Result : .Models.InstallStatus_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Impl.Get_Install_Status (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Install_Status; package API_Get_Package_Manager_Servlet is new Swagger.Servers.Operation (Handler => Get_Package_Manager_Servlet, Method => Swagger.Servers.GET, URI => "/crx/packmgr/service/script.html"); -- procedure Get_Package_Manager_Servlet (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Impl.Get_Package_Manager_Servlet (Context); end Get_Package_Manager_Servlet; package API_Post_Package_Service is new Swagger.Servers.Operation (Handler => Post_Package_Service, Method => Swagger.Servers.POST, URI => "/crx/packmgr/service.jsp"); -- procedure Post_Package_Service (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Cmd : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "cmd", Cmd); Impl.Post_Package_Service (Cmd, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Package_Service; package API_Post_Package_Service_Json is new Swagger.Servers.Operation (Handler => Post_Package_Service_Json, Method => Swagger.Servers.POST, URI => "/crx/packmgr/service/.json/{path}"); -- procedure Post_Package_Service_Json (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Path : Swagger.UString; Cmd : Swagger.UString; Group_Name : Swagger.Nullable_UString; Package_Name : Swagger.Nullable_UString; Package_Version : Swagger.Nullable_UString; Charset : Swagger.Nullable_UString; Force : Swagger.Nullable_Boolean; Recursive : Swagger.Nullable_Boolean; P_Package : Swagger.File_Part_Type; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "cmd", Cmd); Swagger.Servers.Get_Query_Parameter (Req, "groupName", Group_Name); Swagger.Servers.Get_Query_Parameter (Req, "packageName", Package_Name); Swagger.Servers.Get_Query_Parameter (Req, "packageVersion", Package_Version); Swagger.Servers.Get_Query_Parameter (Req, "_charset_", Charset); Swagger.Servers.Get_Query_Parameter (Req, "force", Force); Swagger.Servers.Get_Query_Parameter (Req, "recursive", Recursive); Swagger.Servers.Get_Path_Parameter (Req, 1, Path); Swagger.Servers.Get_Parameter (Context, "package", P_Package); Impl.Post_Package_Service_Json (Path, Cmd, Group_Name, Package_Name, Package_Version, Charset, Force, Recursive, P_Package, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Package_Service_Json; package API_Post_Package_Update is new Swagger.Servers.Operation (Handler => Post_Package_Update, Method => Swagger.Servers.POST, URI => "/crx/packmgr/update.jsp"); -- procedure Post_Package_Update (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Group_Name : Swagger.UString; Package_Name : Swagger.UString; Version : Swagger.UString; Path : Swagger.UString; Filter : Swagger.Nullable_UString; Charset : Swagger.Nullable_UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "groupName", Group_Name); Swagger.Servers.Get_Query_Parameter (Req, "packageName", Package_Name); Swagger.Servers.Get_Query_Parameter (Req, "version", Version); Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "filter", Filter); Swagger.Servers.Get_Query_Parameter (Req, "_charset_", Charset); Impl.Post_Package_Update (Group_Name, Package_Name, Version, Path, Filter, Charset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Package_Update; package API_Post_Set_Password is new Swagger.Servers.Operation (Handler => Post_Set_Password, Method => Swagger.Servers.POST, URI => "/crx/explorer/ui/setpassword.jsp"); -- procedure Post_Set_Password (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Old : Swagger.UString; Plain : Swagger.UString; Verify : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "old", Old); Swagger.Servers.Get_Query_Parameter (Req, "plain", Plain); Swagger.Servers.Get_Query_Parameter (Req, "verify", Verify); Impl.Post_Set_Password (Old, Plain, Verify, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Set_Password; package API_Get_Aem_Health_Check is new Swagger.Servers.Operation (Handler => Get_Aem_Health_Check, Method => Swagger.Servers.GET, URI => "/system/health"); -- procedure Get_Aem_Health_Check (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Tags : Swagger.Nullable_UString; Combine_Tags_Or : Swagger.Nullable_Boolean; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "tags", Tags); Swagger.Servers.Get_Query_Parameter (Req, "combineTagsOr", Combine_Tags_Or); Impl.Get_Aem_Health_Check (Tags, Combine_Tags_Or, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Aem_Health_Check; package API_Post_Config_Aem_Health_Check_Servlet is new Swagger.Servers.Operation (Handler => Post_Config_Aem_Health_Check_Servlet, Method => Swagger.Servers.POST, URI => "/apps/system/config/com.shinesolutions.healthcheck.hc.impl.ActiveBundleHealthCheck"); -- procedure Post_Config_Aem_Health_Check_Servlet (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Bundles_Periodignored : Swagger.UString_Vectors.Vector; Bundles_Periodignored_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "bundles.ignored", Bundles_Periodignored); Swagger.Servers.Get_Query_Parameter (Req, "bundles.ignored@TypeHint", Bundles_Periodignored_At_Type_Hint); Impl.Post_Config_Aem_Health_Check_Servlet (Bundles_Periodignored, Bundles_Periodignored_At_Type_Hint, Context); end Post_Config_Aem_Health_Check_Servlet; package API_Post_Config_Aem_Password_Reset is new Swagger.Servers.Operation (Handler => Post_Config_Aem_Password_Reset, Method => Swagger.Servers.POST, URI => "/apps/system/config/com.shinesolutions.aem.passwordreset.Activator"); -- procedure Post_Config_Aem_Password_Reset (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Pwdreset_Periodauthorizables : Swagger.UString_Vectors.Vector; Pwdreset_Periodauthorizables_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "pwdreset.authorizables", Pwdreset_Periodauthorizables); Swagger.Servers.Get_Query_Parameter (Req, "pwdreset.authorizables@TypeHint", Pwdreset_Periodauthorizables_At_Type_Hint); Impl.Post_Config_Aem_Password_Reset (Pwdreset_Periodauthorizables, Pwdreset_Periodauthorizables_At_Type_Hint, Context); end Post_Config_Aem_Password_Reset; package API_Delete_Agent is new Swagger.Servers.Operation (Handler => Delete_Agent, Method => Swagger.Servers.DELETE, URI => "/etc/replication/agents.{runmode}/{name}"); -- procedure Delete_Agent (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Runmode : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Runmode); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Impl.Delete_Agent (Runmode, Name, Context); end Delete_Agent; package API_Delete_Node is new Swagger.Servers.Operation (Handler => Delete_Node, Method => Swagger.Servers.DELETE, URI => "/{path}/{name}"); -- procedure Delete_Node (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Path : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Impl.Delete_Node (Path, Name, Context); end Delete_Node; package API_Get_Agent is new Swagger.Servers.Operation (Handler => Get_Agent, Method => Swagger.Servers.GET, URI => "/etc/replication/agents.{runmode}/{name}"); -- procedure Get_Agent (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Runmode : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Runmode); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Impl.Get_Agent (Runmode, Name, Context); end Get_Agent; package API_Get_Agents is new Swagger.Servers.Operation (Handler => Get_Agents, Method => Swagger.Servers.GET, URI => "/etc/replication/agents.{runmode}.-1.json"); -- procedure Get_Agents (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Runmode : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 1, Runmode); Impl.Get_Agents (Runmode, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Agents; package API_Get_Authorizable_Keystore is new Swagger.Servers.Operation (Handler => Get_Authorizable_Keystore, Method => Swagger.Servers.GET, URI => "/{intermediatePath}/{authorizableId}.ks.json"); -- procedure Get_Authorizable_Keystore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Intermediate_Path : Swagger.UString; Authorizable_Id : Swagger.UString; Result : .Models.KeystoreInfo_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Intermediate_Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Authorizable_Id); Impl.Get_Authorizable_Keystore (Intermediate_Path, Authorizable_Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Authorizable_Keystore; package API_Get_Keystore is new Swagger.Servers.Operation (Handler => Get_Keystore, Method => Swagger.Servers.GET, URI => "/{intermediatePath}/{authorizableId}/keystore/store.p12"); -- procedure Get_Keystore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Intermediate_Path : Swagger.UString; Authorizable_Id : Swagger.UString; Result : Swagger.Http_Content_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Intermediate_Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Authorizable_Id); Impl.Get_Keystore (Intermediate_Path, Authorizable_Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Keystore; package API_Get_Node is new Swagger.Servers.Operation (Handler => Get_Node, Method => Swagger.Servers.GET, URI => "/{path}/{name}"); -- procedure Get_Node (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Path : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Impl.Get_Node (Path, Name, Context); end Get_Node; package API_Get_Package is new Swagger.Servers.Operation (Handler => Get_Package, Method => Swagger.Servers.GET, URI => "/etc/packages/{group}/{name}-{version}.zip"); -- procedure Get_Package (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Group : Swagger.UString; Name : Swagger.UString; Version : Swagger.UString; Result : Swagger.Http_Content_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 3, Group); Swagger.Servers.Get_Path_Parameter (Req, 3, Name); Swagger.Servers.Get_Path_Parameter (Req, 3, Version); Impl.Get_Package (Group, Name, Version, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Package; package API_Get_Package_Filter is new Swagger.Servers.Operation (Handler => Get_Package_Filter, Method => Swagger.Servers.GET, URI => "/etc/packages/{group}/{name}-{version}.zip/jcr:content/vlt:definition/filter.tidy.2.json"); -- procedure Get_Package_Filter (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Group : Swagger.UString; Name : Swagger.UString; Version : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 3, Group); Swagger.Servers.Get_Path_Parameter (Req, 3, Name); Swagger.Servers.Get_Path_Parameter (Req, 3, Version); Impl.Get_Package_Filter (Group, Name, Version, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Package_Filter; package API_Get_Query is new Swagger.Servers.Operation (Handler => Get_Query, Method => Swagger.Servers.GET, URI => "/bin/querybuilder.json"); -- procedure Get_Query (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Path : Swagger.UString; P_Periodlimit : Swagger.Number; 1_Property : Swagger.UString; 1_Property_Periodvalue : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "p.limit", P_Periodlimit); Swagger.Servers.Get_Query_Parameter (Req, "1_property", 1_Property); Swagger.Servers.Get_Query_Parameter (Req, "1_property.value", 1_Property_Periodvalue); Impl.Get_Query (Path, P_Periodlimit, 1_Property, 1_Property_Periodvalue, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Query; package API_Get_Truststore is new Swagger.Servers.Operation (Handler => Get_Truststore, Method => Swagger.Servers.GET, URI => "/etc/truststore/truststore.p12"); -- procedure Get_Truststore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Result : Swagger.Http_Content_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Impl.Get_Truststore (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Truststore; package API_Get_Truststore_Info is new Swagger.Servers.Operation (Handler => Get_Truststore_Info, Method => Swagger.Servers.GET, URI => "/libs/granite/security/truststore.json"); -- procedure Get_Truststore_Info (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Result : .Models.TruststoreInfo_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Impl.Get_Truststore_Info (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Truststore_Info; package API_Post_Agent is new Swagger.Servers.Operation (Handler => Post_Agent, Method => Swagger.Servers.POST, URI => "/etc/replication/agents.{runmode}/{name}"); -- procedure Post_Agent (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Runmode : Swagger.UString; Name : Swagger.UString; Jcr_Content_Slashcq_Distribute : Swagger.Nullable_Boolean; Jcr_Content_Slashcq_Distribute_At_Type_Hint : Swagger.Nullable_UString; Jcr_Content_Slashcq_Name : Swagger.Nullable_UString; Jcr_Content_Slashcq_Template : Swagger.Nullable_UString; Jcr_Content_Slashenabled : Swagger.Nullable_Boolean; Jcr_Content_Slashjcr_Description : Swagger.Nullable_UString; Jcr_Content_Slashjcr_Last_Modified : Swagger.Nullable_UString; Jcr_Content_Slashjcr_Last_Modified_By : Swagger.Nullable_UString; Jcr_Content_Slashjcr_Mixin_Types : Swagger.Nullable_UString; Jcr_Content_Slashjcr_Title : Swagger.Nullable_UString; Jcr_Content_Slashlog_Level : Swagger.Nullable_UString; Jcr_Content_Slashno_Status_Update : Swagger.Nullable_Boolean; Jcr_Content_Slashno_Versioning : Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_Connect_Timeout : Swagger.Number; Jcr_Content_Slashprotocol_H_T_T_P_Connection_Closed : Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_H_T_T_P_Expired : Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_Headers : Swagger.UString_Vectors.Vector; Jcr_Content_Slashprotocol_H_T_T_P_Headers_At_Type_Hint : Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_Method : Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_S_Relaxed : Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_Interface : Swagger.Nullable_UString; Jcr_Content_Slashprotocol_Socket_Timeout : Swagger.Number; Jcr_Content_Slashprotocol_Version : Swagger.Nullable_UString; Jcr_Content_Slashproxy_N_T_L_M_Domain : Swagger.Nullable_UString; Jcr_Content_Slashproxy_N_T_L_M_Host : Swagger.Nullable_UString; Jcr_Content_Slashproxy_Host : Swagger.Nullable_UString; Jcr_Content_Slashproxy_Password : Swagger.Nullable_UString; Jcr_Content_Slashproxy_Port : Swagger.Number; Jcr_Content_Slashproxy_User : Swagger.Nullable_UString; Jcr_Content_Slashqueue_Batch_Max_Size : Swagger.Number; Jcr_Content_Slashqueue_Batch_Mode : Swagger.Nullable_UString; Jcr_Content_Slashqueue_Batch_Wait_Time : Swagger.Number; Jcr_Content_Slashretry_Delay : Swagger.Nullable_UString; Jcr_Content_Slashreverse_Replication : Swagger.Nullable_Boolean; Jcr_Content_Slashserialization_Type : Swagger.Nullable_UString; Jcr_Content_Slashsling_Resource_Type : Swagger.Nullable_UString; Jcr_Content_Slashssl : Swagger.Nullable_UString; Jcr_Content_Slashtransport_N_T_L_M_Domain : Swagger.Nullable_UString; Jcr_Content_Slashtransport_N_T_L_M_Host : Swagger.Nullable_UString; Jcr_Content_Slashtransport_Password : Swagger.Nullable_UString; Jcr_Content_Slashtransport_Uri : Swagger.Nullable_UString; Jcr_Content_Slashtransport_User : Swagger.Nullable_UString; Jcr_Content_Slashtrigger_Distribute : Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Modified : Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_On_Off_Time : Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Receive : Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Specific : Swagger.Nullable_Boolean; Jcr_Content_Slashuser_Id : Swagger.Nullable_UString; Jcr_Primary_Type : Swagger.Nullable_UString; Operation : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/cq:distribute", Jcr_Content_Slashcq_Distribute); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/cq:distribute@TypeHint", Jcr_Content_Slashcq_Distribute_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/cq:name", Jcr_Content_Slashcq_Name); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/cq:template", Jcr_Content_Slashcq_Template); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/enabled", Jcr_Content_Slashenabled); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:description", Jcr_Content_Slashjcr_Description); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:lastModified", Jcr_Content_Slashjcr_Last_Modified); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:lastModifiedBy", Jcr_Content_Slashjcr_Last_Modified_By); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:mixinTypes", Jcr_Content_Slashjcr_Mixin_Types); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:title", Jcr_Content_Slashjcr_Title); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/logLevel", Jcr_Content_Slashlog_Level); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/noStatusUpdate", Jcr_Content_Slashno_Status_Update); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/noVersioning", Jcr_Content_Slashno_Versioning); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolConnectTimeout", Jcr_Content_Slashprotocol_Connect_Timeout); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPConnectionClosed", Jcr_Content_Slashprotocol_H_T_T_P_Connection_Closed); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPExpired", Jcr_Content_Slashprotocol_H_T_T_P_Expired); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPHeaders", Jcr_Content_Slashprotocol_H_T_T_P_Headers); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPHeaders@TypeHint", Jcr_Content_Slashprotocol_H_T_T_P_Headers_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPMethod", Jcr_Content_Slashprotocol_H_T_T_P_Method); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPSRelaxed", Jcr_Content_Slashprotocol_H_T_T_P_S_Relaxed); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolInterface", Jcr_Content_Slashprotocol_Interface); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolSocketTimeout", Jcr_Content_Slashprotocol_Socket_Timeout); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolVersion", Jcr_Content_Slashprotocol_Version); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyNTLMDomain", Jcr_Content_Slashproxy_N_T_L_M_Domain); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyNTLMHost", Jcr_Content_Slashproxy_N_T_L_M_Host); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyHost", Jcr_Content_Slashproxy_Host); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyPassword", Jcr_Content_Slashproxy_Password); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyPort", Jcr_Content_Slashproxy_Port); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyUser", Jcr_Content_Slashproxy_User); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/queueBatchMaxSize", Jcr_Content_Slashqueue_Batch_Max_Size); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/queueBatchMode", Jcr_Content_Slashqueue_Batch_Mode); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/queueBatchWaitTime", Jcr_Content_Slashqueue_Batch_Wait_Time); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/retryDelay", Jcr_Content_Slashretry_Delay); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/reverseReplication", Jcr_Content_Slashreverse_Replication); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/serializationType", Jcr_Content_Slashserialization_Type); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/sling:resourceType", Jcr_Content_Slashsling_Resource_Type); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/ssl", Jcr_Content_Slashssl); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportNTLMDomain", Jcr_Content_Slashtransport_N_T_L_M_Domain); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportNTLMHost", Jcr_Content_Slashtransport_N_T_L_M_Host); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportPassword", Jcr_Content_Slashtransport_Password); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportUri", Jcr_Content_Slashtransport_Uri); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportUser", Jcr_Content_Slashtransport_User); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerDistribute", Jcr_Content_Slashtrigger_Distribute); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerModified", Jcr_Content_Slashtrigger_Modified); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerOnOffTime", Jcr_Content_Slashtrigger_On_Off_Time); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerReceive", Jcr_Content_Slashtrigger_Receive); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerSpecific", Jcr_Content_Slashtrigger_Specific); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/userId", Jcr_Content_Slashuser_Id); Swagger.Servers.Get_Query_Parameter (Req, "jcr:primaryType", Jcr_Primary_Type); Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation); Swagger.Servers.Get_Path_Parameter (Req, 2, Runmode); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Impl.Post_Agent (Runmode, Name, Jcr_Content_Slashcq_Distribute, Jcr_Content_Slashcq_Distribute_At_Type_Hint, Jcr_Content_Slashcq_Name, Jcr_Content_Slashcq_Template, Jcr_Content_Slashenabled, Jcr_Content_Slashjcr_Description, Jcr_Content_Slashjcr_Last_Modified, Jcr_Content_Slashjcr_Last_Modified_By, Jcr_Content_Slashjcr_Mixin_Types, Jcr_Content_Slashjcr_Title, Jcr_Content_Slashlog_Level, Jcr_Content_Slashno_Status_Update, Jcr_Content_Slashno_Versioning, Jcr_Content_Slashprotocol_Connect_Timeout, Jcr_Content_Slashprotocol_H_T_T_P_Connection_Closed, Jcr_Content_Slashprotocol_H_T_T_P_Expired, Jcr_Content_Slashprotocol_H_T_T_P_Headers, Jcr_Content_Slashprotocol_H_T_T_P_Headers_At_Type_Hint, Jcr_Content_Slashprotocol_H_T_T_P_Method, Jcr_Content_Slashprotocol_H_T_T_P_S_Relaxed, Jcr_Content_Slashprotocol_Interface, Jcr_Content_Slashprotocol_Socket_Timeout, Jcr_Content_Slashprotocol_Version, Jcr_Content_Slashproxy_N_T_L_M_Domain, Jcr_Content_Slashproxy_N_T_L_M_Host, Jcr_Content_Slashproxy_Host, Jcr_Content_Slashproxy_Password, Jcr_Content_Slashproxy_Port, Jcr_Content_Slashproxy_User, Jcr_Content_Slashqueue_Batch_Max_Size, Jcr_Content_Slashqueue_Batch_Mode, Jcr_Content_Slashqueue_Batch_Wait_Time, Jcr_Content_Slashretry_Delay, Jcr_Content_Slashreverse_Replication, Jcr_Content_Slashserialization_Type, Jcr_Content_Slashsling_Resource_Type, Jcr_Content_Slashssl, Jcr_Content_Slashtransport_N_T_L_M_Domain, Jcr_Content_Slashtransport_N_T_L_M_Host, Jcr_Content_Slashtransport_Password, Jcr_Content_Slashtransport_Uri, Jcr_Content_Slashtransport_User, Jcr_Content_Slashtrigger_Distribute, Jcr_Content_Slashtrigger_Modified, Jcr_Content_Slashtrigger_On_Off_Time, Jcr_Content_Slashtrigger_Receive, Jcr_Content_Slashtrigger_Specific, Jcr_Content_Slashuser_Id, Jcr_Primary_Type, Operation, Context); end Post_Agent; package API_Post_Authorizable_Keystore is new Swagger.Servers.Operation (Handler => Post_Authorizable_Keystore, Method => Swagger.Servers.POST, URI => "/{intermediatePath}/{authorizableId}.ks.html"); -- procedure Post_Authorizable_Keystore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Intermediate_Path : Swagger.UString; Authorizable_Id : Swagger.UString; Operation : Swagger.Nullable_UString; Current_Password : Swagger.Nullable_UString; New_Password : Swagger.Nullable_UString; Re_Password : Swagger.Nullable_UString; Key_Password : Swagger.Nullable_UString; Key_Store_Pass : Swagger.Nullable_UString; Alias : Swagger.Nullable_UString; New_Alias : Swagger.Nullable_UString; Remove_Alias : Swagger.Nullable_UString; Cert_Chain : Swagger.File_Part_Type; Pk : Swagger.File_Part_Type; Key_Store : Swagger.File_Part_Type; Result : .Models.KeystoreInfo_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation); Swagger.Servers.Get_Query_Parameter (Req, "currentPassword", Current_Password); Swagger.Servers.Get_Query_Parameter (Req, "newPassword", New_Password); Swagger.Servers.Get_Query_Parameter (Req, "rePassword", Re_Password); Swagger.Servers.Get_Query_Parameter (Req, "keyPassword", Key_Password); Swagger.Servers.Get_Query_Parameter (Req, "keyStorePass", Key_Store_Pass); Swagger.Servers.Get_Query_Parameter (Req, "alias", Alias); Swagger.Servers.Get_Query_Parameter (Req, "newAlias", New_Alias); Swagger.Servers.Get_Query_Parameter (Req, "removeAlias", Remove_Alias); Swagger.Servers.Get_Path_Parameter (Req, 2, Intermediate_Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Authorizable_Id); Swagger.Servers.Get_Parameter (Context, "cert-chain", Cert_Chain); Swagger.Servers.Get_Parameter (Context, "pk", Pk); Swagger.Servers.Get_Parameter (Context, "keyStore", Key_Store); Impl.Post_Authorizable_Keystore (Intermediate_Path, Authorizable_Id, Operation, Current_Password, New_Password, Re_Password, Key_Password, Key_Store_Pass, Alias, New_Alias, Remove_Alias, Cert_Chain, Pk, Key_Store, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Authorizable_Keystore; package API_Post_Authorizables is new Swagger.Servers.Operation (Handler => Post_Authorizables, Method => Swagger.Servers.POST, URI => "/libs/granite/security/post/authorizables"); -- procedure Post_Authorizables (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Authorizable_Id : Swagger.UString; Intermediate_Path : Swagger.UString; Create_User : Swagger.Nullable_UString; Create_Group : Swagger.Nullable_UString; Rep_Password : Swagger.Nullable_UString; Profile_Slashgiven_Name : Swagger.Nullable_UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "authorizableId", Authorizable_Id); Swagger.Servers.Get_Query_Parameter (Req, "intermediatePath", Intermediate_Path); Swagger.Servers.Get_Query_Parameter (Req, "createUser", Create_User); Swagger.Servers.Get_Query_Parameter (Req, "createGroup", Create_Group); Swagger.Servers.Get_Query_Parameter (Req, "rep:password", Rep_Password); Swagger.Servers.Get_Query_Parameter (Req, "profile/givenName", Profile_Slashgiven_Name); Impl.Post_Authorizables (Authorizable_Id, Intermediate_Path, Create_User, Create_Group, Rep_Password, Profile_Slashgiven_Name, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Authorizables; package API_Post_Config_Adobe_Granite_Saml_Authentication_Handler is new Swagger.Servers.Operation (Handler => Post_Config_Adobe_Granite_Saml_Authentication_Handler, Method => Swagger.Servers.POST, URI => "/apps/system/config/com.adobe.granite.auth.saml.SamlAuthenticationHandler.config"); -- procedure Post_Config_Adobe_Granite_Saml_Authentication_Handler (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Key_Store_Password : Swagger.Nullable_UString; Key_Store_Password_At_Type_Hint : Swagger.Nullable_UString; Service_Periodranking : Swagger.Nullable_Integer; Service_Periodranking_At_Type_Hint : Swagger.Nullable_UString; Idp_Http_Redirect : Swagger.Nullable_Boolean; Idp_Http_Redirect_At_Type_Hint : Swagger.Nullable_UString; Create_User : Swagger.Nullable_Boolean; Create_User_At_Type_Hint : Swagger.Nullable_UString; Default_Redirect_Url : Swagger.Nullable_UString; Default_Redirect_Url_At_Type_Hint : Swagger.Nullable_UString; User_I_D_Attribute : Swagger.Nullable_UString; User_I_D_Attribute_At_Type_Hint : Swagger.Nullable_UString; Default_Groups : Swagger.UString_Vectors.Vector; Default_Groups_At_Type_Hint : Swagger.Nullable_UString; Idp_Cert_Alias : Swagger.Nullable_UString; Idp_Cert_Alias_At_Type_Hint : Swagger.Nullable_UString; Add_Group_Memberships : Swagger.Nullable_Boolean; Add_Group_Memberships_At_Type_Hint : Swagger.Nullable_UString; Path : Swagger.UString_Vectors.Vector; Path_At_Type_Hint : Swagger.Nullable_UString; Synchronize_Attributes : Swagger.UString_Vectors.Vector; Synchronize_Attributes_At_Type_Hint : Swagger.Nullable_UString; Clock_Tolerance : Swagger.Nullable_Integer; Clock_Tolerance_At_Type_Hint : Swagger.Nullable_UString; Group_Membership_Attribute : Swagger.Nullable_UString; Group_Membership_Attribute_At_Type_Hint : Swagger.Nullable_UString; Idp_Url : Swagger.Nullable_UString; Idp_Url_At_Type_Hint : Swagger.Nullable_UString; Logout_Url : Swagger.Nullable_UString; Logout_Url_At_Type_Hint : Swagger.Nullable_UString; Service_Provider_Entity_Id : Swagger.Nullable_UString; Service_Provider_Entity_Id_At_Type_Hint : Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L : Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L_At_Type_Hint : Swagger.Nullable_UString; Handle_Logout : Swagger.Nullable_Boolean; Handle_Logout_At_Type_Hint : Swagger.Nullable_UString; Sp_Private_Key_Alias : Swagger.Nullable_UString; Sp_Private_Key_Alias_At_Type_Hint : Swagger.Nullable_UString; Use_Encryption : Swagger.Nullable_Boolean; Use_Encryption_At_Type_Hint : Swagger.Nullable_UString; Name_Id_Format : Swagger.Nullable_UString; Name_Id_Format_At_Type_Hint : Swagger.Nullable_UString; Digest_Method : Swagger.Nullable_UString; Digest_Method_At_Type_Hint : Swagger.Nullable_UString; Signature_Method : Swagger.Nullable_UString; Signature_Method_At_Type_Hint : Swagger.Nullable_UString; User_Intermediate_Path : Swagger.Nullable_UString; User_Intermediate_Path_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "keyStorePassword", Key_Store_Password); Swagger.Servers.Get_Query_Parameter (Req, "keyStorePassword@TypeHint", Key_Store_Password_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "service.ranking", Service_Periodranking); Swagger.Servers.Get_Query_Parameter (Req, "service.ranking@TypeHint", Service_Periodranking_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "idpHttpRedirect", Idp_Http_Redirect); Swagger.Servers.Get_Query_Parameter (Req, "idpHttpRedirect@TypeHint", Idp_Http_Redirect_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "createUser", Create_User); Swagger.Servers.Get_Query_Parameter (Req, "createUser@TypeHint", Create_User_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "defaultRedirectUrl", Default_Redirect_Url); Swagger.Servers.Get_Query_Parameter (Req, "defaultRedirectUrl@TypeHint", Default_Redirect_Url_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "userIDAttribute", User_I_D_Attribute); Swagger.Servers.Get_Query_Parameter (Req, "userIDAttribute@TypeHint", User_I_D_Attribute_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "defaultGroups", Default_Groups); Swagger.Servers.Get_Query_Parameter (Req, "defaultGroups@TypeHint", Default_Groups_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "idpCertAlias", Idp_Cert_Alias); Swagger.Servers.Get_Query_Parameter (Req, "idpCertAlias@TypeHint", Idp_Cert_Alias_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "addGroupMemberships", Add_Group_Memberships); Swagger.Servers.Get_Query_Parameter (Req, "addGroupMemberships@TypeHint", Add_Group_Memberships_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "path@TypeHint", Path_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "synchronizeAttributes", Synchronize_Attributes); Swagger.Servers.Get_Query_Parameter (Req, "synchronizeAttributes@TypeHint", Synchronize_Attributes_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "clockTolerance", Clock_Tolerance); Swagger.Servers.Get_Query_Parameter (Req, "clockTolerance@TypeHint", Clock_Tolerance_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "groupMembershipAttribute", Group_Membership_Attribute); Swagger.Servers.Get_Query_Parameter (Req, "groupMembershipAttribute@TypeHint", Group_Membership_Attribute_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "idpUrl", Idp_Url); Swagger.Servers.Get_Query_Parameter (Req, "idpUrl@TypeHint", Idp_Url_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "logoutUrl", Logout_Url); Swagger.Servers.Get_Query_Parameter (Req, "logoutUrl@TypeHint", Logout_Url_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "serviceProviderEntityId", Service_Provider_Entity_Id); Swagger.Servers.Get_Query_Parameter (Req, "serviceProviderEntityId@TypeHint", Service_Provider_Entity_Id_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "assertionConsumerServiceURL", Assertion_Consumer_Service_U_R_L); Swagger.Servers.Get_Query_Parameter (Req, "assertionConsumerServiceURL@TypeHint", Assertion_Consumer_Service_U_R_L_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "handleLogout", Handle_Logout); Swagger.Servers.Get_Query_Parameter (Req, "handleLogout@TypeHint", Handle_Logout_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "spPrivateKeyAlias", Sp_Private_Key_Alias); Swagger.Servers.Get_Query_Parameter (Req, "spPrivateKeyAlias@TypeHint", Sp_Private_Key_Alias_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "useEncryption", Use_Encryption); Swagger.Servers.Get_Query_Parameter (Req, "useEncryption@TypeHint", Use_Encryption_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "nameIdFormat", Name_Id_Format); Swagger.Servers.Get_Query_Parameter (Req, "nameIdFormat@TypeHint", Name_Id_Format_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "digestMethod", Digest_Method); Swagger.Servers.Get_Query_Parameter (Req, "digestMethod@TypeHint", Digest_Method_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "signatureMethod", Signature_Method); Swagger.Servers.Get_Query_Parameter (Req, "signatureMethod@TypeHint", Signature_Method_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "userIntermediatePath", User_Intermediate_Path); Swagger.Servers.Get_Query_Parameter (Req, "userIntermediatePath@TypeHint", User_Intermediate_Path_At_Type_Hint); Impl.Post_Config_Adobe_Granite_Saml_Authentication_Handler (Key_Store_Password, Key_Store_Password_At_Type_Hint, Service_Periodranking, Service_Periodranking_At_Type_Hint, Idp_Http_Redirect, Idp_Http_Redirect_At_Type_Hint, Create_User, Create_User_At_Type_Hint, Default_Redirect_Url, Default_Redirect_Url_At_Type_Hint, User_I_D_Attribute, User_I_D_Attribute_At_Type_Hint, Default_Groups, Default_Groups_At_Type_Hint, Idp_Cert_Alias, Idp_Cert_Alias_At_Type_Hint, Add_Group_Memberships, Add_Group_Memberships_At_Type_Hint, Path, Path_At_Type_Hint, Synchronize_Attributes, Synchronize_Attributes_At_Type_Hint, Clock_Tolerance, Clock_Tolerance_At_Type_Hint, Group_Membership_Attribute, Group_Membership_Attribute_At_Type_Hint, Idp_Url, Idp_Url_At_Type_Hint, Logout_Url, Logout_Url_At_Type_Hint, Service_Provider_Entity_Id, Service_Provider_Entity_Id_At_Type_Hint, Assertion_Consumer_Service_U_R_L, Assertion_Consumer_Service_U_R_L_At_Type_Hint, Handle_Logout, Handle_Logout_At_Type_Hint, Sp_Private_Key_Alias, Sp_Private_Key_Alias_At_Type_Hint, Use_Encryption, Use_Encryption_At_Type_Hint, Name_Id_Format, Name_Id_Format_At_Type_Hint, Digest_Method, Digest_Method_At_Type_Hint, Signature_Method, Signature_Method_At_Type_Hint, User_Intermediate_Path, User_Intermediate_Path_At_Type_Hint, Context); end Post_Config_Adobe_Granite_Saml_Authentication_Handler; package API_Post_Config_Apache_Felix_Jetty_Based_Http_Service is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Felix_Jetty_Based_Http_Service, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.felix.http"); -- procedure Post_Config_Apache_Felix_Jetty_Based_Http_Service (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Org_Periodapache_Periodfelix_Periodhttps_Periodnio : Swagger.Nullable_Boolean; Org_Periodapache_Periodfelix_Periodhttps_Periodnio_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodenable : Swagger.Nullable_Boolean; Org_Periodapache_Periodfelix_Periodhttps_Periodenable_At_Type_Hint : Swagger.Nullable_UString; Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure : Swagger.Nullable_UString; Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.nio", Org_Periodapache_Periodfelix_Periodhttps_Periodnio); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.nio@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodnio_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.password", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.password@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.key", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.key@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.key.password", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.key.password@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.truststore", Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.truststore@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.truststore.password", Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.truststore.password@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.clientcertificate", Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.clientcertificate@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.enable", Org_Periodapache_Periodfelix_Periodhttps_Periodenable); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.enable@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodenable_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.osgi.service.http.port.secure", Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure); Swagger.Servers.Get_Query_Parameter (Req, "org.osgi.service.http.port.secure@TypeHint", Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure_At_Type_Hint); Impl.Post_Config_Apache_Felix_Jetty_Based_Http_Service (Org_Periodapache_Periodfelix_Periodhttps_Periodnio, Org_Periodapache_Periodfelix_Periodhttps_Periodnio_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate, Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodenable, Org_Periodapache_Periodfelix_Periodhttps_Periodenable_At_Type_Hint, Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure, Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure_At_Type_Hint, Context); end Post_Config_Apache_Felix_Jetty_Based_Http_Service; package API_Post_Config_Apache_Http_Components_Proxy_Configuration is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Http_Components_Proxy_Configuration, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.http.proxyconfigurator.config"); -- procedure Post_Config_Apache_Http_Components_Proxy_Configuration (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Proxy_Periodhost : Swagger.Nullable_UString; Proxy_Periodhost_At_Type_Hint : Swagger.Nullable_UString; Proxy_Periodport : Swagger.Nullable_Integer; Proxy_Periodport_At_Type_Hint : Swagger.Nullable_UString; Proxy_Periodexceptions : Swagger.UString_Vectors.Vector; Proxy_Periodexceptions_At_Type_Hint : Swagger.Nullable_UString; Proxy_Periodenabled : Swagger.Nullable_Boolean; Proxy_Periodenabled_At_Type_Hint : Swagger.Nullable_UString; Proxy_Perioduser : Swagger.Nullable_UString; Proxy_Perioduser_At_Type_Hint : Swagger.Nullable_UString; Proxy_Periodpassword : Swagger.Nullable_UString; Proxy_Periodpassword_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "proxy.host", Proxy_Periodhost); Swagger.Servers.Get_Query_Parameter (Req, "proxy.host@TypeHint", Proxy_Periodhost_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.port", Proxy_Periodport); Swagger.Servers.Get_Query_Parameter (Req, "proxy.port@TypeHint", Proxy_Periodport_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.exceptions", Proxy_Periodexceptions); Swagger.Servers.Get_Query_Parameter (Req, "proxy.exceptions@TypeHint", Proxy_Periodexceptions_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.enabled", Proxy_Periodenabled); Swagger.Servers.Get_Query_Parameter (Req, "proxy.enabled@TypeHint", Proxy_Periodenabled_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.user", Proxy_Perioduser); Swagger.Servers.Get_Query_Parameter (Req, "proxy.user@TypeHint", Proxy_Perioduser_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.password", Proxy_Periodpassword); Swagger.Servers.Get_Query_Parameter (Req, "proxy.password@TypeHint", Proxy_Periodpassword_At_Type_Hint); Impl.Post_Config_Apache_Http_Components_Proxy_Configuration (Proxy_Periodhost, Proxy_Periodhost_At_Type_Hint, Proxy_Periodport, Proxy_Periodport_At_Type_Hint, Proxy_Periodexceptions, Proxy_Periodexceptions_At_Type_Hint, Proxy_Periodenabled, Proxy_Periodenabled_At_Type_Hint, Proxy_Perioduser, Proxy_Perioduser_At_Type_Hint, Proxy_Periodpassword, Proxy_Periodpassword_At_Type_Hint, Context); end Post_Config_Apache_Http_Components_Proxy_Configuration; package API_Post_Config_Apache_Sling_Dav_Ex_Servlet is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Sling_Dav_Ex_Servlet, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet"); -- procedure Post_Config_Apache_Sling_Dav_Ex_Servlet (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Alias : Swagger.Nullable_UString; Alias_At_Type_Hint : Swagger.Nullable_UString; Dav_Periodcreate_Absolute_Uri : Swagger.Nullable_Boolean; Dav_Periodcreate_Absolute_Uri_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "alias", Alias); Swagger.Servers.Get_Query_Parameter (Req, "alias@TypeHint", Alias_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "dav.create-absolute-uri", Dav_Periodcreate_Absolute_Uri); Swagger.Servers.Get_Query_Parameter (Req, "dav.create-absolute-uri@TypeHint", Dav_Periodcreate_Absolute_Uri_At_Type_Hint); Impl.Post_Config_Apache_Sling_Dav_Ex_Servlet (Alias, Alias_At_Type_Hint, Dav_Periodcreate_Absolute_Uri, Dav_Periodcreate_Absolute_Uri_At_Type_Hint, Context); end Post_Config_Apache_Sling_Dav_Ex_Servlet; package API_Post_Config_Apache_Sling_Get_Servlet is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Sling_Get_Servlet, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.sling.servlets.get.DefaultGetServlet"); -- procedure Post_Config_Apache_Sling_Get_Servlet (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Json_Periodmaximumresults : Swagger.Nullable_UString; Json_Periodmaximumresults_At_Type_Hint : Swagger.Nullable_UString; Enable_Periodhtml : Swagger.Nullable_Boolean; Enable_Periodhtml_At_Type_Hint : Swagger.Nullable_UString; Enable_Periodtxt : Swagger.Nullable_Boolean; Enable_Periodtxt_At_Type_Hint : Swagger.Nullable_UString; Enable_Periodxml : Swagger.Nullable_Boolean; Enable_Periodxml_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "json.maximumresults", Json_Periodmaximumresults); Swagger.Servers.Get_Query_Parameter (Req, "json.maximumresults@TypeHint", Json_Periodmaximumresults_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "enable.html", Enable_Periodhtml); Swagger.Servers.Get_Query_Parameter (Req, "enable.html@TypeHint", Enable_Periodhtml_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "enable.txt", Enable_Periodtxt); Swagger.Servers.Get_Query_Parameter (Req, "enable.txt@TypeHint", Enable_Periodtxt_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "enable.xml", Enable_Periodxml); Swagger.Servers.Get_Query_Parameter (Req, "enable.xml@TypeHint", Enable_Periodxml_At_Type_Hint); Impl.Post_Config_Apache_Sling_Get_Servlet (Json_Periodmaximumresults, Json_Periodmaximumresults_At_Type_Hint, Enable_Periodhtml, Enable_Periodhtml_At_Type_Hint, Enable_Periodtxt, Enable_Periodtxt_At_Type_Hint, Enable_Periodxml, Enable_Periodxml_At_Type_Hint, Context); end Post_Config_Apache_Sling_Get_Servlet; package API_Post_Config_Apache_Sling_Referrer_Filter is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Sling_Referrer_Filter, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.sling.security.impl.ReferrerFilter"); -- procedure Post_Config_Apache_Sling_Referrer_Filter (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Allow_Periodempty : Swagger.Nullable_Boolean; Allow_Periodempty_At_Type_Hint : Swagger.Nullable_UString; Allow_Periodhosts : Swagger.Nullable_UString; Allow_Periodhosts_At_Type_Hint : Swagger.Nullable_UString; Allow_Periodhosts_Periodregexp : Swagger.Nullable_UString; Allow_Periodhosts_Periodregexp_At_Type_Hint : Swagger.Nullable_UString; Filter_Periodmethods : Swagger.Nullable_UString; Filter_Periodmethods_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "allow.empty", Allow_Periodempty); Swagger.Servers.Get_Query_Parameter (Req, "allow.empty@TypeHint", Allow_Periodempty_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "allow.hosts", Allow_Periodhosts); Swagger.Servers.Get_Query_Parameter (Req, "allow.hosts@TypeHint", Allow_Periodhosts_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "allow.hosts.regexp", Allow_Periodhosts_Periodregexp); Swagger.Servers.Get_Query_Parameter (Req, "allow.hosts.regexp@TypeHint", Allow_Periodhosts_Periodregexp_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "filter.methods", Filter_Periodmethods); Swagger.Servers.Get_Query_Parameter (Req, "filter.methods@TypeHint", Filter_Periodmethods_At_Type_Hint); Impl.Post_Config_Apache_Sling_Referrer_Filter (Allow_Periodempty, Allow_Periodempty_At_Type_Hint, Allow_Periodhosts, Allow_Periodhosts_At_Type_Hint, Allow_Periodhosts_Periodregexp, Allow_Periodhosts_Periodregexp_At_Type_Hint, Filter_Periodmethods, Filter_Periodmethods_At_Type_Hint, Context); end Post_Config_Apache_Sling_Referrer_Filter; package API_Post_Node is new Swagger.Servers.Operation (Handler => Post_Node, Method => Swagger.Servers.POST, URI => "/{path}/{name}"); -- procedure Post_Node (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Path : Swagger.UString; Name : Swagger.UString; Operation : Swagger.Nullable_UString; Delete_Authorizable : Swagger.Nullable_UString; File : Swagger.File_Part_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation); Swagger.Servers.Get_Query_Parameter (Req, "deleteAuthorizable", Delete_Authorizable); Swagger.Servers.Get_Path_Parameter (Req, 2, Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Swagger.Servers.Get_Parameter (Context, "file", File); Impl.Post_Node (Path, Name, Operation, Delete_Authorizable, File, Context); end Post_Node; package API_Post_Node_Rw is new Swagger.Servers.Operation (Handler => Post_Node_Rw, Method => Swagger.Servers.POST, URI => "/{path}/{name}.rw.html"); -- procedure Post_Node_Rw (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Path : Swagger.UString; Name : Swagger.UString; Add_Members : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "addMembers", Add_Members); Swagger.Servers.Get_Path_Parameter (Req, 2, Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Impl.Post_Node_Rw (Path, Name, Add_Members, Context); end Post_Node_Rw; package API_Post_Path is new Swagger.Servers.Operation (Handler => Post_Path, Method => Swagger.Servers.POST, URI => "/{path}/"); -- procedure Post_Path (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Path : Swagger.UString; Jcr_Primary_Type : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "jcr:primaryType", Jcr_Primary_Type); Swagger.Servers.Get_Query_Parameter (Req, ":name", Name); Swagger.Servers.Get_Path_Parameter (Req, 1, Path); Impl.Post_Path (Path, Jcr_Primary_Type, Name, Context); end Post_Path; package API_Post_Query is new Swagger.Servers.Operation (Handler => Post_Query, Method => Swagger.Servers.POST, URI => "/bin/querybuilder.json"); -- procedure Post_Query (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Path : Swagger.UString; P_Periodlimit : Swagger.Number; 1_Property : Swagger.UString; 1_Property_Periodvalue : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "p.limit", P_Periodlimit); Swagger.Servers.Get_Query_Parameter (Req, "1_property", 1_Property); Swagger.Servers.Get_Query_Parameter (Req, "1_property.value", 1_Property_Periodvalue); Impl.Post_Query (Path, P_Periodlimit, 1_Property, 1_Property_Periodvalue, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Query; package API_Post_Tree_Activation is new Swagger.Servers.Operation (Handler => Post_Tree_Activation, Method => Swagger.Servers.POST, URI => "/etc/replication/treeactivation.html"); -- procedure Post_Tree_Activation (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Ignoredeactivated : Boolean; Onlymodified : Boolean; Path : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "ignoredeactivated", Ignoredeactivated); Swagger.Servers.Get_Query_Parameter (Req, "onlymodified", Onlymodified); Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Impl.Post_Tree_Activation (Ignoredeactivated, Onlymodified, Path, Context); end Post_Tree_Activation; package API_Post_Truststore is new Swagger.Servers.Operation (Handler => Post_Truststore, Method => Swagger.Servers.POST, URI => "/libs/granite/security/post/truststore"); -- procedure Post_Truststore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Operation : Swagger.Nullable_UString; New_Password : Swagger.Nullable_UString; Re_Password : Swagger.Nullable_UString; Key_Store_Type : Swagger.Nullable_UString; Remove_Alias : Swagger.Nullable_UString; Certificate : Swagger.File_Part_Type; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation); Swagger.Servers.Get_Query_Parameter (Req, "newPassword", New_Password); Swagger.Servers.Get_Query_Parameter (Req, "rePassword", Re_Password); Swagger.Servers.Get_Query_Parameter (Req, "keyStoreType", Key_Store_Type); Swagger.Servers.Get_Query_Parameter (Req, "removeAlias", Remove_Alias); Swagger.Servers.Get_Parameter (Context, "certificate", Certificate); Impl.Post_Truststore (Operation, New_Password, Re_Password, Key_Store_Type, Remove_Alias, Certificate, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Truststore; package API_Post_Truststore_P_K_C_S12 is new Swagger.Servers.Operation (Handler => Post_Truststore_P_K_C_S12, Method => Swagger.Servers.POST, URI => "/etc/truststore"); -- procedure Post_Truststore_P_K_C_S12 (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Truststore_Periodp12 : Swagger.File_Part_Type; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Parameter (Context, "truststore.p12", Truststore_Periodp12); Impl.Post_Truststore_P_K_C_S12 (Truststore_Periodp12, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Truststore_P_K_C_S12; procedure Register (Server : in out Swagger.Servers.Application_Type'Class) is begin Swagger.Servers.Register (Server, API_Get_Aem_Product_Info.Definition); Swagger.Servers.Register (Server, API_Get_Config_Mgr.Definition); Swagger.Servers.Register (Server, API_Post_Bundle.Definition); Swagger.Servers.Register (Server, API_Post_Jmx_Repository.Definition); Swagger.Servers.Register (Server, API_Post_Saml_Configuration.Definition); Swagger.Servers.Register (Server, API_Get_Login_Page.Definition); Swagger.Servers.Register (Server, API_Post_Cq_Actions.Definition); Swagger.Servers.Register (Server, API_Get_Crxde_Status.Definition); Swagger.Servers.Register (Server, API_Get_Install_Status.Definition); Swagger.Servers.Register (Server, API_Get_Package_Manager_Servlet.Definition); Swagger.Servers.Register (Server, API_Post_Package_Service.Definition); Swagger.Servers.Register (Server, API_Post_Package_Service_Json.Definition); Swagger.Servers.Register (Server, API_Post_Package_Update.Definition); Swagger.Servers.Register (Server, API_Post_Set_Password.Definition); Swagger.Servers.Register (Server, API_Get_Aem_Health_Check.Definition); Swagger.Servers.Register (Server, API_Post_Config_Aem_Health_Check_Servlet.Definition); Swagger.Servers.Register (Server, API_Post_Config_Aem_Password_Reset.Definition); Swagger.Servers.Register (Server, API_Delete_Agent.Definition); Swagger.Servers.Register (Server, API_Delete_Node.Definition); Swagger.Servers.Register (Server, API_Get_Agent.Definition); Swagger.Servers.Register (Server, API_Get_Agents.Definition); Swagger.Servers.Register (Server, API_Get_Authorizable_Keystore.Definition); Swagger.Servers.Register (Server, API_Get_Keystore.Definition); Swagger.Servers.Register (Server, API_Get_Node.Definition); Swagger.Servers.Register (Server, API_Get_Package.Definition); Swagger.Servers.Register (Server, API_Get_Package_Filter.Definition); Swagger.Servers.Register (Server, API_Get_Query.Definition); Swagger.Servers.Register (Server, API_Get_Truststore.Definition); Swagger.Servers.Register (Server, API_Get_Truststore_Info.Definition); Swagger.Servers.Register (Server, API_Post_Agent.Definition); Swagger.Servers.Register (Server, API_Post_Authorizable_Keystore.Definition); Swagger.Servers.Register (Server, API_Post_Authorizables.Definition); Swagger.Servers.Register (Server, API_Post_Config_Adobe_Granite_Saml_Authentication_Handler.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Felix_Jetty_Based_Http_Service.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Http_Components_Proxy_Configuration.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Sling_Dav_Ex_Servlet.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Sling_Get_Servlet.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Sling_Referrer_Filter.Definition); Swagger.Servers.Register (Server, API_Post_Node.Definition); Swagger.Servers.Register (Server, API_Post_Node_Rw.Definition); Swagger.Servers.Register (Server, API_Post_Path.Definition); Swagger.Servers.Register (Server, API_Post_Query.Definition); Swagger.Servers.Register (Server, API_Post_Tree_Activation.Definition); Swagger.Servers.Register (Server, API_Post_Truststore.Definition); Swagger.Servers.Register (Server, API_Post_Truststore_P_K_C_S12.Definition); end Register; end Skeleton; package body Shared_Instance is -- procedure Get_Aem_Product_Info (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Result : Swagger.UString_Vectors.Vector; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Server.Get_Aem_Product_Info (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Aem_Product_Info; package API_Get_Aem_Product_Info is new Swagger.Servers.Operation (Handler => Get_Aem_Product_Info, Method => Swagger.Servers.GET, URI => "/system/console/status-productinfo.json"); -- procedure Get_Config_Mgr (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Server.Get_Config_Mgr (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Config_Mgr; package API_Get_Config_Mgr is new Swagger.Servers.Operation (Handler => Get_Config_Mgr, Method => Swagger.Servers.GET, URI => "/system/console/configMgr"); -- procedure Post_Bundle (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Name : Swagger.UString; Action : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "action", Action); Swagger.Servers.Get_Path_Parameter (Req, 1, Name); Server.Post_Bundle (Name, Action, Context); end Post_Bundle; package API_Post_Bundle is new Swagger.Servers.Operation (Handler => Post_Bundle, Method => Swagger.Servers.POST, URI => "/system/console/bundles/{name}"); -- procedure Post_Jmx_Repository (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Action : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 1, Action); Server.Post_Jmx_Repository (Action, Context); end Post_Jmx_Repository; package API_Post_Jmx_Repository is new Swagger.Servers.Operation (Handler => Post_Jmx_Repository, Method => Swagger.Servers.POST, URI => "/system/console/jmx/com.adobe.granite:type=Repository/op/{action}"); -- procedure Post_Saml_Configuration (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Post : Swagger.Nullable_Boolean; Apply : Swagger.Nullable_Boolean; Delete : Swagger.Nullable_Boolean; Action : Swagger.Nullable_UString; Dollarlocation : Swagger.Nullable_UString; Path : Swagger.UString_Vectors.Vector; Service_Periodranking : Swagger.Nullable_Integer; Idp_Url : Swagger.Nullable_UString; Idp_Cert_Alias : Swagger.Nullable_UString; Idp_Http_Redirect : Swagger.Nullable_Boolean; Service_Provider_Entity_Id : Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L : Swagger.Nullable_UString; Sp_Private_Key_Alias : Swagger.Nullable_UString; Key_Store_Password : Swagger.Nullable_UString; Default_Redirect_Url : Swagger.Nullable_UString; User_I_D_Attribute : Swagger.Nullable_UString; Use_Encryption : Swagger.Nullable_Boolean; Create_User : Swagger.Nullable_Boolean; Add_Group_Memberships : Swagger.Nullable_Boolean; Group_Membership_Attribute : Swagger.Nullable_UString; Default_Groups : Swagger.UString_Vectors.Vector; Name_Id_Format : Swagger.Nullable_UString; Synchronize_Attributes : Swagger.UString_Vectors.Vector; Handle_Logout : Swagger.Nullable_Boolean; Logout_Url : Swagger.Nullable_UString; Clock_Tolerance : Swagger.Nullable_Integer; Digest_Method : Swagger.Nullable_UString; Signature_Method : Swagger.Nullable_UString; User_Intermediate_Path : Swagger.Nullable_UString; Propertylist : Swagger.UString_Vectors.Vector; Result : .Models.SamlConfigurationInfo_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "post", Post); Swagger.Servers.Get_Query_Parameter (Req, "apply", Apply); Swagger.Servers.Get_Query_Parameter (Req, "delete", Delete); Swagger.Servers.Get_Query_Parameter (Req, "action", Action); Swagger.Servers.Get_Query_Parameter (Req, "$location", Dollarlocation); Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "service.ranking", Service_Periodranking); Swagger.Servers.Get_Query_Parameter (Req, "idpUrl", Idp_Url); Swagger.Servers.Get_Query_Parameter (Req, "idpCertAlias", Idp_Cert_Alias); Swagger.Servers.Get_Query_Parameter (Req, "idpHttpRedirect", Idp_Http_Redirect); Swagger.Servers.Get_Query_Parameter (Req, "serviceProviderEntityId", Service_Provider_Entity_Id); Swagger.Servers.Get_Query_Parameter (Req, "assertionConsumerServiceURL", Assertion_Consumer_Service_U_R_L); Swagger.Servers.Get_Query_Parameter (Req, "spPrivateKeyAlias", Sp_Private_Key_Alias); Swagger.Servers.Get_Query_Parameter (Req, "keyStorePassword", Key_Store_Password); Swagger.Servers.Get_Query_Parameter (Req, "defaultRedirectUrl", Default_Redirect_Url); Swagger.Servers.Get_Query_Parameter (Req, "userIDAttribute", User_I_D_Attribute); Swagger.Servers.Get_Query_Parameter (Req, "useEncryption", Use_Encryption); Swagger.Servers.Get_Query_Parameter (Req, "createUser", Create_User); Swagger.Servers.Get_Query_Parameter (Req, "addGroupMemberships", Add_Group_Memberships); Swagger.Servers.Get_Query_Parameter (Req, "groupMembershipAttribute", Group_Membership_Attribute); Swagger.Servers.Get_Query_Parameter (Req, "defaultGroups", Default_Groups); Swagger.Servers.Get_Query_Parameter (Req, "nameIdFormat", Name_Id_Format); Swagger.Servers.Get_Query_Parameter (Req, "synchronizeAttributes", Synchronize_Attributes); Swagger.Servers.Get_Query_Parameter (Req, "handleLogout", Handle_Logout); Swagger.Servers.Get_Query_Parameter (Req, "logoutUrl", Logout_Url); Swagger.Servers.Get_Query_Parameter (Req, "clockTolerance", Clock_Tolerance); Swagger.Servers.Get_Query_Parameter (Req, "digestMethod", Digest_Method); Swagger.Servers.Get_Query_Parameter (Req, "signatureMethod", Signature_Method); Swagger.Servers.Get_Query_Parameter (Req, "userIntermediatePath", User_Intermediate_Path); Swagger.Servers.Get_Query_Parameter (Req, "propertylist", Propertylist); Server.Post_Saml_Configuration (Post, Apply, Delete, Action, Dollarlocation, Path, Service_Periodranking, Idp_Url, Idp_Cert_Alias, Idp_Http_Redirect, Service_Provider_Entity_Id, Assertion_Consumer_Service_U_R_L, Sp_Private_Key_Alias, Key_Store_Password, Default_Redirect_Url, User_I_D_Attribute, Use_Encryption, Create_User, Add_Group_Memberships, Group_Membership_Attribute, Default_Groups, Name_Id_Format, Synchronize_Attributes, Handle_Logout, Logout_Url, Clock_Tolerance, Digest_Method, Signature_Method, User_Intermediate_Path, Propertylist, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Saml_Configuration; package API_Post_Saml_Configuration is new Swagger.Servers.Operation (Handler => Post_Saml_Configuration, Method => Swagger.Servers.POST, URI => "/system/console/configMgr/com.adobe.granite.auth.saml.SamlAuthenticationHandler"); -- procedure Get_Login_Page (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Result : Swagger.UString; begin Server.Get_Login_Page (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Login_Page; package API_Get_Login_Page is new Swagger.Servers.Operation (Handler => Get_Login_Page, Method => Swagger.Servers.GET, URI => "/libs/granite/core/content/login.html"); -- procedure Post_Cq_Actions (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Authorizable_Id : Swagger.UString; Changelog : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "authorizableId", Authorizable_Id); Swagger.Servers.Get_Query_Parameter (Req, "changelog", Changelog); Server.Post_Cq_Actions (Authorizable_Id, Changelog, Context); end Post_Cq_Actions; package API_Post_Cq_Actions is new Swagger.Servers.Operation (Handler => Post_Cq_Actions, Method => Swagger.Servers.POST, URI => "/.cqactions.html"); -- procedure Get_Crxde_Status (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Server.Get_Crxde_Status (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Crxde_Status; package API_Get_Crxde_Status is new Swagger.Servers.Operation (Handler => Get_Crxde_Status, Method => Swagger.Servers.GET, URI => "/crx/server/crx.default/jcr:root/.1.json"); -- procedure Get_Install_Status (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Result : .Models.InstallStatus_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Server.Get_Install_Status (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Install_Status; package API_Get_Install_Status is new Swagger.Servers.Operation (Handler => Get_Install_Status, Method => Swagger.Servers.GET, URI => "/crx/packmgr/installstatus.jsp"); -- procedure Get_Package_Manager_Servlet (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Server.Get_Package_Manager_Servlet (Context); end Get_Package_Manager_Servlet; package API_Get_Package_Manager_Servlet is new Swagger.Servers.Operation (Handler => Get_Package_Manager_Servlet, Method => Swagger.Servers.GET, URI => "/crx/packmgr/service/script.html"); -- procedure Post_Package_Service (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Cmd : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "cmd", Cmd); Server.Post_Package_Service (Cmd, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Package_Service; package API_Post_Package_Service is new Swagger.Servers.Operation (Handler => Post_Package_Service, Method => Swagger.Servers.POST, URI => "/crx/packmgr/service.jsp"); -- procedure Post_Package_Service_Json (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Path : Swagger.UString; Cmd : Swagger.UString; Group_Name : Swagger.Nullable_UString; Package_Name : Swagger.Nullable_UString; Package_Version : Swagger.Nullable_UString; Charset : Swagger.Nullable_UString; Force : Swagger.Nullable_Boolean; Recursive : Swagger.Nullable_Boolean; P_Package : Swagger.File_Part_Type; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "cmd", Cmd); Swagger.Servers.Get_Query_Parameter (Req, "groupName", Group_Name); Swagger.Servers.Get_Query_Parameter (Req, "packageName", Package_Name); Swagger.Servers.Get_Query_Parameter (Req, "packageVersion", Package_Version); Swagger.Servers.Get_Query_Parameter (Req, "_charset_", Charset); Swagger.Servers.Get_Query_Parameter (Req, "force", Force); Swagger.Servers.Get_Query_Parameter (Req, "recursive", Recursive); Swagger.Servers.Get_Path_Parameter (Req, 1, Path); Swagger.Servers.Get_Parameter (Context, "package", P_Package); Server.Post_Package_Service_Json (Path, Cmd, Group_Name, Package_Name, Package_Version, Charset, Force, Recursive, P_Package, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Package_Service_Json; package API_Post_Package_Service_Json is new Swagger.Servers.Operation (Handler => Post_Package_Service_Json, Method => Swagger.Servers.POST, URI => "/crx/packmgr/service/.json/{path}"); -- procedure Post_Package_Update (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Group_Name : Swagger.UString; Package_Name : Swagger.UString; Version : Swagger.UString; Path : Swagger.UString; Filter : Swagger.Nullable_UString; Charset : Swagger.Nullable_UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "groupName", Group_Name); Swagger.Servers.Get_Query_Parameter (Req, "packageName", Package_Name); Swagger.Servers.Get_Query_Parameter (Req, "version", Version); Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "filter", Filter); Swagger.Servers.Get_Query_Parameter (Req, "_charset_", Charset); Server.Post_Package_Update (Group_Name, Package_Name, Version, Path, Filter, Charset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Package_Update; package API_Post_Package_Update is new Swagger.Servers.Operation (Handler => Post_Package_Update, Method => Swagger.Servers.POST, URI => "/crx/packmgr/update.jsp"); -- procedure Post_Set_Password (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Old : Swagger.UString; Plain : Swagger.UString; Verify : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "old", Old); Swagger.Servers.Get_Query_Parameter (Req, "plain", Plain); Swagger.Servers.Get_Query_Parameter (Req, "verify", Verify); Server.Post_Set_Password (Old, Plain, Verify, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Set_Password; package API_Post_Set_Password is new Swagger.Servers.Operation (Handler => Post_Set_Password, Method => Swagger.Servers.POST, URI => "/crx/explorer/ui/setpassword.jsp"); -- procedure Get_Aem_Health_Check (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Tags : Swagger.Nullable_UString; Combine_Tags_Or : Swagger.Nullable_Boolean; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "tags", Tags); Swagger.Servers.Get_Query_Parameter (Req, "combineTagsOr", Combine_Tags_Or); Server.Get_Aem_Health_Check (Tags, Combine_Tags_Or, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Aem_Health_Check; package API_Get_Aem_Health_Check is new Swagger.Servers.Operation (Handler => Get_Aem_Health_Check, Method => Swagger.Servers.GET, URI => "/system/health"); -- procedure Post_Config_Aem_Health_Check_Servlet (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Bundles_Periodignored : Swagger.UString_Vectors.Vector; Bundles_Periodignored_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "bundles.ignored", Bundles_Periodignored); Swagger.Servers.Get_Query_Parameter (Req, "bundles.ignored@TypeHint", Bundles_Periodignored_At_Type_Hint); Server.Post_Config_Aem_Health_Check_Servlet (Bundles_Periodignored, Bundles_Periodignored_At_Type_Hint, Context); end Post_Config_Aem_Health_Check_Servlet; package API_Post_Config_Aem_Health_Check_Servlet is new Swagger.Servers.Operation (Handler => Post_Config_Aem_Health_Check_Servlet, Method => Swagger.Servers.POST, URI => "/apps/system/config/com.shinesolutions.healthcheck.hc.impl.ActiveBundleHealthCheck"); -- procedure Post_Config_Aem_Password_Reset (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Pwdreset_Periodauthorizables : Swagger.UString_Vectors.Vector; Pwdreset_Periodauthorizables_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "pwdreset.authorizables", Pwdreset_Periodauthorizables); Swagger.Servers.Get_Query_Parameter (Req, "pwdreset.authorizables@TypeHint", Pwdreset_Periodauthorizables_At_Type_Hint); Server.Post_Config_Aem_Password_Reset (Pwdreset_Periodauthorizables, Pwdreset_Periodauthorizables_At_Type_Hint, Context); end Post_Config_Aem_Password_Reset; package API_Post_Config_Aem_Password_Reset is new Swagger.Servers.Operation (Handler => Post_Config_Aem_Password_Reset, Method => Swagger.Servers.POST, URI => "/apps/system/config/com.shinesolutions.aem.passwordreset.Activator"); -- procedure Delete_Agent (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Runmode : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Runmode); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Server.Delete_Agent (Runmode, Name, Context); end Delete_Agent; package API_Delete_Agent is new Swagger.Servers.Operation (Handler => Delete_Agent, Method => Swagger.Servers.DELETE, URI => "/etc/replication/agents.{runmode}/{name}"); -- procedure Delete_Node (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Path : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Server.Delete_Node (Path, Name, Context); end Delete_Node; package API_Delete_Node is new Swagger.Servers.Operation (Handler => Delete_Node, Method => Swagger.Servers.DELETE, URI => "/{path}/{name}"); -- procedure Get_Agent (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Runmode : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Runmode); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Server.Get_Agent (Runmode, Name, Context); end Get_Agent; package API_Get_Agent is new Swagger.Servers.Operation (Handler => Get_Agent, Method => Swagger.Servers.GET, URI => "/etc/replication/agents.{runmode}/{name}"); -- procedure Get_Agents (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Runmode : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 1, Runmode); Server.Get_Agents (Runmode, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Agents; package API_Get_Agents is new Swagger.Servers.Operation (Handler => Get_Agents, Method => Swagger.Servers.GET, URI => "/etc/replication/agents.{runmode}.-1.json"); -- procedure Get_Authorizable_Keystore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Intermediate_Path : Swagger.UString; Authorizable_Id : Swagger.UString; Result : .Models.KeystoreInfo_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Intermediate_Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Authorizable_Id); Server.Get_Authorizable_Keystore (Intermediate_Path, Authorizable_Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Authorizable_Keystore; package API_Get_Authorizable_Keystore is new Swagger.Servers.Operation (Handler => Get_Authorizable_Keystore, Method => Swagger.Servers.GET, URI => "/{intermediatePath}/{authorizableId}.ks.json"); -- procedure Get_Keystore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Intermediate_Path : Swagger.UString; Authorizable_Id : Swagger.UString; Result : Swagger.Http_Content_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Intermediate_Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Authorizable_Id); Server.Get_Keystore (Intermediate_Path, Authorizable_Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Keystore; package API_Get_Keystore is new Swagger.Servers.Operation (Handler => Get_Keystore, Method => Swagger.Servers.GET, URI => "/{intermediatePath}/{authorizableId}/keystore/store.p12"); -- procedure Get_Node (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Path : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 2, Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Server.Get_Node (Path, Name, Context); end Get_Node; package API_Get_Node is new Swagger.Servers.Operation (Handler => Get_Node, Method => Swagger.Servers.GET, URI => "/{path}/{name}"); -- procedure Get_Package (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Group : Swagger.UString; Name : Swagger.UString; Version : Swagger.UString; Result : Swagger.Http_Content_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 3, Group); Swagger.Servers.Get_Path_Parameter (Req, 3, Name); Swagger.Servers.Get_Path_Parameter (Req, 3, Version); Server.Get_Package (Group, Name, Version, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Package; package API_Get_Package is new Swagger.Servers.Operation (Handler => Get_Package, Method => Swagger.Servers.GET, URI => "/etc/packages/{group}/{name}-{version}.zip"); -- procedure Get_Package_Filter (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Group : Swagger.UString; Name : Swagger.UString; Version : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Path_Parameter (Req, 3, Group); Swagger.Servers.Get_Path_Parameter (Req, 3, Name); Swagger.Servers.Get_Path_Parameter (Req, 3, Version); Server.Get_Package_Filter (Group, Name, Version, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Package_Filter; package API_Get_Package_Filter is new Swagger.Servers.Operation (Handler => Get_Package_Filter, Method => Swagger.Servers.GET, URI => "/etc/packages/{group}/{name}-{version}.zip/jcr:content/vlt:definition/filter.tidy.2.json"); -- procedure Get_Query (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Path : Swagger.UString; P_Periodlimit : Swagger.Number; 1_Property : Swagger.UString; 1_Property_Periodvalue : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "p.limit", P_Periodlimit); Swagger.Servers.Get_Query_Parameter (Req, "1_property", 1_Property); Swagger.Servers.Get_Query_Parameter (Req, "1_property.value", 1_Property_Periodvalue); Server.Get_Query (Path, P_Periodlimit, 1_Property, 1_Property_Periodvalue, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Query; package API_Get_Query is new Swagger.Servers.Operation (Handler => Get_Query, Method => Swagger.Servers.GET, URI => "/bin/querybuilder.json"); -- procedure Get_Truststore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Result : Swagger.Http_Content_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Server.Get_Truststore (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Truststore; package API_Get_Truststore is new Swagger.Servers.Operation (Handler => Get_Truststore, Method => Swagger.Servers.GET, URI => "/etc/truststore/truststore.p12"); -- procedure Get_Truststore_Info (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Result : .Models.TruststoreInfo_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Server.Get_Truststore_Info (Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Truststore_Info; package API_Get_Truststore_Info is new Swagger.Servers.Operation (Handler => Get_Truststore_Info, Method => Swagger.Servers.GET, URI => "/libs/granite/security/truststore.json"); -- procedure Post_Agent (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Runmode : Swagger.UString; Name : Swagger.UString; Jcr_Content_Slashcq_Distribute : Swagger.Nullable_Boolean; Jcr_Content_Slashcq_Distribute_At_Type_Hint : Swagger.Nullable_UString; Jcr_Content_Slashcq_Name : Swagger.Nullable_UString; Jcr_Content_Slashcq_Template : Swagger.Nullable_UString; Jcr_Content_Slashenabled : Swagger.Nullable_Boolean; Jcr_Content_Slashjcr_Description : Swagger.Nullable_UString; Jcr_Content_Slashjcr_Last_Modified : Swagger.Nullable_UString; Jcr_Content_Slashjcr_Last_Modified_By : Swagger.Nullable_UString; Jcr_Content_Slashjcr_Mixin_Types : Swagger.Nullable_UString; Jcr_Content_Slashjcr_Title : Swagger.Nullable_UString; Jcr_Content_Slashlog_Level : Swagger.Nullable_UString; Jcr_Content_Slashno_Status_Update : Swagger.Nullable_Boolean; Jcr_Content_Slashno_Versioning : Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_Connect_Timeout : Swagger.Number; Jcr_Content_Slashprotocol_H_T_T_P_Connection_Closed : Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_H_T_T_P_Expired : Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_Headers : Swagger.UString_Vectors.Vector; Jcr_Content_Slashprotocol_H_T_T_P_Headers_At_Type_Hint : Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_Method : Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_S_Relaxed : Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_Interface : Swagger.Nullable_UString; Jcr_Content_Slashprotocol_Socket_Timeout : Swagger.Number; Jcr_Content_Slashprotocol_Version : Swagger.Nullable_UString; Jcr_Content_Slashproxy_N_T_L_M_Domain : Swagger.Nullable_UString; Jcr_Content_Slashproxy_N_T_L_M_Host : Swagger.Nullable_UString; Jcr_Content_Slashproxy_Host : Swagger.Nullable_UString; Jcr_Content_Slashproxy_Password : Swagger.Nullable_UString; Jcr_Content_Slashproxy_Port : Swagger.Number; Jcr_Content_Slashproxy_User : Swagger.Nullable_UString; Jcr_Content_Slashqueue_Batch_Max_Size : Swagger.Number; Jcr_Content_Slashqueue_Batch_Mode : Swagger.Nullable_UString; Jcr_Content_Slashqueue_Batch_Wait_Time : Swagger.Number; Jcr_Content_Slashretry_Delay : Swagger.Nullable_UString; Jcr_Content_Slashreverse_Replication : Swagger.Nullable_Boolean; Jcr_Content_Slashserialization_Type : Swagger.Nullable_UString; Jcr_Content_Slashsling_Resource_Type : Swagger.Nullable_UString; Jcr_Content_Slashssl : Swagger.Nullable_UString; Jcr_Content_Slashtransport_N_T_L_M_Domain : Swagger.Nullable_UString; Jcr_Content_Slashtransport_N_T_L_M_Host : Swagger.Nullable_UString; Jcr_Content_Slashtransport_Password : Swagger.Nullable_UString; Jcr_Content_Slashtransport_Uri : Swagger.Nullable_UString; Jcr_Content_Slashtransport_User : Swagger.Nullable_UString; Jcr_Content_Slashtrigger_Distribute : Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Modified : Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_On_Off_Time : Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Receive : Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Specific : Swagger.Nullable_Boolean; Jcr_Content_Slashuser_Id : Swagger.Nullable_UString; Jcr_Primary_Type : Swagger.Nullable_UString; Operation : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/cq:distribute", Jcr_Content_Slashcq_Distribute); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/cq:distribute@TypeHint", Jcr_Content_Slashcq_Distribute_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/cq:name", Jcr_Content_Slashcq_Name); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/cq:template", Jcr_Content_Slashcq_Template); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/enabled", Jcr_Content_Slashenabled); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:description", Jcr_Content_Slashjcr_Description); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:lastModified", Jcr_Content_Slashjcr_Last_Modified); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:lastModifiedBy", Jcr_Content_Slashjcr_Last_Modified_By); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:mixinTypes", Jcr_Content_Slashjcr_Mixin_Types); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/jcr:title", Jcr_Content_Slashjcr_Title); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/logLevel", Jcr_Content_Slashlog_Level); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/noStatusUpdate", Jcr_Content_Slashno_Status_Update); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/noVersioning", Jcr_Content_Slashno_Versioning); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolConnectTimeout", Jcr_Content_Slashprotocol_Connect_Timeout); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPConnectionClosed", Jcr_Content_Slashprotocol_H_T_T_P_Connection_Closed); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPExpired", Jcr_Content_Slashprotocol_H_T_T_P_Expired); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPHeaders", Jcr_Content_Slashprotocol_H_T_T_P_Headers); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPHeaders@TypeHint", Jcr_Content_Slashprotocol_H_T_T_P_Headers_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPMethod", Jcr_Content_Slashprotocol_H_T_T_P_Method); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPSRelaxed", Jcr_Content_Slashprotocol_H_T_T_P_S_Relaxed); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolInterface", Jcr_Content_Slashprotocol_Interface); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolSocketTimeout", Jcr_Content_Slashprotocol_Socket_Timeout); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolVersion", Jcr_Content_Slashprotocol_Version); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyNTLMDomain", Jcr_Content_Slashproxy_N_T_L_M_Domain); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyNTLMHost", Jcr_Content_Slashproxy_N_T_L_M_Host); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyHost", Jcr_Content_Slashproxy_Host); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyPassword", Jcr_Content_Slashproxy_Password); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyPort", Jcr_Content_Slashproxy_Port); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyUser", Jcr_Content_Slashproxy_User); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/queueBatchMaxSize", Jcr_Content_Slashqueue_Batch_Max_Size); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/queueBatchMode", Jcr_Content_Slashqueue_Batch_Mode); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/queueBatchWaitTime", Jcr_Content_Slashqueue_Batch_Wait_Time); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/retryDelay", Jcr_Content_Slashretry_Delay); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/reverseReplication", Jcr_Content_Slashreverse_Replication); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/serializationType", Jcr_Content_Slashserialization_Type); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/sling:resourceType", Jcr_Content_Slashsling_Resource_Type); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/ssl", Jcr_Content_Slashssl); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportNTLMDomain", Jcr_Content_Slashtransport_N_T_L_M_Domain); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportNTLMHost", Jcr_Content_Slashtransport_N_T_L_M_Host); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportPassword", Jcr_Content_Slashtransport_Password); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportUri", Jcr_Content_Slashtransport_Uri); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportUser", Jcr_Content_Slashtransport_User); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerDistribute", Jcr_Content_Slashtrigger_Distribute); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerModified", Jcr_Content_Slashtrigger_Modified); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerOnOffTime", Jcr_Content_Slashtrigger_On_Off_Time); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerReceive", Jcr_Content_Slashtrigger_Receive); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/triggerSpecific", Jcr_Content_Slashtrigger_Specific); Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/userId", Jcr_Content_Slashuser_Id); Swagger.Servers.Get_Query_Parameter (Req, "jcr:primaryType", Jcr_Primary_Type); Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation); Swagger.Servers.Get_Path_Parameter (Req, 2, Runmode); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Server.Post_Agent (Runmode, Name, Jcr_Content_Slashcq_Distribute, Jcr_Content_Slashcq_Distribute_At_Type_Hint, Jcr_Content_Slashcq_Name, Jcr_Content_Slashcq_Template, Jcr_Content_Slashenabled, Jcr_Content_Slashjcr_Description, Jcr_Content_Slashjcr_Last_Modified, Jcr_Content_Slashjcr_Last_Modified_By, Jcr_Content_Slashjcr_Mixin_Types, Jcr_Content_Slashjcr_Title, Jcr_Content_Slashlog_Level, Jcr_Content_Slashno_Status_Update, Jcr_Content_Slashno_Versioning, Jcr_Content_Slashprotocol_Connect_Timeout, Jcr_Content_Slashprotocol_H_T_T_P_Connection_Closed, Jcr_Content_Slashprotocol_H_T_T_P_Expired, Jcr_Content_Slashprotocol_H_T_T_P_Headers, Jcr_Content_Slashprotocol_H_T_T_P_Headers_At_Type_Hint, Jcr_Content_Slashprotocol_H_T_T_P_Method, Jcr_Content_Slashprotocol_H_T_T_P_S_Relaxed, Jcr_Content_Slashprotocol_Interface, Jcr_Content_Slashprotocol_Socket_Timeout, Jcr_Content_Slashprotocol_Version, Jcr_Content_Slashproxy_N_T_L_M_Domain, Jcr_Content_Slashproxy_N_T_L_M_Host, Jcr_Content_Slashproxy_Host, Jcr_Content_Slashproxy_Password, Jcr_Content_Slashproxy_Port, Jcr_Content_Slashproxy_User, Jcr_Content_Slashqueue_Batch_Max_Size, Jcr_Content_Slashqueue_Batch_Mode, Jcr_Content_Slashqueue_Batch_Wait_Time, Jcr_Content_Slashretry_Delay, Jcr_Content_Slashreverse_Replication, Jcr_Content_Slashserialization_Type, Jcr_Content_Slashsling_Resource_Type, Jcr_Content_Slashssl, Jcr_Content_Slashtransport_N_T_L_M_Domain, Jcr_Content_Slashtransport_N_T_L_M_Host, Jcr_Content_Slashtransport_Password, Jcr_Content_Slashtransport_Uri, Jcr_Content_Slashtransport_User, Jcr_Content_Slashtrigger_Distribute, Jcr_Content_Slashtrigger_Modified, Jcr_Content_Slashtrigger_On_Off_Time, Jcr_Content_Slashtrigger_Receive, Jcr_Content_Slashtrigger_Specific, Jcr_Content_Slashuser_Id, Jcr_Primary_Type, Operation, Context); end Post_Agent; package API_Post_Agent is new Swagger.Servers.Operation (Handler => Post_Agent, Method => Swagger.Servers.POST, URI => "/etc/replication/agents.{runmode}/{name}"); -- procedure Post_Authorizable_Keystore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Intermediate_Path : Swagger.UString; Authorizable_Id : Swagger.UString; Operation : Swagger.Nullable_UString; Current_Password : Swagger.Nullable_UString; New_Password : Swagger.Nullable_UString; Re_Password : Swagger.Nullable_UString; Key_Password : Swagger.Nullable_UString; Key_Store_Pass : Swagger.Nullable_UString; Alias : Swagger.Nullable_UString; New_Alias : Swagger.Nullable_UString; Remove_Alias : Swagger.Nullable_UString; Cert_Chain : Swagger.File_Part_Type; Pk : Swagger.File_Part_Type; Key_Store : Swagger.File_Part_Type; Result : .Models.KeystoreInfo_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation); Swagger.Servers.Get_Query_Parameter (Req, "currentPassword", Current_Password); Swagger.Servers.Get_Query_Parameter (Req, "newPassword", New_Password); Swagger.Servers.Get_Query_Parameter (Req, "rePassword", Re_Password); Swagger.Servers.Get_Query_Parameter (Req, "keyPassword", Key_Password); Swagger.Servers.Get_Query_Parameter (Req, "keyStorePass", Key_Store_Pass); Swagger.Servers.Get_Query_Parameter (Req, "alias", Alias); Swagger.Servers.Get_Query_Parameter (Req, "newAlias", New_Alias); Swagger.Servers.Get_Query_Parameter (Req, "removeAlias", Remove_Alias); Swagger.Servers.Get_Path_Parameter (Req, 2, Intermediate_Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Authorizable_Id); Swagger.Servers.Get_Parameter (Context, "cert-chain", Cert_Chain); Swagger.Servers.Get_Parameter (Context, "pk", Pk); Swagger.Servers.Get_Parameter (Context, "keyStore", Key_Store); Server.Post_Authorizable_Keystore (Intermediate_Path, Authorizable_Id, Operation, Current_Password, New_Password, Re_Password, Key_Password, Key_Store_Pass, Alias, New_Alias, Remove_Alias, Cert_Chain, Pk, Key_Store, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Authorizable_Keystore; package API_Post_Authorizable_Keystore is new Swagger.Servers.Operation (Handler => Post_Authorizable_Keystore, Method => Swagger.Servers.POST, URI => "/{intermediatePath}/{authorizableId}.ks.html"); -- procedure Post_Authorizables (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Authorizable_Id : Swagger.UString; Intermediate_Path : Swagger.UString; Create_User : Swagger.Nullable_UString; Create_Group : Swagger.Nullable_UString; Rep_Password : Swagger.Nullable_UString; Profile_Slashgiven_Name : Swagger.Nullable_UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "authorizableId", Authorizable_Id); Swagger.Servers.Get_Query_Parameter (Req, "intermediatePath", Intermediate_Path); Swagger.Servers.Get_Query_Parameter (Req, "createUser", Create_User); Swagger.Servers.Get_Query_Parameter (Req, "createGroup", Create_Group); Swagger.Servers.Get_Query_Parameter (Req, "rep:password", Rep_Password); Swagger.Servers.Get_Query_Parameter (Req, "profile/givenName", Profile_Slashgiven_Name); Server.Post_Authorizables (Authorizable_Id, Intermediate_Path, Create_User, Create_Group, Rep_Password, Profile_Slashgiven_Name, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Authorizables; package API_Post_Authorizables is new Swagger.Servers.Operation (Handler => Post_Authorizables, Method => Swagger.Servers.POST, URI => "/libs/granite/security/post/authorizables"); -- procedure Post_Config_Adobe_Granite_Saml_Authentication_Handler (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Key_Store_Password : Swagger.Nullable_UString; Key_Store_Password_At_Type_Hint : Swagger.Nullable_UString; Service_Periodranking : Swagger.Nullable_Integer; Service_Periodranking_At_Type_Hint : Swagger.Nullable_UString; Idp_Http_Redirect : Swagger.Nullable_Boolean; Idp_Http_Redirect_At_Type_Hint : Swagger.Nullable_UString; Create_User : Swagger.Nullable_Boolean; Create_User_At_Type_Hint : Swagger.Nullable_UString; Default_Redirect_Url : Swagger.Nullable_UString; Default_Redirect_Url_At_Type_Hint : Swagger.Nullable_UString; User_I_D_Attribute : Swagger.Nullable_UString; User_I_D_Attribute_At_Type_Hint : Swagger.Nullable_UString; Default_Groups : Swagger.UString_Vectors.Vector; Default_Groups_At_Type_Hint : Swagger.Nullable_UString; Idp_Cert_Alias : Swagger.Nullable_UString; Idp_Cert_Alias_At_Type_Hint : Swagger.Nullable_UString; Add_Group_Memberships : Swagger.Nullable_Boolean; Add_Group_Memberships_At_Type_Hint : Swagger.Nullable_UString; Path : Swagger.UString_Vectors.Vector; Path_At_Type_Hint : Swagger.Nullable_UString; Synchronize_Attributes : Swagger.UString_Vectors.Vector; Synchronize_Attributes_At_Type_Hint : Swagger.Nullable_UString; Clock_Tolerance : Swagger.Nullable_Integer; Clock_Tolerance_At_Type_Hint : Swagger.Nullable_UString; Group_Membership_Attribute : Swagger.Nullable_UString; Group_Membership_Attribute_At_Type_Hint : Swagger.Nullable_UString; Idp_Url : Swagger.Nullable_UString; Idp_Url_At_Type_Hint : Swagger.Nullable_UString; Logout_Url : Swagger.Nullable_UString; Logout_Url_At_Type_Hint : Swagger.Nullable_UString; Service_Provider_Entity_Id : Swagger.Nullable_UString; Service_Provider_Entity_Id_At_Type_Hint : Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L : Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L_At_Type_Hint : Swagger.Nullable_UString; Handle_Logout : Swagger.Nullable_Boolean; Handle_Logout_At_Type_Hint : Swagger.Nullable_UString; Sp_Private_Key_Alias : Swagger.Nullable_UString; Sp_Private_Key_Alias_At_Type_Hint : Swagger.Nullable_UString; Use_Encryption : Swagger.Nullable_Boolean; Use_Encryption_At_Type_Hint : Swagger.Nullable_UString; Name_Id_Format : Swagger.Nullable_UString; Name_Id_Format_At_Type_Hint : Swagger.Nullable_UString; Digest_Method : Swagger.Nullable_UString; Digest_Method_At_Type_Hint : Swagger.Nullable_UString; Signature_Method : Swagger.Nullable_UString; Signature_Method_At_Type_Hint : Swagger.Nullable_UString; User_Intermediate_Path : Swagger.Nullable_UString; User_Intermediate_Path_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "keyStorePassword", Key_Store_Password); Swagger.Servers.Get_Query_Parameter (Req, "keyStorePassword@TypeHint", Key_Store_Password_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "service.ranking", Service_Periodranking); Swagger.Servers.Get_Query_Parameter (Req, "service.ranking@TypeHint", Service_Periodranking_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "idpHttpRedirect", Idp_Http_Redirect); Swagger.Servers.Get_Query_Parameter (Req, "idpHttpRedirect@TypeHint", Idp_Http_Redirect_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "createUser", Create_User); Swagger.Servers.Get_Query_Parameter (Req, "createUser@TypeHint", Create_User_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "defaultRedirectUrl", Default_Redirect_Url); Swagger.Servers.Get_Query_Parameter (Req, "defaultRedirectUrl@TypeHint", Default_Redirect_Url_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "userIDAttribute", User_I_D_Attribute); Swagger.Servers.Get_Query_Parameter (Req, "userIDAttribute@TypeHint", User_I_D_Attribute_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "defaultGroups", Default_Groups); Swagger.Servers.Get_Query_Parameter (Req, "defaultGroups@TypeHint", Default_Groups_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "idpCertAlias", Idp_Cert_Alias); Swagger.Servers.Get_Query_Parameter (Req, "idpCertAlias@TypeHint", Idp_Cert_Alias_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "addGroupMemberships", Add_Group_Memberships); Swagger.Servers.Get_Query_Parameter (Req, "addGroupMemberships@TypeHint", Add_Group_Memberships_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "path@TypeHint", Path_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "synchronizeAttributes", Synchronize_Attributes); Swagger.Servers.Get_Query_Parameter (Req, "synchronizeAttributes@TypeHint", Synchronize_Attributes_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "clockTolerance", Clock_Tolerance); Swagger.Servers.Get_Query_Parameter (Req, "clockTolerance@TypeHint", Clock_Tolerance_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "groupMembershipAttribute", Group_Membership_Attribute); Swagger.Servers.Get_Query_Parameter (Req, "groupMembershipAttribute@TypeHint", Group_Membership_Attribute_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "idpUrl", Idp_Url); Swagger.Servers.Get_Query_Parameter (Req, "idpUrl@TypeHint", Idp_Url_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "logoutUrl", Logout_Url); Swagger.Servers.Get_Query_Parameter (Req, "logoutUrl@TypeHint", Logout_Url_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "serviceProviderEntityId", Service_Provider_Entity_Id); Swagger.Servers.Get_Query_Parameter (Req, "serviceProviderEntityId@TypeHint", Service_Provider_Entity_Id_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "assertionConsumerServiceURL", Assertion_Consumer_Service_U_R_L); Swagger.Servers.Get_Query_Parameter (Req, "assertionConsumerServiceURL@TypeHint", Assertion_Consumer_Service_U_R_L_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "handleLogout", Handle_Logout); Swagger.Servers.Get_Query_Parameter (Req, "handleLogout@TypeHint", Handle_Logout_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "spPrivateKeyAlias", Sp_Private_Key_Alias); Swagger.Servers.Get_Query_Parameter (Req, "spPrivateKeyAlias@TypeHint", Sp_Private_Key_Alias_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "useEncryption", Use_Encryption); Swagger.Servers.Get_Query_Parameter (Req, "useEncryption@TypeHint", Use_Encryption_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "nameIdFormat", Name_Id_Format); Swagger.Servers.Get_Query_Parameter (Req, "nameIdFormat@TypeHint", Name_Id_Format_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "digestMethod", Digest_Method); Swagger.Servers.Get_Query_Parameter (Req, "digestMethod@TypeHint", Digest_Method_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "signatureMethod", Signature_Method); Swagger.Servers.Get_Query_Parameter (Req, "signatureMethod@TypeHint", Signature_Method_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "userIntermediatePath", User_Intermediate_Path); Swagger.Servers.Get_Query_Parameter (Req, "userIntermediatePath@TypeHint", User_Intermediate_Path_At_Type_Hint); Server.Post_Config_Adobe_Granite_Saml_Authentication_Handler (Key_Store_Password, Key_Store_Password_At_Type_Hint, Service_Periodranking, Service_Periodranking_At_Type_Hint, Idp_Http_Redirect, Idp_Http_Redirect_At_Type_Hint, Create_User, Create_User_At_Type_Hint, Default_Redirect_Url, Default_Redirect_Url_At_Type_Hint, User_I_D_Attribute, User_I_D_Attribute_At_Type_Hint, Default_Groups, Default_Groups_At_Type_Hint, Idp_Cert_Alias, Idp_Cert_Alias_At_Type_Hint, Add_Group_Memberships, Add_Group_Memberships_At_Type_Hint, Path, Path_At_Type_Hint, Synchronize_Attributes, Synchronize_Attributes_At_Type_Hint, Clock_Tolerance, Clock_Tolerance_At_Type_Hint, Group_Membership_Attribute, Group_Membership_Attribute_At_Type_Hint, Idp_Url, Idp_Url_At_Type_Hint, Logout_Url, Logout_Url_At_Type_Hint, Service_Provider_Entity_Id, Service_Provider_Entity_Id_At_Type_Hint, Assertion_Consumer_Service_U_R_L, Assertion_Consumer_Service_U_R_L_At_Type_Hint, Handle_Logout, Handle_Logout_At_Type_Hint, Sp_Private_Key_Alias, Sp_Private_Key_Alias_At_Type_Hint, Use_Encryption, Use_Encryption_At_Type_Hint, Name_Id_Format, Name_Id_Format_At_Type_Hint, Digest_Method, Digest_Method_At_Type_Hint, Signature_Method, Signature_Method_At_Type_Hint, User_Intermediate_Path, User_Intermediate_Path_At_Type_Hint, Context); end Post_Config_Adobe_Granite_Saml_Authentication_Handler; package API_Post_Config_Adobe_Granite_Saml_Authentication_Handler is new Swagger.Servers.Operation (Handler => Post_Config_Adobe_Granite_Saml_Authentication_Handler, Method => Swagger.Servers.POST, URI => "/apps/system/config/com.adobe.granite.auth.saml.SamlAuthenticationHandler.config"); -- procedure Post_Config_Apache_Felix_Jetty_Based_Http_Service (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Org_Periodapache_Periodfelix_Periodhttps_Periodnio : Swagger.Nullable_Boolean; Org_Periodapache_Periodfelix_Periodhttps_Periodnio_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate_At_Type_Hint : Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodenable : Swagger.Nullable_Boolean; Org_Periodapache_Periodfelix_Periodhttps_Periodenable_At_Type_Hint : Swagger.Nullable_UString; Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure : Swagger.Nullable_UString; Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.nio", Org_Periodapache_Periodfelix_Periodhttps_Periodnio); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.nio@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodnio_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.password", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.password@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.key", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.key@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.key.password", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.keystore.key.password@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.truststore", Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.truststore@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.truststore.password", Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.truststore.password@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.clientcertificate", Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.clientcertificate@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.enable", Org_Periodapache_Periodfelix_Periodhttps_Periodenable); Swagger.Servers.Get_Query_Parameter (Req, "org.apache.felix.https.enable@TypeHint", Org_Periodapache_Periodfelix_Periodhttps_Periodenable_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "org.osgi.service.http.port.secure", Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure); Swagger.Servers.Get_Query_Parameter (Req, "org.osgi.service.http.port.secure@TypeHint", Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure_At_Type_Hint); Server.Post_Config_Apache_Felix_Jetty_Based_Http_Service (Org_Periodapache_Periodfelix_Periodhttps_Periodnio, Org_Periodapache_Periodfelix_Periodhttps_Periodnio_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate, Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodenable, Org_Periodapache_Periodfelix_Periodhttps_Periodenable_At_Type_Hint, Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure, Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure_At_Type_Hint, Context); end Post_Config_Apache_Felix_Jetty_Based_Http_Service; package API_Post_Config_Apache_Felix_Jetty_Based_Http_Service is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Felix_Jetty_Based_Http_Service, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.felix.http"); -- procedure Post_Config_Apache_Http_Components_Proxy_Configuration (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Proxy_Periodhost : Swagger.Nullable_UString; Proxy_Periodhost_At_Type_Hint : Swagger.Nullable_UString; Proxy_Periodport : Swagger.Nullable_Integer; Proxy_Periodport_At_Type_Hint : Swagger.Nullable_UString; Proxy_Periodexceptions : Swagger.UString_Vectors.Vector; Proxy_Periodexceptions_At_Type_Hint : Swagger.Nullable_UString; Proxy_Periodenabled : Swagger.Nullable_Boolean; Proxy_Periodenabled_At_Type_Hint : Swagger.Nullable_UString; Proxy_Perioduser : Swagger.Nullable_UString; Proxy_Perioduser_At_Type_Hint : Swagger.Nullable_UString; Proxy_Periodpassword : Swagger.Nullable_UString; Proxy_Periodpassword_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "proxy.host", Proxy_Periodhost); Swagger.Servers.Get_Query_Parameter (Req, "proxy.host@TypeHint", Proxy_Periodhost_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.port", Proxy_Periodport); Swagger.Servers.Get_Query_Parameter (Req, "proxy.port@TypeHint", Proxy_Periodport_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.exceptions", Proxy_Periodexceptions); Swagger.Servers.Get_Query_Parameter (Req, "proxy.exceptions@TypeHint", Proxy_Periodexceptions_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.enabled", Proxy_Periodenabled); Swagger.Servers.Get_Query_Parameter (Req, "proxy.enabled@TypeHint", Proxy_Periodenabled_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.user", Proxy_Perioduser); Swagger.Servers.Get_Query_Parameter (Req, "proxy.user@TypeHint", Proxy_Perioduser_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "proxy.password", Proxy_Periodpassword); Swagger.Servers.Get_Query_Parameter (Req, "proxy.password@TypeHint", Proxy_Periodpassword_At_Type_Hint); Server.Post_Config_Apache_Http_Components_Proxy_Configuration (Proxy_Periodhost, Proxy_Periodhost_At_Type_Hint, Proxy_Periodport, Proxy_Periodport_At_Type_Hint, Proxy_Periodexceptions, Proxy_Periodexceptions_At_Type_Hint, Proxy_Periodenabled, Proxy_Periodenabled_At_Type_Hint, Proxy_Perioduser, Proxy_Perioduser_At_Type_Hint, Proxy_Periodpassword, Proxy_Periodpassword_At_Type_Hint, Context); end Post_Config_Apache_Http_Components_Proxy_Configuration; package API_Post_Config_Apache_Http_Components_Proxy_Configuration is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Http_Components_Proxy_Configuration, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.http.proxyconfigurator.config"); -- procedure Post_Config_Apache_Sling_Dav_Ex_Servlet (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Alias : Swagger.Nullable_UString; Alias_At_Type_Hint : Swagger.Nullable_UString; Dav_Periodcreate_Absolute_Uri : Swagger.Nullable_Boolean; Dav_Periodcreate_Absolute_Uri_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "alias", Alias); Swagger.Servers.Get_Query_Parameter (Req, "alias@TypeHint", Alias_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "dav.create-absolute-uri", Dav_Periodcreate_Absolute_Uri); Swagger.Servers.Get_Query_Parameter (Req, "dav.create-absolute-uri@TypeHint", Dav_Periodcreate_Absolute_Uri_At_Type_Hint); Server.Post_Config_Apache_Sling_Dav_Ex_Servlet (Alias, Alias_At_Type_Hint, Dav_Periodcreate_Absolute_Uri, Dav_Periodcreate_Absolute_Uri_At_Type_Hint, Context); end Post_Config_Apache_Sling_Dav_Ex_Servlet; package API_Post_Config_Apache_Sling_Dav_Ex_Servlet is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Sling_Dav_Ex_Servlet, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet"); -- procedure Post_Config_Apache_Sling_Get_Servlet (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Json_Periodmaximumresults : Swagger.Nullable_UString; Json_Periodmaximumresults_At_Type_Hint : Swagger.Nullable_UString; Enable_Periodhtml : Swagger.Nullable_Boolean; Enable_Periodhtml_At_Type_Hint : Swagger.Nullable_UString; Enable_Periodtxt : Swagger.Nullable_Boolean; Enable_Periodtxt_At_Type_Hint : Swagger.Nullable_UString; Enable_Periodxml : Swagger.Nullable_Boolean; Enable_Periodxml_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "json.maximumresults", Json_Periodmaximumresults); Swagger.Servers.Get_Query_Parameter (Req, "json.maximumresults@TypeHint", Json_Periodmaximumresults_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "enable.html", Enable_Periodhtml); Swagger.Servers.Get_Query_Parameter (Req, "enable.html@TypeHint", Enable_Periodhtml_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "enable.txt", Enable_Periodtxt); Swagger.Servers.Get_Query_Parameter (Req, "enable.txt@TypeHint", Enable_Periodtxt_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "enable.xml", Enable_Periodxml); Swagger.Servers.Get_Query_Parameter (Req, "enable.xml@TypeHint", Enable_Periodxml_At_Type_Hint); Server.Post_Config_Apache_Sling_Get_Servlet (Json_Periodmaximumresults, Json_Periodmaximumresults_At_Type_Hint, Enable_Periodhtml, Enable_Periodhtml_At_Type_Hint, Enable_Periodtxt, Enable_Periodtxt_At_Type_Hint, Enable_Periodxml, Enable_Periodxml_At_Type_Hint, Context); end Post_Config_Apache_Sling_Get_Servlet; package API_Post_Config_Apache_Sling_Get_Servlet is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Sling_Get_Servlet, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.sling.servlets.get.DefaultGetServlet"); -- procedure Post_Config_Apache_Sling_Referrer_Filter (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Allow_Periodempty : Swagger.Nullable_Boolean; Allow_Periodempty_At_Type_Hint : Swagger.Nullable_UString; Allow_Periodhosts : Swagger.Nullable_UString; Allow_Periodhosts_At_Type_Hint : Swagger.Nullable_UString; Allow_Periodhosts_Periodregexp : Swagger.Nullable_UString; Allow_Periodhosts_Periodregexp_At_Type_Hint : Swagger.Nullable_UString; Filter_Periodmethods : Swagger.Nullable_UString; Filter_Periodmethods_At_Type_Hint : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "allow.empty", Allow_Periodempty); Swagger.Servers.Get_Query_Parameter (Req, "allow.empty@TypeHint", Allow_Periodempty_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "allow.hosts", Allow_Periodhosts); Swagger.Servers.Get_Query_Parameter (Req, "allow.hosts@TypeHint", Allow_Periodhosts_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "allow.hosts.regexp", Allow_Periodhosts_Periodregexp); Swagger.Servers.Get_Query_Parameter (Req, "allow.hosts.regexp@TypeHint", Allow_Periodhosts_Periodregexp_At_Type_Hint); Swagger.Servers.Get_Query_Parameter (Req, "filter.methods", Filter_Periodmethods); Swagger.Servers.Get_Query_Parameter (Req, "filter.methods@TypeHint", Filter_Periodmethods_At_Type_Hint); Server.Post_Config_Apache_Sling_Referrer_Filter (Allow_Periodempty, Allow_Periodempty_At_Type_Hint, Allow_Periodhosts, Allow_Periodhosts_At_Type_Hint, Allow_Periodhosts_Periodregexp, Allow_Periodhosts_Periodregexp_At_Type_Hint, Filter_Periodmethods, Filter_Periodmethods_At_Type_Hint, Context); end Post_Config_Apache_Sling_Referrer_Filter; package API_Post_Config_Apache_Sling_Referrer_Filter is new Swagger.Servers.Operation (Handler => Post_Config_Apache_Sling_Referrer_Filter, Method => Swagger.Servers.POST, URI => "/apps/system/config/org.apache.sling.security.impl.ReferrerFilter"); -- procedure Post_Node (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Path : Swagger.UString; Name : Swagger.UString; Operation : Swagger.Nullable_UString; Delete_Authorizable : Swagger.Nullable_UString; File : Swagger.File_Part_Type; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation); Swagger.Servers.Get_Query_Parameter (Req, "deleteAuthorizable", Delete_Authorizable); Swagger.Servers.Get_Path_Parameter (Req, 2, Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Swagger.Servers.Get_Parameter (Context, "file", File); Server.Post_Node (Path, Name, Operation, Delete_Authorizable, File, Context); end Post_Node; package API_Post_Node is new Swagger.Servers.Operation (Handler => Post_Node, Method => Swagger.Servers.POST, URI => "/{path}/{name}"); -- procedure Post_Node_Rw (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Path : Swagger.UString; Name : Swagger.UString; Add_Members : Swagger.Nullable_UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "addMembers", Add_Members); Swagger.Servers.Get_Path_Parameter (Req, 2, Path); Swagger.Servers.Get_Path_Parameter (Req, 2, Name); Server.Post_Node_Rw (Path, Name, Add_Members, Context); end Post_Node_Rw; package API_Post_Node_Rw is new Swagger.Servers.Operation (Handler => Post_Node_Rw, Method => Swagger.Servers.POST, URI => "/{path}/{name}.rw.html"); -- procedure Post_Path (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Path : Swagger.UString; Jcr_Primary_Type : Swagger.UString; Name : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "jcr:primaryType", Jcr_Primary_Type); Swagger.Servers.Get_Query_Parameter (Req, ":name", Name); Swagger.Servers.Get_Path_Parameter (Req, 1, Path); Server.Post_Path (Path, Jcr_Primary_Type, Name, Context); end Post_Path; package API_Post_Path is new Swagger.Servers.Operation (Handler => Post_Path, Method => Swagger.Servers.POST, URI => "/{path}/"); -- procedure Post_Query (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Path : Swagger.UString; P_Periodlimit : Swagger.Number; 1_Property : Swagger.UString; 1_Property_Periodvalue : Swagger.UString; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Swagger.Servers.Get_Query_Parameter (Req, "p.limit", P_Periodlimit); Swagger.Servers.Get_Query_Parameter (Req, "1_property", 1_Property); Swagger.Servers.Get_Query_Parameter (Req, "1_property.value", 1_Property_Periodvalue); Server.Post_Query (Path, P_Periodlimit, 1_Property, 1_Property_Periodvalue, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Query; package API_Post_Query is new Swagger.Servers.Operation (Handler => Post_Query, Method => Swagger.Servers.POST, URI => "/bin/querybuilder.json"); -- procedure Post_Tree_Activation (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Ignoredeactivated : Boolean; Onlymodified : Boolean; Path : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, "ignoredeactivated", Ignoredeactivated); Swagger.Servers.Get_Query_Parameter (Req, "onlymodified", Onlymodified); Swagger.Servers.Get_Query_Parameter (Req, "path", Path); Server.Post_Tree_Activation (Ignoredeactivated, Onlymodified, Path, Context); end Post_Tree_Activation; package API_Post_Tree_Activation is new Swagger.Servers.Operation (Handler => Post_Tree_Activation, Method => Swagger.Servers.POST, URI => "/etc/replication/treeactivation.html"); -- procedure Post_Truststore (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Operation : Swagger.Nullable_UString; New_Password : Swagger.Nullable_UString; Re_Password : Swagger.Nullable_UString; Key_Store_Type : Swagger.Nullable_UString; Remove_Alias : Swagger.Nullable_UString; Certificate : Swagger.File_Part_Type; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation); Swagger.Servers.Get_Query_Parameter (Req, "newPassword", New_Password); Swagger.Servers.Get_Query_Parameter (Req, "rePassword", Re_Password); Swagger.Servers.Get_Query_Parameter (Req, "keyStoreType", Key_Store_Type); Swagger.Servers.Get_Query_Parameter (Req, "removeAlias", Remove_Alias); Swagger.Servers.Get_Parameter (Context, "certificate", Certificate); Server.Post_Truststore (Operation, New_Password, Re_Password, Key_Store_Type, Remove_Alias, Certificate, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Truststore; package API_Post_Truststore is new Swagger.Servers.Operation (Handler => Post_Truststore, Method => Swagger.Servers.POST, URI => "/libs/granite/security/post/truststore"); -- procedure Post_Truststore_P_K_C_S12 (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Truststore_Periodp12 : Swagger.File_Part_Type; Result : Swagger.UString; begin if not Context.Is_Authenticated then Context.Set_Error (401, "Not authenticated"); return; end if; Swagger.Servers.Get_Parameter (Context, "truststore.p12", Truststore_Periodp12); Server.Post_Truststore_P_K_C_S12 (Truststore_Periodp12, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Post_Truststore_P_K_C_S12; package API_Post_Truststore_P_K_C_S12 is new Swagger.Servers.Operation (Handler => Post_Truststore_P_K_C_S12, Method => Swagger.Servers.POST, URI => "/etc/truststore"); procedure Register (Server : in out Swagger.Servers.Application_Type'Class) is begin Swagger.Servers.Register (Server, API_Get_Aem_Product_Info.Definition); Swagger.Servers.Register (Server, API_Get_Config_Mgr.Definition); Swagger.Servers.Register (Server, API_Post_Bundle.Definition); Swagger.Servers.Register (Server, API_Post_Jmx_Repository.Definition); Swagger.Servers.Register (Server, API_Post_Saml_Configuration.Definition); Swagger.Servers.Register (Server, API_Get_Login_Page.Definition); Swagger.Servers.Register (Server, API_Post_Cq_Actions.Definition); Swagger.Servers.Register (Server, API_Get_Crxde_Status.Definition); Swagger.Servers.Register (Server, API_Get_Install_Status.Definition); Swagger.Servers.Register (Server, API_Get_Package_Manager_Servlet.Definition); Swagger.Servers.Register (Server, API_Post_Package_Service.Definition); Swagger.Servers.Register (Server, API_Post_Package_Service_Json.Definition); Swagger.Servers.Register (Server, API_Post_Package_Update.Definition); Swagger.Servers.Register (Server, API_Post_Set_Password.Definition); Swagger.Servers.Register (Server, API_Get_Aem_Health_Check.Definition); Swagger.Servers.Register (Server, API_Post_Config_Aem_Health_Check_Servlet.Definition); Swagger.Servers.Register (Server, API_Post_Config_Aem_Password_Reset.Definition); Swagger.Servers.Register (Server, API_Delete_Agent.Definition); Swagger.Servers.Register (Server, API_Delete_Node.Definition); Swagger.Servers.Register (Server, API_Get_Agent.Definition); Swagger.Servers.Register (Server, API_Get_Agents.Definition); Swagger.Servers.Register (Server, API_Get_Authorizable_Keystore.Definition); Swagger.Servers.Register (Server, API_Get_Keystore.Definition); Swagger.Servers.Register (Server, API_Get_Node.Definition); Swagger.Servers.Register (Server, API_Get_Package.Definition); Swagger.Servers.Register (Server, API_Get_Package_Filter.Definition); Swagger.Servers.Register (Server, API_Get_Query.Definition); Swagger.Servers.Register (Server, API_Get_Truststore.Definition); Swagger.Servers.Register (Server, API_Get_Truststore_Info.Definition); Swagger.Servers.Register (Server, API_Post_Agent.Definition); Swagger.Servers.Register (Server, API_Post_Authorizable_Keystore.Definition); Swagger.Servers.Register (Server, API_Post_Authorizables.Definition); Swagger.Servers.Register (Server, API_Post_Config_Adobe_Granite_Saml_Authentication_Handler.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Felix_Jetty_Based_Http_Service.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Http_Components_Proxy_Configuration.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Sling_Dav_Ex_Servlet.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Sling_Get_Servlet.Definition); Swagger.Servers.Register (Server, API_Post_Config_Apache_Sling_Referrer_Filter.Definition); Swagger.Servers.Register (Server, API_Post_Node.Definition); Swagger.Servers.Register (Server, API_Post_Node_Rw.Definition); Swagger.Servers.Register (Server, API_Post_Path.Definition); Swagger.Servers.Register (Server, API_Post_Query.Definition); Swagger.Servers.Register (Server, API_Post_Tree_Activation.Definition); Swagger.Servers.Register (Server, API_Post_Truststore.Definition); Swagger.Servers.Register (Server, API_Post_Truststore_P_K_C_S12.Definition); end Register; protected body Server is -- procedure Get_Aem_Product_Info (Result : out Swagger.UString_Vectors.Vector; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Aem_Product_Info (Result, Context); end Get_Aem_Product_Info; -- procedure Get_Config_Mgr (Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Config_Mgr (Result, Context); end Get_Config_Mgr; -- procedure Post_Bundle (Name : in Swagger.UString; Action : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Bundle (Name, Action, Context); end Post_Bundle; -- procedure Post_Jmx_Repository (Action : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Jmx_Repository (Action, Context); end Post_Jmx_Repository; -- procedure Post_Saml_Configuration (Post : in Swagger.Nullable_Boolean; Apply : in Swagger.Nullable_Boolean; Delete : in Swagger.Nullable_Boolean; Action : in Swagger.Nullable_UString; Dollarlocation : in Swagger.Nullable_UString; Path : in Swagger.UString_Vectors.Vector; Service_Periodranking : in Swagger.Nullable_Integer; Idp_Url : in Swagger.Nullable_UString; Idp_Cert_Alias : in Swagger.Nullable_UString; Idp_Http_Redirect : in Swagger.Nullable_Boolean; Service_Provider_Entity_Id : in Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L : in Swagger.Nullable_UString; Sp_Private_Key_Alias : in Swagger.Nullable_UString; Key_Store_Password : in Swagger.Nullable_UString; Default_Redirect_Url : in Swagger.Nullable_UString; User_I_D_Attribute : in Swagger.Nullable_UString; Use_Encryption : in Swagger.Nullable_Boolean; Create_User : in Swagger.Nullable_Boolean; Add_Group_Memberships : in Swagger.Nullable_Boolean; Group_Membership_Attribute : in Swagger.Nullable_UString; Default_Groups : in Swagger.UString_Vectors.Vector; Name_Id_Format : in Swagger.Nullable_UString; Synchronize_Attributes : in Swagger.UString_Vectors.Vector; Handle_Logout : in Swagger.Nullable_Boolean; Logout_Url : in Swagger.Nullable_UString; Clock_Tolerance : in Swagger.Nullable_Integer; Digest_Method : in Swagger.Nullable_UString; Signature_Method : in Swagger.Nullable_UString; User_Intermediate_Path : in Swagger.Nullable_UString; Propertylist : in Swagger.UString_Vectors.Vector; Result : out .Models.SamlConfigurationInfo_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Saml_Configuration (Post, Apply, Delete, Action, Dollarlocation, Path, Service_Periodranking, Idp_Url, Idp_Cert_Alias, Idp_Http_Redirect, Service_Provider_Entity_Id, Assertion_Consumer_Service_U_R_L, Sp_Private_Key_Alias, Key_Store_Password, Default_Redirect_Url, User_I_D_Attribute, Use_Encryption, Create_User, Add_Group_Memberships, Group_Membership_Attribute, Default_Groups, Name_Id_Format, Synchronize_Attributes, Handle_Logout, Logout_Url, Clock_Tolerance, Digest_Method, Signature_Method, User_Intermediate_Path, Propertylist, Result, Context); end Post_Saml_Configuration; -- procedure Get_Login_Page (Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Login_Page (Result, Context); end Get_Login_Page; -- procedure Post_Cq_Actions (Authorizable_Id : in Swagger.UString; Changelog : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Cq_Actions (Authorizable_Id, Changelog, Context); end Post_Cq_Actions; -- procedure Get_Crxde_Status (Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Crxde_Status (Result, Context); end Get_Crxde_Status; -- procedure Get_Install_Status (Result : out .Models.InstallStatus_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Install_Status (Result, Context); end Get_Install_Status; -- procedure Get_Package_Manager_Servlet (Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Package_Manager_Servlet (Context); end Get_Package_Manager_Servlet; -- procedure Post_Package_Service (Cmd : in Swagger.UString; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Package_Service (Cmd, Result, Context); end Post_Package_Service; -- procedure Post_Package_Service_Json (Path : in Swagger.UString; Cmd : in Swagger.UString; Group_Name : in Swagger.Nullable_UString; Package_Name : in Swagger.Nullable_UString; Package_Version : in Swagger.Nullable_UString; Charset : in Swagger.Nullable_UString; Force : in Swagger.Nullable_Boolean; Recursive : in Swagger.Nullable_Boolean; P_Package : in Swagger.File_Part_Type; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Package_Service_Json (Path, Cmd, Group_Name, Package_Name, Package_Version, Charset, Force, Recursive, P_Package, Result, Context); end Post_Package_Service_Json; -- procedure Post_Package_Update (Group_Name : in Swagger.UString; Package_Name : in Swagger.UString; Version : in Swagger.UString; Path : in Swagger.UString; Filter : in Swagger.Nullable_UString; Charset : in Swagger.Nullable_UString; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Package_Update (Group_Name, Package_Name, Version, Path, Filter, Charset, Result, Context); end Post_Package_Update; -- procedure Post_Set_Password (Old : in Swagger.UString; Plain : in Swagger.UString; Verify : in Swagger.UString; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Set_Password (Old, Plain, Verify, Result, Context); end Post_Set_Password; -- procedure Get_Aem_Health_Check (Tags : in Swagger.Nullable_UString; Combine_Tags_Or : in Swagger.Nullable_Boolean; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Aem_Health_Check (Tags, Combine_Tags_Or, Result, Context); end Get_Aem_Health_Check; -- procedure Post_Config_Aem_Health_Check_Servlet (Bundles_Periodignored : in Swagger.UString_Vectors.Vector; Bundles_Periodignored_At_Type_Hint : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Config_Aem_Health_Check_Servlet (Bundles_Periodignored, Bundles_Periodignored_At_Type_Hint, Context); end Post_Config_Aem_Health_Check_Servlet; -- procedure Post_Config_Aem_Password_Reset (Pwdreset_Periodauthorizables : in Swagger.UString_Vectors.Vector; Pwdreset_Periodauthorizables_At_Type_Hint : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Config_Aem_Password_Reset (Pwdreset_Periodauthorizables, Pwdreset_Periodauthorizables_At_Type_Hint, Context); end Post_Config_Aem_Password_Reset; -- procedure Delete_Agent (Runmode : in Swagger.UString; Name : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Delete_Agent (Runmode, Name, Context); end Delete_Agent; -- procedure Delete_Node (Path : in Swagger.UString; Name : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Delete_Node (Path, Name, Context); end Delete_Node; -- procedure Get_Agent (Runmode : in Swagger.UString; Name : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Agent (Runmode, Name, Context); end Get_Agent; -- procedure Get_Agents (Runmode : in Swagger.UString; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Agents (Runmode, Result, Context); end Get_Agents; -- procedure Get_Authorizable_Keystore (Intermediate_Path : in Swagger.UString; Authorizable_Id : in Swagger.UString; Result : out .Models.KeystoreInfo_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Authorizable_Keystore (Intermediate_Path, Authorizable_Id, Result, Context); end Get_Authorizable_Keystore; -- procedure Get_Keystore (Intermediate_Path : in Swagger.UString; Authorizable_Id : in Swagger.UString; Result : out Swagger.Http_Content_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Keystore (Intermediate_Path, Authorizable_Id, Result, Context); end Get_Keystore; -- procedure Get_Node (Path : in Swagger.UString; Name : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Node (Path, Name, Context); end Get_Node; -- procedure Get_Package (Group : in Swagger.UString; Name : in Swagger.UString; Version : in Swagger.UString; Result : out Swagger.Http_Content_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Package (Group, Name, Version, Result, Context); end Get_Package; -- procedure Get_Package_Filter (Group : in Swagger.UString; Name : in Swagger.UString; Version : in Swagger.UString; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Package_Filter (Group, Name, Version, Result, Context); end Get_Package_Filter; -- procedure Get_Query (Path : in Swagger.UString; P_Periodlimit : in Swagger.Number; 1_Property : in Swagger.UString; 1_Property_Periodvalue : in Swagger.UString; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Query (Path, P_Periodlimit, 1_Property, 1_Property_Periodvalue, Result, Context); end Get_Query; -- procedure Get_Truststore (Result : out Swagger.Http_Content_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Truststore (Result, Context); end Get_Truststore; -- procedure Get_Truststore_Info (Result : out .Models.TruststoreInfo_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Truststore_Info (Result, Context); end Get_Truststore_Info; -- procedure Post_Agent (Runmode : in Swagger.UString; Name : in Swagger.UString; Jcr_Content_Slashcq_Distribute : in Swagger.Nullable_Boolean; Jcr_Content_Slashcq_Distribute_At_Type_Hint : in Swagger.Nullable_UString; Jcr_Content_Slashcq_Name : in Swagger.Nullable_UString; Jcr_Content_Slashcq_Template : in Swagger.Nullable_UString; Jcr_Content_Slashenabled : in Swagger.Nullable_Boolean; Jcr_Content_Slashjcr_Description : in Swagger.Nullable_UString; Jcr_Content_Slashjcr_Last_Modified : in Swagger.Nullable_UString; Jcr_Content_Slashjcr_Last_Modified_By : in Swagger.Nullable_UString; Jcr_Content_Slashjcr_Mixin_Types : in Swagger.Nullable_UString; Jcr_Content_Slashjcr_Title : in Swagger.Nullable_UString; Jcr_Content_Slashlog_Level : in Swagger.Nullable_UString; Jcr_Content_Slashno_Status_Update : in Swagger.Nullable_Boolean; Jcr_Content_Slashno_Versioning : in Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_Connect_Timeout : in Swagger.Number; Jcr_Content_Slashprotocol_H_T_T_P_Connection_Closed : in Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_H_T_T_P_Expired : in Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_Headers : in Swagger.UString_Vectors.Vector; Jcr_Content_Slashprotocol_H_T_T_P_Headers_At_Type_Hint : in Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_Method : in Swagger.Nullable_UString; Jcr_Content_Slashprotocol_H_T_T_P_S_Relaxed : in Swagger.Nullable_Boolean; Jcr_Content_Slashprotocol_Interface : in Swagger.Nullable_UString; Jcr_Content_Slashprotocol_Socket_Timeout : in Swagger.Number; Jcr_Content_Slashprotocol_Version : in Swagger.Nullable_UString; Jcr_Content_Slashproxy_N_T_L_M_Domain : in Swagger.Nullable_UString; Jcr_Content_Slashproxy_N_T_L_M_Host : in Swagger.Nullable_UString; Jcr_Content_Slashproxy_Host : in Swagger.Nullable_UString; Jcr_Content_Slashproxy_Password : in Swagger.Nullable_UString; Jcr_Content_Slashproxy_Port : in Swagger.Number; Jcr_Content_Slashproxy_User : in Swagger.Nullable_UString; Jcr_Content_Slashqueue_Batch_Max_Size : in Swagger.Number; Jcr_Content_Slashqueue_Batch_Mode : in Swagger.Nullable_UString; Jcr_Content_Slashqueue_Batch_Wait_Time : in Swagger.Number; Jcr_Content_Slashretry_Delay : in Swagger.Nullable_UString; Jcr_Content_Slashreverse_Replication : in Swagger.Nullable_Boolean; Jcr_Content_Slashserialization_Type : in Swagger.Nullable_UString; Jcr_Content_Slashsling_Resource_Type : in Swagger.Nullable_UString; Jcr_Content_Slashssl : in Swagger.Nullable_UString; Jcr_Content_Slashtransport_N_T_L_M_Domain : in Swagger.Nullable_UString; Jcr_Content_Slashtransport_N_T_L_M_Host : in Swagger.Nullable_UString; Jcr_Content_Slashtransport_Password : in Swagger.Nullable_UString; Jcr_Content_Slashtransport_Uri : in Swagger.Nullable_UString; Jcr_Content_Slashtransport_User : in Swagger.Nullable_UString; Jcr_Content_Slashtrigger_Distribute : in Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Modified : in Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_On_Off_Time : in Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Receive : in Swagger.Nullable_Boolean; Jcr_Content_Slashtrigger_Specific : in Swagger.Nullable_Boolean; Jcr_Content_Slashuser_Id : in Swagger.Nullable_UString; Jcr_Primary_Type : in Swagger.Nullable_UString; Operation : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Agent (Runmode, Name, Jcr_Content_Slashcq_Distribute, Jcr_Content_Slashcq_Distribute_At_Type_Hint, Jcr_Content_Slashcq_Name, Jcr_Content_Slashcq_Template, Jcr_Content_Slashenabled, Jcr_Content_Slashjcr_Description, Jcr_Content_Slashjcr_Last_Modified, Jcr_Content_Slashjcr_Last_Modified_By, Jcr_Content_Slashjcr_Mixin_Types, Jcr_Content_Slashjcr_Title, Jcr_Content_Slashlog_Level, Jcr_Content_Slashno_Status_Update, Jcr_Content_Slashno_Versioning, Jcr_Content_Slashprotocol_Connect_Timeout, Jcr_Content_Slashprotocol_H_T_T_P_Connection_Closed, Jcr_Content_Slashprotocol_H_T_T_P_Expired, Jcr_Content_Slashprotocol_H_T_T_P_Headers, Jcr_Content_Slashprotocol_H_T_T_P_Headers_At_Type_Hint, Jcr_Content_Slashprotocol_H_T_T_P_Method, Jcr_Content_Slashprotocol_H_T_T_P_S_Relaxed, Jcr_Content_Slashprotocol_Interface, Jcr_Content_Slashprotocol_Socket_Timeout, Jcr_Content_Slashprotocol_Version, Jcr_Content_Slashproxy_N_T_L_M_Domain, Jcr_Content_Slashproxy_N_T_L_M_Host, Jcr_Content_Slashproxy_Host, Jcr_Content_Slashproxy_Password, Jcr_Content_Slashproxy_Port, Jcr_Content_Slashproxy_User, Jcr_Content_Slashqueue_Batch_Max_Size, Jcr_Content_Slashqueue_Batch_Mode, Jcr_Content_Slashqueue_Batch_Wait_Time, Jcr_Content_Slashretry_Delay, Jcr_Content_Slashreverse_Replication, Jcr_Content_Slashserialization_Type, Jcr_Content_Slashsling_Resource_Type, Jcr_Content_Slashssl, Jcr_Content_Slashtransport_N_T_L_M_Domain, Jcr_Content_Slashtransport_N_T_L_M_Host, Jcr_Content_Slashtransport_Password, Jcr_Content_Slashtransport_Uri, Jcr_Content_Slashtransport_User, Jcr_Content_Slashtrigger_Distribute, Jcr_Content_Slashtrigger_Modified, Jcr_Content_Slashtrigger_On_Off_Time, Jcr_Content_Slashtrigger_Receive, Jcr_Content_Slashtrigger_Specific, Jcr_Content_Slashuser_Id, Jcr_Primary_Type, Operation, Context); end Post_Agent; -- procedure Post_Authorizable_Keystore (Intermediate_Path : in Swagger.UString; Authorizable_Id : in Swagger.UString; Operation : in Swagger.Nullable_UString; Current_Password : in Swagger.Nullable_UString; New_Password : in Swagger.Nullable_UString; Re_Password : in Swagger.Nullable_UString; Key_Password : in Swagger.Nullable_UString; Key_Store_Pass : in Swagger.Nullable_UString; Alias : in Swagger.Nullable_UString; New_Alias : in Swagger.Nullable_UString; Remove_Alias : in Swagger.Nullable_UString; Cert_Chain : in Swagger.File_Part_Type; Pk : in Swagger.File_Part_Type; Key_Store : in Swagger.File_Part_Type; Result : out .Models.KeystoreInfo_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Authorizable_Keystore (Intermediate_Path, Authorizable_Id, Operation, Current_Password, New_Password, Re_Password, Key_Password, Key_Store_Pass, Alias, New_Alias, Remove_Alias, Cert_Chain, Pk, Key_Store, Result, Context); end Post_Authorizable_Keystore; -- procedure Post_Authorizables (Authorizable_Id : in Swagger.UString; Intermediate_Path : in Swagger.UString; Create_User : in Swagger.Nullable_UString; Create_Group : in Swagger.Nullable_UString; Rep_Password : in Swagger.Nullable_UString; Profile_Slashgiven_Name : in Swagger.Nullable_UString; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Authorizables (Authorizable_Id, Intermediate_Path, Create_User, Create_Group, Rep_Password, Profile_Slashgiven_Name, Result, Context); end Post_Authorizables; -- procedure Post_Config_Adobe_Granite_Saml_Authentication_Handler (Key_Store_Password : in Swagger.Nullable_UString; Key_Store_Password_At_Type_Hint : in Swagger.Nullable_UString; Service_Periodranking : in Swagger.Nullable_Integer; Service_Periodranking_At_Type_Hint : in Swagger.Nullable_UString; Idp_Http_Redirect : in Swagger.Nullable_Boolean; Idp_Http_Redirect_At_Type_Hint : in Swagger.Nullable_UString; Create_User : in Swagger.Nullable_Boolean; Create_User_At_Type_Hint : in Swagger.Nullable_UString; Default_Redirect_Url : in Swagger.Nullable_UString; Default_Redirect_Url_At_Type_Hint : in Swagger.Nullable_UString; User_I_D_Attribute : in Swagger.Nullable_UString; User_I_D_Attribute_At_Type_Hint : in Swagger.Nullable_UString; Default_Groups : in Swagger.UString_Vectors.Vector; Default_Groups_At_Type_Hint : in Swagger.Nullable_UString; Idp_Cert_Alias : in Swagger.Nullable_UString; Idp_Cert_Alias_At_Type_Hint : in Swagger.Nullable_UString; Add_Group_Memberships : in Swagger.Nullable_Boolean; Add_Group_Memberships_At_Type_Hint : in Swagger.Nullable_UString; Path : in Swagger.UString_Vectors.Vector; Path_At_Type_Hint : in Swagger.Nullable_UString; Synchronize_Attributes : in Swagger.UString_Vectors.Vector; Synchronize_Attributes_At_Type_Hint : in Swagger.Nullable_UString; Clock_Tolerance : in Swagger.Nullable_Integer; Clock_Tolerance_At_Type_Hint : in Swagger.Nullable_UString; Group_Membership_Attribute : in Swagger.Nullable_UString; Group_Membership_Attribute_At_Type_Hint : in Swagger.Nullable_UString; Idp_Url : in Swagger.Nullable_UString; Idp_Url_At_Type_Hint : in Swagger.Nullable_UString; Logout_Url : in Swagger.Nullable_UString; Logout_Url_At_Type_Hint : in Swagger.Nullable_UString; Service_Provider_Entity_Id : in Swagger.Nullable_UString; Service_Provider_Entity_Id_At_Type_Hint : in Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L : in Swagger.Nullable_UString; Assertion_Consumer_Service_U_R_L_At_Type_Hint : in Swagger.Nullable_UString; Handle_Logout : in Swagger.Nullable_Boolean; Handle_Logout_At_Type_Hint : in Swagger.Nullable_UString; Sp_Private_Key_Alias : in Swagger.Nullable_UString; Sp_Private_Key_Alias_At_Type_Hint : in Swagger.Nullable_UString; Use_Encryption : in Swagger.Nullable_Boolean; Use_Encryption_At_Type_Hint : in Swagger.Nullable_UString; Name_Id_Format : in Swagger.Nullable_UString; Name_Id_Format_At_Type_Hint : in Swagger.Nullable_UString; Digest_Method : in Swagger.Nullable_UString; Digest_Method_At_Type_Hint : in Swagger.Nullable_UString; Signature_Method : in Swagger.Nullable_UString; Signature_Method_At_Type_Hint : in Swagger.Nullable_UString; User_Intermediate_Path : in Swagger.Nullable_UString; User_Intermediate_Path_At_Type_Hint : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Config_Adobe_Granite_Saml_Authentication_Handler (Key_Store_Password, Key_Store_Password_At_Type_Hint, Service_Periodranking, Service_Periodranking_At_Type_Hint, Idp_Http_Redirect, Idp_Http_Redirect_At_Type_Hint, Create_User, Create_User_At_Type_Hint, Default_Redirect_Url, Default_Redirect_Url_At_Type_Hint, User_I_D_Attribute, User_I_D_Attribute_At_Type_Hint, Default_Groups, Default_Groups_At_Type_Hint, Idp_Cert_Alias, Idp_Cert_Alias_At_Type_Hint, Add_Group_Memberships, Add_Group_Memberships_At_Type_Hint, Path, Path_At_Type_Hint, Synchronize_Attributes, Synchronize_Attributes_At_Type_Hint, Clock_Tolerance, Clock_Tolerance_At_Type_Hint, Group_Membership_Attribute, Group_Membership_Attribute_At_Type_Hint, Idp_Url, Idp_Url_At_Type_Hint, Logout_Url, Logout_Url_At_Type_Hint, Service_Provider_Entity_Id, Service_Provider_Entity_Id_At_Type_Hint, Assertion_Consumer_Service_U_R_L, Assertion_Consumer_Service_U_R_L_At_Type_Hint, Handle_Logout, Handle_Logout_At_Type_Hint, Sp_Private_Key_Alias, Sp_Private_Key_Alias_At_Type_Hint, Use_Encryption, Use_Encryption_At_Type_Hint, Name_Id_Format, Name_Id_Format_At_Type_Hint, Digest_Method, Digest_Method_At_Type_Hint, Signature_Method, Signature_Method_At_Type_Hint, User_Intermediate_Path, User_Intermediate_Path_At_Type_Hint, Context); end Post_Config_Adobe_Granite_Saml_Authentication_Handler; -- procedure Post_Config_Apache_Felix_Jetty_Based_Http_Service (Org_Periodapache_Periodfelix_Periodhttps_Periodnio : in Swagger.Nullable_Boolean; Org_Periodapache_Periodfelix_Periodhttps_Periodnio_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodapache_Periodfelix_Periodhttps_Periodenable : in Swagger.Nullable_Boolean; Org_Periodapache_Periodfelix_Periodhttps_Periodenable_At_Type_Hint : in Swagger.Nullable_UString; Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure : in Swagger.Nullable_UString; Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure_At_Type_Hint : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Config_Apache_Felix_Jetty_Based_Http_Service (Org_Periodapache_Periodfelix_Periodhttps_Periodnio, Org_Periodapache_Periodfelix_Periodhttps_Periodnio_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodkeystore_Periodkey_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword, Org_Periodapache_Periodfelix_Periodhttps_Periodtruststore_Periodpassword_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate, Org_Periodapache_Periodfelix_Periodhttps_Periodclientcertificate_At_Type_Hint, Org_Periodapache_Periodfelix_Periodhttps_Periodenable, Org_Periodapache_Periodfelix_Periodhttps_Periodenable_At_Type_Hint, Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure, Org_Periodosgi_Periodservice_Periodhttp_Periodport_Periodsecure_At_Type_Hint, Context); end Post_Config_Apache_Felix_Jetty_Based_Http_Service; -- procedure Post_Config_Apache_Http_Components_Proxy_Configuration (Proxy_Periodhost : in Swagger.Nullable_UString; Proxy_Periodhost_At_Type_Hint : in Swagger.Nullable_UString; Proxy_Periodport : in Swagger.Nullable_Integer; Proxy_Periodport_At_Type_Hint : in Swagger.Nullable_UString; Proxy_Periodexceptions : in Swagger.UString_Vectors.Vector; Proxy_Periodexceptions_At_Type_Hint : in Swagger.Nullable_UString; Proxy_Periodenabled : in Swagger.Nullable_Boolean; Proxy_Periodenabled_At_Type_Hint : in Swagger.Nullable_UString; Proxy_Perioduser : in Swagger.Nullable_UString; Proxy_Perioduser_At_Type_Hint : in Swagger.Nullable_UString; Proxy_Periodpassword : in Swagger.Nullable_UString; Proxy_Periodpassword_At_Type_Hint : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Config_Apache_Http_Components_Proxy_Configuration (Proxy_Periodhost, Proxy_Periodhost_At_Type_Hint, Proxy_Periodport, Proxy_Periodport_At_Type_Hint, Proxy_Periodexceptions, Proxy_Periodexceptions_At_Type_Hint, Proxy_Periodenabled, Proxy_Periodenabled_At_Type_Hint, Proxy_Perioduser, Proxy_Perioduser_At_Type_Hint, Proxy_Periodpassword, Proxy_Periodpassword_At_Type_Hint, Context); end Post_Config_Apache_Http_Components_Proxy_Configuration; -- procedure Post_Config_Apache_Sling_Dav_Ex_Servlet (Alias : in Swagger.Nullable_UString; Alias_At_Type_Hint : in Swagger.Nullable_UString; Dav_Periodcreate_Absolute_Uri : in Swagger.Nullable_Boolean; Dav_Periodcreate_Absolute_Uri_At_Type_Hint : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Config_Apache_Sling_Dav_Ex_Servlet (Alias, Alias_At_Type_Hint, Dav_Periodcreate_Absolute_Uri, Dav_Periodcreate_Absolute_Uri_At_Type_Hint, Context); end Post_Config_Apache_Sling_Dav_Ex_Servlet; -- procedure Post_Config_Apache_Sling_Get_Servlet (Json_Periodmaximumresults : in Swagger.Nullable_UString; Json_Periodmaximumresults_At_Type_Hint : in Swagger.Nullable_UString; Enable_Periodhtml : in Swagger.Nullable_Boolean; Enable_Periodhtml_At_Type_Hint : in Swagger.Nullable_UString; Enable_Periodtxt : in Swagger.Nullable_Boolean; Enable_Periodtxt_At_Type_Hint : in Swagger.Nullable_UString; Enable_Periodxml : in Swagger.Nullable_Boolean; Enable_Periodxml_At_Type_Hint : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Config_Apache_Sling_Get_Servlet (Json_Periodmaximumresults, Json_Periodmaximumresults_At_Type_Hint, Enable_Periodhtml, Enable_Periodhtml_At_Type_Hint, Enable_Periodtxt, Enable_Periodtxt_At_Type_Hint, Enable_Periodxml, Enable_Periodxml_At_Type_Hint, Context); end Post_Config_Apache_Sling_Get_Servlet; -- procedure Post_Config_Apache_Sling_Referrer_Filter (Allow_Periodempty : in Swagger.Nullable_Boolean; Allow_Periodempty_At_Type_Hint : in Swagger.Nullable_UString; Allow_Periodhosts : in Swagger.Nullable_UString; Allow_Periodhosts_At_Type_Hint : in Swagger.Nullable_UString; Allow_Periodhosts_Periodregexp : in Swagger.Nullable_UString; Allow_Periodhosts_Periodregexp_At_Type_Hint : in Swagger.Nullable_UString; Filter_Periodmethods : in Swagger.Nullable_UString; Filter_Periodmethods_At_Type_Hint : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Config_Apache_Sling_Referrer_Filter (Allow_Periodempty, Allow_Periodempty_At_Type_Hint, Allow_Periodhosts, Allow_Periodhosts_At_Type_Hint, Allow_Periodhosts_Periodregexp, Allow_Periodhosts_Periodregexp_At_Type_Hint, Filter_Periodmethods, Filter_Periodmethods_At_Type_Hint, Context); end Post_Config_Apache_Sling_Referrer_Filter; -- procedure Post_Node (Path : in Swagger.UString; Name : in Swagger.UString; Operation : in Swagger.Nullable_UString; Delete_Authorizable : in Swagger.Nullable_UString; File : in Swagger.File_Part_Type; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Node (Path, Name, Operation, Delete_Authorizable, File, Context); end Post_Node; -- procedure Post_Node_Rw (Path : in Swagger.UString; Name : in Swagger.UString; Add_Members : in Swagger.Nullable_UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Node_Rw (Path, Name, Add_Members, Context); end Post_Node_Rw; -- procedure Post_Path (Path : in Swagger.UString; Jcr_Primary_Type : in Swagger.UString; Name : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Path (Path, Jcr_Primary_Type, Name, Context); end Post_Path; -- procedure Post_Query (Path : in Swagger.UString; P_Periodlimit : in Swagger.Number; 1_Property : in Swagger.UString; 1_Property_Periodvalue : in Swagger.UString; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Query (Path, P_Periodlimit, 1_Property, 1_Property_Periodvalue, Result, Context); end Post_Query; -- procedure Post_Tree_Activation (Ignoredeactivated : in Boolean; Onlymodified : in Boolean; Path : in Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Tree_Activation (Ignoredeactivated, Onlymodified, Path, Context); end Post_Tree_Activation; -- procedure Post_Truststore (Operation : in Swagger.Nullable_UString; New_Password : in Swagger.Nullable_UString; Re_Password : in Swagger.Nullable_UString; Key_Store_Type : in Swagger.Nullable_UString; Remove_Alias : in Swagger.Nullable_UString; Certificate : in Swagger.File_Part_Type; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Truststore (Operation, New_Password, Re_Password, Key_Store_Type, Remove_Alias, Certificate, Result, Context); end Post_Truststore; -- procedure Post_Truststore_P_K_C_S12 (Truststore_Periodp12 : in Swagger.File_Part_Type; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Post_Truststore_P_K_C_S12 (Truststore_Periodp12, Result, Context); end Post_Truststore_P_K_C_S12; end Server; end Shared_Instance; end .Skeletons;
sparre/Ada-2012-Examples
Ada
1,070
adb
with Ada.Containers.Synchronized_Queue_Interfaces; with Ada.Containers.Unbounded_Synchronized_Queues; with Ada.Text_IO; procedure Producer_Consumer_V1 is type Work_Item is range 1 .. 100; package Work_Item_Queue_Interfaces is new Ada.Containers.Synchronized_Queue_Interfaces (Element_Type => Work_Item); package Work_Item_Queues is new Ada.Containers.Unbounded_Synchronized_Queues (Queue_Interfaces => Work_Item_Queue_Interfaces); Queue : Work_Item_Queues.Queue; task type Producer; task type Consumer; Producers : array (1 .. 1) of Producer with Unreferenced; Consumers : array (1 .. 10) of Consumer with Unreferenced; task body Producer is begin for Item in Work_Item loop Queue.Enqueue (New_Item => Item); end loop; end Producer; task body Consumer is Item : Work_Item; begin loop Queue.Dequeue (Element => Item); Ada.Text_IO.Put_Line (Work_Item'Image (Item)); end loop; end Consumer; begin null; end Producer_Consumer_V1;
ekoeppen/STM32_Generic_Ada_Drivers
Ada
532
ads
with Ada.Interrupts; use Ada.Interrupts; with Ada.Real_Time; use Ada.Real_Time; generic Timer : STM32GD.Timer.Timer_Type; IRQ : Interrupt_ID; package STM32GD.Timer.Peripheral is procedure Init; procedure Stop; procedure After (Time : Time_Span; Callback : Timer_Callback_Type); procedure Every (Interval : Time_Span; Callback : Timer_Callback_Type); private protected IRQ_Handler is procedure Handler; pragma Attach_Handler (Handler, IRQ); end IRQ_Handler; end STM32GD.Timer.Peripheral;
reznikmm/clic
Ada
1,942
adb
with Ada.Text_IO; use Ada.Text_IO; with AAA.Strings; with CLIC.User_Input; use CLIC.User_Input; with GNAT.OS_Lib; package body CLIC_Ex.Commands.User_Input is function Valid_Number (Str : String) return Boolean is (for all C of Str => C in '0' .. '9'); ------------- -- Execute -- ------------- overriding procedure Execute (Cmd : in out Instance; Args : AAA.Strings.Vector) is begin if not Args.Is_Empty then Put_Line (Cmd.Name & " takes no arguments"); GNAT.OS_Lib.OS_Exit (1); end if; declare Answer : Answer_Kind; begin Answer := Query (Question => "Do you like this tool?", Valid => (others => True), Default => Yes); if Answer = No then Put_Line ("Fine then."); GNAT.OS_Lib.OS_Exit (42); end if; end; declare Languages : constant AAA.Strings.Vector := AAA.Strings.Empty_Vector .Append ("Ada") .Append ("C") .Append ("C++") .Append ("Rust") .Append ("OCAML") .Append ("Fortran") .Append ("Go"); Answer : Positive; begin Answer := Query_Multi (Question => "What is you favorite programming language?", Choices => Languages); if Answer /= 1 then Put_Line ("Wrong answer."); GNAT.OS_Lib.OS_Exit (42); end if; end; Continue_Or_Abort; declare Answer : constant String := Query_String (Question => "Enter a number please", Default => "42", Validation => Valid_Number'Access); begin Put_Line ("Thanks for your answer: '" & Answer & "'"); end; end Execute; end CLIC_Ex.Commands.User_Input;
francesco-bongiovanni/ewok-kernel
Ada
4,062
ads
-- -- Copyright 2018 The wookey project team <[email protected]> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- package soc.dma.interfaces with spark_mode => off is type t_dma_interrupts is (FIFO_ERROR, DIRECT_MODE_ERROR, TRANSFER_ERROR, HALF_COMPLETE, TRANSFER_COMPLETE); type t_config_mask is record handlers : boolean; buffer_in : boolean; buffer_out : boolean; buffer_size : boolean; mode : boolean; priority : boolean; direction : boolean; end record; for t_config_mask use record handlers at 0 range 0 .. 0; buffer_in at 0 range 1 .. 1; buffer_out at 0 range 2 .. 2; buffer_size at 0 range 3 .. 3; mode at 0 range 4 .. 4; priority at 0 range 5 .. 5; direction at 0 range 6 .. 6; end record; type t_mode is (DIRECT_MODE, FIFO_MODE, CIRCULAR_MODE); type t_transfer_dir is (PERIPHERAL_TO_MEMORY, MEMORY_TO_PERIPHERAL, MEMORY_TO_MEMORY); type t_priority_level is (LOW, MEDIUM, HIGH, VERY_HIGH); type t_data_size is (TRANSFER_BYTE, TRANSFER_HALF_WORD, TRANSFER_WORD); type t_burst_size is (SINGLE_TRANSFER, INCR_4_BEATS, INCR_8_BEATS, INCR_16_BEATS); type t_flow_controller is (DMA_FLOW_CONTROLLER, PERIPH_FLOW_CONTROLLER); type t_dma_config is record dma_id : soc.dma.t_dma_periph_index; stream : soc.dma.t_stream_index; channel : soc.dma.t_channel_index; bytes : unsigned_16; in_addr : system_address; in_priority : t_priority_level; in_handler : system_address; -- ISR out_addr : system_address; out_priority : t_priority_level; out_handler : system_address; -- ISR flow_controller : t_flow_controller; transfer_dir : t_transfer_dir; mode : t_mode; data_size : t_data_size; memory_inc : boolean; periph_inc : boolean; mem_burst_size : t_burst_size; periph_burst_size : t_burst_size; end record; procedure enable_stream (dma_id : in soc.dma.t_dma_periph_index; stream : in soc.dma.t_stream_index); procedure disable_stream (dma_id : in soc.dma.t_dma_periph_index; stream : in soc.dma.t_stream_index); procedure clear_interrupt (dma_id : in soc.dma.t_dma_periph_index; stream : in soc.dma.t_stream_index; interrupt : in t_dma_interrupts); procedure clear_all_interrupts (dma_id : in soc.dma.t_dma_periph_index; stream : in soc.dma.t_stream_index); function get_interrupt_status (dma_id : in soc.dma.t_dma_periph_index; stream : in soc.dma.t_stream_index) return t_dma_stream_int_status; procedure configure_stream (dma_id : in soc.dma.t_dma_periph_index; stream : in soc.dma.t_stream_index; user_config : in t_dma_config); -- FIXME - duplicate ewok.exported procedure reconfigure_stream (dma_id : in soc.dma.t_dma_periph_index; stream : in soc.dma.t_stream_index; user_config : in t_dma_config; -- FIXME - duplicate ewok.exported to_configure: in t_config_mask); procedure reset_stream (dma_id : in soc.dma.t_dma_periph_index; stream : in soc.dma.t_stream_index); end soc.dma.interfaces;
kontena/ruby-packer
Ada
10,963
adb
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-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.28 $ -- $Date: 2014/09/13 19:00:47 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Ada.Unchecked_Deallocation; with System.Address_To_Access_Conversions; -- | -- |===================================================================== -- | man page form_fieldtype.3x -- |===================================================================== -- | package body Terminal_Interface.Curses.Forms.Field_Types is use type System.Address; package Argument_Conversions is new System.Address_To_Access_Conversions (Argument); function Get_Fieldtype (F : Field) return C_Field_Type; pragma Import (C, Get_Fieldtype, "field_type"); function Get_Arg (F : Field) return System.Address; pragma Import (C, Get_Arg, "field_arg"); -- | -- |===================================================================== -- | man page form_field_validation.3x -- |===================================================================== -- | -- | -- | function Get_Type (Fld : Field) return Field_Type_Access is Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); Arg : Argument_Access; begin if Low_Level = Null_Field_Type then return null; else if Low_Level = M_Builtin_Router or else Low_Level = M_Generic_Type or else Low_Level = M_Choice_Router or else Low_Level = M_Generic_Choice then Arg := Argument_Access (Argument_Conversions.To_Pointer (Get_Arg (Fld))); if Arg = null then raise Form_Exception; else return Arg.all.Typ; end if; else raise Form_Exception; end if; end if; end Get_Type; function Copy_Arg (Usr : System.Address) return System.Address is begin return Usr; end Copy_Arg; procedure Free_Arg (Usr : System.Address) is procedure Free_Type is new Ada.Unchecked_Deallocation (Field_Type'Class, Field_Type_Access); procedure Freeargs is new Ada.Unchecked_Deallocation (Argument, Argument_Access); To_Be_Free : Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); Low_Level : C_Field_Type; begin if To_Be_Free /= null then if To_Be_Free.all.Usr /= System.Null_Address then Low_Level := To_Be_Free.all.Cft; if Low_Level.all.Freearg /= null then Low_Level.all.Freearg (To_Be_Free.all.Usr); end if; end if; if To_Be_Free.all.Typ /= null then Free_Type (To_Be_Free.all.Typ); end if; Freeargs (To_Be_Free); end if; end Free_Arg; procedure Wrap_Builtin (Fld : Field; Typ : Field_Type'Class; Cft : C_Field_Type := C_Builtin_Router) is Usr_Arg : constant System.Address := Get_Arg (Fld); Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); Arg : Argument_Access; function Set_Fld_Type (F : Field := Fld; Cf : C_Field_Type := Cft; Arg1 : Argument_Access) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_user"); begin pragma Assert (Low_Level /= Null_Field_Type); if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then raise Form_Exception; else Arg := new Argument'(Usr => System.Null_Address, Typ => new Field_Type'Class'(Typ), Cft => Get_Fieldtype (Fld)); if Usr_Arg /= System.Null_Address then if Low_Level.all.Copyarg /= null then Arg.all.Usr := Low_Level.all.Copyarg (Usr_Arg); else Arg.all.Usr := Usr_Arg; end if; end if; Eti_Exception (Set_Fld_Type (Arg1 => Arg)); end if; end Wrap_Builtin; function Field_Check_Router (Fld : Field; Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type and then Arg.all.Typ /= null); if Arg.all.Cft.all.Fcheck /= null then return Arg.all.Cft.all.Fcheck (Fld, Arg.all.Usr); else return 1; end if; end Field_Check_Router; function Char_Check_Router (Ch : C_Int; Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type and then Arg.all.Typ /= null); if Arg.all.Cft.all.Ccheck /= null then return Arg.all.Cft.all.Ccheck (Ch, Arg.all.Usr); else return 1; end if; end Char_Check_Router; function Next_Router (Fld : Field; Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type and then Arg.all.Typ /= null); if Arg.all.Cft.all.Next /= null then return Arg.all.Cft.all.Next (Fld, Arg.all.Usr); else return 1; end if; end Next_Router; function Prev_Router (Fld : Field; Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type and then Arg.all.Typ /= null); if Arg.all.Cft.all.Prev /= null then return Arg.all.Cft.all.Prev (Fld, Arg.all.Usr); else return 1; end if; end Prev_Router; -- ----------------------------------------------------------------------- -- function C_Builtin_Router return C_Field_Type is T : C_Field_Type; begin if M_Builtin_Router = Null_Field_Type then T := New_Fieldtype (Field_Check_Router'Access, Char_Check_Router'Access); if T = Null_Field_Type then raise Form_Exception; else Eti_Exception (Set_Fieldtype_Arg (T, Make_Arg'Access, Copy_Arg'Access, Free_Arg'Access)); end if; M_Builtin_Router := T; end if; pragma Assert (M_Builtin_Router /= Null_Field_Type); return M_Builtin_Router; end C_Builtin_Router; -- ----------------------------------------------------------------------- -- function C_Choice_Router return C_Field_Type is T : C_Field_Type; begin if M_Choice_Router = Null_Field_Type then T := New_Fieldtype (Field_Check_Router'Access, Char_Check_Router'Access); if T = Null_Field_Type then raise Form_Exception; else Eti_Exception (Set_Fieldtype_Arg (T, Make_Arg'Access, Copy_Arg'Access, Free_Arg'Access)); Eti_Exception (Set_Fieldtype_Choice (T, Next_Router'Access, Prev_Router'Access)); end if; M_Choice_Router := T; end if; pragma Assert (M_Choice_Router /= Null_Field_Type); return M_Choice_Router; end C_Choice_Router; end Terminal_Interface.Curses.Forms.Field_Types;
onox/orka
Ada
1,683
ads
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2016 onox <[email protected]> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with Orka.SIMD.SSE2.Doubles; package Orka.SIMD.SSE3.Doubles.Arithmetic is pragma Pure; use Orka.SIMD.SSE2.Doubles; function Add_Subtract (Left, Right : m128d) return m128d with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_addsubpd"; -- Subtract the doubles in the lower half and add the doubles in -- the upper half function Horizontal_Add (Left, Right : m128d) return m128d with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_haddpd"; -- Compute the sum of the two doubles in Left and store it in the -- lower half of the result. Store the sum of Right in the upper half. function Horizontal_Subtract (Left, Right : m128d) return m128d with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_hsubpd"; -- Compute the difference of the two doubles in Left and store the -- result in the lower half of the result. Store the difference of Right -- in the upper half. end Orka.SIMD.SSE3.Doubles.Arithmetic;
docandrew/troodon
Ada
18,937
ads
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with System; with stddef_h; with Interfaces.C.Strings; with bits_types_locale_t_h; package string_h is -- arg-macro: function strdupa (s) -- return __extension__ ({ const char *__old := (s); size_t __len := strlen (__old) + 1; char *__new := (char *) __builtin_alloca (__len); (char *) memcpy (__new, __old, __len); }); -- arg-macro: function strndupa (s, n) -- return __extension__ ({ const char *__old := (s); size_t __len := strnlen (__old, (n)); char *__new := (char *) __builtin_alloca (__len + 1); __new(__len) := Character'Val (0); (char *) memcpy (__new, __old, __len); }); -- Copyright (C) 1991-2021 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- The GNU C Library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, see -- <https://www.gnu.org/licenses/>. -- * ISO C99 Standard: 7.21 String handling <string.h> -- -- Get size_t and NULL from <stddef.h>. -- Tell the caller that we provide correct C++ prototypes. -- Copy N bytes of SRC to DEST. function memcpy (uu_dest : System.Address; uu_src : System.Address; uu_n : stddef_h.size_t) return System.Address -- /usr/include/string.h:43 with Import => True, Convention => C, External_Name => "memcpy"; -- Copy N bytes of SRC to DEST, guaranteeing -- correct behavior for overlapping strings. function memmove (uu_dest : System.Address; uu_src : System.Address; uu_n : stddef_h.size_t) return System.Address -- /usr/include/string.h:47 with Import => True, Convention => C, External_Name => "memmove"; -- Copy no more than N bytes of SRC to DEST, stopping when C is found. -- Return the position in DEST one byte past where C was copied, -- or NULL if C was not found in the first N bytes of SRC. function memccpy (uu_dest : System.Address; uu_src : System.Address; uu_c : int; uu_n : stddef_h.size_t) return System.Address -- /usr/include/string.h:54 with Import => True, Convention => C, External_Name => "memccpy"; -- Set N bytes of S to C. function memset (uu_s : System.Address; uu_c : int; uu_n : stddef_h.size_t) return System.Address -- /usr/include/string.h:61 with Import => True, Convention => C, External_Name => "memset"; -- Compare N bytes of S1 and S2. function memcmp (uu_s1 : System.Address; uu_s2 : System.Address; uu_n : stddef_h.size_t) return int -- /usr/include/string.h:64 with Import => True, Convention => C, External_Name => "memcmp"; -- Search N bytes of S for C. function memchr (uu_s : System.Address; uu_c : int; uu_n : stddef_h.size_t) return System.Address -- /usr/include/string.h:71 with Import => True, Convention => C, External_Name => "memchr"; -- Search in S for C. This is similar to `memchr' but there is no -- length limit. function rawmemchr (uu_s : System.Address; uu_c : int) return System.Address -- /usr/include/string.h:99 with Import => True, Convention => C, External_Name => "rawmemchr"; -- Search N bytes of S for the final occurrence of C. function memrchr (uu_s : System.Address; uu_c : int; uu_n : stddef_h.size_t) return System.Address -- /usr/include/string.h:110 with Import => True, Convention => C, External_Name => "memrchr"; -- Copy SRC to DEST. function strcpy (uu_dest : Interfaces.C.Strings.chars_ptr; uu_src : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:125 with Import => True, Convention => C, External_Name => "strcpy"; -- Copy no more than N characters of SRC to DEST. function strncpy (uu_dest : Interfaces.C.Strings.chars_ptr; uu_src : Interfaces.C.Strings.chars_ptr; uu_n : stddef_h.size_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:128 with Import => True, Convention => C, External_Name => "strncpy"; -- Append SRC onto DEST. function strcat (uu_dest : Interfaces.C.Strings.chars_ptr; uu_src : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:133 with Import => True, Convention => C, External_Name => "strcat"; -- Append no more than N characters from SRC onto DEST. function strncat (uu_dest : Interfaces.C.Strings.chars_ptr; uu_src : Interfaces.C.Strings.chars_ptr; uu_n : stddef_h.size_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:136 with Import => True, Convention => C, External_Name => "strncat"; -- Compare S1 and S2. function strcmp (uu_s1 : Interfaces.C.Strings.chars_ptr; uu_s2 : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/string.h:140 with Import => True, Convention => C, External_Name => "strcmp"; -- Compare N characters of S1 and S2. function strncmp (uu_s1 : Interfaces.C.Strings.chars_ptr; uu_s2 : Interfaces.C.Strings.chars_ptr; uu_n : stddef_h.size_t) return int -- /usr/include/string.h:143 with Import => True, Convention => C, External_Name => "strncmp"; -- Compare the collated forms of S1 and S2. function strcoll (uu_s1 : Interfaces.C.Strings.chars_ptr; uu_s2 : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/string.h:147 with Import => True, Convention => C, External_Name => "strcoll"; -- Put a transformation of SRC into no more than N bytes of DEST. function strxfrm (uu_dest : Interfaces.C.Strings.chars_ptr; uu_src : Interfaces.C.Strings.chars_ptr; uu_n : stddef_h.size_t) return stddef_h.size_t -- /usr/include/string.h:150 with Import => True, Convention => C, External_Name => "strxfrm"; -- POSIX.1-2008 extended locale interface (see locale.h). -- Compare the collated forms of S1 and S2, using sorting rules from L. function strcoll_l (uu_s1 : Interfaces.C.Strings.chars_ptr; uu_s2 : Interfaces.C.Strings.chars_ptr; uu_l : bits_types_locale_t_h.locale_t) return int -- /usr/include/string.h:159 with Import => True, Convention => C, External_Name => "strcoll_l"; -- Put a transformation of SRC into no more than N bytes of DEST, -- using sorting rules from L. function strxfrm_l (uu_dest : Interfaces.C.Strings.chars_ptr; uu_src : Interfaces.C.Strings.chars_ptr; uu_n : stddef_h.size_t; uu_l : bits_types_locale_t_h.locale_t) return stddef_h.size_t -- /usr/include/string.h:163 with Import => True, Convention => C, External_Name => "strxfrm_l"; -- Duplicate S, returning an identical malloc'd string. function strdup (uu_s : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:171 with Import => True, Convention => C, External_Name => "strdup"; -- Return a malloc'd copy of at most N bytes of STRING. The -- resultant string is terminated even if no null terminator -- appears before STRING[N]. function strndup (uu_string : Interfaces.C.Strings.chars_ptr; uu_n : stddef_h.size_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:179 with Import => True, Convention => C, External_Name => "strndup"; -- Duplicate S, returning an identical alloca'd string. -- Return an alloca'd copy of at most N bytes of string. -- Find the first occurrence of C in S. function strchr (uu_s : Interfaces.C.Strings.chars_ptr; uu_c : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:210 with Import => True, Convention => C, External_Name => "strchr"; -- Find the last occurrence of C in S. function strrchr (uu_s : Interfaces.C.Strings.chars_ptr; uu_c : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:237 with Import => True, Convention => C, External_Name => "strrchr"; -- This function is similar to `strchr'. But it returns a pointer to -- the closing NUL byte in case C is not found in S. function strchrnul (uu_s : Interfaces.C.Strings.chars_ptr; uu_c : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:265 with Import => True, Convention => C, External_Name => "strchrnul"; -- Return the length of the initial segment of S which -- consists entirely of characters not in REJECT. function strcspn (uu_s : Interfaces.C.Strings.chars_ptr; uu_reject : Interfaces.C.Strings.chars_ptr) return stddef_h.size_t -- /usr/include/string.h:277 with Import => True, Convention => C, External_Name => "strcspn"; -- Return the length of the initial segment of S which -- consists entirely of characters in ACCEPT. function strspn (uu_s : Interfaces.C.Strings.chars_ptr; uu_accept : Interfaces.C.Strings.chars_ptr) return stddef_h.size_t -- /usr/include/string.h:281 with Import => True, Convention => C, External_Name => "strspn"; -- Find the first occurrence in S of any character in ACCEPT. function strpbrk (uu_s : Interfaces.C.Strings.chars_ptr; uu_accept : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:287 with Import => True, Convention => C, External_Name => "strpbrk"; -- Find the first occurrence of NEEDLE in HAYSTACK. function strstr (uu_haystack : Interfaces.C.Strings.chars_ptr; uu_needle : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:314 with Import => True, Convention => C, External_Name => "strstr"; -- Divide S into tokens separated by characters in DELIM. function strtok (uu_s : Interfaces.C.Strings.chars_ptr; uu_delim : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:340 with Import => True, Convention => C, External_Name => "strtok"; -- Divide S into tokens separated by characters in DELIM. Information -- passed between calls are stored in SAVE_PTR. -- skipped func __strtok_r function strtok_r (uu_s : Interfaces.C.Strings.chars_ptr; uu_delim : Interfaces.C.Strings.chars_ptr; uu_save_ptr : System.Address) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:350 with Import => True, Convention => C, External_Name => "strtok_r"; -- Similar to `strstr' but this function ignores the case of both strings. function strcasestr (uu_haystack : Interfaces.C.Strings.chars_ptr; uu_needle : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:358 with Import => True, Convention => C, External_Name => "strcasestr"; -- Find the first occurrence of NEEDLE in HAYSTACK. -- NEEDLE is NEEDLELEN bytes long; -- HAYSTACK is HAYSTACKLEN bytes long. function memmem (uu_haystack : System.Address; uu_haystacklen : stddef_h.size_t; uu_needle : System.Address; uu_needlelen : stddef_h.size_t) return System.Address -- /usr/include/string.h:373 with Import => True, Convention => C, External_Name => "memmem"; -- Copy N bytes of SRC to DEST, return pointer to bytes after the -- last written byte. -- skipped func __mempcpy function mempcpy (uu_dest : System.Address; uu_src : System.Address; uu_n : stddef_h.size_t) return System.Address -- /usr/include/string.h:384 with Import => True, Convention => C, External_Name => "mempcpy"; -- Return the length of S. function strlen (uu_s : Interfaces.C.Strings.chars_ptr) return stddef_h.size_t -- /usr/include/string.h:391 with Import => True, Convention => C, External_Name => "strlen"; -- Find the length of STRING, but scan at most MAXLEN characters. -- If no '\0' terminator is found in that many characters, return MAXLEN. function strnlen (uu_string : Interfaces.C.Strings.chars_ptr; uu_maxlen : stddef_h.size_t) return stddef_h.size_t -- /usr/include/string.h:397 with Import => True, Convention => C, External_Name => "strnlen"; -- Return a string describing the meaning of the `errno' code in ERRNUM. function strerror (uu_errnum : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:403 with Import => True, Convention => C, External_Name => "strerror"; -- Reentrant version of `strerror'. -- There are 2 flavors of `strerror_r', GNU which returns the string -- and may or may not use the supplied temporary buffer and POSIX one -- which fills the string into the buffer. -- To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L -- without -D_GNU_SOURCE is needed, otherwise the GNU version is -- preferred. -- Fill BUF with a string describing the meaning of the `errno' code in -- ERRNUM. -- If a temporary buffer is required, at most BUFLEN bytes of BUF will be -- used. function strerror_r (uu_errnum : int; uu_buf : Interfaces.C.Strings.chars_ptr; uu_buflen : stddef_h.size_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:428 with Import => True, Convention => C, External_Name => "strerror_r"; -- Return a string describing the meaning of tthe error in ERR. function strerrordesc_np (uu_err : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:434 with Import => True, Convention => C, External_Name => "strerrordesc_np"; -- Return a string with the error name in ERR. function strerrorname_np (uu_err : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:436 with Import => True, Convention => C, External_Name => "strerrorname_np"; -- Translate error number to string according to the locale L. function strerror_l (uu_errnum : int; uu_l : bits_types_locale_t_h.locale_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:442 with Import => True, Convention => C, External_Name => "strerror_l"; -- Set N bytes of S to 0. The compiler will not delete a call to this -- function, even if S is dead after the call. procedure explicit_bzero (uu_s : System.Address; uu_n : stddef_h.size_t) -- /usr/include/string.h:450 with Import => True, Convention => C, External_Name => "explicit_bzero"; -- Return the next DELIM-delimited token from *STRINGP, -- terminating it with a '\0', and update *STRINGP to point past it. function strsep (uu_stringp : System.Address; uu_delim : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:455 with Import => True, Convention => C, External_Name => "strsep"; -- Return a string describing the meaning of the signal number in SIG. function strsignal (uu_sig : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:462 with Import => True, Convention => C, External_Name => "strsignal"; -- Return an abbreviation string for the signal number SIG. function sigabbrev_np (uu_sig : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:466 with Import => True, Convention => C, External_Name => "sigabbrev_np"; -- Return a string describing the meaning of the signal number in SIG, -- the result is not translated. function sigdescr_np (uu_sig : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:469 with Import => True, Convention => C, External_Name => "sigdescr_np"; -- Copy SRC to DEST, returning the address of the terminating '\0' in DEST. -- skipped func __stpcpy function stpcpy (uu_dest : Interfaces.C.Strings.chars_ptr; uu_src : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:475 with Import => True, Convention => C, External_Name => "stpcpy"; -- Copy no more than N characters of SRC to DEST, returning the address of -- the last character written into DEST. -- skipped func __stpncpy function stpncpy (uu_dest : Interfaces.C.Strings.chars_ptr; uu_src : Interfaces.C.Strings.chars_ptr; uu_n : stddef_h.size_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:483 with Import => True, Convention => C, External_Name => "stpncpy"; -- Compare S1 and S2 as strings holding name & indices/version numbers. function strverscmp (uu_s1 : Interfaces.C.Strings.chars_ptr; uu_s2 : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/string.h:490 with Import => True, Convention => C, External_Name => "strverscmp"; -- Sautee STRING briskly. function strfry (uu_string : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:494 with Import => True, Convention => C, External_Name => "strfry"; -- Frobnicate N bytes of S. function memfrob (uu_s : System.Address; uu_n : stddef_h.size_t) return System.Address -- /usr/include/string.h:497 with Import => True, Convention => C, External_Name => "memfrob"; -- Return the file name within directory of FILENAME. We don't -- declare the function if the `basename' macro is available (defined -- in <libgen.h>) which makes the XPG version of this function -- available. function basename (uu_filename : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/string.h:506 with Import => True, Convention => C, External_Name => "basename"; -- Functions with security checks. end string_h;
optikos/ada-lsp
Ada
1,142
adb
-- Copyright (c) 2017 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body LSP.Notification_Dispatchers is -------------- -- Dispatch -- -------------- not overriding procedure Dispatch (Self : in out Notification_Dispatcher; Method : LSP.Types.LSP_String; Stream : access Ada.Streams.Root_Stream_Type'Class; Handler : not null LSP.Message_Handlers.Notification_Handler_Access) is Cursor : Maps.Cursor := Self.Map.Find (Method); begin if not Maps.Has_Element (Cursor) then Cursor := Self.Map.Find (League.Strings.Empty_Universal_String); end if; Maps.Element (Cursor) (Stream, Handler); end Dispatch; -------------- -- Register -- -------------- not overriding procedure Register (Self : in out Notification_Dispatcher; Method : League.Strings.Universal_String; Value : Parameter_Handler_Access) is begin Self.Map.Insert (Method, Value); end Register; end LSP.Notification_Dispatchers;
zhmu/ananas
Ada
99
ads
with Slice8_Pkg2; package Slice8_Pkg1 is new Slice8_Pkg2 (Line_Length => 132, Max_Lines => 1000);
ecofast/asphyre-cpp
Ada
4,451
ads
---------------------------------------------------------------- -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2003 Dmitriy Anisimkov -- -- -- -- Open source license information is in the zlib.ads file. -- ---------------------------------------------------------------- -- $Id: zlib-streams.ads,v 1.1 2010/08/18 14:11:29 Administrator Exp $ package ZLib.Streams is type Stream_Mode is (In_Stream, Out_Stream, Duplex); type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class; type Stream_Type is new Ada.Streams.Root_Stream_Type with private; procedure Read (Stream : in out Stream_Type; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); procedure Write (Stream : in out Stream_Type; Item : in Ada.Streams.Stream_Element_Array); procedure Flush (Stream : in out Stream_Type; Mode : in Flush_Mode := Sync_Flush); -- Flush the written data to the back stream, -- all data placed to the compressor is flushing to the Back stream. -- Should not be used untill necessary, becouse it is decreasing -- compression. function Read_Total_In (Stream : in Stream_Type) return Count; pragma Inline (Read_Total_In); -- Return total number of bytes read from back stream so far. function Read_Total_Out (Stream : in Stream_Type) return Count; pragma Inline (Read_Total_Out); -- Return total number of bytes read so far. function Write_Total_In (Stream : in Stream_Type) return Count; pragma Inline (Write_Total_In); -- Return total number of bytes written so far. function Write_Total_Out (Stream : in Stream_Type) return Count; pragma Inline (Write_Total_Out); -- Return total number of bytes written to the back stream. procedure Create (Stream : out Stream_Type; Mode : in Stream_Mode; Back : in Stream_Access; Back_Compressed : in Boolean; Level : in Compression_Level := Default_Compression; Strategy : in Strategy_Type := Default_Strategy; Header : in Header_Type := Default; Read_Buffer_Size : in Ada.Streams.Stream_Element_Offset := Default_Buffer_Size; Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset := Default_Buffer_Size); -- Create the Comression/Decompression stream. -- If mode is In_Stream then Write operation is disabled. -- If mode is Out_Stream then Read operation is disabled. -- If Back_Compressed is true then -- Data written to the Stream is compressing to the Back stream -- and data read from the Stream is decompressed data from the Back stream. -- If Back_Compressed is false then -- Data written to the Stream is decompressing to the Back stream -- and data read from the Stream is compressed data from the Back stream. -- !!! When the Need_Header is False ZLib-Ada is using undocumented -- ZLib 1.1.4 functionality to do not create/wait for ZLib headers. function Is_Open (Stream : Stream_Type) return Boolean; procedure Close (Stream : in out Stream_Type); private use Ada.Streams; type Buffer_Access is access all Stream_Element_Array; type Stream_Type is new Root_Stream_Type with record Mode : Stream_Mode; Buffer : Buffer_Access; Rest_First : Stream_Element_Offset; Rest_Last : Stream_Element_Offset; -- Buffer for Read operation. -- We need to have this buffer in the record -- becouse not all read data from back stream -- could be processed during the read operation. Buffer_Size : Stream_Element_Offset; -- Buffer size for write operation. -- We do not need to have this buffer -- in the record becouse all data could be -- processed in the write operation. Back : Stream_Access; Reader : Filter_Type; Writer : Filter_Type; end record; end ZLib.Streams;
AdaCore/libadalang
Ada
100
ads
with G_Vars; generic with package Vars is new G_Vars; package G_Solver_Ifc is end G_Solver_Ifc;
stcarrez/ada-enet
Ada
4,503
adb
----------------------------------------------------------------------- -- net-protos-Ipv4 -- IPv4 Network protocol -- Copyright (C) 2016, 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Net.Protos.Arp; package body Net.Protos.IPv4 is use type Net.Protos.Arp.Arp_Status; Packet_Id : Uint16 := 1; -- ------------------------------ -- Send the raw IPv4 packet to the interface. The destination Ethernet address is -- resolved from the ARP table and the packet Ethernet header updated. The packet -- is send immediately when the destination Ethernet address is known, otherwise -- it is queued and sent when the ARP resolution is successful. -- ------------------------------ procedure Send_Raw (Ifnet : in out Net.Interfaces.Ifnet_Type'Class; Target_Ip : in Ip_Addr; Packet : in out Net.Buffers.Buffer_Type; Status : out Error_Code) is Ether : constant Net.Headers.Ether_Header_Access := Packet.Ethernet; Arp_Status : Net.Protos.Arp.Arp_Status; begin Ether.Ether_Shost := Ifnet.Mac; Ether.Ether_Type := Net.Headers.To_Network (Net.Protos.ETHERTYPE_IP); if Ifnet.Is_Local_Network (Target_Ip) then Net.Protos.Arp.Resolve (Ifnet, Target_Ip, Ether.Ether_Dhost, Packet, Arp_Status); elsif Ifnet.Gateway /= (0, 0, 0, 0) then Net.Protos.Arp.Resolve (Ifnet, Ifnet.Gateway, Ether.Ether_Dhost, Packet, Arp_Status); else Arp_Status := Net.Protos.Arp.ARP_UNREACHABLE; end if; case Arp_Status is when Net.Protos.Arp.ARP_FOUND => Ifnet.Send (Packet); Status := EOK; when Net.Protos.Arp.ARP_PENDING | Net.Protos.Arp.ARP_NEEDED => Status := EINPROGRESS; when Net.Protos.Arp.ARP_UNREACHABLE | Net.Protos.Arp.ARP_QUEUE_FULL => Net.Buffers.Release (Packet); Status := ENETUNREACH; end case; end Send_Raw; -- ------------------------------ -- Make an IP packet identifier. -- ------------------------------ procedure Make_Ident (Ip : in Net.Headers.IP_Header_Access) is begin Ip.Ip_Id := Net.Headers.To_Network (Packet_Id); Packet_Id := Packet_Id + 1; end Make_Ident; -- ------------------------------ -- Make the IPv4 header for the source and destination IP addresses and protocol. -- ------------------------------ procedure Make_Header (Ip : in Net.Headers.IP_Header_Access; Src : in Ip_Addr; Dst : in Ip_Addr; Proto : in Uint8; Length : in Uint16) is begin Ip.Ip_Ihl := 16#45#; Ip.Ip_Tos := 0; Ip.Ip_Off := Net.Headers.To_Network (16#4000#); Ip.Ip_Ttl := 64; Ip.Ip_Sum := 0; Ip.Ip_Src := Src; Ip.Ip_Dst := Dst; Ip.Ip_P := Proto; Ip.Ip_Len := Net.Headers.To_Network (Length); Make_Ident (Ip); end Make_Header; procedure Send (Ifnet : in out Net.Interfaces.Ifnet_Type'Class; Target_Ip : in Ip_Addr; Packet : in out Net.Buffers.Buffer_Type; Status : out Error_Code) is Ip : constant Net.Headers.IP_Header_Access := Packet.IP; begin Make_Header (Ip, Ifnet.Ip, Target_Ip, P_UDP, Packet.Get_Length); Ip.Ip_Ihl := 4; Ip.Ip_Tos := 0; Ip.Ip_Id := 2; Ip.Ip_Off := 0; Ip.Ip_Ttl := 255; Ip.Ip_Sum := 0; Ip.Ip_Src := Ifnet.Ip; Ip.Ip_Dst := Target_Ip; Ip.Ip_P := 4; -- Ip.Ip_Len := Net.Headers.To_Network (Packet.Get_Length); -- if Ifnet.Is_Local_Address (Target_Ip) then Send_Raw (Ifnet, Target_Ip, Packet, Status); end Send; end Net.Protos.IPv4;
reznikmm/matreshka
Ada
3,689
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Form_Title_Attributes is pragma Preelaborate; type ODF_Form_Title_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Form_Title_Attribute_Access is access all ODF_Form_Title_Attribute'Class with Storage_Size => 0; end ODF.DOM.Form_Title_Attributes;
leo-brewin/adm-bssn-numerical
Ada
104
ads
package BSSNBase.Initial is procedure create_data; procedure create_grid; end BSSNBase.Initial;
BrickBot/Bound-T-H8-300
Ada
36,152
ads
-- Output (decl) -- -- Output of basic results, notes, warnings and errors. -- -- A component of the Bound-T Worst-Case Execution Time Tool. -- ------------------------------------------------------------------------------- -- Copyright (c) 1999 .. 2015 Tidorum Ltd -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- 1. Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- 2. Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- -- 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. -- -- Other modules (files) of this software composition should contain their -- own copyright statements, which may have different copyright and usage -- conditions. The above conditions apply to this file. ------------------------------------------------------------------------------- -- -- $Revision: 1.32 $ -- $Date: 2015/10/24 19:36:51 $ -- -- $Log: output.ads,v $ -- Revision 1.32 2015/10/24 19:36:51 niklas -- Moved to free licence. -- -- Revision 1.31 2013-11-27 11:44:42 niklas -- Added Locus (Code_Address_T) return Statement_Locus_T. -- -- Revision 1.30 2011-08-31 04:23:34 niklas -- BT-CH-0222: Option registry. Option -dump. External help files. -- -- Revision 1.29 2009/05/21 08:08:27 niklas -- BT-CH-0175: Limits on the number of Warnings, Errors, Faults. -- -- Revision 1.28 2009/03/24 07:48:35 niklas -- BT-CH-0166: String_Pool.Item_T for source-file and marker names. -- -- Revision 1.27 2009/03/21 13:09:17 niklas -- BT-CH-0165: Option -file_match for matching asserted file-names. -- -- Revision 1.26 2008/11/09 21:43:04 niklas -- BT-CH-0158: Output.Image (Time_T) replaces Programs.Execution.Image. -- -- Revision 1.25 2008/02/15 20:27:43 niklas -- BT-CH-0110: Better "&" for call-paths in Output loci. -- -- Revision 1.24 2007/10/26 12:44:36 niklas -- BT-CH-0091: Reanalyse a boundable edge only if its domain grows. -- -- Revision 1.23 2007/04/30 06:39:55 niklas -- Made No_Mark public and the default initial value. -- -- Revision 1.22 2006/06/16 14:51:13 niklas -- Published the function Formed_Source with a Default value -- for the Form parameter. -- -- Revision 1.21 2006/05/17 20:07:13 niklas -- Added the function Source_File_Item. -- -- Revision 1.20 2006/02/28 08:47:15 niklas -- Extended the option -source (Output.Opt.Source_File_Form) to -- apply also to the name of the target program executable file. -- Thus, the function Program_File (Locus) now takes also a -- Form parameter and applies Formed_Source to the file-name. -- -- Revision 1.19 2005/10/26 14:11:30 niklas -- Using Basic_Output. -- -- Revision 1.18 2005/10/09 08:10:22 niklas -- BT-CH-0013. -- -- Revision 1.17 2005/08/24 10:06:50 niklas -- Added an "Address" parameter (Boolean option) to the Image -- functions for Statement_Locus_T, Statement_Range_T and -- Source_Interval_T. This lets clients force the display of -- code addresses in warnings and errors that need it, as if -- the option -address were in effect. -- -- Revision 1.16 2005/08/08 17:42:04 niklas -- Added functions First and Last to get the line-number range -- directly from a Statement Range. -- -- Revision 1.15 2005/06/29 09:33:45 niklas -- Added the Heading procedure. -- -- Revision 1.14 2005/06/28 07:02:21 niklas -- Added function Code_Image. -- -- Revision 1.13 2004/04/25 09:29:45 niklas -- First Tidorum version. -- Multiple source files per location ("See_Also" lines). -- Options for source-file name form (full path or basename). -- Inexact source-line matching (surrounding lines). -- Operations for tracing output ("Trace" lines). -- Additional control over "Result" and "Unknown" output. -- Caching of current default locus computed from locus nest. -- -- Revision 1.12 2001/12/10 14:43:11 holsti -- Locus-nest marks have a "Defined" attribute to avoid accessing -- undefined (uninitialized) marks. -- -- Revision 1.11 2001/03/21 20:12:46 holsti -- Program locations given by Locus_T. -- -- Revision 1.10 2000/12/28 12:35:07 holsti -- Image for Integer added. -- -- Revision 1.9 2000/11/24 12:06:01 sihvo -- Added stack height analysis. -- -- Revision 1.8 2000/11/09 14:44:31 saarinen -- Added function Get_Subprogram. -- -- Revision 1.7 2000/10/26 09:30:01 saarinen -- Added procedures Wcet, Wcet_Call, Unknown and Loop_Bound. -- -- Revision 1.6 2000/06/27 20:05:28 holsti -- Added procedure Fault. -- -- Revision 1.5 2000/05/02 10:53:01 holsti -- Field_Separator is provided by Output, too. -- -- Revision 1.4 2000/04/24 18:36:20 holsti -- Added Subprogram field. -- -- Revision 1.3 2000/04/24 14:28:39 holsti -- Symbol scopes added. -- -- Revision 1.2 2000/04/23 21:41:17 holsti -- Added Flow package. -- -- Revision 1.1 2000/04/22 12:08:28 holsti -- Output package added. -- with Ada.Text_IO; with Ada.Exceptions; with Basic_Output; with Processor; with String_Pool; with Symbols; package Output is -- -- The "basic output format" consists of lines divided into fields. -- Fields are separated by a reserved character (by default the -- colon ':', settable). -- -- The first five fields have a fixed meaning as follows: -- -- Field 1 Key string, e.g. "Warning" that defines the type -- of output line and the interpretation of the variable -- fields (starting from field 5). -- -- Field 2 Name of target-program executable file. -- -- Field 3 Name of target-program source-code file (if known and relevant). -- -- Field 4 Name of subprogram (if known and relevant), or a call-path -- containing the names of several subprograms in top-down -- calling order, with the location of each call indicated. -- The last, or bottom, subprogram in the call-path is the one -- to which this output line most directly applies. -- -- Field 5 Statement(s) in the target-program. A statement or instruction -- is located by a line number in the source-code file and/or -- a code address. This may be a single statement (in the case -- of a call instruction, for example), or a range of statements -- (corresponding to a subprogram or a loop, for example). -- -- When field 4 contains a call-path, the higher-level subprograms in -- the path may reside in different source files than the bottom subprogram. -- Fields 3 and 5 apply to the bottom subprogram. The call-path (field 4) -- may contain embedded statement locators (and perhaps source=file names) -- for the higher levels. -- -- In some cases, even the bottom subprogram - or other program part to -- which the output line applies - is related to more than one source-code -- file and statement range. When this happens, additional output lines -- are emitted with "See_Also" in the key field (field 1), the same -- contents in fields 2 and 4, and the other source-code file(s) and -- statement ranges in fields 3 and 5. No other fields are emitted for -- these See_Also lines. -- -- The form and meaning of the remaining "data" fields (6 .. N) depend -- on the type of output line, i.e. on the value in field 1. Field_Separator : Character renames Basic_Output.Field_Separator; -- -- The character that separates fields in basic-format output lines. -- --- Locus for locating elements of a program -- type Locus_T is private; -- -- A locus defines a element, place or region of the target program -- under analysis. Its attributes include the data necessary to generate -- fields 2 through 5 for a basic-output line. -- -- Each field may (separately) be undefined or more or less precisely -- defined. Operations are provided to create loci with specific -- field values, to query the fields, and to combine two loci into a -- new locus value that uses the most precisely defined data from both -- original loci. -- -- The operations for generating basic-output lines take a locus -- parameter, which usually defines the output locus fields fully. -- -- However, to avoid transporting locus parameters from specific -- contexts to general routines where output may be generated in -- exceptional cases (errors, warnings) a system of default loci is -- implemented. The default loci are nested, so that new defaults can -- be pushed and popped. -- -- The displayed locus of a basic-output line is derived from the current -- default loci, with more recently pushed loci overriding or focussing -- the older ones, and with the locus parameter having the final say. No_Locus : constant Locus_T; -- -- A locus that is completely undefined. -- --- Statement locus -- subtype Line_Number_T is Symbols.Line_Number_T; -- -- The number of a line in a source (text) file. -- The first line is number 1 (for zero, see No_Line_Number). No_Line_Number : constant Line_Number_T := Line_Number_T'First; -- -- This "line number" represents an unknown or irrelevant line-number. type Statement_Locus_T is private; -- -- A statement locus locates a statement by its code address -- and/or a source-line number in a specific source-file. -- It may contain a (reference to) a symbol-table, for later -- improvement or widening of the mapping between code addresses -- and source-line numbers. No_Statement : constant Statement_Locus_T; -- -- Indicates a missing or unknown statement locus. type Statement_Range_T is private; -- -- A range of statements, usually representing a contiguous -- part of the target program. -- A statement range has, as attributes, one or more source-file -- names, and for each source-file name a range of source-line -- numbers and a range of code addresses. -- Note that the min/max line-number need not correspond to the -- min/max code address, since the compiler may have reordered -- instructions. -- The common case is to have just one source-file name and -- its associated line-number range and code address range. -- It may contain a (reference to) a symbol-table, for later -- improvement or widening of the mapping between code addresses -- and sourc-line numbers. Max_Source_Files_Per_Locus : constant := 3; -- -- The maximum number of source-file names and associated -- line-number and code-address ranges for a Statement_Range_T. subtype Source_Ordinal_T is Positive range 1 .. Max_Source_Files_Per_Locus; -- -- Identifies one of the source-files of a Statement_Range_T. -- The order is arbitrary. First_Source : constant Source_Ordinal_T := Source_Ordinal_T'First; -- -- The ordinal number of the first (and usually only) source-file -- in a statement range. function No_Statements return Statement_Range_T; -- -- An undefined range of statements. -- Adding this range to another statement range has no effect. -- --- Querying statement loci attributes -- type Source_File_Form_T is (Full, Base, Default); -- -- Optional forms of the name of a source-file. -- -- Full -- The full name, including directory path. -- The name "a/b/c" is given in full as "a/b/c". -- Base -- Only the actual file-name, omitting directories. -- The name "a/b/c" is given as "c". -- Default -- The value (either Full_Path or Base_Name) selected -- by command-line option, or the default value if no -- option given. function Formed_Source ( Full_Name : String; Form : Source_File_Form_T := Default) return String; -- -- Presents the Full source-file Name in the chosen Form. subtype Real_Source_File_Form_T is Source_File_Form_T range Full .. Base; -- -- All forms except Default. function Source_File ( Item : Statement_Locus_T; Form : Source_File_Form_T := Default) return String; -- -- The name of the source file that contains the statement, in -- the chosen Form. Null string if unknown. function Line_Number (Item : Statement_Locus_T) return Line_Number_T; -- -- The number of the source-file that contains or corresponds -- to the statement. -- No_Line_Number if unknown. function Code_Address (Item : Statement_Locus_T) return Processor.Code_Address_T; -- -- The code address of the statement. -- TBD if unknown. function Number_Of_Sources (Item : Statement_Range_T) return Natural; -- -- The number of source-files associated with the given statement -- range. The source-files have consecutive ordinal numbers from -- 1 to Number_Of_Sources. -- Zero if the statement range is null. function Source_File ( Item : Statement_Range_T; Source : Source_Ordinal_T := First_Source; Form : Source_File_Form_T := Default) return String; -- -- The name of the source file, with ordinal number Source, that -- contains a part of the statement range. -- Fault if Source is out of range for the Item. -- Null string if unknown or Fault. function Source_File ( Item : Statement_Range_T; Source : Source_Ordinal_T := First_Source) return Symbols.Source_File_Name_T; -- -- Similar to Source_File (...) return String, but returns a -- Symbols.Source_File_Name_T for the full source-file name -- (including directory path). If the Source is out of range -- for the Item, issues a Fault message and returns Null_Name. function First ( Item : Statement_Range_T; Source : Source_Ordinal_T := First_Source) return Statement_Locus_T; -- -- The first (least) statement locus in the source-file with -- ordinal number Source in the range. -- The result will have the smallest line-number and smallest -- code-address that are known to lie in this source-file in the -- given range. Note that these need not correspond to each other, -- if instructions have been reordered. -- If Item is No_Statements, returns No_Statement. function Last ( Item : Statement_Range_T; Source : Source_Ordinal_T := First_Source) return Statement_Locus_T; -- -- The last (largest) statement locus in the source-file with -- ordinal number Source in the range. -- The result will have the largest line-number and largest -- code-address that are known to lie in this source-file in the -- given range. Note that these need not correspond to each other, -- if instructions have been reordered. -- If Item is No_Statements, returns No_Statement. function First ( Item : Statement_Range_T; Source : Source_Ordinal_T := First_Source) return Line_Number_T; -- -- The first (least) line-number locus in the source-file with -- ordinal number Source in the range. This is the combination -- of the First function that takes a Statement_Range_T and -- returns a Statement_Locus_T, followed by the Line_Number -- function applied to this Statement_Locus_T. function Last ( Item : Statement_Range_T; Source : Source_Ordinal_T := First_Source) return Line_Number_T; -- -- The first (least) line-number locus in the source-file with -- ordinal number Source in the range. This is the combination -- of the First function that takes a Statement_Range_T and -- returns a Statement_Locus_T, followed by the Line_Number -- function applied to this Statement_Locus_T. -- --- Constructing statement loci and ranges -- function Locus ( Source_File : String := ""; Line_Number : Line_Number_T := No_Line_Number; Code_Address : Processor.Code_Address_T; Symbol_Table : Symbols.Symbol_Table_T) return Statement_Locus_T; -- -- A statement in the given source file (if known), at -- the given source line (if known), and the given code -- address (which is assumed known here). function Locus ( Source_File : String := ""; Line_Number : Line_Number_T) return Statement_Locus_T; -- -- A statement in the given source file (if known) and at -- the given source line (known) but with an unknown or -- irrelevant code address. function Locus (Code_Address : Processor.Code_Address_T) return Statement_Locus_T; -- -- A statement in the given source file (if known), at -- the given code address, without specifying the source line -- nor the source file. function Rainge ( First : Statement_Locus_T; Last : Statement_Locus_T) return Statement_Range_T; -- -- The statement range from First to Last, where First and Last -- must be in the same source-file (when the source-file is known). -- The first/last line-numbers and first/last code-addresses are -- chosen separately from the attributes of First and Last. -- Thus, if First has a smaller line-number than Last, but Last has -- a smaller code address than First, the First locus of the result -- will have the line-number of the First parameter but the -- code-address of the Last parameter. function "+" (Item : Statement_Locus_T) return Statement_Range_T; -- -- Returns the range than contains exactly the given statement. -- If Item = No_Statement, returns No_Statements. function "+" (Left, Right : Statement_Range_T) return Statement_Range_T; -- -- Returns the smallest range that contains both the given ranges. -- If Left and Right refer to the same source-file, the result -- will also refer to this source-file. If Left and Right refer -- to different (sets of) source files, the ranges will be combined -- separately for each source-file. -- If the maximum number of source-files per range is exceeded, -- some source-files will be left out from the result. function "+" ( Left : Statement_Range_T; Right : Statement_Locus_T) return Statement_Range_T; -- -- Returns the smallest range that contains Left and Right, -- with the same handling of source-files as for "+" with two -- statement-range operands. function "&" (Left, Right : Statement_Range_T) return Statement_Range_T; -- -- Returns the more precise of the given statement ranges. -- If either operand is No_Statement_Range, the other is -- returned, otherwise the intersection is returned. When -- multiple source-files are involved, the intersection is -- computed separately for each source file. procedure Add_Surrounding_Lines (To : in out Statement_Range_T); -- -- Adds To a given statement range references to the source-lines -- that most closely surround the code address(es) of the rage, if -- the range does not already have source-line information. The code -- address(es) of the statement range are not changed. -- -- If there is a source-line connection before the given range, -- this source-line is added (the logic is that all the code generated -- for a source line normally follows the first code generated for -- this line). Otherwise, a source-line that is after the given range -- is sought and used if found. -- -- This operation is controlled by a command-line option. function Image ( Item : Statement_Locus_T; Address : Boolean := False) return String; -- -- Image of the statement locator. -- The source-file name is not included. -- The source line number, if known, is shown as a string of -- base-10 digits with no leading, embedded or trailing blanks. -- The code address, if known and chosen by the Address parameter -- or a general option, is shown after the line-number, by using -- Processor.Image, enclosed in []. -- Thus, the possible forms are: -- "" if neither line-number nor code-address known -- "line" -- "[code]" -- "line[code]" function Image ( Item : Statement_Range_T; Source : Source_Ordinal_T := First_Source; Address : Boolean := False) return String; -- -- Image of the statement range associated with the source-file -- with ordinal Source in the range. -- A range of source-lines followed by a range of code addresses, -- with enclosing [] as above. -- For example, "11-44[a1bf-a2e5]". -- In both parts, if the first and last values are the same, only -- one is displayed (and the "-" is omitted). -- For example, "123[83ef-890a]". -- If source-line numbers are known, the code-address is displayed -- only if chosen by the Address parameter or by the general option. function Code_Image (Item : Statement_Range_T) return String; -- -- Image of the overall code-address range for this statement range, -- as in the Image function above but showing only the code address -- part (in brackets). -- --- Locus construction and combination -- Call_Locus_Mark : constant String := "@"; -- -- The symbol used to separate the name of the caller from the -- locus of the call, in the construct Caller @ locus => Callee -- that is a part of a call-path locus. Call_Mark : constant String := "=>"; -- -- The symbol used to denote a call in various outputs, usually -- appearing between the names of the caller subprogram and the -- callee subprogram, in the construct Caller @ locus => Callee -- that is a part of a call-path locus. function Locus ( Program_File : String := ""; Source_File : String := ""; Call_Path : String := ""; Statements : Statement_Range_T := No_Statements) return Locus_T; -- -- Creates a locus with the specified attributes. -- The default value of each parameter represents an undefined or -- unknown value for that attribute. -- If no Source_File is given directly, but one is known for -- the Statements, the latter is used. function "&" (Left, Right : Locus_T) return Locus_T; -- -- Combines two loci into a more precise locus by choosing -- for each attribute the more precise of the Left and Right values -- for that attribute. If the Left and Right values are equally -- precise, the Right value is chosen (overriding Left). -- -- The more precise value of each attribute is defined as follows: -- -- Program_File -- The null string represents undefined. -- All other values are equally precise. -- -- Source_File -- As for Program_File. -- -- Call_Path -- The null string represents undefined. -- A non-null string is more precise than any of its substrings. -- That is, extending the call-path at either end (to higher or -- lower levels) makes it more precise. -- -- Statements -- No_Statement_Range represents undefined. A statement-range -- that is contained in another (as a subset) is more precise -- than the larger range. -- -- Symbol_Table -- No_Symbol_Table, if neither operand has a symbol table. -- If one or both operands have a symbol-table, they are -- assumed to have the same table, and this table is used. procedure Add_Surrounding_Lines (To : in out Locus_T); -- -- Adds To a given locus references to the source-lines that most -- closely surround the code address(es) of the locus, if the -- locus does not already have source-line information. The code -- address(es) of the locus are not changed. -- -- If there is a source-line connection before the given locus, -- this source-line is added (the logic is that all the code generated -- for a source line normally follows the first code generated for -- this line). Otherwise, a source-line that is after the given locus -- is sought and used if found. -- -- This operation is controlled by a command-line option. -- --- Default-locus operations -- type Nest_Mark_T is private; -- -- Identifies a locus in the nest of default loci. -- It is used to check that defaults are nested and unnested properly. -- The default initial value of a Nest_Mark_T is No_Mark, below. No_Mark : constant Nest_Mark_T; -- -- Indicates an undefined (absent) locus mark. -- This is the default initial value of all Nest_Mark_T objects. function Nest (Locus : in Locus_T) return Nest_Mark_T; -- -- Defines the given locus as a new default, nesting it within -- the currently defined default loci. -- The return value is needed to remove (un-nest) this locus from -- the defaults. procedure Unnest (Mark : in Nest_Mark_T); -- -- Removes the innermost (newest) default locus, or all default loci -- down to and including the one identified by the given mark. function Current_Locus return Locus_T; -- -- Returns the combination of the currently defined default loci. -- The result is computed by the "&" operator applied from the -- oldest (outermost) to the newest (innermost) currently -- defined default locus. -- --- Locus queries -- function Program_File ( Item : Locus_T; Form : Source_File_Form_T := Default) return String; -- -- The name of the target-program executable file that contains the locus. -- Null string if not defined. function Source_File ( Item : Locus_T; Form : Source_File_Form_T := Default) return String; -- -- The name of the source-code file that contains the locus. -- Null string if not defined. function Call_Path (Item : Locus_T) return String; -- -- The string image of the call-path that leads to the locus. -- Null string if not defined. function Statements (Item : Locus_T) return Statement_Range_T; -- -- The statements that correspond to the locus. -- No_Statements is not defined. function Image (Item : Locus_T) return String; -- -- The locus, displayed as in fields 2 through 5. -- --- Basic output operations -- -- Most operations that can take a locus parameter are defined in -- two forms, one with a locus parameter and the other without it. -- The form without a locus parameter uses Current_Locus. -- The other form uses Current_Locus combined with (and perhaps -- overridden by) the parameter locus. procedure Line ( Channel : in Ada.Text_IO.File_Type; Key : in String; Program_File : in String; Source_File : in String; Call_Path : in String; Statements : in String; Data : in String) renames Basic_Output.Line; -- -- Emit a line in the basic format, with all fields given -- as parameters. "Data" contains field 6 .. N, with embedded -- field separators. Too_Many_Problems : exception; -- -- Signals that too many Warning, Error, or Fault messages have -- been emitted, compared to the maximum numbers set in Output.Opt. procedure Note ( Text : in String); procedure Note ( Locus : in Locus_T; Text : in String); -- -- Outputs a "Note" line. procedure Warning ( Text : in String); procedure Warning ( Locus : in Locus_T; Text : in String); -- -- Outputs a "Warning" line. -- -- Propagates Too_Many_Problems if the total number of Warnings -- emitted in this execution now exceeds the chosen maximum, -- Output.Opt.Max_Warnings. procedure Error ( Text : in String); procedure Error ( Locus : in Locus_T; Text : in String); -- -- Outputs an "Error" line. -- -- Propagates Too_Many_Problems if the total number of Errors -- emitted in this execution now exceeds the chosen maximum, -- Output.Opt.Max_Errors. procedure Fault ( Location : in String; Text : in String); procedure Fault ( Location : in String; Locus : in Locus_T; Text : in String); -- -- Outputs a "Fault" line, to signal an internal fault in Bound-T -- detected in the Bound-T package or subprogram "Location". -- -- Propagates Too_Many_Problems if the total number of Faults -- emitted in this execution now exceeds the chosen maximum, -- Output.Opt.Max_Faults. procedure Trace ( Text : in String); procedure Trace ( Locus : in Locus_T; Text : in String); -- -- Outputs a "Trace" line, to report some on-the-fly execution -- tracing information. procedure Exception_Info ( Text : in String; Occurrence : in Ada.Exceptions.Exception_Occurrence); procedure Exception_Info ( Locus : in Locus_T; Text : in String; Occurrence : in Ada.Exceptions.Exception_Occurrence); -- -- Outputs an "Exception" line, which is like an error, but -- includes more fields giving the exception info. procedure Result ( Key : in String; Text : in String); procedure Result ( Key : in String; Locus : in Locus_T; Text : in String); -- -- Outputs a line with the result of an analysis, as identified -- by the Key parameter. procedure Unknown ( Key : in String; Text : in String := ""); procedure Unknown ( Key : in String; Locus : in Locus_T; Text : in String := ""); -- -- Outputs a line that shows that a result, identified by the -- the Key parameter, is unknown (analysis failed), with further -- explanation in the optional Text. -- --- Supporting utility operations -- function Trim (Item : String) return String renames Basic_Output.Trim; -- -- The given string with leading and trailing blanks removed. function Image (Item : Integer) return String renames Basic_Output.Image; -- -- A trimmed, base-10 formatting of the number. -- Same as Integer'Image but with no leading blank. function Image (Item : Processor.Time_T) return String; -- -- A trimmed, base-10 formatting of the time number. -- Same as Time_T'Image but with no leading blank. function Image (Item : Line_Number_T) return String; -- -- A trimmed, base-10 formatting of the line-number. -- Same as Integer'Image but with no leading blank. function Either ( Cond : Boolean; Yes : String; No : String) return String; -- -- A conditional choice: if Cond then Yes else No. procedure Flush; -- -- Ensures that all output generated so far is physically written to -- the output devices (flush buffers) before returning. -- This is useful for user interaction. -- --- Support for raw text-io. -- procedure Heading ( Text : in String; Margin : in Ada.Text_IO.Positive_Count := 4); -- -- Prints the Text, starting from column 1, then indents to -- the given Margin column on the next line. However, first -- uses Flush to clear the output buffers. -- -- This procedure is useful to give a heading to some output that -- uses raw text-io, not the "basic output" format, and takes its -- left margin from the current column. private type Possible_Line_Number_T (Known : Boolean := False) is record case Known is when False => null; when True => Number : Line_Number_T; end case; end record; type Possible_Code_Address_T (Known : Boolean := False) is record case Known is when False => null; when True => Address : Processor.Code_Address_T; end case; end record; type Statement_Locus_T is record Source_File : Symbols.Source_File_Name_T; Line : Possible_Line_Number_T; Code : Possible_Code_Address_T; Symbol_Table : Symbols.Symbol_Table_T; end record; No_Statement : constant Statement_Locus_T := ( Source_File => Symbols.Null_Name, Line => (Known => False), Code => (Known => False), Symbol_Table => Symbols.No_Symbol_Table); type Source_Interval_T is record File : Symbols.Source_File_Name_T; First : Possible_Line_Number_T; Last : Possible_Line_Number_T; end record; -- -- An interval of source lines, all from the same source file. No_Source_Interval : constant Source_Interval_T := ( File => Symbols.Null_Name, First => (Known => False), Last => (Known => False)); type Source_Interval_List_T is array (Source_Ordinal_T range <> ) of Source_Interval_T; -- -- A source-line interval for each source-file associated -- with a statement range. subtype Source_Intervals_T is Source_Interval_List_T (Source_Ordinal_T); -- -- A list of source-line intervals with the fixed maximum length. type Code_Interval_T is record First : Possible_Code_Address_T; Last : Possible_Code_Address_T; end record; -- -- An interval of instruction (code) addresses, all from -- the same executable file (but not necessarily generated -- from the same source-code file). No_Code_Interval : constant Code_Interval_T := ( First => (Known => False), Last => (Known => False)); type Statement_Range_T is record Sources : Natural := 0; Source : Source_Intervals_T; Code : Code_Interval_T; Symbol_Table : Symbols.Symbol_Table_T; end record; -- -- A range of statements, possibly from several source-code -- files. Null if Sources = 0. Note that even if Sources > 0, -- the actual Source_File components in one of the Intervals -- be Null_Item, meaning an unknown source file. No_Statement_Range : constant Statement_Range_T := ( Sources => 0, Source => (others => No_Source_Interval), Code => No_Code_Interval, Symbol_Table => Symbols.No_Symbol_Table); type Locus_T is record Program_File : String_Pool.Item_T := String_Pool.Null_Item; Source_File : Symbols.Source_File_Name_T := Symbols.Null_Name; Call_Path : String_Pool.Item_T := String_Pool.Null_Item; Statements : Statement_Range_T := No_Statement_Range; end record; No_Locus : constant Locus_T := ( Program_File => String_Pool.Null_Item, Source_File => Symbols.Null_Name, Call_Path => String_Pool.Null_Item, Statements => No_Statement_Range); Max_Nest_Depth : constant := 70; -- -- Maximum depth of nested default loci. type Nest_Depth_T is range 0 .. Max_Nest_Depth; -- -- The current depth of the default-locus nest. type Nest_Mark_T is record Defined : Boolean := False; Depth : Nest_Depth_T := 0; Seq : Natural := 0; end record; -- -- The mark has a depth, which is the primary mark, and -- a sequential number, which is used to check that the -- depths are not mixed up. -- The mark becomes "defined" by the Nest operation. -- Unnesting and undefined mark has no effect. No_Mark : constant Nest_Mark_T := ( Defined => False, Depth => 0, Seq => 0); end Output;
RREE/ada-util
Ada
5,040
adb
----------------------------------------------------------------------- -- Util.Beans.Objects.Hash -- Hash on an object -- Copyright (C) 2010, 2011, 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Hash; with Ada.Strings.Wide_Wide_Hash; with Ada.Unchecked_Conversion; with Interfaces; with Util.Beans.Basic; function Util.Beans.Objects.Hash (Key : in Object) return Ada.Containers.Hash_Type is use Ada.Containers; use Ada.Strings; use Interfaces; use Util.Beans.Basic; type Unsigned_32_Array is array (Natural range <>) of Unsigned_32; subtype U32_For_Float is Unsigned_32_Array (1 .. Long_Long_Float'Size / 32); subtype U32_For_Duration is Unsigned_32_Array (1 .. Duration'Size / 32); subtype U32_For_Long is Unsigned_32_Array (1 .. Long_Long_Integer'Size / 32); subtype U32_For_Access is Unsigned_32_Array (1 .. Readonly_Bean_Access'Size / 32); -- Hash the integer and floats using 32-bit values. function To_U32_For_Long is new Ada.Unchecked_Conversion (Source => Long_Long_Integer, Target => U32_For_Long); -- Likewise for floats. function To_U32_For_Float is new Ada.Unchecked_Conversion (Source => Long_Long_Float, Target => U32_For_Float); -- Likewise for duration. function To_U32_For_Duration is new Ada.Unchecked_Conversion (Source => Duration, Target => U32_For_Duration); -- Likewise for the bean pointer function To_U32_For_Access is new Ada.Unchecked_Conversion (Source => Readonly_Bean_Access, Target => U32_For_Access); begin case Key.V.Of_Type is when TYPE_NULL => return 0; when TYPE_BOOLEAN => if Key.V.Bool_Value then return 1; else return 2; end if; when TYPE_INTEGER => declare U32 : constant U32_For_Long := To_U32_For_Long (Key.V.Int_Value); Val : Unsigned_32 := U32 (U32'First); begin for I in U32'First + 1 .. U32'Last loop Val := Val xor U32 (I); end loop; return Hash_Type (Val); end; when TYPE_FLOAT => declare U32 : constant U32_For_Float := To_U32_For_Float (Key.V.Float_Value); Val : Unsigned_32 := U32 (U32'First); begin for I in U32'First + 1 .. U32'Last loop Val := Val xor U32 (I); end loop; return Hash_Type (Val); end; when TYPE_STRING => if Key.V.String_Proxy = null then return 0; else return Hash (Key.V.String_Proxy.Value); end if; when TYPE_TIME => declare U32 : constant U32_For_Duration := To_U32_For_Duration (Key.V.Time_Value); Val : Unsigned_32 := U32 (U32'First); begin for I in U32'First + 1 .. U32'Last loop Val := Val xor U32 (I); end loop; return Hash_Type (Val); end; when TYPE_WIDE_STRING => if Key.V.Wide_Proxy = null then return 0; else return Wide_Wide_Hash (Key.V.Wide_Proxy.Value); end if; when TYPE_BEAN => if Key.V.Proxy = null or else Bean_Proxy (Key.V.Proxy.all).Bean = null then return 0; end if; declare U32 : constant U32_For_Access := To_U32_For_Access (Bean_Proxy (Key.V.Proxy.all).Bean.all'Access); Val : Unsigned_32 := U32 (U32'First); -- The loop is not executed if pointers are 32-bit wide. pragma Warnings (Off); begin for I in U32'First + 1 .. U32'Last loop Val := Val xor U32 (I); end loop; return Hash_Type (Val); end; when TYPE_ARRAY => declare Result : Unsigned_32 := 0; begin for Object of Key.V.Array_Proxy.Values loop Result := Result xor Unsigned_32 (Hash (Object)); end loop; return Hash_Type (Result); end; end case; end Util.Beans.Objects.Hash;
reznikmm/matreshka
Ada
4,616
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_Chart.Scale_Text_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Chart_Scale_Text_Attribute_Node is begin return Self : Chart_Scale_Text_Attribute_Node do Matreshka.ODF_Chart.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Chart_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Chart_Scale_Text_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Scale_Text_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Chart_URI, Matreshka.ODF_String_Constants.Scale_Text_Attribute, Chart_Scale_Text_Attribute_Node'Tag); end Matreshka.ODF_Chart.Scale_Text_Attributes;
AaronC98/PlaneSystem
Ada
3,158
ads
------------------------------------------------------------------------------ -- Ada Web Server -- -- -- -- Copyright (C) 2000-2014, 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/>. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ------------------------------------------------------------------------------ with AWS.Response; generic type T (<>) is limited private; -- Data type received by this server type T_Access is access T; with function Callback (Server : String; -- Host name Name : String; -- Message name Context : not null access T; Parameters : Parameter_Set := Null_Parameter_Set) return Response.Data; package AWS.Communication.Server is -- Each instantiation of this package will create an HTTP server waiting -- for incoming requests at the Port specified in the Start formal -- parameter. This communication server must be started with the Start -- procedure and can be stopped with the procedure Shutdown below. procedure Start (Port : Positive; Context : T_Access; Host : String := ""); -- Start communication HTTP server listening at the given port procedure Shutdown; -- Shutdown the communication HTTP server end AWS.Communication.Server;
Gabriel-Degret/adalib
Ada
3,311
ads
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <[email protected]> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual --------------------------------------------------------------------------- generic type Float_Type is digits <>; package Ada.Numerics.Generic_Elementary_Functions is pragma Pure (Generic_Elementary_Functions); function Sqrt (X : Float_Type'Base) return Float_Type'Base; function Log (X : Float_Type'Base) return Float_Type'Base; function Log (X, Base : Float_Type'Base) return Float_Type'Base; function Exp (X : Float_Type'Base) return Float_Type'Base; function "**" (Left, Right : Float_Type'Base) return Float_Type'Base; function Sin (X : Float_Type'Base) return Float_Type'Base; function Sin (X, Cycle : Float_Type'Base) return Float_Type'Base; function Cos (X : Float_Type'Base) return Float_Type'Base; function Cos (X, Cycle : Float_Type'Base) return Float_Type'Base; function Tan (X : Float_Type'Base) return Float_Type'Base; function Tan (X, Cycle : Float_Type'Base) return Float_Type'Base; function Cot (X : Float_Type'Base) return Float_Type'Base; function Cot (X, Cycle : Float_Type'Base) return Float_Type'Base; function Arcsin (X : Float_Type'Base) return Float_Type'Base; function Arcsin (X, Cycle : Float_Type'Base) return Float_Type'Base; function Arccos (X : Float_Type'Base) return Float_Type'Base; function Arccos (X, Cycle : Float_Type'Base) return Float_Type'Base; function Arctan (Y : Float_Type'Base; X : Float_Type'Base := 1.0) return Float_Type'Base; function Arctan (Y : Float_Type'Base; X : Float_Type'Base := 1.0; Cycle : Float_Type'Base) return Float_Type'Base; function Arccot (X : Float_Type'Base; Y : Float_Type'Base := 1.0) return Float_Type'Base; function Arccot (X : Float_Type'Base; Y : Float_Type'Base := 1.0; Cycle : Float_Type'Base) return Float_Type'Base; function Sinh (X : Float_Type'Base) return Float_Type'Base; function Cosh (X : Float_Type'Base) return Float_Type'Base; function Tanh (X : Float_Type'Base) return Float_Type'Base; function Coth (X : Float_Type'Base) return Float_Type'Base; function Arcsinh (X : Float_Type'Base) return Float_Type'Base; function Arccosh (X : Float_Type'Base) return Float_Type'Base; function Arctanh (X : Float_Type'Base) return Float_Type'Base; function Arccoth (X : Float_Type'Base) return Float_Type'Base; end Ada.Numerics.Generic_Elementary_Functions;
AdaCore/libadalang
Ada
210
adb
procedure Test is type T is tagged null record; External_Tag : String := T'External_Tag; pragma Test_Statement; Type_Key : String := T'Type_Key; pragma Test_Statement; begin null; end Test;
stcarrez/ada-util
Ada
1,389
ads
----------------------------------------------------------------------- -- Util.Concurrent.Locks -- Concurrent Tools -- Copyright (C) 2001, 2002, 2003, 2009, 2010 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 Util.Concurrent.Locks is pragma Preelaborate; -- Lock for accessing the shared cache protected type RW_Lock is -- Lock the resource for reading. entry Read; -- Release the read lock. procedure Release_Read; -- Lock the resource for writing. entry Write; -- Release the write lock. procedure Release_Write; private Readable : Boolean := True; Reader_Count : Natural := 0; end RW_Lock; end Util.Concurrent.Locks;
twdroeger/ada-awa
Ada
2,808
ads
----------------------------------------------------------------------- -- awa-jobs-modules -- Job module -- Copyright (C) 2012, 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. ----------------------------------------------------------------------- with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Strings.Hash; with ASF.Applications; with AWA.Modules; with AWA.Jobs.Services; -- == Job Module == -- The <b>Jobs.Modules</b> is the entry point for the management of asynchronous jobs. -- It maintains a list of job types that can be executed for the application and it -- manages the job dispatchers. package AWA.Jobs.Modules is NAME : constant String := "jobs"; type Job_Module is new AWA.Modules.Module with private; type Job_Module_Access is access all Job_Module'Class; -- Initialize the job module. overriding procedure Initialize (Plugin : in out Job_Module; App : in AWA.Modules.Application_Access; Props : in ASF.Applications.Config); -- Get the job module instance associated with the current application. function Get_Job_Module return Job_Module_Access; -- Registers the job work procedure represented by `Work` under the name `Name`. procedure Register (Plugin : in out Job_Module; Definition : in AWA.Jobs.Services.Job_Factory_Access); -- Find the job work factory registered under the name `Name`. -- Returns null if there is no such factory. function Find_Factory (Plugin : in Job_Module; Name : in String) return AWA.Jobs.Services.Job_Factory_Access; private use AWA.Jobs.Services; -- A factory map to create job instances. package Job_Factory_Map is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => Job_Factory_Access, Hash => Ada.Strings.Hash, Equivalent_Keys => "="); type Job_Module is new AWA.Modules.Module with record Factory : Job_Factory_Map.Map; end record; end AWA.Jobs.Modules;
zhmu/ananas
Ada
170
adb
package body Opt46_Pkg is function Last (T : Instance) return Table_Index_Type is begin return Table_Index_Type (T.P.Last_Val); end Last; end Opt46_Pkg;
RREE/ada-util
Ada
21,813
adb
----------------------------------------------------------------------- -- util-processes-tests - Test for processes -- Copyright (C) 2011, 2012, 2016, 2018, 2019, 2021 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.Log.Loggers; with Util.Test_Caller; with Util.Files; with Util.Strings.Vectors; with Util.Streams.Pipes; with Util.Streams.Buffered; with Util.Streams.Texts; with Util.Processes.Tools; package body Util.Processes.Tests is -- The logger Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Util.Processes.Tests"); package Caller is new Util.Test_Caller (Test, "Processes"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Processes.Is_Running", Test_No_Process'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn/Wait/Get_Exit_Status", Test_Spawn'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(READ pipe)", Test_Output_Pipe'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(WRITE pipe)", Test_Input_Pipe'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(ERROR pipe)", Test_Error_Pipe'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn/Shell(WRITE pipe)", Test_Shell_Splitting_Pipe'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(OUTPUT redirect)", Test_Output_Redirect'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(INPUT redirect)", Test_Input_Redirect'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(CHDIR)", Test_Set_Working_Directory'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(Environment)", Test_Set_Environment'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(errors)", Test_Errors'Access); Caller.Add_Test (Suite, "Test Util.Streams.Pipes.Open/Read/Close (Multi spawn)", Test_Multi_Spawn'Access); Caller.Add_Test (Suite, "Test Util.Streams.Pipes.Set_XXX (errors)", Test_Pipe_Errors'Access); Caller.Add_Test (Suite, "Test Util.Streams.Pipes.Stop", Test_Pipe_Stop'Access); Caller.Add_Test (Suite, "Test Util.Processes.Tools.Execute", Test_Tools_Execute'Access); Caller.Add_Test (Suite, "Test Util.Processes.Stop", Test_Stop'Access); end Add_Tests; -- ------------------------------ -- Tests when the process is not launched -- ------------------------------ procedure Test_No_Process (T : in out Test) is P : Process; begin T.Assert (not P.Is_Running, "Process should not be running"); T.Assert (P.Get_Pid < 0, "Invalid process id"); end Test_No_Process; -- ------------------------------ -- Test executing a process -- ------------------------------ procedure Test_Spawn (T : in out Test) is P : Process; begin -- Launch the test process => exit code 2 P.Spawn ("bin/util_test_process"); T.Assert (P.Is_Running, "Process is running"); P.Wait; T.Assert (not P.Is_Running, "Process has stopped"); T.Assert (P.Get_Pid > 0, "Invalid process id"); Util.Tests.Assert_Equals (T, 2, P.Get_Exit_Status, "Invalid exit status"); -- Launch the test process => exit code 0 P.Spawn ("bin/util_test_process 0 write b c d e f"); T.Assert (P.Is_Running, "Process is running"); P.Wait; T.Assert (not P.Is_Running, "Process has stopped"); T.Assert (P.Get_Pid > 0, "Invalid process id"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Invalid exit status"); end Test_Spawn; -- ------------------------------ -- Test output pipe redirection: read the process standard output -- ------------------------------ procedure Test_Output_Pipe (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Set_Working_Directory ("bin"); P.Open ("./util_test_process 0 write b c d e f test_marker"); declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; begin Buffer.Initialize (P'Unchecked_Access, 19); Buffer.Read (Content); P.Close; Util.Tests.Assert_Matches (T, "b\s+c\s+d\s+e\s+f\s+test_marker\s+", Content, "Invalid content"); end; T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Invalid exit status"); end Test_Output_Pipe; -- ------------------------------ -- Test error pipe redirection: read the process standard output -- ------------------------------ procedure Test_Error_Pipe (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Open ("gprbuild -z", READ_ERROR); declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; begin Buffer.Initialize (P'Unchecked_Access, 19); Buffer.Read (Content); P.Close; Util.Tests.Assert_Matches (T, ".*gprbuild: .*", Content, "Invalid content"); end; T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 4, P.Get_Exit_Status, "Invalid exit status"); end Test_Error_Pipe; -- ------------------------------ -- Test shell splitting. -- ------------------------------ procedure Test_Shell_Splitting_Pipe (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Open ("bin/util_test_process 0 write ""b c d e f"" test_marker"); declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; begin Buffer.Initialize (P'Unchecked_Access, 19); Buffer.Read (Content); P.Close; Util.Tests.Assert_Matches (T, "b c d e f\s+test_marker\s+", Content, "Invalid content"); end; T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Invalid exit status"); end Test_Shell_Splitting_Pipe; -- ------------------------------ -- Test input pipe redirection: write the process standard input -- At the same time, read the process standard output. -- ------------------------------ procedure Test_Input_Pipe (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Open ("bin/util_test_process 0 read -", READ_WRITE); declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; Print : Util.Streams.Texts.Print_Stream; begin -- Write on the process input stream. Print.Initialize (P'Unchecked_Access); Print.Write ("Write test on the input pipe"); Print.Close; -- Read the output. Buffer.Initialize (P'Unchecked_Access, 19); Buffer.Read (Content); -- Wait for the process to finish. P.Close; Util.Tests.Assert_Matches (T, "Write test on the input pipe-\s", Content, "Invalid content"); end; T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Invalid exit status"); end Test_Input_Pipe; -- ------------------------------ -- Test launching several processes through pipes in several threads. -- ------------------------------ procedure Test_Multi_Spawn (T : in out Test) is Task_Count : constant Natural := 8; Count_By_Task : constant Natural := 10; type State_Array is array (1 .. Task_Count) of Boolean; States : State_Array; begin declare task type Worker is entry Start (Count : in Natural); entry Result (Status : out Boolean); end Worker; task body Worker is Cnt : Natural; State : Boolean := True; begin accept Start (Count : in Natural) do Cnt := Count; end Start; declare type Pipe_Array is array (1 .. Cnt) of aliased Util.Streams.Pipes.Pipe_Stream; Pipes : Pipe_Array; begin -- Launch the processes. -- They will print their arguments on stdout, one by one on each line. -- The expected exit status is the first argument. for I in 1 .. Cnt loop Pipes (I).Open ("bin/util_test_process 0 write b c d e f test_marker"); end loop; -- Read their output for I in 1 .. Cnt loop declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; begin Buffer.Initialize (Pipes (I)'Unchecked_Access, 19); Buffer.Read (Content); Pipes (I).Close; -- Check status and output. State := State and Pipes (I).Get_Exit_Status = 0; State := State and Ada.Strings.Unbounded.Index (Content, "test_marker") > 0; end; end loop; exception when E : others => Log.Error ("Exception raised", E); State := False; end; accept Result (Status : out Boolean) do Status := State; end Result; end Worker; type Worker_Array is array (1 .. Task_Count) of Worker; Tasks : Worker_Array; begin for I in Tasks'Range loop Tasks (I).Start (Count_By_Task); end loop; -- Get the results (do not raise any assertion here because we have to call -- 'Result' to ensure the thread terminates. for I in Tasks'Range loop Tasks (I).Result (States (I)); end loop; -- Leaving the Worker task scope means we are waiting for our tasks to finish. end; for I in States'Range loop T.Assert (States (I), "Task " & Natural'Image (I) & " failed"); end loop; end Test_Multi_Spawn; -- ------------------------------ -- Test output file redirection. -- ------------------------------ procedure Test_Output_Redirect (T : in out Test) is P : Process; Path : constant String := Util.Tests.Get_Test_Path ("proc-output.txt"); Content : Ada.Strings.Unbounded.Unbounded_String; begin Util.Processes.Set_Output_Stream (P, Path); Util.Processes.Spawn (P, "bin/util_test_process 0 write b c d e f test_marker"); Util.Processes.Wait (P); T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Process failed"); Util.Files.Read_File (Path, Content); Util.Tests.Assert_Matches (T, ".*test_marker", Content, "Invalid content"); Util.Processes.Set_Output_Stream (P, Path, True); Util.Processes.Spawn (P, "bin/util_test_process 0 write appended_text"); Util.Processes.Wait (P); Content := Ada.Strings.Unbounded.Null_Unbounded_String; Util.Files.Read_File (Path, Content); Util.Tests.Assert_Matches (T, ".*appended_text", Content, "Invalid content"); Util.Tests.Assert_Matches (T, ".*test_marker.*", Content, "Invalid content"); end Test_Output_Redirect; -- ------------------------------ -- Test input file redirection. -- ------------------------------ procedure Test_Input_Redirect (T : in out Test) is P : Process; In_Path : constant String := Util.Tests.Get_Path ("regtests/files/proc-input.txt"); Exp_Path : constant String := Util.Tests.Get_Path ("regtests/expect/proc-inres.txt"); Out_Path : constant String := Util.Tests.Get_Test_Path ("proc-inres.txt"); Err_Path : constant String := Util.Tests.Get_Test_Path ("proc-errres.txt"); begin Util.Processes.Set_Input_Stream (P, In_Path); Util.Processes.Set_Output_Stream (P, Out_Path); Util.Processes.Set_Error_Stream (P, Err_Path); Util.Processes.Spawn (P, "bin/util_test_process 0 read -"); Util.Processes.Wait (P); T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Process failed"); Util.Tests.Assert_Equal_Files (T => T, Expect => Exp_Path, Test => Out_Path, Message => "Process input/output redirection"); end Test_Input_Redirect; -- ------------------------------ -- Test changing working directory. -- ------------------------------ procedure Test_Set_Working_Directory (T : in out Test) is P : Process; Dir_Path : constant String := Util.Tests.Get_Path ("regtests/files"); In_Path : constant String := Util.Tests.Get_Path ("regtests/files/proc-empty.txt"); Exp_Path : constant String := Util.Tests.Get_Path ("regtests/files/proc-input.txt"); Out_Path : constant String := Util.Tests.Get_Test_Path ("proc-cat.txt"); Err_Path : constant String := Util.Tests.Get_Test_Path ("proc-errres.txt"); begin Util.Processes.Set_Working_Directory (P, Dir_Path); Util.Processes.Set_Input_Stream (P, In_Path); Util.Processes.Set_Output_Stream (P, Out_Path); Util.Processes.Set_Error_Stream (P, Err_Path); Util.Processes.Spawn (P, "cat proc-input.txt"); Util.Processes.Wait (P); T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Process failed"); Util.Tests.Assert_Equal_Files (T => T, Expect => Exp_Path, Test => Out_Path, Message => "Process input/output redirection"); end Test_Set_Working_Directory; -- ------------------------------ -- Test changing working directory. -- ------------------------------ procedure Test_Set_Environment (T : in out Test) is P : Process; In_Path : constant String := Util.Tests.Get_Path ("regtests/files/proc-empty.txt"); Exp_Path : constant String := Util.Tests.Get_Path ("regtests/expect/proc-env.txt"); Out_Path : constant String := Util.Tests.Get_Test_Path ("proc-env.txt"); Err_Path : constant String := Util.Tests.Get_Test_Path ("proc-errres.txt"); begin Util.Processes.Set_Environment (P, "ENV_VAR", "test1"); Util.Processes.Set_Input_Stream (P, In_Path); Util.Processes.Set_Output_Stream (P, Out_Path); Util.Processes.Set_Error_Stream (P, Err_Path); Util.Processes.Spawn (P, "env | grep ENV_VAR"); Util.Processes.Wait (P); T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Process failed"); Util.Tests.Assert_Equal_Files (T => T, Expect => Exp_Path, Test => Out_Path, Message => "Process input/output redirection"); end Test_Set_Environment; -- ------------------------------ -- Test various errors. -- ------------------------------ procedure Test_Errors (T : in out Test) is P : Process; begin Util.Processes.Spawn (P, "sleep 1"); begin Util.Processes.Set_Working_Directory (P, "/"); T.Fail ("Set_Working_Directory: no exception raised"); exception when Invalid_State => null; end; begin Util.Processes.Set_Input_Stream (P, "/"); T.Fail ("Set_Input_Stream: no exception raised"); exception when Invalid_State => null; end; begin Util.Processes.Set_Output_Stream (P, "/"); T.Fail ("Set_Output_Stream: no exception raised"); exception when Invalid_State => null; end; begin Util.Processes.Set_Error_Stream (P, "."); T.Fail ("Set_Error_Stream: no exception raised"); exception when Invalid_State => null; end; begin Util.Processes.Set_Environment (P, "ENV_VAR", "test1"); T.Fail ("Set_Environment: no exception raised"); exception when Invalid_State => null; end; begin Util.Processes.Spawn (P, "sleep 1"); T.Fail ("Spawn: no exception raised"); exception when Invalid_State => null; end; Util.Processes.Wait (P); T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Process failed"); end Test_Errors; -- ------------------------------ -- Test launching and stopping a process. -- ------------------------------ procedure Test_Stop (T : in out Test) is P : Process; begin Util.Processes.Spawn (P, "sleep 3600"); T.Assert (P.Is_Running, "Process is running"); Util.Processes.Stop (P); Util.Processes.Wait (P); T.Assert (not P.Is_Running, "Process has stopped"); end Test_Stop; -- ------------------------------ -- Test various errors (pipe streams)). -- ------------------------------ procedure Test_Pipe_Errors (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Open ("sleep 1"); begin P.Set_Working_Directory ("/"); T.Fail ("Set_Working_Directory: no exception raised"); exception when Invalid_State => null; end; begin P.Set_Input_Stream ("/"); T.Fail ("Set_Input_Stream: no exception raised"); exception when Invalid_State => null; end; begin P.Set_Output_Stream ("/"); T.Fail ("Set_Output_Stream: no exception raised"); exception when Invalid_State => null; end; begin P.Set_Error_Stream ("."); T.Fail ("Set_Error_Stream: no exception raised"); exception when Invalid_State => null; end; P.Close; T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Process failed"); end Test_Pipe_Errors; -- ------------------------------ -- Test launching and stopping a process (pipe streams). -- ------------------------------ procedure Test_Pipe_Stop (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Open ("sleep 3600"); T.Assert (P.Is_Running, "Process is running"); P.Stop; P.Close; T.Assert (not P.Is_Running, "Process has stopped"); end Test_Pipe_Stop; -- ------------------------------ -- Test the Tools.Execute operation. -- ------------------------------ procedure Test_Tools_Execute (T : in out Test) is List : Util.Strings.Vectors.Vector; Status : Integer; begin Tools.Execute (Command => "bin/util_test_process 23 write ""b c d e f"" test_marker", Output => List, Status => Status); Util.Tests.Assert_Equals (T, 23, Status, "Invalid exit status"); Util.Tests.Assert_Equals (T, 2, Integer (List.Length), "Invalid output collected by Execute"); Util.Tests.Assert_Equals (T, "b c d e f", List.Element (1), ""); Util.Tests.Assert_Equals (T, "test_marker", List.Element (2), ""); List.Clear; Tools.Execute (Command => "grep 'L[2-9]'", Input_Path => Util.Tests.Get_Path ("regtests/files/proc-input.txt"), Output => List, Status => Status); Util.Tests.Assert_Equals (T, 0, Status, "Invalid exit status"); Util.Tests.Assert_Equals (T, 4, Integer (List.Length), "Invalid output collected by Execute"); Util.Tests.Assert_Equals (T, "L2 ", List.Element (1), ""); Util.Tests.Assert_Equals (T, "L3", List.Element (2), ""); Util.Tests.Assert_Equals (T, "L4", List.Element (3), ""); Util.Tests.Assert_Equals (T, "L5", List.Element (4), ""); end Test_Tools_Execute; end Util.Processes.Tests;
tjquinno/openapi-generator
Ada
4,830
ads
-- OpenAPI Petstore -- This is a sample server Petstore server. For this sample, you can use the api key `special_key` to test the authorization filters. -- -- The version of the OpenAPI document: 1.0.0 -- -- -- NOTE: This package is auto generated by OpenAPI-Generator 6.0.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. with Samples.Petstore.Models; with Swagger.Clients; package Samples.Petstore.Clients is pragma Style_Checks ("-mr"); type Client_Type is new Swagger.Clients.Client_Type with null record; -- Add a new pet to the store procedure Add_Pet (Client : in out Client_Type; P_Body : in Samples.Petstore.Models.Pet_Type); -- Deletes a pet procedure Delete_Pet (Client : in out Client_Type; Pet_Id : in Swagger.Long; Api_Key : in Swagger.Nullable_UString); -- Finds Pets by status -- Multiple status values can be provided with comma separated strings procedure Find_Pets_By_Status (Client : in out Client_Type; Status : in Swagger.UString_Vectors.Vector; Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector); -- Finds Pets by tags -- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. procedure Find_Pets_By_Tags (Client : in out Client_Type; Tags : in Swagger.UString_Vectors.Vector; Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector); -- Find pet by ID -- Returns a single pet procedure Get_Pet_By_Id (Client : in out Client_Type; Pet_Id : in Swagger.Long; Result : out Samples.Petstore.Models.Pet_Type); -- Update an existing pet procedure Update_Pet (Client : in out Client_Type; P_Body : in Samples.Petstore.Models.Pet_Type); -- Updates a pet in the store with form data procedure Update_Pet_With_Form (Client : in out Client_Type; Pet_Id : in Swagger.Long; Name : in Swagger.Nullable_UString; Status : in Swagger.Nullable_UString); -- uploads an image procedure Upload_File (Client : in out Client_Type; Pet_Id : in Swagger.Long; Additional_Metadata : in Swagger.Nullable_UString; File : in Swagger.File_Part_Type; Result : out Samples.Petstore.Models.ApiResponse_Type); -- Delete purchase order by ID -- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors procedure Delete_Order (Client : in out Client_Type; Order_Id : in Swagger.UString); -- Returns pet inventories by status -- Returns a map of status codes to quantities procedure Get_Inventory (Client : in out Client_Type; Result : out Swagger.Integer_Map); -- Find purchase order by ID -- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions procedure Get_Order_By_Id (Client : in out Client_Type; Order_Id : in Swagger.Long; Result : out Samples.Petstore.Models.Order_Type); -- Place an order for a pet procedure Place_Order (Client : in out Client_Type; P_Body : in Samples.Petstore.Models.Order_Type; Result : out Samples.Petstore.Models.Order_Type); -- Create user -- This can only be done by the logged in user. procedure Create_User (Client : in out Client_Type; P_Body : in Samples.Petstore.Models.User_Type); -- Creates list of users with given input array procedure Create_Users_With_Array_Input (Client : in out Client_Type; P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector); -- Creates list of users with given input array procedure Create_Users_With_List_Input (Client : in out Client_Type; P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector); -- Delete user -- This can only be done by the logged in user. procedure Delete_User (Client : in out Client_Type; Username : in Swagger.UString); -- Get user by user name procedure Get_User_By_Name (Client : in out Client_Type; Username : in Swagger.UString; Result : out Samples.Petstore.Models.User_Type); -- Logs user into the system procedure Login_User (Client : in out Client_Type; Username : in Swagger.UString; Password : in Swagger.UString; Result : out Swagger.UString); -- Logs out current logged in user session procedure Logout_User (Client : in out Client_Type); -- Updated user -- This can only be done by the logged in user. procedure Update_User (Client : in out Client_Type; Username : in Swagger.UString; P_Body : in Samples.Petstore.Models.User_Type); end Samples.Petstore.Clients;
yannickmoy/spat
Ada
1,748
ads
------------------------------------------------------------------------------ -- Copyright (C) 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); ------------------------------------------------------------------------------ -- -- SPARK Proof Analysis Tool -- -- S.P.A.T. - Utility generic package to instantiate type safe string lists. -- ------------------------------------------------------------------------------ with Ada.Containers.Bounded_Vectors; with Ada.Text_IO; generic type Element_Type is private; with function "=" (Left : in Element_Type; Right : in Element_Type) return Boolean is <>; with function Length (Source : in Element_Type) return Natural is <>; package SPAT.String_Vectors is package Base_Vectors is new Ada.Containers.Bounded_Vectors (Index_Type => Positive, Element_Type => Element_Type, "=" => "="); type List is new Base_Vectors.Vector with private; --------------------------------------------------------------------- -- Max_Length -- -- Returns the length of the longest string in the list. --------------------------------------------------------------------- not overriding function Max_Length (Source : in List) return Ada.Text_IO.Count; private type List is new Base_Vectors.Vector with null record; end SPAT.String_Vectors;
reznikmm/matreshka
Ada
5,328
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. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Structured_Classifiers.Collections is pragma Preelaborate; package UML_Structured_Classifier_Collections is new AMF.Generic_Collections (UML_Structured_Classifier, UML_Structured_Classifier_Access); type Set_Of_UML_Structured_Classifier is new UML_Structured_Classifier_Collections.Set with null record; Empty_Set_Of_UML_Structured_Classifier : constant Set_Of_UML_Structured_Classifier; type Ordered_Set_Of_UML_Structured_Classifier is new UML_Structured_Classifier_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Structured_Classifier : constant Ordered_Set_Of_UML_Structured_Classifier; type Bag_Of_UML_Structured_Classifier is new UML_Structured_Classifier_Collections.Bag with null record; Empty_Bag_Of_UML_Structured_Classifier : constant Bag_Of_UML_Structured_Classifier; type Sequence_Of_UML_Structured_Classifier is new UML_Structured_Classifier_Collections.Sequence with null record; Empty_Sequence_Of_UML_Structured_Classifier : constant Sequence_Of_UML_Structured_Classifier; private Empty_Set_Of_UML_Structured_Classifier : constant Set_Of_UML_Structured_Classifier := (UML_Structured_Classifier_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Structured_Classifier : constant Ordered_Set_Of_UML_Structured_Classifier := (UML_Structured_Classifier_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Structured_Classifier : constant Bag_Of_UML_Structured_Classifier := (UML_Structured_Classifier_Collections.Bag with null record); Empty_Sequence_Of_UML_Structured_Classifier : constant Sequence_Of_UML_Structured_Classifier := (UML_Structured_Classifier_Collections.Sequence with null record); end AMF.UML.Structured_Classifiers.Collections;
godunko/adawebpack
Ada
2,951
ads
------------------------------------------------------------------------------ -- -- -- AdaWebPack -- -- -- ------------------------------------------------------------------------------ -- Copyright © 2021, Vadim Godunko -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- ------------------------------------------------------------------------------ with Web.GL.Objects; package Web.GL.Framebuffers is pragma Preelaborate; type WebGL_Framebuffer is new Web.GL.Objects.WebGL_Object with null record; end Web.GL.Framebuffers;
reznikmm/matreshka
Ada
4,664
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_Chart.Display_Equation_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Chart_Display_Equation_Attribute_Node is begin return Self : Chart_Display_Equation_Attribute_Node do Matreshka.ODF_Chart.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Chart_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Chart_Display_Equation_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Display_Equation_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Chart_URI, Matreshka.ODF_String_Constants.Display_Equation_Attribute, Chart_Display_Equation_Attribute_Node'Tag); end Matreshka.ODF_Chart.Display_Equation_Attributes;
reznikmm/matreshka
Ada
3,532
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Testsuite Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-2011, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with League.Application; with League.Strings; package Library_Level_Objects is SX : League.Strings.Universal_String; SY : League.Strings.Universal_String; end Library_Level_Objects;
coopht/axmpp
Ada
4,895
ads
------------------------------------------------------------------------------ -- -- -- AXMPP Project -- -- -- -- XMPP Library for Ada -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2018, Alexander Basov <[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 Alexander Basov, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with League.Strings; with XML.SAX.Pretty_Writers; with XMPP.Objects; package XMPP.MUCS is MUC_Element : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("x"); MUC_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://jabber.org/protocol/muc"); History_Element : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("history"); type MUC_Item is record Affilation : MUC_Affilation := None; Role : MUC_Role := None; end record; type Optional_Integer (Is_Set : Boolean := False) is record case Is_Set is when True => Value : Integer; when False => null; end case; end record; type MUC_History is record Max_Chars : Optional_Integer; end record; type XMPP_MUC is new XMPP.Objects.XMPP_Object with private; type XMPP_MUC_Access is access all XMPP_MUC'Class; overriding function Get_Kind (Self : XMPP_MUC) return Object_Kind; overriding procedure Serialize (Self : XMPP_MUC; Writer : in out XML.SAX.Pretty_Writers.XML_Pretty_Writer'Class); overriding procedure Set_Content (Self : in out XMPP_MUC; Parameter : League.Strings.Universal_String; Value : League.Strings.Universal_String); function Create return XMPP_MUC_Access; procedure Set_Item (Self : in out XMPP_MUC; Item : MUC_Item); procedure Set_History (Self : in out XMPP_MUC; Value : MUC_History); private type XMPP_MUC is new XMPP.Objects.XMPP_Object with record Item : MUC_Item; History : MUC_History; end record; end XMPP.MUCS;
reznikmm/matreshka
Ada
14,087
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014-2021, 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.Unchecked_Deallocation; package body Matreshka.Servlet_Dispatchers is use type Matreshka.Servlet_Registrations.Servlet_Registration_Access; Solidus : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("/"); Asterisk_Full_Stop : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("*."); Solidus_Asterisk : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("/*"); procedure Free is new Ada.Unchecked_Deallocation (Abstract_Dispatcher'Class, Dispatcher_Access); ----------------- -- Add_Mapping -- ----------------- procedure Add_Mapping (Self : not null access Context_Dispatcher'Class; Servlet : not null Matreshka.Servlet_Registrations.Servlet_Registration_Access; URL_Pattern : League.Strings.Universal_String; Success : out Boolean) is use type League.Strings.Universal_String; begin Success := False; if URL_Pattern.Is_Empty then -- Exact map to application's context root. if Self.Root_Servlet = null then Self.Root_Servlet := Servlet; Success := True; end if; elsif URL_Pattern = Solidus then -- "Default" servlet of the application. if Self.Default_Servlet = null then Self.Default_Servlet := Servlet; Success := True; end if; elsif URL_Pattern.Starts_With (Asterisk_Full_Stop) then -- Extension mapping. declare Extension : constant League.Strings.Universal_String := URL_Pattern.Tail_From (3); begin if not Extension.Is_Empty and then Extension.Index ('.') = 0 and then not Self.Extension_Servlets.Contains (Extension) then -- Extension should not be empty string, extension should not -- contains '.' character and should not be mapped already. Self.Extension_Servlets.Insert (Extension, Servlet); Success := True; end if; end; elsif URL_Pattern.Starts_With (Solidus) then -- Path mapping. declare Is_Pattern : constant Boolean := URL_Pattern.Ends_With (Solidus_Asterisk); URL : constant League.Strings.Universal_String := (if Is_Pattern then URL_Pattern.Head (URL_Pattern.Length - 2) else URL_Pattern); Path : League.String_Vectors.Universal_String_Vector := URL.Split ('/', League.Strings.Skip_Empty); Index : Positive := 1; Current : Dispatcher_Access; Parent : Dispatcher_Access := Self.all'Unchecked_Access; Aux : Dispatcher_Access; Position : Dispatcher_Maps.Cursor; begin if URL_Pattern.Ends_With (Solidus) then Path.Append (League.Strings.Empty_Universal_String); end if; loop Position := Segment_Dispatcher'Class (Parent.all).Children.Find (Path (Index)); if Dispatcher_Maps.Has_Element (Position) then Current := Dispatcher_Maps.Element (Position); else -- Current segment of path is not mapped to dispatcher, -- allocate new dispatcher. if Index = Path.Length then Current := new Servlet_Dispatcher; else Current := new Segment_Dispatcher; end if; Segment_Dispatcher'Class (Parent.all).Children.Insert (Path (Index), Current); end if; if Index = Path.Length then if Current.all not in Servlet_Dispatcher'Class then -- Change type of current dispatcher to servant -- dispatcher. Aux := Current; Current := new Servlet_Dispatcher' (Children => Segment_Dispatcher'Class (Aux.all).Children, others => <>); Segment_Dispatcher'Class (Parent.all).Children.Replace_Element (Position, Current); Free (Aux); end if; if Is_Pattern then if Servlet_Dispatcher'Class (Current.all).Mapping_Servlet = null then Servlet_Dispatcher'Class (Current.all).Mapping_Servlet := Servlet; Success := True; end if; else if Servlet_Dispatcher'Class (Current.all).Exact_Servlet = null then Servlet_Dispatcher'Class (Current.all).Exact_Servlet := Servlet; Success := True; end if; end if; exit; end if; -- Go to next segment. Parent := Current; Current := null; Index := Index + 1; Position := Dispatcher_Maps.No_Element; end loop; end; end if; end Add_Mapping; -------------- -- Dispatch -- -------------- overriding procedure Dispatch (Self : not null access constant Context_Dispatcher; Request : in out Matreshka.Servlet_HTTP_Requests.Abstract_HTTP_Servlet_Request'Class; Path : League.String_Vectors.Universal_String_Vector; Index : Positive; Servlet : in out Matreshka.Servlet_Registrations.Servlet_Registration_Access) is Servlet_Found : Boolean := False; -- Sets to True when servlet is found by this subprogram, but not by -- call to inherited one. begin if Path.Length < Index or (Path.Length = Index and Path (Index).Is_Empty) then -- Exact match of root, use root servlet when available; otherwise -- use default servlet. if Self.Root_Servlet /= null then Servlet := Self.Root_Servlet; Servlet_Found := True; elsif Self.Default_Servlet /= null then Servlet := Self.Default_Servlet; Servlet_Found := True; end if; else -- Call inherited subprogram to lookup exact servlet or longest -- path-prefix. Segment_Dispatcher (Self.all).Dispatch (Request, Path, Index, Servlet); if Servlet = null then -- Lookup servlet using extension mapping. declare Last_Segment : constant League.Strings.Universal_String := Path (Path.Length); Full_Stop_Position : constant Natural := Last_Segment.Last_Index ('.'); Position : constant Extension_Maps.Cursor := (if Full_Stop_Position /= 0 then Self.Extension_Servlets.Find (Last_Segment.Tail_From (Full_Stop_Position + 1)) else Extension_Maps.No_Element); begin if Extension_Maps.Has_Element (Position) then Servlet := Extension_Maps.Element (Position); Servlet_Found := True; end if; end; end if; if Servlet = null then -- Use application's default servlet. Servlet := Self.Default_Servlet; Servlet_Found := True; end if; end if; -- Set indices of last segment of context and servlet paths. if Servlet /= null then Request.Set_Context_Last_Segment (Index - 1); if Servlet_Found then Request.Set_Servlet_Last_Segment (Index - 1); end if; end if; end Dispatch; -------------- -- Dispatch -- -------------- overriding procedure Dispatch (Self : not null access constant Segment_Dispatcher; Request : in out Matreshka.Servlet_HTTP_Requests.Abstract_HTTP_Servlet_Request'Class; Path : League.String_Vectors.Universal_String_Vector; Index : Positive; Servlet : in out Matreshka.Servlet_Registrations.Servlet_Registration_Access) is begin if Path.Length < Index then -- Looked path is exactly what this (simple) dispatcher handles. -- Request for this path should be processed in another way by one of -- parent dispatchers. null; else declare Position : constant Dispatcher_Maps.Cursor := Self.Children.Find (Path (Index)); begin if Dispatcher_Maps.Has_Element (Position) then Dispatcher_Maps.Element (Position).Dispatch (Request, Path, Index + 1, Servlet); end if; end; end if; end Dispatch; -------------- -- Dispatch -- -------------- overriding procedure Dispatch (Self : not null access constant Servlet_Dispatcher; Request : in out Matreshka.Servlet_HTTP_Requests.Abstract_HTTP_Servlet_Request'Class; Path : League.String_Vectors.Universal_String_Vector; Index : Positive; Servlet : in out Matreshka.Servlet_Registrations.Servlet_Registration_Access) is begin if Path.Length < Index then -- Exact match, use exact match servlet when available. if Self.Exact_Servlet /= null then Servlet := Self.Exact_Servlet; Request.Set_Servlet_Last_Segment (Index - 1); end if; else -- Call inherited subprogram to lookup exact servlet or longest -- path-prefix. Segment_Dispatcher (Self.all).Dispatch (Request, Path, Index, Servlet); end if; if Servlet = null then -- Exact or longest path-prefix servlet was not found; use path -- mapping servlet when available for current path-prefix. if Self.Mapping_Servlet /= null then Servlet := Self.Mapping_Servlet; Request.Set_Servlet_Last_Segment (Index - 1); end if; end if; end Dispatch; end Matreshka.Servlet_Dispatchers;
optikos/oasis
Ada
544
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Elements.Type_Definitions; package Program.Elements.Access_Types is pragma Pure (Program.Elements.Access_Types); type Access_Type is limited interface and Program.Elements.Type_Definitions.Type_Definition; type Access_Type_Access is access all Access_Type'Class with Storage_Size => 0; end Program.Elements.Access_Types;
reznikmm/matreshka
Ada
4,623
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Form.Command_Type_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Form_Command_Type_Attribute_Node is begin return Self : Form_Command_Type_Attribute_Node do Matreshka.ODF_Form.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Form_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Form_Command_Type_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Command_Type_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Form_URI, Matreshka.ODF_String_Constants.Command_Type_Attribute, Form_Command_Type_Attribute_Node'Tag); end Matreshka.ODF_Form.Command_Type_Attributes;
zhmu/ananas
Ada
450
ads
package Discr46 is type Enum is (One, Two, Three); for Enum use (One => 1, Two => 2, Three => 3); type Rec1 (D : Boolean := False) is record case D is when False => null; when True => T : Integer; end case; end record; type Rec2 is record R : Rec1; C : Character; end record; type Arr is array (Enum) of Rec2; A : Arr; function F (Id : Enum) return Integer; end Discr46;
reznikmm/matreshka
Ada
4,017
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- 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.Servlet_Containers; package body Matreshka.Servlet_Servers.FastCGI_Servers is ---------------- -- Initialize -- ---------------- procedure Initialize (Self : not null access FastCGI_Server'Class; Success : out Boolean) is begin -- XXX Not implemented yet. Success := False; end Initialize; ------------------- -- Set_Container -- ------------------- overriding procedure Set_Container (Self : not null access FastCGI_Server; Container : Matreshka.Servlet_Containers.Servlet_Container_Access) is begin null; end Set_Container; end Matreshka.Servlet_Servers.FastCGI_Servers;
AdaCore/training_material
Ada
772
ads
with Test_Suite; use Test_Suite; with Test_Suite.Test; package Drawable_Chars.Tests is procedure Test_By_Black_Ratio (TC : Test_Case_T'Class); package Pkg_Test_By_Black_Ratio is new Test_Suite.Test (Name => "Sort (by black ratio)", Run_Test => Test_By_Black_Ratio); procedure Test_Identical_Values (TC : Test_Case_T'Class); package Pkg_Test_Identical_Values is new Test_Suite.Test (Name => "Sort (identical values)", Run_Test => Test_Identical_Values); procedure Test_Closest_By_Height (TC : Test_Case_T'Class); package Pkg_Test_Closest_By_Height is new Test_Suite.Test (Name => "Closest (by height)", Run_Test => Test_Closest_By_Height); end Drawable_Chars.Tests;
vikasbidhuri1995/DW1000
Ada
2,317
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.BSP; with DW1000.Types; -- This package provides a generic API for typed read-only registers. -- -- Register_Type is the typed representation of the register (e.g. a record -- with a representation clause matching the layout of the register according -- to the DW1000 User Manual). -- -- Register_ID is the numerical ID of the register file according to the -- DW1000 User Manual. -- -- Sub_Register is the offset of the sub-register within the register file. -- If the register file has no sub-registers then this should be set to 0. generic type Register_Type is private; Register_ID : DW1000.Types.Bits_6; Sub_Register : DW1000.Types.Bits_15 := 0; package DW1000.Generic_RO_Register_Driver is procedure Read (Reg : out Register_Type) with Global => (In_Out => DW1000.BSP.Device_State), Depends => (DW1000.BSP.Device_State => DW1000.BSP.Device_State, Reg => DW1000.BSP.Device_State), SPARK_Mode => On; end DW1000.Generic_RO_Register_Driver;
Rodeo-McCabe/orka
Ada
15,052
adb
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2016 onox <[email protected]> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with Ada.Command_Line; with Ada.Directories; with Ada.Real_Time; with Ada.Text_IO; with Ada.Exceptions; with GL.Low_Level.Enums; with GL.Objects.Samplers; with GL.Objects.Textures; with GL.Pixels; with GL.Toggles; with GL.Types; with Orka.Behaviors; with Orka.Contexts; with Orka.Cameras.Rotate_Around_Cameras; with Orka.Culling; with Orka.Debug; with Orka.Futures; with Orka.Jobs; with Orka.Loggers.Terminal; with Orka.Logging; with Orka.Loops; with Orka.Rendering.Framebuffers; with Orka.Rendering.Programs.Modules; with Orka.Rendering.Programs.Uniforms; with Orka.Rendering.Textures; with Orka.Resources.Loaders; with Orka.Resources.Locations.Directories; with Orka.Resources.Managers; with Orka.Resources.Models.glTF; with Orka.Scenes.Singles.Trees; with Orka.Types; with Orka.Windows.GLFW; with Orka_Package_glTF; procedure Orka_GLTF is Width : constant := 1280; Height : constant := 720; Samples : constant := 2; use type GL.Types.Single; Light_Position : constant Orka.Types.Singles.Vector4 := (0.0, 0.0, 0.0, 1.0); ---------------------------------------------------------------------- procedure Load_Texture (Texture : in out GL.Objects.Textures.Texture) is Pixels : aliased constant GL.Types.Single_Array -- White := (0.5, 0.5, 0.5, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, -- Red 0.5, 0.5, 0.5, 1.0, 0.0, 0.0, 0.5, 0.5, 0.5, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.5, 0.5, 1.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1.0, 0.0, 0.0, 0.5, 0.5, 0.5, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.5, 0.5, 1.0, 0.0, 0.0, 0.5, 0.5, 0.5, -- Green 0.5, 0.5, 0.5, 0.0, 1.0, 0.0, 0.5, 0.5, 0.5, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.5, 0.5, 0.5, 0.0, 1.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.0, 1.0, 0.0, 0.5, 0.5, 0.5, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.5, 0.5, 0.5, 0.0, 1.0, 0.0, 0.5, 0.5, 0.5, -- Blue 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 0.5, 0.5, 0.5, -- Cyan 0.5, 0.5, 0.5, 0.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.0, 1.0, 1.0, 0.5, 0.5, 0.5, -- Yellow 0.5, 0.5, 0.5, 1.0, 1.0, 0.0, 0.5, 0.5, 0.5, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 0.5, 0.5, 0.5, 1.0, 1.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1.0, 1.0, 0.0, 0.5, 0.5, 0.5, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 0.5, 0.5, 0.5, 1.0, 1.0, 0.0, 0.5, 0.5, 0.5, -- Magenta 0.5, 0.5, 0.5, 1.0, 0.0, 1.0, 0.5, 0.5, 0.5, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.5, 0.5, 0.5, 1.0, 0.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1.0, 0.0, 1.0, 0.5, 0.5, 0.5, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.5, 0.5, 0.5, 1.0, 0.0, 1.0, 0.5, 0.5, 0.5); begin Texture.Allocate_Storage (1, 1, GL.Pixels.RGBA8, 4, 4, 7); Texture.Load_From_Data (0, 0, 0, 0, 4, 4, 7, GL.Pixels.RGB, GL.Pixels.Float, Pixels'Address); end Load_Texture; package Job_System renames Orka_Package_glTF.Job_System; package Loader renames Orka_Package_glTF.Loader; use Ada.Exceptions; begin if Ada.Command_Line.Argument_Count /= 1 then Ada.Text_IO.Put_Line ("Usage: <path to .gltf file"); Job_System.Shutdown; Loader.Shutdown; return; end if; Orka.Logging.Set_Logger (Orka.Loggers.Terminal.Create_Logger (Level => Orka.Loggers.Debug)); declare Library : constant Orka.Contexts.Library'Class := Orka.Windows.GLFW.Initialize (Major => 4, Minor => 2, Debug => True); Window : aliased Orka.Windows.Window'Class := Library.Create_Window (Width, Height, Resizable => True); W_Ptr : constant Orka.Windows.Window_Ptr := Orka.Windows.Window_Ptr'(Window'Unchecked_Access); Context : Orka.Contexts.Context'Class := Window.Context; begin Orka.Debug.Set_Log_Messages (Enable => True, Raise_API_Error => True); -- Enable some features Context.Enable (Orka.Contexts.Reversed_Z); if Samples > 0 then Context.Enable (Orka.Contexts.Multisample); end if; GL.Toggles.Enable (GL.Toggles.Cull_Face); GL.Toggles.Enable (GL.Toggles.Depth_Test); declare Full_Path : constant String := Ada.Command_Line.Argument (1); Location_Path : constant String := Ada.Directories.Containing_Directory (Full_Path); Model_Path : constant String := Ada.Directories.Simple_Name (Full_Path); use Orka.Resources; Location_Shaders : constant Locations.Location_Ptr := Locations.Directories.Create_Location ("../data/shaders"); package LE renames GL.Low_Level.Enums; use Orka.Rendering.Programs; use Orka.Rendering.Framebuffers; P_1 : Program := Create_Program (Modules.Create_Module (Location_Shaders, VS => "tools/gltf.vert", FS => "tools/gltf.frag")); Uni_View : constant Uniforms.Uniform := P_1.Uniform ("view"); Uni_Proj : constant Uniforms.Uniform := P_1.Uniform ("proj"); Uni_Light : constant Uniforms.Uniform := P_1.Uniform ("lightPosition"); ---------------------------------------------------------------------- Uni_Texture : constant Uniforms.Uniform_Sampler := P_1.Uniform_Sampler ("diffuseTexture"); Uni_Dither : constant Uniforms.Uniform_Sampler := P_1.Uniform_Sampler ("ditherTexture"); use GL.Objects.Textures; use GL.Objects.Samplers; Texture_1 : Texture (LE.Texture_2D_Array); Texture_2 : constant Texture := Orka.Rendering.Textures.Bayer_Dithering_Pattern; Texture_3 : Texture (LE.Texture_2D_Multisample); Texture_4 : Texture (LE.Texture_2D_Multisample); Sampler_1 : Sampler; Sampler_2 : constant Sampler := Orka.Rendering.Textures.Bayer_Dithering_Pattern; ---------------------------------------------------------------------- FB_1 : Framebuffer := Create_Framebuffer (Width, Height, Samples, Context); FB_D : constant Framebuffer := Get_Default_Framebuffer (Window); use Orka.Cameras; Lens : constant Lens_Ptr := new Camera_Lens'Class'(Create_Lens (Width, Height, 45.0, Context)); Current_Camera : constant Camera_Ptr := new Camera'Class'(Camera'Class (Rotate_Around_Cameras.Create_Camera (Window.Pointer_Input, Lens, FB_1))); use Orka.Culling; Culler_1 : constant Culler_Ptr := new Culler'Class'(Culler'Class (Create_Culler (Location_Shaders))); ---------------------------------------------------------------------- task Resource_Test; Manager : constant Managers.Manager_Ptr := Managers.Create_Manager; Group : aliased Orka.Resources.Models.Group_Access := null; use type Orka.Resources.Models.Group_Access; task body Resource_Test is use Ada.Real_Time; Loader_glTF : constant Loaders.Loader_Ptr := Models.glTF.Create_Loader (Manager); Location_Models : constant Locations.Location_Ptr := Locations.Directories.Create_Location (Location_Path); begin Loader.Add_Location (Location_Models, Loader_glTF); declare T1 : constant Time := Clock; Future_Ref : Orka.Futures.Pointers.Reference := Loader.Load (Model_Path).Get; use type Orka.Futures.Status; Resource_Status : Orka.Futures.Status; Resource_Future : constant Orka.Futures.Future_Access := Future_Ref.Value; begin select Resource_Future.Wait_Until_Done (Resource_Status); pragma Assert (Resource_Status = Orka.Futures.Done); pragma Assert (Manager.Contains (Model_Path)); declare Model_1 : constant Models.Model_Ptr := Models.Model_Ptr (Manager.Resource (Model_Path)); Handle : Orka.Futures.Pointers.Mutable_Pointer; Create_Instance_Job : constant Orka.Jobs.Job_Ptr := new Orka_Package_glTF.Create_Group_Job' (Orka.Jobs.Abstract_Job with Model => Model_1, Culler => Culler_1, Group => Group'Unchecked_Access); begin Job_System.Queue.Enqueue (Create_Instance_Job, Handle); end; or delay until T1 + Milliseconds (2000); Ada.Text_IO.Put_Line ("Not completed loading: " & Future_Ref.Current_Status'Image); end select; end; exception when Error : others => Ada.Text_IO.Put_Line ("Error loading resource: " & Exception_Information (Error)); end Resource_Test; begin -- Clear color to black and depth to 0.0 (if using reversed Z) FB_1.Set_Default_Values ((Color => (0.0, 0.0, 0.0, 1.0), Depth => (if Context.Enabled (Orka.Contexts.Reversed_Z) then 0.0 else 1.0), others => <>)); Texture_3.Allocate_Storage (1, Samples, GL.Pixels.RGBA8, Width, Height, 1); Texture_4.Allocate_Storage (1, Samples, GL.Pixels.Depth32F_Stencil8, Width, Height, 1); Sampler_1.Set_X_Wrapping (Clamp_To_Edge); Sampler_1.Set_Y_Wrapping (Clamp_To_Edge); Sampler_1.Set_Minifying_Filter (Nearest); Sampler_1.Set_Magnifying_Filter (Nearest); Sampler_1.Bind (0); Sampler_2.Bind (1); FB_1.Attach (Texture_3); FB_1.Attach (Texture_4); -- Load checkerboard texture array Load_Texture (Texture_1); Uni_Texture.Verify_Compatibility (Texture_1); Uni_Dither.Verify_Compatibility (Texture_2); Orka.Rendering.Textures.Bind (Texture_1, Orka.Rendering.Textures.Texture, 0); Orka.Rendering.Textures.Bind (Texture_2, Orka.Rendering.Textures.Texture, 1); Uni_Proj.Set_Matrix (Current_Camera.Projection_Matrix); Uni_Light.Set_Vector (Light_Position); Window.Set_Title ("glTF viewer - " & Model_Path); declare Group_Added : Boolean := False; use Ada.Real_Time; procedure Add_Behavior (Object : Orka.Behaviors.Behavior_Ptr); procedure Render_Scene (Scene : not null Orka.Behaviors.Behavior_Array_Access; Camera : Orka.Cameras.Camera_Ptr) is begin Camera.FB.Use_Framebuffer; Camera.FB.Clear; Uni_View.Set_Matrix (Camera.View_Matrix); declare use Orka.Cameras.Transforms; begin -- TODO Don't re-compute projection matrix every frame Culler_1.Bind (Camera.Projection_Matrix * Camera.View_Matrix); end; if Group /= null then if not Group_Added then Group_Added := True; declare Instance_1 : Orka.Resources.Models.Model_Instance_Ptr := new Orka_Package_glTF.No_Behavior'(Orka.Resources.Models.Model_Instance with Position => (0.0, 0.0, 0.0, 1.0)); begin Group.Add_Instance (Instance_1); Add_Behavior (Orka.Behaviors.Behavior_Ptr (Instance_1)); -- For Rotate_Around_Camera and Look_At_Camera if Camera.all in Observing_Camera'Class then Observing_Camera'Class (Camera.all).Look_At (Orka.Behaviors.Behavior_Ptr (Instance_1)); end if; end; end if; Group.Cull; P_1.Use_Program; -- Render objects in scene here for Behavior of Scene.all loop Behavior.Render; end loop; Group.Render; -- Resolve the multiple samples in the FBO Camera.FB.Resolve_To (FB_D); Group.After_Render; for Behavior of Scene.all loop Behavior.After_Render; end loop; end if; end Render_Scene; package Loops is new Orka.Loops (Time_Step => Ada.Real_Time.Microseconds (2_083), Frame_Limit => Ada.Real_Time.Microseconds (8_334), Window => W_Ptr, Camera => Current_Camera, Job_Manager => Job_System); procedure Add_Behavior (Object : Orka.Behaviors.Behavior_Ptr) is begin Loops.Scene.Add (Object); end Add_Behavior; begin Loops.Scene.Add (Orka.Behaviors.Null_Behavior); Loops.Handler.Enable_Limit (False); Loops.Run_Loop (Render_Scene'Access); end; exception when Error : others => Ada.Text_IO.Put_Line ("Error: " & Exception_Information (Error)); end; end; Job_System.Shutdown; Loader.Shutdown; Ada.Text_IO.Put_Line ("Shutdown job system and loader"); exception when Error : others => Ada.Text_IO.Put_Line ("Error: " & Exception_Information (Error)); end Orka_GLTF;
MinimSecure/unum-sdk
Ada
791
ads
-- Copyright (C) 2011-2016 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Pck is function Ident (I : Integer) return Integer; end Pck;
charlie5/lace
Ada
2,152
ads
with openGL.Texture, openGL.GlyphImpl.Texture, freetype_c.FT_GlyphSlot; package openGL.Glyph.texture -- -- A specialisation of Glyph for creating texture glyphs. -- is type Item is new Glyph.item with private; type View is access all Item'Class; ----------- -- Forge -- function to_Glyph (glyth_Slot : in freetype_c.FT_GlyphSlot.item; texture_Id : in openGL.Texture.texture_Name; xOffset, yOffset : in Integer; Width, Height : in Integer) return Glyph.texture.item; -- -- glyth_Slot: The Freetype glyph to be processed. -- texture_id: The id of the texture that this glyph will be drawn in. -- xOffset, yOffset: The x and y offset into the parent texture to draw this glyph. -- Width, Height: The width and height (number of rows) of the parent texture. function new_Glyph (glyth_Slot : in freetype_c.FT_GlyphSlot.item; texture_Id : in openGL.Texture.texture_Name; xOffset, yOffset : in Integer; Width, Height : in Integer) return Glyph.texture.view; -- -- glyth_Slot: The Freetype glyph to be processed. -- texture_Id: The id of the texture that this glyph will be drawn in. -- xOffset, yOffset: The x,y offset into the parent texture to draw this glyph. -- Width, Height: The width and height (number of rows) of the parent texture. -------------- -- Attributes -- function Quad (Self : in Item; Pen : in Vector_3) return GlyphImpl.texture.Quad_t; --------------- -- Operations -- overriding function render (Self : in Item; Pen : in Vector_3; renderMode : in Integer) return Vector_3; -- -- Render this glyph at the current pen position. -- -- Pen: The current pen position. -- renderMode: Render mode to display. -- -- Returns the advance distance for this glyph. private type Item is new Glyph.item with null record; end openGL.Glyph.texture;
stcarrez/ada-keystore
Ada
1,966
ads
----------------------------------------------------------------------- -- akt-commands-mount -- Mount the keystore on the filesystem for direct access -- Copyright (C) 2019, 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. ----------------------------------------------------------------------- with AKT.Commands.Drivers; private package AKT.Commands.Mount is HAS_FUSE : constant Boolean := True; type Command_Type is new AKT.Commands.Drivers.Command_Type with private; -- Mount the keystore on the filesystem. overriding procedure Execute (Command : in out Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type); -- Setup the command before parsing the arguments and executing it. overriding procedure Setup (Command : in out Command_Type; Config : in out GNAT.Command_Line.Command_Line_Configuration; Context : in out Context_Type); procedure Register (Driver : in out AKT.Commands.Drivers.Driver_Type); private type Command_Type is new AKT.Commands.Drivers.Command_Type with record Foreground : aliased Boolean := False; Verbose_Fuse : aliased Boolean := False; Enable_Cache : aliased Boolean := False; end record; end AKT.Commands.Mount;
reznikmm/spawn
Ada
10,476
adb
-- -- Copyright (C) 2018-2022, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -- with Ada.Containers.Synchronized_Queue_Interfaces; with Ada.Containers.Unbounded_Synchronized_Queues; with Ada.Containers.Vectors; with Ada.Unchecked_Deallocation; pragma Warnings (Off); with System.Win32; pragma Warnings (On); with Spawn.Windows_API; with Spawn.Internal.Windows; package body Spawn.Internal.Monitor is use all type Spawn.Common.Pipe_Kinds; subtype Context is Internal.Context; subtype Stream_Element_Buffer is Internal.Stream_Element_Buffer; type Process_Access is access all Process'Class; procedure Start_Process (Self : access Process'Class); package Command_Queue_Interfaces is new Ada.Containers.Synchronized_Queue_Interfaces (Command); package Command_Queues is new Ada.Containers.Unbounded_Synchronized_Queues (Queue_Interfaces => Command_Queue_Interfaces); package Read_Write_Ex is new Windows_API.Generic_Read_Write_Ex (Context); procedure Standard_Input_Callback (dwErrorCode : Windows_API.DWORD; dwNumberOfBytesTransfered : Windows_API.DWORD; lpOverlapped : access Context) with Convention => Stdcall; procedure Standard_Output_Callback (dwErrorCode : Windows_API.DWORD; dwNumberOfBytesTransfered : Windows_API.DWORD; lpOverlapped : access Context) with Convention => Stdcall; procedure Standard_Error_Callback (dwErrorCode : Windows_API.DWORD; dwNumberOfBytesTransfered : Windows_API.DWORD; lpOverlapped : access Context) with Convention => Stdcall; procedure Do_Watch_Pipe (Process : not null Process_Access; Kind : Spawn.Common.Standard_Pipe); Callback : constant array (Stdout .. Stderr) of Read_Write_Ex.Callback := (Standard_Output_Callback'Access, Standard_Error_Callback'Access); Queue : Command_Queues.Queue; package Poll is procedure Wake_Up; procedure Add_Process (Process : Process_Access); procedure Wait_Process_Death (Timeout : Duration); end Poll; package body Poll is package Info_Vectors is new Ada.Containers.Vectors (Positive, Process_Access); type pollfd_array_access is access all Windows_API.HANDLE_Array; procedure Free is new Ada.Unchecked_Deallocation (Windows_API.HANDLE_Array, pollfd_array_access); List : Info_Vectors.Vector; fds : pollfd_array_access; Last : Natural := 0; wake : Windows_API.HANDLE := 0; ----------------- -- Add_Process -- ----------------- procedure Add_Process (Process : Process_Access) is begin if fds = null then -- Make event for wake up poll and initialize fds wake := Windows_API.CreateEventW (lpSecurityAttributes => null, bManualReset => System.Win32.FALSE, bInitialState => System.Win32.FALSE, lpName => null); fds := new Windows_API.HANDLE_Array (1 .. 5); fds (1) := wake; List.Append (null); -- Dummy value Last := 1; elsif fds'Length < Last + 1 then -- Grow fds by factor of 1.5 declare Old : pollfd_array_access := fds; begin fds := new Windows_API.HANDLE_Array (1 .. fds'Last * 3 / 2); fds (Old'Range) := Old.all; Free (Old); end; end if; Last := Last + 1; Process.Index := Last; fds (Last) := Process.pid.hProcess; if List.Last_Index < Last then List.Append (Process); else List (Last) := (Process); end if; end Add_Process; ------------------------ -- Wait_Process_Death -- ------------------------ procedure Wait_Process_Death (Timeout : Duration) is use type Windows_API.DWORD; procedure Swap (Left, Right : in out Windows_API.HANDLE); procedure Swap (Left, Right : in out Windows_API.HANDLE) is Copy : constant Windows_API.HANDLE := Left; begin Left := Right; Right := Copy; end Swap; Result : Windows_API.DWORD; Index : Integer; Process : Process_Access; begin loop Result := Windows_API.WaitForMultipleObjectsEx (nCount => Windows_API.DWORD (Last), lpHandles => fds.all, bWaitAll => System.Win32.FALSE, dwMilliseconds => Windows_API.DWORD (Timeout * 1000.0), bAlertable => System.Win32.TRUE); if Result /= Windows_API.WAIT_IO_COMPLETION then exit; end if; end loop; Index := Integer (Result) + 1; if Result = Windows_API.WAIT_TIMEOUT then return; elsif Index = 1 then -- Wake up event triggered return; elsif Index <= Last then -- Some process died, drop it from fds and List Process := List (Index); Swap (fds (Index), fds (Last)); List.Swap (Index, Last); List.Delete_Last; Last := Last - 1; Windows.On_Process_Died (Process.all); else raise Program_Error with "WaitForMultipleObjectsEx FAILED"; end if; end Wait_Process_Death; ------------- -- Wake_Up -- ------------- procedure Wake_Up is use type Windows_API.BOOL; use type Windows_API.HANDLE; Result : Windows_API.BOOL; begin if wake /= 0 then -- If wake has been created Result := Windows_API.SetEvent (wake); pragma Assert (Result /= System.Win32.FALSE); end if; end Wake_Up; end Poll; ------------------- -- Do_Watch_Pipe -- ------------------- procedure Do_Watch_Pipe (Process : not null Process_Access; Kind : Spawn.Common.Standard_Pipe) is use type Ada.Streams.Stream_Element_Count; use type Windows_API.BOOL; Ok : Windows_API.BOOL; Last : Ada.Streams.Stream_Element_Count; begin case Kind is when Stdout | Stderr => Ok := Read_Write_Ex.ReadFileEx (hFile => Process.pipe (Kind).Handle, lpBuffer => Process.pipe (Kind).Buffer, nNumberOfBytesToRead => Process.pipe (Kind).Buffer'Length, lpOverlapped => Process.pipe (Kind)'Access, lpCompletionRoutine => Callback (Kind)); if Ok = System.Win32.FALSE then Process.Listener.Error_Occurred (Integer (System.Win32.GetLastError)); else Process.pipe (Kind).Waiting_IO := True; end if; when Stdin => Last := Process.pipe (Kind).Last; if Last not in Stream_Element_Buffer'Range then Last := Last - Stream_Element_Buffer'Last; end if; Ok := Read_Write_Ex.WriteFileEx (hFile => Process.pipe (Kind).Handle, lpBuffer => Process.pipe (Kind).Buffer, nNumberOfBytesToWrite => Windows_API.DWORD (Last), lpOverlapped => Process.pipe (Kind)'Access, lpCompletionRoutine => Standard_Input_Callback'Access); if Ok = System.Win32.FALSE then Process.Listener.Error_Occurred (Integer (System.Win32.GetLastError)); else Process.pipe (Kind).Waiting_IO := True; end if; end case; end Do_Watch_Pipe; ------------- -- Enqueue -- ------------- procedure Enqueue (Value : Command) is begin Queue.Enqueue (Value); Poll.Wake_Up; end Enqueue; ---------------- -- Loop_Cycle -- ---------------- procedure Loop_Cycle (Timeout : Duration) is use type Ada.Containers.Count_Type; Command : Monitor.Command; begin while Queue.Current_Use > 0 loop Queue.Dequeue (Command); case Command.Kind is when Start => Start_Process (Command.Process); when Close_Pipe => Windows.Do_Close_Pipe (Command.Process.all, Command.Pipe); when Watch_Pipe => Do_Watch_Pipe (Command.Process, Command.Pipe); end case; end loop; Poll.Wait_Process_Death (Timeout); end Loop_Cycle; ----------------------------- -- Standard_Error_Callback -- ----------------------------- procedure Standard_Error_Callback (dwErrorCode : Windows_API.DWORD; dwNumberOfBytesTransfered : Windows_API.DWORD; lpOverlapped : access Context) is begin Windows.IO_Callback (dwErrorCode, dwNumberOfBytesTransfered, lpOverlapped, Stderr); end Standard_Error_Callback; ------------------------------ -- Standard_Output_Callback -- ------------------------------ procedure Standard_Output_Callback (dwErrorCode : Windows_API.DWORD; dwNumberOfBytesTransfered : Windows_API.DWORD; lpOverlapped : access Context) is begin Windows.IO_Callback (dwErrorCode, dwNumberOfBytesTransfered, lpOverlapped, Stdout); end Standard_Output_Callback; ----------------------------- -- Standard_Input_Callback -- ----------------------------- procedure Standard_Input_Callback (dwErrorCode : Windows_API.DWORD; dwNumberOfBytesTransfered : Windows_API.DWORD; lpOverlapped : access Context) is begin Windows.IO_Callback (dwErrorCode, dwNumberOfBytesTransfered, lpOverlapped, Stdin); end Standard_Input_Callback; ------------------- -- Start_Process -- ------------------- procedure Start_Process (Self : access Process'Class) is procedure On_Start; procedure On_Start is begin Poll.Add_Process (Process_Access (Self)); end On_Start; begin Windows.Do_Start_Process (Self.all, On_Start'Access); end Start_Process; end Spawn.Internal.Monitor;
jrcarter/Lined
Ada
3,571
ads
-- Each command may be preceded by line numbers that indicate the lines to operate on -- There is also the concept of the current line number ("dot") -- Line_Numbers parses commands to extract line numbers into Start and Stop -- -- A line number is made up of one or more components, which can be -- <number> a non-negative integer representing an absolute line number -- . dot, the current line number -- $ the last line -- /<pattern>/ forward search: the first line after the current line that contains <pattern>, a regular expression; the search wraps -- \<pattern>\ backward search: the first line before the current line that contains <pattern>; the search wraps -- The last pattern specified is remembered and returned by Searching.Current. The shortcuts // and \\ mean to search for the saved -- pattern -- -- Nultiple components are separated by the mathematical operators + or -; the line number is the mathematical result of applying -- these operators to the components -- .+1 the line after the current line -- $-10 the 10th line before the last line -- -- Multiple line numbers are separated by a comma (,) or semicolon (;) -- A line number followed by a semicolon sets the current line number to the given line number, thus affecting the use of dot in -- following line numbers; -- a line number followed by a comma does not affect the current line number -- /abc/;//;// the 3rd following occurence of "abc" with Lined.Buffer; with Lined.Searching; package Lined.Line_Numbers is procedure Get_Line_Number (Source : in String; Current : in Natural; Last : out Natural; Value : out Natural) with Pre => Source'Length > 0 and Source'Last < Integer'Last; -- Gets a full line number (sum/difference of components) from Source -- Current is the current line number -- The last position in Source that is part of the line number is returned in Last -- Value is the line number obtained -- Last < Source'First if Source doesn't begin with a line number procedure Parse (Command : in String; Current : in out Natural; Last : out Natural) with Pre => Command'Length > 0 and Command'Last < Integer'Last; -- Parses line numbers from the beginning of Command; Current is the current line number -- Last is set to the index in Command of the last character included in a line number; if there are no line numbers, Last = 0 -- Sets the results of Num_Numbers, Start, and Stop (and Searching.Current) -- If Command has line numbers that are search patterns, Searching.Current will return the last pattern encountered -- If Command has no line numbers, Num_Numbers will return 0; Start and Stop will be set to the current line number, and -- Searching.Current is unchanged -- If Command has a single line number, Num_Numbers will return 1; Start and Stop will return that line number; -- Current is unchanged -- If Command has 2 line numbers, Num_Numbers will return 2; Start will return the first number; Stop will return the second -- number; Current will be changed if they are spearated by a semicolon -- If Command has > 2 line numbers, Num_Numbers will return 2; Start will return the next to last number; Stop will return the -- last number; Current will be changed if any of the line number separators are semicolons subtype Number_Count is Integer range 0 .. 2; function Num_Numbers return Number_Count; function Start return Natural; function Stop return Natural; -- These functions initially return 0 end Lined.Line_Numbers;
DrenfongWong/tkm-rpc
Ada
401
ads
with Ada.Unchecked_Conversion; package Tkmrpc.Response.Ike.Isa_Reset.Convert is function To_Response is new Ada.Unchecked_Conversion ( Source => Isa_Reset.Response_Type, Target => Response.Data_Type); function From_Response is new Ada.Unchecked_Conversion ( Source => Response.Data_Type, Target => Isa_Reset.Response_Type); end Tkmrpc.Response.Ike.Isa_Reset.Convert;
tum-ei-rcs/StratoX
Ada
9,285
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M -- -- -- -- S p e c -- -- (ARM Cortex M4 Version) -- -- -- -- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Modified for STM32F4(27) by Martin Becker ([email protected]) -- -- + Denorm=True -- pragma Restrictions (No_Exception_Propagation); -- Only local exception handling is supported in this profile pragma Restrictions (No_Exception_Registration); -- Disable exception name registration. This capability is not used because -- it is only required by exception stream attributes which are not supported -- in this run time. pragma Restrictions (No_Implicit_Dynamic_Code); -- Pointers to nested subprograms are not allowed in this run time, in order -- to prevent the compiler from building "trampolines". pragma Restrictions (No_Finalization); -- Controlled types are not supported in this run time pragma Profile (Ravenscar); -- This is a Ravenscar run time pragma Restrictions (No_Task_At_Interrupt_Priority); -- On Cortex-M, it is not possible to have tasks at Interrupt_Priority, as -- the context switch is triggered by the Pend_SV interrupt, which is at -- lowest priority. pragma Discard_Names; -- Disable explicitly the generation of names associated with entities in -- order to reduce the amount of storage used. These names are not used anyway -- (attributes such as 'Image and 'Value are not supported in this run time). package System is pragma Pure; -- Note that we take advantage of the implementation permission to make -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada -- 2005, this is Pure in any case (AI-362). pragma No_Elaboration_Code_All; -- Allow the use of that restriction in units that WITH this unit type Name is (SYSTEM_NAME_GNAT); System_Name : constant Name := SYSTEM_NAME_GNAT; -- System-Dependent Named Numbers Min_Int : constant := Long_Long_Integer'First; Max_Int : constant := Long_Long_Integer'Last; Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; Max_Base_Digits : constant := Long_Long_Float'Digits; Max_Digits : constant := Long_Long_Float'Digits; Max_Mantissa : constant := 63; Fine_Delta : constant := 2.0 ** (-Max_Mantissa); Tick : constant := 0.000_001; -- Storage-related Declarations type Address is private; pragma Preelaborable_Initialization (Address); Null_Address : constant Address; Storage_Unit : constant := 8; Word_Size : constant := 32; Memory_Size : constant := 2 ** 32; -- Address comparison function "<" (Left, Right : Address) return Boolean; function "<=" (Left, Right : Address) return Boolean; function ">" (Left, Right : Address) return Boolean; function ">=" (Left, Right : Address) return Boolean; function "=" (Left, Right : Address) return Boolean; pragma Import (Intrinsic, "<"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, ">="); pragma Import (Intrinsic, "="); -- Other System-Dependent Declarations type Bit_Order is (High_Order_First, Low_Order_First); Default_Bit_Order : constant Bit_Order := Bit_Order'Val (Standard'Default_Bit_Order); pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning -- Priority-related Declarations (RM D.1) -- 241 .. 255 corresponds to priority level 15 .. 1 Max_Interrupt_Priority : constant Positive := 255; Max_Priority : constant Positive := 240; subtype Any_Priority is Integer range 0 .. 255; subtype Priority is Any_Priority range 0 .. 240; subtype Interrupt_Priority is Any_Priority range 241 .. 255; Default_Priority : constant Priority := 120; private type Address is mod Memory_Size; Null_Address : constant Address := 0; -------------------------------------- -- System Implementation Parameters -- -------------------------------------- -- These parameters provide information about the target that is used by -- the compiler. They are in the private part of System, where they can be -- accessed using the special circuitry in the Targparm unit whose source -- should be consulted for more detailed descriptions of the individual -- switch values. -- see https://www2.adacore.com/gap-static/GNAT_Book/html/ -- frontend/targparm__ads.htm -- Attributes are only true if the target *reliably* supports features. -- Reliably means, for all settings of the relevant compiler switches, -- since we cannot control the user setting of these switches. Atomic_Sync_Default : constant Boolean := False; Backend_Divide_Checks : constant Boolean := False; -- frontend must generate checks Backend_Overflow_Checks : constant Boolean := True; -- backend or HW generates OVF checks Command_Line_Args : constant Boolean := False; -- does target take cmd lines? Configurable_Run_Time : constant Boolean := True; Denorm : constant Boolean := True; -- set to True if target reliably supports denormals with flag "-m.." Duration_32_Bits : constant Boolean := False; Exit_Status_Supported : constant Boolean := False; Fractional_Fixed_Ops : constant Boolean := False; Frontend_Layout : constant Boolean := False; Machine_Overflows : constant Boolean := False; -- S'Machine_Overflows Machine_Rounds : constant Boolean := True; -- S'Machine_Rounds Preallocated_Stacks : constant Boolean := True; Signed_Zeros : constant Boolean := True; Stack_Check_Default : constant Boolean := False; -- stack checking is off by default Stack_Check_Probes : constant Boolean := False; -- target does not probe stack Stack_Check_Limits : constant Boolean := False; Support_Aggregates : constant Boolean := True; Support_Composite_Assign : constant Boolean := True; Support_Composite_Compare : constant Boolean := True; Support_Long_Shifts : constant Boolean := True; Always_Compatible_Rep : constant Boolean := True; Suppress_Standard_Library : constant Boolean := True; Use_Ada_Main_Program_Name : constant Boolean := False; Frontend_Exceptions : constant Boolean := False; ZCX_By_Default : constant Boolean := True; -- zero-cost exceptions are active end System;
reznikmm/matreshka
Ada
3,780
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 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$ ------------------------------------------------------------------------------ with Ada.Containers.Vectors; with Servlet.HTTP_Parameters; package Servlet.HTTP_Parameter_Vectors is pragma Preelaborate; package HTTP_Parameter_Vectors is new Ada.Containers.Vectors (Positive, Servlet.HTTP_Parameters.HTTP_Parameter, Servlet.HTTP_Parameters."="); type HTTP_Parameter_Vector is new HTTP_Parameter_Vectors.Vector with null record; end Servlet.HTTP_Parameter_Vectors;
zhmu/ananas
Ada
9,051
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 2 8 -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System.Storage_Elements; with System.Unsigned_Types; package body System.Pack_28 is subtype Bit_Order is System.Bit_Order; Reverse_Bit_Order : constant Bit_Order := Bit_Order'Val (1 - Bit_Order'Pos (System.Default_Bit_Order)); subtype Ofs is System.Storage_Elements.Storage_Offset; subtype Uns is System.Unsigned_Types.Unsigned; subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7; use type System.Storage_Elements.Storage_Offset; use type System.Unsigned_Types.Unsigned; type Cluster is record E0, E1, E2, E3, E4, E5, E6, E7 : Bits_28; end record; for Cluster use record E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1; E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1; E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1; E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1; E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1; E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1; E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1; E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1; end record; for Cluster'Size use Bits * 8; for Cluster'Alignment use Integer'Min (Standard'Maximum_Alignment, 1 + 1 * Boolean'Pos (Bits mod 2 = 0) + 2 * Boolean'Pos (Bits mod 4 = 0)); -- Use maximum possible alignment, given the bit field size, since this -- will result in the most efficient code possible for the field. type Cluster_Ref is access Cluster; type Rev_Cluster is new Cluster with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; type Rev_Cluster_Ref is access Rev_Cluster; -- The following declarations are for the case where the address -- passed to GetU_28 or SetU_28 is not guaranteed to be aligned. -- These routines are used when the packed array is itself a -- component of a packed record, and therefore may not be aligned. type ClusterU is new Cluster; for ClusterU'Alignment use 1; type ClusterU_Ref is access ClusterU; type Rev_ClusterU is new ClusterU with Bit_Order => Reverse_Bit_Order, Scalar_Storage_Order => Reverse_Bit_Order; type Rev_ClusterU_Ref is access Rev_ClusterU; ------------ -- Get_28 -- ------------ function Get_28 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_28 is A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); C : Cluster_Ref with Address => A'Address, Import; RC : Rev_Cluster_Ref with Address => A'Address, Import; begin if Rev_SSO then case N07 (Uns (N) mod 8) is when 0 => return RC.E0; when 1 => return RC.E1; when 2 => return RC.E2; when 3 => return RC.E3; when 4 => return RC.E4; when 5 => return RC.E5; when 6 => return RC.E6; when 7 => return RC.E7; end case; else case N07 (Uns (N) mod 8) is when 0 => return C.E0; when 1 => return C.E1; when 2 => return C.E2; when 3 => return C.E3; when 4 => return C.E4; when 5 => return C.E5; when 6 => return C.E6; when 7 => return C.E7; end case; end if; end Get_28; ------------- -- GetU_28 -- ------------- function GetU_28 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_28 is A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); C : ClusterU_Ref with Address => A'Address, Import; RC : Rev_ClusterU_Ref with Address => A'Address, Import; begin if Rev_SSO then case N07 (Uns (N) mod 8) is when 0 => return RC.E0; when 1 => return RC.E1; when 2 => return RC.E2; when 3 => return RC.E3; when 4 => return RC.E4; when 5 => return RC.E5; when 6 => return RC.E6; when 7 => return RC.E7; end case; else case N07 (Uns (N) mod 8) is when 0 => return C.E0; when 1 => return C.E1; when 2 => return C.E2; when 3 => return C.E3; when 4 => return C.E4; when 5 => return C.E5; when 6 => return C.E6; when 7 => return C.E7; end case; end if; end GetU_28; ------------ -- Set_28 -- ------------ procedure Set_28 (Arr : System.Address; N : Natural; E : Bits_28; Rev_SSO : Boolean) is A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); C : Cluster_Ref with Address => A'Address, Import; RC : Rev_Cluster_Ref with Address => A'Address, Import; begin if Rev_SSO then case N07 (Uns (N) mod 8) is when 0 => RC.E0 := E; when 1 => RC.E1 := E; when 2 => RC.E2 := E; when 3 => RC.E3 := E; when 4 => RC.E4 := E; when 5 => RC.E5 := E; when 6 => RC.E6 := E; when 7 => RC.E7 := E; end case; else case N07 (Uns (N) mod 8) is when 0 => C.E0 := E; when 1 => C.E1 := E; when 2 => C.E2 := E; when 3 => C.E3 := E; when 4 => C.E4 := E; when 5 => C.E5 := E; when 6 => C.E6 := E; when 7 => C.E7 := E; end case; end if; end Set_28; ------------- -- SetU_28 -- ------------- procedure SetU_28 (Arr : System.Address; N : Natural; E : Bits_28; Rev_SSO : Boolean) is A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8); C : ClusterU_Ref with Address => A'Address, Import; RC : Rev_ClusterU_Ref with Address => A'Address, Import; begin if Rev_SSO then case N07 (Uns (N) mod 8) is when 0 => RC.E0 := E; when 1 => RC.E1 := E; when 2 => RC.E2 := E; when 3 => RC.E3 := E; when 4 => RC.E4 := E; when 5 => RC.E5 := E; when 6 => RC.E6 := E; when 7 => RC.E7 := E; end case; else case N07 (Uns (N) mod 8) is when 0 => C.E0 := E; when 1 => C.E1 := E; when 2 => C.E2 := E; when 3 => C.E3 := E; when 4 => C.E4 := E; when 5 => C.E5 := E; when 6 => C.E6 := E; when 7 => C.E7 := E; end case; end if; end SetU_28; end System.Pack_28;
AdaCore/libadalang
Ada
167
ads
package PK3_Bis is type Int_Array is array (Positive range <>) of Integer; type Record_Type is record A : Int_Array (1 .. 10); end record; end PK3_Bis;
Fabien-Chouteau/Ada_Drivers_Library
Ada
1,930
ads
-- This package was generated by the Ada_Drivers_Library project wizard script package ADL_Config is Vendor : constant String := "STMicro"; -- From board definition Max_Mount_Points : constant := 2; -- From default value Max_Mount_Name_Length : constant := 128; -- From default value Runtime_Profile : constant String := "ravenscar-full"; -- From command line Device_Name : constant String := "STM32F407VGTx"; -- From board definition Device_Family : constant String := "STM32F4"; -- From board definition Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition Runtime_Name : constant String := "ravenscar-full-stm32f4"; -- From default value Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition CPU_Core : constant String := "ARM Cortex-M4F"; -- From mcu definition Board : constant String := "NUCLEO_F446ZE"; -- From command line Has_ZFP_Runtime : constant String := "False"; -- From board definition Number_Of_Interrupts : constant := 0; -- From default value High_Speed_External_Clock : constant := 8000000; -- From board definition Use_Startup_Gen : constant Boolean := False; -- From command line Max_Path_Length : constant := 1024; -- From default value Runtime_Name_Suffix : constant String := "stm32f4"; -- From board definition Architecture : constant String := "ARM"; -- From board definition end ADL_Config;
reznikmm/matreshka
Ada
3,761
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_Attributes.FO.Border_Right is type FO_Border_Right_Node is new Matreshka.ODF_Attributes.FO.FO_Node_Base with null record; type FO_Border_Right_Access is access all FO_Border_Right_Node'Class; overriding function Get_Local_Name (Self : not null access constant FO_Border_Right_Node) return League.Strings.Universal_String; end Matreshka.ODF_Attributes.FO.Border_Right;
Fabien-Chouteau/coffee-clock
Ada
2,821
ads
------------------------------------------------------------------------------- -- -- -- Coffee Clock -- -- -- -- Copyright (C) 2016-2017 Fabien Chouteau -- -- -- -- Coffee Clock 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. -- -- -- -- Coffee Clock 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 We Noise Maker. If not, see <http://www.gnu.org/licenses/>. -- -- -- ------------------------------------------------------------------------------- with Giza.Window; with Giza.Widget.Button; with Giza.Widget.Tiles; use Giza.Widget; with Giza.Events; use Giza.Events; with Giza.Types; use Giza.Types; with Time_Select_Window; with Date_Select_Window; with alarm_80x80; with clock_80x80; package Settings_Window is subtype Parent is Giza.Window.Instance; type Instance is new Parent with private; subtype Class is Instance'Class; type Ref is access all Class; overriding procedure On_Init (This : in out Instance); overriding procedure On_Displayed (This : in out Instance); overriding procedure On_Hidden (This : in out Instance) is null; overriding function On_Position_Event (This : in out Instance; Evt : Position_Event_Ref; Pos : Point_T) return Boolean; private type Instance is new Parent with record Alarm, Clock, Calandar, Back : aliased Button.Instance; Tile : aliased Tiles.Instance (4, Tiles.Left_Right); Select_Alarm : aliased Time_Select_Window.Instance (alarm_80x80.Image); Select_Clock : aliased Time_Select_Window.Instance (clock_80x80.Image); Select_Date : aliased Date_Select_Window.Instance; end record; end Settings_Window;
reznikmm/matreshka
Ada
39,647
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- 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$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Indexes is pragma Preelaborate; Group_Index : constant array (First_Stage_Index) of First_Stage_Index := (16#0000# => 16#0000#, 16#0001# => 16#0001#, 16#0002# => 16#0002#, 16#0003# => 16#0003#, 16#0004# => 16#0004#, 16#0005# => 16#0005#, 16#0006# => 16#0006#, 16#0007# => 16#0007#, 16#0008# => 16#0008#, 16#0009# => 16#0009#, 16#000A# => 16#000A#, 16#000B# => 16#000B#, 16#000C# => 16#000C#, 16#000D# => 16#000D#, 16#000E# => 16#000E#, 16#000F# => 16#000F#, 16#0010# => 16#0010#, 16#0011# => 16#0011#, 16#0012# => 16#0012#, 16#0013# => 16#0013#, 16#0014# => 16#0014#, 16#0015# => 16#0015#, 16#0016# => 16#0016#, 16#0017# => 16#0017#, 16#0018# => 16#0018#, 16#0019# => 16#0019#, 16#001A# => 16#001A#, 16#001B# => 16#001B#, 16#001C# => 16#001C#, 16#001D# => 16#001D#, 16#001E# => 16#001E#, 16#001F# => 16#001F#, 16#0020# => 16#0020#, 16#0021# => 16#0021#, 16#0022# => 16#0022#, 16#0023# => 16#0023#, 16#0024# => 16#0024#, 16#0025# => 16#0025#, 16#0026# => 16#0026#, 16#0027# => 16#0027#, 16#0028# => 16#0028#, 16#0029# => 16#0029#, 16#002A# => 16#002A#, 16#002B# => 16#002B#, 16#002C# => 16#002C#, 16#002D# => 16#002D#, 16#002E# => 16#002E#, 16#002F# => 16#002F#, 16#0030# => 16#0030#, 16#0031# => 16#0031#, 16#0032# => 16#0032#, 16#0033# => 16#0033#, 16#0034# => 16#0034#, 16#0035# => 16#0034#, 16#0036# => 16#0034#, 16#0037# => 16#0034#, 16#0038# => 16#0034#, 16#0039# => 16#0034#, 16#003A# => 16#0034#, 16#003B# => 16#0034#, 16#003C# => 16#0034#, 16#003D# => 16#0034#, 16#003E# => 16#0034#, 16#003F# => 16#0034#, 16#0040# => 16#0034#, 16#0041# => 16#0034#, 16#0042# => 16#0034#, 16#0043# => 16#0034#, 16#0044# => 16#0034#, 16#0045# => 16#0034#, 16#0046# => 16#0034#, 16#0047# => 16#0034#, 16#0048# => 16#0034#, 16#0049# => 16#0034#, 16#004A# => 16#0034#, 16#004B# => 16#0034#, 16#004C# => 16#0034#, 16#004D# => 16#0035#, 16#004E# => 16#0034#, 16#004F# => 16#0034#, 16#0050# => 16#0034#, 16#0051# => 16#0034#, 16#0052# => 16#0034#, 16#0053# => 16#0034#, 16#0054# => 16#0034#, 16#0055# => 16#0034#, 16#0056# => 16#0034#, 16#0057# => 16#0034#, 16#0058# => 16#0034#, 16#0059# => 16#0034#, 16#005A# => 16#0034#, 16#005B# => 16#0034#, 16#005C# => 16#0034#, 16#005D# => 16#0034#, 16#005E# => 16#0034#, 16#005F# => 16#0034#, 16#0060# => 16#0034#, 16#0061# => 16#0034#, 16#0062# => 16#0034#, 16#0063# => 16#0034#, 16#0064# => 16#0034#, 16#0065# => 16#0034#, 16#0066# => 16#0034#, 16#0067# => 16#0034#, 16#0068# => 16#0034#, 16#0069# => 16#0034#, 16#006A# => 16#0034#, 16#006B# => 16#0034#, 16#006C# => 16#0034#, 16#006D# => 16#0034#, 16#006E# => 16#0034#, 16#006F# => 16#0034#, 16#0070# => 16#0034#, 16#0071# => 16#0034#, 16#0072# => 16#0034#, 16#0073# => 16#0034#, 16#0074# => 16#0034#, 16#0075# => 16#0034#, 16#0076# => 16#0034#, 16#0077# => 16#0034#, 16#0078# => 16#0034#, 16#0079# => 16#0034#, 16#007A# => 16#0034#, 16#007B# => 16#0034#, 16#007C# => 16#0034#, 16#007D# => 16#0034#, 16#007E# => 16#0034#, 16#007F# => 16#0034#, 16#0080# => 16#0034#, 16#0081# => 16#0034#, 16#0082# => 16#0034#, 16#0083# => 16#0034#, 16#0084# => 16#0034#, 16#0085# => 16#0034#, 16#0086# => 16#0034#, 16#0087# => 16#0034#, 16#0088# => 16#0034#, 16#0089# => 16#0034#, 16#008A# => 16#0034#, 16#008B# => 16#0034#, 16#008C# => 16#0034#, 16#008D# => 16#0034#, 16#008E# => 16#0034#, 16#008F# => 16#0034#, 16#0090# => 16#0034#, 16#0091# => 16#0034#, 16#0092# => 16#0034#, 16#0093# => 16#0034#, 16#0094# => 16#0034#, 16#0095# => 16#0034#, 16#0096# => 16#0034#, 16#0097# => 16#0034#, 16#0098# => 16#0034#, 16#0099# => 16#0034#, 16#009A# => 16#0034#, 16#009B# => 16#0034#, 16#009C# => 16#0034#, 16#009D# => 16#0034#, 16#009E# => 16#0034#, 16#009F# => 16#0036#, 16#00A0# => 16#0037#, 16#00A1# => 16#0038#, 16#00A2# => 16#0038#, 16#00A3# => 16#0038#, 16#00A4# => 16#0039#, 16#00A5# => 16#0015#, 16#00A6# => 16#003A#, 16#00A7# => 16#003B#, 16#00A8# => 16#003C#, 16#00A9# => 16#003D#, 16#00AA# => 16#003E#, 16#00AB# => 16#003F#, 16#00AC# => 16#0040#, 16#00AD# => 16#0041#, 16#00AE# => 16#0042#, 16#00AF# => 16#0043#, 16#00B0# => 16#0044#, 16#00B1# => 16#0045#, 16#00B2# => 16#0046#, 16#00B3# => 16#0040#, 16#00B4# => 16#0041#, 16#00B5# => 16#0042#, 16#00B6# => 16#0043#, 16#00B7# => 16#0044#, 16#00B8# => 16#0045#, 16#00B9# => 16#0046#, 16#00BA# => 16#0040#, 16#00BB# => 16#0041#, 16#00BC# => 16#0042#, 16#00BD# => 16#0043#, 16#00BE# => 16#0044#, 16#00BF# => 16#0045#, 16#00C0# => 16#0046#, 16#00C1# => 16#0040#, 16#00C2# => 16#0041#, 16#00C3# => 16#0042#, 16#00C4# => 16#0043#, 16#00C5# => 16#0044#, 16#00C6# => 16#0045#, 16#00C7# => 16#0046#, 16#00C8# => 16#0040#, 16#00C9# => 16#0041#, 16#00CA# => 16#0042#, 16#00CB# => 16#0043#, 16#00CC# => 16#0044#, 16#00CD# => 16#0045#, 16#00CE# => 16#0046#, 16#00CF# => 16#0040#, 16#00D0# => 16#0041#, 16#00D1# => 16#0042#, 16#00D2# => 16#0043#, 16#00D3# => 16#0044#, 16#00D4# => 16#0045#, 16#00D5# => 16#0046#, 16#00D6# => 16#0040#, 16#00D7# => 16#0047#, 16#00D8# => 16#0048#, 16#00D9# => 16#0048#, 16#00DA# => 16#0048#, 16#00DB# => 16#0048#, 16#00DC# => 16#0048#, 16#00DD# => 16#0048#, 16#00DE# => 16#0048#, 16#00DF# => 16#0048#, 16#00E0# => 16#0049#, 16#00E1# => 16#0049#, 16#00E2# => 16#0049#, 16#00E3# => 16#0049#, 16#00E4# => 16#0049#, 16#00E5# => 16#0049#, 16#00E6# => 16#0049#, 16#00E7# => 16#0049#, 16#00E8# => 16#0049#, 16#00E9# => 16#0049#, 16#00EA# => 16#0049#, 16#00EB# => 16#0049#, 16#00EC# => 16#0049#, 16#00ED# => 16#0049#, 16#00EE# => 16#0049#, 16#00EF# => 16#0049#, 16#00F0# => 16#0049#, 16#00F1# => 16#0049#, 16#00F2# => 16#0049#, 16#00F3# => 16#0049#, 16#00F4# => 16#0049#, 16#00F5# => 16#0049#, 16#00F6# => 16#0049#, 16#00F7# => 16#0049#, 16#00F8# => 16#0049#, 16#00F9# => 16#004A#, 16#00FA# => 16#004B#, 16#00FB# => 16#004C#, 16#00FC# => 16#004D#, 16#00FD# => 16#004E#, 16#00FE# => 16#004F#, 16#00FF# => 16#0050#, 16#0100# => 16#0051#, 16#0101# => 16#0052#, 16#0102# => 16#0053#, 16#0103# => 16#0054#, 16#0104# => 16#0055#, 16#0105# => 16#0056#, 16#0106# => 16#0015#, 16#0107# => 16#0057#, 16#0108# => 16#0058#, 16#0109# => 16#0059#, 16#010A# => 16#005A#, 16#010B# => 16#005B#, 16#010C# => 16#005C#, 16#010E# => 16#005E#, 16#0110# => 16#005F#, 16#0111# => 16#0060#, 16#0112# => 16#0061#, 16#0113# => 16#0062#, 16#0114# => 16#0063#, 16#0115# => 16#0064#, 16#0116# => 16#0065#, 16#0118# => 16#0066#, 16#011A# => 16#0067#, 16#0120# => 16#0015#, 16#0121# => 16#0015#, 16#0122# => 16#0015#, 16#0123# => 16#0068#, 16#0124# => 16#0069#, 16#0130# => 16#0015#, 16#0131# => 16#0015#, 16#0132# => 16#006A#, 16#0133# => 16#006B#, 16#0134# => 16#006C#, 16#0168# => 16#0015#, 16#0169# => 16#0015#, 16#016A# => 16#006D#, 16#016B# => 16#006E#, 16#016F# => 16#006F#, 16#01B0# => 16#0070#, 16#01BC# => 16#0071#, 16#01D0# => 16#0072#, 16#01D1# => 16#0073#, 16#01D2# => 16#0074#, 16#01D3# => 16#0075#, 16#01D4# => 16#0076#, 16#01D5# => 16#0077#, 16#01D6# => 16#0078#, 16#01D7# => 16#0079#, 16#01E8# => 16#007A#, 16#01EE# => 16#007B#, 16#01F0# => 16#007C#, 16#01F1# => 16#007D#, 16#01F2# => 16#007E#, 16#01F3# => 16#007F#, 16#01F4# => 16#0080#, 16#01F5# => 16#0081#, 16#01F6# => 16#0082#, 16#01F7# => 16#0083#, 16#01F8# => 16#0084#, 16#01FF# => 16#0085#, 16#0200# => 16#0034#, 16#0201# => 16#0034#, 16#0202# => 16#0034#, 16#0203# => 16#0034#, 16#0204# => 16#0034#, 16#0205# => 16#0034#, 16#0206# => 16#0034#, 16#0207# => 16#0034#, 16#0208# => 16#0034#, 16#0209# => 16#0034#, 16#020A# => 16#0034#, 16#020B# => 16#0034#, 16#020C# => 16#0034#, 16#020D# => 16#0034#, 16#020E# => 16#0034#, 16#020F# => 16#0034#, 16#0210# => 16#0034#, 16#0211# => 16#0034#, 16#0212# => 16#0034#, 16#0213# => 16#0034#, 16#0214# => 16#0034#, 16#0215# => 16#0034#, 16#0216# => 16#0034#, 16#0217# => 16#0034#, 16#0218# => 16#0034#, 16#0219# => 16#0034#, 16#021A# => 16#0034#, 16#021B# => 16#0034#, 16#021C# => 16#0034#, 16#021D# => 16#0034#, 16#021E# => 16#0034#, 16#021F# => 16#0034#, 16#0220# => 16#0034#, 16#0221# => 16#0034#, 16#0222# => 16#0034#, 16#0223# => 16#0034#, 16#0224# => 16#0034#, 16#0225# => 16#0034#, 16#0226# => 16#0034#, 16#0227# => 16#0034#, 16#0228# => 16#0034#, 16#0229# => 16#0034#, 16#022A# => 16#0034#, 16#022B# => 16#0034#, 16#022C# => 16#0034#, 16#022D# => 16#0034#, 16#022E# => 16#0034#, 16#022F# => 16#0034#, 16#0230# => 16#0034#, 16#0231# => 16#0034#, 16#0232# => 16#0034#, 16#0233# => 16#0034#, 16#0234# => 16#0034#, 16#0235# => 16#0034#, 16#0236# => 16#0034#, 16#0237# => 16#0034#, 16#0238# => 16#0034#, 16#0239# => 16#0034#, 16#023A# => 16#0034#, 16#023B# => 16#0034#, 16#023C# => 16#0034#, 16#023D# => 16#0034#, 16#023E# => 16#0034#, 16#023F# => 16#0034#, 16#0240# => 16#0034#, 16#0241# => 16#0034#, 16#0242# => 16#0034#, 16#0243# => 16#0034#, 16#0244# => 16#0034#, 16#0245# => 16#0034#, 16#0246# => 16#0034#, 16#0247# => 16#0034#, 16#0248# => 16#0034#, 16#0249# => 16#0034#, 16#024A# => 16#0034#, 16#024B# => 16#0034#, 16#024C# => 16#0034#, 16#024D# => 16#0034#, 16#024E# => 16#0034#, 16#024F# => 16#0034#, 16#0250# => 16#0034#, 16#0251# => 16#0034#, 16#0252# => 16#0034#, 16#0253# => 16#0034#, 16#0254# => 16#0034#, 16#0255# => 16#0034#, 16#0256# => 16#0034#, 16#0257# => 16#0034#, 16#0258# => 16#0034#, 16#0259# => 16#0034#, 16#025A# => 16#0034#, 16#025B# => 16#0034#, 16#025C# => 16#0034#, 16#025D# => 16#0034#, 16#025E# => 16#0034#, 16#025F# => 16#0034#, 16#0260# => 16#0034#, 16#0261# => 16#0034#, 16#0262# => 16#0034#, 16#0263# => 16#0034#, 16#0264# => 16#0034#, 16#0265# => 16#0034#, 16#0266# => 16#0034#, 16#0267# => 16#0034#, 16#0268# => 16#0034#, 16#0269# => 16#0034#, 16#026A# => 16#0034#, 16#026B# => 16#0034#, 16#026C# => 16#0034#, 16#026D# => 16#0034#, 16#026E# => 16#0034#, 16#026F# => 16#0034#, 16#0270# => 16#0034#, 16#0271# => 16#0034#, 16#0272# => 16#0034#, 16#0273# => 16#0034#, 16#0274# => 16#0034#, 16#0275# => 16#0034#, 16#0276# => 16#0034#, 16#0277# => 16#0034#, 16#0278# => 16#0034#, 16#0279# => 16#0034#, 16#027A# => 16#0034#, 16#027B# => 16#0034#, 16#027C# => 16#0034#, 16#027D# => 16#0034#, 16#027E# => 16#0034#, 16#027F# => 16#0034#, 16#0280# => 16#0034#, 16#0281# => 16#0034#, 16#0282# => 16#0034#, 16#0283# => 16#0034#, 16#0284# => 16#0034#, 16#0285# => 16#0034#, 16#0286# => 16#0034#, 16#0287# => 16#0034#, 16#0288# => 16#0034#, 16#0289# => 16#0034#, 16#028A# => 16#0034#, 16#028B# => 16#0034#, 16#028C# => 16#0034#, 16#028D# => 16#0034#, 16#028E# => 16#0034#, 16#028F# => 16#0034#, 16#0290# => 16#0034#, 16#0291# => 16#0034#, 16#0292# => 16#0034#, 16#0293# => 16#0034#, 16#0294# => 16#0034#, 16#0295# => 16#0034#, 16#0296# => 16#0034#, 16#0297# => 16#0034#, 16#0298# => 16#0034#, 16#0299# => 16#0034#, 16#029A# => 16#0034#, 16#029B# => 16#0034#, 16#029C# => 16#0034#, 16#029D# => 16#0034#, 16#029E# => 16#0034#, 16#029F# => 16#0034#, 16#02A0# => 16#0034#, 16#02A1# => 16#0034#, 16#02A2# => 16#0034#, 16#02A3# => 16#0034#, 16#02A4# => 16#0034#, 16#02A5# => 16#0034#, 16#02A6# => 16#0086#, 16#02A7# => 16#0034#, 16#02A8# => 16#0034#, 16#02A9# => 16#0034#, 16#02AA# => 16#0034#, 16#02AB# => 16#0034#, 16#02AC# => 16#0034#, 16#02AD# => 16#0034#, 16#02AE# => 16#0034#, 16#02AF# => 16#0034#, 16#02B0# => 16#0034#, 16#02B1# => 16#0034#, 16#02B2# => 16#0034#, 16#02B3# => 16#0034#, 16#02B4# => 16#0034#, 16#02B5# => 16#0034#, 16#02B6# => 16#0034#, 16#02B7# => 16#0087#, 16#02B8# => 16#0088#, 16#02B9# => 16#0089#, 16#02BA# => 16#0089#, 16#02BB# => 16#0089#, 16#02BC# => 16#0089#, 16#02BD# => 16#0089#, 16#02BE# => 16#0089#, 16#02BF# => 16#0089#, 16#02C0# => 16#0089#, 16#02C1# => 16#0089#, 16#02C2# => 16#0089#, 16#02C3# => 16#0089#, 16#02C4# => 16#0089#, 16#02C5# => 16#0089#, 16#02C6# => 16#0089#, 16#02C7# => 16#0089#, 16#02C8# => 16#0089#, 16#02C9# => 16#0089#, 16#02CA# => 16#0089#, 16#02CB# => 16#0089#, 16#02CC# => 16#0089#, 16#02CD# => 16#0089#, 16#02CE# => 16#0089#, 16#02CF# => 16#0089#, 16#02D0# => 16#0089#, 16#02D1# => 16#0089#, 16#02D2# => 16#0089#, 16#02D3# => 16#0089#, 16#02D4# => 16#0089#, 16#02D5# => 16#0089#, 16#02D6# => 16#0089#, 16#02D7# => 16#0089#, 16#02D8# => 16#0089#, 16#02D9# => 16#0089#, 16#02DA# => 16#0089#, 16#02DB# => 16#0089#, 16#02DC# => 16#0089#, 16#02DD# => 16#0089#, 16#02DE# => 16#0089#, 16#02DF# => 16#0089#, 16#02E0# => 16#0089#, 16#02E1# => 16#0089#, 16#02E2# => 16#0089#, 16#02E3# => 16#0089#, 16#02E4# => 16#0089#, 16#02E5# => 16#0089#, 16#02E6# => 16#0089#, 16#02E7# => 16#0089#, 16#02E8# => 16#0089#, 16#02E9# => 16#0089#, 16#02EA# => 16#0089#, 16#02EB# => 16#0089#, 16#02EC# => 16#0089#, 16#02ED# => 16#0089#, 16#02EE# => 16#0089#, 16#02EF# => 16#0089#, 16#02F0# => 16#0089#, 16#02F1# => 16#0089#, 16#02F2# => 16#0089#, 16#02F3# => 16#0089#, 16#02F4# => 16#0089#, 16#02F5# => 16#0089#, 16#02F6# => 16#0089#, 16#02F7# => 16#0089#, 16#02F8# => 16#004A#, 16#02F9# => 16#004A#, 16#02FA# => 16#008A#, 16#02FB# => 16#0089#, 16#02FC# => 16#0089#, 16#02FD# => 16#0089#, 16#02FE# => 16#0089#, 16#02FF# => 16#008B#, 16#0300# => 16#0089#, 16#0301# => 16#0089#, 16#0302# => 16#0089#, 16#0303# => 16#0089#, 16#0304# => 16#0089#, 16#0305# => 16#0089#, 16#0306# => 16#0089#, 16#0307# => 16#0089#, 16#0308# => 16#0089#, 16#0309# => 16#0089#, 16#030A# => 16#0089#, 16#030B# => 16#0089#, 16#030C# => 16#0089#, 16#030D# => 16#0089#, 16#030E# => 16#0089#, 16#030F# => 16#0089#, 16#0310# => 16#0089#, 16#0311# => 16#0089#, 16#0312# => 16#0089#, 16#0313# => 16#0089#, 16#0314# => 16#0089#, 16#0315# => 16#0089#, 16#0316# => 16#0089#, 16#0317# => 16#0089#, 16#0318# => 16#0089#, 16#0319# => 16#0089#, 16#031A# => 16#0089#, 16#031B# => 16#0089#, 16#031C# => 16#0089#, 16#031D# => 16#0089#, 16#031E# => 16#0089#, 16#031F# => 16#0089#, 16#0320# => 16#0089#, 16#0321# => 16#0089#, 16#0322# => 16#0089#, 16#0323# => 16#0089#, 16#0324# => 16#0089#, 16#0325# => 16#0089#, 16#0326# => 16#0089#, 16#0327# => 16#0089#, 16#0328# => 16#0089#, 16#0329# => 16#0089#, 16#032A# => 16#0089#, 16#032B# => 16#0089#, 16#032C# => 16#0089#, 16#032D# => 16#0089#, 16#032E# => 16#0089#, 16#032F# => 16#0089#, 16#0330# => 16#0089#, 16#0331# => 16#0089#, 16#0332# => 16#0089#, 16#0333# => 16#0089#, 16#0334# => 16#0089#, 16#0335# => 16#0089#, 16#0336# => 16#0089#, 16#0337# => 16#0089#, 16#0338# => 16#0089#, 16#0339# => 16#0089#, 16#033A# => 16#0089#, 16#033B# => 16#0089#, 16#033C# => 16#0089#, 16#033D# => 16#0089#, 16#033E# => 16#0089#, 16#033F# => 16#0089#, 16#0340# => 16#0089#, 16#0341# => 16#0089#, 16#0342# => 16#0089#, 16#0343# => 16#0089#, 16#0344# => 16#0089#, 16#0345# => 16#0089#, 16#0346# => 16#0089#, 16#0347# => 16#0089#, 16#0348# => 16#0089#, 16#0349# => 16#0089#, 16#034A# => 16#0089#, 16#034B# => 16#0089#, 16#034C# => 16#0089#, 16#034D# => 16#0089#, 16#034E# => 16#0089#, 16#034F# => 16#0089#, 16#0350# => 16#0089#, 16#0351# => 16#0089#, 16#0352# => 16#0089#, 16#0353# => 16#0089#, 16#0354# => 16#0089#, 16#0355# => 16#0089#, 16#0356# => 16#0089#, 16#0357# => 16#0089#, 16#0358# => 16#0089#, 16#0359# => 16#0089#, 16#035A# => 16#0089#, 16#035B# => 16#0089#, 16#035C# => 16#0089#, 16#035D# => 16#0089#, 16#035E# => 16#0089#, 16#035F# => 16#0089#, 16#0360# => 16#0089#, 16#0361# => 16#0089#, 16#0362# => 16#0089#, 16#0363# => 16#0089#, 16#0364# => 16#0089#, 16#0365# => 16#0089#, 16#0366# => 16#0089#, 16#0367# => 16#0089#, 16#0368# => 16#0089#, 16#0369# => 16#0089#, 16#036A# => 16#0089#, 16#036B# => 16#0089#, 16#036C# => 16#0089#, 16#036D# => 16#0089#, 16#036E# => 16#0089#, 16#036F# => 16#0089#, 16#0370# => 16#0089#, 16#0371# => 16#0089#, 16#0372# => 16#0089#, 16#0373# => 16#0089#, 16#0374# => 16#0089#, 16#0375# => 16#0089#, 16#0376# => 16#0089#, 16#0377# => 16#0089#, 16#0378# => 16#0089#, 16#0379# => 16#0089#, 16#037A# => 16#0089#, 16#037B# => 16#0089#, 16#037C# => 16#0089#, 16#037D# => 16#0089#, 16#037E# => 16#0089#, 16#037F# => 16#0089#, 16#0380# => 16#0089#, 16#0381# => 16#0089#, 16#0382# => 16#0089#, 16#0383# => 16#0089#, 16#0384# => 16#0089#, 16#0385# => 16#0089#, 16#0386# => 16#0089#, 16#0387# => 16#0089#, 16#0388# => 16#0089#, 16#0389# => 16#0089#, 16#038A# => 16#0089#, 16#038B# => 16#0089#, 16#038C# => 16#0089#, 16#038D# => 16#0089#, 16#038E# => 16#0089#, 16#038F# => 16#0089#, 16#0390# => 16#0089#, 16#0391# => 16#0089#, 16#0392# => 16#0089#, 16#0393# => 16#0089#, 16#0394# => 16#0089#, 16#0395# => 16#0089#, 16#0396# => 16#0089#, 16#0397# => 16#0089#, 16#0398# => 16#0089#, 16#0399# => 16#0089#, 16#039A# => 16#0089#, 16#039B# => 16#0089#, 16#039C# => 16#0089#, 16#039D# => 16#0089#, 16#039E# => 16#0089#, 16#039F# => 16#0089#, 16#03A0# => 16#0089#, 16#03A1# => 16#0089#, 16#03A2# => 16#0089#, 16#03A3# => 16#0089#, 16#03A4# => 16#0089#, 16#03A5# => 16#0089#, 16#03A6# => 16#0089#, 16#03A7# => 16#0089#, 16#03A8# => 16#0089#, 16#03A9# => 16#0089#, 16#03AA# => 16#0089#, 16#03AB# => 16#0089#, 16#03AC# => 16#0089#, 16#03AD# => 16#0089#, 16#03AE# => 16#0089#, 16#03AF# => 16#0089#, 16#03B0# => 16#0089#, 16#03B1# => 16#0089#, 16#03B2# => 16#0089#, 16#03B3# => 16#0089#, 16#03B4# => 16#0089#, 16#03B5# => 16#0089#, 16#03B6# => 16#0089#, 16#03B7# => 16#0089#, 16#03B8# => 16#0089#, 16#03B9# => 16#0089#, 16#03BA# => 16#0089#, 16#03BB# => 16#0089#, 16#03BC# => 16#0089#, 16#03BD# => 16#0089#, 16#03BE# => 16#0089#, 16#03BF# => 16#0089#, 16#03C0# => 16#0089#, 16#03C1# => 16#0089#, 16#03C2# => 16#0089#, 16#03C3# => 16#0089#, 16#03C4# => 16#0089#, 16#03C5# => 16#0089#, 16#03C6# => 16#0089#, 16#03C7# => 16#0089#, 16#03C8# => 16#0089#, 16#03C9# => 16#0089#, 16#03CA# => 16#0089#, 16#03CB# => 16#0089#, 16#03CC# => 16#0089#, 16#03CD# => 16#0089#, 16#03CE# => 16#0089#, 16#03CF# => 16#0089#, 16#03D0# => 16#0089#, 16#03D1# => 16#0089#, 16#03D2# => 16#0089#, 16#03D3# => 16#0089#, 16#03D4# => 16#0089#, 16#03D5# => 16#0089#, 16#03D6# => 16#0089#, 16#03D7# => 16#0089#, 16#03D8# => 16#0089#, 16#03D9# => 16#0089#, 16#03DA# => 16#0089#, 16#03DB# => 16#0089#, 16#03DC# => 16#0089#, 16#03DD# => 16#0089#, 16#03DE# => 16#0089#, 16#03DF# => 16#0089#, 16#03E0# => 16#0089#, 16#03E1# => 16#0089#, 16#03E2# => 16#0089#, 16#03E3# => 16#0089#, 16#03E4# => 16#0089#, 16#03E5# => 16#0089#, 16#03E6# => 16#0089#, 16#03E7# => 16#0089#, 16#03E8# => 16#0089#, 16#03E9# => 16#0089#, 16#03EA# => 16#0089#, 16#03EB# => 16#0089#, 16#03EC# => 16#0089#, 16#03ED# => 16#0089#, 16#03EE# => 16#0089#, 16#03EF# => 16#0089#, 16#03F0# => 16#0089#, 16#03F1# => 16#0089#, 16#03F2# => 16#0089#, 16#03F3# => 16#0089#, 16#03F4# => 16#0089#, 16#03F5# => 16#0089#, 16#03F6# => 16#0089#, 16#03F7# => 16#0089#, 16#03F8# => 16#0089#, 16#03F9# => 16#0089#, 16#03FA# => 16#0089#, 16#03FB# => 16#0089#, 16#03FC# => 16#0089#, 16#03FD# => 16#0089#, 16#03FE# => 16#0089#, 16#03FF# => 16#008B#, 16#04FF# => 16#0085#, 16#05FF# => 16#0085#, 16#06FF# => 16#0085#, 16#07FF# => 16#0085#, 16#08FF# => 16#0085#, 16#09FF# => 16#0085#, 16#0AFF# => 16#0085#, 16#0BFF# => 16#0085#, 16#0CFF# => 16#0085#, 16#0DFF# => 16#0085#, 16#0E00# => 16#008C#, 16#0E01# => 16#008D#, 16#0E02# => 16#008E#, 16#0E03# => 16#008E#, 16#0E04# => 16#008E#, 16#0E05# => 16#008E#, 16#0E06# => 16#008E#, 16#0E07# => 16#008E#, 16#0E08# => 16#008E#, 16#0E09# => 16#008E#, 16#0E0A# => 16#008E#, 16#0E0B# => 16#008E#, 16#0E0C# => 16#008E#, 16#0E0D# => 16#008E#, 16#0E0E# => 16#008E#, 16#0E0F# => 16#008E#, 16#0EFF# => 16#0085#, 16#0F00# => 16#0049#, 16#0F01# => 16#0049#, 16#0F02# => 16#0049#, 16#0F03# => 16#0049#, 16#0F04# => 16#0049#, 16#0F05# => 16#0049#, 16#0F06# => 16#0049#, 16#0F07# => 16#0049#, 16#0F08# => 16#0049#, 16#0F09# => 16#0049#, 16#0F0A# => 16#0049#, 16#0F0B# => 16#0049#, 16#0F0C# => 16#0049#, 16#0F0D# => 16#0049#, 16#0F0E# => 16#0049#, 16#0F0F# => 16#0049#, 16#0F10# => 16#0049#, 16#0F11# => 16#0049#, 16#0F12# => 16#0049#, 16#0F13# => 16#0049#, 16#0F14# => 16#0049#, 16#0F15# => 16#0049#, 16#0F16# => 16#0049#, 16#0F17# => 16#0049#, 16#0F18# => 16#0049#, 16#0F19# => 16#0049#, 16#0F1A# => 16#0049#, 16#0F1B# => 16#0049#, 16#0F1C# => 16#0049#, 16#0F1D# => 16#0049#, 16#0F1E# => 16#0049#, 16#0F1F# => 16#0049#, 16#0F20# => 16#0049#, 16#0F21# => 16#0049#, 16#0F22# => 16#0049#, 16#0F23# => 16#0049#, 16#0F24# => 16#0049#, 16#0F25# => 16#0049#, 16#0F26# => 16#0049#, 16#0F27# => 16#0049#, 16#0F28# => 16#0049#, 16#0F29# => 16#0049#, 16#0F2A# => 16#0049#, 16#0F2B# => 16#0049#, 16#0F2C# => 16#0049#, 16#0F2D# => 16#0049#, 16#0F2E# => 16#0049#, 16#0F2F# => 16#0049#, 16#0F30# => 16#0049#, 16#0F31# => 16#0049#, 16#0F32# => 16#0049#, 16#0F33# => 16#0049#, 16#0F34# => 16#0049#, 16#0F35# => 16#0049#, 16#0F36# => 16#0049#, 16#0F37# => 16#0049#, 16#0F38# => 16#0049#, 16#0F39# => 16#0049#, 16#0F3A# => 16#0049#, 16#0F3B# => 16#0049#, 16#0F3C# => 16#0049#, 16#0F3D# => 16#0049#, 16#0F3E# => 16#0049#, 16#0F3F# => 16#0049#, 16#0F40# => 16#0049#, 16#0F41# => 16#0049#, 16#0F42# => 16#0049#, 16#0F43# => 16#0049#, 16#0F44# => 16#0049#, 16#0F45# => 16#0049#, 16#0F46# => 16#0049#, 16#0F47# => 16#0049#, 16#0F48# => 16#0049#, 16#0F49# => 16#0049#, 16#0F4A# => 16#0049#, 16#0F4B# => 16#0049#, 16#0F4C# => 16#0049#, 16#0F4D# => 16#0049#, 16#0F4E# => 16#0049#, 16#0F4F# => 16#0049#, 16#0F50# => 16#0049#, 16#0F51# => 16#0049#, 16#0F52# => 16#0049#, 16#0F53# => 16#0049#, 16#0F54# => 16#0049#, 16#0F55# => 16#0049#, 16#0F56# => 16#0049#, 16#0F57# => 16#0049#, 16#0F58# => 16#0049#, 16#0F59# => 16#0049#, 16#0F5A# => 16#0049#, 16#0F5B# => 16#0049#, 16#0F5C# => 16#0049#, 16#0F5D# => 16#0049#, 16#0F5E# => 16#0049#, 16#0F5F# => 16#0049#, 16#0F60# => 16#0049#, 16#0F61# => 16#0049#, 16#0F62# => 16#0049#, 16#0F63# => 16#0049#, 16#0F64# => 16#0049#, 16#0F65# => 16#0049#, 16#0F66# => 16#0049#, 16#0F67# => 16#0049#, 16#0F68# => 16#0049#, 16#0F69# => 16#0049#, 16#0F6A# => 16#0049#, 16#0F6B# => 16#0049#, 16#0F6C# => 16#0049#, 16#0F6D# => 16#0049#, 16#0F6E# => 16#0049#, 16#0F6F# => 16#0049#, 16#0F70# => 16#0049#, 16#0F71# => 16#0049#, 16#0F72# => 16#0049#, 16#0F73# => 16#0049#, 16#0F74# => 16#0049#, 16#0F75# => 16#0049#, 16#0F76# => 16#0049#, 16#0F77# => 16#0049#, 16#0F78# => 16#0049#, 16#0F79# => 16#0049#, 16#0F7A# => 16#0049#, 16#0F7B# => 16#0049#, 16#0F7C# => 16#0049#, 16#0F7D# => 16#0049#, 16#0F7E# => 16#0049#, 16#0F7F# => 16#0049#, 16#0F80# => 16#0049#, 16#0F81# => 16#0049#, 16#0F82# => 16#0049#, 16#0F83# => 16#0049#, 16#0F84# => 16#0049#, 16#0F85# => 16#0049#, 16#0F86# => 16#0049#, 16#0F87# => 16#0049#, 16#0F88# => 16#0049#, 16#0F89# => 16#0049#, 16#0F8A# => 16#0049#, 16#0F8B# => 16#0049#, 16#0F8C# => 16#0049#, 16#0F8D# => 16#0049#, 16#0F8E# => 16#0049#, 16#0F8F# => 16#0049#, 16#0F90# => 16#0049#, 16#0F91# => 16#0049#, 16#0F92# => 16#0049#, 16#0F93# => 16#0049#, 16#0F94# => 16#0049#, 16#0F95# => 16#0049#, 16#0F96# => 16#0049#, 16#0F97# => 16#0049#, 16#0F98# => 16#0049#, 16#0F99# => 16#0049#, 16#0F9A# => 16#0049#, 16#0F9B# => 16#0049#, 16#0F9C# => 16#0049#, 16#0F9D# => 16#0049#, 16#0F9E# => 16#0049#, 16#0F9F# => 16#0049#, 16#0FA0# => 16#0049#, 16#0FA1# => 16#0049#, 16#0FA2# => 16#0049#, 16#0FA3# => 16#0049#, 16#0FA4# => 16#0049#, 16#0FA5# => 16#0049#, 16#0FA6# => 16#0049#, 16#0FA7# => 16#0049#, 16#0FA8# => 16#0049#, 16#0FA9# => 16#0049#, 16#0FAA# => 16#0049#, 16#0FAB# => 16#0049#, 16#0FAC# => 16#0049#, 16#0FAD# => 16#0049#, 16#0FAE# => 16#0049#, 16#0FAF# => 16#0049#, 16#0FB0# => 16#0049#, 16#0FB1# => 16#0049#, 16#0FB2# => 16#0049#, 16#0FB3# => 16#0049#, 16#0FB4# => 16#0049#, 16#0FB5# => 16#0049#, 16#0FB6# => 16#0049#, 16#0FB7# => 16#0049#, 16#0FB8# => 16#0049#, 16#0FB9# => 16#0049#, 16#0FBA# => 16#0049#, 16#0FBB# => 16#0049#, 16#0FBC# => 16#0049#, 16#0FBD# => 16#0049#, 16#0FBE# => 16#0049#, 16#0FBF# => 16#0049#, 16#0FC0# => 16#0049#, 16#0FC1# => 16#0049#, 16#0FC2# => 16#0049#, 16#0FC3# => 16#0049#, 16#0FC4# => 16#0049#, 16#0FC5# => 16#0049#, 16#0FC6# => 16#0049#, 16#0FC7# => 16#0049#, 16#0FC8# => 16#0049#, 16#0FC9# => 16#0049#, 16#0FCA# => 16#0049#, 16#0FCB# => 16#0049#, 16#0FCC# => 16#0049#, 16#0FCD# => 16#0049#, 16#0FCE# => 16#0049#, 16#0FCF# => 16#0049#, 16#0FD0# => 16#0049#, 16#0FD1# => 16#0049#, 16#0FD2# => 16#0049#, 16#0FD3# => 16#0049#, 16#0FD4# => 16#0049#, 16#0FD5# => 16#0049#, 16#0FD6# => 16#0049#, 16#0FD7# => 16#0049#, 16#0FD8# => 16#0049#, 16#0FD9# => 16#0049#, 16#0FDA# => 16#0049#, 16#0FDB# => 16#0049#, 16#0FDC# => 16#0049#, 16#0FDD# => 16#0049#, 16#0FDE# => 16#0049#, 16#0FDF# => 16#0049#, 16#0FE0# => 16#0049#, 16#0FE1# => 16#0049#, 16#0FE2# => 16#0049#, 16#0FE3# => 16#0049#, 16#0FE4# => 16#0049#, 16#0FE5# => 16#0049#, 16#0FE6# => 16#0049#, 16#0FE7# => 16#0049#, 16#0FE8# => 16#0049#, 16#0FE9# => 16#0049#, 16#0FEA# => 16#0049#, 16#0FEB# => 16#0049#, 16#0FEC# => 16#0049#, 16#0FED# => 16#0049#, 16#0FEE# => 16#0049#, 16#0FEF# => 16#0049#, 16#0FF0# => 16#0049#, 16#0FF1# => 16#0049#, 16#0FF2# => 16#0049#, 16#0FF3# => 16#0049#, 16#0FF4# => 16#0049#, 16#0FF5# => 16#0049#, 16#0FF6# => 16#0049#, 16#0FF7# => 16#0049#, 16#0FF8# => 16#0049#, 16#0FF9# => 16#0049#, 16#0FFA# => 16#0049#, 16#0FFB# => 16#0049#, 16#0FFC# => 16#0049#, 16#0FFD# => 16#0049#, 16#0FFE# => 16#0049#, 16#0FFF# => 16#008F#, 16#1000# => 16#0049#, 16#1001# => 16#0049#, 16#1002# => 16#0049#, 16#1003# => 16#0049#, 16#1004# => 16#0049#, 16#1005# => 16#0049#, 16#1006# => 16#0049#, 16#1007# => 16#0049#, 16#1008# => 16#0049#, 16#1009# => 16#0049#, 16#100A# => 16#0049#, 16#100B# => 16#0049#, 16#100C# => 16#0049#, 16#100D# => 16#0049#, 16#100E# => 16#0049#, 16#100F# => 16#0049#, 16#1010# => 16#0049#, 16#1011# => 16#0049#, 16#1012# => 16#0049#, 16#1013# => 16#0049#, 16#1014# => 16#0049#, 16#1015# => 16#0049#, 16#1016# => 16#0049#, 16#1017# => 16#0049#, 16#1018# => 16#0049#, 16#1019# => 16#0049#, 16#101A# => 16#0049#, 16#101B# => 16#0049#, 16#101C# => 16#0049#, 16#101D# => 16#0049#, 16#101E# => 16#0049#, 16#101F# => 16#0049#, 16#1020# => 16#0049#, 16#1021# => 16#0049#, 16#1022# => 16#0049#, 16#1023# => 16#0049#, 16#1024# => 16#0049#, 16#1025# => 16#0049#, 16#1026# => 16#0049#, 16#1027# => 16#0049#, 16#1028# => 16#0049#, 16#1029# => 16#0049#, 16#102A# => 16#0049#, 16#102B# => 16#0049#, 16#102C# => 16#0049#, 16#102D# => 16#0049#, 16#102E# => 16#0049#, 16#102F# => 16#0049#, 16#1030# => 16#0049#, 16#1031# => 16#0049#, 16#1032# => 16#0049#, 16#1033# => 16#0049#, 16#1034# => 16#0049#, 16#1035# => 16#0049#, 16#1036# => 16#0049#, 16#1037# => 16#0049#, 16#1038# => 16#0049#, 16#1039# => 16#0049#, 16#103A# => 16#0049#, 16#103B# => 16#0049#, 16#103C# => 16#0049#, 16#103D# => 16#0049#, 16#103E# => 16#0049#, 16#103F# => 16#0049#, 16#1040# => 16#0049#, 16#1041# => 16#0049#, 16#1042# => 16#0049#, 16#1043# => 16#0049#, 16#1044# => 16#0049#, 16#1045# => 16#0049#, 16#1046# => 16#0049#, 16#1047# => 16#0049#, 16#1048# => 16#0049#, 16#1049# => 16#0049#, 16#104A# => 16#0049#, 16#104B# => 16#0049#, 16#104C# => 16#0049#, 16#104D# => 16#0049#, 16#104E# => 16#0049#, 16#104F# => 16#0049#, 16#1050# => 16#0049#, 16#1051# => 16#0049#, 16#1052# => 16#0049#, 16#1053# => 16#0049#, 16#1054# => 16#0049#, 16#1055# => 16#0049#, 16#1056# => 16#0049#, 16#1057# => 16#0049#, 16#1058# => 16#0049#, 16#1059# => 16#0049#, 16#105A# => 16#0049#, 16#105B# => 16#0049#, 16#105C# => 16#0049#, 16#105D# => 16#0049#, 16#105E# => 16#0049#, 16#105F# => 16#0049#, 16#1060# => 16#0049#, 16#1061# => 16#0049#, 16#1062# => 16#0049#, 16#1063# => 16#0049#, 16#1064# => 16#0049#, 16#1065# => 16#0049#, 16#1066# => 16#0049#, 16#1067# => 16#0049#, 16#1068# => 16#0049#, 16#1069# => 16#0049#, 16#106A# => 16#0049#, 16#106B# => 16#0049#, 16#106C# => 16#0049#, 16#106D# => 16#0049#, 16#106E# => 16#0049#, 16#106F# => 16#0049#, 16#1070# => 16#0049#, 16#1071# => 16#0049#, 16#1072# => 16#0049#, 16#1073# => 16#0049#, 16#1074# => 16#0049#, 16#1075# => 16#0049#, 16#1076# => 16#0049#, 16#1077# => 16#0049#, 16#1078# => 16#0049#, 16#1079# => 16#0049#, 16#107A# => 16#0049#, 16#107B# => 16#0049#, 16#107C# => 16#0049#, 16#107D# => 16#0049#, 16#107E# => 16#0049#, 16#107F# => 16#0049#, 16#1080# => 16#0049#, 16#1081# => 16#0049#, 16#1082# => 16#0049#, 16#1083# => 16#0049#, 16#1084# => 16#0049#, 16#1085# => 16#0049#, 16#1086# => 16#0049#, 16#1087# => 16#0049#, 16#1088# => 16#0049#, 16#1089# => 16#0049#, 16#108A# => 16#0049#, 16#108B# => 16#0049#, 16#108C# => 16#0049#, 16#108D# => 16#0049#, 16#108E# => 16#0049#, 16#108F# => 16#0049#, 16#1090# => 16#0049#, 16#1091# => 16#0049#, 16#1092# => 16#0049#, 16#1093# => 16#0049#, 16#1094# => 16#0049#, 16#1095# => 16#0049#, 16#1096# => 16#0049#, 16#1097# => 16#0049#, 16#1098# => 16#0049#, 16#1099# => 16#0049#, 16#109A# => 16#0049#, 16#109B# => 16#0049#, 16#109C# => 16#0049#, 16#109D# => 16#0049#, 16#109E# => 16#0049#, 16#109F# => 16#0049#, 16#10A0# => 16#0049#, 16#10A1# => 16#0049#, 16#10A2# => 16#0049#, 16#10A3# => 16#0049#, 16#10A4# => 16#0049#, 16#10A5# => 16#0049#, 16#10A6# => 16#0049#, 16#10A7# => 16#0049#, 16#10A8# => 16#0049#, 16#10A9# => 16#0049#, 16#10AA# => 16#0049#, 16#10AB# => 16#0049#, 16#10AC# => 16#0049#, 16#10AD# => 16#0049#, 16#10AE# => 16#0049#, 16#10AF# => 16#0049#, 16#10B0# => 16#0049#, 16#10B1# => 16#0049#, 16#10B2# => 16#0049#, 16#10B3# => 16#0049#, 16#10B4# => 16#0049#, 16#10B5# => 16#0049#, 16#10B6# => 16#0049#, 16#10B7# => 16#0049#, 16#10B8# => 16#0049#, 16#10B9# => 16#0049#, 16#10BA# => 16#0049#, 16#10BB# => 16#0049#, 16#10BC# => 16#0049#, 16#10BD# => 16#0049#, 16#10BE# => 16#0049#, 16#10BF# => 16#0049#, 16#10C0# => 16#0049#, 16#10C1# => 16#0049#, 16#10C2# => 16#0049#, 16#10C3# => 16#0049#, 16#10C4# => 16#0049#, 16#10C5# => 16#0049#, 16#10C6# => 16#0049#, 16#10C7# => 16#0049#, 16#10C8# => 16#0049#, 16#10C9# => 16#0049#, 16#10CA# => 16#0049#, 16#10CB# => 16#0049#, 16#10CC# => 16#0049#, 16#10CD# => 16#0049#, 16#10CE# => 16#0049#, 16#10CF# => 16#0049#, 16#10D0# => 16#0049#, 16#10D1# => 16#0049#, 16#10D2# => 16#0049#, 16#10D3# => 16#0049#, 16#10D4# => 16#0049#, 16#10D5# => 16#0049#, 16#10D6# => 16#0049#, 16#10D7# => 16#0049#, 16#10D8# => 16#0049#, 16#10D9# => 16#0049#, 16#10DA# => 16#0049#, 16#10DB# => 16#0049#, 16#10DC# => 16#0049#, 16#10DD# => 16#0049#, 16#10DE# => 16#0049#, 16#10DF# => 16#0049#, 16#10E0# => 16#0049#, 16#10E1# => 16#0049#, 16#10E2# => 16#0049#, 16#10E3# => 16#0049#, 16#10E4# => 16#0049#, 16#10E5# => 16#0049#, 16#10E6# => 16#0049#, 16#10E7# => 16#0049#, 16#10E8# => 16#0049#, 16#10E9# => 16#0049#, 16#10EA# => 16#0049#, 16#10EB# => 16#0049#, 16#10EC# => 16#0049#, 16#10ED# => 16#0049#, 16#10EE# => 16#0049#, 16#10EF# => 16#0049#, 16#10F0# => 16#0049#, 16#10F1# => 16#0049#, 16#10F2# => 16#0049#, 16#10F3# => 16#0049#, 16#10F4# => 16#0049#, 16#10F5# => 16#0049#, 16#10F6# => 16#0049#, 16#10F7# => 16#0049#, 16#10F8# => 16#0049#, 16#10F9# => 16#0049#, 16#10FA# => 16#0049#, 16#10FB# => 16#0049#, 16#10FC# => 16#0049#, 16#10FD# => 16#0049#, 16#10FE# => 16#0049#, 16#10FF# => 16#008F#, others => 16#005D#); Base : constant array (First_Stage_Index range <>) of First_Stage_Index := (16#0000#, 16#0001#, 16#0002#, 16#0003#, 16#0004#, 16#0005#, 16#0006#, 16#0007#, 16#0008#, 16#0009#, 16#000A#, 16#000B#, 16#000C#, 16#000D#, 16#000E#, 16#000F#, 16#0010#, 16#0011#, 16#0012#, 16#0013#, 16#0014#, 16#0015#, 16#0016#, 16#0017#, 16#0018#, 16#0019#, 16#001A#, 16#001B#, 16#001C#, 16#001D#, 16#001E#, 16#001F#, 16#0020#, 16#0021#, 16#0022#, 16#0023#, 16#0024#, 16#0025#, 16#0026#, 16#0027#, 16#0028#, 16#0029#, 16#002A#, 16#002B#, 16#002C#, 16#002D#, 16#002E#, 16#002F#, 16#0030#, 16#0031#, 16#0032#, 16#0033#, 16#0034#, 16#004D#, 16#009F#, 16#00A0#, 16#00A1#, 16#00A4#, 16#00A6#, 16#00A7#, 16#00A8#, 16#00A9#, 16#00AA#, 16#00AB#, 16#00AC#, 16#00AD#, 16#00AE#, 16#00AF#, 16#00B0#, 16#00B1#, 16#00B2#, 16#00D7#, 16#00D8#, 16#00E0#, 16#00F9#, 16#00FA#, 16#00FB#, 16#00FC#, 16#00FD#, 16#00FE#, 16#00FF#, 16#0100#, 16#0101#, 16#0102#, 16#0103#, 16#0104#, 16#0105#, 16#0107#, 16#0108#, 16#0109#, 16#010A#, 16#010B#, 16#010C#, 16#010D#, 16#010E#, 16#0110#, 16#0111#, 16#0112#, 16#0113#, 16#0114#, 16#0115#, 16#0116#, 16#0118#, 16#011A#, 16#0123#, 16#0124#, 16#0132#, 16#0133#, 16#0134#, 16#016A#, 16#016B#, 16#016F#, 16#01B0#, 16#01BC#, 16#01D0#, 16#01D1#, 16#01D2#, 16#01D3#, 16#01D4#, 16#01D5#, 16#01D6#, 16#01D7#, 16#01E8#, 16#01EE#, 16#01F0#, 16#01F1#, 16#01F2#, 16#01F3#, 16#01F4#, 16#01F5#, 16#01F6#, 16#01F7#, 16#01F8#, 16#01FF#, 16#02A6#, 16#02B7#, 16#02B8#, 16#02B9#, 16#02FA#, 16#02FF#, 16#0E00#, 16#0E01#, 16#0E02#, 16#0FFF#); Base_Last : constant First_Stage_Index := 143; end Matreshka.Internals.Unicode.Ucd.Indexes;
reznikmm/matreshka
Ada
4,033
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_Specular_Color_Attributes; package Matreshka.ODF_Dr3d.Specular_Color_Attributes is type Dr3d_Specular_Color_Attribute_Node is new Matreshka.ODF_Dr3d.Abstract_Dr3d_Attribute_Node and ODF.DOM.Dr3d_Specular_Color_Attributes.ODF_Dr3d_Specular_Color_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Dr3d_Specular_Color_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Dr3d_Specular_Color_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Dr3d.Specular_Color_Attributes;
reznikmm/matreshka
Ada
4,067
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.Chart_Treat_Empty_Cells_Attributes; package Matreshka.ODF_Chart.Treat_Empty_Cells_Attributes is type Chart_Treat_Empty_Cells_Attribute_Node is new Matreshka.ODF_Chart.Abstract_Chart_Attribute_Node and ODF.DOM.Chart_Treat_Empty_Cells_Attributes.ODF_Chart_Treat_Empty_Cells_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Chart_Treat_Empty_Cells_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Chart_Treat_Empty_Cells_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Chart.Treat_Empty_Cells_Attributes;
reznikmm/matreshka
Ada
4,279
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.Style.Writing_Mode.Internals is ------------ -- Create -- ------------ function Create (Node : Matreshka.ODF_Attributes.Style.Writing_Mode.Style_Writing_Mode_Access) return ODF.DOM.Attributes.Style.Writing_Mode.ODF_Style_Writing_Mode 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.Style.Writing_Mode.Style_Writing_Mode_Access) return ODF.DOM.Attributes.Style.Writing_Mode.ODF_Style_Writing_Mode is begin return (XML.DOM.Attributes.Internals.Wrap (Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record); end Wrap; end ODF.DOM.Attributes.Style.Writing_Mode.Internals;
sungyeon/drake
Ada
5,196
ads
pragma License (Unrestricted); with Ada.Strings.Maps.Constants; -- diff (Ada.Strings.Maps.Naked) -- diff (Ada.Strings.Naked_Maps.Set_Constants) package Ada.Strings.Wide_Maps.Wide_Constants is pragma Preelaborate; -- extended -- There are sets of unicode category. function Unassigned_Set return Wide_Character_Set renames Maps.Constants.Unassigned_Set; function Uppercase_Letter_Set return Wide_Character_Set renames Maps.Constants.Uppercase_Letter_Set; function Lowercase_Letter_Set return Wide_Character_Set renames Maps.Constants.Lowercase_Letter_Set; function Titlecase_Letter_Set return Wide_Character_Set renames Maps.Constants.Titlecase_Letter_Set; function Modifier_Letter_Set return Wide_Character_Set renames Maps.Constants.Modifier_Letter_Set; function Other_Letter_Set return Wide_Character_Set renames Maps.Constants.Other_Letter_Set; function Decimal_Number_Set return Wide_Character_Set renames Maps.Constants.Decimal_Number_Set; function Letter_Number_Set return Wide_Character_Set renames Maps.Constants.Letter_Number_Set; function Other_Number_Set return Wide_Character_Set renames Maps.Constants.Other_Number_Set; function Line_Separator_Set return Wide_Character_Set renames Maps.Constants.Line_Separator_Set; function Paragraph_Separator_Set return Wide_Character_Set renames Maps.Constants.Paragraph_Separator_Set; function Control_Set return Wide_Character_Set renames Maps.Constants.Control_Set; function Format_Set return Wide_Character_Set renames Maps.Constants.Format_Set; function Private_Use_Set return Wide_Character_Set renames Maps.Constants.Private_Use_Set; function Surrogate_Set return Wide_Character_Set renames Maps.Constants.Surrogate_Set; -- extended function Base_Set return Wide_Character_Set renames Maps.Constants.Base_Set; -- Control_Set : constant Wide_Character_Set; -- Control_Set is declared as unicode category in above. -- Graphic_Set : constant Wide_Character_Set; function Graphic_Set return Wide_Character_Set renames Maps.Constants.Graphic_Set; -- Letter_Set : constant Wide_Character_Set; function Letter_Set return Wide_Character_Set renames Maps.Constants.Letter_Set; -- Lower_Set : constant Wide_Character_Set; function Lower_Set return Wide_Character_Set renames Lowercase_Letter_Set; -- Note: Lower_Set is extended for all unicode characters. -- Upper_Set : constant Wide_Character_Set; function Upper_Set return Wide_Character_Set renames Uppercase_Letter_Set; -- Note: Upper_Set is extended for all unicode characters. -- Basic_Set : constant Wide_Character_Set; function Basic_Set return Wide_Character_Set renames Maps.Constants.Basic_Set; -- Note: Basic_Set is extended for all unicode characters. -- Decimal_Digit_Set : constant Wide_Character_Set; function Decimal_Digit_Set return Wide_Character_Set renames Maps.Constants.Decimal_Digit_Set; -- Note: Decimal_Digit_Set is NOT extended for parsing. -- Hexadecimal_Digit_Set : constant Wide_Character_Set; function Hexadecimal_Digit_Set return Wide_Character_Set renames Maps.Constants.Hexadecimal_Digit_Set; -- Note: Hexadecimal_Digit_Set is NOT extended for parsing. -- Alphanumeric_Set : constant Wide_Character_Set; function Alphanumeric_Set return Wide_Character_Set renames Maps.Constants.Alphanumeric_Set; -- Special_Set : constant Wide_Character_Set; function Special_Set return Wide_Character_Set renames Maps.Constants.Special_Set; -- ISO_646_Set : constant Wide_Character_Set; function ISO_646_Set return Wide_Character_Set renames Maps.Constants.ISO_646_Set; -- Lower_Case_Map : constant Wide_Character_Mapping; function Lower_Case_Map return Wide_Character_Mapping renames Maps.Constants.Lower_Case_Map; -- Maps to lower case for letters, else identity -- Note: Lower_Case_Map is extended for all unicode characters. -- Upper_Case_Map : constant Wide_Character_Mapping; function Upper_Case_Map return Wide_Character_Mapping renames Maps.Constants.Upper_Case_Map; -- Maps to upper case for letters, else identity -- Note: Upper_Case_Map is extended for all unicode characters. -- extended from here function Case_Folding_Map return Wide_Character_Mapping renames Maps.Constants.Case_Folding_Map; -- to here -- Basic_Map : constant Wide_Character_Mapping; function Basic_Map return Wide_Character_Mapping renames Maps.Constants.Basic_Map; -- Maps to basic letter for letters, else identity -- Note: Basic_Map is extended for all unicode characters, and not -- limited to letters. -- RM A.4.7 -- Character_Set : constant Wide_Maps.Wide_Character_Set; function Character_Set return Wide_Character_Set renames ISO_646_Set; -- Contains each Wide_Character value WC such that -- Characters.Conversions.Is_Character(WC) is True -- Note: (16#7F# .. 16#FF#) is excluded from Character_Set. end Ada.Strings.Wide_Maps.Wide_Constants;
reznikmm/matreshka
Ada
6,980
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_Text.Hidden_Paragraph_Elements is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Text_Hidden_Paragraph_Element_Node is begin return Self : Text_Hidden_Paragraph_Element_Node do Matreshka.ODF_Text.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Text_Prefix); end return; end Create; ---------------- -- Enter_Node -- ---------------- overriding procedure Enter_Node (Self : not null access Text_Hidden_Paragraph_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Enter_Text_Hidden_Paragraph (ODF.DOM.Text_Hidden_Paragraph_Elements.ODF_Text_Hidden_Paragraph_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Enter_Node (Visitor, Control); end if; end Enter_Node; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Text_Hidden_Paragraph_Element_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Hidden_Paragraph_Element; end Get_Local_Name; ---------------- -- Leave_Node -- ---------------- overriding procedure Leave_Node (Self : not null access Text_Hidden_Paragraph_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Leave_Text_Hidden_Paragraph (ODF.DOM.Text_Hidden_Paragraph_Elements.ODF_Text_Hidden_Paragraph_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Leave_Node (Visitor, Control); end if; end Leave_Node; ---------------- -- Visit_Node -- ---------------- overriding procedure Visit_Node (Self : not null access Text_Hidden_Paragraph_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) is begin if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then ODF.DOM.Iterators.Abstract_ODF_Iterator'Class (Iterator).Visit_Text_Hidden_Paragraph (Visitor, ODF.DOM.Text_Hidden_Paragraph_Elements.ODF_Text_Hidden_Paragraph_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Visit_Node (Iterator, Visitor, Control); end if; end Visit_Node; begin Matreshka.DOM_Documents.Register_Element (Matreshka.ODF_String_Constants.Text_URI, Matreshka.ODF_String_Constants.Hidden_Paragraph_Element, Text_Hidden_Paragraph_Element_Node'Tag); end Matreshka.ODF_Text.Hidden_Paragraph_Elements;
caqg/linux-home
Ada
19,411
adb
-- generated parser support file. -*- buffer-read-only:t -*- -- command line: wisitoken-bnf-generate.exe --generate LR1 Ada_Emacs re2c PROCESS gpr.wy -- -- Copyright (C) 2013 - 2022 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, or (at -- your option) any later version. -- -- This software 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>. with Wisi; use Wisi; with Wisi.Gpr; use Wisi.Gpr; with WisiToken.In_Parse_Actions; use WisiToken.In_Parse_Actions; package body Gpr_Process_Actions is use WisiToken.Syntax_Trees.In_Parse_Actions; procedure aggregate_g_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => null; when Face => null; when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Anchored_0, 1, 1))), (False, (Simple, (Anchored_0, 1, 0))))); end case; end aggregate_g_0; procedure attribute_declaration_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (5, Statement_End))); Name_Action (Parse_Data, Tree, Nonterm, 2); when Face => Face_Apply_Action (Parse_Data, Tree, Nonterm, (1 => (2, 2, 0))); when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))))); end case; end attribute_declaration_0; procedure attribute_declaration_1 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (8, Statement_End))); Name_Action (Parse_Data, Tree, Nonterm, 2); when Face => Face_Apply_Action (Parse_Data, Tree, Nonterm, (1 => (2, 2, 0))); when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken - 1))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken - 1))), (False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))))); end case; end attribute_declaration_1; procedure attribute_declaration_2 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (10, Statement_End))); Name_Action (Parse_Data, Tree, Nonterm, 2); when Face => Face_Apply_Action (Parse_Data, Tree, Nonterm, (1 => (2, 2, 0))); when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken - 1))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken - 1))), (False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))))); end case; end attribute_declaration_2; procedure attribute_declaration_3 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (8, Statement_End))); when Face => null; when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken - 1))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken - 1))), (False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))))); end case; end attribute_declaration_3; procedure case_statement_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (7, Statement_End))); when Face => null; when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (True, (Simple, (Block, Gpr_Indent_When)), (Simple, (Int, Gpr_Indent_When))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))))); end case; end case_statement_0; procedure case_item_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, (1 => (1, Motion))); when Face => null; when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent))), (False, (Simple, (Block, Gpr_Indent))))); end case; end case_item_0; procedure compilation_unit_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => null; when Face => null; when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Int, 0))), (False, (Simple, (Int, 0))), (True, (Simple, (Int, 0)), (Simple, (Int, 0))))); end case; end compilation_unit_0; function identifier_opt_1_check (Tree : in WisiToken.Syntax_Trees.Tree; Nonterm : in out WisiToken.Syntax_Trees.Recover_Token; Tokens : in WisiToken.Syntax_Trees.Recover_Token_Array; Recover_Active : in Boolean) return WisiToken.Syntax_Trees.In_Parse_Actions.Status is pragma Unreferenced (Recover_Active); begin return Propagate_Name (Tree, Nonterm, Tokens, 1); end identifier_opt_1_check; procedure package_spec_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (7, Statement_End))); Name_Action (Parse_Data, Tree, Nonterm, 2); when Face => Face_Apply_Action (Parse_Data, Tree, Nonterm, ((2, 2, 0), (6, 2, 0))); when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (True, (Simple, (Block, Gpr_Indent)), (Simple, (Int, Gpr_Indent))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))))); end case; end package_spec_0; function package_spec_0_check (Tree : in WisiToken.Syntax_Trees.Tree; Nonterm : in out WisiToken.Syntax_Trees.Recover_Token; Tokens : in WisiToken.Syntax_Trees.Recover_Token_Array; Recover_Active : in Boolean) return WisiToken.Syntax_Trees.In_Parse_Actions.Status is pragma Unreferenced (Nonterm, Recover_Active); begin return Match_Names (Tree, Tokens, 2, 6, End_Names_Optional); end package_spec_0_check; procedure package_extension_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (9, Statement_End))); Name_Action (Parse_Data, Tree, Nonterm, 2); when Face => Face_Apply_Action (Parse_Data, Tree, Nonterm, ((2, 2, 0), (8, 2, 0))); when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (True, (Simple, (Block, Gpr_Indent)), (Simple, (Int, Gpr_Indent))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))))); end case; end package_extension_0; function package_extension_0_check (Tree : in WisiToken.Syntax_Trees.Tree; Nonterm : in out WisiToken.Syntax_Trees.Recover_Token; Tokens : in WisiToken.Syntax_Trees.Recover_Token_Array; Recover_Active : in Boolean) return WisiToken.Syntax_Trees.In_Parse_Actions.Status is pragma Unreferenced (Nonterm, Recover_Active); begin return Match_Names (Tree, Tokens, 2, 8, End_Names_Optional); end package_extension_0_check; procedure package_renaming_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (5, Statement_End))); when Face => Face_Apply_Action (Parse_Data, Tree, Nonterm, ((2, 2, 0), (4, 2, 0))); when Indent => null; end case; end package_renaming_0; procedure project_extension_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (9, Statement_End))); Name_Action (Parse_Data, Tree, Nonterm, 2); when Face => Face_Apply_Action (Parse_Data, Tree, Nonterm, ((1, 2, 1), (2, 2, 0), (8, 2, 0))); when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (True, (Simple, (Block, Gpr_Indent)), (Simple, (Int, Gpr_Indent))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))))); end case; end project_extension_0; function project_extension_0_check (Tree : in WisiToken.Syntax_Trees.Tree; Nonterm : in out WisiToken.Syntax_Trees.Recover_Token; Tokens : in WisiToken.Syntax_Trees.Recover_Token_Array; Recover_Active : in Boolean) return WisiToken.Syntax_Trees.In_Parse_Actions.Status is pragma Unreferenced (Nonterm, Recover_Active); begin return Match_Names (Tree, Tokens, 2, 8, End_Names_Optional); end project_extension_0_check; procedure simple_declarative_item_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (4, Statement_End))); when Face => null; when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))))); end case; end simple_declarative_item_0; procedure simple_declarative_item_1 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (6, Statement_End))); when Face => null; when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))))); end case; end simple_declarative_item_1; procedure simple_declarative_item_4 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (2, Statement_End))); when Face => null; when Indent => null; end case; end simple_declarative_item_4; procedure simple_project_declaration_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (7, Statement_End))); Name_Action (Parse_Data, Tree, Nonterm, 2); when Face => Face_Apply_Action (Parse_Data, Tree, Nonterm, ((1, 2, 1), (2, 2, 0), (6, 2, 0))); when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))), (True, (Simple, (Block, Gpr_Indent)), (Simple, (Int, Gpr_Indent))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))), (False, (Simple, (Label => None))))); end case; end simple_project_declaration_0; function simple_project_declaration_0_check (Tree : in WisiToken.Syntax_Trees.Tree; Nonterm : in out WisiToken.Syntax_Trees.Recover_Token; Tokens : in WisiToken.Syntax_Trees.Recover_Token_Array; Recover_Active : in Boolean) return WisiToken.Syntax_Trees.In_Parse_Actions.Status is pragma Unreferenced (Nonterm, Recover_Active); begin return Match_Names (Tree, Tokens, 2, 6, End_Names_Optional); end simple_project_declaration_0_check; procedure typed_string_declaration_0 (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class; Tree : in out WisiToken.Syntax_Trees.Tree; Nonterm : in WisiToken.Syntax_Trees.Valid_Node_Access) is Parse_Data : Wisi.Parse_Data_Type renames Wisi.Parse_Data_Type (User_Data); begin case Parse_Data.Post_Parse_Action is when Navigate => Statement_Action (Parse_Data, Tree, Nonterm, ((1, Statement_Start), (5, Statement_End))); when Face => null; when Indent => Indent_Action_0 (Parse_Data, Tree, Nonterm, ((False, (Simple, (Label => None))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Int, Gpr_Indent_Broken))), (False, (Simple, (Label => None))))); end case; end typed_string_declaration_0; end Gpr_Process_Actions;
mirror/ncurses
Ada
17,336
adb
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses2.trace_set -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright 2020 Thomas E. Dickey -- -- Copyright 2000-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: Eugene V. Melaragno <[email protected]> 2000 -- Version Control -- $Revision: 1.7 $ -- $Date: 2020/02/02 23:34:34 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Ada.Strings.Bounded; -- interactively set the trace level procedure ncurses2.trace_set is function menu_virtualize (c : Key_Code) return Key_Code; function subset (super, sub : Trace_Attribute_Set) return Boolean; function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set; function trace_num (tlevel : Trace_Attribute_Set) return String; function tracetrace (tlevel : Trace_Attribute_Set) return String; function run_trace_menu (m : Menu; count : Integer) return Boolean; function menu_virtualize (c : Key_Code) return Key_Code is begin case c is when Character'Pos (newl) | Key_Exit => return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO when Character'Pos ('u') => return M_ScrollUp_Line; when Character'Pos ('d') => return M_ScrollDown_Line; when Character'Pos ('b') | Key_Next_Page => return M_ScrollUp_Page; when Character'Pos ('f') | Key_Previous_Page => return M_ScrollDown_Page; when Character'Pos ('n') | Key_Cursor_Down => return M_Next_Item; when Character'Pos ('p') | Key_Cursor_Up => return M_Previous_Item; when Character'Pos (' ') => return M_Toggle_Item; when Key_Mouse => return c; when others => Beep; return c; end case; end menu_virtualize; type string_a is access String; type tbl_entry is record name : string_a; mask : Trace_Attribute_Set; end record; t_tbl : constant array (Positive range <>) of tbl_entry := ( (new String'("Disable"), Trace_Disable), (new String'("Times"), Trace_Attribute_Set'(Times => True, others => False)), (new String'("Tputs"), Trace_Attribute_Set'(Tputs => True, others => False)), (new String'("Update"), Trace_Attribute_Set'(Update => True, others => False)), (new String'("Cursor_Move"), Trace_Attribute_Set'(Cursor_Move => True, others => False)), (new String'("Character_Output"), Trace_Attribute_Set'(Character_Output => True, others => False)), (new String'("Ordinary"), Trace_Ordinary), (new String'("Calls"), Trace_Attribute_Set'(Calls => True, others => False)), (new String'("Virtual_Puts"), Trace_Attribute_Set'(Virtual_Puts => True, others => False)), (new String'("Input_Events"), Trace_Attribute_Set'(Input_Events => True, others => False)), (new String'("TTY_State"), Trace_Attribute_Set'(TTY_State => True, others => False)), (new String'("Internal_Calls"), Trace_Attribute_Set'(Internal_Calls => True, others => False)), (new String'("Character_Calls"), Trace_Attribute_Set'(Character_Calls => True, others => False)), (new String'("Termcap_TermInfo"), Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)), (new String'("Maximium"), Trace_Maximum) ); package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (300); function subset (super, sub : Trace_Attribute_Set) return Boolean is begin if (super.Times or not sub.Times) and (super.Tputs or not sub.Tputs) and (super.Update or not sub.Update) and (super.Cursor_Move or not sub.Cursor_Move) and (super.Character_Output or not sub.Character_Output) and (super.Calls or not sub.Calls) and (super.Virtual_Puts or not sub.Virtual_Puts) and (super.Input_Events or not sub.Input_Events) and (super.TTY_State or not sub.TTY_State) and (super.Internal_Calls or not sub.Internal_Calls) and (super.Character_Calls or not sub.Character_Calls) and (super.Termcap_TermInfo or not sub.Termcap_TermInfo) and True then return True; else return False; end if; end subset; function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set is retval : Trace_Attribute_Set := Trace_Disable; begin retval.Times := (a.Times or b.Times); retval.Tputs := (a.Tputs or b.Tputs); retval.Update := (a.Update or b.Update); retval.Cursor_Move := (a.Cursor_Move or b.Cursor_Move); retval.Character_Output := (a.Character_Output or b.Character_Output); retval.Calls := (a.Calls or b.Calls); retval.Virtual_Puts := (a.Virtual_Puts or b.Virtual_Puts); retval.Input_Events := (a.Input_Events or b.Input_Events); retval.TTY_State := (a.TTY_State or b.TTY_State); retval.Internal_Calls := (a.Internal_Calls or b.Internal_Calls); retval.Character_Calls := (a.Character_Calls or b.Character_Calls); retval.Termcap_TermInfo := (a.Termcap_TermInfo or b.Termcap_TermInfo); return retval; end trace_or; -- Print the hexadecimal value of the mask so -- users can set it from the command line. function trace_num (tlevel : Trace_Attribute_Set) return String is result : Integer := 0; m : Integer := 1; begin if tlevel.Times then result := result + m; end if; m := m * 2; if tlevel.Tputs then result := result + m; end if; m := m * 2; if tlevel.Update then result := result + m; end if; m := m * 2; if tlevel.Cursor_Move then result := result + m; end if; m := m * 2; if tlevel.Character_Output then result := result + m; end if; m := m * 2; if tlevel.Calls then result := result + m; end if; m := m * 2; if tlevel.Virtual_Puts then result := result + m; end if; m := m * 2; if tlevel.Input_Events then result := result + m; end if; m := m * 2; if tlevel.TTY_State then result := result + m; end if; m := m * 2; if tlevel.Internal_Calls then result := result + m; end if; m := m * 2; if tlevel.Character_Calls then result := result + m; end if; m := m * 2; if tlevel.Termcap_TermInfo then result := result + m; end if; m := m * 2; return result'Img; end trace_num; function tracetrace (tlevel : Trace_Attribute_Set) return String is use BS; buf : Bounded_String := To_Bounded_String (""); begin -- The C version prints the hexadecimal value of the mask, we -- won't do that here because this is Ada. if tlevel = Trace_Disable then Append (buf, "Trace_Disable"); else if subset (tlevel, Trace_Attribute_Set'(Times => True, others => False)) then Append (buf, "Times"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Tputs => True, others => False)) then Append (buf, "Tputs"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Update => True, others => False)) then Append (buf, "Update"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Cursor_Move => True, others => False)) then Append (buf, "Cursor_Move"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Character_Output => True, others => False)) then Append (buf, "Character_Output"); Append (buf, ", "); end if; if subset (tlevel, Trace_Ordinary) then Append (buf, "Ordinary"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Calls => True, others => False)) then Append (buf, "Calls"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Virtual_Puts => True, others => False)) then Append (buf, "Virtual_Puts"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Input_Events => True, others => False)) then Append (buf, "Input_Events"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(TTY_State => True, others => False)) then Append (buf, "TTY_State"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Internal_Calls => True, others => False)) then Append (buf, "Internal_Calls"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Character_Calls => True, others => False)) then Append (buf, "Character_Calls"); Append (buf, ", "); end if; if subset (tlevel, Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)) then Append (buf, "Termcap_TermInfo"); Append (buf, ", "); end if; if subset (tlevel, Trace_Maximum) then Append (buf, "Maximium"); Append (buf, ", "); end if; end if; if To_String (buf) (Length (buf) - 1) = ',' then Delete (buf, Length (buf) - 1, Length (buf)); end if; return To_String (buf); end tracetrace; function run_trace_menu (m : Menu; count : Integer) return Boolean is i, p : Item; changed : Boolean; c, v : Key_Code; begin loop changed := (count /= 0); c := Getchar (Get_Window (m)); v := menu_virtualize (c); case Driver (m, v) is when Unknown_Request => return False; when others => i := Current (m); if i = Menus.Items (m, 1) then -- the first item for n in t_tbl'First + 1 .. t_tbl'Last loop if Value (i) then Set_Value (i, False); changed := True; end if; end loop; else for n in t_tbl'First + 1 .. t_tbl'Last loop p := Menus.Items (m, n); if Value (p) then Set_Value (Menus.Items (m, 1), False); changed := True; exit; end if; end loop; end if; if not changed then return True; end if; end case; end loop; end run_trace_menu; nc_tracing, mask : Trace_Attribute_Set; pragma Import (C, nc_tracing, "_nc_tracing"); items_a : constant Item_Array_Access := new Item_Array (t_tbl'First .. t_tbl'Last + 1); mrows : Line_Count; mcols : Column_Count; menuwin : Window; menu_y : constant Line_Position := 8; menu_x : constant Column_Position := 8; ip : Item; m : Menu; count : Integer; newtrace : Trace_Attribute_Set; begin Add (Line => 0, Column => 0, Str => "Interactively set trace level:"); Add (Line => 2, Column => 0, Str => " Press space bar to toggle a selection."); Add (Line => 3, Column => 0, Str => " Use up and down arrow to move the select bar."); Add (Line => 4, Column => 0, Str => " Press return to set the trace level."); Add (Line => 6, Column => 0, Str => "(Current trace level is "); Add (Str => tracetrace (nc_tracing) & " numerically: " & trace_num (nc_tracing)); Add (Ch => ')'); Refresh; for n in t_tbl'Range loop items_a.all (n) := New_Item (t_tbl (n).name.all); end loop; items_a.all (t_tbl'Last + 1) := Null_Item; m := New_Menu (items_a); Set_Format (m, 16, 2); Scale (m, mrows, mcols); Switch_Options (m, (One_Valued => True, others => False), On => False); menuwin := New_Window (mrows + 2, mcols + 2, menu_y, menu_x); Set_Window (m, menuwin); Set_KeyPad_Mode (menuwin, SwitchOn => True); Box (menuwin); Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); Post (m); for n in t_tbl'Range loop ip := Items (m, n); mask := t_tbl (n).mask; if mask = Trace_Disable then Set_Value (ip, nc_tracing = Trace_Disable); elsif subset (sub => mask, super => nc_tracing) then Set_Value (ip, True); end if; end loop; count := 1; while run_trace_menu (m, count) loop count := count + 1; end loop; newtrace := Trace_Disable; for n in t_tbl'Range loop ip := Items (m, n); if Value (ip) then mask := t_tbl (n).mask; newtrace := trace_or (newtrace, mask); end if; end loop; Trace_On (newtrace); Trace_Put ("trace level interactively set to " & tracetrace (nc_tracing)); Move_Cursor (Line => Lines - 4, Column => 0); Add (Str => "Trace level is "); Add (Str => tracetrace (nc_tracing)); Add (Ch => newl); Pause; -- was just Add(); Getchar Post (m, False); -- menuwin has subwindows I think, which makes an error. declare begin Delete (menuwin); exception when Curses_Exception => null; end; -- free_menu(m); -- free_item() end ncurses2.trace_set;
reznikmm/matreshka
Ada
3,779
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.Presentation_Transition_Type_Attributes is pragma Preelaborate; type ODF_Presentation_Transition_Type_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Presentation_Transition_Type_Attribute_Access is access all ODF_Presentation_Transition_Type_Attribute'Class with Storage_Size => 0; end ODF.DOM.Presentation_Transition_Type_Attributes;
MinimSecure/unum-sdk
Ada
951
ads
-- Copyright 2008-2016 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Pck is type Parameter is record One : Integer; Two : Integer; Three : Integer; end record; function Ident (P : Parameter) return Parameter; procedure Do_Nothing (P : in out Parameter); end Pck;
PThierry/ewok-kernel
Ada
4,404
ads
-- -- Copyright 2018 The wookey project team <[email protected]> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- with m4.layout; package m4.systick with spark_mode => on is -- FIXME - Should be defined in arch/boards MAIN_CLOCK_FREQUENCY : constant := 168_000_000; TICKS_PER_SECOND : constant := 1000; subtype t_tick is unsigned_64; ---------------------------------------------------- -- SysTick control and status register (STK_CTRL) -- ---------------------------------------------------- type t_clock_type is (EXT_CLOCK, PROCESSOR_CLOCK) with size => 1; for t_clock_type use (EXT_CLOCK => 0, PROCESSOR_CLOCK => 1); type t_STK_CTRL is record ENABLE : boolean; -- Enables the counter TICKINT : boolean; -- Enables exception request CLKSOURCE : t_clock_type; COUNTFLAG : bit; end record with size => 32, volatile_full_access; for t_STK_CTRL use record ENABLE at 0 range 0 .. 0; TICKINT at 0 range 1 .. 1; CLKSOURCE at 0 range 2 .. 2; COUNTFLAG at 0 range 16 .. 16; end record; ---------------------------------------------- -- SysTick reload value register (STK_LOAD) -- ---------------------------------------------- -- Note: To generate a timer with a period of N processor clock -- cycles, use a RELOAD value of N-1. type t_STK_LOAD is record RELOAD : bits_24; end record with size => 32, volatile_full_access; ---------------------------------------------- -- SysTick current value register (STK_VAL) -- ---------------------------------------------- type t_STK_VAL is record CURRENT : bits_24; end record with size => 32, volatile_full_access; ---------------------------------------------------- -- SysTick calibration value register (STK_CALIB) -- ---------------------------------------------------- type t_STK_CALIB is record TENMS : bits_24; SKEW : bit; NOREF : bit; end record with size => 32, volatile_full_access; for t_STK_CALIB use record TENMS at 0 range 0 .. 23; SKEW at 0 range 30 .. 30; NOREF at 0 range 31 .. 31; end record; ---------------- -- Peripheral -- ---------------- type t_SYSTICK_peripheral is record CTRL : t_STK_CTRL; LOAD : t_STK_LOAD; VAL : t_STK_VAL; CALIB : t_STK_CALIB; end record with volatile; for t_SYSTICK_peripheral use record CTRL at 16#00# range 0 .. 31; LOAD at 16#04# range 0 .. 31; VAL at 16#08# range 0 .. 31; CALIB at 16#0C# range 0 .. 31; end record; SYSTICK : t_SYSTICK_peripheral with import, volatile, address => m4.layout.SYS_TIMER_base; --------------- -- Functions -- --------------- -- Initialize the systick module procedure init; -- Get the number of milliseconds elapsed since booting function get_ticks return unsigned_64 with volatile_function; function get_milliseconds return milliseconds with volatile_function; function get_microseconds return microseconds with volatile_function; function to_ticks (ms : milliseconds) return t_tick with inline; function to_milliseconds (t : t_tick) return milliseconds with inline; function to_microseconds (t : t_tick) return microseconds with inline; -- Note: default Systick IRQ handler is defined in package -- ewok.interrupts.handler and call 'increment' procedure procedure increment; private ticks : t_tick with volatile, async_writers; end m4.systick;
Fabien-Chouteau/lvgl-ada
Ada
2,148
ads
with Lv.Style; package Lv.Objx.Led is subtype Instance is Obj_T; subtype Brightness is Uint8_T range 0 .. 255; -- Create a led objects -- @param par pointer to an object, it will be the parent of the new led -- @param copy pointer to a led object, if not NULL then the new object will be copied from it -- @return pointer to the created led function Create (Parent : Obj_T; Copy : Instance) return Instance; ---------------------- -- Setter functions -- ---------------------- -- Set the brightness of a LED object -- @param self pointer to a LED object -- @param bright 0 (max. dark) ... 255 (max. light) procedure Set_Bright (Self : Instance; Bright : Brightness); -- Light on a LED -- @param self pointer to a LED object procedure On (Self : Instance); -- Light off a LED -- @param self pointer to a LED object procedure Off (Self : Instance); -- Toggle the state of a LED -- @param self pointer to a LED object procedure Toggle (Self : Instance); -- Set the style of a led -- @param self pointer to a led object -- @param style pointer to a style procedure Set_Style (Self : Instance; Style : Lv.Style.Style); ---------------------- -- Getter functions -- ---------------------- -- Get the brightness of a LEd object -- @param self pointer to LED object -- @return bright 0 (max. dark) ... 255 (max. light) function Bright (Self : Instance) return Brightness; -- Get the style of an led object -- @param self pointer to an led object -- @return pointer to the led's style function Style (Self : Instance) return Lv.Style.Style; ------------- -- Imports -- ------------- pragma Import (C, Create, "lv_led_create"); pragma Import (C, Set_Bright, "lv_led_set_bright"); pragma Import (C, On, "lv_led_on"); pragma Import (C, Off, "lv_led_off"); pragma Import (C, Toggle, "lv_led_toggle"); pragma Import (C, Set_Style, "lv_led_set_style_inline"); pragma Import (C, Bright, "lv_led_get_bright"); pragma Import (C, Style, "lv_led_get_style_inline"); end Lv.Objx.Led;
sungyeon/drake
Ada
2,273
adb
package body System.Fat_LLF is function frexp (value : Long_Long_Float; exp : access Integer) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_frexpl"; function inf return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_infl"; function isfinite (X : Long_Long_Float) return Integer with Import, Convention => Intrinsic, External_Name => "__builtin_isfinite"; pragma Warnings (Off, isfinite); -- [gcc 4.6] excessive prototype checking package body Attr_Long_Long_Float is function Compose (Fraction : Long_Long_Float; Exponent : Integer) return Long_Long_Float is begin return Scaling (Attr_Long_Long_Float.Fraction (Fraction), Exponent); end Compose; function Exponent (X : Long_Long_Float) return Integer is Result : aliased Integer; Dummy : Long_Long_Float; begin Dummy := frexp (X, Result'Access); return Result; end Exponent; function Fraction (X : Long_Long_Float) return Long_Long_Float is Dummy : aliased Integer; begin return frexp (X, Dummy'Access); end Fraction; function Leading_Part (X : Long_Long_Float; Radix_Digits : Integer) return Long_Long_Float is S : constant Integer := Radix_Digits - Exponent (X); begin return Scaling (Truncation (Scaling (X, S)), -S); end Leading_Part; function Machine (X : Long_Long_Float) return Long_Long_Float is begin return X; -- ??? end Machine; function Pred (X : Long_Long_Float) return Long_Long_Float is begin return Adjacent (X, -inf); end Pred; function Succ (X : Long_Long_Float) return Long_Long_Float is begin return Adjacent (X, inf); end Succ; function Unbiased_Rounding (X : Long_Long_Float) return Long_Long_Float is begin return X - Remainder (X, 1.0); end Unbiased_Rounding; function Valid (X : not null access Long_Long_Float) return Boolean is begin return isfinite (X.all) /= 0; end Valid; end Attr_Long_Long_Float; end System.Fat_LLF;
reznikmm/matreshka
Ada
3,744
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.Text_Master_Page_Name_Attributes is pragma Preelaborate; type ODF_Text_Master_Page_Name_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Text_Master_Page_Name_Attribute_Access is access all ODF_Text_Master_Page_Name_Attribute'Class with Storage_Size => 0; end ODF.DOM.Text_Master_Page_Name_Attributes;
michalkonecny/polypaver
Ada
912
ads
--# inherit PP_F_Exact, PP_F_Elementary; package Riemann is -- An approximation of the function erf(x)*pi/2, which is equal -- to the integral \int_0^x(e^(-t^2))dt. This integral does not -- have a closed algebraic solution. This function uses a simple -- Riemann sum to approximate the integral. -- -- The parameter n determines the number of segments to be used in the -- partition of equal size. There are 2^n segments. function erf_Riemann(x : Float; n : Integer) return Float; --# return result => --# PP_F_Exact.Contained_In( --# result --# , --# PP_F_Exact.Integral(0.0,x,PP_F_Exact.Exp(-PP_F_Exact.Integration_Variable**2)) --# + --# PP_F_Exact.Interval( --# 0.0 --# , --# (1.0-PP_F_Exact.Exp(-x**2))*x/Float(2**n) --# ) --# ); end Riemann;
zhmu/ananas
Ada
2,929
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . T E X T _ I O . R E S E T _ S T A N D A R D _ F I L E S -- -- -- -- S p e c -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- This package provides a reset routine that resets the standard files used -- by Text_IO. This is useful in systems such as VxWorks where Ada.Text_IO is -- elaborated at the program start, but a system restart may alter the status -- of these files, resulting in incorrect operation of Text_IO (in particular -- if the standard input file is changed to be interactive, then Get_Line may -- hang looking for an extra character after the end of the line. procedure Ada.Text_IO.Reset_Standard_Files; -- Reset standard Text_IO files as described above
ZinebZaad/ENSEEIHT
Ada
10,050
adb
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with SDA_Exceptions; use SDA_Exceptions; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; --! Les Unbounded_String ont une capacité variable, contrairement au String --! pour lesquelles une capacité doit être fixée. with ABR; procedure Test_ABR is package ABR_String_Integer is new ABR (T_Cle => Unbounded_String, T_Donnee => Integer, "<" => "<"); use ABR_String_Integer; -- Est-ce que la Cle est utilisée dans la Sda function Cle_Presente (Sda : in T_ABR ; Cle : in Unbounded_String) return Boolean is Temp: Integer; begin Temp := La_Donnee(Sda, Cle); return True; exception when Cle_Absente_Exception => return False; end Cle_Presente; -- Retourner une chaîne avec des guillemets autour de S function Avec_Guillemets (S: Unbounded_String) return String is begin return '"' & To_String (S) & '"'; end; -- Utiliser & entre String à gauche et Unbounded_String à droite. Des -- guillemets sont ajoutées autour de la Unbounded_String -- Il s'agit d'un masquage de l'opérteur & défini dans Strings.Unbounded function "&" (Left: String; Right: Unbounded_String) return String is begin return Left & Avec_Guillemets (Right); end; -- Surcharge l'opérateur unaire "+" pour convertir une String -- en Unbounded_String. -- Cette astuce permet de simplifier l'initialisation -- de cles un peu plus loin. function "+" (Item : in String) return Unbounded_String renames To_Unbounded_String; -- Afficher une Unbounded_String et un entier. procedure Afficher_S (S : in Unbounded_String; N: in Integer) is begin Put (Avec_Guillemets (S)); Put (" : "); Put (N, 1); New_Line; end Afficher_S; -- Afficher la Sda. procedure Afficher_Old is new Pour_Chaque (Afficher_S); -- Afficher la Sda. procedure Afficher is new Afficher_SDA (Afficher_S); Nb_Cles : constant Integer := 17; Cles : constant array (1..Nb_Cles) of Unbounded_String := (+"Frank", +"Bob", +"Henri", +"Dick", +"Alice", +"Eric", +"Giles", +"Jack", +"Irene", +"Chris", +"un", +"deux", +"trois", +"quatre", +"cinq", +"quatre-vingt-dix-neuf", +"vingt-et-un"); Inconnu : constant Unbounded_String := To_Unbounded_String ("Inconnu"); Donnees : constant array (1..Nb_Cles) of Integer := (6156, 9278, 1476, 9327, 3890, 9223, 4512, 6843, 0924, 3839, 1, 2, 3, 4, 5, 99, 21); Somme_Donnees : constant Integer := 55468 + 135; Somme_Donnees_Len4 : constant Integer := 25393 + 7; -- somme si Length (Cle) = 4 Somme_Donnees_Q: constant Integer := 103; -- somme si initiale de Cle = 'q' -- Initialiser l'annuaire avec les Donnees et Cles ci-dessus. -- Attention, c'est à l'appelant de libérer la mémoire associée en -- utilisant Vider. -- Si Bavard est vrai, les insertions sont tracées (affichées). procedure Construire_Exemple_Sujet (Annuaire : out T_ABR; Bavard: Boolean := False) is begin Initialiser (Annuaire); pragma Assert (Est_Vide (Annuaire)); pragma Assert (Taille (Annuaire) = 0); for I in 1..Nb_Cles loop Enregistrer (Annuaire, Cles (I), Donnees (I)); if Bavard then Put_Line ("Après insertion de la clé " & Cles (I)); Afficher (Annuaire); New_Line; else null; end if; pragma Assert (not Est_Vide (Annuaire)); pragma Assert (Taille (Annuaire) = I); for J in 1..I loop pragma Assert (La_Donnee (Annuaire, Cles (J)) = Donnees (J)); end loop; for J in I+1..Nb_Cles loop pragma Assert (not Cle_Presente (Annuaire, Cles (J))); end loop; end loop; end Construire_Exemple_Sujet; procedure Tester_Exemple_Sujet is Annuaire : T_ABR; begin Construire_Exemple_Sujet (Annuaire, True); Vider (Annuaire); end Tester_Exemple_Sujet; -- Tester suppression en commençant par les derniers éléments ajoutés procedure Tester_Supprimer_Inverse is Annuaire : T_ABR; begin Put_Line ("=== Tester_Supprimer_Inverse..."); New_Line; Construire_Exemple_Sujet (Annuaire); for I in reverse 1..Nb_Cles loop Supprimer (Annuaire, Cles (I)); Put_Line ("Après suppression de " & Cles (I) & " :"); Afficher (Annuaire); New_Line; for J in 1..I-1 loop pragma Assert (Cle_Presente (Annuaire, Cles (J))); pragma Assert (La_Donnee (Annuaire, Cles (J)) = Donnees (J)); end loop; for J in I..Nb_Cles loop pragma Assert (not Cle_Presente (Annuaire, Cles (J))); end loop; end loop; Vider (Annuaire); end Tester_Supprimer_Inverse; -- Tester suppression en commençant les les premiers éléments ajoutés procedure Tester_Supprimer is Annuaire : T_ABR; begin Put_Line ("=== Tester_Supprimer..."); New_Line; Construire_Exemple_Sujet (Annuaire); for I in 1..Nb_Cles loop Put_Line ("Suppression de " & Cles (I) & " :"); Supprimer (Annuaire, Cles (I)); Afficher (Annuaire); New_Line; for J in 1..I loop pragma Assert (not Cle_Presente (Annuaire, Cles (J))); end loop; for J in I+1..Nb_Cles loop pragma Assert (Cle_Presente (Annuaire, Cles (J))); pragma Assert (La_Donnee (Annuaire, Cles (J)) = Donnees (J)); end loop; end loop; Vider (Annuaire); end Tester_Supprimer; procedure Tester_Supprimer_Un_Element is -- Tester supprimer sur un élément, celui à Indice dans Cles. procedure Tester_Supprimer_Un_Element (Indice: in Integer) is Annuaire : T_ABR; begin Construire_Exemple_Sujet (Annuaire); Put_Line ("Suppression de " & Cles (Indice) & " :"); Supprimer (Annuaire, Cles (Indice)); Afficher (Annuaire); New_Line; for J in 1..Nb_Cles loop if J = Indice then pragma Assert (not Cle_Presente (Annuaire, Cles (J))); else pragma Assert (Cle_Presente (Annuaire, Cles (J))); end if; end loop; Vider (Annuaire); end Tester_Supprimer_Un_Element; begin Put_Line ("=== Tester_Supprimer_Un_Element..."); New_Line; for I in 1..Nb_Cles loop Tester_Supprimer_Un_Element (I); end loop; end Tester_Supprimer_Un_Element; procedure Tester_Remplacer_Un_Element is -- Tester enregistrer sur un élément présent, celui à Indice dans Cles. procedure Tester_Remplacer_Un_Element (Indice: in Integer; Nouveau: in Integer) is Annuaire : T_ABR; begin Construire_Exemple_Sujet (Annuaire); Put_Line ("Remplacement de " & Cles (Indice) & " par " & Integer'Image(Nouveau) & " :"); enregistrer (Annuaire, Cles (Indice), Nouveau); Afficher (Annuaire); New_Line; for J in 1..Nb_Cles loop pragma Assert (Cle_Presente (Annuaire, Cles (J))); if J = Indice then pragma Assert (La_Donnee (Annuaire, Cles (J)) = Nouveau); else pragma Assert (La_Donnee (Annuaire, Cles (J)) = Donnees (J)); end if; end loop; Vider (Annuaire); end Tester_Remplacer_Un_Element; begin Put_Line ("=== Tester_Remplacer_Un_Element..."); New_Line; for I in 1..Nb_Cles loop Tester_Remplacer_Un_Element (I, 0); null; end loop; end Tester_Remplacer_Un_Element; procedure Tester_Supprimer_Erreur is Annuaire : T_ABR; begin begin Put_Line ("=== Tester_Supprimer_Erreur..."); New_Line; Construire_Exemple_Sujet (Annuaire); Supprimer (Annuaire, Inconnu); exception when Cle_Absente_Exception => null; when others => pragma Assert (False); end; Vider (Annuaire); end Tester_Supprimer_Erreur; procedure Tester_La_Donnee_Erreur is Annuaire : T_ABR; Inutile: Integer; begin begin Put_Line ("=== Tester_Supprimer_Erreur..."); New_Line; Construire_Exemple_Sujet (Annuaire); Inutile := La_Donnee (Annuaire, Inconnu); exception when Cle_Absente_Exception => null; when others => pragma Assert (False); end; Vider (Annuaire); end Tester_La_Donnee_Erreur; procedure Tester_Pour_chaque is Annuaire : T_ABR; Somme: Integer; procedure Sommer (Cle: Unbounded_String; Donnee: Integer) is begin Put (" + "); Put (Donnee, 2); New_Line; Somme := Somme + Donnee; end; procedure Sommer is new Pour_Chaque (Sommer); begin Put_Line ("=== Tester_Pour_Chaque..."); New_Line; Construire_Exemple_Sujet(Annuaire); Somme := 0; Sommer (Annuaire); pragma Assert (Somme = Somme_Donnees); Vider(Annuaire); New_Line; end Tester_Pour_chaque; procedure Tester_Pour_chaque_Somme_Si_Cle_Commence_Par_Q is Annuaire : T_ABR; Somme: Integer; procedure Sommer_Cle_Commence_Par_Q (Cle: Unbounded_String; Donnee: Integer) is begin if To_String (Cle) (1) = 'q' then Put (" + "); Put (Donnee, 2); New_Line; Somme := Somme + Donnee; else null; end if; end; procedure Sommer is new Pour_Chaque (Sommer_Cle_Commence_Par_Q); begin Put_Line ("=== Tester_Pour_Chaque_Somme_Si_Cle_Commence_Par_Q..."); New_Line; Construire_Exemple_Sujet(Annuaire); Somme := 0; Sommer (Annuaire); pragma Assert (Somme = Somme_Donnees_Q); Vider(Annuaire); New_Line; end Tester_Pour_chaque_Somme_Si_Cle_Commence_Par_Q; procedure Tester_Pour_chaque_Somme_Len4_Erreur is Annuaire : T_ABR; Somme: Integer; procedure Sommer_Len4_Erreur (Cle: Unbounded_String; Donnee: Integer) is Nouvelle_Exception: Exception; begin if Length (Cle) = 4 then Put (" + "); Put (Donnee, 2); New_Line; Somme := Somme + Donnee; else raise Nouvelle_Exception; end if; end; procedure Sommer is new Pour_Chaque (Sommer_Len4_Erreur); begin Put_Line ("=== Tester_Pour_Chaque_Somme_Len4_Erreur..."); New_Line; Construire_Exemple_Sujet(Annuaire); Somme := 0; Sommer (Annuaire); pragma Assert (Somme = Somme_Donnees_Len4); Vider(Annuaire); New_Line; end Tester_Pour_chaque_Somme_Len4_Erreur; begin Tester_Exemple_Sujet; Tester_Supprimer_Inverse; Tester_Supprimer; Tester_Supprimer_Un_Element; Tester_Remplacer_Un_Element; Tester_Supprimer_Erreur; Tester_La_Donnee_Erreur; Tester_Pour_chaque; Tester_Pour_chaque_Somme_Si_Cle_Commence_Par_Q; Tester_Pour_chaque_Somme_Len4_Erreur; Put_Line ("Fin des tests : OK."); end Test_ABR;
reznikmm/matreshka
Ada
4,011
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.Chart_Scale_Text_Attributes; package Matreshka.ODF_Chart.Scale_Text_Attributes is type Chart_Scale_Text_Attribute_Node is new Matreshka.ODF_Chart.Abstract_Chart_Attribute_Node and ODF.DOM.Chart_Scale_Text_Attributes.ODF_Chart_Scale_Text_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Chart_Scale_Text_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Chart_Scale_Text_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Chart.Scale_Text_Attributes;
sungyeon/drake
Ada
1,883
adb
with System.Address_To_Named_Access_Conversions; with System.Growth; with System.Zero_Terminated_Strings; with C.errno; with C.sys.sysctl; with C.sys.types; package body System.Program is use type C.signed_int; package char_ptr_Conv is new Address_To_Named_Access_Conversions (C.char, C.char_ptr); mib : aliased constant C.signed_int_array (0 .. 3) := ( C.sys.sysctl.CTL_KERN, C.sys.sysctl.KERN_PROC, C.sys.sysctl.KERN_PROC_PATHNAME, -1); -- implies the current process -- implementation function Full_Name return String is package Holder is new Growth.Scoped_Holder ( C.sys.types.ssize_t, Component_Size => C.char_array'Component_Size); begin Holder.Reserve_Capacity (1024); loop declare Result_Length : aliased C.size_t := C.size_t (Holder.Capacity); begin if C.sys.sysctl.sysctl ( mib (0)'Unrestricted_Access, -- const is missing until FreeBSD8 4, C.void_ptr (Holder.Storage_Address), Result_Length'Access, C.void_const_ptr (Null_Address), 0) < 0 then case C.errno.errno is when C.errno.ENOMEM => null; -- retry since the buffer size is too short when others => raise Program_Error; end case; else return Zero_Terminated_Strings.Value ( char_ptr_Conv.To_Pointer (Holder.Storage_Address)); end if; end; -- growth declare function Grow is new Growth.Fast_Grow (C.sys.types.ssize_t); begin Holder.Reserve_Capacity (Grow (Holder.Capacity)); end; end loop; end Full_Name; end System.Program;
clinta/synth
Ada
45,887
adb
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt with PortScan.Ops; with Signals; with Unix; package body PortScan.Packages is package OPS renames PortScan.Ops; package SIG renames Signals; --------------------------- -- wipe_out_repository -- --------------------------- procedure wipe_out_repository (repository : String) is pkg_search : AD.Search_Type; dirent : AD.Directory_Entry_Type; begin AD.Start_Search (Search => pkg_search, Directory => repository, Filter => (AD.Ordinary_File => True, others => False), Pattern => "*.txz"); while AD.More_Entries (Search => pkg_search) loop AD.Get_Next_Entry (Search => pkg_search, Directory_Entry => dirent); declare pkgname : String := repository & "/" & AD.Simple_Name (dirent); begin AD.Delete_File (pkgname); end; end loop; end wipe_out_repository; ----------------------------- -- remove_queue_packages -- ----------------------------- procedure remove_queue_packages (repository : String) is procedure remove_package (cursor : ranking_crate.Cursor); procedure remove_package (cursor : ranking_crate.Cursor) is QR : constant queue_record := ranking_crate.Element (cursor); fullpath : constant String := repository & "/" & JT.USS (all_ports (QR.ap_index).package_name); begin if AD.Exists (fullpath) then AD.Delete_File (fullpath); end if; end remove_package; begin rank_queue.Iterate (remove_package'Access); end remove_queue_packages; ---------------------------- -- initial_package_scan -- ---------------------------- procedure initial_package_scan (repository : String; id : port_id) is begin if id = port_match_failed then return; end if; if not all_ports (id).scanned then return; end if; declare pkgname : constant String := JT.USS (all_ports (id).package_name); fullpath : constant String := repository & "/" & pkgname; begin if AD.Exists (fullpath) then all_ports (id).pkg_present := True; else return; end if; if not passed_option_check (repository, id, True) then TIO.Put_Line (pkgname & " failed option check."); all_ports (id).deletion_due := True; return; end if; if not passed_abi_check (repository, id, True) then TIO.Put_Line (pkgname & " failed architecture (ABI) check."); all_ports (id).deletion_due := True; return; end if; end; all_ports (id).pkg_dep_query := result_of_dependency_query (repository, id); end initial_package_scan; --------------------------- -- remote_package_scan -- --------------------------- procedure remote_package_scan (id : port_id) is begin if passed_abi_check (repository => "", id => id, skip_exist_check => True) then all_ports (id).remote_pkg := True; else return; end if; if not passed_option_check (repository => "", id => id, skip_exist_check => True) then all_ports (id).remote_pkg := False; return; end if; all_ports (id).pkg_dep_query := result_of_dependency_query (repository => "", id => id); end remote_package_scan; ---------------------------- -- limited_sanity_check -- ---------------------------- procedure limited_sanity_check (repository : String; dry_run : Boolean; suppress_remote : Boolean) is procedure prune_packages (cursor : ranking_crate.Cursor); procedure check_package (cursor : ranking_crate.Cursor); procedure prune_queue (cursor : subqueue.Cursor); procedure print (cursor : subqueue.Cursor); procedure fetch (cursor : subqueue.Cursor); procedure check (cursor : subqueue.Cursor); already_built : subqueue.Vector; fetch_list : subqueue.Vector; fetch_fail : Boolean := False; clean_pass : Boolean := False; listlog : TIO.File_Type; goodlog : Boolean; using_screen : constant Boolean := Unix.screen_attached; filename : constant String := "/tmp/synth_prefetch_list.txt"; package_list : JT.Text := JT.blank; procedure check_package (cursor : ranking_crate.Cursor) is target : port_id := ranking_crate.Element (cursor).ap_index; pkgname : String := JT.USS (all_ports (target).package_name); available : constant Boolean := all_ports (target).remote_pkg or else (all_ports (target).pkg_present and then not all_ports (target).deletion_due); begin if not available then return; end if; if passed_dependency_check (query_result => all_ports (target).pkg_dep_query, id => target) then already_built.Append (New_Item => target); if all_ports (target).remote_pkg then fetch_list.Append (New_Item => target); end if; else if all_ports (target).remote_pkg then -- silently fail, remote packages are a bonus anyway all_ports (target).remote_pkg := False; else TIO.Put_Line (pkgname & " failed dependency check."); all_ports (target).deletion_due := True; end if; clean_pass := False; end if; end check_package; procedure prune_queue (cursor : subqueue.Cursor) is id : constant port_index := subqueue.Element (cursor); begin OPS.cascade_successful_build (id); end prune_queue; procedure prune_packages (cursor : ranking_crate.Cursor) is target : port_id := ranking_crate.Element (cursor).ap_index; delete_it : Boolean := all_ports (target).deletion_due; pkgname : String := JT.USS (all_ports (target).package_name); fullpath : constant String := repository & "/" & pkgname; begin if delete_it then AD.Delete_File (fullpath); end if; exception when others => null; end prune_packages; procedure print (cursor : subqueue.Cursor) is id : constant port_index := subqueue.Element (cursor); line : constant String := JT.USS (all_ports (id).package_name) & " (" & get_catport (all_ports (id)) & ")"; begin TIO.Put_Line (" => " & line); if goodlog then TIO.Put_Line (listlog, line); end if; end print; procedure fetch (cursor : subqueue.Cursor) is id : constant port_index := subqueue.Element (cursor); begin JT.SU.Append (package_list, " " & id2pkgname (id)); end fetch; procedure check (cursor : subqueue.Cursor) is id : constant port_index := subqueue.Element (cursor); name : constant String := JT.USS (all_ports (id).package_name); loc : constant String := JT.USS (PM.configuration.dir_repository) & "/" & name; begin if not AD.Exists (loc) then TIO.Put_Line ("Download failed: " & name); fetch_fail := True; end if; end check; begin if Unix.env_variable_defined ("WHYFAIL") then activate_debugging_code; end if; establish_package_architecture; original_queue_len := rank_queue.Length; for m in scanners'Range loop mq_progress (m) := 0; end loop; parallel_package_scan (repository, False, using_screen); if SIG.graceful_shutdown_requested then return; end if; while not clean_pass loop clean_pass := True; already_built.Clear; rank_queue.Iterate (check_package'Access); end loop; if not suppress_remote and then PM.configuration.defer_prebuilt then -- The defer_prebuilt options has been elected, so check all the -- missing and to-be-pruned ports for suitable prebuilt packages -- So we need to an incremental scan (skip valid, present packages) for m in scanners'Range loop mq_progress (m) := 0; end loop; parallel_package_scan (repository, True, using_screen); if SIG.graceful_shutdown_requested then return; end if; clean_pass := False; while not clean_pass loop clean_pass := True; already_built.Clear; fetch_list.Clear; rank_queue.Iterate (check_package'Access); end loop; end if; if SIG.graceful_shutdown_requested then return; end if; if dry_run then if not fetch_list.Is_Empty then declare begin TIO.Create (File => listlog, Mode => TIO.Out_File, Name => filename); goodlog := True; exception when others => goodlog := False; end; TIO.Put_Line ("These are the packages that would be fetched:"); fetch_list.Iterate (print'Access); TIO.Put_Line ("Total packages that would be fetched:" & fetch_list.Length'Img); if goodlog then TIO.Close (listlog); TIO.Put_Line ("The complete build list can also be found at:" & LAT.LF & filename); end if; else if PM.configuration.defer_prebuilt then TIO.Put_Line ("No packages qualify for prefetching from " & "official package repository."); end if; end if; else rank_queue.Iterate (prune_packages'Access); fetch_list.Iterate (fetch'Access); if not JT.equivalent (package_list, JT.blank) then declare cmd : constant String := host_pkg8 & " fetch -U -y --output " & JT.USS (PM.configuration.dir_packages) & JT.USS (package_list); begin if Unix.external_command (cmd) then null; end if; end; fetch_list.Iterate (check'Access); end if; end if; if fetch_fail then TIO.Put_Line ("At least one package failed to fetch, aborting build!"); rank_queue.Clear; else already_built.Iterate (prune_queue'Access); end if; end limited_sanity_check; --------------------------- -- preclean_repository -- --------------------------- procedure preclean_repository (repository : String) is procedure insert (cursor : string_crate.Cursor); using_screen : constant Boolean := Unix.screen_attached; uniqid : PortScan.port_id := 0; procedure insert (cursor : string_crate.Cursor) is key2 : JT.Text := string_crate.Element (cursor); begin if not portlist.Contains (key2) then uniqid := uniqid + 1; portlist.Insert (key2, uniqid); end if; end insert; begin if not scan_repository (repository) then return; end if; parallel_preliminary_package_scan (repository, using_screen); for ndx in scanners'Range loop stored_origins (ndx).Iterate (insert'Access); stored_origins (ndx).Clear; end loop; end preclean_repository; ----------------------- -- scan_repository -- ----------------------- function scan_repository (repository : String) return Boolean is pkg_search : AD.Search_Type; dirent : AD.Directory_Entry_Type; pkg_index : scanners := scanners'First; result : Boolean := False; begin AD.Start_Search (Search => pkg_search, Directory => repository, Filter => (AD.Ordinary_File => True, others => False), Pattern => "*.txz"); while AD.More_Entries (Search => pkg_search) loop AD.Get_Next_Entry (Search => pkg_search, Directory_Entry => dirent); declare pkgname : JT.Text := JT.SUS (AD.Simple_Name (dirent)); begin stored_packages (pkg_index).Append (New_Item => pkgname); if pkg_index = scanners (number_cores) then pkg_index := scanners'First; else pkg_index := pkg_index + 1; end if; pkgscan_total := pkgscan_total + 1; result := True; end; end loop; return result; end scan_repository; ----------------------------- -- generic_system_command -- ----------------------------- function generic_system_command (command : String) return JT.Text is content : JT.Text; status : Integer; begin content := Unix.piped_command (command, status); if status /= 0 then raise pkgng_execution with "pkg options query cmd: " & command & " (return code =" & status'Img & ")"; end if; return content; end generic_system_command; --------------------------- -- passed_option_check -- --------------------------- function passed_option_check (repository : String; id : port_id; skip_exist_check : Boolean := False) return Boolean is begin if id = port_match_failed or else not all_ports (id).scanned then return False; end if; declare pkg_base : constant String := id2pkgname (id); pkg_name : constant String := JT.USS (all_ports (id).package_name); fullpath : constant String := repository & "/" & pkg_name; command : constant String := host_pkg8 & " query -F " & fullpath & " %Ok:%Ov"; remocmd : constant String := host_pkg8 & " rquery -r " & JT.USS (external_repository) & " -U %Ok:%Ov " & pkg_base; content : JT.Text; topline : JT.Text; colon : Natural; required : Natural := Natural (all_ports (id).options.Length); counter : Natural := 0; begin if not skip_exist_check and then not AD.Exists (Name => fullpath) then return False; end if; declare begin if repository = "" then content := generic_system_command (remocmd); else content := generic_system_command (command); end if; exception when pkgng_execution => return False; end; loop JT.nextline (lineblock => content, firstline => topline); exit when JT.IsBlank (topline); colon := JT.SU.Index (Source => topline, Pattern => ":"); if colon < 2 then raise unknown_format with JT.USS (topline); end if; declare knob : String := JT.SU.Slice (Source => topline, Low => colon + 1, High => JT.SU.Length (topline)); namekey : JT.Text := JT.SUS (JT.SU.Slice (Source => topline, Low => 1, High => colon - 1)); knobval : Boolean; begin if knob = "on" then knobval := True; elsif knob = "off" then knobval := False; else raise unknown_format with "knob=" & knob & "(" & JT.USS (topline) & ")"; end if; counter := counter + 1; if counter > required then -- package has more options than we are looking for if debug_opt_check then TIO.Put_Line ("options " & JT.USS (namekey)); TIO.Put_Line (pkg_name & " has more options than required " & "(" & JT.int2str (required) & ")"); end if; return False; end if; if all_ports (id).options.Contains (namekey) then if knobval /= all_ports (id).options.Element (namekey) then -- port option value doesn't match package option value if debug_opt_check then if knobval then TIO.Put_Line (pkg_name & " " & JT.USS (namekey) & " is ON but port says it must be OFF"); else TIO.Put_Line (pkg_name & " " & JT.USS (namekey) & " is OFF but port says it must be ON"); end if; end if; return False; end if; else -- Name of package option not found in port options if debug_opt_check then TIO.Put_Line (pkg_name & " option " & JT.USS (namekey) & " is no longer present in the port"); end if; return False; end if; end; end loop; if counter < required then -- The ports tree has more options than the existing package if debug_opt_check then TIO.Put_Line (pkg_name & " has less options than required " & "(" & JT.int2str (required) & ")"); end if; return False; end if; -- If we get this far, the package options must match port options return True; end; exception when others => if debug_opt_check then TIO.Put_Line ("option check exception"); end if; return False; end passed_option_check; ---------------------------------- -- result_of_dependency_query -- ---------------------------------- function result_of_dependency_query (repository : String; id : port_id) return JT.Text is pkg_base : constant String := id2pkgname (id); pkg_name : constant String := JT.USS (all_ports (id).package_name); fullpath : constant String := repository & "/" & pkg_name; command : constant String := host_pkg8 & " query -F " & fullpath & " %do:%dn-%dv"; remocmd : constant String := host_pkg8 & " rquery -r " & JT.USS (external_repository) & " -U %do:%dn-%dv " & pkg_base; begin if repository = "" then return generic_system_command (remocmd); else return generic_system_command (command); end if; exception when others => return JT.blank; end result_of_dependency_query; ------------------------------- -- passed_dependency_check -- ------------------------------- function passed_dependency_check (query_result : JT.Text; id : port_id) return Boolean is begin declare content : JT.Text := query_result; topline : JT.Text; colon : Natural; required : Natural := Natural (all_ports (id).librun.Length); headport : constant String := get_catport (all_ports (id)); counter : Natural := 0; begin loop JT.nextline (lineblock => content, firstline => topline); exit when JT.IsBlank (topline); colon := JT.SU.Index (Source => topline, Pattern => ":"); if colon < 2 then raise unknown_format with JT.USS (topline); end if; declare deppkg : String := JT.SU.Slice (Source => topline, Low => colon + 1, High => JT.SU.Length (topline)) & ".txz"; origin : JT.Text := JT.SUS (JT.SU.Slice (Source => topline, Low => 1, High => colon - 1)); target_id : port_index := ports_keys.Element (Key => origin); target_pkg : JT.Text := all_ports (target_id).package_name; available : constant Boolean := all_ports (target_id).remote_pkg or else (all_ports (target_id).pkg_present and then not all_ports (target_id).deletion_due); begin if target_id = port_match_failed then -- package has a dependency that has been removed from -- the ports tree if debug_dep_check then TIO.Put_Line (JT.USS (origin) & " has been removed from the ports tree"); end if; return False; end if; counter := counter + 1; if counter > required then -- package has more dependencies than we are looking for if debug_dep_check then TIO.Put_Line (headport & " package has more dependencies than " & "the port requires (" & JT.int2str (required) & ")"); TIO.Put_Line ("Query: " & JT.USS (query_result)); TIO.Put_Line ("Tripped on: " & JT.USS (target_pkg) & ":" & JT.USS (origin)); end if; return False; end if; if deppkg /= JT.USS (target_pkg) then -- The version that the package requires differs from the -- version that the ports tree will now produce if debug_dep_check then TIO.Put_Line ("Current " & headport & " package depends on " & deppkg & ", but this is a different version than " & "requirement of " & JT.USS (target_pkg)); end if; return False; end if; if not available then -- Even if all the versions are matching, we still need -- the package to be in repository. if debug_dep_check then TIO.Put_Line (headport & " package depends on " & JT.USS (target_pkg) & " which doesn't exist or has been scheduled " & "for deletion"); end if; return False; end if; end; end loop; if counter < required then -- The ports tree requires more dependencies than the existing -- package does if debug_dep_check then TIO.Put_Line (headport & " package has less dependencies than the port " & "requires (" & JT.int2str (required) & ")"); TIO.Put_Line ("Query: " & JT.USS (query_result)); end if; return False; end if; -- If we get this far, the package dependencies match what the -- port tree requires exactly. This package passed sanity check. return True; end; exception when others => if debug_dep_check then TIO.Put_Line ("Dependency check exception"); end if; return False; end passed_dependency_check; ------------------ -- id2pkgname -- ------------------ function id2pkgname (id : port_id) return String is pkg_name : constant String := JT.USS (all_ports (id).package_name); len : constant Natural := pkg_name'Length - 4; begin return pkg_name (1 .. len); end id2pkgname; ------------------------ -- passed_abi_check -- ------------------------ function passed_abi_check (repository : String; id : port_id; skip_exist_check : Boolean := False) return Boolean is pkg_base : constant String := id2pkgname (id); pkg_name : constant String := JT.USS (all_ports (id).package_name); fullpath : constant String := repository & "/" & pkg_name; command : constant String := host_pkg8 & " query -F " & fullpath & " %q"; remocmd : constant String := host_pkg8 & " rquery -r " & JT.USS (external_repository) & " -U %q " & pkg_base; content : JT.Text; topline : JT.Text; begin if not skip_exist_check and then not AD.Exists (Name => fullpath) then return False; end if; declare begin if repository = "" then content := generic_system_command (remocmd); else content := generic_system_command (command); end if; exception when pkgng_execution => return False; end; JT.nextline (lineblock => content, firstline => topline); if JT.equivalent (topline, calculated_abi) then return True; end if; if JT.equivalent (topline, calc_abi_noarch) then return True; end if; if JT.equivalent (topline, calculated_alt_abi) then return True; end if; if JT.equivalent (topline, calc_alt_abi_noarch) then return True; end if; return False; exception when others => return False; end passed_abi_check; ---------------------- -- queue_is_empty -- ---------------------- function queue_is_empty return Boolean is begin return rank_queue.Is_Empty; end queue_is_empty; -------------------------------------- -- establish_package_architecture -- -------------------------------------- procedure establish_package_architecture is function newsuffix (fileinfo : String) return String; function suffix (fileinfo : String) return String; function fbrel (fileinfo : String) return String; function even (fileinfo : String) return String; command : constant String := "/usr/bin/file -b " & JT.USS (PM.configuration.dir_system) & "/bin/sh"; UN : JT.Text; function suffix (fileinfo : String) return String is -- DF: ELF 64-bit LSB executable, x86-64 -- FB: ELF 64-bit LSB executable, x86-64 -- FB: ELF 32-bit LSB executable, Intel 80386 arch : constant String (1 .. 11) := fileinfo (fileinfo'First + 27 .. fileinfo'First + 37); begin if arch (1 .. 6) = "x86-64" then return "x86:64"; elsif arch = "Intel 80386" then return "x86:32"; else return "unknown:" & arch; end if; end suffix; function newsuffix (fileinfo : String) return String is arch : constant String (1 .. 11) := fileinfo (fileinfo'First + 27 .. fileinfo'First + 37); begin if arch (1 .. 6) = "x86-64" then return "amd64"; elsif arch = "Intel 80386" then return "i386"; else return "unknown:" & arch; end if; end newsuffix; function even (fileinfo : String) return String is -- DF: ... DragonFly 4.0.501 rest : constant String := JT.part_2 (fileinfo, "DragonFly "); major : constant String := JT.part_1 (rest, "."); rest2 : constant String := JT.part_2 (rest, "."); minor : constant String := JT.part_1 (rest2, "."); rest3 : constant String := JT.part_2 (rest2, "."); point : constant Character := rest3 (rest3'First); final : Character := point; begin case point is when '1' => final := '2'; when '3' => final := '4'; when '5' => final := '6'; when '7' => final := '8'; when '9' => final := '0'; when others => null; end case; if minor = "0" then return major & "." & final; else return major & "." & minor & final; end if; end even; function fbrel (fileinfo : String) return String is -- FreeBSD 10.2, stripped -- FreeBSD 11.0 (1100093), stripped rest : constant String := JT.part_2 (fileinfo, "FreeBSD "); major : constant String := JT.part_1 (rest, "."); begin return major; end fbrel; begin UN := generic_system_command (command); if JT.equivalent (PM.configuration.operating_sys, "DragonFly") then declare dfly : constant String := "dragonfly:"; unlen : constant Natural := JT.SU.Length (UN) - 1; fileinfo : constant String := JT.USS (UN)(1 .. unlen); begin calculated_abi := JT.SUS (dfly); JT.SU.Append (calculated_abi, even (fileinfo) & ":"); calc_abi_noarch := calculated_abi; JT.SU.Append (calculated_abi, suffix (fileinfo)); JT.SU.Append (calc_abi_noarch, "*"); calculated_alt_abi := calculated_abi; calc_alt_abi_noarch := calc_abi_noarch; end; else declare fbsd1 : constant String := "FreeBSD:"; fbsd2 : constant String := "freebsd:"; unlen : constant Natural := JT.SU.Length (UN) - 1; fileinfo : constant String := JT.USS (UN)(1 .. unlen); release : constant String := fbrel (fileinfo); begin calculated_abi := JT.SUS (fbsd1); calculated_alt_abi := JT.SUS (fbsd2); JT.SU.Append (calculated_abi, release & ":"); JT.SU.Append (calculated_alt_abi, release & ":"); calc_abi_noarch := calculated_abi; calc_alt_abi_noarch := calculated_alt_abi; JT.SU.Append (calculated_abi, newsuffix (fileinfo)); JT.SU.Append (calculated_alt_abi, suffix (fileinfo)); JT.SU.Append (calc_abi_noarch, "*"); JT.SU.Append (calc_alt_abi_noarch, "*"); end; end if; end establish_package_architecture; --------------------------- -- original_queue_size -- --------------------------- function original_queue_size return Natural is begin return Natural (original_queue_len); end original_queue_size; ---------------------------------- -- passed_options_cache_check -- ---------------------------------- function passed_options_cache_check (id : port_id) return Boolean is target_dname : String := JT.replace (get_catport (all_ports (id)), reject => LAT.Solidus, shiny => LAT.Low_Line); target_path : constant String := JT.USS (PM.configuration.dir_options) & LAT.Solidus & target_dname & LAT.Solidus & "options"; marker : constant String := "+="; option_file : TIO.File_Type; required : Natural := Natural (all_ports (id).options.Length); counter : Natural := 0; result : Boolean := False; begin if not AD.Exists (target_path) then return True; end if; TIO.Open (File => option_file, Mode => TIO.In_File, Name => target_path); while not TIO.End_Of_File (option_file) loop declare Line : String := TIO.Get_Line (option_file); namekey : JT.Text; valid : Boolean := False; begin -- If "marker" starts at 17, it's OPTIONS_FILES_SET -- if "marker" starts at 19, it's OPTIONS_FILES_UNSET -- if neither, we don't care. if Line (17 .. 18) = marker then namekey := JT.SUS (Line (19 .. Line'Last)); valid := True; elsif Line (19 .. 20) = marker then namekey := JT.SUS (Line (21 .. Line'Last)); valid := True; end if; if valid then counter := counter + 1; if counter > required then -- The port used to have more options, abort! goto clean_exit; end if; if not all_ports (id).options.Contains (namekey) then -- cached option not found in port anymore, abort! goto clean_exit; end if; end if; end; end loop; if counter = required then result := True; end if; <<clean_exit>> TIO.Close (option_file); return result; end passed_options_cache_check; ------------------------------------ -- limited_cached_options_check -- ------------------------------------ function limited_cached_options_check return Boolean is procedure check_port (cursor : ranking_crate.Cursor); fail_count : Natural := 0; first_fail : queue_record; procedure check_port (cursor : ranking_crate.Cursor) is QR : constant queue_record := ranking_crate.Element (cursor); id : port_index := QR.ap_index; prelude : constant String := "Cached options obsolete: "; begin if not passed_options_cache_check (id) then if fail_count = 0 then first_fail := QR; end if; fail_count := fail_count + 1; TIO.Put_Line (prelude & get_catport (all_ports (id))); end if; end check_port; begin rank_queue.Iterate (Process => check_port'Access); if fail_count > 0 then TIO.Put (LAT.LF & "A preliminary scan has revealed the cached " & "options of"); if fail_count = 1 then TIO.Put_Line (" one port are"); else TIO.Put_Line (fail_count'Img & " ports are"); end if; TIO.Put_Line ("obsolete. Please update or remove the saved " & "options and try again."); declare portsdir : String := JT.USS (PM.configuration.dir_portsdir) & LAT.Solidus; catport : String := get_catport (all_ports (first_fail.ap_index)); begin TIO.Put_Line (" e.g. make -C " & portsdir & catport & " config"); TIO.Put_Line (" e.g. make -C " & portsdir & catport & " rmconfig"); end; end if; return (fail_count = 0); end limited_cached_options_check; ----------------------------- -- parallel_package_scan -- ----------------------------- procedure parallel_package_scan (repository : String; remote_scan : Boolean; show_progress : Boolean) is task type scan (lot : scanners); finished : array (scanners) of Boolean := (others => False); combined_wait : Boolean := True; label_shown : Boolean := False; aborted : Boolean := False; task body scan is procedure populate (cursor : subqueue.Cursor); procedure populate (cursor : subqueue.Cursor) is target_port : port_index := subqueue.Element (cursor); important : constant Boolean := all_ports (target_port).scanned; begin if not aborted and then important then if remote_scan and then not all_ports (target_port).never_remote then if not all_ports (target_port).pkg_present or else all_ports (target_port).deletion_due then remote_package_scan (target_port); end if; else initial_package_scan (repository, target_port); end if; end if; mq_progress (lot) := mq_progress (lot) + 1; end populate; begin make_queue (lot).Iterate (populate'Access); finished (lot) := True; end scan; scan_01 : scan (lot => 1); scan_02 : scan (lot => 2); scan_03 : scan (lot => 3); scan_04 : scan (lot => 4); scan_05 : scan (lot => 5); scan_06 : scan (lot => 6); scan_07 : scan (lot => 7); scan_08 : scan (lot => 8); scan_09 : scan (lot => 9); scan_10 : scan (lot => 10); scan_11 : scan (lot => 11); scan_12 : scan (lot => 12); scan_13 : scan (lot => 13); scan_14 : scan (lot => 14); scan_15 : scan (lot => 15); scan_16 : scan (lot => 16); scan_17 : scan (lot => 17); scan_18 : scan (lot => 18); scan_19 : scan (lot => 19); scan_20 : scan (lot => 20); scan_21 : scan (lot => 21); scan_22 : scan (lot => 22); scan_23 : scan (lot => 23); scan_24 : scan (lot => 24); scan_25 : scan (lot => 25); scan_26 : scan (lot => 26); scan_27 : scan (lot => 27); scan_28 : scan (lot => 28); scan_29 : scan (lot => 29); scan_30 : scan (lot => 30); scan_31 : scan (lot => 31); scan_32 : scan (lot => 32); begin while combined_wait loop delay 1.0; combined_wait := False; for j in scanners'Range loop if not finished (j) then combined_wait := True; exit; end if; end loop; if combined_wait then if not label_shown then label_shown := True; TIO.Put_Line ("Scanning existing packages."); end if; if show_progress then TIO.Put (scan_progress); end if; if SIG.graceful_shutdown_requested then aborted := True; end if; end if; end loop; end parallel_package_scan; ----------------------------------------- -- parallel_preliminary_package_scan -- ----------------------------------------- procedure parallel_preliminary_package_scan (repository : String; show_progress : Boolean) is task type scan (lot : scanners); finished : array (scanners) of Boolean := (others => False); combined_wait : Boolean := True; label_shown : Boolean := False; aborted : Boolean := False; task body scan is procedure check (csr : string_crate.Cursor); procedure check (csr : string_crate.Cursor) is begin if aborted then return; end if; declare pkgname : constant String := JT.USS (string_crate.Element (csr)); pkgpath : constant String := repository & "/" & pkgname; origin : constant String := query_origin (fullpath => pkgpath); path1 : constant String := JT.USS (PM.configuration.dir_portsdir) & "/" & origin; begin if AD.Exists (path1) and then current_package_name (origin, pkgname) then stored_origins (lot).Append (New_Item => JT.SUS (origin)); else AD.Delete_File (pkgpath); TIO.Put_Line ("Removed: " & pkgname); end if; exception when others => TIO.Put_Line (" Failed to remove " & pkgname); end; pkgscan_progress (lot) := pkgscan_progress (lot) + 1; end check; begin stored_packages (lot).Iterate (check'Access); stored_packages (lot).Clear; finished (lot) := True; end scan; scan_01 : scan (lot => 1); scan_02 : scan (lot => 2); scan_03 : scan (lot => 3); scan_04 : scan (lot => 4); scan_05 : scan (lot => 5); scan_06 : scan (lot => 6); scan_07 : scan (lot => 7); scan_08 : scan (lot => 8); scan_09 : scan (lot => 9); scan_10 : scan (lot => 10); scan_11 : scan (lot => 11); scan_12 : scan (lot => 12); scan_13 : scan (lot => 13); scan_14 : scan (lot => 14); scan_15 : scan (lot => 15); scan_16 : scan (lot => 16); scan_17 : scan (lot => 17); scan_18 : scan (lot => 18); scan_19 : scan (lot => 19); scan_20 : scan (lot => 20); scan_21 : scan (lot => 21); scan_22 : scan (lot => 22); scan_23 : scan (lot => 23); scan_24 : scan (lot => 24); scan_25 : scan (lot => 25); scan_26 : scan (lot => 26); scan_27 : scan (lot => 27); scan_28 : scan (lot => 28); scan_29 : scan (lot => 29); scan_30 : scan (lot => 30); scan_31 : scan (lot => 31); scan_32 : scan (lot => 32); begin while combined_wait loop delay 1.0; if show_progress then TIO.Put (package_scan_progress); end if; combined_wait := False; for j in scanners'Range loop if not finished (j) then combined_wait := True; exit; end if; end loop; if combined_wait then if not label_shown then label_shown := True; TIO.Put_Line ("Stand by, prescanning existing packages."); end if; if SIG.graceful_shutdown_requested then aborted := True; end if; end if; end loop; end parallel_preliminary_package_scan; ----------------------------------- -- located_external_repository -- ----------------------------------- function located_external_repository return Boolean is command : constant String := host_pkg8 & " -vv"; dump : JT.Text; topline : JT.Text; crlen1 : Natural; crlen2 : Natural; found : Boolean := False; inspect : Boolean := False; begin declare begin dump := generic_system_command (command); exception when pkgng_execution => return False; end; crlen1 := JT.SU.Length (dump); loop JT.nextline (lineblock => dump, firstline => topline); crlen2 := JT.SU.Length (dump); exit when crlen1 = crlen2; crlen1 := crlen2; if inspect then declare line : constant String := JT.USS (topline); len : constant Natural := line'Length; begin if len > 7 and then line (1 .. 2) = " " and then line (len - 3 .. len) = ": { " and then line (3 .. len - 4) /= "Synth" then found := True; external_repository := JT.SUS (line (3 .. len - 4)); exit; end if; end; else if JT.equivalent (topline, "Repositories:") then inspect := True; end if; end if; end loop; return found; end located_external_repository; ------------------------------- -- top_external_repository -- ------------------------------- function top_external_repository return String is begin return JT.USS (external_repository); end top_external_repository; ------------------------------- -- activate_debugging_code -- ------------------------------- procedure activate_debugging_code is begin debug_opt_check := True; debug_dep_check := True; end activate_debugging_code; -------------------- -- query_origin -- -------------------- function query_origin (fullpath : String) return String is command : constant String := host_pkg8 & " query -F " & fullpath & " %o"; content : JT.Text; topline : JT.Text; begin content := generic_system_command (command); JT.nextline (lineblock => content, firstline => topline); return JT.USS (topline); exception when others => return ""; end query_origin; ---------------------------- -- current_package_name -- ---------------------------- function current_package_name (origin, file_name : String) return Boolean is cpn : constant String := get_pkg_name (origin); begin return cpn = file_name; end current_package_name; ----------------------------- -- package_scan_progress -- ----------------------------- function package_scan_progress return String is type percent is delta 0.01 digits 5; complete : port_index := 0; pc : percent; total : constant Float := Float (pkgscan_total); begin for k in scanners'Range loop complete := complete + pkgscan_progress (k); end loop; pc := percent (100.0 * Float (complete) / total); return " progress:" & pc'Img & "% " & LAT.CR; end package_scan_progress; end PortScan.Packages;
annexi-strayline/AURA
Ada
6,408
adb
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- ANNEXI-STRAYLINE Reference Implementation -- -- -- -- Command Line Interface -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019-2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with Ada.Directories; with Ada.Unchecked_Deallocation; package body Registrar.Source_Files.Allocation is package SIO renames Ada.Streams.Stream_IO; generic with procedure Action (File: in out SIO.File_Type; Mode: in SIO.File_Mode; Name: in String; Form: in String := ""); procedure Open_Or_Create (Source : in out Source_File; Full_Name: in String); procedure Open_Or_Create (Source : in out Source_File; Full_Name: in String) is use Ada.Strings.Unbounded; begin -- Note that we don't need to worry about a checked-out stream, since -- that can only be done if the file is already open, and attempting -- open on an already open file will just raise an exception, and it -- won't bother anyone. -- We attempt to open the file first, since if it fails, we won't -- set the Full_Name property Action (File => Source.File_Actual, Mode => SIO.In_File, Name => Full_Name); Set_Unbounded_String (Target => Source.Full_Name, Source => Full_Name); end Open_Or_Create; ---------- -- Open -- ---------- function Open (Full_Name: String) return not null Source_File_Access is procedure Do_Open is new Open_Or_Create (Action => SIO.Open); begin return Source: not null Source_File_Access := new Source_File do Do_Open (Source => Source.all, Full_Name => Full_Name); Source.Compute_Hash; end return; end Open; ------------ -- Create -- ------------ function Create (Full_Name: String) return not null Source_File_Access is procedure Do_Create is new Open_Or_Create (Action => SIO.Create); begin return Source: not null Source_File_Access := new Source_File do Do_Create (Source => Source.all, Full_Name => Full_Name); end return; end Create; ------------- -- Discard -- ------------- procedure Discard (File : in out Source_File_Access; Checkout: in out Source_Stream'Class) is procedure Free is new Ada.Unchecked_Deallocation (Object => Source_File, Name => Source_File_Access); begin pragma Assert (Checkout.File = File); -- First nullify all links in the checked-out stream Checkout.Checkout.File := null; Checkout.File := null; Checkout.Stream_Actual := null; -- collateral -- Close the file and free it if SIO.Is_Open (File.File_Actual) then SIO.Close (File.File_Actual); end if; Free (File); end Discard; end Registrar.Source_Files.Allocation;
MinimSecure/unum-sdk
Ada
1,008
adb
-- Copyright 2018-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/>. procedure Foo_Q418_043 is type Index is (Index1, Index2); Size : constant Integer := 10; for Index use (Index1 => 1, Index2 => Size); type Array_Index_Enum is array (Index) of Integer; A : Array_Index_Enum :=(others => 42); begin A(Index2) := 4242; --BREAK end Foo_Q418_043;
charlie5/lace
Ada
782
adb
with ada.unchecked_Deallocation; package body gel.Mouse.local is package body Forge is function to_Mouse (of_Name : in String) return Item is begin return Self : constant Item := (lace.Subject.local.Forge.to_Subject (of_Name) with null record) do null; end return; end to_Mouse; function new_Mouse (of_Name : in String) return View is begin return new Item' (to_Mouse (of_Name)); end new_Mouse; end Forge; procedure free (Self : in out View) is procedure deallocate is new ada.unchecked_Deallocation (Item'Class, View); begin Self.destroy; deallocate (Self); end free; end gel.Mouse.local;