repo_name
stringlengths 9
74
| language
stringclasses 1
value | length_bytes
int64 11
9.34M
| extension
stringclasses 2
values | content
stringlengths 11
9.34M
|
---|---|---|---|---|
reznikmm/matreshka | Ada | 8,051 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- OpenGL Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with System;
with Matreshka.Atomics.Counters;
with OpenGL.Contexts;
with OpenGL.Functions;
package body OpenGL.Generic_Buffers is
use type OpenGL.Contexts.OpenGL_Context_Access;
type Buffer_Shared_Data is record
Counter : Matreshka.Atomics.Counters.Counter;
Context : OpenGL.Contexts.OpenGL_Context_Access;
Buffer_Type : OpenGL.GLenum;
Buffer_Usage : OpenGL.GLenum;
Buffer_Id : OpenGL.GLuint;
end record;
procedure Reference (Self : in out not null Buffer_Shared_Data_Access);
procedure Unreference (Self : in out Buffer_Shared_Data_Access);
------------
-- Adjust --
------------
overriding procedure Adjust (Self : in out OpenGL_Buffer) is
begin
if Self.Data /= null then
Reference (Self.Data);
end if;
end Adjust;
--------------
-- Allocate --
--------------
procedure Allocate
(Self : in out OpenGL_Buffer'Class; Data : Element_Array) is
begin
Self.Data.Context.Functions.glBufferData
(Self.Data.Buffer_Type,
Data'Size / System.Storage_Unit,
Data (Data'First)'Address,
Self.Data.Buffer_Usage);
end Allocate;
----------
-- Bind --
----------
function Bind (Self : in out OpenGL_Buffer'Class) return Boolean is
use type OpenGL.Contexts.OpenGL_Context_Access;
begin
if Self.Data = null
or else Self.Data.Context /= OpenGL.Contexts.Current_Context
then
-- Buffer was not created or created for another context.
return False;
end if;
Self.Data.Context.Functions.glBindBuffer
(Self.Data.Buffer_Type, Self.Data.Buffer_Id);
return True;
end Bind;
----------
-- Bind --
----------
procedure Bind (Self : in out OpenGL_Buffer'Class) is
begin
if not Self.Bind then
raise Program_Error;
end if;
end Bind;
------------
-- Create --
------------
procedure Create
(Self : in out OpenGL_Buffer'Class;
Buffer_Type : OpenGL.Buffer_Type)
is
Buffers : OpenGL.GLuint_Array (1 .. 1);
begin
if OpenGL.Contexts.Current_Context = null then
raise Program_Error;
end if;
OpenGL.Contexts.Current_Context.Functions.glGenBuffers (Buffers);
Self.Data :=
new Buffer_Shared_Data'
(Counter => <>,
Context => OpenGL.Contexts.Current_Context,
Buffer_Type =>
(if Buffer_Type = Vertex_Buffer
then GL_ARRAY_BUFFER
else GL_ELEMENT_ARRAY_BUFFER),
Buffer_Usage => GL_STATIC_DRAW,
Buffer_Id => Buffers (Buffers'First));
end Create;
--------------
-- Finalize --
--------------
overriding procedure Finalize (Self : in out OpenGL_Buffer) is
begin
if Self.Data /= null then
Unreference (Self.Data);
end if;
end Finalize;
----------------
-- Initialize --
----------------
procedure Initialize
(Self : in out OpenGL_Buffer'Class;
Buffer_Type : OpenGL.Buffer_Type) is
begin
if OpenGL.Contexts.Current_Context = null then
raise Program_Error;
end if;
Self.Data :=
new Buffer_Shared_Data'
(Counter => <>,
Context => OpenGL.Contexts.Current_Context,
Buffer_Type =>
(if Buffer_Type = Vertex_Buffer
then GL_ARRAY_BUFFER
else GL_ELEMENT_ARRAY_BUFFER),
Buffer_Usage => GL_STATIC_DRAW,
Buffer_Id => 0);
end Initialize;
---------------
-- Reference --
---------------
procedure Reference (Self : in out not null Buffer_Shared_Data_Access) is
begin
Matreshka.Atomics.Counters.Increment (Self.Counter);
end Reference;
------------
-- Stride --
------------
function Stride return OpenGL.GLsizei is
begin
return Element_Array'Component_Size / System.Storage_Unit;
end Stride;
-----------------
-- Unreference --
-----------------
procedure Unreference (Self : in out Buffer_Shared_Data_Access) is
procedure Free is
new Ada.Unchecked_Deallocation
(Buffer_Shared_Data, Buffer_Shared_Data_Access);
begin
if Matreshka.Atomics.Counters.Decrement (Self.Counter) then
declare
Buffers : OpenGL.GLuint_Array (1 .. 1) := (1 => Self.Buffer_Id);
begin
Self.Context.Functions.glDeleteBuffers (Buffers);
Free (Self);
end;
end if;
Self := null;
end Unreference;
end OpenGL.Generic_Buffers;
|
reznikmm/matreshka | Ada | 3,627 | 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.Elements.Generic_Hash;
function AMF.UMLDI.UML_State_Shapes.Hash is
new AMF.Elements.Generic_Hash (UMLDI_UML_State_Shape, UMLDI_UML_State_Shape_Access);
|
usainzg/EHU | Ada | 209 | adb | with Suma_Divisores_Propios;
function Es_Primo(N: Integer) return Boolean is
begin
if Suma_Divisores_Propios(N) = 1 then
return True;
end if;
return False;
end Es_Primo; |
AdaCore/libadalang | Ada | 184 | adb | with Children; use Children;
with Great_Children; use Great_Children;
procedure Main is
Obj : constant Child'Class := Great_Child'(others => <>);
begin
Obj.Primitive;
end Main;
|
jrcarter/Ada_GUI | Ada | 2,262 | adb | -- A program for generating Luhn checksums with an Ada_GUI UI
-- An Ada_GUI demo program
--
-- Copyright (C) 2022 by PragmAda Software Engineering
-- Released under the terms of the BSD 3-Clause license; see https://opensource.org/licenses
--
with Ada.Exceptions;
with Ada_GUI;
with PragmARC.Luhn_Generation;
procedure Luhn_Gen is
Input : Ada_GUI.Widget_ID;
Err : Ada_GUI.Widget_ID;
Checksum : Ada_GUI.Widget_ID;
Gen : Ada_GUI.Widget_ID;
Quit : Ada_GUI.Widget_ID;
procedure Generate;
Err_Msg : constant String := "Enter some digits";
procedure Generate is
-- Empty
begin -- Generate
Err.Set_Visibility (Visible => False);
Checksum.Set_Text (Text => Integer'Image (PragmARC.Luhn_Generation.Checksum (Input.Text) ) );
exception -- Generate
when E : others =>
Ada_GUI.Log (Message => "Generate: " & Ada.Exceptions.Exception_Information (E) );
Err.Set_Visibility (Visible => True);
Checksum.Set_Text (Text => "");
end Generate;
Event : Ada_GUI.Next_Result_Info;
use type Ada_GUI.Event_Kind_ID;
use type Ada_GUI.Widget_ID;
begin -- Luhn_Gen
Ada_GUI.Set_Up (Title => "Luhn Checksum Generator");
Input := Ada_GUI.New_Text_Box (Label => "Input :", Placeholder => Err_Msg);
Err := Ada_GUI.New_Background_Text (Text => Err_Msg, Break_Before => True);
Err.Set_Foreground_Color (Color => Ada_GUI.To_Color (Ada_GUI.Red) );
Err.Set_Visibility (Visible => False);
Checksum := Ada_GUI.New_Text_Box (Label => "Checksum :", Break_Before => True);
Gen := Ada_GUI.New_Button (Text => "Generate", Break_Before => True);
Quit := Ada_GUI.New_Button (Text => "Quit", Break_Before => True);
All_Events : loop
Event := Ada_GUI.Next_Event;
if not Event.Timed_Out then
exit All_Events when Event.Event.Kind = Ada_GUI.Window_Closed;
if Event.Event.Kind = Ada_GUI.Left_Click then
if Event.Event.ID = Gen then
Generate;
end if;
exit All_Events when Event.Event.ID = Quit;
end if;
end if;
end loop All_Events;
Ada_GUI.End_GUI;
exception -- Luhn_Gen
when E : others =>
Ada_GUI.Log (Message => Ada.Exceptions.Exception_Information (E) );
end Luhn_Gen;
|
johnperry-math/hac | Ada | 15,991 | ads | -- HAC_Pack - HAC Compatibility pack
-------------------------------------
--
-- This is the package containing all specifications of types and support
-- routines for HAC in its default operating mode.
-- So far, all HAC programs must have "with" and "use" of this package.
--
-- Note: this requirement is kept only for early stages of HAC.
-- At some point HAC_Pack won't be required anymore, but it is
-- still useful anyway for small script-like programs.
--
-- The package HAC_Pack is compilable by a full Ada compiler
-- like GNAT, so the HAC programs can be run on both HAC and
-- a "real" Ada system.
--
-- Another purpose of this specification is to document
-- the standard types and subprograms available in HAC.
with Ada.Calendar,
Ada.Characters.Handling,
Ada.Command_Line,
Ada.Directories,
Ada.Environment_Variables,
Ada.Strings.Unbounded,
Ada.Text_IO;
pragma Warnings ("H"); -- Disable warning: declaration of "=" hides predefined operator.
package HAC_Pack is
-----------------------------------------
-- Floating-point numeric type: Real --
-----------------------------------------
type Real is digits 18;
package RIO is new Ada.Text_IO.Float_IO (Real);
function "**" (F1, F2 : Real) return Real;
-- Square Root
function Sqrt (I : Integer) return Real;
function Sqrt (F : Real) return Real;
-- Integer to Character
function Chr (I : Integer) return Character;
-- Character to Integer
function Ord (C : Character) return Integer;
-- Next Character
function Succ (C : Character) return Character;
-- Previous Character
function Pred (C : Character) return Character;
-- Round to an Integer
function Round (F : Real) return Integer;
-- Truncate
function Trunc (F : Real) return Integer;
-- Trigonometric Functions w/ arguments in radians
function Sin (F : Real) return Real;
function Cos (F : Real) return Real;
function Arctan (F : Real) return Real;
-- Exponential Functions
function Log (F : Real) return Real;
function Exp (F : Real) return Real;
-- Random number in the real range [0, I+1[ , truncated to lowest integer.
-- For example, Rand (10) returns equiprobable integer values
-- between 0 and 10 (so, there are 11 possible values).
function Rand (I : Integer) return Integer;
-- Random number from 0 to 1, uniform.
function Rnd return Real;
package IIO is new Ada.Text_IO.Integer_IO (Integer);
package BIO is new Ada.Text_IO.Enumeration_IO (Boolean);
------------------------------------------
-- Variable-size string type: VString --
------------------------------------------
package VStr_Pkg renames Ada.Strings.Unbounded;
subtype VString is VStr_Pkg.Unbounded_String;
Null_VString : VString renames VStr_Pkg.Null_Unbounded_String;
function To_VString (S : String) return VString renames VStr_Pkg.To_Unbounded_String;
function To_VString (C : Character) return VString;
package ACH renames Ada.Characters.Handling;
--
function Element (Source : VString; Index : Positive) return Character renames VStr_Pkg.Element;
function Ends_With (Item : VString; Pattern : String) return Boolean;
function Ends_With (Item : VString; Pattern : VString) return Boolean;
function Head (Source : VString; Count : Natural) return VString;
function Index (Source : VString; Pattern : String) return Natural;
function Index (Source : VString; Pattern : VString) return Natural;
function Length (Source : VString) return Natural renames VStr_Pkg.Length;
function Slice (Source : VString; From : Positive; To : Natural) return VString;
function Tail (Source : VString; Count : Natural) return VString;
function Starts_With (Item : VString; Pattern : String) return Boolean;
function Starts_With (Item : VString; Pattern : VString) return Boolean;
function To_Lower (Item : Character) return Character renames ACH.To_Lower; -- RM A.3.2 (6)
function To_Upper (Item : Character) return Character renames ACH.To_Upper; -- RM A.3.2 (6)
function To_Lower (Item : VString) return VString;
function To_Upper (Item : VString) return VString;
function Trim_Left (Source : VString) return VString;
function Trim_Right (Source : VString) return VString;
function Trim_Both (Source : VString) return VString;
--
function "+" (S : String) return VString renames To_VString;
function "+" (C : Character) return VString renames To_VString;
--
function "*" (Num : Natural; Pattern : Character) return VString renames VStr_Pkg."*";
function "*" (Num : Natural; Pattern : String) return VString;
function "*" (Num : Natural; Pattern : VString) return VString renames VStr_Pkg."*";
--
function "&" (V1, V2 : VString) return VString renames VStr_Pkg."&";
--
function "&" (V : VString; S : String) return VString renames VStr_Pkg."&";
function "&" (S : String; V : VString) return VString renames VStr_Pkg."&";
--
function "&" (V : VString; C : Character) return VString renames VStr_Pkg."&";
function "&" (C : Character; V : VString) return VString renames VStr_Pkg."&";
--
function "&" (I : Integer; V : VString) return VString;
function "&" (V : VString; I : Integer) return VString;
--
function "&" (R : Real; V : VString) return VString;
function "&" (V : VString; R : Real) return VString;
--
function "=" (Left, Right : VString) return Boolean renames VStr_Pkg."=";
function "<" (Left, Right : VString) return Boolean renames VStr_Pkg."<";
function "<=" (Left, Right : VString) return Boolean renames VStr_Pkg."<=";
function ">" (Left, Right : VString) return Boolean renames VStr_Pkg.">";
function ">=" (Left, Right : VString) return Boolean renames VStr_Pkg.">=";
--
function "=" (Left : VString; Right : String) return Boolean renames VStr_Pkg."=";
function "<" (Left : VString; Right : String) return Boolean renames VStr_Pkg."<";
function "<=" (Left : VString; Right : String) return Boolean renames VStr_Pkg."<=";
function ">" (Left : VString; Right : String) return Boolean renames VStr_Pkg.">";
function ">=" (Left : VString; Right : String) return Boolean renames VStr_Pkg.">=";
function Image (I : Integer) return VString;
function Image (F : Real) return VString; -- "nice" image of F
function Image_Attribute (F : Real) return VString; -- returns +Real'Image(F) "as is"
function Image (T : Ada.Calendar.Time) return VString;
function Image (D : Duration) return VString;
function Integer_Value (V : VString) return Integer;
function Float_Value (V : VString) return Real;
-------------------------
-- Text Input/Output --
-------------------------
-- 1) Console I/O
-- We have a real console/terminal input where several
-- inputs can be made on the same line, followed by a
-- "Return". It behaves like for a file. Actually it
-- *could* be a file, if run like this: prog <input.txt .
--
function Get_Needs_Skip_Line return Boolean is (True);
-- Get
procedure Get (C : out Character) renames Ada.Text_IO.Get;
procedure Get (S : out String) renames Ada.Text_IO.Get;
procedure Get (I : out Integer);
procedure Get (F : out Real);
procedure Get_Immediate (C : out Character) renames Ada.Text_IO.Get_Immediate;
-- Get and then move file pointer to next line (Skip_Line)
procedure Get_Line (C : out Character);
procedure Get_Line (I : out Integer);
procedure Get_Line (F : out Real);
procedure Get_Line (V : out VString); -- Gets the line till its end.
procedure Skip_Line;
-- Put
procedure Put (C : Character);
procedure Put (I : Integer;
Width : Ada.Text_IO.Field := IIO.Default_Width;
Base : Ada.Text_IO.Number_Base := IIO.Default_Base);
procedure Put (F : Real;
Fore : Integer := RIO.Default_Fore;
Aft : Integer := RIO.Default_Aft;
Expo : Integer := RIO.Default_Exp);
procedure Put (B : Boolean;
Width : Ada.Text_IO.Field := BIO.Default_Width);
procedure Put (S : String);
procedure Put (V : VString);
-- Put and then New_Line (for S: it is the same as Ada.Text_IO.Put_Line)
procedure Put_Line (C : Character);
procedure Put_Line (I : Integer;
Width : Ada.Text_IO.Field := IIO.Default_Width;
Base : Ada.Text_IO.Number_Base := IIO.Default_Base);
procedure Put_Line (F : Real;
Fore : Integer := RIO.Default_Fore;
Aft : Integer := RIO.Default_Aft;
Expo : Integer := RIO.Default_Exp);
procedure Put_Line (B : Boolean;
Width : Ada.Text_IO.Field := BIO.Default_Width);
procedure Put_Line (S : String);
procedure Put_Line (V : VString);
procedure New_Line;
function End_Of_Line return Boolean renames Ada.Text_IO.End_Of_Line;
function End_Of_File return Boolean renames Ada.Text_IO.End_Of_File;
-------------------------
-- Text Input/Output --
-------------------------
-- 2) File I/O
subtype File_Type is Ada.Text_IO.File_Type;
procedure Open (File : in out File_Type; Name : String); -- Open as In_File (input).
procedure Open (File : in out File_Type; Name : VString); -- Open as In_File (input).
procedure Create (File : in out File_Type; Name : String); -- Create as Out_File (output).
procedure Create (File : in out File_Type; Name : VString); -- Create as Out_File (output).
procedure Append (File : in out File_Type; Name : String); -- Open as Append_File.
procedure Append (File : in out File_Type; Name : VString); -- Open as Append_File.
procedure Close (File : in out File_Type) renames Ada.Text_IO.Close;
-- Get
procedure Get (File : File_Type; C : out Character) renames Ada.Text_IO.Get;
procedure Get (File : File_Type; S : out String) renames Ada.Text_IO.Get;
procedure Get (File : File_Type; I : out Integer);
procedure Get (File : File_Type; F : out Real);
-- Get and then move file pointer to next line (Skip_Line)
procedure Get_Line (File : File_Type; C : out Character);
procedure Get_Line (File : File_Type; I : out Integer);
procedure Get_Line (File : File_Type; F : out Real);
procedure Get_Line (File : File_Type; V : out VString); -- Gets the line till its end.
procedure Skip_Line (File : File_Type);
-- Put
procedure Put (File : File_Type; C : Character);
procedure Put (File : File_Type;
I : Integer;
Width : Ada.Text_IO.Field := IIO.Default_Width;
Base : Ada.Text_IO.Number_Base := IIO.Default_Base);
procedure Put (File : File_Type;
F : Real;
Fore : Integer := RIO.Default_Fore;
Aft : Integer := RIO.Default_Aft;
Expo : Integer := RIO.Default_Exp);
procedure Put (File : File_Type;
B : Boolean;
Width : Ada.Text_IO.Field := BIO.Default_Width);
procedure Put (File : File_Type;
S : String);
procedure Put (File : File_Type;
V : VString);
-- Put and then New_Line (for S: it is the same as Ada.Text_IO.Put_Line)
procedure Put_Line (File : File_Type;
C : Character);
procedure Put_Line (File : File_Type;
I : Integer;
Width : Ada.Text_IO.Field := IIO.Default_Width;
Base : Ada.Text_IO.Number_Base := IIO.Default_Base);
procedure Put_Line (File : File_Type;
F : Real;
Fore : Integer := RIO.Default_Fore;
Aft : Integer := RIO.Default_Aft;
Expo : Integer := RIO.Default_Exp);
procedure Put_Line (File : File_Type;
B : Boolean;
Width : Ada.Text_IO.Field := BIO.Default_Width);
procedure Put_Line (File : File_Type; S : String);
procedure Put_Line (File : File_Type; V : VString);
procedure New_Line (File : File_Type);
function End_Of_Line (File : File_Type) return Boolean renames Ada.Text_IO.End_Of_Line;
function End_Of_File (File : File_Type) return Boolean renames Ada.Text_IO.End_Of_File;
------------
-- Time --
------------
subtype Time is Ada.Calendar.Time;
function Clock return Time renames Ada.Calendar.Clock;
function "-" (Left : Time; Right : Time) return Duration renames Ada.Calendar."-";
-- The following functions are slightly different (no subtypes) from
-- Ada.Calendar's but GNAT accepts the renaming. Is it correct?
function Year (Date : Time) return Integer renames Ada.Calendar.Year;
function Month (Date : Time) return Integer renames Ada.Calendar.Month;
function Day (Date : Time) return Integer renames Ada.Calendar.Day;
function Seconds (Date : Time) return Duration renames Ada.Calendar.Seconds;
-- Semaphore stuff (from SmallAda)
type Semaphore is new Integer; -- private;
procedure Wait (S : Semaphore);
procedure Signal (S : Semaphore);
-- System (items similar to items in Ada.Directories, Ada.Environment_Variables)
function Argument_Count return Natural renames Ada.Command_Line.Argument_Count;
function Argument (Number : Positive) return VString;
function Command_Name return VString;
procedure Set_Exit_Status (Code : in Integer);
-- Get_Env. If env. var. Name is not set, returns an empty string.
function Get_Env (Name : String) return VString;
function Get_Env (Name : VString) return VString;
procedure Set_Env (Name : String; Value : String) renames Ada.Environment_Variables.Set;
procedure Set_Env (Name : VString; Value : String);
procedure Set_Env (Name : String; Value : VString);
procedure Set_Env (Name : VString; Value : VString);
function Current_Directory return VString;
procedure Set_Directory (Directory : String) renames Ada.Directories.Set_Directory;
procedure Set_Directory (Directory : VString);
procedure Copy_File (Source_Name : String; Target_Name : String);
procedure Copy_File (Source_Name : VString; Target_Name : String);
procedure Copy_File (Source_Name : String; Target_Name : VString);
procedure Copy_File (Source_Name : VString; Target_Name : VString);
procedure Delete_File (Name : String) renames Ada.Directories.Delete_File;
procedure Delete_File (Name : VString);
function Exists (Name : String) return Boolean renames Ada.Directories.Exists;
function Exists (Name : VString) return Boolean;
procedure Rename (Old_Name : String; New_Name : String) renames Ada.Directories.Rename;
procedure Rename (Old_Name : VString; New_Name : String);
procedure Rename (Old_Name : String; New_Name : VString);
procedure Rename (Old_Name : VString; New_Name : VString);
procedure Shell_Execute (Command : String; Result : out Integer);
procedure Shell_Execute (Command : VString; Result : out Integer);
-- In this version, the result value is discarded:
procedure Shell_Execute (Command : String);
procedure Shell_Execute (Command : VString);
function Directory_Separator return Character;
-- This is public, but directly used by the HAC system itself only
-- (HAC programs cannot return String's).
-- That way, we avoid code duplication or incompatibilities between
-- HAC_Pack (as compatibility package) and the HAC run-tim system itself.
generic
type Abstract_Integer is range <>;
function HAC_Generic_Image (I : Abstract_Integer) return String;
function HAC_Image (F : Real) return String;
function HAC_Image (T : Ada.Calendar.Time) return String;
private
-- type SEMAPHORE is new INTEGER;
end HAC_Pack;
|
stcarrez/ada-servlet | Ada | 1,715 | adb | -----------------------------------------------------------------------
-- volume_server -- Example of server with a servlet
-- Copyright (C) 2010, 2015, 2018, 2021, 2022 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Server;
with Servlet.Core;
with Volume_Servlet;
with Util.Log.Loggers;
procedure Volume_Server is
CONFIG_PATH : constant String := "samples.properties";
Compute : aliased Volume_Servlet.Servlet;
App : aliased Servlet.Core.Servlet_Registry;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Volume_Server");
begin
Util.Log.Loggers.Initialize (CONFIG_PATH);
-- Register the servlets and filters
App.Add_Servlet (Name => "compute", Server => Compute'Unchecked_Access);
-- Define servlet mappings
App.Add_Mapping (Name => "compute", Pattern => "*.html");
Server.WS.Register_Application ("/volume", App'Unchecked_Access);
Log.Info ("Connect you browser to: http://localhost:8080/volume/compute.html");
Server.WS.Start;
delay 60.0;
end Volume_Server;
|
pvrego/adaino | Ada | 18,384 | adb | with AVR.MCU;
-- =============================================================================
-- Package body AVR.USART
-- =============================================================================
package body AVR.USART is
procedure Initialize
(In_Port : Port_Type;
In_Setup : Setup_Type)
is
UBRR_Value : Unsigned_16;
procedure Set_Sync_Mode is
begin
case In_Port is
when USART0 =>
case In_Setup.Sync_Mode is
when ASYNCHRONOUS => null;
when SYNCHRONOUS =>
Reg_USART0.UCSRC.UMSEL (0) := TRUE;
when MASTER_SPI =>
Reg_USART0.UCSRC.UMSEL (0) := TRUE;
Reg_USART0.UCSRC.UMSEL (1) := TRUE;
end case;
#if MCU="ATMEGA2560" then
when USART1 =>
case In_Setup.Sync_Mode is
when ASYNCHRONOUS => null;
when SYNCHRONOUS =>
Reg_USART1.UCSRC.UMSEL (0) := TRUE;
when MASTER_SPI =>
Reg_USART1.UCSRC.UMSEL (0) := TRUE;
Reg_USART1.UCSRC.UMSEL (1) := TRUE;
end case;
when USART2 =>
case In_Setup.Sync_Mode is
when ASYNCHRONOUS => null;
when SYNCHRONOUS =>
Reg_USART2.UCSRC.UMSEL (0) := TRUE;
when MASTER_SPI =>
Reg_USART2.UCSRC.UMSEL (0) := TRUE;
Reg_USART2.UCSRC.UMSEL (1) := TRUE;
end case;
when USART3 =>
case In_Setup.Sync_Mode is
when ASYNCHRONOUS => null;
when SYNCHRONOUS =>
Reg_USART3.UCSRC.UMSEL (0) := TRUE;
when MASTER_SPI =>
Reg_USART3.UCSRC.UMSEL (0) := TRUE;
Reg_USART3.UCSRC.UMSEL (1) := TRUE;
end case;
#end if;
end case;
exception
when others => null;
end Set_Sync_Mode;
procedure Set_Double_Speed is
begin
case In_Port is
when USART0 =>
if In_Setup.Double_Speed then
Reg_USART0.UCSRA.U2X := TRUE;
end if;
#if MCU="ATMEGA2560" then
when USART1 =>
if In_Setup.Double_Speed then
Reg_USART1.UCSRA.U2X := TRUE;
end if;
when USART2 =>
if In_Setup.Double_Speed then
Reg_USART2.UCSRA.U2X := TRUE;
end if;
when USART3 =>
if In_Setup.Double_Speed then
Reg_USART3.UCSRA.U2X := TRUE;
end if;
#end if;
end case;
exception
when others => null;
end Set_Double_Speed;
procedure Set_Baud_Speed is
begin
if In_Setup.Sync_Mode = ASYNCHRONOUS then
if not In_Setup.Double_Speed then
-- Asynchronous Normal mode (U2Xn = 0);
UBRR_Value := Unsigned_16 (AVR.MCU.F_CPU / (16 * In_Setup.Baud_Rate) - 1);
else
UBRR_Value := Unsigned_16 (AVR.MCU.F_CPU / (08 * In_Setup.Baud_Rate) - 1);
end if;
else
UBRR_Value := Unsigned_16 (AVR.MCU.F_CPU / (02 * In_Setup.Baud_Rate) - 1);
end if;
case In_Port is
when USART0 =>
Reg_USART0.UBRR (1) := Byte_Type (Shift_Right (UBRR_Value, 8));
Reg_USART0.UBRR (0) := Byte_Type (UBRR_Value);
#if MCU="ATMEGA2560" then
when USART1 =>
Reg_USART1.UBRR (1) := Byte_Type (Shift_Right (UBRR_Value, 8));
Reg_USART1.UBRR (0) := Byte_Type (UBRR_Value);
when USART2 =>
Reg_USART2.UBRR (1) := Byte_Type (Shift_Right (UBRR_Value, 8));
Reg_USART2.UBRR (0) := Byte_Type (UBRR_Value);
when USART3 =>
Reg_USART3.UBRR (1) := Byte_Type (Shift_Right (UBRR_Value, 8));
Reg_USART3.UBRR (0) := Byte_Type (UBRR_Value);
#end if;
end case;
exception
when others => null;
end Set_Baud_Speed;
procedure Set_Data_Bits is
begin
case In_Port is
when USART0 =>
case In_Setup.Data_Bits is
when BITS_5 => null; -- Add null;
when BITS_6 =>
Reg_USART0.UCSRC.UCSZ0 := TRUE;
when BITS_7 =>
Reg_USART0.UCSRC.UCSZ1 := TRUE;
when BITS_8 =>
Reg_USART0.UCSRC.UCSZ0 := TRUE;
Reg_USART0.UCSRC.UCSZ1 := TRUE;
when BITS_9 =>
Reg_USART0.UCSRC.UCSZ0 := TRUE;
Reg_USART0.UCSRC.UCSZ1 := TRUE;
Reg_USART0.UCSRB.UCSZ2 := TRUE;
end case;
#if MCU="ATMEGA2560" then
when USART1 =>
case In_Setup.Data_Bits is
when BITS_5 => null; -- Add null;
when BITS_6 =>
Reg_USART1.UCSRC.UCSZ0 := TRUE;
when BITS_7 =>
Reg_USART1.UCSRC.UCSZ1 := TRUE;
when BITS_8 =>
Reg_USART1.UCSRC.UCSZ0 := TRUE;
Reg_USART1.UCSRC.UCSZ1 := TRUE;
when BITS_9 =>
Reg_USART1.UCSRC.UCSZ0 := TRUE;
Reg_USART1.UCSRC.UCSZ1 := TRUE;
Reg_USART1.UCSRB.UCSZ2 := TRUE;
end case;
when USART2 =>
case In_Setup.Data_Bits is
when BITS_5 => null; -- Add null;
when BITS_6 =>
Reg_USART2.UCSRC.UCSZ0 := TRUE;
when BITS_7 =>
Reg_USART2.UCSRC.UCSZ1 := TRUE;
when BITS_8 =>
Reg_USART2.UCSRC.UCSZ0 := TRUE;
Reg_USART2.UCSRC.UCSZ1 := TRUE;
when BITS_9 =>
Reg_USART2.UCSRC.UCSZ0 := TRUE;
Reg_USART2.UCSRC.UCSZ1 := TRUE;
Reg_USART2.UCSRB.UCSZ2 := TRUE;
end case;
when USART3 =>
case In_Setup.Data_Bits is
when BITS_5 => null; -- Add null;
when BITS_6 =>
Reg_USART3.UCSRC.UCSZ0 := TRUE;
when BITS_7 =>
Reg_USART3.UCSRC.UCSZ1 := TRUE;
when BITS_8 =>
Reg_USART3.UCSRC.UCSZ0 := TRUE;
Reg_USART3.UCSRC.UCSZ1 := TRUE;
when BITS_9 =>
Reg_USART3.UCSRC.UCSZ0 := TRUE;
Reg_USART3.UCSRC.UCSZ1 := TRUE;
Reg_USART3.UCSRB.UCSZ2 := TRUE;
end case;
#end if;
end case;
exception
when others => null;
end Set_Data_Bits;
procedure Set_Parity is
begin
case In_Port is
when USART0 =>
case In_Setup.Parity is
when NONE => null;
when EVEN =>
Reg_USART0.UCSRC.UPM (1) := TRUE;
when ODD =>
Reg_USART0.UCSRC.UPM (0) := TRUE;
Reg_USART0.UCSRC.UPM (1) := TRUE;
end case;
#if MCU="ATMEGA2560" then
when USART1 =>
case In_Setup.Parity is
when NONE => null;
when EVEN =>
Reg_USART1.UCSRC.UPM (1) := TRUE;
when ODD =>
Reg_USART1.UCSRC.UPM (0) := TRUE;
Reg_USART1.UCSRC.UPM (1) := TRUE;
end case;
when USART2 =>
case In_Setup.Parity is
when NONE => null;
when EVEN =>
Reg_USART2.UCSRC.UPM (1) := TRUE;
when ODD =>
Reg_USART2.UCSRC.UPM (0) := TRUE;
Reg_USART2.UCSRC.UPM (1) := TRUE;
end case;
when USART3 =>
case In_Setup.Parity is
when NONE => null;
when EVEN =>
Reg_USART3.UCSRC.UPM (1) := TRUE;
when ODD =>
Reg_USART3.UCSRC.UPM (0) := TRUE;
Reg_USART3.UCSRC.UPM (1) := TRUE;
end case;
#end if;
end case;
exception
when others => null;
end Set_Parity;
procedure Set_Stop_Bits is
begin
case In_Port is
when USART0 =>
if In_Setup.Stop_Bits = 2 then
Reg_USART0.UCSRC.USBS := TRUE;
end if;
#if MCU="ATMEGA2560" then
when USART1 =>
if In_Setup.Stop_Bits = 2 then
Reg_USART1.UCSRC.USBS := TRUE;
end if;
when USART2 =>
if In_Setup.Stop_Bits = 2 then
Reg_USART2.UCSRC.USBS := TRUE;
end if;
when USART3 =>
if In_Setup.Stop_Bits = 2 then
Reg_USART3.UCSRC.USBS := TRUE;
end if;
#end if;
end case;
exception
when others => null;
end Set_Stop_Bits;
procedure Clear_Registers
is
begin
case In_Port is
when USART0 =>
AVR.USART.Reg_USART0.UCSRA := (others => <>);
AVR.USART.Reg_USART0.UCSRB := (others => <>);
AVR.USART.Reg_USART0.UCSRC := (others => <>);
#if MCU="ATMEGA2560" then
when USART1 =>
AVR.USART.Reg_USART1.UCSRA := (others => <>);
AVR.USART.Reg_USART1.UCSRB := (others => <>);
AVR.USART.Reg_USART1.UCSRC := (others => <>);
when USART2 =>
AVR.USART.Reg_USART2.UCSRA := (others => <>);
AVR.USART.Reg_USART2.UCSRB := (others => <>);
AVR.USART.Reg_USART2.UCSRC := (others => <>);
when USART3 =>
AVR.USART.Reg_USART3.UCSRA := (others => <>);
AVR.USART.Reg_USART3.UCSRB := (others => <>);
AVR.USART.Reg_USART3.UCSRC := (others => <>);
#end if;
end case;
exception
when others => null;
end Clear_Registers;
procedure Enable_Tx_Rx_And_Maybe_RXCIE
is
begin
case In_Port is
when USART0 =>
Reg_USART0.UCSRB.TXEN := True;
Reg_USART0.UCSRB.RXEN := True;
Reg_USART0.UCSRB.RXCIE := (In_Setup.Model = INTERRUPTIVE);
when USART1 =>
Reg_USART1.UCSRB.TXEN := True;
Reg_USART1.UCSRB.RXEN := True;
Reg_USART1.UCSRB.RXCIE := (In_Setup.Model = INTERRUPTIVE);
when USART2 =>
Reg_USART2.UCSRB.TXEN := True;
Reg_USART2.UCSRB.RXEN := True;
Reg_USART2.UCSRB.RXCIE := (In_Setup.Model = INTERRUPTIVE);
when USART3 =>
Reg_USART3.UCSRB.TXEN := True;
Reg_USART3.UCSRB.RXEN := True;
Reg_USART3.UCSRB.RXCIE := (In_Setup.Model = INTERRUPTIVE);
end case;
exception
when others => null;
end Enable_Tx_Rx_And_Maybe_RXCIE;
begin
Priv_Setup (In_Port) := In_Setup;
Clear_Registers;
Set_Sync_Mode;
Set_Double_Speed;
Set_Baud_Speed;
Set_Data_Bits;
Set_Parity;
Set_Stop_Bits;
Enable_Tx_Rx_And_Maybe_RXCIE;
exception
when others => null;
end Initialize;
procedure Write_Char
(In_Port : Port_Type;
In_Data : Character)
is
begin
Write (In_Port => In_Port,
In_Data => To_Unsigned_8 (In_Data));
end Write_Char;
procedure Write_String_U8
(In_Port : Port_Type;
In_Data : String_U8)
is
begin
for Index in In_Data'Range loop
Write_Char (In_Port => In_Port,
In_Data => In_Data (Index));
end loop;
end Write_String_U8;
procedure Write
(In_Port : Port_Type;
In_Data : Unsigned_8)
is
begin
-- Loop while the transmit buffer UDRn us bit ready to receive
-- new data.
case In_Port is
when USART0 =>
while not Reg_USART0.UCSRA.UDRE loop null; end loop;
Reg_USART0.UDR := Byte_Type (In_Data);
#if MCU="ATMEGA2560" then
when USART1 =>
while not Reg_USART1.UCSRA.UDRE loop null; end loop;
Reg_USART1.UDR := Byte_Type (In_Data);
when USART2 =>
while not Reg_USART2.UCSRA.UDRE loop null; end loop;
Reg_USART2.UDR := Byte_Type (In_Data);
when USART3 =>
while not Reg_USART3.UCSRA.UDRE loop null; end loop;
Reg_USART3.UDR := Byte_Type (In_Data);
#end if;
end case;
exception
when others => null;
end Write;
procedure Write_Line
(In_Port : Port_Type;
In_Data : String_U8)
is
begin
Write_String_U8 (In_Port => In_Port,
In_Data => In_Data);
New_Line (In_Port => In_Port);
end Write_Line;
procedure New_Line
(In_Port : Port_Type)
is
begin
Write_Char (In_Port => In_Port,
In_Data => ASCII.CR);
Write_Char (In_Port => In_Port,
In_Data => ASCII.LF);
end New_Line;
function Receive
(In_Port : Port_Type;
Out_Data : out Unsigned_8)
return Boolean
is
begin
case Priv_Setup (In_Port).Model is
when POLLING =>
case In_Port is
when USART0 =>
if Reg_USART0.UCSRA.RXC then
Out_Data := Unsigned_8 (Reg_USART0.UDR);
return True;
else
return False;
end if;
#if MCU="ATMEGA2560" then
when USART1 =>
if Reg_USART1.UCSRA.RXC then
Out_Data := Unsigned_8 (Reg_USART1.UDR);
return True;
else
return False;
end if;
when USART2 =>
if Reg_USART2.UCSRA.RXC then
Out_Data := Unsigned_8 (Reg_USART2.UDR);
return True;
else
return False;
end if;
when USART3 =>
if Reg_USART3.UCSRA.RXC then
Out_Data := Unsigned_8 (Reg_USART3.UDR);
return True;
else
return False;
end if;
#end if;
end case;
when INTERRUPTIVE =>
if Priv_Receive_Flag (In_Port) then
Out_Data := Unsigned_8 (Priv_Receive_Buffer (In_Port));
Priv_Receive_Flag (In_Port) := False;
return True;
else
return False;
end if;
end case;
exception
when others => return False;
end Receive;
function Receive_Char
(In_Port : in Port_Type;
Out_Data : out Character)
return Boolean
is
Curr_Status : Boolean;
Curr_Data : Unsigned_8;
begin
Curr_Status := Receive
(In_Port => In_Port,
Out_Data => Curr_Data);
if Curr_Status then
Out_Data := To_Char (Curr_Data);
return True;
else
return False;
end if;
end Receive_Char;
procedure Receive_Char_Polled
(In_Port : in Port_Type := USART0;
Out_Data : out Character)
is
begin
while not Receive_Char
(In_Port => In_Port,
Out_Data => Out_Data)
loop null; end loop;
end Receive_Char_Polled;
procedure Receive_Char_Polled_Until_Flag_Char
(In_Port : in AVR.USART.Port_Type;
In_Char : in Character;
Out_Data : out AVR.USART.String_U8)
is
Curr_Char : Character := ' ';
begin
Receive_Char_Polled
(In_Port => In_Port,
Out_Data => Curr_Char);
for Index in 1 .. Out_Data'Length loop
if Curr_Char /= In_Char then
Out_Data (Unsigned_8 (Index)) := Curr_Char;
Receive_Char_Polled
(In_Port => In_Port,
Out_Data => Curr_Char);
else
Out_Data (Unsigned_8 (Index)) := In_Char;
end if;
end loop;
exception
when others => null;
end Receive_Char_Polled_Until_Flag_Char;
function Receive_Char_Tries
(In_Port : in Port_Type := USART0;
In_Tries : in Unsigned_8;
Out_Data : out Character)
return Boolean
is
Curr_Data : Character;
Curr_Success : Boolean := False;
begin
for Curr_Try in 1 .. In_Tries loop
Curr_Success := Receive_Char
(In_Port => In_Port,
Out_Data => Curr_Data);
if Curr_Success then
Out_Data := Curr_Data;
exit;
end if;
end loop;
return Curr_Success;
end Receive_Char_Tries;
function Receive_String_U8
(In_Port : in Port_Type;
Out_Data : out String_U8)
return Boolean
is
Curr_Data : Character;
begin
for Index in 1 .. Out_Data'Length loop
-- It will wait eternally for the data. No good.
while not Receive_Char
(In_Port => In_Port,
Out_Data => Curr_Data)
loop null; end loop;
Out_Data (Unsigned_8 (Index)) := Curr_Data;
end loop;
return True;
exception
when others => return False;
end Receive_String_U8;
procedure Handle_ISR_RXC
(In_Port : in Port_Type)
is
begin
case In_Port is
when USART0 =>
Priv_Receive_Buffer (In_Port) := Reg_USART0.UDR;
#if MCU="ATMEGA2560" then
when USART1 =>
Priv_Receive_Buffer (In_Port) := Reg_USART1.UDR;
when USART2 =>
Priv_Receive_Buffer (In_Port) := Reg_USART2.UDR;
when USART3 =>
Priv_Receive_Buffer (In_Port) := Reg_USART3.UDR;
#end if;
end case;
Priv_Receive_Flag (In_Port) := True;
exception
when others => null;
end Handle_ISR_RXC;
function Get_Setup
(In_Port : Port_Type)
return Setup_Type
is
begin
return Priv_Setup (In_Port);
end Get_Setup;
end AVR.USART;
|
onox/orka | Ada | 2,094 | adb | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2012 Felix Krause <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Unchecked_Deallocation;
package body GL.Objects is
overriding procedure Initialize (Object : in out GL_Object) is
begin
Object.Reference := new GL_Object_Reference'
(GL_Id => 0,
Reference_Count => 1);
GL_Object'Class (Object).Initialize_Id;
end Initialize;
overriding procedure Adjust (Object : in out GL_Object) is
begin
if Object.Reference /= null then
Object.Reference.Reference_Count := Object.Reference.Reference_Count + 1;
end if;
end Adjust;
overriding procedure Finalize (Object : in out GL_Object) is
procedure Free is new Ada.Unchecked_Deallocation
(Object => GL_Object_Reference, Name => GL_Object_Reference_Access);
begin
if Object.Reference /= null then
Object.Reference.Reference_Count := Object.Reference.Reference_Count - 1;
if Object.Reference.Reference_Count = 0 then
if Object.Reference.GL_Id /= 0 then
GL_Object'Class (Object).Delete_Id;
end if;
Free (Object.Reference);
end if;
end if;
-- Idempotence: next call to Finalize has no effect
Object.Reference := null;
end Finalize;
function Raw_Id (Object : GL_Object) return UInt is (Object.Reference.GL_Id);
overriding
function "=" (Left, Right : GL_Object) return Boolean is (Left.Reference = Right.Reference);
end GL.Objects;
|
zhmu/ananas | Ada | 5,436 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is the VxWorks version of this package
-- This package encapsulates and centralizes information about all
-- uses of interrupts (or signals), including the target-dependent
-- mapping of interrupts (or signals) to exceptions.
-- Unlike the original design, System.Interrupt_Management can only
-- be used for tasking systems.
-- PLEASE DO NOT put any subprogram declarations with arguments of
-- type Interrupt_ID into the visible part of this package. The type
-- Interrupt_ID is used to derive the type in Ada.Interrupts, and
-- adding more operations to that type would be illegal according
-- to the Ada Reference Manual. This is the reason why the signals
-- sets are implemented using visible arrays rather than functions.
with System.OS_Interface;
with Interfaces.C;
package System.Interrupt_Management is
pragma Preelaborate;
type Interrupt_Mask is limited private;
type Interrupt_ID is new Interfaces.C.int
range 0 .. System.OS_Interface.Max_Interrupt;
type Interrupt_Set is array (Interrupt_ID) of Boolean;
subtype Signal_ID is Interrupt_ID range 0 .. System.OS_Interface.NSIG - 1;
type Signal_Set is array (Signal_ID) of Boolean;
-- The following objects serve as constants, but are initialized in the
-- body to aid portability. This permits us to use more portable names for
-- interrupts, where distinct names may map to the same interrupt ID
-- value.
-- For example, suppose SIGRARE is a signal that is not defined on all
-- systems, but is always reserved when it is defined. If we have the
-- convention that ID zero is not used for any "real" signals, and SIGRARE
-- = 0 when SIGRARE is not one of the locally supported signals, we can
-- write:
-- Reserved (SIGRARE) := True;
-- and the initialization code will be portable.
Abort_Task_Interrupt : Signal_ID;
-- The signal that is used to implement task abort if an interrupt is used
-- for that purpose. This is one of the reserved signals.
Reserve : Interrupt_Set := (others => False);
-- Reserve (I) is true iff the interrupt I is one that cannot be permitted
-- to be attached to a user handler. The possible reasons are many. For
-- example, it may be mapped to an exception used to implement task abort,
-- or used to implement time delays.
procedure Initialize_Interrupts;
pragma Import (C, Initialize_Interrupts, "__gnat_install_handler");
-- Under VxWorks, there is no signal inheritance between tasks.
-- This procedure is used to initialize signal-to-exception mapping in
-- each task.
procedure Initialize;
-- Initialize the various variables defined in this package. This procedure
-- must be called before accessing any object from this package and can be
-- called multiple times (only the first call has any effect).
private
type Interrupt_Mask is new System.OS_Interface.sigset_t;
-- In some implementation Interrupt_Mask can be represented as a linked
-- list.
end System.Interrupt_Management;
|
stcarrez/ada-awa | Ada | 9,713 | adb | -----------------------------------------------------------------------
-- awa-settings-modules -- Module awa-settings
-- Copyright (C) 2013, 2016, 2017 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with ADO.Sessions;
with ADO.Queries;
with AWA.Services.Contexts;
with AWA.Settings.Models;
with AWA.Modules.Get;
with AWA.Users.Models;
with Util.Log.Loggers;
with Util.Beans.Objects;
with Util.Beans.Basic;
package body AWA.Settings.Modules is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Awa.Settings.Module");
package ASC renames AWA.Services.Contexts;
-- Load the setting value for the current user.
-- Return the default value if there is no such setting.
procedure Load (Name : in String;
Default : in String;
Value : out Ada.Strings.Unbounded.Unbounded_String);
-- Save the setting value for the current user.
procedure Save (Name : in String;
Value : in String);
-- ------------------------------
-- Set the user setting with the given name in the setting manager cache
-- and in the database.
-- ------------------------------
procedure Set (Manager : in out Setting_Manager;
Name : in String;
Value : in String) is
begin
Manager.Data.Set (Name, Value);
end Set;
-- ------------------------------
-- Get the user setting with the given name from the setting manager cache.
-- Load the user setting from the database if necessary.
-- ------------------------------
procedure Get (Manager : in out Setting_Manager;
Name : in String;
Default : in String;
Value : out Ada.Strings.Unbounded.Unbounded_String) is
begin
Manager.Data.Get (Name, Default, Value);
end Get;
-- ------------------------------
-- Release the memory allocated for the settings.
-- ------------------------------
overriding
procedure Finalize (Manager : in out Setting_Manager) is
begin
Manager.Data.Clear;
end Finalize;
-- ------------------------------
-- Get the current setting manager for the current user.
-- ------------------------------
function Current return Setting_Manager_Access is
Ctx : constant ASC.Service_Context_Access := ASC.Current;
Obj : Util.Beans.Objects.Object := Ctx.Get_Session_Attribute (SESSION_ATTR_NAME);
Bean : constant access Util.Beans.Basic.Readonly_Bean'Class
:= Util.Beans.Objects.To_Bean (Obj);
begin
if Bean = null or else not (Bean.all in Setting_Manager'Class) then
declare
Mgr : constant Setting_Manager_Access := new Setting_Manager;
begin
Obj := Util.Beans.Objects.To_Object (Mgr.all'Access);
Ctx.Set_Session_Attribute (SESSION_ATTR_NAME, Obj);
return Mgr;
end;
else
return Setting_Manager'Class (Bean.all)'Unchecked_Access;
end if;
end Current;
-- ------------------------------
-- Initialize the settings module.
-- ------------------------------
overriding
procedure Initialize (Plugin : in out Setting_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config) is
begin
Log.Info ("Initializing the settings module");
AWA.Modules.Module (Plugin).Initialize (App, Props);
end Initialize;
-- ------------------------------
-- Get the settings module.
-- ------------------------------
function Get_Setting_Module return Setting_Module_Access is
function Get is new AWA.Modules.Get (Setting_Module, Setting_Module_Access, NAME);
begin
return Get;
end Get_Setting_Module;
-- ------------------------------
-- Load the setting value for the current user.
-- Return the default value if there is no such setting.
-- ------------------------------
procedure Load (Name : in String;
Default : in String;
Value : out Ada.Strings.Unbounded.Unbounded_String) is
Ctx : constant Services.Contexts.Service_Context_Access := AWA.Services.Contexts.Current;
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
Query : ADO.Queries.Context;
Setting : AWA.Settings.Models.User_Setting_Ref;
Found : Boolean;
begin
Query.Set_Join ("INNER JOIN awa_setting AS a ON o.setting_id = a.id ");
Query.Set_Filter ("a.name = :name AND o.user_id = :user");
Query.Bind_Param ("name", Name);
Query.Bind_Param ("user", User.Get_Id);
Setting.Find (DB, Query, Found);
if not Found then
Value := Ada.Strings.Unbounded.To_Unbounded_String (Default);
else
Value := Setting.Get_Value;
end if;
end Load;
-- Save the setting value for the current user.
procedure Save (Name : in String;
Value : in String) is
Ctx : constant Services.Contexts.Service_Context_Access := AWA.Services.Contexts.Current;
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
Setting : AWA.Settings.Models.User_Setting_Ref;
Query : ADO.Queries.Context;
Found : Boolean;
begin
Ctx.Start;
Query.Set_Join ("INNER JOIN awa_setting AS a ON o.setting_id = a.id ");
Query.Set_Filter ("a.name = :name AND o.user_id = :user");
Query.Bind_Param ("name", Name);
Query.Bind_Param ("user", User.Get_Id);
Setting.Find (DB, Query, Found);
if not Found then
declare
Setting_Def : AWA.Settings.Models.Setting_Ref;
begin
Query.Clear;
Query.Set_Filter ("o.name = :name");
Query.Bind_Param ("name", Name);
Setting_Def.Find (DB, Query, Found);
if not Found then
Setting_Def.Set_Name (Name);
Setting_Def.Save (DB);
end if;
Setting.Set_Setting (Setting_Def);
end;
Setting.Set_User (User);
end if;
Setting.Set_Value (Value);
Setting.Save (DB);
Ctx.Commit;
end Save;
procedure Free is new Ada.Unchecked_Deallocation (Object => Setting_Data,
Name => Setting_Data_Access);
use Ada.Strings.Unbounded;
protected body Settings is
procedure Get (Name : in String;
Default : in String;
Value : out Ada.Strings.Unbounded.Unbounded_String) is
Item : Setting_Data_Access := First;
Previous : Setting_Data_Access := null;
begin
while Item /= null loop
if Item.Name = Name then
Value := Item.Value;
if Previous /= null then
Previous.Next_Setting := Item.Next_Setting;
Item.Next_Setting := First;
First := Item;
end if;
return;
end if;
Previous := Item;
Item := Item.Next_Setting;
end loop;
Load (Name, Default, Value);
Item := new Setting_Data;
Item.Name := Ada.Strings.Unbounded.To_Unbounded_String (Name);
Item.Value := Value;
Item.Next_Setting := First;
First := Item;
end Get;
procedure Set (Name : in String;
Value : in String) is
Item : Setting_Data_Access := First;
Previous : Setting_Data_Access := null;
begin
while Item /= null loop
if Item.Name = Name then
if Previous /= null then
Previous.Next_Setting := Item.Next_Setting;
Item.Next_Setting := First;
First := Item;
end if;
if Item.Value = Value then
return;
end if;
Item.Value := Ada.Strings.Unbounded.To_Unbounded_String (Value);
Save (Name, Value);
return;
end if;
Previous := Item;
Item := Item.Next_Setting;
end loop;
Item := new Setting_Data;
Item.Name := Ada.Strings.Unbounded.To_Unbounded_String (Name);
Item.Value := Ada.Strings.Unbounded.To_Unbounded_String (Value);
Item.Next_Setting := First;
First := Item;
Save (Name, Value);
end Set;
procedure Clear is
begin
while First /= null loop
declare
Item : Setting_Data_Access := First;
begin
First := Item.Next_Setting;
Free (Item);
end;
end loop;
end Clear;
end Settings;
end AWA.Settings.Modules;
|
zrmyers/VulkanAda | Ada | 3,960 | adb | --------------------------------------------------------------------------------
-- 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.
--------------------------------------------------------------------------------
-- This package describes a generic Unsigned Integer Vulkan Math type.
--------------------------------------------------------------------------------
package body Vulkan.Math.GenUType is
----------------------------------------------------------------------------
-- Generic Operations
----------------------------------------------------------------------------
function Apply_Func_IVU_IVU_IVB_RVU(IVU1, IVU2 : in Vkm_GenUType;
IVB1 : in Vkm_GenBType) return Vkm_GenUType is
result : Vkm_GenUType := (last_index => IVU1.last_index, others => <>);
begin
for index in result.data'Range loop
result.data(index) := Func(IVU1.data(index),
IVU2.data(index),
IVB1.data(index));
end loop;
return Result;
end Apply_Func_IVU_IVU_IVB_RVU;
----------------------------------------------------------------------------
function Apply_Func_IVU_IVU_RVB(
IVU1, IVU2 : in Vkm_GenUType) return Vkm_GenBType is
result : Vkm_GenBType := (last_index => IVU1.last_index, others => <>);
begin
for index in result.data'Range loop
result.data(index) := Func(IVU1.data(index), IVU2.data(index));
end loop;
return result;
end Apply_Func_IVU_IVU_RVB;
----------------------------------------------------------------------------
function Apply_Func_IVU_ISI_ISI_RVU(
IVU1 : in Vkm_GenUType;
ISI1, ISI2 : in Vkm_Int ) return Vkm_GenUType is
result : Vkm_GenUType := (last_index => IVU1.last_index, others => <>);
begin
for index in result.data'Range loop
result.data(index) := Func(IVU1.data(index), ISI1, ISI2);
end loop;
return result;
end Apply_Func_IVU_ISI_ISI_RVU;
----------------------------------------------------------------------------
function Apply_Func_IVU_IVU_ISI_ISI_RVU(
IVU1, IVU2 : in Vkm_GenUType;
ISI1, ISI2 : in Vkm_Int ) return Vkm_GenUType is
result : Vkm_GenUType := (last_index => IVU1.last_index, others => <>);
begin
for index in result.data'Range loop
result.data(index) := Func(IVU1.data(index),
IVU2.data(index),
ISI1, ISI2);
end loop;
return result;
end Apply_Func_IVU_IVU_ISI_ISI_RVU;
end Vulkan.Math.GenUType;
|
edin/raytracer | Ada | 926 | adb | --
-- Raytracer implementation in Ada
-- by John Perry (github: johnperry-math)
-- 2021
--
-- implementation for Cameras, that view the scene
--
-- local packages
with RayTracing_Constants; use RayTracing_Constants;
package body Cameras is
function Create_Camera(Position, Target: Vector) return Camera_Type is
Result: Camera_Type;
Down: Vector := Create_Vector(0.0, -1.0, 0.0);
Forward: Vector := Target - Position;
-- computed later
Right_Norm, Up_Norm: Vector;
begin
Result.Position := Position;
Result.Forward := Normal(Forward);
Result.Right := Cross_Product(Result.Forward, Down);
Result.Up := Cross_Product(Result.Forward, Result.Right);
Right_Norm := Normal(Result.Right);
Up_Norm := Normal(Result.Up);
Result.Right := Right_Norm * 1.5;
Result.Up := Up_Norm * 1.5;
return Result;
end Create_Camera;
end Cameras;
|
annexi-strayline/AURA | Ada | 3,982 | ads | ------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- ANNEXI-STRAYLINE Reference Implementation --
-- --
-- Core --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Workers;
with Registrar.Subsystems; use Registrar.Subsystems;
package Registrar.Executive.Subsystems_Request is
type Subsystems_Request_Order is
new Workers.Work_Order with
record
Requested_Subsystems: Subsystem_Sets.Set;
end record;
overriding procedure Execute (Order: in out Subsystems_Request_Order);
overriding
function Image (Order: Subsystems_Request_Order)
return String;
end Registrar.Executive.Subsystems_Request;
|
stcarrez/dynamo | Ada | 5,325 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S C N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a generic lexical analyzer. This is used for scanning
-- Ada source files or text files with an Ada-like syntax, such as project
-- files. It is instantiated in Scn and Prj.Err.
with Casing; use Casing;
with Styleg;
with Types; use Types;
generic
with procedure Post_Scan;
-- Procedure called by Scan for the following tokens: Tok_Char_Literal,
-- Tok_Identifier, Tok_Real_Literal, Tok_Real_Literal, Tok_Integer_Literal,
-- Tok_String_Literal, Tok_Operator_Symbol, and Tok_Vertical_Bar. Used to
-- build Token_Node and also check for obsolescent features.
with procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr);
-- Output a message at specified location
with procedure Error_Msg_S (Msg : String);
-- Output a message at current scan pointer location
with procedure Error_Msg_SC (Msg : String);
-- Output a message at the start of the current token
with procedure Error_Msg_SP (Msg : String);
-- Output a message at the start of the previous token
with package Style is new Styleg
(Error_Msg, Error_Msg_S, Error_Msg_SC, Error_Msg_SP);
-- Instantiation of Styleg with the same error reporting routines
package Scng is
procedure Check_End_Of_Line;
-- Called when end of line encountered. Checks that line is not too long,
-- and that other style checks for the end of line are met.
procedure Initialize_Scanner (Index : Source_File_Index);
-- Initialize lexical scanner for scanning a new file referenced by Index.
-- Initialize_Scanner does not call Scan.
procedure Scan;
-- Scan scans out the next token, and advances the scan state accordingly
-- (see package Scan_State for details). If the scan encounters an illegal
-- token, then an error message is issued pointing to the bad character,
-- and Scan returns a reasonable substitute token of some kind.
-- For tokens Char_Literal, Identifier, Real_Literal, Integer_Literal,
-- String_Literal and Operator_Symbol, Post_Scan is called after scanning.
function Determine_Token_Casing return Casing_Type;
pragma Inline (Determine_Token_Casing);
-- Determines the casing style of the current token, which is
-- either a keyword or an identifier. See also package Casing.
procedure Set_Special_Character (C : Character);
-- Indicate that one of the following character '#', '$', '?', '@', '`',
-- '\', '^', '_' or '~', when found is a Special token.
procedure Reset_Special_Characters;
-- Indicate that there is no characters that are Special tokens., which
-- is the default.
procedure Set_End_Of_Line_As_Token (Value : Boolean);
-- Indicate if End_Of_Line is a token or not.
-- By default, End_Of_Line is not a token.
procedure Set_Comment_As_Token (Value : Boolean);
-- Indicate if a comment is a token or not.
-- By default, a comment is not a token.
function Set_Start_Column return Column_Number;
-- This routine is called with Scan_Ptr pointing to the first character
-- of a line. On exit, Scan_Ptr is advanced to the first non-blank
-- character of this line (or to the terminating format effector if the
-- line contains no non-blank characters), and the returned result is the
-- column number of this non-blank character (zero origin), which is the
-- value to be stored in the Start_Column scan variable.
end Scng;
|
reznikmm/matreshka | Ada | 4,397 | ads | ------------------------------------------------------------------------------
-- --
-- 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 Ada.Containers;
package ESAPI.Users is
pragma Preelaborate;
type User_Identifier is private;
Anonymous_User_Identifier : constant User_Identifier;
type User is limited interface;
type User_Access is access all User'Class with Storage_Size => 0;
not overriding function Get_User_Identifier
(Self : not null access constant User) return User_Identifier is abstract;
not overriding function Is_Anonymous
(Self : not null access constant User) return Boolean is abstract;
not overriding function Is_Enabled
(Self : not null access constant User) return Boolean is abstract;
not overriding procedure Enable (Self : not null access User) is abstract;
-- Enable user's account.
not overriding procedure Disable (Self : not null access User) is abstract;
-- Disable user's account.
function Hash (Item : User_Identifier) return Ada.Containers.Hash_Type;
private
type User_Identifier is range 0 .. 2**63 - 1;
Anonymous_User_Identifier : constant User_Identifier := 0;
end ESAPI.Users;
|
stcarrez/ada-util | Ada | 1,197 | ads | -----------------------------------------------------------------------
-- util-beans-objects-record_tests -- Unit tests for objects.records package
-- Copyright (C) 2011 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Tests;
package Util.Beans.Objects.Record_Tests is
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);
type Test is new Util.Tests.Test with null record;
procedure Test_Record (T : in out Test);
procedure Test_Bean (T : in out Test);
end Util.Beans.Objects.Record_Tests;
|
reznikmm/matreshka | Ada | 3,746 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.Constants;
package body Matreshka.ODF_Attributes.Style is
-----------------------
-- Get_Namespace_URI --
-----------------------
overriding function Get_Namespace_URI
(Self : not null access constant Style_Node_Base)
return League.Strings.Universal_String is
begin
return ODF.Constants.Style_URI;
end Get_Namespace_URI;
end Matreshka.ODF_Attributes.Style;
|
sparre/JSA | Ada | 6,776 | adb | ------------------------------------------------------------------------------
--
-- generic package Generic_Table_Text_IO (body)
--
-- A package for reading data tables with column headers indicating
-- which data are in which columns.
--
------------------------------------------------------------------------------
-- Update information:
--
-- 2003.03.25-26 (Jacob Sparre Andersen)
-- Written.
--
-- 2003.06.17 (Jacob Sparre Andersen)
-- Added the option of reading from Standard_Input.
--
-- (Insert additional update information above this line.)
------------------------------------------------------------------------------
-- Standard packages:
------------------------------------------------------------------------------
-- Other packages:
with JSA.Tabulated_Text_IO;
------------------------------------------------------------------------------
with JSA.Debugged; use JSA.Debugged;
package body JSA.Generic_Table_Text_IO is
---------------------------------------------------------------------------
-- procedure Close:
procedure Close (File : in out File_Type) is
begin
Ada.Text_IO.Close (File.File);
end Close;
---------------------------------------------------------------------------
-- function End_Of_File:
function End_Of_File (File : in File_Type) return Boolean is
begin
return Ada.Text_IO.End_Of_File (File.File);
end End_Of_File;
---------------------------------------------------------------------------
-- function End_Of_File:
--
-- Works on Standard_Input:
function End_Of_File return Boolean is
begin
return Ada.Text_IO.End_Of_File (Ada.Text_IO.Standard_Input);
end End_Of_File;
---------------------------------------------------------------------------
-- procedure Get:
procedure Get (File : in File_Type;
Item : out Row) is
use Ada.Strings.Unbounded;
use Tabulated_Text_IO;
Data : Unbounded_String;
begin
for Column in 1 .. File.Last_Column loop
Get (File => File.File,
Field => Data);
Message_Line ("Read """ & To_String (Data) & """ from column " &
Column'Img & ".");
for Field in Fields loop
if File.Columns (Field) = Column then
Item (Field) := Value (To_String (Data));
end if;
end loop;
end loop;
Skip_Record (File => File.File);
end Get;
---------------------------------------------------------------------------
-- procedure Get:
procedure Get (Item : out Row) is
use Ada.Strings.Unbounded;
use Tabulated_Text_IO;
Data : Unbounded_String;
begin
if not Initialised_Standard_Input then
Initialise_Standard_Input :
declare
Column : Natural := 0;
Label : Unbounded_String;
begin
Last_Standard_Input_Column := 0;
Standard_Input_Columns := (others => 0);
while not Ada.Text_IO.End_Of_Line (Ada.Text_IO.Standard_Input) loop
Tabulated_Text_IO.Get (File => Ada.Text_IO.Standard_Input,
Field => Label);
Column := Column + 1;
Message_Line ("Column " & Column'Img & " is labeled """ &
To_String (Label) & """.");
for Field in Fields loop
if Label = Labels (Field) and
Standard_Input_Columns (Field) = 0
then
Standard_Input_Columns (Field) := Column;
Message_Line ("Will copy column " &
Standard_Input_Columns (Field)'Img &
" to the field " & Field'Img & ".");
Last_Standard_Input_Column :=
Natural'Max (Last_Standard_Input_Column, Column);
Message_Line ("Will read " &
Last_Standard_Input_Column'Img &
" columns from the file.");
end if;
end loop;
end loop;
Tabulated_Text_IO.Skip_Record (File => Ada.Text_IO.Standard_Input);
Initialised_Standard_Input := True;
end Initialise_Standard_Input;
end if;
for Column in 1 .. Last_Standard_Input_Column loop
Get (File => Ada.Text_IO.Standard_Input,
Field => Data);
Message_Line ("Read """ & To_String (Data) & """ from column " &
Column'Img & ".");
for Field in Fields loop
if Standard_Input_Columns (Field) = Column then
Item (Field) := Value (To_String (Data));
end if;
end loop;
end loop;
Skip_Record (File => Ada.Text_IO.Standard_Input);
end Get;
---------------------------------------------------------------------------
-- function Is_Open:
function Is_Open (File : in File_Type) return Boolean is
begin
return Ada.Text_IO.Is_Open (File.File);
end Is_Open;
---------------------------------------------------------------------------
-- procedure Open:
procedure Open (File : in out File_Type;
Name : in String;
Mode : in Ada.Text_IO.File_Mode) is
use Ada.Strings.Unbounded;
Column : Natural := 0;
Label : Unbounded_String;
begin -- Open
Ada.Text_IO.Open (File => File.File,
Name => Name,
Mode => Mode);
File.Last_Column := 0;
File.Columns := (others => 0);
while not Ada.Text_IO.End_Of_Line (File.File) loop
Tabulated_Text_IO.Get (File => File.File,
Field => Label);
Column := Column + 1;
Message_Line ("Column " & Column'Img & " is labeled """ &
To_String (Label) & """.");
for Field in Fields loop
if Label = Labels (Field) and File.Columns (Field) = 0 then
File.Columns (Field) := Column;
Message_Line ("Will copy column " & File.Columns (Field)'Img &
" to the field " & Field'Img & ".");
File.Last_Column := Natural'Max (File.Last_Column, Column);
Message_Line ("Will read " & File.Last_Column'Img &
" columns from the file.");
end if;
end loop;
end loop;
Tabulated_Text_IO.Skip_Record (File => File.File);
end Open;
---------------------------------------------------------------------------
end JSA.Generic_Table_Text_IO;
|
sparre/Command-Line-Parser-Generator | Ada | 116 | ads | package Bad_With_Aliased_Parameter is
procedure Run (Help : aliased in Boolean);
end Bad_With_Aliased_Parameter;
|
reznikmm/matreshka | Ada | 3,719 | 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.Smil_RepeatCount_Attributes is
pragma Preelaborate;
type ODF_Smil_RepeatCount_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Smil_RepeatCount_Attribute_Access is
access all ODF_Smil_RepeatCount_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Smil_RepeatCount_Attributes;
|
danieagle/ASAP-Modular_Hashing | Ada | 18,751 | adb | ------------------------------------------------------------------------------
-- --
-- Modular Hash Infrastructure --
-- --
-- SHA1 --
-- --
-- - "Reference" Implementation - --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2018-2021, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Ensi Martini (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. --
-- --
------------------------------------------------------------------------------
package body Modular_Hashing.SHA1 is
pragma Assert (Stream_Element'Size = 8);
-- This implementation makes the assumption that a Stream_Element is 8 bits
-- wide. This is a safe assumption in most common applications. Making this
-- assumption greatly simplifies this reference implementation.
--
-- Internal Subprograms
--
------------------
-- Digest_Chunk --
------------------
-- This procedure is the internal digest that allows for a 512-bit block to
-- be processed without finishing the hash (padding)
--
-- This is the bulk of the SHA1 algorithm, missing only the addition of
-- message size with padding, which is handed by the Digest subprogram
procedure Digest_Chunk (Engine : in out SHA1_Engine) with Inline is
A, B, C, D, E, F, K, Temp : Unsigned_32;
Word_Sequence : array (1 .. 80) of Unsigned_32;
begin
-- Break the chunk into 16 32-bit words, assign to Word_Sequence
for I in 1 .. 16 loop
Word_Sequence(I) :=
Shift_Left(Value => Unsigned_32
(Engine.Buffer(Stream_Element_Offset((I * 4) - 3))),
Amount => 24)
+ Shift_Left(Value => Unsigned_32
(Engine.Buffer(Stream_Element_Offset((I * 4) - 2))),
Amount => 16)
+ Shift_Left(Value => Unsigned_32
(Engine.Buffer(Stream_Element_Offset((I * 4) - 1))),
Amount => 8)
+ Unsigned_32(Engine.Buffer(Stream_Element_Offset(I * 4)));
end loop;
-- Create the values for the rest of Word_Sequence
for I in 17 .. 80 loop
Word_Sequence(I) :=
Rotate_Left (Value =>
Word_Sequence(I - 3)
xor Word_Sequence(I - 8)
xor Word_Sequence(I - 14)
xor Word_Sequence(I - 16),
Amount => 1);
end loop;
A := Engine.H0;
B := Engine.H1;
C := Engine.H2;
D := Engine.H3;
E := Engine.H4;
declare
procedure Operations(Index : Integer) with Inline is
begin
Temp := Rotate_Left (Value => A, Amount => 5)
+ F + E + K + Word_Sequence(Index);
E := D;
D := C;
C := Rotate_Left (Value => B, Amount => 30);
B := A;
A := Temp;
end;
begin
-- The following loops are split-up to avoid persistent if-else
-- statements that is common in many reference implementations.
-- Inlining the operations takes up more code-space, but that is rarely
-- a concern in modern times...
for I in 1 .. 20 loop
F := (B and C) or ((not B) and D);
K := 16#5A827999#;
Operations (I);
end loop;
for I in 21 .. 40 loop
F := B xor C xor D;
K := 16#6ED9EBA1#;
Operations (I);
end loop;
for I in 41 .. 60 loop
F := (B and C) or (B and D) or (C and D);
K := 16#8F1BBCDC#;
Operations (I);
end loop;
for I in 61 .. 80 loop
F := B xor C xor D;
K := 16#CA62C1D6#;
Operations (I);
end loop;
end;
Engine.H0 := Engine.H0 + A;
Engine.H1 := Engine.H1 + B;
Engine.H2 := Engine.H2 + C;
Engine.H3 := Engine.H3 + D;
Engine.H4 := Engine.H4 + E;
Engine.Last_Element_Index := 0;
end Digest_Chunk;
--
-- SHA1_Hash
--
---------
-- "<" --
---------
function "<" (Left, Right: SHA1_Hash) return Boolean is
begin
-- Even though our numbers are split into arrays of Unsigned_32,
-- comparison operators can work on each section individually,
-- as the lower indices have more significance
for I in Message_Digest'Range loop
if Left.Digest(I) < Right.Digest(I) then
return True;
elsif Left.Digest(I) > Right.Digest(I) then
return False;
end if;
end loop;
-- The only way we get here is when Left = Right
return False;
end "<";
---------
-- ">" --
---------
function ">" (Left, Right: SHA1_Hash) return Boolean is
begin
-- Even though our numbers are split into arrays of Unsigned_32,
-- comparison operators can work on each section individually,
-- as the lower indices have more significance
for I in Message_Digest'Range loop
if Left.Digest(I) > Right.Digest(I) then
return True;
elsif Left.Digest(I) < Right.Digest(I) then
return False;
end if;
end loop;
-- The only way we get here is when Left = Right
return False;
end ">";
---------
-- "=" --
---------
function "=" (Left, Right: SHA1_Hash) return Boolean is
begin
for I in Message_Digest'Range loop
if Left.Digest(I) /= Right.Digest(I) then
return False;
end if;
end loop;
return True;
end "=";
------------
-- Binary --
------------
function Binary (Value: SHA1_Hash) return Hash_Binary_Value is
I: Positive;
Register: Unsigned_32;
begin
return Output: Hash_Binary_Value (1 .. SHA1_Hash_Bytes) do
I := Output'First;
for Chunk of reverse Value.Digest loop -- Value.Digest big-endian
Register := Chunk;
for J in 1 .. 4 loop -- Four bytes per digest chunk
Output(I) := Unsigned_8 (Register and 16#FF#);
Register := Shift_Right (Register, 8);
I := I + 1;
end loop;
end loop;
end return;
end Binary;
--
-- SHA1_Engine
--
-----------
-- Write --
-----------
overriding procedure Write (Stream : in out SHA1_Engine;
Item : in Stream_Element_Array)
is
Last_In: Stream_Element_Offset;
begin
-- Check for a null range of Item and discard
if Item'Length = 0 then
return;
end if;
Last_In := Item'First - 1;
-- Finally, we can go ahead and add the message length to the Engine now,
-- since there are early-ending code-paths below, and so we can avoid
-- duplicating code. The only way this can really go wrong is if the
-- entire message is larger than the Message_Size, which SHA1 limits to a
-- 64-bit signed integer. Therefore a message of 16 exabytes will cause
-- an invalid hash, due to a wrap-around of the Message_Size.
-- That's a risk we are willing to take.
Stream.Message_Length
:= Stream.Message_Length + (Stream_Element'Size * Item'Length);
-- Our buffer has a size of 512 (the size of a "chunk" of processing for
-- the SHA-1 algorithm).
-- Our write should be automated so that as soon as that buffer is full
-- (no matter how much of the Item array is written already), the chunk is
-- processed
-- In order to take advantage of any processor vector copy features, we
-- will explicitly copy Item in chunks that are either the full size of
-- Item, 64 elements, or the remaining space in the hash Buffer, whichever
-- is largest
while Last_In < Item'Last loop
declare
subtype Buffer_Slice is Stream_Element_Offset range
Stream.Last_Element_Index + 1 .. Stream.Buffer'Last;
Buffer_Slice_Length: Stream_Element_Offset
:= Buffer_Slice'Last - Buffer_Slice'First + 1;
subtype Item_Slice is Stream_Element_Offset range
Last_In + 1 .. Item'Last;
Item_Slice_Length: Stream_Element_Offset
:= Item_Slice'Last - Item_Slice'First + 1;
begin
if Buffer_Slice_Length > Item_Slice_Length then
-- We can fit the rest in the buffer, with space left-over
declare
-- Set-up a specific slice in the Buffer which can accommodate
-- the remaining elements of Item
subtype Target_Slice is Stream_Element_Offset range
Buffer_Slice'First .. Buffer_Slice'First +
(Item_Slice'Last - Item_Slice'First);
begin
-- Here is the block copy
Stream.Buffer(Target_Slice'Range):= Item (Item_Slice'Range);
Stream.Last_Element_Index := Target_Slice'Last;
end;
-- That's it, we've absorbed the entire Item, no need to waste
-- time updating Last_In.
return;
else
-- This means the buffer space is either equal to or smaller than
-- the remaining Item elements, this means we need process the
-- chunk (digest the buffer) no matter what
-- First step is to copy in as much of the remaining Item
-- elements as possible
declare
subtype Source_Slice is Stream_Element_Offset range
Item_Slice'First
.. Item_Slice'First + Buffer_Slice_Length - 1;
begin
-- Block copy
Stream.Buffer(Buffer_Slice'Range)
:= Item (Source_Slice'Range);
Stream.Last_Element_Index := Buffer_Slice'Last;
Last_In := Source_Slice'Last;
end;
-- Now we digest the currently full buffer
Digest_Chunk (Stream);
end if;
end;
end loop;
end Write;
-----------
-- Reset --
-----------
overriding procedure Reset (Engine : in out SHA1_Engine) is
begin
Engine.Last_Element_Index := 0;
Engine.Message_Length := 0;
Engine.H0 := H0_Initial;
Engine.H1 := H1_Initial;
Engine.H2 := H2_Initial;
Engine.H3 := H3_Initial;
Engine.H4 := H4_Initial;
end Reset;
------------
-- Digest --
------------
overriding function Digest (Engine : in out SHA1_Engine)
return Hash'Class is
-- The core of the message digest algorithm occurs in-line with stream
-- writes through the Digest_Chunk procedure. The role of this function
-- is to append the message size and padding, and then execute the final
-- Digest_Chunk before returning the digest.
-- We work with the data in the Buffer in chunks of 512 bits
-- Once we get to the last section that is < 512 bits, we append
-- the 64 bit length and padding 0's
-- In most cases, this 64 bit + padding will all be in the last section
-- of the buffer
-- We pad up until the 448th bit (56th byte) and then add the length
-- However, we must also keep in mind the fringe case where the data ends
-- at bit position 448 or later (byte 56 or later)
-- In that case, the approach to take is to pad the final chunk, then add
-- a new one that is ONLY padding and the 64 bit length
Message_Length_Spliced : Stream_Element_Array(1 .. 8);
Special_Case_Index : Stream_Element_Offset := 0;
begin
-- Splitting the 64-bit message length into array of bytes
for I in 1 .. 8 loop
Message_Length_Spliced(Stream_Element_Offset(I)) :=
Stream_Element
(Unsigned_8(Shift_Right(Value => Engine.Message_Length,
Amount => 8 * (8 - I)) and 16#ff#));
end loop;
-- This is a while loop but we use an exit condition to make sure that it
-- executes at least once (for the case of empty hash message)
loop
if Special_Case_Index /= 0 then
if Special_Case_Index = 1 then
Engine.Buffer(1) := 2#10000000#;
else
Engine.Buffer(1) := 2#00000000#;
end if;
Engine.Buffer(2 .. 56) := (others => 2#00000000#);
Engine.Buffer(57 .. 64) := Message_Length_Spliced;
Special_Case_Index := 0;
-- If there is less than 512 bits left in the Buffer
else
-- The case where one chunk will hold Buffer + padding + 64 bits
if Engine.Last_Element_Index < 56 then
-- Add the correct amount of padding
Engine.Buffer(Engine.Last_Element_Index + 1) := 2#10000000#;
Engine.Buffer(Engine.Last_Element_Index + 2 .. 56) :=
(others => 2#00000000#);
-- Finish it off with Message_Length
Engine.Buffer(57 .. 64) := Message_Length_Spliced;
-- The case where one chunk will hold Buffer + padding, and
-- another will hold padding + 64 bit message length
else
-- Put what we can of the padding in the current chunk
Engine.Buffer(Engine.Last_Element_Index + 1) := 2#10000000#;
Engine.Buffer(Engine.Last_Element_Index + 2 .. 64) :=
(others => 2#00000000#);
-- Save where we left off in the padding for the next chunk
Special_Case_Index := 65 - Engine.Last_Element_Index;
end if;
end if;
Digest_Chunk (Engine);
exit when Engine.Last_Element_Index = 0 and Special_Case_Index = 0;
end loop;
return Result: SHA1_Hash do
Result.Digest := (1 => Engine.H0,
2 => Engine.H1,
3 => Engine.H2,
4 => Engine.H3,
5 => Engine.H4);
Engine.Reset;
end return;
end Digest;
end Modular_Hashing.SHA1;
|
Vovanium/stm32-ada | Ada | 15,244 | ads | with Interfaces;
package STM32.F4.RCC is
pragma Preelaborate;
-- CR
type Clock_Control_Register is record
HSION: Boolean;
HSIRDY: Boolean;
HSITRIM: Integer range 0 .. 2**5 - 1;
HSICAL: Integer range 0 .. 2**8 - 1;
HSEON: Boolean;
HSERDY: Boolean;
HSEBYP: Boolean;
CSSON: Boolean;
PLLON: Boolean;
PLLRDY: Boolean;
PLLI2SON: Boolean;
PLLI2SRDY: Boolean;
end record with Size => 32;
for Clock_Control_Register use record
HSION at 0 range 0 .. 0;
HSIRDY at 0 range 1 .. 1;
HSITRIM at 0 range 3 .. 7;
HSICAL at 0 range 8 .. 15;
HSEON at 0 range 16 .. 16;
HSERDY at 0 range 17 .. 17;
HSEBYP at 0 range 18 .. 18;
CSSON at 0 range 19 .. 19;
PLLON at 0 range 24 .. 24;
PLLRDY at 0 range 25 .. 25;
PLLI2SON at 0 range 26 .. 26;
PLLI2SRDY at 0 range 27 .. 27;
end record;
--- PLLCFGR
type PLL_Division_Factor is (
PLL_DIV_2,
PLL_DIV_4,
PLL_DIV_6,
PLL_DIV_8
);
for PLL_Division_Factor use (
PLL_DIV_2 => 2#00#,
PLL_DIV_4 => 2#01#,
PLL_DIV_6 => 2#10#,
PLL_DIV_8 => 2#11#
);
type PLL_Clock_Source is (
PLLSRC_HSI,
PLLSRC_HSE
);
for PLL_Clock_Source use (
PLLSRC_HSI => 0,
PLLSRC_HSE => 1
);
type PLL_Configuration_Register is record
PLLM: Integer range 2 .. 63;
PLLN: Integer range 50 .. 432;
PLLP: PLL_Division_Factor;
PLLSRC: PLL_Clock_Source;
PLLQ: Integer range 2 .. 15;
end record with Size => 32;
for PLL_Configuration_Register use record
PLLM at 0 range 0 .. 5;
PLLN at 0 range 6 .. 14;
PLLP at 0 range 16 .. 17;
PLLSRC at 0 range 22 .. 22;
PLLQ at 0 range 24 .. 27;
end record;
-- CFGR
type System_Clock_Switch is (
System_Clock_HSI,
System_Clock_HSE,
System_Clock_PLL
) with Size => 2;
for System_Clock_Switch use (
System_Clock_HSI => 2#00#,
System_Clock_HSE => 2#01#,
System_Clock_PLL => 2#10#
);
type AHB_Prescaler_Factor is (
AHB_Prescaler_1,
AHB_Prescaler_2,
AHB_Prescaler_4,
AHB_Prescaler_8,
AHB_Prescaler_16,
AHB_Prescaler_64,
AHB_Prescaler_128,
AHB_Prescaler_256,
AHB_Prescaler_512
) with Size => 4;
for AHB_Prescaler_Factor use (
AHB_Prescaler_1 => 2#0000#,
AHB_Prescaler_2 => 2#1000#,
AHB_Prescaler_4 => 2#1001#,
AHB_Prescaler_8 => 2#1010#,
AHB_Prescaler_16 => 2#1011#,
AHB_Prescaler_64 => 2#1100#,
AHB_Prescaler_128 => 2#1101#,
AHB_Prescaler_256 => 2#1110#,
AHB_Prescaler_512 => 2#1111#
);
type APB_Prescaler_Factor is (
APB_Prescaler_1,
APB_Prescaler_2,
APB_Prescaler_4,
APB_Prescaler_8,
APB_Prescaler_16
) with Size => 3;
for APB_Prescaler_Factor use (
APB_Prescaler_1 => 2#000#,
APB_Prescaler_2 => 2#100#,
APB_Prescaler_4 => 2#101#,
APB_Prescaler_8 => 2#110#,
APB_Prescaler_16 => 2#111#
);
type Clock_Output_1 is (
Clock_Output_1_HSI,
Clock_Output_1_LSE,
Clock_Output_1_HSE,
Clock_Output_1_PLL
) with Size => 2;
for Clock_Output_1 use (
Clock_Output_1_HSI => 2#00#,
Clock_Output_1_LSE => 2#01#,
Clock_Output_1_HSE => 2#10#,
Clock_Output_1_PLL => 2#11#
);
type I2S_Clock_Source is (
I2S_Clock_PLLI2S,
I2S_Clock_CLKIN
) with Size => 1;
for I2S_Clock_Source use (
I2S_Clock_PLLI2S => 0,
I2S_Clock_CLKIN => 1
);
type Clock_Output_Prescaler_Factor is (
MCO_Prescaler_1,
MCO_Prescaler_2,
MCO_Prescaler_3,
MCO_Prescaler_4,
MCO_Prescaler_5
) with Size => 3;
for Clock_Output_Prescaler_Factor use (
MCO_Prescaler_1 => 2#000#,
MCO_Prescaler_2 => 2#100#,
MCO_Prescaler_3 => 2#101#,
MCO_Prescaler_4 => 2#110#,
MCO_Prescaler_5 => 2#111#
);
type Clock_Output_2 is (
Clock_Output_2_SYSCLK,
Clock_Output_2_PLLI2S,
Clock_Output_2_HSE,
Clock_Output_2_PLL
) with Size => 2;
for Clock_Output_2 use (
Clock_Output_2_SYSCLK => 2#00#,
Clock_Output_2_PLLI2S => 2#01#,
Clock_Output_2_HSE => 2#10#,
Clock_Output_2_PLL => 2#11#
);
type Clock_Configuration_Register is record
SW: System_Clock_Switch;
SWS: System_Clock_Switch;
HPRE: AHB_Prescaler_Factor;
Reserved_8: Integer range 0 .. 3;
PPRE1: APB_Prescaler_Factor;
PPRE2: APB_Prescaler_Factor;
RTCPRE: Integer range 0 .. 31;
MCO1: Clock_Output_1;
I2SSCR: I2S_Clock_Source;
MCO1PRE: Clock_Output_Prescaler_Factor;
MCO2PRE: Clock_Output_Prescaler_Factor;
MCO2: Clock_Output_2;
end record with Size => 32;
for Clock_Configuration_Register use record
SW at 0 range 0 .. 1;
SWS at 0 range 2 .. 3;
HPRE at 0 range 4 .. 7;
Reserved_8 at 0 range 8 .. 9;
PPRE1 at 0 range 10 .. 12;
PPRE2 at 0 range 13 .. 15;
RTCPRE at 0 range 16 .. 20;
MCO1 at 0 range 21 .. 22;
I2SSCR at 0 range 23 .. 23;
MCO1PRE at 0 range 24 .. 26;
MCO2PRE at 0 range 27 .. 29;
MCO2 at 0 range 30 .. 31;
end record;
-- CIR
type Clock_Interrupt_Register is record
LSIRDYF: Boolean;
LSERDYF: Boolean;
HSIRDYF: Boolean;
HSERDYF: Boolean;
PLLRDYF: Boolean;
PLLI2SRDYF: Boolean;
Reserved_6: Integer range 0 .. 1;
CSSF: Boolean;
LSIRDYIE: Boolean;
LSERDYIE: Boolean;
HSIRDYIE: Boolean;
HSERDYIE: Boolean;
PLLRDYIE: Boolean;
PLLI2SRDYIE: Boolean;
Reserved_14: Integer range 0 .. 2**2 - 1;
LSIRDYC: Boolean;
LSERDYC: Boolean;
HSIRDYC: Boolean;
HSERDYC: Boolean;
PLLRDYC: Boolean;
PLLI2SRDYC: Boolean;
Reserved_22: Integer range 0 .. 1;
CSSC: Boolean;
Reserved_24: Integer range 0 .. 2**8 - 1;
end record with Size => 32;
for Clock_Interrupt_Register use record
LSIRDYF at 0 range 0 .. 0;
LSERDYF at 0 range 1 .. 1;
HSIRDYF at 0 range 2 .. 2;
HSERDYF at 0 range 3 .. 3;
PLLRDYF at 0 range 4 .. 4;
PLLI2SRDYF at 0 range 5 .. 5;
Reserved_6 at 0 range 6 .. 6;
CSSF at 0 range 7 .. 7;
LSIRDYIE at 0 range 8 .. 8;
LSERDYIE at 0 range 9 .. 9;
HSIRDYIE at 0 range 10 .. 10;
HSERDYIE at 0 range 11 .. 11;
PLLRDYIE at 0 range 12 .. 12;
PLLI2SRDYIE at 0 range 13 .. 13;
Reserved_14 at 0 range 14 .. 15;
LSIRDYC at 0 range 16 .. 16;
LSERDYC at 0 range 17 .. 17;
HSIRDYC at 0 range 18 .. 18;
HSERDYC at 0 range 19 .. 19;
PLLRDYC at 0 range 20 .. 20;
PLLI2SRDYC at 0 range 21 .. 21;
Reserved_22 at 0 range 22 .. 22;
CSSC at 0 range 23 .. 23;
Reserved_24 at 0 range 24 .. 31;
end record;
-- AHB1RSTR, AHB1ENR
type AHB1_Register is record
GPIOA: Boolean;
GPIOB: Boolean;
GPIOC: Boolean;
GPIOD: Boolean;
GPIOE: Boolean;
GPIOF: Boolean;
GPIOG: Boolean;
GPIOH: Boolean;
GPIOI: Boolean;
GPIOJ: Boolean;
GPIOK: Boolean;
CRC: Boolean;
FLITF: Boolean;
SRAM1: Boolean;
SRAM2: Boolean;
BKPSRAM: Boolean;
CCMDATARAM: Boolean;
DMA1: Boolean;
DMA2: Boolean;
DMA2D: Boolean;
ETHMAC: Boolean;
ETHMACTX: Boolean;
ETHMACRX: Boolean;
ETHMACPTP: Boolean;
OTGHS: Boolean;
OTGHSULPI: Boolean;
end record with Size => 32;
for AHB1_Register use record
GPIOA at 0 range 0 .. 0;
GPIOB at 0 range 1 .. 1;
GPIOC at 0 range 2 .. 2;
GPIOD at 0 range 3 .. 3;
GPIOE at 0 range 4 .. 4;
GPIOF at 0 range 5 .. 5;
GPIOG at 0 range 6 .. 6;
GPIOH at 0 range 7 .. 7;
GPIOI at 0 range 8 .. 8;
GPIOJ at 0 range 9 .. 9;
GPIOK at 0 range 10 .. 10;
CRC at 0 range 12 .. 12;
FLITF at 0 range 15 .. 15;
SRAM1 at 0 range 16 .. 16;
SRAM2 at 0 range 17 .. 17;
BKPSRAM at 0 range 18 .. 18;
CCMDATARAM at 0 range 20 .. 20;
DMA1 at 0 range 21 .. 21;
DMA2 at 0 range 22 .. 22;
DMA2D at 0 range 23 .. 23;
ETHMAC at 0 range 25 .. 25;
ETHMACTX at 0 range 26 .. 26;
ETHMACRX at 0 range 27 .. 27;
ETHMACPTP at 0 range 28 .. 28;
OTGHS at 0 range 29 .. 29;
OTGHSULPI at 0 range 30 .. 30;
end record;
-- AHB2RSTR, AHB2ENR
type AHB2_Register is record
DCMI: Boolean;
CRYP: Boolean;
HASH: Boolean;
RNG: Boolean;
OTGFS: Boolean;
end record with Size => 32;
for AHB2_Register use record
DCMI at 0 range 0 .. 0;
CRYP at 0 range 4 .. 4;
HASH at 0 range 5 .. 5;
RNG at 0 range 6 .. 6;
OTGFS at 0 range 7 .. 7;
end record;
-- AHB3RSTR, AHB3ENR
type AHB3_Register is record
FMC: Boolean;
end record with Size => 32;
for AHB3_Register use record
FMC at 0 range 0 .. 0;
end record;
-- APB1RSTR, APB1ENR
type APB1_Register is record
TIM2: Boolean;
TIM3: Boolean;
TIM4: Boolean;
TIM5: Boolean;
TIM6: Boolean;
TIM7: Boolean;
TIM12: Boolean;
TIM13: Boolean;
TIM14: Boolean;
WWDG: Boolean;
SPI2: Boolean;
SPI3: Boolean;
USART2: Boolean;
USART3: Boolean;
UART4: Boolean;
UART5: Boolean;
I2C1: Boolean;
I2C2: Boolean;
I2C3: Boolean;
CAN1: Boolean;
CAN2: Boolean;
PWR: Boolean;
DAC: Boolean;
UART7: Boolean;
UART8: Boolean;
end record with Size => 32;
for APB1_Register use record
TIM2 at 0 range 0 .. 0;
TIM3 at 0 range 1 .. 1;
TIM4 at 0 range 2 .. 2;
TIM5 at 0 range 3 .. 3;
TIM6 at 0 range 4 .. 4;
TIM7 at 0 range 5 .. 5;
TIM12 at 0 range 6 .. 6;
TIM13 at 0 range 7 .. 7;
TIM14 at 0 range 8 .. 8;
WWDG at 0 range 11 .. 11;
SPI2 at 0 range 14 .. 14;
SPI3 at 0 range 15 .. 15;
USART2 at 0 range 17 .. 17;
USART3 at 0 range 18 .. 18;
UART4 at 0 range 19 .. 19;
UART5 at 0 range 20 .. 20;
I2C1 at 0 range 21 .. 21;
I2C2 at 0 range 22 .. 22;
I2C3 at 0 range 23 .. 23;
CAN1 at 0 range 25 .. 25;
CAN2 at 0 range 26 .. 26;
PWR at 0 range 28 .. 28;
DAC at 0 range 29 .. 29;
UART7 at 0 range 30 .. 30;
UART8 at 0 range 31 .. 31;
end record;
-- APB2RSTR, APB2ENR
type APB2_Register is record
TIM1: Boolean;
TIM8: Boolean;
USART1: Boolean;
USART6: Boolean;
ADC1: Boolean; -- RST resets all ADCs
ADC2: Boolean;
ADC3: Boolean;
SDIO: Boolean;
SPI1: Boolean;
SPI4: Boolean;
SYSCFG: Boolean;
TIM9: Boolean;
TIM10: Boolean;
TIM11: Boolean;
SPI5: Boolean;
SPI6: Boolean;
SAI1: Boolean;
LTDC: Boolean;
end record with Size => 32;
for APB2_Register use record
TIM1 at 0 range 0 .. 0;
TIM8 at 0 range 1 .. 1;
USART1 at 0 range 4 .. 4;
USART6 at 0 range 5 .. 5;
ADC1 at 0 range 8 .. 8;
ADC2 at 0 range 9 .. 9;
ADC3 at 0 range 10 .. 10;
SDIO at 0 range 11 .. 11;
SPI1 at 0 range 12 .. 12;
SPI4 at 0 range 13 .. 13;
SYSCFG at 0 range 14 .. 14;
TIM9 at 0 range 16 .. 16;
TIM10 at 0 range 17 .. 17;
TIM11 at 0 range 18 .. 18;
SPI5 at 0 range 20 .. 20;
SPI6 at 0 range 21 .. 21;
SAI1 at 0 range 22 .. 22;
LTDC at 0 range 26 .. 26;
end record;
-- BCDR
type RTC_Clock_Source is (
RTC_Not_Clocked,
RTC_Clock_LSE,
RTC_Clock_LSI,
RTC_Clock_HSE
) with Size => 2;
for RTC_Clock_Source use (
RTC_Not_Clocked => 2#00#,
RTC_Clock_LSE => 2#01#,
RTC_Clock_LSI => 2#10#,
RTC_Clock_HSE => 2#11#
);
type Backup_Domain_Control_Register is record
LSEON: Boolean;
LSERDY: Boolean;
LSEBYP: Boolean;
Reserved_3: Integer range 0 .. 2**5 - 1;
RTCSEL: RTC_Clock_Source;
Reserved_10: Integer range 0 .. 2**5 - 1;
RTCEN: Boolean;
BDRST: Boolean;
Reserved_17: Integer range 0 .. 2**15 - 1;
end record with Size => 32;
for Backup_Domain_Control_Register use record
LSEON at 0 range 0 .. 0;
LSERDY at 0 range 1 .. 1;
LSEBYP at 0 range 2 .. 2;
Reserved_3 at 0 range 3 .. 7;
RTCSEL at 0 range 8 .. 9;
Reserved_10 at 0 range 10 .. 14;
RTCEN at 0 range 15 .. 15;
BDRST at 0 range 16 .. 16;
Reserved_17 at 0 range 17 .. 31;
end record;
-- CSR
type Clock_Control_and_Status_Register is record
LSION: Boolean;
LSIRDY: Boolean;
Reserved_2: Integer range 0 .. 2**22 - 1;
RMVF: Boolean;
BORRSTF: Boolean;
PINRSTF: Boolean;
PORRSTF: Boolean;
SFTRSTF: Boolean;
IWDGRSTF: Boolean;
WWDGRSTF: Boolean;
LPWRRSTF: Boolean;
end record with Size => 32;
for Clock_Control_and_Status_Register use record
LSION at 0 range 0 .. 0;
LSIRDY at 0 range 1 .. 1;
Reserved_2 at 0 range 2 .. 23;
RMVF at 0 range 24 .. 24;
BORRSTF at 0 range 25 .. 25;
PINRSTF at 0 range 26 .. 26;
PORRSTF at 0 range 27 .. 27;
SFTRSTF at 0 range 28 .. 28;
IWDGRSTF at 0 range 29 .. 29;
WWDGRSTF at 0 range 30 .. 30;
LPWRRSTF at 0 range 31 .. 31;
end record;
-- SSCGR
type Spread_Select is (
Center_Spread,
Down_Spread
) with Size => 1;
for Spread_Select use (
Center_Spread => 0,
Down_Spread => 1
);
type Spread_Spectrum_Clock_Generation_Register is record
MODPER: Integer range 0 .. 2**13 - 1;
INCSTEP: Integer range 0 .. 2**15 - 1;
Reserved_28: Integer range 0 .. 3;
SPREADSEL: Spread_Select;
SSCGEN: Boolean;
end record with Size => 32;
for Spread_Spectrum_Clock_Generation_Register use record
MODPER at 0 range 0 .. 12;
INCSTEP at 0 range 13 .. 27;
Reserved_28 at 0 range 28 .. 29;
SPREADSEL at 0 range 30 .. 30;
SSCGEN at 0 range 31 .. 31;
end record;
-- PLLI2SCFGR
type PLLI2S_Configuration_Register is record
Reserved_0: Integer range 0 .. 2**6 - 1;
PLLI2SN: Integer range 2 .. 432;
Reserved_15: Integer range 0 .. 2**13 - 1;
PLLI2SR: Integer range 2 .. 7;
Reserved_31: Integer range 0 .. 1;
end record with Size => 32;
for PLLI2S_Configuration_Register use record
Reserved_0 at 0 range 0 .. 5;
PLLI2SN at 0 range 6 .. 14;
Reserved_15 at 0 range 15 .. 27;
PLLI2SR at 0 range 28 .. 30;
Reserved_31 at 0 range 31 .. 31;
end record;
type RCC_Registers is record
CR: Clock_Control_Register;
PLLCFGR: PLL_Configuration_Register;
CFGR: Clock_Configuration_Register;
CIR: Clock_Interrupt_Register;
AHB1RSTR: AHB1_Register;
AHB2RSTR: AHB2_Register;
AHB3RSTR: AHB3_Register;
APB1RSTR: APB1_Register;
APB2RSTR: APB2_Register;
AHB1ENR: AHB1_Register;
AHB2ENR: AHB2_Register;
AHB3ENR: AHB3_Register;
APB1ENR: APB1_Register;
APB2ENR: APB2_Register;
AHB1LPENR: AHB1_Register;
AHB2LPENR: AHB2_Register;
AHB3LPENR: AHB3_Register;
APB1LPENR: APB1_Register;
APB2LPENR: APB2_Register;
BDCR: Backup_Domain_Control_Register;
CSR: Clock_Control_and_Status_Register;
SSCGR: Spread_Spectrum_Clock_Generation_Register;
PLLI2SCFGR: PLLI2S_Configuration_Register;
end record with Volatile;
for RCC_Registers use record
CR at 16#00# range 0 .. 31;
PLLCFGR at 16#04# range 0 .. 31;
CFGR at 16#08# range 0 .. 31;
CIR at 16#0C# range 0 .. 31;
AHB1RSTR at 16#10# range 0 .. 31;
AHB2RSTR at 16#14# range 0 .. 31;
AHB3RSTR at 16#18# range 0 .. 31;
APB1RSTR at 16#20# range 0 .. 31;
APB2RSTR at 16#24# range 0 .. 31;
AHB1ENR at 16#30# range 0 .. 31;
AHB2ENR at 16#34# range 0 .. 31;
AHB3ENR at 16#38# range 0 .. 31;
APB1ENR at 16#40# range 0 .. 31;
APB2ENR at 16#44# range 0 .. 31;
AHB1LPENR at 16#50# range 0 .. 31;
AHB2LPENR at 16#54# range 0 .. 31;
AHB3LPENR at 16#58# range 0 .. 31;
APB1LPENR at 16#60# range 0 .. 31;
APB2LPENR at 16#64# range 0 .. 31;
BDCR at 16#70# range 0 .. 31;
CSR at 16#74# range 0 .. 31;
SSCGR at 16#80# range 0 .. 31;
PLLI2SCFGR at 16#84# range 0 .. 31;
end record;
end STM32.F4.RCC;
|
AdaCore/langkit | Ada | 256 | ads | package Libfoolang.Implementation.Extensions is
function Foo_Node_P_Trigger_Unit_Requested
(Node : Bare_Foo_Node;
Name : Symbol_Type;
Found : Boolean;
Error : Boolean) return Boolean;
end Libfoolang.Implementation.Extensions;
|
eryjus/ada | Ada | 1,816 | ads | --===================================================================================================================
-- scanner.ads
--
-- This file contains the a sample of the lexical components we need to be able to recognize and convert
-- into tokens.
--===================================================================================================================
--
-- -- These examples are from the Ada Specification
-- ---------------------------------------------
& ' ( ) * + , - . / : ; < = > |
=> .. ** := /= >= <= << >> <>
Count X Get_Symbol Ethelyn Marion
Snobol_4 X1 Page_Count Store_Next_Item
Πλάτων -- Plato
Чайковский -- Tchaikovsky
θ φ -- Angles
12 0 1E6 123_456 -- integer literals
12.0 0.0 0.456 3.14159_26 -- real literals
2#1111_1111# 16#FF# 016#0ff# -- integer literals of value 255
16#E#E1 2#1110_0000# -- integer literals of value 224
16#F.FF#E+2 2#1.1111_1111_1110#E11 -- real literals of value 4095.0
'A' '*' ''' ' ' 'L' 'Л' 'Λ' -- Various els.
'∞' 'א' -- Big numbers - infinity and aleph.
"Message of the day:"
"" -- a null string literal
" " "A" """" -- three string literals of length 1
"Characters such as $, %, and } are allowed in string literals"
"Archimedes said ""Εύρηκα"""
"Volume of cylinder (πr2h) = "
abort
else
new
return
abs
elsif
not
reverse
abstract
end
null
select
accept
entry
of
separate
access
exception
or
some
aliased
exit
others
subtype
all
for
out
synchronized
and
function
overriding
array
tagged
at
generic
package
task
goto
pragma
terminate
begin
private
then
body
if
procedure
type
in
case
protected
interface
until
constant
is
raise
use
declare
range
limited
when
delay
record
loop
while
delta
rem
with
digits
mod
renames
do
requeue
xor
|
tum-ei-rcs/StratoX | Ada | 18,055 | ads | -- This spec has been automatically generated from STM32F429x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
with HAL;
with System;
package STM32_SVD.DMA2D is
pragma Preelaborate;
---------------
-- Registers --
---------------
-----------------
-- CR_Register --
-----------------
subtype CR_MODE_Field is HAL.UInt2;
-- control register
type CR_Register is record
-- Start
START : Boolean := False;
-- Suspend
SUSP : Boolean := False;
-- Abort
ABORT_k : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
-- Transfer error interrupt enable
TEIE : Boolean := False;
-- Transfer complete interrupt enable
TCIE : Boolean := False;
-- Transfer watermark interrupt enable
TWIE : Boolean := False;
-- CLUT access error interrupt enable
CAEIE : Boolean := False;
-- CLUT transfer complete interrupt enable
CTCIE : Boolean := False;
-- Configuration Error Interrupt Enable
CEIE : Boolean := False;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- DMA2D mode
MODE : CR_MODE_Field := 16#0#;
-- unspecified
Reserved_18_31 : HAL.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
START at 0 range 0 .. 0;
SUSP at 0 range 1 .. 1;
ABORT_k at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
TEIE at 0 range 8 .. 8;
TCIE at 0 range 9 .. 9;
TWIE at 0 range 10 .. 10;
CAEIE at 0 range 11 .. 11;
CTCIE at 0 range 12 .. 12;
CEIE at 0 range 13 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
MODE at 0 range 16 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
------------------
-- ISR_Register --
------------------
-- Interrupt Status Register
type ISR_Register is record
-- Read-only. Transfer error interrupt flag
TEIF : Boolean;
-- Read-only. Transfer complete interrupt flag
TCIF : Boolean;
-- Read-only. Transfer watermark interrupt flag
TWIF : Boolean;
-- Read-only. CLUT access error interrupt flag
CAEIF : Boolean;
-- Read-only. CLUT transfer complete interrupt flag
CTCIF : Boolean;
-- Read-only. Configuration error interrupt flag
CEIF : Boolean;
-- unspecified
Reserved_6_31 : HAL.UInt26;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
TEIF at 0 range 0 .. 0;
TCIF at 0 range 1 .. 1;
TWIF at 0 range 2 .. 2;
CAEIF at 0 range 3 .. 3;
CTCIF at 0 range 4 .. 4;
CEIF at 0 range 5 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
-------------------
-- IFCR_Register --
-------------------
-- interrupt flag clear register
type IFCR_Register is record
-- Clear Transfer error interrupt flag
CTEIF : Boolean := False;
-- Clear transfer complete interrupt flag
CTCIF : Boolean := False;
-- Clear transfer watermark interrupt flag
CTWIF : Boolean := False;
-- Clear CLUT access error interrupt flag
CAECIF : Boolean := False;
-- Clear CLUT transfer complete interrupt flag
CCTCIF : Boolean := False;
-- Clear configuration error interrupt flag
CCEIF : Boolean := False;
-- unspecified
Reserved_6_31 : HAL.UInt26 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IFCR_Register use record
CTEIF at 0 range 0 .. 0;
CTCIF at 0 range 1 .. 1;
CTWIF at 0 range 2 .. 2;
CAECIF at 0 range 3 .. 3;
CCTCIF at 0 range 4 .. 4;
CCEIF at 0 range 5 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
-------------------
-- FGOR_Register --
-------------------
subtype FGOR_LO_Field is HAL.UInt14;
-- foreground offset register
type FGOR_Register is record
-- Line offset
LO : FGOR_LO_Field := 16#0#;
-- unspecified
Reserved_14_31 : HAL.UInt18 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FGOR_Register use record
LO at 0 range 0 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
-------------------
-- BGOR_Register --
-------------------
subtype BGOR_LO_Field is HAL.UInt14;
-- background offset register
type BGOR_Register is record
-- Line offset
LO : BGOR_LO_Field := 16#0#;
-- unspecified
Reserved_14_31 : HAL.UInt18 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BGOR_Register use record
LO at 0 range 0 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
----------------------
-- FGPFCCR_Register --
----------------------
subtype FGPFCCR_CM_Field is HAL.UInt4;
subtype FGPFCCR_CS_Field is HAL.Byte;
subtype FGPFCCR_AM_Field is HAL.UInt2;
subtype FGPFCCR_ALPHA_Field is HAL.Byte;
-- foreground PFC control register
type FGPFCCR_Register is record
-- Color mode
CM : FGPFCCR_CM_Field := 16#0#;
-- CLUT color mode
CCM : Boolean := False;
-- Start
START : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- CLUT size
CS : FGPFCCR_CS_Field := 16#0#;
-- Alpha mode
AM : FGPFCCR_AM_Field := 16#0#;
-- unspecified
Reserved_18_23 : HAL.UInt6 := 16#0#;
-- Alpha value
ALPHA : FGPFCCR_ALPHA_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FGPFCCR_Register use record
CM at 0 range 0 .. 3;
CCM at 0 range 4 .. 4;
START at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
CS at 0 range 8 .. 15;
AM at 0 range 16 .. 17;
Reserved_18_23 at 0 range 18 .. 23;
ALPHA at 0 range 24 .. 31;
end record;
---------------------
-- FGCOLR_Register --
---------------------
subtype FGCOLR_BLUE_Field is HAL.Byte;
subtype FGCOLR_GREEN_Field is HAL.Byte;
subtype FGCOLR_RED_Field is HAL.Byte;
-- foreground color register
type FGCOLR_Register is record
-- Blue Value
BLUE : FGCOLR_BLUE_Field := 16#0#;
-- Green Value
GREEN : FGCOLR_GREEN_Field := 16#0#;
-- Red Value
RED : FGCOLR_RED_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.Byte := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FGCOLR_Register use record
BLUE at 0 range 0 .. 7;
GREEN at 0 range 8 .. 15;
RED at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
----------------------
-- BGPFCCR_Register --
----------------------
subtype BGPFCCR_CM_Field is HAL.UInt4;
subtype BGPFCCR_CS_Field is HAL.Byte;
subtype BGPFCCR_AM_Field is HAL.UInt2;
subtype BGPFCCR_ALPHA_Field is HAL.Byte;
-- background PFC control register
type BGPFCCR_Register is record
-- Color mode
CM : BGPFCCR_CM_Field := 16#0#;
-- CLUT Color mode
CCM : Boolean := False;
-- Start
START : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- CLUT size
CS : BGPFCCR_CS_Field := 16#0#;
-- Alpha mode
AM : BGPFCCR_AM_Field := 16#0#;
-- unspecified
Reserved_18_23 : HAL.UInt6 := 16#0#;
-- Alpha value
ALPHA : BGPFCCR_ALPHA_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BGPFCCR_Register use record
CM at 0 range 0 .. 3;
CCM at 0 range 4 .. 4;
START at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
CS at 0 range 8 .. 15;
AM at 0 range 16 .. 17;
Reserved_18_23 at 0 range 18 .. 23;
ALPHA at 0 range 24 .. 31;
end record;
---------------------
-- BGCOLR_Register --
---------------------
subtype BGCOLR_BLUE_Field is HAL.Byte;
subtype BGCOLR_GREEN_Field is HAL.Byte;
subtype BGCOLR_RED_Field is HAL.Byte;
-- background color register
type BGCOLR_Register is record
-- Blue Value
BLUE : BGCOLR_BLUE_Field := 16#0#;
-- Green Value
GREEN : BGCOLR_GREEN_Field := 16#0#;
-- Red Value
RED : BGCOLR_RED_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.Byte := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BGCOLR_Register use record
BLUE at 0 range 0 .. 7;
GREEN at 0 range 8 .. 15;
RED at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
---------------------
-- OPFCCR_Register --
---------------------
subtype OPFCCR_CM_Field is HAL.UInt3;
-- output PFC control register
type OPFCCR_Register is record
-- Color mode
CM : OPFCCR_CM_Field := 16#0#;
-- unspecified
Reserved_3_31 : HAL.UInt29 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPFCCR_Register use record
CM at 0 range 0 .. 2;
Reserved_3_31 at 0 range 3 .. 31;
end record;
--------------------
-- OCOLR_Register --
--------------------
subtype OCOLR_BLUE_Field is HAL.Byte;
subtype OCOLR_GREEN_Field is HAL.Byte;
subtype OCOLR_RED_Field is HAL.Byte;
subtype OCOLR_APLHA_Field is HAL.Byte;
-- output color register
type OCOLR_Register is record
-- Blue Value
BLUE : OCOLR_BLUE_Field := 16#0#;
-- Green Value
GREEN : OCOLR_GREEN_Field := 16#0#;
-- Red Value
RED : OCOLR_RED_Field := 16#0#;
-- Alpha Channel Value
APLHA : OCOLR_APLHA_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OCOLR_Register use record
BLUE at 0 range 0 .. 7;
GREEN at 0 range 8 .. 15;
RED at 0 range 16 .. 23;
APLHA at 0 range 24 .. 31;
end record;
------------------
-- OOR_Register --
------------------
subtype OOR_LO_Field is HAL.UInt14;
-- output offset register
type OOR_Register is record
-- Line Offset
LO : OOR_LO_Field := 16#0#;
-- unspecified
Reserved_14_31 : HAL.UInt18 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OOR_Register use record
LO at 0 range 0 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
------------------
-- NLR_Register --
------------------
subtype NLR_NL_Field is HAL.Short;
subtype NLR_PL_Field is HAL.UInt14;
-- number of line register
type NLR_Register is record
-- Number of lines
NL : NLR_NL_Field := 16#0#;
-- Pixel per lines
PL : NLR_PL_Field := 16#0#;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for NLR_Register use record
NL at 0 range 0 .. 15;
PL at 0 range 16 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
------------------
-- LWR_Register --
------------------
subtype LWR_LW_Field is HAL.Short;
-- line watermark register
type LWR_Register is record
-- Line watermark
LW : LWR_LW_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LWR_Register use record
LW at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
--------------------
-- AMTCR_Register --
--------------------
subtype AMTCR_DT_Field is HAL.Byte;
-- AHB master timer configuration register
type AMTCR_Register is record
-- Enable
EN : Boolean := False;
-- unspecified
Reserved_1_7 : HAL.UInt7 := 16#0#;
-- Dead Time
DT : AMTCR_DT_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AMTCR_Register use record
EN at 0 range 0 .. 0;
Reserved_1_7 at 0 range 1 .. 7;
DT at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
---------------------
-- FGCLUT_Register --
---------------------
subtype FGCLUT_BLUE_Field is HAL.Byte;
subtype FGCLUT_GREEN_Field is HAL.Byte;
subtype FGCLUT_RED_Field is HAL.Byte;
subtype FGCLUT_APLHA_Field is HAL.Byte;
-- FGCLUT
type FGCLUT_Register is record
-- BLUE
BLUE : FGCLUT_BLUE_Field := 16#0#;
-- GREEN
GREEN : FGCLUT_GREEN_Field := 16#0#;
-- RED
RED : FGCLUT_RED_Field := 16#0#;
-- APLHA
APLHA : FGCLUT_APLHA_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FGCLUT_Register use record
BLUE at 0 range 0 .. 7;
GREEN at 0 range 8 .. 15;
RED at 0 range 16 .. 23;
APLHA at 0 range 24 .. 31;
end record;
---------------------
-- BGCLUT_Register --
---------------------
subtype BGCLUT_BLUE_Field is HAL.Byte;
subtype BGCLUT_GREEN_Field is HAL.Byte;
subtype BGCLUT_RED_Field is HAL.Byte;
subtype BGCLUT_APLHA_Field is HAL.Byte;
-- BGCLUT
type BGCLUT_Register is record
-- BLUE
BLUE : BGCLUT_BLUE_Field := 16#0#;
-- GREEN
GREEN : BGCLUT_GREEN_Field := 16#0#;
-- RED
RED : BGCLUT_RED_Field := 16#0#;
-- APLHA
APLHA : BGCLUT_APLHA_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BGCLUT_Register use record
BLUE at 0 range 0 .. 7;
GREEN at 0 range 8 .. 15;
RED at 0 range 16 .. 23;
APLHA at 0 range 24 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- DMA2D controller
type DMA2D_Peripheral is record
-- control register
CR : CR_Register;
-- Interrupt Status Register
ISR : ISR_Register;
-- interrupt flag clear register
IFCR : IFCR_Register;
-- foreground memory address register
FGMAR : HAL.Word;
-- foreground offset register
FGOR : FGOR_Register;
-- background memory address register
BGMAR : HAL.Word;
-- background offset register
BGOR : BGOR_Register;
-- foreground PFC control register
FGPFCCR : FGPFCCR_Register;
-- foreground color register
FGCOLR : FGCOLR_Register;
-- background PFC control register
BGPFCCR : BGPFCCR_Register;
-- background color register
BGCOLR : BGCOLR_Register;
-- foreground CLUT memory address register
FGCMAR : HAL.Word;
-- background CLUT memory address register
BGCMAR : HAL.Word;
-- output PFC control register
OPFCCR : OPFCCR_Register;
-- output color register
OCOLR : OCOLR_Register;
-- output memory address register
OMAR : HAL.Word;
-- output offset register
OOR : OOR_Register;
-- number of line register
NLR : NLR_Register;
-- line watermark register
LWR : LWR_Register;
-- AHB master timer configuration register
AMTCR : AMTCR_Register;
-- FGCLUT
FGCLUT : FGCLUT_Register;
-- BGCLUT
BGCLUT : BGCLUT_Register;
end record
with Volatile;
for DMA2D_Peripheral use record
CR at 0 range 0 .. 31;
ISR at 4 range 0 .. 31;
IFCR at 8 range 0 .. 31;
FGMAR at 12 range 0 .. 31;
FGOR at 16 range 0 .. 31;
BGMAR at 20 range 0 .. 31;
BGOR at 24 range 0 .. 31;
FGPFCCR at 28 range 0 .. 31;
FGCOLR at 32 range 0 .. 31;
BGPFCCR at 36 range 0 .. 31;
BGCOLR at 40 range 0 .. 31;
FGCMAR at 44 range 0 .. 31;
BGCMAR at 48 range 0 .. 31;
OPFCCR at 52 range 0 .. 31;
OCOLR at 56 range 0 .. 31;
OMAR at 60 range 0 .. 31;
OOR at 64 range 0 .. 31;
NLR at 68 range 0 .. 31;
LWR at 72 range 0 .. 31;
AMTCR at 76 range 0 .. 31;
FGCLUT at 1024 range 0 .. 31;
BGCLUT at 2048 range 0 .. 31;
end record;
-- DMA2D controller
DMA2D_Periph : aliased DMA2D_Peripheral
with Import, Address => DMA2D_Base;
end STM32_SVD.DMA2D;
|
Fabien-Chouteau/motherlode | Ada | 1,490 | ads | -- Motherlode
-- Copyright (c) 2020 Fabien Chouteau
with GESTE;
with GESTE.Physics;
with HAL;
with Parameters;
with World;
package Player is
procedure Spawn;
procedure Move (Pt : GESTE.Pix_Point);
function Position return GESTE.Pix_Point;
function Quantity (Kind : World.Valuable_Cell) return Natural;
procedure Drop (Kind : World.Valuable_Cell);
function Level (Kind : Parameters.Equipment)
return Parameters.Equipment_Level;
procedure Upgrade (Kind : Parameters.Equipment);
function Money return Natural;
procedure Update;
procedure Draw_Hud (FB : in out HAL.UInt16_Array);
procedure Move_Up;
procedure Move_Down;
procedure Move_Left;
procedure Move_Right;
procedure Drill;
private
type Cargo_Array is array (World.Valuable_Cell) of Natural;
type Equip_Array is array (Parameters.Equipment) of Parameters.Equipment_Level;
type Player_Type
is limited new GESTE.Physics.Object with record
Money : Natural := 0;
Fuel : Float := 5.0;
Cargo : Cargo_Array := (others => 0);
Cargo_Sum : Natural := 0;
Equip_Level : Equip_Array := (others => 1);
Cash_In : Integer := 0;
Cash_In_TTL : Natural := 0;
end record;
procedure Put_In_Cargo (This : in out Player_Type;
Kind : World.Valuable_Cell);
procedure Empty_Cargo (This : in out Player_Type);
procedure Refuel (This : in out Player_Type);
end Player;
|
charlie5/aShell | Ada | 21,644 | adb | with
GNAT.OS_Lib,
Ada.Strings.Fixed,
Ada.Strings.Maps,
Ada.Unchecked_Deallocation,
Ada.Unchecked_Conversion;
package body Shell.Commands
is
--- Strings
--
function To_String_Vector (Strings : String_Array) return String_Vector
is
use String_Vectors;
Vector : String_Vector;
begin
for Each of Strings
loop
Vector.Append (Each);
end loop;
return Vector;
end To_String_Vector;
function To_String_Array (Strings : String_Vector) return String_Array
is
use String_Vectors;
The_Array : String_Array (1 .. Natural (Strings.Length));
begin
for i in The_Array'Range
loop
The_Array (i) := Strings.Element (i);
end loop;
return The_Array;
end To_String_Array;
function To_Arguments (All_Arguments : in String) return String_Array
is
use GNAT.OS_Lib;
Command_Name : constant String := "Command_Name"; -- 'Argument_String_To_List' expects the command name to be
-- the 1st piece of the string, so we provide a dummy name.
Arguments : Argument_List_Access := Argument_String_To_List (Command_Name & " " & All_Arguments);
Result : String_Array (1 .. Arguments'Length - 1);
begin
for i in Result'Range
loop
Result (i) := +Arguments (i + 1).all;
end loop;
Free (Arguments);
return Result;
end To_Arguments;
--- Commands
--
function Image (The_Command : in Command) return String
is
use String_Vectors;
Result : Unbounded_String;
begin
Append (Result, "(" & The_Command.Name & ", (");
for Each of The_Command.Arguments
loop
Append (Result, Each);
if Each = Last_Element (The_Command.Arguments)
then
Append (Result, ")");
else
Append (Result, ", ");
end if;
end loop;
-- Append (Result, ", Input_Pipe => " & Image (The_Command.Input_Pipe));
-- Append (Result, ", Output_Pipe => " & Image (The_Command.Output_Pipe));
-- Append (Result, ", Error_Pipe => " & Image (The_Command.Error_Pipe));
Append (Result, ")");
return To_String (Result);
end Image;
function To_Command_Lines (Pipeline : in String) return String_Array
is
use Ada.Strings.Fixed;
Cursor : Positive := Pipeline'First;
First,
Last : Positive;
Count : Natural := 0;
Max_Commands_In_Pipeline : constant := 50; -- Arbitrary.
Result : String_Array (1 .. Max_Commands_In_Pipeline);
begin
loop
Find_Token (Source => Pipeline,
Set => Ada.Strings.Maps.To_Set ('|'),
From => Cursor,
Test => Ada.Strings.Outside,
First => First,
Last => Last);
declare
Full_Command : constant String := Trim (Pipeline (First .. Last),
Ada.Strings.Both);
begin
Count := Count + 1;
Result (Count) := +Full_Command;
end;
exit when Last = Pipeline'Last;
Cursor := Last + 1;
end loop;
return Result (1 .. Count);
end To_Command_Lines;
procedure Define (The_Command : out Command; Command_Line : in String)
is
use Ada.Strings.Fixed;
I : constant Natural := Index (Command_Line, " ");
begin
The_Command.Copy_Count := new Count' (1);
if I = 0
then
The_Command.Name := +Command_Line;
return;
end if;
declare
Name : constant String := Command_Line (Command_Line'First .. I - 1);
Arguments : constant String_Array := To_Arguments (Command_Line (I + 1 .. Command_Line'Last));
begin
The_Command.Name := +(Name);
The_Command.Arguments := To_String_Vector (Arguments);
end;
end Define;
-- package body Forge
-- is
--
-- function To_Command (Command_Line : in String) return Command
-- is
-- begin
-- return Result : Command
-- do
-- Define (Result, Command_Line);
-- end return;
-- end to_Command;
--
--
--
-- function To_Commands (Pipeline : in String) return Command_Array
-- is
-- All_Commands : constant String_Array := To_Command_Lines (Pipeline);
-- begin
-- return Result : Command_Array (1 .. All_Commands'Length)
-- do
-- for i in 1 .. All_Commands'Length
-- loop
-- Define ( Result (i),
-- +All_Commands (i));
-- end loop;
-- end return;
-- end To_Commands;
--
-- end Forge;
-- procedure Connect (From, To : in out Command)
-- is
-- Pipe : constant Shell.Pipe := To_Pipe;
-- begin
-- From.Output_Pipe := Pipe;
-- To. Input_Pipe := Pipe;
--
-- From.Owns_Input_Pipe := True;
-- To. Owns_Output_Pipe := True;
-- end Connect;
-- procedure Connect (Commands : in out Command_Array)
-- is
-- begin
-- for i in Commands'First .. Commands'Last - 1
-- loop
-- Connect (From => Commands (i),
-- To => Commands (i + 1));
-- end loop;
-- end Connect;
-- procedure Close_Pipe_Write_Ends (The_Command : in out Command)
-- is
-- begin
-- if The_Command.Output_Pipe /= Standard_Output
-- then
-- Close_Write_End (The_Command.Output_Pipe);
-- end if;
--
-- if The_Command.Error_Pipe /= Standard_Error
-- then
-- Close_Write_End (The_Command.Error_Pipe);
-- end if;
-- end Close_Pipe_Write_Ends;
-- function Input_Pipe (The_Command : in Command) return Pipe
-- is
-- begin
-- return The_Command.Input_Pipe;
-- end Input_Pipe;
-- function Output_Pipe (The_Command : in Command) return Pipe
-- is
-- begin
-- return The_Command.Output_Pipe;
-- end Output_Pipe;
-- function Error_Pipe (The_Command : in Command) return Pipe
-- is
-- begin
-- return The_Command.Error_Pipe;
-- end Error_Pipe;
function Name (The_Command : in Command) return String
is
begin
return +The_Command.Name;
end Name;
function Arguments (The_Command : in Command) return String
is
All_Arguments : Unbounded_String;
Last : constant Natural := Natural (The_Command.Arguments.Length);
begin
for i in 1 .. Last
loop
Append (All_Arguments, The_Command.Arguments.Element (i));
if i /= Last
then
Append (All_Arguments, " ");
end if;
end loop;
return To_String (All_Arguments);
end Arguments;
-- function Process (The_Command : in out Command) return access Shell.Process
-- is
-- begin
-- return The_Command.Process'Unchecked_Access;
-- end Process;
--- Start
--
-- procedure Start (The_Command : in out Command;
-- Input : in Data := No_Data;
-- Pipeline : in Boolean := False)
-- is
-- begin
-- if Input /= No_Data
-- then
-- The_Command.Input_Pipe := To_Pipe;
-- Write_To (The_Command.Input_Pipe, Input);
-- end if;
--
-- if The_Command.Output_Pipe = Null_Pipe
-- then
-- The_Command.Owns_Output_Pipe := True;
-- The_Command.Output_Pipe := To_Pipe (Blocking => False);
-- end if;
--
-- if The_Command.Error_Pipe = Null_Pipe
-- then
-- The_Command. Error_Pipe := To_Pipe (Blocking => False);
-- end if;
--
-- The_Command.Process := Start (Program => +The_Command.Name,
-- Arguments => To_String_Array (The_Command.Arguments),
-- Input => The_Command.Input_Pipe,
-- Output => The_Command.Output_Pipe,
-- Errors => The_Command.Error_Pipe,
-- Pipeline => Pipeline);
-- end Start;
-- procedure Start (Commands : in out Command_Array;
-- Input : in Data := No_Data;
-- Pipeline : in Boolean := True)
-- is
-- begin
-- if not Pipeline
-- then
-- for Each of Commands
-- loop
-- Start (Each, Input);
-- end loop;
--
-- return;
-- end if;
--
-- Connect (Commands);
--
-- for i in Commands'Range
-- loop
-- if i = Commands'First
-- then
-- Start (Commands (i),
-- Input,
-- Pipeline => True);
-- else
-- Start (Commands (i),
-- Pipeline => True);
-- end if;
--
-- -- Since we are making a pipeline, we need to close the write ends of
-- -- the Output & Errors pipes ourselves.
-- --
-- if i /= Commands'First
-- then
-- Close_Pipe_Write_Ends (Commands (i - 1)); -- Close ends for the prior command.
-- end if;
--
-- end loop;
--
-- Close_Pipe_Write_Ends (Commands (Commands'Last)); -- Close ends for the final command.
-- end Start;
-- procedure Send (To : in Command;
-- Input : in Data)
-- is
-- begin
-- Write_To (To.Input_Pipe, Input);
-- end Send;
--- Run
--
-- procedure Gather_Results (The_Command : in out Command)
-- is
-- begin
-- declare
-- The_Output : constant Data := Output_Of (The_Command.Output_Pipe);
-- begin
-- if The_Output'Length /= 0
-- then
-- The_Command.Output.Append (The_Output);
-- end if;
-- end;
--
-- declare
-- The_Errors : constant Data := Output_Of (The_Command.Error_Pipe);
-- begin
-- if The_Errors'Length /= 0
-- then
-- The_Command.Errors.Append (The_Errors);
-- end if;
-- end;
-- end Gather_Results;
-- procedure Run (The_Command : in out Command;
-- Input : in Data := No_Data;
-- Raise_Error : in Boolean := False)
-- is
-- begin
-- Start (The_Command, Input);
--
-- loop
-- Gather_Results (The_Command); -- Gather on-going results.
-- exit when Has_Terminated (The_Command.Process);
-- end loop;
--
-- Gather_Results (The_Command); -- Gather any final results.
--
-- if not Normal_Exit (The_Command.Process)
-- and Raise_Error
-- then
-- declare
-- Error : constant String := +Output_Of (The_Command.Error_Pipe);
-- begin
-- raise Command_Error with Error;
-- end;
-- end if;
-- end Run;
function Run (The_Command : in out Command'Class;
Input : in Data := No_Data;
Raise_Error : in Boolean := False) return Command_Results
is
begin
Run (The_Command, Input, Raise_Error);
return Results_Of (The_Command);
end Run;
-- procedure Run (The_Pipeline : in out Command_Array;
-- Input : in Data := No_Data;
-- Raise_Error : in Boolean := False)
-- is
-- Last_Command : Command renames The_Pipeline (The_Pipeline'Last);
-- i : Positive := 1;
-- begin
-- Last_Command.Output_Pipe := To_Pipe;
--
-- Start (The_Pipeline, Input);
--
-- loop
-- Gather_Results (Last_Command); -- Gather on-going results.
--
-- if Has_Terminated (The_Pipeline (i).Process)
-- then
-- if Normal_Exit (The_Pipeline (i).Process)
-- then
-- i := i + 1;
--
-- if i > The_Pipeline'Last
-- then
-- Gather_Results (Last_Command); -- Gather any final results.
-- exit;
-- end if;
--
-- else
-- declare
-- Error : constant String := "Pipeline command" & Integer'Image (i)
-- & " '" & (+The_Pipeline (i).Name) & "' failed.";
-- begin
-- -- Stop the pipeline.
-- --
-- while i <= The_Pipeline'Last
-- loop
-- Stop (The_Pipeline (i));
-- i := i + 1;
-- end loop;
--
-- if Raise_Error
-- then
-- raise Command_Error with Error;
-- else
-- exit;
-- end if;
-- end;
-- end if;
-- end if;
-- end loop;
-- end Run;
-- function Run (The_Pipeline : in out Command_Array;
-- Input : in Data := No_Data;
-- Raise_Error : in Boolean := False) return Command_Results
-- is
-- Last_Command : Command renames The_Pipeline (The_Pipeline'Last);
-- begin
-- Run (The_Pipeline, Input, Raise_Error);
--
-- return Results_Of (Last_Command);
-- end Run;
-- procedure Stop (The_Command : in out Command)
-- is
-- use Ada.Characters.Handling,
-- Ada.Exceptions;
-- begin
-- The_Command.Gather_Results;
--
-- Close (The_Command. Input_Pipe);
-- Close (The_Command.Output_Pipe);
-- Close (The_Command. Error_Pipe);
--
-- begin
-- Kill (The_Command);
-- exception
-- when E : POSIX.POSIX_Error =>
-- if To_Upper (Exception_Message (E)) /= "NO_SUCH_PROCESS"
-- then
-- Log ("Unable to kill process" & Image (The_Command.Process));
-- raise;
-- end if;
-- end;
--
-- begin
-- Wait_On (The_Command.Process); -- Reap zombies.
-- exception
-- when E : POSIX.POSIX_Error =>
-- if To_Upper (Exception_Message (E)) /= "NO_CHILD_PROCESS"
-- then
-- Log ("Unable to wait on process" & Image (The_Command.Process));
-- raise;
-- end if;
-- end;
-- end Stop;
function Failed (The_Command : in Command'Class) return Boolean
is
begin
return not Normal_Exit (The_Command);
end Failed;
-- function Failed (The_Pipeline : in Command_Array) return Boolean
-- is
-- begin
-- for Each of The_Pipeline
-- loop
-- if Failed (Each)
-- then
-- return True;
-- end if;
-- end loop;
--
-- return False;
-- end Failed;
-- function Which_Failed (The_Pipeline : in Command_Array) return Natural
-- is
-- begin
-- for i in The_Pipeline'Range
-- loop
-- if not Normal_Exit (The_Pipeline (i).Process)
-- then
-- return i;
-- end if;
-- end loop;
--
-- return 0;
-- end Which_Failed;
-- Command Results
--
function Results_Of (The_Command : in out Command'Class) return Command_Results
is
use Data_Vectors;
Output_Size : Data_Offset := 0;
Errors_Size : Data_Offset := 0;
begin
Gather_Results (The_Command);
for Each of The_Command.Output
loop
Output_Size := Output_Size + Each'Length;
end loop;
for Each of The_Command.Errors
loop
Errors_Size := Errors_Size + Each'Length;
end loop;
declare
Output : Data (1 .. Output_Size);
Errors : Data (1 .. Errors_Size);
procedure Set_Data (From : in out Data_Vector;
To : out Data)
is
First : Data_Index := 1;
Last : Data_Index;
begin
for Each of From
loop
Last := First + Each'Length - 1;
To (First .. Last) := Each;
First := Last + 1;
end loop;
From.Clear;
end Set_Data;
begin
Set_Data (The_Command.Output, Output);
Set_Data (The_Command.Errors, Errors);
return (Output_Size => Output_Size,
Error_Size => Errors_Size,
Output => Output,
Errors => Errors);
end;
exception
when Storage_Error =>
raise Command_Error with "Command output exceeds stack capacity. "
& "Increase the stack limit via 'ulimit -s'.";
end Results_Of;
function Output_Of (The_Results : in Command_Results) return Data
is
begin
return The_Results.Output;
end Output_Of;
function Errors_Of (The_Results : in Command_Results) return Data
is
begin
return The_Results.Errors;
end Errors_Of;
-- procedure Wait_On (The_Command : in out Command)
-- is
-- begin
-- Wait_On (The_Command.Process);
-- end Wait_On;
-- function Has_Terminated (The_Command : in out Command) return Boolean
-- is
-- begin
-- return Has_Terminated (The_Command.Process);
-- end Has_Terminated;
-- function Normal_Exit (The_Command : in Command) return Boolean
-- is
-- begin
-- return Normal_Exit (The_Command.Process);
-- end Normal_Exit;
-- procedure Kill (The_Command : in Command)
-- is
-- begin
-- Kill (The_Command.Process);
-- end Kill;
-- procedure Interrupt (The_Command : in Command)
-- is
-- begin
-- Interrupt (The_Command.Process);
-- end Interrupt;
-- procedure Pause (The_Command : in out Command)
-- is
-- begin
-- Pause (The_Command.Process);
-- The_Command.Paused := True;
-- end Pause;
-- procedure Resume (The_Command : in out Command)
-- is
-- begin
-- Resume (The_Command.Process);
-- The_Command.Paused := False;
-- end Resume;
procedure Start (The_Command : in out Command;
Input : in Data := No_Data;
Accepts_Input : in Boolean := False;
Pipeline : in Boolean := False)
is
begin
if The_Command.Status /= Not_Started
then
raise Command_Error with "Cannot start '" & (+The_Command.Name) & "' as it is already started.";
end if;
The_Command.Status := Running;
end Start;
procedure Pause (The_Command : in out Command)
is
begin
if The_Command.Status /= Running
then
raise Command_Error with "Cannot pause '" & (+The_Command.Name) & "' as it is not running.";
end if;
The_Command.Status := Paused;
end Pause;
procedure Resume (The_Command : in out Command)
is
begin
if The_Command.Status /= Paused
then
raise Command_Error with "Cannot resume '" & (+The_Command.Name) & "' as it is not paused.";
end if;
The_Command.Status := Running;
end Resume;
procedure Kill (The_Command : in out Command)
is
begin
case The_Command.Status
is
when Not_Started =>
raise Command_Error with "Cannot kill '" & (+The_Command.Name) & "' as it is not started.";
when Running
| Paused =>
The_Command.Status := Killed;
when Normal_Exit
| Failed_Exit =>
raise Command_Error with "Cannot kill '" & (+The_Command.Name) & "' as it has exited.";
when Killed =>
raise Command_Error with "Cannot kill '" & (+The_Command.Name) & "' as it is already killed.";
end case;
end Kill;
function Status (The_Command : in out Command) return State
is
begin
return The_Command.Status;
end Status;
--- Controlled
--
overriding
procedure Adjust (The_Command : in out Command)
is
begin
The_Command.Copy_Count.all := The_Command.Copy_Count.all + 1;
end Adjust;
overriding
procedure Finalize (The_Command : in out Command)
is
procedure Deallocate is new Ada.Unchecked_Deallocation (Count, Count_Access);
begin
The_Command.Copy_Count.all := The_Command.Copy_Count.all - 1;
if The_Command.Copy_Count.all = 0
then
-- if The_Command.Owns_Input_Pipe
-- then
-- Close (The_Command.Input_Pipe);
-- end if;
--
-- if The_Command.Owns_Output_Pipe
-- then
-- Close (The_Command.Output_Pipe);
-- end if;
--
-- Close (The_Command.Error_Pipe);
Deallocate (The_Command.Copy_Count);
end if;
end Finalize;
function Hash (Id : in Command_Id) return Ada.Containers.Hash_Type
is
begin
return Ada.Containers.Hash_Type (Id);
end Hash;
end Shell.Commands;
|
gspu/synth | Ada | 10,640 | ads | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
-- GCC 6.0 only (skip Container_Checks until identified need arises)
pragma Suppress (Tampering_Check);
with Ada.Text_IO;
with Ada.Calendar;
with Ada.Containers.Hashed_Maps;
with Ada.Containers.Ordered_Sets;
with Ada.Containers.Vectors;
with Ada.Characters.Latin_1;
with Ada.Directories;
with Ada.Exceptions;
with JohnnyText;
with Parameters;
with Definitions; use Definitions;
private with Replicant.Platform;
package PortScan is
package JT renames JohnnyText;
package AC renames Ada.Containers;
package CAL renames Ada.Calendar;
package AD renames Ada.Directories;
package EX renames Ada.Exceptions;
package TIO renames Ada.Text_IO;
package LAT renames Ada.Characters.Latin_1;
package PM renames Parameters;
type count_type is (total, success, failure, ignored, skipped);
type dim_handlers is array (count_type) of TIO.File_Type;
type port_id is private;
port_match_failed : constant port_id;
-- Scan the entire ports tree in order with a single, non-recursive pass
-- Return True on success
function scan_entire_ports_tree (portsdir : String) return Boolean;
-- Starting with a single port, recurse to determine a limited but complete
-- dependency tree. Repeated calls will augment already existing data.
-- Return True on success
function scan_single_port (catport : String; always_build : Boolean;
fatal : out Boolean)
return Boolean;
-- This procedure causes the reverse dependencies to be calculated, and
-- then the extended (recursive) reverse dependencies. The former is
-- used progressively to determine when a port is free to build and the
-- latter sets the build priority.
procedure set_build_priority;
-- Wipe out all scan data so new scan can be performed
procedure reset_ports_tree;
-- Returns the number of cores. The set_cores procedure must be run first.
-- set_cores was private previously, but we need the information to set
-- intelligent defaults for the configuration file.
procedure set_cores;
function cores_available return cpu_range;
-- Return " (port deleted)" if the catport doesn't exist
-- Return " (directory empty)" if the directory exists but has no contents
-- Return " (Makefile missing)" when makefile is missing
-- otherwise return blank string
function obvious_problem (portsdir, catport : String) return String;
-- Attempts to generate a ports index file after acquiring all port origins
-- Returns False (with an outputted message) if it fails to:
-- a. create directories
-- b. scan fails
-- c. index file creation fails
function generate_ports_index (index_file, portsdir : String) return Boolean;
-- Recursively scans a ports directory tree, returning True as soon as a file or directory
-- newer than the given time is found.
function tree_newer_than_reference
(portsdir : String;
reference : CAL.Time;
valid : out Boolean) return Boolean;
-- Store origin support
-- * store data from flavor index in hash and vector
-- * clear data when complete
-- * valid origin returns true when candidate available verbatim
procedure load_index_for_store_origins;
procedure clear_store_origin_data;
function input_origin_valid (candidate : String) return Boolean;
procedure suggest_flavor_for_bad_origin (candidate : String);
private
package REP renames Replicant;
package PLAT renames Replicant.Platform;
max_ports : constant := 40000;
scan_slave : constant builders := 9;
ss_base : constant String := "/SL09";
dir_ports : constant String := "/xports";
chroot : constant String := "/usr/sbin/chroot ";
index_path : constant String := "/var/cache/synth";
type port_id is range -1 .. max_ports - 1;
subtype port_index is port_id range 0 .. port_id'Last;
port_match_failed : constant port_id := port_id'First;
-- skip "package" because every port has same dependency on ports-mgmt/pkg
-- except for pkg itself. Skip "test" because these dependencies are
-- not required to build packages.
type dependency_type is (fetch, extract, patch, build, library, runtime);
subtype LR_set is dependency_type range library .. runtime;
bmake_execution : exception;
pkgng_execution : exception;
make_garbage : exception;
nonexistent_port : exception;
circular_logic : exception;
seek_failure : exception;
unknown_format : exception;
package subqueue is new AC.Vectors
(Element_Type => port_index,
Index_Type => port_index);
package string_crate is new AC.Vectors
(Element_Type => JT.Text,
Index_Type => port_index,
"=" => JT.SU."=");
type queue_record is
record
ap_index : port_index;
reverse_score : port_index;
end record;
-- Functions for ranking_crate definitions
function "<" (L, R : queue_record) return Boolean;
package ranking_crate is new AC.Ordered_Sets (Element_Type => queue_record);
-- Functions for portkey_crate and package_crate definitions
function port_hash (key : JT.Text) return AC.Hash_Type;
package portkey_crate is new AC.Hashed_Maps
(Key_Type => JT.Text,
Element_Type => port_index,
Hash => port_hash,
Equivalent_Keys => JT.equivalent);
package package_crate is new AC.Hashed_Maps
(Key_Type => JT.Text,
Element_Type => Boolean,
Hash => port_hash,
Equivalent_Keys => JT.equivalent);
-- Functions for block_crate definitions
function block_hash (key : port_index) return AC.Hash_Type;
function block_ekey (left, right : port_index) return Boolean;
package block_crate is new AC.Hashed_Maps
(Key_Type => port_index,
Element_Type => port_index,
Hash => block_hash,
Equivalent_Keys => block_ekey);
type port_record is
record
sequence_id : port_index := 0;
key_cursor : portkey_crate.Cursor := portkey_crate.No_Element;
jobs : builders := 1;
ignore_reason : JT.Text := JT.blank;
port_version : JT.Text := JT.blank;
package_name : JT.Text := JT.blank;
pkg_dep_query : JT.Text := JT.blank;
ignored : Boolean := False;
scanned : Boolean := False;
rev_scanned : Boolean := False;
unlist_failed : Boolean := False;
work_locked : Boolean := False;
scan_locked : Boolean := False;
pkg_present : Boolean := False;
remote_pkg : Boolean := False;
never_remote : Boolean := False;
deletion_due : Boolean := False;
use_procfs : Boolean := False;
use_linprocfs : Boolean := False;
reverse_score : port_index := 0;
min_librun : Natural := 0;
librun : block_crate.Map;
blocked_by : block_crate.Map;
blocks : block_crate.Map;
all_reverse : block_crate.Map;
options : package_crate.Map;
flavors : string_crate.Vector;
end record;
type port_record_access is access all port_record;
type dim_make_queue is array (scanners) of subqueue.Vector;
type dim_progress is array (scanners) of port_index;
type dim_all_ports is array (port_index) of aliased port_record;
all_ports : dim_all_ports;
ports_keys : portkey_crate.Map;
portlist : portkey_crate.Map;
make_queue : dim_make_queue;
mq_progress : dim_progress := (others => 0);
rank_queue : ranking_crate.Set;
number_cores : cpu_range := cpu_range'First;
lot_number : scanners := 1;
lot_counter : port_index := 0;
last_port : port_index := 0;
prescanned : Boolean := False;
fullpop : Boolean := True;
so_porthash : portkey_crate.Map;
so_serial : string_crate.Vector;
procedure iterate_reverse_deps;
procedure iterate_drill_down;
procedure populate_set_depends (target : port_index;
catport : String;
line : JT.Text;
dtype : dependency_type);
procedure populate_set_options (target : port_index;
line : JT.Text;
on : Boolean);
procedure populate_flavors (target : port_index;
line : JT.Text);
procedure populate_port_data (target : port_index);
procedure populate_port_data_fpc (target : port_index);
procedure populate_port_data_nps (target : port_index);
procedure drill_down (next_target : port_index;
original_target : port_index);
-- subroutines for populate_port_data
procedure prescan_ports_tree (portsdir : String);
procedure grep_Makefile (portsdir, category : String);
procedure walk_all_subdirectories (portsdir, category : String);
procedure wipe_make_queue;
procedure read_flavor_index;
procedure parallel_deep_scan (success : out Boolean;
show_progress : Boolean);
-- some helper routines
function scan_environment return String;
function find_colon (Source : String) return Natural;
function scrub_phase (Source : String) return JT.Text;
function get_catport (PR : port_record) return String;
function scan_progress return String;
function get_max_lots return scanners;
function get_pkg_name (origin : String) return String;
function timestamp (hack : CAL.Time; www_format : Boolean := False) return String;
function clean_up_pkgsrc_ignore_reason (dirty_string : String) return JT.Text;
function subdirectory_is_older (portsdir, category : String;
reference : CAL.Time) return Boolean;
type dim_counters is array (count_type) of Natural;
-- bulk run variables
Flog : dim_handlers;
start_time : CAL.Time;
stop_time : CAL.Time;
scan_start : CAL.Time;
scan_stop : CAL.Time;
bld_counter : dim_counters := (0, 0, 0, 0, 0);
end PortScan;
|
reznikmm/matreshka | Ada | 3,743 | 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.Table.Align is
type Table_Align_Node is
new Matreshka.ODF_Attributes.Table.Table_Node_Base with null record;
type Table_Align_Access is access all Table_Align_Node'Class;
overriding function Get_Local_Name
(Self : not null access constant Table_Align_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Attributes.Table.Align;
|
stcarrez/ada-util | Ada | 4,767 | ads | -----------------------------------------------------------------------
-- util-streams-encoders -- Streams with encoding and decoding capabilities
-- Copyright (C) 2017, 2019, 2021, 2022 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Encoders;
-- == Encoder Streams ==
-- The `Util.Streams.Buffered.Encoders` is a generic package which implements an
-- encoding or decoding stream through the `Transformer` interface. The generic
-- package must be instantiated with a transformer type. The stream passes the data
-- to be written to the `Transform` method of that interface and it makes
-- transformations on the data before being written.
--
-- The AES encoding stream is created as follows:
--
-- package Encoding is
-- new Util.Streams.Buffered.Encoders (Encoder => Util.Encoders.AES.Encoder);
--
-- and the AES decoding stream is created with:
--
-- package Decoding is
-- new Util.Streams.Buffered.Encoders (Encoder => Util.Encoders.AES.Decoder);
--
-- The encoding stream instance is declared:
--
-- Encode : Util.Streams.Buffered.Encoders.Encoder_Stream;
--
-- The encoding stream manages a buffer that is used to hold the encoded data before it is
-- written to the target stream. The `Initialize` procedure must be called to indicate
-- the target stream, the size of the buffer and the encoding format to be used.
--
-- Encode.Initialize (Output => File'Access, Size => 4096, Format => "base64");
--
-- The encoding stream provides a `Produces` procedure that reads the encoded
-- stream and write the result in another stream. It also provides a `Consumes`
-- procedure that encodes a stream by reading its content and write the encoded
-- result to another stream.
generic
type Encoder is limited new Util.Encoders.Transformer with private;
package Util.Streams.Buffered.Encoders is
-- -----------------------
-- Encoding stream
-- -----------------------
-- The <b>Encoding_Stream</b> is an output stream which uses an encoder to
-- transform the data before writing it to the output. The transformer can
-- change the data by encoding it in Base64, Base16 or encrypting it.
type Encoder_Stream is limited new Util.Streams.Buffered.Input_Output_Buffer_Stream
with record
Transform : Encoder;
Flushed : Boolean := False;
end record;
-- Initialize the stream with a buffer of <b>Size</b> bytes.
overriding
procedure Initialize (Stream : in out Encoder_Stream;
Size : in Positive);
-- Initialize the stream to write on the given stream.
-- An internal buffer is allocated for writing the stream.
procedure Produces (Stream : in out Encoder_Stream;
Output : access Output_Stream'Class;
Size : in Positive);
-- Initialize the stream to read the given streams.
procedure Consumes (Stream : in out Encoder_Stream;
Input : access Input_Stream'Class;
Size : in Positive);
-- Close the sink.
overriding
procedure Close (Stream : in out Encoder_Stream);
-- Write the buffer array to the output stream.
overriding
procedure Write (Stream : in out Encoder_Stream;
Buffer : in Ada.Streams.Stream_Element_Array);
-- Read into the buffer as many bytes as possible and return in
-- `last` the position of the last byte read.
overriding
procedure Read (Stream : in out Encoder_Stream;
Into : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-- Flush the buffer by writing on the output stream.
-- Raises Data_Error if there is no output stream.
overriding
procedure Flush (Stream : in out Encoder_Stream);
overriding
procedure Finalize (Stream : in out Encoder_Stream);
-- Fill the buffer by reading the input stream.
-- Raises Data_Error if there is no input stream;
procedure Fill (Stream : in out Encoder_Stream);
end Util.Streams.Buffered.Encoders;
|
jhumphry/Reqrep_Task_Pools | Ada | 3,918 | adb | -- error_handling_example.adb
-- An example of handling errors when using the Reqrep_Task_Pool
-- Copyright (c) 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 Ada.Text_IO; use Ada.Text_IO;
with Ada.Exceptions;
with Reqrep_Task_Pools;
use all type Reqrep_Task_Pools.Reqrep_Status;
with Ada.Task_Identification;
with Ada.Task_Termination;
procedure Error_Handling_Example is
type Example_Reqrep is tagged record
ID : Positive := 1;
D : Duration := 1.0;
Fail : Boolean := False;
Crash : Boolean := False;
Worker_Crash : Boolean := False;
end record;
function Execute
(R : in out Example_Reqrep) return Reqrep_Task_Pools.Reqrep_Return_Status
is
begin
delay R.D;
if R.Crash then
raise Program_Error;
elsif R.Worker_Crash then
raise Reqrep_Task_Pools.Inject_Worker_Crash;
elsif R.Fail then
return Failure;
else
return Success;
end if;
end Execute;
package Example_Task_Pool is new Reqrep_Task_Pools.Task_Pool
(Reqrep => Example_Reqrep,
Number_Workers => 2);
use Example_Task_Pool;
Result : Reqrep_Job;
Unhandled_Exception_Occurrence : Ada.Exceptions.Exception_Occurrence;
begin
Put_Line ("A example of handling errors.");
New_Line;
Put_Line ("Pushing requests onto the queue.");
Example_Task_Pool.Push_Job
(Example_Reqrep'(ID => 1, D => 1.0, Fail => False, Crash => False, Worker_Crash => False));
Put_Line ("Request 1 will succeed.");
Example_Task_Pool.Push_Job
(Example_Reqrep'(ID => 2, D => 1.0, Fail => True, Crash => False, Worker_Crash => False));
Put_Line ("Request 2 will fail.");
Example_Task_Pool.Push_Job
(Example_Reqrep'(ID => 3, D => 1.0, Fail => False, Crash => True, Worker_Crash => False));
Put_Line ("Request 3 will crash but the worker should catch this.");
Example_Task_Pool.Push_Job
(Example_Reqrep'(ID => 4, D => 5.0, Fail => False, Crash => False, Worker_Crash => False),
Timeout => 2.0);
Put_Line ("Request 4 will time out.");
Example_Task_Pool.Push_Job
(Example_Reqrep'(ID => 6, D => 1.0, Fail => False, Crash => False, Worker_Crash => True));
-- (Example_Reqrep'(ID => 5, D => 1.0, Fail => False, Crash => True, Worker_Crash => False));
Put_Line ("Request 5 will crash the worker.");
New_Line;
Put_Line ("Pulling results off the queue.");
for I in 1 .. 5 loop
Result := Get_Result;
Put_Line
("Got response: " &
Reqrep_Task_Pools.Reqrep_Status'Image (Result.Status) &
" for request ID:" &
Integer'Image (Result.ID));
if Result.Status = Unhandled_Exception or Result.Status = Internal_Error then
Get_Exception (Unhandled_Exception_Occurrence);
Put_Line
(Ada.Exceptions.Exception_Information
(Unhandled_Exception_Occurrence));
end if;
end loop;
Put_Line("Active workers: " & Natural'Image(Active_Workers));
Put_Line ("Shutting down...");
Shutdown;
delay 0.1;
Put_Line("Active workers: " & Natural'Image(Active_Workers));
Put_Line ("Shut down.");
end Error_Handling_Example;
|
AdaCore/Ada_Drivers_Library | Ada | 58,911 | ads | -- This spec has been automatically generated from STM32F46_79x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.RCC is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR_HSITRIM_Field is HAL.UInt5;
subtype CR_HSICAL_Field is HAL.UInt8;
-- clock control register
type CR_Register is record
-- Internal high-speed clock enable
HSION : Boolean := True;
-- Read-only. Internal high-speed clock ready flag
HSIRDY : Boolean := True;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Internal high-speed clock trimming
HSITRIM : CR_HSITRIM_Field := 16#10#;
-- Read-only. Internal high-speed clock calibration
HSICAL : CR_HSICAL_Field := 16#0#;
-- HSE clock enable
HSEON : Boolean := False;
-- Read-only. HSE clock ready flag
HSERDY : Boolean := False;
-- HSE clock bypass
HSEBYP : Boolean := False;
-- Clock security system enable
CSSON : Boolean := False;
-- unspecified
Reserved_20_23 : HAL.UInt4 := 16#0#;
-- Main PLL (PLL) enable
PLLON : Boolean := False;
-- Read-only. Main PLL (PLL) clock ready flag
PLLRDY : Boolean := False;
-- PLLI2S enable
PLLI2SON : Boolean := False;
-- Read-only. PLLI2S clock ready flag
PLLI2SRDY : Boolean := False;
-- PLLSAI enable
PLLSAION : Boolean := False;
-- Read-only. PLLSAI clock ready flag
PLLSAIRDY : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
HSION at 0 range 0 .. 0;
HSIRDY at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
HSITRIM at 0 range 3 .. 7;
HSICAL at 0 range 8 .. 15;
HSEON at 0 range 16 .. 16;
HSERDY at 0 range 17 .. 17;
HSEBYP at 0 range 18 .. 18;
CSSON at 0 range 19 .. 19;
Reserved_20_23 at 0 range 20 .. 23;
PLLON at 0 range 24 .. 24;
PLLRDY at 0 range 25 .. 25;
PLLI2SON at 0 range 26 .. 26;
PLLI2SRDY at 0 range 27 .. 27;
PLLSAION at 0 range 28 .. 28;
PLLSAIRDY at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
subtype PLLCFGR_PLLM_Field is HAL.UInt6;
subtype PLLCFGR_PLLN_Field is HAL.UInt9;
subtype PLLCFGR_PLLP_Field is HAL.UInt2;
subtype PLLCFGR_PLLQ_Field is HAL.UInt4;
subtype PLLCFGR_PLLR_Field is HAL.UInt3;
-- PLL configuration register
type PLLCFGR_Register is record
-- Division factor for the main PLL (PLL) and audio PLL (PLLI2S) input
-- clock
PLLM : PLLCFGR_PLLM_Field := 16#10#;
-- Main PLL (PLL) multiplication factor for VCO
PLLN : PLLCFGR_PLLN_Field := 16#C0#;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- Main PLL (PLL) division factor for main system clock
PLLP : PLLCFGR_PLLP_Field := 16#0#;
-- unspecified
Reserved_18_21 : HAL.UInt4 := 16#0#;
-- Main PLL(PLL) and audio PLL (PLLI2S) entry clock source
PLLSRC : Boolean := False;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- Main PLL (PLL) division factor for USB OTG FS, SDIO and random number
-- generator clocks
PLLQ : PLLCFGR_PLLQ_Field := 16#4#;
-- Main PLL division factor for DSI clock
PLLR : PLLCFGR_PLLR_Field := 16#2#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PLLCFGR_Register use record
PLLM at 0 range 0 .. 5;
PLLN at 0 range 6 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
PLLP at 0 range 16 .. 17;
Reserved_18_21 at 0 range 18 .. 21;
PLLSRC at 0 range 22 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
PLLQ at 0 range 24 .. 27;
PLLR at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype CFGR_SW_Field is HAL.UInt2;
subtype CFGR_SWS_Field is HAL.UInt2;
subtype CFGR_HPRE_Field is HAL.UInt4;
-- CFGR_PPRE array element
subtype CFGR_PPRE_Element is HAL.UInt3;
-- CFGR_PPRE array
type CFGR_PPRE_Field_Array is array (1 .. 2) of CFGR_PPRE_Element
with Component_Size => 3, Size => 6;
-- Type definition for CFGR_PPRE
type CFGR_PPRE_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PPRE as a value
Val : HAL.UInt6;
when True =>
-- PPRE as an array
Arr : CFGR_PPRE_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for CFGR_PPRE_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
subtype CFGR_RTCPRE_Field is HAL.UInt5;
subtype CFGR_MCO1_Field is HAL.UInt2;
subtype CFGR_MCO1PRE_Field is HAL.UInt3;
subtype CFGR_MCO2PRE_Field is HAL.UInt3;
subtype CFGR_MCO2_Field is HAL.UInt2;
-- clock configuration register
type CFGR_Register is record
-- System clock switch
SW : CFGR_SW_Field := 16#0#;
-- Read-only. System clock switch status
SWS : CFGR_SWS_Field := 16#0#;
-- AHB prescaler
HPRE : CFGR_HPRE_Field := 16#0#;
-- unspecified
Reserved_8_9 : HAL.UInt2 := 16#0#;
-- APB Low speed prescaler (APB1)
PPRE : CFGR_PPRE_Field := (As_Array => False, Val => 16#0#);
-- HSE division factor for RTC clock
RTCPRE : CFGR_RTCPRE_Field := 16#0#;
-- Microcontroller clock output 1
MCO1 : CFGR_MCO1_Field := 16#0#;
-- I2S clock selection
I2SSRC : Boolean := False;
-- MCO1 prescaler
MCO1PRE : CFGR_MCO1PRE_Field := 16#0#;
-- MCO2 prescaler
MCO2PRE : CFGR_MCO2PRE_Field := 16#0#;
-- Microcontroller clock output 2
MCO2 : CFGR_MCO2_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CFGR_Register use record
SW at 0 range 0 .. 1;
SWS at 0 range 2 .. 3;
HPRE at 0 range 4 .. 7;
Reserved_8_9 at 0 range 8 .. 9;
PPRE at 0 range 10 .. 15;
RTCPRE at 0 range 16 .. 20;
MCO1 at 0 range 21 .. 22;
I2SSRC at 0 range 23 .. 23;
MCO1PRE at 0 range 24 .. 26;
MCO2PRE at 0 range 27 .. 29;
MCO2 at 0 range 30 .. 31;
end record;
-- clock interrupt register
type CIR_Register is record
-- Read-only. LSI ready interrupt flag
LSIRDYF : Boolean := False;
-- Read-only. LSE ready interrupt flag
LSERDYF : Boolean := False;
-- Read-only. HSI ready interrupt flag
HSIRDYF : Boolean := False;
-- Read-only. HSE ready interrupt flag
HSERDYF : Boolean := False;
-- Read-only. Main PLL (PLL) ready interrupt flag
PLLRDYF : Boolean := False;
-- Read-only. PLLI2S ready interrupt flag
PLLI2SRDYF : Boolean := False;
-- Read-only. PLLSAI ready interrupt flag
PLLSAIRDYF : Boolean := False;
-- Read-only. Clock security system interrupt flag
CSSF : Boolean := False;
-- LSI ready interrupt enable
LSIRDYIE : Boolean := False;
-- LSE ready interrupt enable
LSERDYIE : Boolean := False;
-- HSI ready interrupt enable
HSIRDYIE : Boolean := False;
-- HSE ready interrupt enable
HSERDYIE : Boolean := False;
-- Main PLL (PLL) ready interrupt enable
PLLRDYIE : Boolean := False;
-- PLLI2S ready interrupt enable
PLLI2SRDYIE : Boolean := False;
-- PLLSAI Ready Interrupt Enable
PLLSAIRDYIE : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- Write-only. LSI ready interrupt clear
LSIRDYC : Boolean := False;
-- Write-only. LSE ready interrupt clear
LSERDYC : Boolean := False;
-- Write-only. HSI ready interrupt clear
HSIRDYC : Boolean := False;
-- Write-only. HSE ready interrupt clear
HSERDYC : Boolean := False;
-- Write-only. Main PLL(PLL) ready interrupt clear
PLLRDYC : Boolean := False;
-- Write-only. PLLI2S ready interrupt clear
PLLI2SRDYC : Boolean := False;
-- Write-only. PLLSAI Ready Interrupt Clear
PLLSAIRDYC : Boolean := False;
-- Write-only. Clock security system interrupt clear
CSSC : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CIR_Register use record
LSIRDYF at 0 range 0 .. 0;
LSERDYF at 0 range 1 .. 1;
HSIRDYF at 0 range 2 .. 2;
HSERDYF at 0 range 3 .. 3;
PLLRDYF at 0 range 4 .. 4;
PLLI2SRDYF at 0 range 5 .. 5;
PLLSAIRDYF at 0 range 6 .. 6;
CSSF at 0 range 7 .. 7;
LSIRDYIE at 0 range 8 .. 8;
LSERDYIE at 0 range 9 .. 9;
HSIRDYIE at 0 range 10 .. 10;
HSERDYIE at 0 range 11 .. 11;
PLLRDYIE at 0 range 12 .. 12;
PLLI2SRDYIE at 0 range 13 .. 13;
PLLSAIRDYIE at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
LSIRDYC at 0 range 16 .. 16;
LSERDYC at 0 range 17 .. 17;
HSIRDYC at 0 range 18 .. 18;
HSERDYC at 0 range 19 .. 19;
PLLRDYC at 0 range 20 .. 20;
PLLI2SRDYC at 0 range 21 .. 21;
PLLSAIRDYC at 0 range 22 .. 22;
CSSC at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- AHB1 peripheral reset register
type AHB1RSTR_Register is record
-- IO port A reset
GPIOARST : Boolean := False;
-- IO port B reset
GPIOBRST : Boolean := False;
-- IO port C reset
GPIOCRST : Boolean := False;
-- IO port D reset
GPIODRST : Boolean := False;
-- IO port E reset
GPIOERST : Boolean := False;
-- IO port F reset
GPIOFRST : Boolean := False;
-- IO port G reset
GPIOGRST : Boolean := False;
-- IO port H reset
GPIOHRST : Boolean := False;
-- IO port I reset
GPIOIRST : Boolean := False;
-- IO port J reset
GPIOJRST : Boolean := False;
-- IO port K reset
GPIOKRST : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- CRC reset
CRCRST : Boolean := False;
-- unspecified
Reserved_13_20 : HAL.UInt8 := 16#0#;
-- DMA2 reset
DMA1RST : Boolean := False;
-- DMA2 reset
DMA2RST : Boolean := False;
-- DMA2D reset
DMA2DRST : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- Ethernet MAC reset
ETHMACRST : Boolean := False;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- USB OTG HS module reset
OTGHSRST : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB1RSTR_Register use record
GPIOARST at 0 range 0 .. 0;
GPIOBRST at 0 range 1 .. 1;
GPIOCRST at 0 range 2 .. 2;
GPIODRST at 0 range 3 .. 3;
GPIOERST at 0 range 4 .. 4;
GPIOFRST at 0 range 5 .. 5;
GPIOGRST at 0 range 6 .. 6;
GPIOHRST at 0 range 7 .. 7;
GPIOIRST at 0 range 8 .. 8;
GPIOJRST at 0 range 9 .. 9;
GPIOKRST at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
CRCRST at 0 range 12 .. 12;
Reserved_13_20 at 0 range 13 .. 20;
DMA1RST at 0 range 21 .. 21;
DMA2RST at 0 range 22 .. 22;
DMA2DRST at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
ETHMACRST at 0 range 25 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
OTGHSRST at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-- AHB2 peripheral reset register
type AHB2RSTR_Register is record
-- Camera interface reset
DCMIRST : Boolean := False;
-- unspecified
Reserved_1_3 : HAL.UInt3 := 16#0#;
-- Cryptographic module reset
CRYPRST : Boolean := False;
-- Hash module reset
HSAHRST : Boolean := False;
-- Random number generator module reset
RNGRST : Boolean := False;
-- USB OTG FS module reset
OTGFSRST : Boolean := False;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB2RSTR_Register use record
DCMIRST at 0 range 0 .. 0;
Reserved_1_3 at 0 range 1 .. 3;
CRYPRST at 0 range 4 .. 4;
HSAHRST at 0 range 5 .. 5;
RNGRST at 0 range 6 .. 6;
OTGFSRST at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- AHB3 peripheral reset register
type AHB3RSTR_Register is record
-- Flexible memory controller module reset
FMCRST : Boolean := False;
-- QUADSPI memory controller reset
QSPIRST : Boolean := False;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB3RSTR_Register use record
FMCRST at 0 range 0 .. 0;
QSPIRST at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- APB1 peripheral reset register
type APB1RSTR_Register is record
-- TIM2 reset
TIM2RST : Boolean := False;
-- TIM3 reset
TIM3RST : Boolean := False;
-- TIM4 reset
TIM4RST : Boolean := False;
-- TIM5 reset
TIM5RST : Boolean := False;
-- TIM6 reset
TIM6RST : Boolean := False;
-- TIM7 reset
TIM7RST : Boolean := False;
-- TIM12 reset
TIM12RST : Boolean := False;
-- TIM13 reset
TIM13RST : Boolean := False;
-- TIM14 reset
TIM14RST : Boolean := False;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- Window watchdog reset
WWDGRST : Boolean := False;
-- unspecified
Reserved_12_13 : HAL.UInt2 := 16#0#;
-- SPI 2 reset
SPI2RST : Boolean := False;
-- SPI 3 reset
SPI3RST : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- USART 2 reset
UART2RST : Boolean := False;
-- USART 3 reset
UART3RST : Boolean := False;
-- USART 4 reset
UART4RST : Boolean := False;
-- USART 5 reset
UART5RST : Boolean := False;
-- I2C 1 reset
I2C1RST : Boolean := False;
-- I2C 2 reset
I2C2RST : Boolean := False;
-- I2C3 reset
I2C3RST : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- CAN1 reset
CAN1RST : Boolean := False;
-- CAN2 reset
CAN2RST : Boolean := False;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Power interface reset
PWRRST : Boolean := False;
-- DAC reset
DACRST : Boolean := False;
-- UART7 reset
UART7RST : Boolean := False;
-- UART8 reset
UART8RST : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB1RSTR_Register use record
TIM2RST at 0 range 0 .. 0;
TIM3RST at 0 range 1 .. 1;
TIM4RST at 0 range 2 .. 2;
TIM5RST at 0 range 3 .. 3;
TIM6RST at 0 range 4 .. 4;
TIM7RST at 0 range 5 .. 5;
TIM12RST at 0 range 6 .. 6;
TIM13RST at 0 range 7 .. 7;
TIM14RST at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
WWDGRST at 0 range 11 .. 11;
Reserved_12_13 at 0 range 12 .. 13;
SPI2RST at 0 range 14 .. 14;
SPI3RST at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
UART2RST at 0 range 17 .. 17;
UART3RST at 0 range 18 .. 18;
UART4RST at 0 range 19 .. 19;
UART5RST at 0 range 20 .. 20;
I2C1RST at 0 range 21 .. 21;
I2C2RST at 0 range 22 .. 22;
I2C3RST at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
CAN1RST at 0 range 25 .. 25;
CAN2RST at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
PWRRST at 0 range 28 .. 28;
DACRST at 0 range 29 .. 29;
UART7RST at 0 range 30 .. 30;
UART8RST at 0 range 31 .. 31;
end record;
-- APB2 peripheral reset register
type APB2RSTR_Register is record
-- TIM1 reset
TIM1RST : Boolean := False;
-- TIM8 reset
TIM8RST : Boolean := False;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- USART1 reset
USART1RST : Boolean := False;
-- USART6 reset
USART6RST : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- ADC interface reset (common to all ADCs)
ADCRST : Boolean := False;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- SDIO reset
SDIORST : Boolean := False;
-- SPI 1 reset
SPI1RST : Boolean := False;
-- SPI4 reset
SPI4RST : Boolean := False;
-- System configuration controller reset
SYSCFGRST : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- TIM9 reset
TIM9RST : Boolean := False;
-- TIM10 reset
TIM10RST : Boolean := False;
-- TIM11 reset
TIM11RST : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- SPI5 reset
SPI5RST : Boolean := False;
-- SPI6 reset
SPI6RST : Boolean := False;
-- SAI1 reset
SAI1RST : Boolean := False;
-- unspecified
Reserved_23_25 : HAL.UInt3 := 16#0#;
-- LTDC reset
LTDCRST : Boolean := False;
-- DSI host reset
DSIRST : Boolean := False;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB2RSTR_Register use record
TIM1RST at 0 range 0 .. 0;
TIM8RST at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
USART1RST at 0 range 4 .. 4;
USART6RST at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADCRST at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
SDIORST at 0 range 11 .. 11;
SPI1RST at 0 range 12 .. 12;
SPI4RST at 0 range 13 .. 13;
SYSCFGRST at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
TIM9RST at 0 range 16 .. 16;
TIM10RST at 0 range 17 .. 17;
TIM11RST at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
SPI5RST at 0 range 20 .. 20;
SPI6RST at 0 range 21 .. 21;
SAI1RST at 0 range 22 .. 22;
Reserved_23_25 at 0 range 23 .. 25;
LTDCRST at 0 range 26 .. 26;
DSIRST at 0 range 27 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- AHB1 peripheral clock register
type AHB1ENR_Register is record
-- IO port A clock enable
GPIOAEN : Boolean := False;
-- IO port B clock enable
GPIOBEN : Boolean := False;
-- IO port C clock enable
GPIOCEN : Boolean := False;
-- IO port D clock enable
GPIODEN : Boolean := False;
-- IO port E clock enable
GPIOEEN : Boolean := False;
-- IO port F clock enable
GPIOFEN : Boolean := False;
-- IO port G clock enable
GPIOGEN : Boolean := False;
-- IO port H clock enable
GPIOHEN : Boolean := False;
-- IO port I clock enable
GPIOIEN : Boolean := False;
-- IO port J clock enable
GPIOJEN : Boolean := False;
-- IO port K clock enable
GPIOKEN : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- CRC clock enable
CRCEN : Boolean := False;
-- unspecified
Reserved_13_17 : HAL.UInt5 := 16#0#;
-- Backup SRAM interface clock enable
BKPSRAMEN : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- CCM data RAM clock enable
CCMDATARAMEN : Boolean := True;
-- DMA1 clock enable
DMA1EN : Boolean := False;
-- DMA2 clock enable
DMA2EN : Boolean := False;
-- DMA2D clock enable
DMA2DEN : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- Ethernet MAC clock enable
ETHMACEN : Boolean := False;
-- Ethernet Transmission clock enable
ETHMACTXEN : Boolean := False;
-- Ethernet Reception clock enable
ETHMACRXEN : Boolean := False;
-- Ethernet PTP clock enable
ETHMACPTPEN : Boolean := False;
-- USB OTG HS clock enable
OTGHSEN : Boolean := False;
-- USB OTG HSULPI clock enable
OTGHSULPIEN : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB1ENR_Register use record
GPIOAEN at 0 range 0 .. 0;
GPIOBEN at 0 range 1 .. 1;
GPIOCEN at 0 range 2 .. 2;
GPIODEN at 0 range 3 .. 3;
GPIOEEN at 0 range 4 .. 4;
GPIOFEN at 0 range 5 .. 5;
GPIOGEN at 0 range 6 .. 6;
GPIOHEN at 0 range 7 .. 7;
GPIOIEN at 0 range 8 .. 8;
GPIOJEN at 0 range 9 .. 9;
GPIOKEN at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
CRCEN at 0 range 12 .. 12;
Reserved_13_17 at 0 range 13 .. 17;
BKPSRAMEN at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
CCMDATARAMEN at 0 range 20 .. 20;
DMA1EN at 0 range 21 .. 21;
DMA2EN at 0 range 22 .. 22;
DMA2DEN at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
ETHMACEN at 0 range 25 .. 25;
ETHMACTXEN at 0 range 26 .. 26;
ETHMACRXEN at 0 range 27 .. 27;
ETHMACPTPEN at 0 range 28 .. 28;
OTGHSEN at 0 range 29 .. 29;
OTGHSULPIEN at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- AHB2 peripheral clock enable register
type AHB2ENR_Register is record
-- Camera interface enable
DCMIEN : Boolean := False;
-- unspecified
Reserved_1_3 : HAL.UInt3 := 16#0#;
-- Cryptographic modules clock enable
CRYPEN : Boolean := False;
-- Hash modules clock enable
HASHEN : Boolean := False;
-- Random number generator clock enable
RNGEN : Boolean := False;
-- USB OTG FS clock enable
OTGFSEN : Boolean := False;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB2ENR_Register use record
DCMIEN at 0 range 0 .. 0;
Reserved_1_3 at 0 range 1 .. 3;
CRYPEN at 0 range 4 .. 4;
HASHEN at 0 range 5 .. 5;
RNGEN at 0 range 6 .. 6;
OTGFSEN at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- AHB3 peripheral clock enable register
type AHB3ENR_Register is record
-- Flexible memory controller module clock enable
FMCEN : Boolean := False;
-- QUADSPI memory controller module clock enable
QSPIEN : Boolean := False;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB3ENR_Register use record
FMCEN at 0 range 0 .. 0;
QSPIEN at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- APB1 peripheral clock enable register
type APB1ENR_Register is record
-- TIM2 clock enable
TIM2EN : Boolean := False;
-- TIM3 clock enable
TIM3EN : Boolean := False;
-- TIM4 clock enable
TIM4EN : Boolean := False;
-- TIM5 clock enable
TIM5EN : Boolean := False;
-- TIM6 clock enable
TIM6EN : Boolean := False;
-- TIM7 clock enable
TIM7EN : Boolean := False;
-- TIM12 clock enable
TIM12EN : Boolean := False;
-- TIM13 clock enable
TIM13EN : Boolean := False;
-- TIM14 clock enable
TIM14EN : Boolean := False;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- Window watchdog clock enable
WWDGEN : Boolean := False;
-- unspecified
Reserved_12_13 : HAL.UInt2 := 16#0#;
-- SPI2 clock enable
SPI2EN : Boolean := False;
-- SPI3 clock enable
SPI3EN : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- USART 2 clock enable
USART2EN : Boolean := False;
-- USART3 clock enable
USART3EN : Boolean := False;
-- UART4 clock enable
UART4EN : Boolean := False;
-- UART5 clock enable
UART5EN : Boolean := False;
-- I2C1 clock enable
I2C1EN : Boolean := False;
-- I2C2 clock enable
I2C2EN : Boolean := False;
-- I2C3 clock enable
I2C3EN : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- CAN 1 clock enable
CAN1EN : Boolean := False;
-- CAN 2 clock enable
CAN2EN : Boolean := False;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Power interface clock enable
PWREN : Boolean := False;
-- DAC interface clock enable
DACEN : Boolean := False;
-- UART7 clock enable
UART7ENR : Boolean := False;
-- UART8 clock enable
UART8ENR : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB1ENR_Register use record
TIM2EN at 0 range 0 .. 0;
TIM3EN at 0 range 1 .. 1;
TIM4EN at 0 range 2 .. 2;
TIM5EN at 0 range 3 .. 3;
TIM6EN at 0 range 4 .. 4;
TIM7EN at 0 range 5 .. 5;
TIM12EN at 0 range 6 .. 6;
TIM13EN at 0 range 7 .. 7;
TIM14EN at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
WWDGEN at 0 range 11 .. 11;
Reserved_12_13 at 0 range 12 .. 13;
SPI2EN at 0 range 14 .. 14;
SPI3EN at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
USART2EN at 0 range 17 .. 17;
USART3EN at 0 range 18 .. 18;
UART4EN at 0 range 19 .. 19;
UART5EN at 0 range 20 .. 20;
I2C1EN at 0 range 21 .. 21;
I2C2EN at 0 range 22 .. 22;
I2C3EN at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
CAN1EN at 0 range 25 .. 25;
CAN2EN at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
PWREN at 0 range 28 .. 28;
DACEN at 0 range 29 .. 29;
UART7ENR at 0 range 30 .. 30;
UART8ENR at 0 range 31 .. 31;
end record;
-- APB2 peripheral clock enable register
type APB2ENR_Register is record
-- TIM1 clock enable
TIM1EN : Boolean := False;
-- TIM8 clock enable
TIM8EN : Boolean := False;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- USART1 clock enable
USART1EN : Boolean := False;
-- USART6 clock enable
USART6EN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- ADC1 clock enable
ADC1EN : Boolean := False;
-- ADC2 clock enable
ADC2EN : Boolean := False;
-- ADC3 clock enable
ADC3EN : Boolean := False;
-- SDIO clock enable
SDIOEN : Boolean := False;
-- SPI1 clock enable
SPI1EN : Boolean := False;
-- SPI4 clock enable
SPI4ENR : Boolean := False;
-- System configuration controller clock enable
SYSCFGEN : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- TIM9 clock enable
TIM9EN : Boolean := False;
-- TIM10 clock enable
TIM10EN : Boolean := False;
-- TIM11 clock enable
TIM11EN : Boolean := False;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- SPI5 clock enable
SPI5ENR : Boolean := False;
-- SPI6 clock enable
SPI6ENR : Boolean := False;
-- SAI1 clock enable
SAI1EN : Boolean := False;
-- unspecified
Reserved_23_25 : HAL.UInt3 := 16#0#;
-- LTDC clock enable
LTDCEN : Boolean := False;
-- DSI clocks enable
DSIEN : Boolean := False;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB2ENR_Register use record
TIM1EN at 0 range 0 .. 0;
TIM8EN at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
USART1EN at 0 range 4 .. 4;
USART6EN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADC1EN at 0 range 8 .. 8;
ADC2EN at 0 range 9 .. 9;
ADC3EN at 0 range 10 .. 10;
SDIOEN at 0 range 11 .. 11;
SPI1EN at 0 range 12 .. 12;
SPI4ENR at 0 range 13 .. 13;
SYSCFGEN at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
TIM9EN at 0 range 16 .. 16;
TIM10EN at 0 range 17 .. 17;
TIM11EN at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
SPI5ENR at 0 range 20 .. 20;
SPI6ENR at 0 range 21 .. 21;
SAI1EN at 0 range 22 .. 22;
Reserved_23_25 at 0 range 23 .. 25;
LTDCEN at 0 range 26 .. 26;
DSIEN at 0 range 27 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- AHB1 peripheral clock enable in low power mode register
type AHB1LPENR_Register is record
-- IO port A clock enable during sleep mode
GPIOALPEN : Boolean := True;
-- IO port B clock enable during Sleep mode
GPIOBLPEN : Boolean := True;
-- IO port C clock enable during Sleep mode
GPIOCLPEN : Boolean := True;
-- IO port D clock enable during Sleep mode
GPIODLPEN : Boolean := True;
-- IO port E clock enable during Sleep mode
GPIOELPEN : Boolean := True;
-- IO port F clock enable during Sleep mode
GPIOFLPEN : Boolean := True;
-- IO port G clock enable during Sleep mode
GPIOGLPEN : Boolean := True;
-- IO port H clock enable during Sleep mode
GPIOHLPEN : Boolean := True;
-- IO port I clock enable during Sleep mode
GPIOILPEN : Boolean := True;
-- IO port J clock enable during Sleep mode
GPIOJLPEN : Boolean := False;
-- IO port K clock enable during Sleep mode
GPIOKLPEN : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- CRC clock enable during Sleep mode
CRCLPEN : Boolean := True;
-- unspecified
Reserved_13_14 : HAL.UInt2 := 16#0#;
-- Flash interface clock enable during Sleep mode
FLITFLPEN : Boolean := True;
-- SRAM 1interface clock enable during Sleep mode
SRAM1LPEN : Boolean := True;
-- SRAM 2 interface clock enable during Sleep mode
SRAM2LPEN : Boolean := True;
-- Backup SRAM interface clock enable during Sleep mode
BKPSRAMLPEN : Boolean := True;
-- SRAM 3 interface clock enable during Sleep mode
SRAM3LPEN : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA1 clock enable during Sleep mode
DMA1LPEN : Boolean := True;
-- DMA2 clock enable during Sleep mode
DMA2LPEN : Boolean := True;
-- DMA2D clock enable during Sleep mode
DMA2DLPEN : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- Ethernet MAC clock enable during Sleep mode
ETHMACLPEN : Boolean := True;
-- Ethernet transmission clock enable during Sleep mode
ETHMACTXLPEN : Boolean := True;
-- Ethernet reception clock enable during Sleep mode
ETHMACRXLPEN : Boolean := True;
-- Ethernet PTP clock enable during Sleep mode
ETHMACPTPLPEN : Boolean := True;
-- USB OTG HS clock enable during Sleep mode
OTGHSLPEN : Boolean := True;
-- USB OTG HS ULPI clock enable during Sleep mode
OTGHSULPILPEN : Boolean := True;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB1LPENR_Register use record
GPIOALPEN at 0 range 0 .. 0;
GPIOBLPEN at 0 range 1 .. 1;
GPIOCLPEN at 0 range 2 .. 2;
GPIODLPEN at 0 range 3 .. 3;
GPIOELPEN at 0 range 4 .. 4;
GPIOFLPEN at 0 range 5 .. 5;
GPIOGLPEN at 0 range 6 .. 6;
GPIOHLPEN at 0 range 7 .. 7;
GPIOILPEN at 0 range 8 .. 8;
GPIOJLPEN at 0 range 9 .. 9;
GPIOKLPEN at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
CRCLPEN at 0 range 12 .. 12;
Reserved_13_14 at 0 range 13 .. 14;
FLITFLPEN at 0 range 15 .. 15;
SRAM1LPEN at 0 range 16 .. 16;
SRAM2LPEN at 0 range 17 .. 17;
BKPSRAMLPEN at 0 range 18 .. 18;
SRAM3LPEN at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
DMA1LPEN at 0 range 21 .. 21;
DMA2LPEN at 0 range 22 .. 22;
DMA2DLPEN at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
ETHMACLPEN at 0 range 25 .. 25;
ETHMACTXLPEN at 0 range 26 .. 26;
ETHMACRXLPEN at 0 range 27 .. 27;
ETHMACPTPLPEN at 0 range 28 .. 28;
OTGHSLPEN at 0 range 29 .. 29;
OTGHSULPILPEN at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- AHB2 peripheral clock enable in low power mode register
type AHB2LPENR_Register is record
-- Camera interface enable during Sleep mode
DCMILPEN : Boolean := True;
-- unspecified
Reserved_1_3 : HAL.UInt3 := 16#0#;
-- Cryptography modules clock enable during Sleep mode
CRYPLPEN : Boolean := True;
-- Hash modules clock enable during Sleep mode
HASHLPEN : Boolean := True;
-- Random number generator clock enable during Sleep mode
RNGLPEN : Boolean := True;
-- USB OTG FS clock enable during Sleep mode
OTGFSLPEN : Boolean := True;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB2LPENR_Register use record
DCMILPEN at 0 range 0 .. 0;
Reserved_1_3 at 0 range 1 .. 3;
CRYPLPEN at 0 range 4 .. 4;
HASHLPEN at 0 range 5 .. 5;
RNGLPEN at 0 range 6 .. 6;
OTGFSLPEN at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- AHB3 peripheral clock enable in low power mode register
type AHB3LPENR_Register is record
-- Flexible memory controller module clock enable during Sleep mode
FMCLPEN : Boolean := True;
-- QUADSPI memory controller module clock enable during Sleep mode
QSPILPEN : Boolean := False;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB3LPENR_Register use record
FMCLPEN at 0 range 0 .. 0;
QSPILPEN at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- APB1 peripheral clock enable in low power mode register
type APB1LPENR_Register is record
-- TIM2 clock enable during Sleep mode
TIM2LPEN : Boolean := True;
-- TIM3 clock enable during Sleep mode
TIM3LPEN : Boolean := True;
-- TIM4 clock enable during Sleep mode
TIM4LPEN : Boolean := True;
-- TIM5 clock enable during Sleep mode
TIM5LPEN : Boolean := True;
-- TIM6 clock enable during Sleep mode
TIM6LPEN : Boolean := True;
-- TIM7 clock enable during Sleep mode
TIM7LPEN : Boolean := True;
-- TIM12 clock enable during Sleep mode
TIM12LPEN : Boolean := True;
-- TIM13 clock enable during Sleep mode
TIM13LPEN : Boolean := True;
-- TIM14 clock enable during Sleep mode
TIM14LPEN : Boolean := True;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- Window watchdog clock enable during Sleep mode
WWDGLPEN : Boolean := True;
-- unspecified
Reserved_12_13 : HAL.UInt2 := 16#0#;
-- SPI2 clock enable during Sleep mode
SPI2LPEN : Boolean := True;
-- SPI3 clock enable during Sleep mode
SPI3LPEN : Boolean := True;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- USART2 clock enable during Sleep mode
USART2LPEN : Boolean := True;
-- USART3 clock enable during Sleep mode
USART3LPEN : Boolean := True;
-- UART4 clock enable during Sleep mode
UART4LPEN : Boolean := True;
-- UART5 clock enable during Sleep mode
UART5LPEN : Boolean := True;
-- I2C1 clock enable during Sleep mode
I2C1LPEN : Boolean := True;
-- I2C2 clock enable during Sleep mode
I2C2LPEN : Boolean := True;
-- I2C3 clock enable during Sleep mode
I2C3LPEN : Boolean := True;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- CAN 1 clock enable during Sleep mode
CAN1LPEN : Boolean := True;
-- CAN 2 clock enable during Sleep mode
CAN2LPEN : Boolean := True;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Power interface clock enable during Sleep mode
PWRLPEN : Boolean := True;
-- DAC interface clock enable during Sleep mode
DACLPEN : Boolean := True;
-- UART7 clock enable during Sleep mode
UART7LPEN : Boolean := False;
-- UART8 clock enable during Sleep mode
UART8LPEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB1LPENR_Register use record
TIM2LPEN at 0 range 0 .. 0;
TIM3LPEN at 0 range 1 .. 1;
TIM4LPEN at 0 range 2 .. 2;
TIM5LPEN at 0 range 3 .. 3;
TIM6LPEN at 0 range 4 .. 4;
TIM7LPEN at 0 range 5 .. 5;
TIM12LPEN at 0 range 6 .. 6;
TIM13LPEN at 0 range 7 .. 7;
TIM14LPEN at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
WWDGLPEN at 0 range 11 .. 11;
Reserved_12_13 at 0 range 12 .. 13;
SPI2LPEN at 0 range 14 .. 14;
SPI3LPEN at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
USART2LPEN at 0 range 17 .. 17;
USART3LPEN at 0 range 18 .. 18;
UART4LPEN at 0 range 19 .. 19;
UART5LPEN at 0 range 20 .. 20;
I2C1LPEN at 0 range 21 .. 21;
I2C2LPEN at 0 range 22 .. 22;
I2C3LPEN at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
CAN1LPEN at 0 range 25 .. 25;
CAN2LPEN at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
PWRLPEN at 0 range 28 .. 28;
DACLPEN at 0 range 29 .. 29;
UART7LPEN at 0 range 30 .. 30;
UART8LPEN at 0 range 31 .. 31;
end record;
-- APB2 peripheral clock enabled in low power mode register
type APB2LPENR_Register is record
-- TIM1 clock enable during Sleep mode
TIM1LPEN : Boolean := True;
-- TIM8 clock enable during Sleep mode
TIM8LPEN : Boolean := True;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- USART1 clock enable during Sleep mode
USART1LPEN : Boolean := True;
-- USART6 clock enable during Sleep mode
USART6LPEN : Boolean := True;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- ADC1 clock enable during Sleep mode
ADC1LPEN : Boolean := True;
-- ADC2 clock enable during Sleep mode
ADC2LPEN : Boolean := True;
-- ADC 3 clock enable during Sleep mode
ADC3LPEN : Boolean := True;
-- SDIO clock enable during Sleep mode
SDIOLPEN : Boolean := True;
-- SPI 1 clock enable during Sleep mode
SPI1LPEN : Boolean := True;
-- SPI 4 clock enable during Sleep mode
SPI4LPEN : Boolean := False;
-- System configuration controller clock enable during Sleep mode
SYSCFGLPEN : Boolean := True;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- TIM9 clock enable during sleep mode
TIM9LPEN : Boolean := True;
-- TIM10 clock enable during Sleep mode
TIM10LPEN : Boolean := True;
-- TIM11 clock enable during Sleep mode
TIM11LPEN : Boolean := True;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- SPI 5 clock enable during Sleep mode
SPI5LPEN : Boolean := False;
-- SPI 6 clock enable during Sleep mode
SPI6LPEN : Boolean := False;
-- SAI1 clock enable
SAI1LPEN : Boolean := False;
-- unspecified
Reserved_23_25 : HAL.UInt3 := 16#0#;
-- LTDC clock enable
LTDCLPEN : Boolean := False;
-- DSI clocks enable during Sleep mode
DSILPEN : Boolean := False;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB2LPENR_Register use record
TIM1LPEN at 0 range 0 .. 0;
TIM8LPEN at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
USART1LPEN at 0 range 4 .. 4;
USART6LPEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADC1LPEN at 0 range 8 .. 8;
ADC2LPEN at 0 range 9 .. 9;
ADC3LPEN at 0 range 10 .. 10;
SDIOLPEN at 0 range 11 .. 11;
SPI1LPEN at 0 range 12 .. 12;
SPI4LPEN at 0 range 13 .. 13;
SYSCFGLPEN at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
TIM9LPEN at 0 range 16 .. 16;
TIM10LPEN at 0 range 17 .. 17;
TIM11LPEN at 0 range 18 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
SPI5LPEN at 0 range 20 .. 20;
SPI6LPEN at 0 range 21 .. 21;
SAI1LPEN at 0 range 22 .. 22;
Reserved_23_25 at 0 range 23 .. 25;
LTDCLPEN at 0 range 26 .. 26;
DSILPEN at 0 range 27 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- BDCR_RTCSEL array
type BDCR_RTCSEL_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for BDCR_RTCSEL
type BDCR_RTCSEL_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- RTCSEL as a value
Val : HAL.UInt2;
when True =>
-- RTCSEL as an array
Arr : BDCR_RTCSEL_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for BDCR_RTCSEL_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Backup domain control register
type BDCR_Register is record
-- External low-speed oscillator enable
LSEON : Boolean := False;
-- Read-only. External low-speed oscillator ready
LSERDY : Boolean := False;
-- External low-speed oscillator bypass
LSEBYP : Boolean := False;
-- External low-speed oscillator mode
LSEMOD : Boolean := False;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- RTC clock source selection
RTCSEL : BDCR_RTCSEL_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_10_14 : HAL.UInt5 := 16#0#;
-- RTC clock enable
RTCEN : Boolean := False;
-- Backup domain software reset
BDRST : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BDCR_Register use record
LSEON at 0 range 0 .. 0;
LSERDY at 0 range 1 .. 1;
LSEBYP at 0 range 2 .. 2;
LSEMOD at 0 range 3 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
RTCSEL at 0 range 8 .. 9;
Reserved_10_14 at 0 range 10 .. 14;
RTCEN at 0 range 15 .. 15;
BDRST at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- clock control & status register
type CSR_Register is record
-- Internal low-speed oscillator enable
LSION : Boolean := False;
-- Read-only. Internal low-speed oscillator ready
LSIRDY : Boolean := False;
-- unspecified
Reserved_2_23 : HAL.UInt22 := 16#0#;
-- Remove reset flag
RMVF : Boolean := False;
-- BOR reset flag
BORRSTF : Boolean := True;
-- PIN reset flag
PADRSTF : Boolean := True;
-- POR/PDR reset flag
PORRSTF : Boolean := True;
-- Software reset flag
SFTRSTF : Boolean := False;
-- Independent watchdog reset flag
WDGRSTF : Boolean := False;
-- Window watchdog reset flag
WWDGRSTF : Boolean := False;
-- Low-power reset flag
LPWRRSTF : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CSR_Register use record
LSION at 0 range 0 .. 0;
LSIRDY at 0 range 1 .. 1;
Reserved_2_23 at 0 range 2 .. 23;
RMVF at 0 range 24 .. 24;
BORRSTF at 0 range 25 .. 25;
PADRSTF at 0 range 26 .. 26;
PORRSTF at 0 range 27 .. 27;
SFTRSTF at 0 range 28 .. 28;
WDGRSTF at 0 range 29 .. 29;
WWDGRSTF at 0 range 30 .. 30;
LPWRRSTF at 0 range 31 .. 31;
end record;
subtype SSCGR_MODPER_Field is HAL.UInt13;
subtype SSCGR_INCSTEP_Field is HAL.UInt15;
-- spread spectrum clock generation register
type SSCGR_Register is record
-- Modulation period
MODPER : SSCGR_MODPER_Field := 16#0#;
-- Incrementation step
INCSTEP : SSCGR_INCSTEP_Field := 16#0#;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
-- Spread Select
SPREADSEL : Boolean := False;
-- Spread spectrum modulation enable
SSCGEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SSCGR_Register use record
MODPER at 0 range 0 .. 12;
INCSTEP at 0 range 13 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
SPREADSEL at 0 range 30 .. 30;
SSCGEN at 0 range 31 .. 31;
end record;
subtype PLLI2SCFGR_PLLI2SN_Field is HAL.UInt9;
subtype PLLI2SCFGR_PLLI2SQ_Field is HAL.UInt4;
subtype PLLI2SCFGR_PLLI2SR_Field is HAL.UInt3;
-- PLLI2S configuration register
type PLLI2SCFGR_Register is record
-- unspecified
Reserved_0_5 : HAL.UInt6 := 16#0#;
-- PLLI2S multiplication factor for VCO
PLLI2SN : PLLI2SCFGR_PLLI2SN_Field := 16#C0#;
-- unspecified
Reserved_15_23 : HAL.UInt9 := 16#0#;
-- PLLI2S division factor for SAI1 clock
PLLI2SQ : PLLI2SCFGR_PLLI2SQ_Field := 16#0#;
-- PLLI2S division factor for I2S clocks
PLLI2SR : PLLI2SCFGR_PLLI2SR_Field := 16#2#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PLLI2SCFGR_Register use record
Reserved_0_5 at 0 range 0 .. 5;
PLLI2SN at 0 range 6 .. 14;
Reserved_15_23 at 0 range 15 .. 23;
PLLI2SQ at 0 range 24 .. 27;
PLLI2SR at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype PLLSAICFGR_PLLSAIN_Field is HAL.UInt9;
subtype PLLSAICFGR_PLLSAIP_Field is HAL.UInt2;
subtype PLLSAICFGR_PLLSAIQ_Field is HAL.UInt4;
subtype PLLSAICFGR_PLLSAIR_Field is HAL.UInt3;
-- PLL configuration register
type PLLSAICFGR_Register is record
-- unspecified
Reserved_0_5 : HAL.UInt6 := 16#0#;
-- PLLSAI division factor for VCO
PLLSAIN : PLLSAICFGR_PLLSAIN_Field := 16#C0#;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- PLLSAI division factor for 48 MHz clock
PLLSAIP : PLLSAICFGR_PLLSAIP_Field := 16#0#;
-- unspecified
Reserved_18_23 : HAL.UInt6 := 16#0#;
-- PLLSAI division factor for SAI1 clock
PLLSAIQ : PLLSAICFGR_PLLSAIQ_Field := 16#4#;
-- PLLSAI division factor for LCD clock
PLLSAIR : PLLSAICFGR_PLLSAIR_Field := 16#2#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PLLSAICFGR_Register use record
Reserved_0_5 at 0 range 0 .. 5;
PLLSAIN at 0 range 6 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
PLLSAIP at 0 range 16 .. 17;
Reserved_18_23 at 0 range 18 .. 23;
PLLSAIQ at 0 range 24 .. 27;
PLLSAIR at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DCKCFGR_PLLIS2DIVQ_Field is HAL.UInt5;
subtype DCKCFGR_PLLSAIDIVQ_Field is HAL.UInt5;
subtype DCKCFGR_PLLSAIDIVR_Field is HAL.UInt2;
subtype DCKCFGR_SAI1ASRC_Field is HAL.UInt2;
subtype DCKCFGR_SAI1BSRC_Field is HAL.UInt2;
-- Dedicated Clock Configuration Register
type DCKCFGR_Register is record
-- PLLI2S division factor for SAIs clock
PLLIS2DIVQ : DCKCFGR_PLLIS2DIVQ_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- PLLSAI division factor for SAIs clock
PLLSAIDIVQ : DCKCFGR_PLLSAIDIVQ_Field := 16#0#;
-- unspecified
Reserved_13_15 : HAL.UInt3 := 16#0#;
-- PLLSAIDIVR
PLLSAIDIVR : DCKCFGR_PLLSAIDIVR_Field := 16#0#;
-- unspecified
Reserved_18_19 : HAL.UInt2 := 16#0#;
-- SAI1 clock source selection
SAI1ASRC : DCKCFGR_SAI1ASRC_Field := 16#0#;
-- SAI1-B clock source selection
SAI1BSRC : DCKCFGR_SAI1BSRC_Field := 16#0#;
-- Timers clocks prescalers selection
TIMPRE : Boolean := False;
-- unspecified
Reserved_25_26 : HAL.UInt2 := 16#0#;
-- 48 MHz clock source selection
MSEL : Boolean := False;
-- SDIO clock source selection
SDMMCSEL : Boolean := False;
-- DSI clock source selection
DSISEL : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DCKCFGR_Register use record
PLLIS2DIVQ at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
PLLSAIDIVQ at 0 range 8 .. 12;
Reserved_13_15 at 0 range 13 .. 15;
PLLSAIDIVR at 0 range 16 .. 17;
Reserved_18_19 at 0 range 18 .. 19;
SAI1ASRC at 0 range 20 .. 21;
SAI1BSRC at 0 range 22 .. 23;
TIMPRE at 0 range 24 .. 24;
Reserved_25_26 at 0 range 25 .. 26;
MSEL at 0 range 27 .. 27;
SDMMCSEL at 0 range 28 .. 28;
DSISEL at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Reset and clock control
type RCC_Peripheral is record
-- clock control register
CR : aliased CR_Register;
-- PLL configuration register
PLLCFGR : aliased PLLCFGR_Register;
-- clock configuration register
CFGR : aliased CFGR_Register;
-- clock interrupt register
CIR : aliased CIR_Register;
-- AHB1 peripheral reset register
AHB1RSTR : aliased AHB1RSTR_Register;
-- AHB2 peripheral reset register
AHB2RSTR : aliased AHB2RSTR_Register;
-- AHB3 peripheral reset register
AHB3RSTR : aliased AHB3RSTR_Register;
-- APB1 peripheral reset register
APB1RSTR : aliased APB1RSTR_Register;
-- APB2 peripheral reset register
APB2RSTR : aliased APB2RSTR_Register;
-- AHB1 peripheral clock register
AHB1ENR : aliased AHB1ENR_Register;
-- AHB2 peripheral clock enable register
AHB2ENR : aliased AHB2ENR_Register;
-- AHB3 peripheral clock enable register
AHB3ENR : aliased AHB3ENR_Register;
-- APB1 peripheral clock enable register
APB1ENR : aliased APB1ENR_Register;
-- APB2 peripheral clock enable register
APB2ENR : aliased APB2ENR_Register;
-- AHB1 peripheral clock enable in low power mode register
AHB1LPENR : aliased AHB1LPENR_Register;
-- AHB2 peripheral clock enable in low power mode register
AHB2LPENR : aliased AHB2LPENR_Register;
-- AHB3 peripheral clock enable in low power mode register
AHB3LPENR : aliased AHB3LPENR_Register;
-- APB1 peripheral clock enable in low power mode register
APB1LPENR : aliased APB1LPENR_Register;
-- APB2 peripheral clock enabled in low power mode register
APB2LPENR : aliased APB2LPENR_Register;
-- Backup domain control register
BDCR : aliased BDCR_Register;
-- clock control & status register
CSR : aliased CSR_Register;
-- spread spectrum clock generation register
SSCGR : aliased SSCGR_Register;
-- PLLI2S configuration register
PLLI2SCFGR : aliased PLLI2SCFGR_Register;
-- PLL configuration register
PLLSAICFGR : aliased PLLSAICFGR_Register;
-- Dedicated Clock Configuration Register
DCKCFGR : aliased DCKCFGR_Register;
end record
with Volatile;
for RCC_Peripheral use record
CR at 16#0# range 0 .. 31;
PLLCFGR at 16#4# range 0 .. 31;
CFGR at 16#8# range 0 .. 31;
CIR at 16#C# range 0 .. 31;
AHB1RSTR at 16#10# range 0 .. 31;
AHB2RSTR at 16#14# range 0 .. 31;
AHB3RSTR at 16#18# range 0 .. 31;
APB1RSTR at 16#20# range 0 .. 31;
APB2RSTR at 16#24# range 0 .. 31;
AHB1ENR at 16#30# range 0 .. 31;
AHB2ENR at 16#34# range 0 .. 31;
AHB3ENR at 16#38# range 0 .. 31;
APB1ENR at 16#40# range 0 .. 31;
APB2ENR at 16#44# range 0 .. 31;
AHB1LPENR at 16#50# range 0 .. 31;
AHB2LPENR at 16#54# range 0 .. 31;
AHB3LPENR at 16#58# range 0 .. 31;
APB1LPENR at 16#60# range 0 .. 31;
APB2LPENR at 16#64# range 0 .. 31;
BDCR at 16#70# range 0 .. 31;
CSR at 16#74# range 0 .. 31;
SSCGR at 16#80# range 0 .. 31;
PLLI2SCFGR at 16#84# range 0 .. 31;
PLLSAICFGR at 16#88# range 0 .. 31;
DCKCFGR at 16#8C# range 0 .. 31;
end record;
-- Reset and clock control
RCC_Periph : aliased RCC_Peripheral
with Import, Address => System'To_Address (16#40023800#);
end STM32_SVD.RCC;
|
stcarrez/ada-awa | Ada | 2,292 | ads | -----------------------------------------------------------------------
-- awa-votes -- Module votes
-- Copyright (C) 2013, 2015, 2018, 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.
-----------------------------------------------------------------------
-- = Votes Module =
-- The `votes` module allows users to vote for objects defined in the
-- application. Users can vote by setting a rating value on an item
-- (+1, -1 or any other integer value). The `votes` module makes sure
-- that users can vote only once for an item. A global rating
-- is associated with the item to give the vote summary. The vote can
-- be associated with any database entity and it is not necessary to
-- change other entities in your data model.
--
-- @include awa-votes-modules.ads
-- @include awa-votes-beans.ads
--
-- == Javascript integration ==
-- The `votes` module provides a Javascript support to help users vote
-- for items. The Javascript file `/js/awa-votes.js` must be included
-- in the Javascript page. It is based on jQuery and ASF. The vote
-- actions are activated on the page items as follows in XHTML facelet files:
--
-- <util:script>
-- $('.question-vote').votes({
-- voteUrl: "#{contextPath}/questions/ajax/questionVote/vote?id=",
-- itemPrefix: "vote_for-"
-- });
-- </util:script>
--
-- When the vote up or down HTML element is clicked, the `vote` operation
-- of the managed bean `questionVote` is called. The operation will
-- update the user's vote for the selected item (in the example "a question").
--
-- == Data model ==
-- [images/awa_votes_model.png]
--
package AWA.Votes is
pragma Preelaborate;
end AWA.Votes;
|
reznikmm/matreshka | Ada | 4,333 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- 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$
------------------------------------------------------------------------------
-- This package provides component to construct namespace by processing all
-- included and redefined schema documents.
------------------------------------------------------------------------------
with XML.SAX.Error_Handlers;
with Matreshka.XML_Schema.AST;
with Matreshka.XML_Schema.Visitors;
package Matreshka.XML_Schema.Namespace_Builders is
pragma Preelaborate;
type Namespace_Builder is
new Matreshka.XML_Schema.Visitors.Abstract_Visitor with private;
procedure Analyze
(Self : in out Namespace_Builder'Class;
Namespace : not null Matreshka.XML_Schema.AST.Namespace_Access;
Schema : not null Matreshka.XML_Schema.AST.Schema_Access;
Error_Handler :
not null access XML.SAX.Error_Handlers.SAX_Error_Handler'Class);
-- Builds Namespace from data from Schema.
private
type Namespace_Builder is
new Matreshka.XML_Schema.Visitors.Abstract_Visitor with null record;
end Matreshka.XML_Schema.Namespace_Builders;
|
reznikmm/matreshka | Ada | 9,118 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- SQL Database Access --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Text_Codecs;
package body SQL.Queries is
procedure Raise_SQL_Error
(Self : in out SQL_Query'Class; Success : Boolean);
-- Raises SQL_Error when Success is not equal to True. Constructs exception
-- message from Error_Message of query.
------------
-- Adjust --
------------
overriding procedure Adjust (Self : in out SQL_Query) is
begin
Matreshka.Internals.SQL_Drivers.Reference (Self.Data);
end Adjust;
----------------
-- Bind_Value --
----------------
procedure Bind_Value
(Self : in out SQL_Query'Class;
Name : League.Strings.Universal_String;
Value : League.Holders.Holder;
Direction : Parameter_Directions := In_Parameter) is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return;
end if;
Self.Data.Bind_Value (Name.To_Casefold, Value, Direction);
end Bind_Value;
-----------------
-- Bound_Value --
-----------------
function Bound_Value
(Self : SQL_Query'Class;
Name : League.Strings.Universal_String) return League.Holders.Holder is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return League.Holders.Empty_Holder;
end if;
return Self.Data.Bound_Value (Name.To_Casefold);
end Bound_Value;
-------------------
-- Error_Message --
-------------------
function Error_Message
(Self : SQL_Query'Class) return League.Strings.Universal_String is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return League.Strings.To_Universal_String ("object was invalidated");
end if;
return Self.Data.Error_Message;
end Error_Message;
-------------
-- Execute --
-------------
function Execute (Self : in out SQL_Query'Class) return Boolean is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return False;
end if;
return Self.Data.Execute;
end Execute;
-------------
-- Execute --
-------------
procedure Execute (Self : in out SQL_Query'Class) is
begin
Self.Raise_SQL_Error (Self.Execute);
end Execute;
--------------
-- Finalize --
--------------
overriding procedure Finalize (Self : in out SQL_Query) is
use type Matreshka.Internals.SQL_Drivers.Query_Access;
begin
-- Finalize must be idempotent according to language rules.
if Self.Data /= null then
Matreshka.Internals.SQL_Drivers.Dereference (Self.Data);
end if;
end Finalize;
------------
-- Finish --
------------
procedure Finish (Self : in out SQL_Query'Class) is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return;
end if;
Self.Data.Finish;
end Finish;
---------------
-- Is_Active --
---------------
function Is_Active (Self : SQL_Query'Class) return Boolean is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return False;
end if;
return Self.Data.Is_Active;
end Is_Active;
--------------
-- Is_Valid --
--------------
function Is_Valid (Self : SQL_Query'Class) return Boolean is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return False;
end if;
return Self.Data.Is_Valid;
end Is_Valid;
----------
-- Next --
----------
function Next (Self : in out SQL_Query'Class) return Boolean is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return False;
end if;
return Self.Data.Next;
end Next;
-------------
-- Prepare --
-------------
function Prepare
(Self : in out SQL_Query'Class;
Query : League.Strings.Universal_String) return Boolean is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return False;
end if;
return Self.Data.Prepare (Query);
end Prepare;
-------------
-- Prepare --
-------------
procedure Prepare
(Self : in out SQL_Query'Class; Query : League.Strings.Universal_String) is
begin
Self.Raise_SQL_Error (Self.Prepare (Query));
end Prepare;
--------------
-- Previous --
--------------
-- function Previous (Self : in out SQL_Query'Class) return Boolean;
procedure Previous (Self : in out SQL_Query'Class) is
begin
if not Self.Data.Is_Object_Valid then
-- Returns when internal object was invalidated.
return;
end if;
end Previous;
---------------------
-- Raise_SQL_Error --
---------------------
procedure Raise_SQL_Error
(Self : in out SQL_Query'Class; Success : Boolean) is
begin
if not Success then
raise SQL_Error
with League.Text_Codecs.To_Exception_Message (Self.Error_Message);
end if;
end Raise_SQL_Error;
-----------
-- Value --
-----------
function Value
(Self : SQL_Query'Class;
Index : Positive) return League.Holders.Holder is
begin
if not Self.Data.Is_Object_Valid
or else not Self.Data.Is_Active
or else not Self.Data.Is_Valid
then
-- Returns when internal object was invalidated or not in active
-- state.
return League.Holders.Empty_Holder;
end if;
return Self.Data.Value (Index);
end Value;
end SQL.Queries;
|
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.Elements;
package ODF.DOM.Text_Outline_Style_Elements is
pragma Preelaborate;
type ODF_Text_Outline_Style is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Text_Outline_Style_Access is
access all ODF_Text_Outline_Style'Class
with Storage_Size => 0;
end ODF.DOM.Text_Outline_Style_Elements;
|
reznikmm/matreshka | Ada | 3,613 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Elements.Table.Table is
type ODF_Table_Table is
new XML.DOM.Elements.DOM_Element with private;
private
type ODF_Table_Table is
new XML.DOM.Elements.DOM_Element with null record;
end ODF.DOM.Elements.Table.Table;
|
AdaCore/libadalang | Ada | 417 | ads | package Valid is
Int_Max_1 : constant Integer := Integer'Max (1, 2);
--% node.f_default_expr.p_eval_as_int
Int_Max_2 : constant Integer := Integer'Max (5, 4);
--% node.f_default_expr.p_eval_as_int
Int_Min_1 : constant Integer := Integer'Min (1, 2);
--% node.f_default_expr.p_eval_as_int
Int_Min_2 : constant Integer := Integer'Min (5, 4);
--% node.f_default_expr.p_eval_as_int
end Valid;
|
albertklee/SPARKZumo | Ada | 1,159 | adb | pragma SPARK_Mode;
with System;
with Proc_Types; use Proc_Types;
package body Pwm is
TCCR1A : Register
with Address => System'To_Address (16#80#);
TCCR1B : Register
with Address => System'To_Address (16#81#);
ICR1 : Double_Register
with Address => System'To_Address (16#86#);
OCR1A : Double_Register
with Address => System'To_Address (16#88#);
OCR1B : Double_Register
with Address => System'To_Address (16#8A#);
procedure Configure_Timers
is
begin
-- Timer 1 configuration
-- prescaler: clockI/O / 1
-- outputs enabled
-- phase-correct PWM
-- top of 400
--
-- PWM frequency calculation
-- 16MHz / 1 (prescaler) / 2 (phase-correct) / 400 (top) = 20kHz
TCCR1A := 2#1010_0000#;
TCCR1B := 2#0001_0001#;
ICR1 := 400;
end Configure_Timers;
procedure SetRate (Index : Pwm_Index;
Value : Word)
is
begin
case Index is
when Left =>
OCR1B := Double_Register (Value);
when Right =>
OCR1A := Double_Register (Value);
end case;
end SetRate;
end Pwm;
|
stcarrez/ada-util | Ada | 3,222 | adb | -----------------------------------------------------------------------
-- facebook -- Get information about a Facebook user using the Facebook API
-- Copyright (C) 2012, 2014 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Text_IO;
with Ada.Command_Line;
with Ada.Strings.Unbounded;
with Util.Http.Clients.AWS;
with Util.Http.Rest;
with Mapping;
-- This example shows how to invoke a REST service, retrieve and extract a JSON content
-- into some Ada record. It uses the Facebook Graph API which does not need any
-- authentication (ie, the public Facebook API).
procedure Facebook is
procedure Print (P : in Mapping.Person);
procedure Print (P : in Mapping.Person) is
use Ada.Strings.Unbounded;
begin
Ada.Text_IO.Put_Line ("Id : " & Long_Long_Integer'Image (P.Id));
Ada.Text_IO.Put_Line ("Name : " & To_String (P.Name));
Ada.Text_IO.Put_Line ("First name : " & To_String (P.First_Name));
Ada.Text_IO.Put_Line ("Last name : " & To_String (P.Last_Name));
Ada.Text_IO.Put_Line ("Username : " & To_String (P.Username));
Ada.Text_IO.Put_Line ("Gender : " & To_String (P.Gender));
Ada.Text_IO.Put_Line ("Link : " & To_String (P.Link));
end Print;
procedure Get_User is new Util.Http.Rest.Rest_Get (Mapping.Person_Mapper);
Count : constant Natural := Ada.Command_Line.Argument_Count;
-- Mapping for the Person record.
Person_Mapping : aliased Mapping.Person_Mapper.Mapper;
begin
if Count = 0 then
Ada.Text_IO.Put_Line ("Usage: facebook username ...");
Ada.Text_IO.Put_Line ("Example: facebook btaylor");
return;
end if;
Person_Mapping.Add_Mapping ("id", Mapping.FIELD_ID);
Person_Mapping.Add_Mapping ("name", Mapping.FIELD_NAME);
Person_Mapping.Add_Mapping ("first_name", Mapping.FIELD_FIRST_NAME);
Person_Mapping.Add_Mapping ("last_name", Mapping.FIELD_LAST_NAME);
Person_Mapping.Add_Mapping ("link", Mapping.FIELD_LINK);
Person_Mapping.Add_Mapping ("username", Mapping.FIELD_USER_NAME);
Person_Mapping.Add_Mapping ("gender", Mapping.FIELD_GENDER);
Util.Http.Clients.AWS.Register;
for I in 1 .. Count loop
declare
URI : constant String := Ada.Command_Line.Argument (I);
P : aliased Mapping.Person;
begin
Get_User (URI => "https://graph.facebook.com/" & URI,
Mapping => Person_Mapping'Unchecked_Access,
Into => P'Unchecked_Access);
Print (P);
end;
end loop;
end Facebook;
|
shinesolutions/swagger-aem | Ada | 243,410 | adb | -- Adobe Experience Manager (AEM) API
-- Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
--
-- The version of the OpenAPI document: 3.5.0_pre.0
-- Contact: [email protected]
--
-- NOTE: This package is auto generated by OpenAPI-Generator 5.2.1.
-- https://openapi-generator.tech
-- Do not edit the class manually.
pragma Warnings (Off, "*is not referenced");
with Swagger.Streams;
with Swagger.Servers.Operation;
package body .Skeletons is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*use clause for package*");
use Swagger.Streams;
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 => URI_Prefix & "/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
Impl.Get_Aem_Product_Info (Result, Context);
if Context.Get_Status = 200 then
Stream.Start_Document;
Swagger.Streams.Serialize (Stream, "", Result);
Stream.End_Document;
end if;
end Get_Aem_Product_Info;
package API_Get_Bundle_Info is
new Swagger.Servers.Operation (Handler => Get_Bundle_Info,
Method => Swagger.Servers.GET,
URI => URI_Prefix & "/system/console/bundles/{name}.json");
--
procedure Get_Bundle_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;
Name : Swagger.UString;
Result : .Models.BundleInfo_Type;
begin
Swagger.Servers.Get_Path_Parameter (Req, 1, Name);
Impl.Get_Bundle_Info
(Name, Result, Context);
if Context.Get_Status = 200 then
Stream.Start_Document;
.Models.Serialize (Stream, "", Result);
Stream.End_Document;
end if;
end Get_Bundle_Info;
package API_Get_Config_Mgr is
new Swagger.Servers.Operation (Handler => Get_Config_Mgr,
Method => Swagger.Servers.GET,
URI => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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_URL : Swagger.Nullable_UString;
Sp_Private_Key_Alias : Swagger.Nullable_UString;
Key_Store_Password : Swagger.Nullable_UString;
Default_Redirect_Url : Swagger.Nullable_UString;
User_IDAttribute : 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
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_URL);
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_IDAttribute);
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_URL,
Sp_Private_Key_Alias,
Key_Store_Password,
Default_Redirect_Url,
User_IDAttribute,
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 => URI_Prefix & "/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 => URI_Prefix & "/.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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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_Ssl_Setup is
new Swagger.Servers.Operation (Handler => Ssl_Setup,
Method => Swagger.Servers.POST,
URI => URI_Prefix & "/libs/granite/security/post/sslSetup.html");
--
procedure Ssl_Setup
(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;
Keystore_Password : Swagger.UString;
Keystore_Password_Confirm : Swagger.UString;
Truststore_Password : Swagger.UString;
Truststore_Password_Confirm : Swagger.UString;
Https_Hostname : Swagger.UString;
Https_Port : Swagger.UString;
Privatekey_File : Swagger.File_Part_Type;
Certificate_File : Swagger.File_Part_Type;
Result : Swagger.UString;
begin
Swagger.Servers.Get_Query_Parameter (Req, "keystorePassword", Keystore_Password);
Swagger.Servers.Get_Query_Parameter (Req, "keystorePasswordConfirm", Keystore_Password_Confirm);
Swagger.Servers.Get_Query_Parameter (Req, "truststorePassword", Truststore_Password);
Swagger.Servers.Get_Query_Parameter (Req, "truststorePasswordConfirm", Truststore_Password_Confirm);
Swagger.Servers.Get_Query_Parameter (Req, "httpsHostname", Https_Hostname);
Swagger.Servers.Get_Query_Parameter (Req, "httpsPort", Https_Port);
Swagger.Servers.Get_Parameter (Context, "privatekeyFile", Privatekey_File);
Swagger.Servers.Get_Parameter (Context, "certificateFile", Certificate_File);
Impl.Ssl_Setup
(Keystore_Password,
Keystore_Password_Confirm,
Truststore_Password,
Truststore_Password_Confirm,
Https_Hostname,
Https_Port,
Privatekey_File,
Certificate_File, Result, Context);
if Context.Get_Status = 200 then
Stream.Start_Document;
Swagger.Streams.Serialize (Stream, "", Result);
Stream.End_Document;
end if;
end Ssl_Setup;
package API_Delete_Agent is
new Swagger.Servers.Operation (Handler => Delete_Agent,
Method => Swagger.Servers.DELETE,
URI => URI_Prefix & "/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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/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
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 => URI_Prefix & "/{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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/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
Swagger.Servers.Get_Path_Parameter (Req, 1, Group);
Swagger.Servers.Get_Path_Parameter (Req, 2, 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 => URI_Prefix & "/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
Swagger.Servers.Get_Path_Parameter (Req, 1, Group);
Swagger.Servers.Get_Path_Parameter (Req, 2, 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 => URI_Prefix & "/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;
P_1Property : Swagger.UString;
P_1Property_Periodvalue : Swagger.UString;
Result : Swagger.UString;
begin
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", P_1Property);
Swagger.Servers.Get_Query_Parameter (Req, "1_property.value", P_1Property_Periodvalue);
Impl.Get_Query
(Path,
P_Periodlimit,
P_1Property,
P_1Property_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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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_HTTPConnection_Closed : Swagger.Nullable_Boolean;
Jcr_Content_Slashprotocol_HTTPExpired : Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPHeaders : Swagger.UString_Vectors.Vector;
Jcr_Content_Slashprotocol_HTTPHeaders_At_Type_Hint : Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPMethod : Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPSRelaxed : 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_NTLMDomain : Swagger.Nullable_UString;
Jcr_Content_Slashproxy_NTLMHost : 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_NTLMDomain : Swagger.Nullable_UString;
Jcr_Content_Slashtransport_NTLMHost : 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
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_HTTPConnection_Closed);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPExpired", Jcr_Content_Slashprotocol_HTTPExpired);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPHeaders", Jcr_Content_Slashprotocol_HTTPHeaders);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPHeaders@TypeHint", Jcr_Content_Slashprotocol_HTTPHeaders_At_Type_Hint);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPMethod", Jcr_Content_Slashprotocol_HTTPMethod);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPSRelaxed", Jcr_Content_Slashprotocol_HTTPSRelaxed);
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_NTLMDomain);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyNTLMHost", Jcr_Content_Slashproxy_NTLMHost);
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_NTLMDomain);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportNTLMHost", Jcr_Content_Slashtransport_NTLMHost);
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, 1, 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_HTTPConnection_Closed,
Jcr_Content_Slashprotocol_HTTPExpired,
Jcr_Content_Slashprotocol_HTTPHeaders,
Jcr_Content_Slashprotocol_HTTPHeaders_At_Type_Hint,
Jcr_Content_Slashprotocol_HTTPMethod,
Jcr_Content_Slashprotocol_HTTPSRelaxed,
Jcr_Content_Slashprotocol_Interface,
Jcr_Content_Slashprotocol_Socket_Timeout,
Jcr_Content_Slashprotocol_Version,
Jcr_Content_Slashproxy_NTLMDomain,
Jcr_Content_Slashproxy_NTLMHost,
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_NTLMDomain,
Jcr_Content_Slashtransport_NTLMHost,
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 => URI_Prefix & "/{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
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, 1, 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 => URI_Prefix & "/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
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 => URI_Prefix & "/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_IDAttribute : Swagger.Nullable_UString;
User_IDAttribute_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_URL : Swagger.Nullable_UString;
Assertion_Consumer_Service_URLAt_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
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_IDAttribute);
Swagger.Servers.Get_Query_Parameter (Req, "userIDAttribute@TypeHint", User_IDAttribute_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_URL);
Swagger.Servers.Get_Query_Parameter (Req, "assertionConsumerServiceURL@TypeHint", Assertion_Consumer_Service_URLAt_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_IDAttribute,
User_IDAttribute_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_URL,
Assertion_Consumer_Service_URLAt_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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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_Config_Property is
new Swagger.Servers.Operation (Handler => Post_Config_Property,
Method => Swagger.Servers.POST,
URI => URI_Prefix & "/apps/system/config/{configNodeName}");
--
procedure Post_Config_Property
(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;
Config_Node_Name : Swagger.UString;
begin
Swagger.Servers.Get_Path_Parameter (Req, 1, Config_Node_Name);
Impl.Post_Config_Property
(Config_Node_Name, Context);
end Post_Config_Property;
package API_Post_Node is
new Swagger.Servers.Operation (Handler => Post_Node,
Method => Swagger.Servers.POST,
URI => URI_Prefix & "/{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
Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation);
Swagger.Servers.Get_Query_Parameter (Req, "deleteAuthorizable", Delete_Authorizable);
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Query_Parameter (Req, "addMembers", Add_Members);
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
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 => URI_Prefix & "/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;
P_1Property : Swagger.UString;
P_1Property_Periodvalue : Swagger.UString;
Result : Swagger.UString;
begin
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", P_1Property);
Swagger.Servers.Get_Query_Parameter (Req, "1_property.value", P_1Property_Periodvalue);
Impl.Post_Query
(Path,
P_Periodlimit,
P_1Property,
P_1Property_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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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_PKCS12 is
new Swagger.Servers.Operation (Handler => Post_Truststore_PKCS12,
Method => Swagger.Servers.POST,
URI => URI_Prefix & "/etc/truststore");
--
procedure Post_Truststore_PKCS12
(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_Periodp_12 : Swagger.File_Part_Type;
Result : Swagger.UString;
begin
Swagger.Servers.Get_Parameter (Context, "truststore.p12", Truststore_Periodp_12);
Impl.Post_Truststore_PKCS12
(Truststore_Periodp_12, Result, Context);
if Context.Get_Status = 200 then
Stream.Start_Document;
Swagger.Streams.Serialize (Stream, "", Result);
Stream.End_Document;
end if;
end Post_Truststore_PKCS12;
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_Bundle_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_Ssl_Setup.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_Config_Property.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_PKCS12.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
Server.Get_Aem_Product_Info (Result, Context);
if Context.Get_Status = 200 then
Stream.Start_Document;
Swagger.Streams.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 => URI_Prefix & "/system/console/status-productinfo.json");
--
procedure Get_Bundle_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
Name : Swagger.UString;
Result : .Models.BundleInfo_Type;
begin
Swagger.Servers.Get_Path_Parameter (Req, 1, Name);
Server.Get_Bundle_Info
(Name, Result, Context);
if Context.Get_Status = 200 then
Stream.Start_Document;
.Models.Serialize (Stream, "", Result);
Stream.End_Document;
end if;
end Get_Bundle_Info;
package API_Get_Bundle_Info is
new Swagger.Servers.Operation (Handler => Get_Bundle_Info,
Method => Swagger.Servers.GET,
URI => URI_Prefix & "/system/console/bundles/{name}.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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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_URL : Swagger.Nullable_UString;
Sp_Private_Key_Alias : Swagger.Nullable_UString;
Key_Store_Password : Swagger.Nullable_UString;
Default_Redirect_Url : Swagger.Nullable_UString;
User_IDAttribute : 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
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_URL);
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_IDAttribute);
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_URL,
Sp_Private_Key_Alias,
Key_Store_Password,
Default_Redirect_Url,
User_IDAttribute,
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 => URI_Prefix & "/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 => URI_Prefix & "/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
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 => URI_Prefix & "/.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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/apps/system/config/com.shinesolutions.aem.passwordreset.Activator");
--
procedure Ssl_Setup
(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
Keystore_Password : Swagger.UString;
Keystore_Password_Confirm : Swagger.UString;
Truststore_Password : Swagger.UString;
Truststore_Password_Confirm : Swagger.UString;
Https_Hostname : Swagger.UString;
Https_Port : Swagger.UString;
Privatekey_File : Swagger.File_Part_Type;
Certificate_File : Swagger.File_Part_Type;
Result : Swagger.UString;
begin
Swagger.Servers.Get_Query_Parameter (Req, "keystorePassword", Keystore_Password);
Swagger.Servers.Get_Query_Parameter (Req, "keystorePasswordConfirm", Keystore_Password_Confirm);
Swagger.Servers.Get_Query_Parameter (Req, "truststorePassword", Truststore_Password);
Swagger.Servers.Get_Query_Parameter (Req, "truststorePasswordConfirm", Truststore_Password_Confirm);
Swagger.Servers.Get_Query_Parameter (Req, "httpsHostname", Https_Hostname);
Swagger.Servers.Get_Query_Parameter (Req, "httpsPort", Https_Port);
Swagger.Servers.Get_Parameter (Context, "privatekeyFile", Privatekey_File);
Swagger.Servers.Get_Parameter (Context, "certificateFile", Certificate_File);
Server.Ssl_Setup
(Keystore_Password,
Keystore_Password_Confirm,
Truststore_Password,
Truststore_Password_Confirm,
Https_Hostname,
Https_Port,
Privatekey_File,
Certificate_File, Result, Context);
if Context.Get_Status = 200 then
Stream.Start_Document;
Swagger.Streams.Serialize (Stream, "", Result);
Stream.End_Document;
end if;
end Ssl_Setup;
package API_Ssl_Setup is
new Swagger.Servers.Operation (Handler => Ssl_Setup,
Method => Swagger.Servers.POST,
URI => URI_Prefix & "/libs/granite/security/post/sslSetup.html");
--
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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Path_Parameter (Req, 1, Group);
Swagger.Servers.Get_Path_Parameter (Req, 2, 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 => URI_Prefix & "/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
Swagger.Servers.Get_Path_Parameter (Req, 1, Group);
Swagger.Servers.Get_Path_Parameter (Req, 2, 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 => URI_Prefix & "/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;
P_1Property : Swagger.UString;
P_1Property_Periodvalue : Swagger.UString;
Result : Swagger.UString;
begin
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", P_1Property);
Swagger.Servers.Get_Query_Parameter (Req, "1_property.value", P_1Property_Periodvalue);
Server.Get_Query
(Path,
P_Periodlimit,
P_1Property,
P_1Property_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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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_HTTPConnection_Closed : Swagger.Nullable_Boolean;
Jcr_Content_Slashprotocol_HTTPExpired : Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPHeaders : Swagger.UString_Vectors.Vector;
Jcr_Content_Slashprotocol_HTTPHeaders_At_Type_Hint : Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPMethod : Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPSRelaxed : 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_NTLMDomain : Swagger.Nullable_UString;
Jcr_Content_Slashproxy_NTLMHost : 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_NTLMDomain : Swagger.Nullable_UString;
Jcr_Content_Slashtransport_NTLMHost : 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
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_HTTPConnection_Closed);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPExpired", Jcr_Content_Slashprotocol_HTTPExpired);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPHeaders", Jcr_Content_Slashprotocol_HTTPHeaders);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPHeaders@TypeHint", Jcr_Content_Slashprotocol_HTTPHeaders_At_Type_Hint);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPMethod", Jcr_Content_Slashprotocol_HTTPMethod);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/protocolHTTPSRelaxed", Jcr_Content_Slashprotocol_HTTPSRelaxed);
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_NTLMDomain);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/proxyNTLMHost", Jcr_Content_Slashproxy_NTLMHost);
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_NTLMDomain);
Swagger.Servers.Get_Query_Parameter (Req, "jcr:content/transportNTLMHost", Jcr_Content_Slashtransport_NTLMHost);
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, 1, 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_HTTPConnection_Closed,
Jcr_Content_Slashprotocol_HTTPExpired,
Jcr_Content_Slashprotocol_HTTPHeaders,
Jcr_Content_Slashprotocol_HTTPHeaders_At_Type_Hint,
Jcr_Content_Slashprotocol_HTTPMethod,
Jcr_Content_Slashprotocol_HTTPSRelaxed,
Jcr_Content_Slashprotocol_Interface,
Jcr_Content_Slashprotocol_Socket_Timeout,
Jcr_Content_Slashprotocol_Version,
Jcr_Content_Slashproxy_NTLMDomain,
Jcr_Content_Slashproxy_NTLMHost,
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_NTLMDomain,
Jcr_Content_Slashtransport_NTLMHost,
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 => URI_Prefix & "/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
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, 1, 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 => URI_Prefix & "/{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
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 => URI_Prefix & "/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_IDAttribute : Swagger.Nullable_UString;
User_IDAttribute_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_URL : Swagger.Nullable_UString;
Assertion_Consumer_Service_URLAt_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
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_IDAttribute);
Swagger.Servers.Get_Query_Parameter (Req, "userIDAttribute@TypeHint", User_IDAttribute_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_URL);
Swagger.Servers.Get_Query_Parameter (Req, "assertionConsumerServiceURL@TypeHint", Assertion_Consumer_Service_URLAt_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_IDAttribute,
User_IDAttribute_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_URL,
Assertion_Consumer_Service_URLAt_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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/apps/system/config/org.apache.sling.security.impl.ReferrerFilter");
--
procedure Post_Config_Property
(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
Config_Node_Name : Swagger.UString;
begin
Swagger.Servers.Get_Path_Parameter (Req, 1, Config_Node_Name);
Server.Post_Config_Property
(Config_Node_Name, Context);
end Post_Config_Property;
package API_Post_Config_Property is
new Swagger.Servers.Operation (Handler => Post_Config_Property,
Method => Swagger.Servers.POST,
URI => URI_Prefix & "/apps/system/config/{configNodeName}");
--
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
Swagger.Servers.Get_Query_Parameter (Req, ":operation", Operation);
Swagger.Servers.Get_Query_Parameter (Req, "deleteAuthorizable", Delete_Authorizable);
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
Swagger.Servers.Get_Query_Parameter (Req, "addMembers", Add_Members);
Swagger.Servers.Get_Path_Parameter (Req, 1, 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 => URI_Prefix & "/{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
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 => URI_Prefix & "/{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;
P_1Property : Swagger.UString;
P_1Property_Periodvalue : Swagger.UString;
Result : Swagger.UString;
begin
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", P_1Property);
Swagger.Servers.Get_Query_Parameter (Req, "1_property.value", P_1Property_Periodvalue);
Server.Post_Query
(Path,
P_Periodlimit,
P_1Property,
P_1Property_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 => URI_Prefix & "/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
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 => URI_Prefix & "/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
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 => URI_Prefix & "/libs/granite/security/post/truststore");
--
procedure Post_Truststore_PKCS12
(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_Periodp_12 : Swagger.File_Part_Type;
Result : Swagger.UString;
begin
Swagger.Servers.Get_Parameter (Context, "truststore.p12", Truststore_Periodp_12);
Server.Post_Truststore_PKCS12
(Truststore_Periodp_12, Result, Context);
if Context.Get_Status = 200 then
Stream.Start_Document;
Swagger.Streams.Serialize (Stream, "", Result);
Stream.End_Document;
end if;
end Post_Truststore_PKCS12;
package API_Post_Truststore_PKCS12 is
new Swagger.Servers.Operation (Handler => Post_Truststore_PKCS12,
Method => Swagger.Servers.POST,
URI => URI_Prefix & "/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_Bundle_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_Ssl_Setup.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_Config_Property.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_PKCS12.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_Bundle_Info
(Name : in Swagger.UString;
Result : out .Models.BundleInfo_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
Impl.Get_Bundle_Info
(Name,
Result,
Context);
end Get_Bundle_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_URL : 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_IDAttribute : 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_URL,
Sp_Private_Key_Alias,
Key_Store_Password,
Default_Redirect_Url,
User_IDAttribute,
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 Ssl_Setup
(Keystore_Password : in Swagger.UString;
Keystore_Password_Confirm : in Swagger.UString;
Truststore_Password : in Swagger.UString;
Truststore_Password_Confirm : in Swagger.UString;
Https_Hostname : in Swagger.UString;
Https_Port : in Swagger.UString;
Privatekey_File : in Swagger.File_Part_Type;
Certificate_File : in Swagger.File_Part_Type;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
Impl.Ssl_Setup
(Keystore_Password,
Keystore_Password_Confirm,
Truststore_Password,
Truststore_Password_Confirm,
Https_Hostname,
Https_Port,
Privatekey_File,
Certificate_File,
Result,
Context);
end Ssl_Setup;
--
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;
P_1Property : in Swagger.UString;
P_1Property_Periodvalue : in Swagger.UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
Impl.Get_Query
(Path,
P_Periodlimit,
P_1Property,
P_1Property_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_HTTPConnection_Closed : in Swagger.Nullable_Boolean;
Jcr_Content_Slashprotocol_HTTPExpired : in Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPHeaders : in Swagger.UString_Vectors.Vector;
Jcr_Content_Slashprotocol_HTTPHeaders_At_Type_Hint : in Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPMethod : in Swagger.Nullable_UString;
Jcr_Content_Slashprotocol_HTTPSRelaxed : 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_NTLMDomain : in Swagger.Nullable_UString;
Jcr_Content_Slashproxy_NTLMHost : 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_NTLMDomain : in Swagger.Nullable_UString;
Jcr_Content_Slashtransport_NTLMHost : 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_HTTPConnection_Closed,
Jcr_Content_Slashprotocol_HTTPExpired,
Jcr_Content_Slashprotocol_HTTPHeaders,
Jcr_Content_Slashprotocol_HTTPHeaders_At_Type_Hint,
Jcr_Content_Slashprotocol_HTTPMethod,
Jcr_Content_Slashprotocol_HTTPSRelaxed,
Jcr_Content_Slashprotocol_Interface,
Jcr_Content_Slashprotocol_Socket_Timeout,
Jcr_Content_Slashprotocol_Version,
Jcr_Content_Slashproxy_NTLMDomain,
Jcr_Content_Slashproxy_NTLMHost,
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_NTLMDomain,
Jcr_Content_Slashtransport_NTLMHost,
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_IDAttribute : in Swagger.Nullable_UString;
User_IDAttribute_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_URL : in Swagger.Nullable_UString;
Assertion_Consumer_Service_URLAt_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_IDAttribute,
User_IDAttribute_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_URL,
Assertion_Consumer_Service_URLAt_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_Config_Property
(Config_Node_Name : in Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
Impl.Post_Config_Property
(Config_Node_Name,
Context);
end Post_Config_Property;
--
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;
P_1Property : in Swagger.UString;
P_1Property_Periodvalue : in Swagger.UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
Impl.Post_Query
(Path,
P_Periodlimit,
P_1Property,
P_1Property_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_PKCS12
(Truststore_Periodp_12 : in Swagger.File_Part_Type;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
Impl.Post_Truststore_PKCS12
(Truststore_Periodp_12,
Result,
Context);
end Post_Truststore_PKCS12;
end Server;
end Shared_Instance;
end .Skeletons;
|
pdaxrom/Kino2 | Ada | 4,165 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Panels.User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en
-- Version Control:
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux;
use Terminal_Interface.Curses.Aux;
with Terminal_Interface.Curses.Panels;
use Terminal_Interface.Curses.Panels;
package body Terminal_Interface.Curses.Panels.User_Data is
use type Interfaces.C.int;
procedure Set_User_Data (Pan : in Panel;
Data : in User_Access)
is
function Set_Panel_Userptr (Pan : Panel;
Addr : User_Access) return C_Int;
pragma Import (C, Set_Panel_Userptr, "set_panel_userptr");
begin
if Set_Panel_Userptr (Pan, Data) = Curses_Err then
raise Panel_Exception;
end if;
end Set_User_Data;
function Get_User_Data (Pan : in Panel) return User_Access
is
function Panel_Userptr (Pan : Panel) return User_Access;
pragma Import (C, Panel_Userptr, "panel_userptr");
begin
return Panel_Userptr (Pan);
end Get_User_Data;
procedure Get_User_Data (Pan : in Panel;
Data : out User_Access)
is
begin
Data := Get_User_Data (Pan);
end Get_User_Data;
end Terminal_Interface.Curses.Panels.User_Data;
|
burratoo/Acton | Ada | 3,246 | ads | ------------------------------------------------------------------------------------------
-- --
-- OAK CORE SUPPORT PACKAGE --
-- FREESCALE e200 --
-- --
-- OAK.CORE_SUPPORT_PACKAGE.INTERRUPTS --
-- --
-- Copyright (C) 2010-2021, Patrick Bernardi --
-- --
------------------------------------------------------------------------------------------
-- This package provides the core-level interrupt support, including
-- interrupts that occur at the core level.
-- This is the Freescal e200 version.
package Oak.Core_Support_Package.Interrupts with Preelaborate is
procedure Set_Up_Interrupts;
procedure Enable_External_Interrupts with Inline_Always;
procedure Disable_External_Interrupts with Inline_Always;
procedure Disable_Oak_Wake_Up_Interrupt with Inline_Always;
procedure Enable_Oak_Wake_Up_Interrupt with Inline_Always;
procedure Decrementer_Interrupt
with Linker_Section => ".acton_intr_branch_table";
procedure External_Interrupt_Handler
with Linker_Section => ".acton_intr_branch_table";
procedure Full_Context_Switch_To_Agent_Interrupt
with Linker_Section => ".acton_intr_branch_table";
procedure In_Place_Context_Switch_To_Agent_Interrupt
with Linker_Section => ".acton_intr_branch_table";
procedure In_Place_Context_Switch_To_Oak_Interrupt
with Linker_Section => ".acton_intr_branch_table";
procedure Request_Context_Switch_To_Agent_Interrupt
with Linker_Section => ".acton_intr_branch_table";
procedure Request_Context_Switch_To_Oak_Interrupt
with Linker_Section => ".acton_intr_branch_table";
---------------------------------
-- Internal Package Components --
---------------------------------
procedure External_Interrupt_Present
with Linker_Section => ".acton_intr_branch_table";
-- Sets r3 to 1 to indicate that an external interrupt is present
private
procedure Enable_SPE_Instructions with Inline_Always;
procedure Full_Context_Switch_To_Oak;
-- Not callable as an interrupt. Called by Decrementer_Interrupt and
-- External_Interrupt. Does not save r3.
-- Notes on register uses:
--
-- SPRG0: Stores the kernel's stack pointer
-- SPRG1: Stores the kernel's instruction pointer
-- SPRG2: Return interrupt handler address
-- pragma Machine_Attribute
-- (Context_Switch_To_Kernel_Interrupt, "aligned", 16);
-- pragma Machine_Attribute
-- (Context_Switch_To_Task_Interrupt, "aligned", 16);
-- pragma Machine_Attribute
-- (Decrementer_Interrupt, "aligned", 16);
-- pragma Machine_Attribute
-- (External_Interrupt_Handler, "aligned", 16);
end Oak.Core_Support_Package.Interrupts;
|
AdaCore/libadalang | Ada | 174 | ads | with Children; use Children;
package Great_Children is
type Great_Child is new Child with null Record;
procedure Primitive (Self : Great_Child);
end Great_Children;
|
charlie5/cBound | Ada | 1,628 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with swig;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_get_font_path_reply_t is
-- Item
--
type Item is record
response_type : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
sequence : aliased Interfaces.Unsigned_16;
length : aliased Interfaces.Unsigned_32;
path_len : aliased Interfaces.Unsigned_16;
pad1 : aliased swig.int8_t_Array (0 .. 21);
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C.size_t range <>) of aliased xcb.xcb_get_font_path_reply_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_get_font_path_reply_t.Item,
Element_Array => xcb.xcb_get_font_path_reply_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased xcb.xcb_get_font_path_reply_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_get_font_path_reply_t.Pointer,
Element_Array => xcb.xcb_get_font_path_reply_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_get_font_path_reply_t;
|
sungyeon/drake | Ada | 8,312 | ads | pragma License (Unrestricted);
-- generalized unit of a part of Ada.Strings.Unbounded
with Ada.Strings.Generic_Functions;
generic
with package Fixed_Functions is
new Strings.Generic_Functions (
Character_Type => Character_Type,
String_Type => String_Type,
Space => <>);
package Ada.Strings.Generic_Unbounded.Generic_Functions is
pragma Preelaborate;
-- Search subprograms
function Index (
Source : Unbounded_String;
Pattern : String_Type;
From : Positive;
Going : Direction := Forward)
return Natural;
function Index (
Source : Unbounded_String;
Pattern : String_Type;
Going : Direction := Forward)
return Natural;
function Index_Non_Blank (
Source : Unbounded_String;
From : Positive;
Going : Direction := Forward)
return Natural;
function Index_Non_Blank (
Source : Unbounded_String;
Going : Direction := Forward)
return Natural;
function Count (Source : Unbounded_String; Pattern : String_Type)
return Natural;
-- String transformation subprograms
function Replace_Slice (
Source : Unbounded_String;
Low : Positive;
High : Natural;
By : String_Type)
return Unbounded_String;
procedure Replace_Slice (
Source : in out Unbounded_String;
Low : Positive;
High : Natural;
By : String_Type);
function Insert (
Source : Unbounded_String;
Before : Positive;
New_Item : String_Type)
return Unbounded_String;
procedure Insert (
Source : in out Unbounded_String;
Before : Positive;
New_Item : String_Type);
function Overwrite (
Source : Unbounded_String;
Position : Positive;
New_Item : String_Type)
return Unbounded_String;
procedure Overwrite (
Source : in out Unbounded_String;
Position : Positive;
New_Item : String_Type);
function Delete (
Source : Unbounded_String;
From : Positive;
Through : Natural)
return Unbounded_String;
procedure Delete (
Source : in out Unbounded_String;
From : Positive;
Through : Natural);
-- String selector subprograms
function Trim (
Source : Unbounded_String;
Side : Trim_End;
Blank : Character_Type := Fixed_Functions.Space) -- additional
return Unbounded_String;
procedure Trim (
Source : in out Unbounded_String;
Side : Trim_End;
Blank : Character_Type := Fixed_Functions.Space); -- additional
function Head (
Source : Unbounded_String;
Count : Natural;
Pad : Character_Type := Fixed_Functions.Space)
return Unbounded_String;
procedure Head (
Source : in out Unbounded_String;
Count : Natural;
Pad : Character_Type := Fixed_Functions.Space);
function Tail (
Source : Unbounded_String;
Count : Natural;
Pad : Character_Type := Fixed_Functions.Space)
return Unbounded_String;
procedure Tail (
Source : in out Unbounded_String;
Count : Natural;
Pad : Character_Type := Fixed_Functions.Space);
-- String constructor functions
function "*" (Left : Natural; Right : Character_Type)
return Unbounded_String;
function "*" (Left : Natural; Right : String_Type)
return Unbounded_String;
function "*" (Left : Natural; Right : Unbounded_String)
return Unbounded_String;
generic
with package Fixed_Maps is new Fixed_Functions.Generic_Maps (<>);
package Generic_Maps is
-- Search subprograms
function Index (
Source : Unbounded_String;
Pattern : String_Type;
From : Positive;
Going : Direction := Forward;
Mapping : Fixed_Maps.Character_Mapping)
return Natural;
function Index (
Source : Unbounded_String;
Pattern : String_Type;
Going : Direction := Forward;
Mapping : Fixed_Maps.Character_Mapping)
return Natural;
function Index (
Source : Unbounded_String;
Pattern : String_Type;
From : Positive;
Going : Direction := Forward;
Mapping : not null access function (From : Wide_Wide_Character)
return Wide_Wide_Character)
return Natural;
function Index (
Source : Unbounded_String;
Pattern : String_Type;
Going : Direction := Forward;
Mapping : not null access function (From : Wide_Wide_Character)
return Wide_Wide_Character)
return Natural;
function Index_Element (
Source : Unbounded_String;
Pattern : String_Type;
From : Positive;
Going : Direction := Forward;
Mapping : not null access function (From : Character_Type)
return Character_Type)
return Natural;
function Index_Element (
Source : Unbounded_String;
Pattern : String_Type;
Going : Direction := Forward;
Mapping : not null access function (From : Character_Type)
return Character_Type)
return Natural;
function Index (
Source : Unbounded_String;
Set : Fixed_Maps.Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward)
return Natural;
function Index (
Source : Unbounded_String;
Set : Fixed_Maps.Character_Set;
Test : Membership := Inside;
Going : Direction := Forward)
return Natural;
function Count (
Source : Unbounded_String;
Pattern : String_Type;
Mapping : Fixed_Maps.Character_Mapping)
return Natural;
function Count (
Source : Unbounded_String;
Pattern : String_Type;
Mapping : not null access function (From : Wide_Wide_Character)
return Wide_Wide_Character)
return Natural;
function Count_Element (
Source : Unbounded_String;
Pattern : String_Type;
Mapping : not null access function (From : Character_Type)
return Character_Type)
return Natural;
function Count (
Source : Unbounded_String;
Set : Fixed_Maps.Character_Set)
return Natural;
procedure Find_Token (
Source : Unbounded_String;
Set : Fixed_Maps.Character_Set;
From : Positive;
Test : Membership;
First : out Positive;
Last : out Natural);
procedure Find_Token (
Source : Unbounded_String;
Set : Fixed_Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
-- String translation subprograms
function Translate (
Source : Unbounded_String;
Mapping : Fixed_Maps.Character_Mapping)
return Unbounded_String;
procedure Translate (
Source : in out Unbounded_String;
Mapping : Fixed_Maps.Character_Mapping);
function Translate (
Source : Unbounded_String;
Mapping : not null access function (From : Wide_Wide_Character)
return Wide_Wide_Character)
return Unbounded_String;
procedure Translate (
Source : in out Unbounded_String;
Mapping : not null access function (From : Wide_Wide_Character)
return Wide_Wide_Character);
function Translate_Element (
Source : Unbounded_String;
Mapping : not null access function (From : Character_Type)
return Character_Type)
return Unbounded_String;
procedure Translate_Element (
Source : in out Unbounded_String;
Mapping : not null access function (From : Character_Type)
return Character_Type);
-- String selector subprograms
function Trim (
Source : Unbounded_String;
Left : Fixed_Maps.Character_Set;
Right : Fixed_Maps.Character_Set)
return Unbounded_String;
procedure Trim (
Source : in out Unbounded_String;
Left : Fixed_Maps.Character_Set;
Right : Fixed_Maps.Character_Set);
end Generic_Maps;
end Ada.Strings.Generic_Unbounded.Generic_Functions;
|
meowthsli/EVB1000 | Ada | 2,737 | 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.
-------------------------------------------------------------------------------
pragma Profile(Ravenscar);
pragma Partition_Elaboration_Policy(Sequential);
with System;
-- Provides an API for writing ASCII text to the two-line LCD on the EVB1000
-- board.
--
-- The LCD has two rows capable of displaying ASCII text. Each row can display
-- a maximum of 16 characters.
--
-- The LCD driver is implemented as a protected object in order to protect
-- the SPI interface against race conditions.
--
-- Below is an example of using this API:
--
-- EVB1000.LCD.Driver.Put(Line_1 => "Hello",
-- Line_2 => "World!");
package EVB1000.LCD
with SPARK_Mode => On,
Abstract_State => (LCD_State with External),
Initializes => LCD_State
is
protected type Driver_Type with Priority => System.Priority'Last
is
procedure Clear_LCD
with Global => (In_Out => LCD_State),
Depends => (LCD_State => LCD_State,
Driver_Type => Driver_Type);
-- Clear the LCD.
procedure Put(Text_1 : in String;
Text_2 : in String)
with Global => (In_Out => LCD_State),
Depends => (LCD_State => + (Text_1, Text_2),
Driver_Type => Driver_Type),
Pre => Text_1'Length <= 16 and Text_2'Length <= 16;
-- Set the text for lines 1 (top line) and 2 (bottom line) on the LCD.
--
-- Both lines can display a maximum of 16 characters.
end Driver_Type;
Driver : Driver_Type;
end EVB1000.LCD;
|
twdroeger/ada-awa | Ada | 72,255 | adb | -----------------------------------------------------------------------
-- AWA.Users.Models -- AWA.Users.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2019 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Beans.Objects.Time;
package body AWA.Users.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
pragma Warnings (Off, "formal parameter * is not referenced");
function Email_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => EMAIL_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Email_Key;
function Email_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => EMAIL_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Email_Key;
function "=" (Left, Right : Email_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Email_Ref'Class;
Impl : out Email_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Email_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Email_Ref) is
Impl : Email_Access;
begin
Impl := new Email_Impl;
Impl.Status := AWA.Users.Models.MailDeliveryStatus'First;
Impl.Last_Error_Date := ADO.DEFAULT_TIME;
Impl.Version := 0;
Impl.User_Id := ADO.NO_IDENTIFIER;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Email
-- ----------------------------------------
procedure Set_Email (Object : in out Email_Ref;
Value : in String) is
Impl : Email_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 1, Impl.Email, Value);
end Set_Email;
procedure Set_Email (Object : in out Email_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Email_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 1, Impl.Email, Value);
end Set_Email;
function Get_Email (Object : in Email_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Email);
end Get_Email;
function Get_Email (Object : in Email_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Email_Access
:= Email_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Email;
end Get_Email;
procedure Set_Status (Object : in out Email_Ref;
Value : in AWA.Users.Models.MailDeliveryStatus) is
procedure Set_Field_Enum is
new ADO.Objects.Set_Field_Operation (MailDeliveryStatus);
Impl : Email_Access;
begin
Set_Field (Object, Impl);
Set_Field_Enum (Impl.all, 2, Impl.Status, Value);
end Set_Status;
function Get_Status (Object : in Email_Ref)
return AWA.Users.Models.MailDeliveryStatus is
Impl : constant Email_Access
:= Email_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Status;
end Get_Status;
procedure Set_Last_Error_Date (Object : in out Email_Ref;
Value : in Ada.Calendar.Time) is
Impl : Email_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 3, Impl.Last_Error_Date, Value);
end Set_Last_Error_Date;
function Get_Last_Error_Date (Object : in Email_Ref)
return Ada.Calendar.Time is
Impl : constant Email_Access
:= Email_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Last_Error_Date;
end Get_Last_Error_Date;
function Get_Version (Object : in Email_Ref)
return Integer is
Impl : constant Email_Access
:= Email_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Id (Object : in out Email_Ref;
Value : in ADO.Identifier) is
Impl : Email_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 5, Value);
end Set_Id;
function Get_Id (Object : in Email_Ref)
return ADO.Identifier is
Impl : constant Email_Access
:= Email_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_User_Id (Object : in out Email_Ref;
Value : in ADO.Identifier) is
Impl : Email_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Identifier (Impl.all, 6, Impl.User_Id, Value);
end Set_User_Id;
function Get_User_Id (Object : in Email_Ref)
return ADO.Identifier is
Impl : constant Email_Access
:= Email_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.User_Id;
end Get_User_Id;
-- Copy of the object.
procedure Copy (Object : in Email_Ref;
Into : in out Email_Ref) is
Result : Email_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Email_Access
:= Email_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Email_Access
:= new Email_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Email := Impl.Email;
Copy.Status := Impl.Status;
Copy.Last_Error_Date := Impl.Last_Error_Date;
Copy.Version := Impl.Version;
Copy.User_Id := Impl.User_Id;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Email_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Email_Access := new Email_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Email_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Email_Access := new Email_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Email_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Email_Access := new Email_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Email_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Email_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Email_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Email_Impl) is
type Email_Impl_Ptr is access all Email_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Email_Impl, Email_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Email_Impl_Ptr := Email_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Email_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, EMAIL_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Email_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Email_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (EMAIL_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_1_NAME, -- email
Value => Object.Email);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_1_NAME, -- status
Value => Integer (MailDeliveryStatus'Pos (Object.Status)));
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_1_NAME, -- last_error_date
Value => Object.Last_Error_Date);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_1_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_1_NAME, -- user_id
Value => Object.User_Id);
Object.Clear_Modified (6);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Email_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (EMAIL_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Query.Save_Field (Name => COL_0_1_NAME, -- email
Value => Object.Email);
Query.Save_Field (Name => COL_1_1_NAME, -- status
Value => Integer (MailDeliveryStatus'Pos (Object.Status)));
Query.Save_Field (Name => COL_2_1_NAME, -- last_error_date
Value => Object.Last_Error_Date);
Query.Save_Field (Name => COL_3_1_NAME, -- version
Value => Object.Version);
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_4_1_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_5_1_NAME, -- user_id
Value => Object.User_Id);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Email_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (EMAIL_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Email_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Email_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Email_Impl (Obj.all)'Access;
if Name = "email" then
return Util.Beans.Objects.To_Object (Impl.Email);
elsif Name = "status" then
return AWA.Users.Models.MailDeliveryStatus_Objects.To_Object (Impl.Status);
elsif Name = "last_error_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Last_Error_Date);
elsif Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "user_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.User_Id));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Email_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Email := Stmt.Get_Unbounded_String (0);
Object.Status := MailDeliveryStatus'Val (Stmt.Get_Integer (1));
Object.Last_Error_Date := Stmt.Get_Time (2);
Object.Set_Key_Value (Stmt.Get_Identifier (4));
Object.User_Id := Stmt.Get_Identifier (5);
Object.Version := Stmt.Get_Integer (3);
ADO.Objects.Set_Created (Object);
end Load;
function User_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => USER_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end User_Key;
function User_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => USER_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end User_Key;
function "=" (Left, Right : User_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out User_Ref'Class;
Impl : out User_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := User_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out User_Ref) is
Impl : User_Access;
begin
Impl := new User_Impl;
Impl.Version := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: User
-- ----------------------------------------
procedure Set_First_Name (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_String (Impl.all, 1, Impl.First_Name, Value);
end Set_First_Name;
procedure Set_First_Name (Object : in out User_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Unbounded_String (Impl.all, 1, Impl.First_Name, Value);
end Set_First_Name;
function Get_First_Name (Object : in User_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_First_Name);
end Get_First_Name;
function Get_First_Name (Object : in User_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.First_Name;
end Get_First_Name;
procedure Set_Last_Name (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_String (Impl.all, 2, Impl.Last_Name, Value);
end Set_Last_Name;
procedure Set_Last_Name (Object : in out User_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Unbounded_String (Impl.all, 2, Impl.Last_Name, Value);
end Set_Last_Name;
function Get_Last_Name (Object : in User_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Last_Name);
end Get_Last_Name;
function Get_Last_Name (Object : in User_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Last_Name;
end Get_Last_Name;
procedure Set_Password (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Password, Value);
end Set_Password;
procedure Set_Password (Object : in out User_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Password, Value);
end Set_Password;
function Get_Password (Object : in User_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Password);
end Get_Password;
function Get_Password (Object : in User_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Password;
end Get_Password;
procedure Set_Open_Id (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 4, Impl.Open_Id, Value);
end Set_Open_Id;
procedure Set_Open_Id (Object : in out User_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 4, Impl.Open_Id, Value);
end Set_Open_Id;
function Get_Open_Id (Object : in User_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Open_Id);
end Get_Open_Id;
function Get_Open_Id (Object : in User_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Open_Id;
end Get_Open_Id;
procedure Set_Country (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_String (Impl.all, 5, Impl.Country, Value);
end Set_Country;
procedure Set_Country (Object : in out User_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Unbounded_String (Impl.all, 5, Impl.Country, Value);
end Set_Country;
function Get_Country (Object : in User_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Country);
end Get_Country;
function Get_Country (Object : in User_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Country;
end Get_Country;
procedure Set_Name (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_String (Impl.all, 6, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out User_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Unbounded_String (Impl.all, 6, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in User_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in User_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
function Get_Version (Object : in User_Ref)
return Integer is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Id (Object : in out User_Ref;
Value : in ADO.Identifier) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 8, Value);
end Set_Id;
function Get_Id (Object : in User_Ref)
return ADO.Identifier is
Impl : constant User_Access
:= User_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Salt (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 9, Impl.Salt, Value);
end Set_Salt;
procedure Set_Salt (Object : in out User_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 9, Impl.Salt, Value);
end Set_Salt;
function Get_Salt (Object : in User_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Salt);
end Get_Salt;
function Get_Salt (Object : in User_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Salt;
end Get_Salt;
procedure Set_Email (Object : in out User_Ref;
Value : in AWA.Users.Models.Email_Ref'Class) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 10, Impl.Email, Value);
end Set_Email;
function Get_Email (Object : in User_Ref)
return AWA.Users.Models.Email_Ref'Class is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Email;
end Get_Email;
-- Copy of the object.
procedure Copy (Object : in User_Ref;
Into : in out User_Ref) is
Result : User_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant User_Access
:= new User_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.First_Name := Impl.First_Name;
Copy.Last_Name := Impl.Last_Name;
Copy.Password := Impl.Password;
Copy.Open_Id := Impl.Open_Id;
Copy.Country := Impl.Country;
Copy.Name := Impl.Name;
Copy.Version := Impl.Version;
Copy.Salt := Impl.Salt;
Copy.Email := Impl.Email;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out User_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant User_Access := new User_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out User_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant User_Access := new User_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out User_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant User_Access := new User_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out User_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new User_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out User_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access User_Impl) is
type User_Impl_Ptr is access all User_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(User_Impl, User_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : User_Impl_Ptr := User_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out User_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, USER_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out User_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out User_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (USER_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_2_NAME, -- first_name
Value => Object.First_Name);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_2_NAME, -- last_name
Value => Object.Last_Name);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_2_NAME, -- password
Value => Object.Password);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_2_NAME, -- open_id
Value => Object.Open_Id);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_2_NAME, -- country
Value => Object.Country);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_2_NAME, -- name
Value => Object.Name);
Object.Clear_Modified (6);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_2_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_2_NAME, -- salt
Value => Object.Salt);
Object.Clear_Modified (9);
end if;
if Object.Is_Modified (10) then
Stmt.Save_Field (Name => COL_9_2_NAME, -- email_id
Value => Object.Email);
Object.Clear_Modified (10);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
ADO.Audits.Save (Object, Session);
end;
end if;
end Save;
procedure Create (Object : in out User_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (USER_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Query.Save_Field (Name => COL_0_2_NAME, -- first_name
Value => Object.First_Name);
Query.Save_Field (Name => COL_1_2_NAME, -- last_name
Value => Object.Last_Name);
Query.Save_Field (Name => COL_2_2_NAME, -- password
Value => Object.Password);
Query.Save_Field (Name => COL_3_2_NAME, -- open_id
Value => Object.Open_Id);
Query.Save_Field (Name => COL_4_2_NAME, -- country
Value => Object.Country);
Query.Save_Field (Name => COL_5_2_NAME, -- name
Value => Object.Name);
Query.Save_Field (Name => COL_6_2_NAME, -- version
Value => Object.Version);
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_7_2_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_8_2_NAME, -- salt
Value => Object.Salt);
Query.Save_Field (Name => COL_9_2_NAME, -- email_id
Value => Object.Email);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
ADO.Audits.Save (Object, Session);
end Create;
procedure Delete (Object : in out User_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (USER_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in User_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access User_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := User_Impl (Obj.all)'Access;
if Name = "first_name" then
return Util.Beans.Objects.To_Object (Impl.First_Name);
elsif Name = "last_name" then
return Util.Beans.Objects.To_Object (Impl.Last_Name);
elsif Name = "password" then
return Util.Beans.Objects.To_Object (Impl.Password);
elsif Name = "open_id" then
return Util.Beans.Objects.To_Object (Impl.Open_Id);
elsif Name = "country" then
return Util.Beans.Objects.To_Object (Impl.Country);
elsif Name = "name" then
return Util.Beans.Objects.To_Object (Impl.Name);
elsif Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "salt" then
return Util.Beans.Objects.To_Object (Impl.Salt);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out User_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.First_Name := Stmt.Get_Unbounded_String (0);
Object.Last_Name := Stmt.Get_Unbounded_String (1);
Object.Password := Stmt.Get_Unbounded_String (2);
Object.Open_Id := Stmt.Get_Unbounded_String (3);
Object.Country := Stmt.Get_Unbounded_String (4);
Object.Name := Stmt.Get_Unbounded_String (5);
Object.Set_Key_Value (Stmt.Get_Identifier (7));
Object.Salt := Stmt.Get_Unbounded_String (8);
if not Stmt.Is_Null (9) then
Object.Email.Set_Key_Value (Stmt.Get_Identifier (9), Session);
end if;
Object.Version := Stmt.Get_Integer (6);
ADO.Objects.Set_Created (Object);
end Load;
function Access_Key_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => ACCESS_KEY_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Access_Key_Key;
function Access_Key_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => ACCESS_KEY_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Access_Key_Key;
function "=" (Left, Right : Access_Key_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Access_Key_Ref'Class;
Impl : out Access_Key_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Access_Key_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Access_Key_Ref) is
Impl : Access_Key_Access;
begin
Impl := new Access_Key_Impl;
Impl.Expire_Date := ADO.DEFAULT_TIME;
Impl.Version := 0;
Impl.Kind := AWA.Users.Models.Key_Type'First;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Access_Key
-- ----------------------------------------
procedure Set_Access_Key (Object : in out Access_Key_Ref;
Value : in String) is
Impl : Access_Key_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 1, Impl.Access_Key, Value);
end Set_Access_Key;
procedure Set_Access_Key (Object : in out Access_Key_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Access_Key_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 1, Impl.Access_Key, Value);
end Set_Access_Key;
function Get_Access_Key (Object : in Access_Key_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Access_Key);
end Get_Access_Key;
function Get_Access_Key (Object : in Access_Key_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Access_Key_Access
:= Access_Key_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Access_Key;
end Get_Access_Key;
procedure Set_Expire_Date (Object : in out Access_Key_Ref;
Value : in Ada.Calendar.Time) is
Impl : Access_Key_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 2, Impl.Expire_Date, Value);
end Set_Expire_Date;
function Get_Expire_Date (Object : in Access_Key_Ref)
return Ada.Calendar.Time is
Impl : constant Access_Key_Access
:= Access_Key_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Expire_Date;
end Get_Expire_Date;
procedure Set_Id (Object : in out Access_Key_Ref;
Value : in ADO.Identifier) is
Impl : Access_Key_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 3, Value);
end Set_Id;
function Get_Id (Object : in Access_Key_Ref)
return ADO.Identifier is
Impl : constant Access_Key_Access
:= Access_Key_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
function Get_Version (Object : in Access_Key_Ref)
return Integer is
Impl : constant Access_Key_Access
:= Access_Key_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Kind (Object : in out Access_Key_Ref;
Value : in AWA.Users.Models.Key_Type) is
procedure Set_Field_Enum is
new ADO.Objects.Set_Field_Operation (Key_Type);
Impl : Access_Key_Access;
begin
Set_Field (Object, Impl);
Set_Field_Enum (Impl.all, 5, Impl.Kind, Value);
end Set_Kind;
function Get_Kind (Object : in Access_Key_Ref)
return AWA.Users.Models.Key_Type is
Impl : constant Access_Key_Access
:= Access_Key_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Kind;
end Get_Kind;
procedure Set_User (Object : in out Access_Key_Ref;
Value : in AWA.Users.Models.User_Ref'Class) is
Impl : Access_Key_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 6, Impl.User, Value);
end Set_User;
function Get_User (Object : in Access_Key_Ref)
return AWA.Users.Models.User_Ref'Class is
Impl : constant Access_Key_Access
:= Access_Key_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.User;
end Get_User;
-- Copy of the object.
procedure Copy (Object : in Access_Key_Ref;
Into : in out Access_Key_Ref) is
Result : Access_Key_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Access_Key_Access
:= Access_Key_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Access_Key_Access
:= new Access_Key_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Access_Key := Impl.Access_Key;
Copy.Expire_Date := Impl.Expire_Date;
Copy.Version := Impl.Version;
Copy.Kind := Impl.Kind;
Copy.User := Impl.User;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Access_Key_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Access_Key_Access := new Access_Key_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Access_Key_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Access_Key_Access := new Access_Key_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Access_Key_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Access_Key_Access := new Access_Key_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Access_Key_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Access_Key_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Access_Key_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Access_Key_Impl) is
type Access_Key_Impl_Ptr is access all Access_Key_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Access_Key_Impl, Access_Key_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Access_Key_Impl_Ptr := Access_Key_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Access_Key_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, ACCESS_KEY_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Access_Key_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Access_Key_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (ACCESS_KEY_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_3_NAME, -- access_key
Value => Object.Access_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_3_NAME, -- expire_date
Value => Object.Expire_Date);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_3_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_3_NAME, -- kind
Value => Integer (Key_Type'Pos (Object.Kind)));
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_3_NAME, -- user_id
Value => Object.User);
Object.Clear_Modified (6);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Access_Key_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (ACCESS_KEY_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Query.Save_Field (Name => COL_0_3_NAME, -- access_key
Value => Object.Access_Key);
Query.Save_Field (Name => COL_1_3_NAME, -- expire_date
Value => Object.Expire_Date);
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_2_3_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_3_3_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_4_3_NAME, -- kind
Value => Integer (Key_Type'Pos (Object.Kind)));
Query.Save_Field (Name => COL_5_3_NAME, -- user_id
Value => Object.User);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Access_Key_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (ACCESS_KEY_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Access_Key_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Access_Key_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Access_Key_Impl (Obj.all)'Access;
if Name = "access_key" then
return Util.Beans.Objects.To_Object (Impl.Access_Key);
elsif Name = "expire_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Expire_Date);
elsif Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "kind" then
return AWA.Users.Models.Key_Type_Objects.To_Object (Impl.Kind);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Access_Key_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Access_Key := Stmt.Get_Unbounded_String (0);
Object.Expire_Date := Stmt.Get_Time (1);
Object.Set_Key_Value (Stmt.Get_Identifier (2));
Object.Kind := Key_Type'Val (Stmt.Get_Integer (4));
if not Stmt.Is_Null (5) then
Object.User.Set_Key_Value (Stmt.Get_Identifier (5), Session);
end if;
Object.Version := Stmt.Get_Integer (3);
ADO.Objects.Set_Created (Object);
end Load;
function Session_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => SESSION_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Session_Key;
function Session_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => SESSION_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Session_Key;
function "=" (Left, Right : Session_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Session_Ref'Class;
Impl : out Session_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Session_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Session_Ref) is
Impl : Session_Access;
begin
Impl := new Session_Impl;
Impl.Start_Date := ADO.DEFAULT_TIME;
Impl.End_Date.Is_Null := True;
Impl.Stype := AWA.Users.Models.Session_Type'First;
Impl.Version := 0;
Impl.Server_Id := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Session
-- ----------------------------------------
procedure Set_Start_Date (Object : in out Session_Ref;
Value : in Ada.Calendar.Time) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 1, Impl.Start_Date, Value);
end Set_Start_Date;
function Get_Start_Date (Object : in Session_Ref)
return Ada.Calendar.Time is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Start_Date;
end Get_Start_Date;
procedure Set_End_Date (Object : in out Session_Ref;
Value : in ADO.Nullable_Time) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 2, Impl.End_Date, Value);
end Set_End_Date;
function Get_End_Date (Object : in Session_Ref)
return ADO.Nullable_Time is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.End_Date;
end Get_End_Date;
procedure Set_Ip_Address (Object : in out Session_Ref;
Value : in String) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Ip_Address, Value);
end Set_Ip_Address;
procedure Set_Ip_Address (Object : in out Session_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Ip_Address, Value);
end Set_Ip_Address;
function Get_Ip_Address (Object : in Session_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Ip_Address);
end Get_Ip_Address;
function Get_Ip_Address (Object : in Session_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Ip_Address;
end Get_Ip_Address;
procedure Set_Stype (Object : in out Session_Ref;
Value : in AWA.Users.Models.Session_Type) is
procedure Set_Field_Enum is
new ADO.Objects.Set_Field_Operation (Session_Type);
Impl : Session_Access;
begin
Set_Field (Object, Impl);
Set_Field_Enum (Impl.all, 4, Impl.Stype, Value);
end Set_Stype;
function Get_Stype (Object : in Session_Ref)
return AWA.Users.Models.Session_Type is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Stype;
end Get_Stype;
function Get_Version (Object : in Session_Ref)
return Integer is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Server_Id (Object : in out Session_Ref;
Value : in Integer) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 6, Impl.Server_Id, Value);
end Set_Server_Id;
function Get_Server_Id (Object : in Session_Ref)
return Integer is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Server_Id;
end Get_Server_Id;
procedure Set_Id (Object : in out Session_Ref;
Value : in ADO.Identifier) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 7, Value);
end Set_Id;
function Get_Id (Object : in Session_Ref)
return ADO.Identifier is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Auth (Object : in out Session_Ref;
Value : in AWA.Users.Models.Session_Ref'Class) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 8, Impl.Auth, Value);
end Set_Auth;
function Get_Auth (Object : in Session_Ref)
return AWA.Users.Models.Session_Ref'Class is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Auth;
end Get_Auth;
procedure Set_User (Object : in out Session_Ref;
Value : in AWA.Users.Models.User_Ref'Class) is
Impl : Session_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 9, Impl.User, Value);
end Set_User;
function Get_User (Object : in Session_Ref)
return AWA.Users.Models.User_Ref'Class is
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.User;
end Get_User;
-- Copy of the object.
procedure Copy (Object : in Session_Ref;
Into : in out Session_Ref) is
Result : Session_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Session_Access
:= Session_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Session_Access
:= new Session_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Start_Date := Impl.Start_Date;
Copy.End_Date := Impl.End_Date;
Copy.Ip_Address := Impl.Ip_Address;
Copy.Stype := Impl.Stype;
Copy.Version := Impl.Version;
Copy.Server_Id := Impl.Server_Id;
Copy.Auth := Impl.Auth;
Copy.User := Impl.User;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Session_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Session_Access := new Session_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Session_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Session_Access := new Session_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Session_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Session_Access := new Session_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Session_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Session_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Session_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Session_Impl) is
type Session_Impl_Ptr is access all Session_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Session_Impl, Session_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Session_Impl_Ptr := Session_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Session_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, SESSION_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Session_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Session_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (SESSION_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_4_NAME, -- start_date
Value => Object.Start_Date);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_4_NAME, -- end_date
Value => Object.End_Date);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_4_NAME, -- ip_address
Value => Object.Ip_Address);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_4_NAME, -- stype
Value => Integer (Session_Type'Pos (Object.Stype)));
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_4_NAME, -- server_id
Value => Object.Server_Id);
Object.Clear_Modified (6);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_4_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (7);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_4_NAME, -- auth_id
Value => Object.Auth);
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_4_NAME, -- user_id
Value => Object.User);
Object.Clear_Modified (9);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Session_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (SESSION_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Query.Save_Field (Name => COL_0_4_NAME, -- start_date
Value => Object.Start_Date);
Query.Save_Field (Name => COL_1_4_NAME, -- end_date
Value => Object.End_Date);
Query.Save_Field (Name => COL_2_4_NAME, -- ip_address
Value => Object.Ip_Address);
Query.Save_Field (Name => COL_3_4_NAME, -- stype
Value => Integer (Session_Type'Pos (Object.Stype)));
Query.Save_Field (Name => COL_4_4_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_5_4_NAME, -- server_id
Value => Object.Server_Id);
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_6_4_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_7_4_NAME, -- auth_id
Value => Object.Auth);
Query.Save_Field (Name => COL_8_4_NAME, -- user_id
Value => Object.User);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Session_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (SESSION_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Session_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Session_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Session_Impl (Obj.all)'Access;
if Name = "start_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Start_Date);
elsif Name = "end_date" then
if Impl.End_Date.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.Time.To_Object (Impl.End_Date.Value);
end if;
elsif Name = "ip_address" then
return Util.Beans.Objects.To_Object (Impl.Ip_Address);
elsif Name = "stype" then
return AWA.Users.Models.Session_Type_Objects.To_Object (Impl.Stype);
elsif Name = "server_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Server_Id));
elsif Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Session_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Start_Date := Stmt.Get_Time (0);
Object.End_Date := Stmt.Get_Nullable_Time (1);
Object.Ip_Address := Stmt.Get_Unbounded_String (2);
Object.Stype := Session_Type'Val (Stmt.Get_Integer (3));
Object.Server_Id := Stmt.Get_Integer (5);
Object.Set_Key_Value (Stmt.Get_Identifier (6));
if not Stmt.Is_Null (7) then
Object.Auth.Set_Key_Value (Stmt.Get_Identifier (7), Session);
end if;
if not Stmt.Is_Null (8) then
Object.User.Set_Key_Value (Stmt.Get_Identifier (8), Session);
end if;
Object.Version := Stmt.Get_Integer (4);
ADO.Objects.Set_Created (Object);
end Load;
end AWA.Users.Models;
|
AdaCore/spat | Ada | 2,997 | adb | ------------------------------------------------------------------------------
-- 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);
with Ada.Containers.Bounded_Vectors;
package body SPAT.Entity.Tree is
package body Generic_Sorting is
package Cursor_Lists is new
Ada.Containers.Bounded_Vectors (Index_Type => Positive,
Element_Type => Cursor,
"=" => "=");
------------------------------------------------------------------------
-- Sort
--
-- This is a "sort by proxy". The way it works that we first copy the
-- children's cursors into a vector which then gets sorted. After this
-- step, we rearrange the subtree in the order of elements in the
-- vector.
------------------------------------------------------------------------
procedure Sort (Tree : in out T;
Parent : in Cursor) is
Num_Children : constant Ada.Containers.Count_Type :=
Entity.Tree.Child_Count (Parent => Parent);
use type Ada.Containers.Count_Type;
The_List : Cursor_Lists.Vector (Capacity => Num_Children);
begin
if Num_Children < 2 then
-- No elements to sort.
return;
end if;
-- Copy the tree's cursor into The_List.
for C in Tree.Iterate_Children (Parent => Parent) loop
The_List.Append (New_Item => C);
end loop;
-- Sort the list with our tree cursors.
declare
------------------------------------------------------------------
-- Before
--
-- Comparison operator.
------------------------------------------------------------------
function Before (Left : in Cursor;
Right : in Cursor) return Boolean is
(Before -- from the generic instance
(Left => Entity.Tree.Element (Position => Left),
Right => Entity.Tree.Element (Position => Right)));
package Sorting is new
Cursor_Lists.Generic_Sorting ("<" => Before);
begin
Sorting.Sort (Container => The_List);
end;
-- Now rearrange the subtree according to our sorting order.
for C of The_List loop
Tree.Splice_Subtree (Parent => Parent,
Before => Entity.Tree.No_Element,
Position => C);
end loop;
end Sort;
end Generic_Sorting;
end SPAT.Entity.Tree;
|
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.Elements;
package ODF.DOM.Table_Even_Rows_Elements is
pragma Preelaborate;
type ODF_Table_Even_Rows is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Table_Even_Rows_Access is
access all ODF_Table_Even_Rows'Class
with Storage_Size => 0;
end ODF.DOM.Table_Even_Rows_Elements;
|
sbksba/Concurrence-LI330 | Ada | 628 | adb | with Ada.Text_IO, Ada.Integer_Text_IO, Matrice;
use Ada.Text_IO, Ada.Integer_Text_IO, Matrice;
procedure Test_Scalaire is
A : Une_Matrice_Entiere(1..5,1..5);
scal : Integer;
begin
Put("Saisie du scalaire : ");
Get(scal);
Initialiser_Une_Matrice(A);
Afficher_Une_Matrice(A);
Put_Line("*");
Put(scal, width => 8);
New_Line;
Put_Line("=");
A := A * scal;
Afficher_Une_Matrice(A);
Put_Line("----------------------------------------------");
Put(scal, width => 8);
New_Line;
Put_Line("*");
Afficher_Une_Matrice(A);
Put_Line("=");
A := scal * A;
Afficher_Une_Matrice(A);
end Test_Scalaire;
|
Maxelweb/concurrency-sandbox | Ada | 244 | ads | package RCP.User is
-- a user process class with discriminants
-- for use by the constructor
task type User_T
(Id : Positive;
Extent : Use_T;
Demand : Request_T;
Interval : Positive);
end RCP.User;
|
1Crazymoney/LearnAda | Ada | 1,714 | adb | package body Mat is
function Lnko ( A, B : Positive ) return Positive is
X: Positive := A;
Y: Positive := B;
begin
while X /= Y loop
if X > Y then
X := X - Y;
else
Y := Y - X;
end if;
end loop;
return X;
end Lnko;
function Faktorialis( N: Natural ) return Positive is
Fakt : Positive := 1;
begin
for I in 1..N loop
Fakt := Fakt * I;
end loop;
return Fakt;
end Faktorialis;
function Max2 ( A, B : Natural ) return Natural is
X: Natural := A;
Y: Natural := B;
begin
if X >= Y then
return X;
else
return Y;
end if;
end Max2;
function Max3 ( A, B, C : Natural ) return Natural is
X: Natural := Max2(A,B);
Y: Natural := C;
begin
return Max2(X,Y);
end Max3;
function isEven ( N : Natural ) return Boolean is
begin
return (N mod 2 = 0);
end isEven;
function signof ( N : Integer ) return Integer is
begin
if N > 0 then
return 1;
elsif N = 0 then
return 0;
else
return -1;
end if;
end signof;
function powerof ( X, N : Integer ) return Integer is
begin
if N > 1 then
return X * powerof(X, N - 1);
elsif N = 0 then
return 1;
else
return X;
end if;
end powerof;
function factorial ( N : Natural ) return Natural is
begin
if N <= 1 then
return 1;
else
return N * factorial(N - 1);
end if;
end factorial;
function digitSum ( N : Natural ) return Natural is
begin
return 0;
end digitSum;
end Mat;
|
reznikmm/matreshka | Ada | 3,812 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
package body GMVC.Items is
------------
-- Append --
------------
procedure Append
(Self : in out Abstract_Container'Class;
Item : Item_Access) is
begin
Item.Container := Self'Unchecked_Access;
if Self.Head = null then
Self.Head := Item;
Self.Tail := Item;
else
Self.Tail.Next := Item;
Item.Previous := Self.Tail;
Self.Tail := Item;
end if;
end Append;
end GMVC.Items;
|
ryanroth79/stm32general | Ada | 87 | ads | package Program is
procedure Run;
pragma Export (C, Run, "run");
end Program;
|
usainzg/EHU | Ada | 2,693 | ads | generic
type Elemento is private;
package Listas is
type Lista is limited private; -- Tipo lista ordenada creciente
procedure Crear_Vacia (
L : out Lista);
-- Post: crea la lista vacia L
procedure Colocar (
L : in out Lista;
E : in Elemento);
-- Pre: L es una lista ordenada crecientemente
-- Post: Coloca en orden creciente el elemento E en L si hay espacio en la lista
-- Si la lista est� llena dar� un mensaje de Lista_Llena
procedure Obtener_Primero (
L : in Lista;
P: out Elemento);
-- Pre: L es una lista ordenada crecientemente
-- Post: P es el primer elemento de la lista L, si L no est� vac�a.
-- Si la lista est� vac�a dar� un mensaje de Lista_Vacia
function Esta (
L : in Lista;
N : in Elemento)
return Boolean;
-- Post: True sii C esta en la lista L
procedure Borrar_Primero (
L : in out Lista);
-- Pre: L es una lista ordenada crecientemente
-- Si la lista est� vac�a dar� un mensaje de Lista_Vacia
function Es_Vacia (
L : in Lista)
return Boolean;
-- Pre: L es una lista ordenada crecientemente
-- Post: True sii la lista L es vacia
function Igual (
L1,
L2 : in Lista)
return Boolean;
-- Pre: L1 y L2 son listas ordenadas
-- Post: True sii L1 y L2 son iguales (representan listas iguales)
procedure Copiar (
L1 : out Lista;
L2 : in Lista);
-- Pre: L2 es lista ordenada
-- Post: L1 es una lista ordenada copia de L2.
generic
with function Filtro(E: Elemento) return Boolean;
Cuantos: in Integer;
procedure Crear_Sublista(
L : in Lista;
Sl: out Lista
);
-- Pre: L es una lista ordenada crecientemente
-- Post: La sublista Sl esta formada por los n (donde n está condicionado por el parametro CUANTOS)
-- primeros elementos pares de la lista L.
-- Si no hay 4, la crear� con los elementos que pares que haya en L.
private
-- implementacion dinamica, ligadura simple
type Nodo;
type Lista is access Nodo;
type Nodo is
record
Info : Integer;
Sig : Lista;
end record;
end Listas;
|
mfkiwl/ewok-kernel-security-OS | Ada | 5,433 | 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 system;
package m4.fpu
with spark_mode => on
is
-------------------------------------------------
-- Coprocessor access control register (CPACR) --
-------------------------------------------------
type t_cp_access is
(ACCESS_DENIED, ACCESS_PRIV, ACCESS_UNDEF, ACCESS_FULL)
with size => 2;
for t_cp_access use
(ACCESS_DENIED => 2#00#,
ACCESS_PRIV => 2#01#,
ACCESS_UNDEF => 2#10#,
ACCESS_FULL => 2#11#);
type t_CPACR is record
CP10 : t_cp_access;
CP11 : t_cp_access;
end record
with volatile_full_access, size => 32;
for t_CPACR use record
CP10 at 0 range 20 .. 21;
CP11 at 0 range 22 .. 23;
end record;
-----------------------------------------------------
-- Floating-point context control register (FPCCR) --
-----------------------------------------------------
type t_FPU_FPCCR is record
LSPACT : boolean;
USER : boolean;
THREAD : boolean;
HFRDY : boolean;
MMRDY : boolean;
BFRDY : boolean;
MONRDY : boolean;
LSPEN : boolean;
ASPEN : boolean;
end record
with volatile_full_access, size => 32;
for t_FPU_FPCCR use record
LSPACT at 0 range 0 .. 0;
USER at 0 range 1 .. 1;
THREAD at 0 range 3 .. 3;
HFRDY at 0 range 4 .. 4;
MMRDY at 0 range 5 .. 5;
BFRDY at 0 range 6 .. 6;
MONRDY at 0 range 8 .. 8;
LSPEN at 0 range 30 .. 30;
ASPEN at 0 range 31 .. 31;
end record;
-----------------------------------------------------
-- Floating-point context address register (FPCAR) --
-----------------------------------------------------
type t_FPU_FPCAR is record
ADDRESS : unsigned_32;
end record
with volatile_full_access, size => 32;
----------------------------------------------------
-- Floating-point status control register (FPSCR) --
----------------------------------------------------
type t_FPU_FPSCR is record
IOC : bit;
DZC : bit;
OFC : bit;
UFC : bit;
IXC : bit;
reserved_5_6 : bits_2;
IDC : bit;
reserved_8_15 : unsigned_8;
reserved_16_21 : bits_6;
RMode : bits_2;
FZ : bit;
DN : bit;
AHP : bit;
reserved_27_27 : bit;
V : bit;
C : bit;
Z : bit;
N : bit;
end record
with volatile_full_access, size => 32;
for t_FPU_FPSCR use record
IOC at 0 range 0 .. 0;
DZC at 0 range 1 .. 1;
OFC at 0 range 2 .. 2;
UFC at 0 range 3 .. 3;
IXC at 0 range 4 .. 4;
reserved_5_6 at 0 range 5 .. 6;
IDC at 0 range 7 .. 7;
reserved_8_15 at 0 range 8 .. 15;
reserved_16_21 at 0 range 16 .. 21;
RMode at 0 range 22 .. 23;
FZ at 0 range 24 .. 24;
DN at 0 range 25 .. 25;
AHP at 0 range 26 .. 26;
reserved_27_27 at 0 range 27 .. 27;
V at 0 range 28 .. 28;
C at 0 range 29 .. 29;
Z at 0 range 30 .. 30;
N at 0 range 31 .. 31;
end record;
-------------------------------------------------------------
-- Floating-point default status control register (FPDSCR) --
-------------------------------------------------------------
type t_FPU_FPDSCR is record
RMode : bits_2;
FZ : bit;
DN : bit;
AHP : bit;
end record
with size => 32, volatile_full_access;
for t_FPU_FPDSCR use record
RMode at 0 range 22 .. 23;
FZ at 0 range 24 .. 24;
DN at 0 range 25 .. 25;
AHP at 0 range 26 .. 26;
end record;
--------------------
-- FPU peripheral --
--------------------
type t_FPU_peripheral is record
FPCCR : t_FPU_FPCCR;
FPCAR : t_FPU_FPCAR;
FPDSCR : t_FPU_FPDSCR;
end record
with volatile;
for t_FPU_peripheral use record
FPCCR at 16#04# range 0 .. 31;
FPCAR at 16#08# range 0 .. 31;
FPDSCR at 16#0C# range 0 .. 31;
end record;
FPU : t_FPU_peripheral
with
import,
volatile,
address => system'to_address(16#E000_EF30#);
CPACR : t_CPACR
with
import,
volatile,
address => system'to_address(16#E000_ED88#);
end m4.fpu;
|
gerr135/ada_composition | Ada | 1,898 | ads | --
-- This is a wrapper package for (non-generic) mixin.
-- As in generic case, everything can be done explicitly in a few lines of code,
-- as shown in main demo procedure. This module provides a somewhat clearer illustration by
-- keeping all relevant code in one place as well as presenting inheritance in a more
-- evident form by separating public presentation and hiding inheritance details in private part.
--
-- 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.
--
with base_iface; use base_iface;
with base_type; use base_type;
with oop_mixin;
package oop_mixin_compositor is
type Extension is limited new The_Interface with private;
type Mixin is limited new The_Type and The_Interface with private;
--
overriding procedure simple (Self : Mixin);
overriding procedure compound (Self : Mixin);
overriding procedure redispatching(Self : Mixin);
type Mixin_Child is new Mixin with private;
-- same could be done with Extension_Child, but that would be pretty much exactly
-- the same code/inheritance constructs
overriding procedure simple(Self : Mixin_Child);
private
type Extension is limited new oop_mixin.Derived with null record;
-- this should nont need any special handling, as we can derive from interfaces directly
type Mixin is limited new The_Type and The_Interface with record
-- here we have to mix-in extra type as a record entry (explicitly)
-- and provide a redirection glue code.
inner : oop_mixin.Derived;
end record;
---------------
-- try further inheritance and overriding various methods
type Mixin_Child is new Mixin with null record;
end oop_mixin_compositor;
|
MinimSecure/unum-sdk | Ada | 1,067 | adb | -- Copyright 2015-2019 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pack; use Pack;
procedure Var_Arr_Typedef is
RA : constant Rec_Type := (3, False);
RB : constant Rec_Type := (2, True);
VA : constant Vec_Type := (RA, RA, RB, RB);
VB : constant Vec_Type := (RB, RB, RA, RA);
A : constant Array_Type (1 .. Identity (4)) := (VA, VA, VB, VB);
begin
Do_Nothing (A); -- BREAK
end Var_Arr_Typedef;
|
AdaCore/training_material | Ada | 91 | ads | package Parser is
procedure Load (Filename : String);
procedure Print;
end Parser;
|
reznikmm/matreshka | Ada | 4,097 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Presentation_Preset_Class_Attributes;
package Matreshka.ODF_Presentation.Preset_Class_Attributes is
type Presentation_Preset_Class_Attribute_Node is
new Matreshka.ODF_Presentation.Abstract_Presentation_Attribute_Node
and ODF.DOM.Presentation_Preset_Class_Attributes.ODF_Presentation_Preset_Class_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Presentation_Preset_Class_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Presentation_Preset_Class_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Presentation.Preset_Class_Attributes;
|
reznikmm/matreshka | Ada | 4,015 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.ODF_Attributes.FO.Hyphenation_Remain_Char_Count;
package ODF.DOM.Attributes.FO.Hyphenation_Remain_Char_Count.Internals is
function Create
(Node : Matreshka.ODF_Attributes.FO.Hyphenation_Remain_Char_Count.FO_Hyphenation_Remain_Char_Count_Access)
return ODF.DOM.Attributes.FO.Hyphenation_Remain_Char_Count.ODF_FO_Hyphenation_Remain_Char_Count;
function Wrap
(Node : Matreshka.ODF_Attributes.FO.Hyphenation_Remain_Char_Count.FO_Hyphenation_Remain_Char_Count_Access)
return ODF.DOM.Attributes.FO.Hyphenation_Remain_Char_Count.ODF_FO_Hyphenation_Remain_Char_Count;
end ODF.DOM.Attributes.FO.Hyphenation_Remain_Char_Count.Internals;
|
JeremyGrosser/Ada_Drivers_Library | Ada | 1,930 | ads | -- This package was generated by the Ada_Drivers_Library project wizard script
package ADL_Config is
Architecture : constant String := "ARM"; -- From board definition
Board : constant String := "NUCLEO_F446ZE"; -- From command line
CPU_Core : constant String := "ARM Cortex-M4F"; -- From mcu definition
Device_Family : constant String := "STM32F4"; -- From board definition
Device_Name : constant String := "STM32F407VGTx"; -- From board definition
Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition
Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition
Has_ZFP_Runtime : constant String := "False"; -- From board definition
High_Speed_External_Clock : constant := 8000000; -- From board definition
Max_Mount_Name_Length : constant := 128; -- From default value
Max_Mount_Points : constant := 2; -- From default value
Max_Path_Length : constant := 1024; -- From default value
Number_Of_Interrupts : constant := 0; -- From default value
Runtime_Name : constant String := "ravenscar-full-stm32f4"; -- From default value
Runtime_Name_Suffix : constant String := "stm32f4"; -- From board definition
Runtime_Profile : constant String := "ravenscar-full"; -- From command line
Use_Startup_Gen : constant Boolean := False; -- From command line
Vendor : constant String := "STMicro"; -- From board definition
end ADL_Config;
|
AdaCore/gpr | Ada | 955 | adb | with p8_0; use p8_0;
package body p8_3 is
function p8_3_0 (Item : Integer) return Integer is
Result : Long_Long_Integer;
begin
if Item < 0 then
return -Item;
end if;
Result := Long_Long_Integer (p8_0_0 (Item - 1)) + 830;
return Integer (Result rem Long_Long_Integer (Integer'Last));
end p8_3_0;
function p8_3_1 (Item : Integer) return Integer is
Result : Long_Long_Integer;
begin
if Item < 0 then
return -Item;
end if;
Result := Long_Long_Integer (p8_0_1 (Item - 1)) + 831;
return Integer (Result rem Long_Long_Integer (Integer'Last));
end p8_3_1;
function p8_3_2 (Item : Integer) return Integer is
Result : Long_Long_Integer;
begin
if Item < 0 then
return -Item;
end if;
Result := Long_Long_Integer (p8_0_2 (Item - 1)) + 832;
return Integer (Result rem Long_Long_Integer (Integer'Last));
end p8_3_2;
end p8_3;
|
reznikmm/matreshka | Ada | 834 | adb | package body Forum.Posts is
------------
-- Decode --
------------
function Decode
(Image : League.Strings.Universal_String;
Value : out Post_Identifier) return Boolean is
begin
-- XXX This subprogram must be rewritter without use of exceptions.
Value := Post_Identifier'Wide_Wide_Value (Image.To_Wide_Wide_String);
return True;
exception
when Constraint_Error =>
return False;
end Decode;
------------
-- Encode --
------------
function Encode
(Item : Post_Identifier)
return League.Strings.Universal_String
is
Aux : constant Wide_Wide_String
:= Post_Identifier'Wide_Wide_Image (Item);
begin
return
League.Strings.To_Universal_String (Aux (Aux'First + 1 .. Aux'Last));
end Encode;
end Forum.Posts;
|
reznikmm/matreshka | Ada | 3,654 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Draw_Plugin_Elements is
pragma Preelaborate;
type ODF_Draw_Plugin is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Draw_Plugin_Access is
access all ODF_Draw_Plugin'Class
with Storage_Size => 0;
end ODF.DOM.Draw_Plugin_Elements;
|
optikos/oasis | Ada | 448 | ads | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Nodes.Generic_Vectors;
with Program.Elements.Expressions;
package Program.Nodes.Expression_Vectors is new
Program.Nodes.Generic_Vectors
(Program.Elements.Expressions.Expression_Vector);
pragma Preelaborate (Program.Nodes.Expression_Vectors);
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 10,509 | ads | pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32L0x3.svd
pragma Restrictions (No_Elaboration_Code);
with System;
package STM32_SVD.SCB is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CPUID_Revision_Field is STM32_SVD.UInt4;
subtype CPUID_PartNo_Field is STM32_SVD.UInt12;
subtype CPUID_Architecture_Field is STM32_SVD.UInt4;
subtype CPUID_Variant_Field is STM32_SVD.UInt4;
subtype CPUID_Implementer_Field is STM32_SVD.Byte;
-- CPUID base register
type CPUID_Register is record
-- Read-only. Revision number
Revision : CPUID_Revision_Field;
-- Read-only. Part number of the processor
PartNo : CPUID_PartNo_Field;
-- Read-only. Reads as 0xF
Architecture : CPUID_Architecture_Field;
-- Read-only. Variant number
Variant : CPUID_Variant_Field;
-- Read-only. Implementer code
Implementer : CPUID_Implementer_Field;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CPUID_Register use record
Revision at 0 range 0 .. 3;
PartNo at 0 range 4 .. 15;
Architecture at 0 range 16 .. 19;
Variant at 0 range 20 .. 23;
Implementer at 0 range 24 .. 31;
end record;
subtype ICSR_VECTACTIVE_Field is STM32_SVD.UInt9;
subtype ICSR_RETTOBASE_Field is STM32_SVD.Bit;
subtype ICSR_VECTPENDING_Field is STM32_SVD.UInt7;
subtype ICSR_ISRPENDING_Field is STM32_SVD.Bit;
subtype ICSR_PENDSTCLR_Field is STM32_SVD.Bit;
subtype ICSR_PENDSTSET_Field is STM32_SVD.Bit;
subtype ICSR_PENDSVCLR_Field is STM32_SVD.Bit;
subtype ICSR_PENDSVSET_Field is STM32_SVD.Bit;
subtype ICSR_NMIPENDSET_Field is STM32_SVD.Bit;
-- Interrupt control and state register
type ICSR_Register is record
-- Active vector
VECTACTIVE : ICSR_VECTACTIVE_Field := 16#0#;
-- unspecified
Reserved_9_10 : STM32_SVD.UInt2 := 16#0#;
-- Return to base level
RETTOBASE : ICSR_RETTOBASE_Field := 16#0#;
-- Pending vector
VECTPENDING : ICSR_VECTPENDING_Field := 16#0#;
-- unspecified
Reserved_19_21 : STM32_SVD.UInt3 := 16#0#;
-- Interrupt pending flag
ISRPENDING : ICSR_ISRPENDING_Field := 16#0#;
-- unspecified
Reserved_23_24 : STM32_SVD.UInt2 := 16#0#;
-- SysTick exception clear-pending bit
PENDSTCLR : ICSR_PENDSTCLR_Field := 16#0#;
-- SysTick exception set-pending bit
PENDSTSET : ICSR_PENDSTSET_Field := 16#0#;
-- PendSV clear-pending bit
PENDSVCLR : ICSR_PENDSVCLR_Field := 16#0#;
-- PendSV set-pending bit
PENDSVSET : ICSR_PENDSVSET_Field := 16#0#;
-- unspecified
Reserved_29_30 : STM32_SVD.UInt2 := 16#0#;
-- NMI set-pending bit.
NMIPENDSET : ICSR_NMIPENDSET_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ICSR_Register use record
VECTACTIVE at 0 range 0 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
RETTOBASE at 0 range 11 .. 11;
VECTPENDING at 0 range 12 .. 18;
Reserved_19_21 at 0 range 19 .. 21;
ISRPENDING at 0 range 22 .. 22;
Reserved_23_24 at 0 range 23 .. 24;
PENDSTCLR at 0 range 25 .. 25;
PENDSTSET at 0 range 26 .. 26;
PENDSVCLR at 0 range 27 .. 27;
PENDSVSET at 0 range 28 .. 28;
Reserved_29_30 at 0 range 29 .. 30;
NMIPENDSET at 0 range 31 .. 31;
end record;
subtype VTOR_TBLOFF_Field is STM32_SVD.UInt25;
-- Vector table offset register
type VTOR_Register is record
-- unspecified
Reserved_0_6 : STM32_SVD.UInt7 := 16#0#;
-- Vector table base offset field
TBLOFF : VTOR_TBLOFF_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for VTOR_Register use record
Reserved_0_6 at 0 range 0 .. 6;
TBLOFF at 0 range 7 .. 31;
end record;
subtype AIRCR_VECTCLRACTIVE_Field is STM32_SVD.Bit;
subtype AIRCR_SYSRESETREQ_Field is STM32_SVD.Bit;
subtype AIRCR_ENDIANESS_Field is STM32_SVD.Bit;
subtype AIRCR_VECTKEYSTAT_Field is STM32_SVD.UInt16;
-- Application interrupt and reset control register
type AIRCR_Register is record
-- unspecified
Reserved_0_0 : STM32_SVD.Bit := 16#0#;
-- VECTCLRACTIVE
VECTCLRACTIVE : AIRCR_VECTCLRACTIVE_Field := 16#0#;
-- SYSRESETREQ
SYSRESETREQ : AIRCR_SYSRESETREQ_Field := 16#0#;
-- unspecified
Reserved_3_14 : STM32_SVD.UInt12 := 16#0#;
-- ENDIANESS
ENDIANESS : AIRCR_ENDIANESS_Field := 16#0#;
-- Register key
VECTKEYSTAT : AIRCR_VECTKEYSTAT_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AIRCR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
VECTCLRACTIVE at 0 range 1 .. 1;
SYSRESETREQ at 0 range 2 .. 2;
Reserved_3_14 at 0 range 3 .. 14;
ENDIANESS at 0 range 15 .. 15;
VECTKEYSTAT at 0 range 16 .. 31;
end record;
subtype SCR_SLEEPONEXIT_Field is STM32_SVD.Bit;
subtype SCR_SLEEPDEEP_Field is STM32_SVD.Bit;
subtype SCR_SEVEONPEND_Field is STM32_SVD.Bit;
-- System control register
type SCR_Register is record
-- unspecified
Reserved_0_0 : STM32_SVD.Bit := 16#0#;
-- SLEEPONEXIT
SLEEPONEXIT : SCR_SLEEPONEXIT_Field := 16#0#;
-- SLEEPDEEP
SLEEPDEEP : SCR_SLEEPDEEP_Field := 16#0#;
-- unspecified
Reserved_3_3 : STM32_SVD.Bit := 16#0#;
-- Send Event on Pending bit
SEVEONPEND : SCR_SEVEONPEND_Field := 16#0#;
-- unspecified
Reserved_5_31 : STM32_SVD.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SCR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
SLEEPONEXIT at 0 range 1 .. 1;
SLEEPDEEP at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
SEVEONPEND at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype CCR_NONBASETHRDENA_Field is STM32_SVD.Bit;
subtype CCR_USERSETMPEND_Field is STM32_SVD.Bit;
subtype CCR_UNALIGN_TRP_Field is STM32_SVD.Bit;
subtype CCR_DIV_0_TRP_Field is STM32_SVD.Bit;
subtype CCR_BFHFNMIGN_Field is STM32_SVD.Bit;
subtype CCR_STKALIGN_Field is STM32_SVD.Bit;
-- Configuration and control register
type CCR_Register is record
-- Configures how the processor enters Thread mode
NONBASETHRDENA : CCR_NONBASETHRDENA_Field := 16#0#;
-- USERSETMPEND
USERSETMPEND : CCR_USERSETMPEND_Field := 16#0#;
-- unspecified
Reserved_2_2 : STM32_SVD.Bit := 16#0#;
-- UNALIGN_ TRP
UNALIGN_TRP : CCR_UNALIGN_TRP_Field := 16#0#;
-- DIV_0_TRP
DIV_0_TRP : CCR_DIV_0_TRP_Field := 16#0#;
-- unspecified
Reserved_5_7 : STM32_SVD.UInt3 := 16#0#;
-- BFHFNMIGN
BFHFNMIGN : CCR_BFHFNMIGN_Field := 16#0#;
-- STKALIGN
STKALIGN : CCR_STKALIGN_Field := 16#0#;
-- unspecified
Reserved_10_31 : STM32_SVD.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CCR_Register use record
NONBASETHRDENA at 0 range 0 .. 0;
USERSETMPEND at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
UNALIGN_TRP at 0 range 3 .. 3;
DIV_0_TRP at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
BFHFNMIGN at 0 range 8 .. 8;
STKALIGN at 0 range 9 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
subtype SHPR2_PRI_11_Field is STM32_SVD.Byte;
-- System handler priority registers
type SHPR2_Register is record
-- unspecified
Reserved_0_23 : STM32_SVD.UInt24 := 16#0#;
-- Priority of system handler 11
PRI_11 : SHPR2_PRI_11_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SHPR2_Register use record
Reserved_0_23 at 0 range 0 .. 23;
PRI_11 at 0 range 24 .. 31;
end record;
subtype SHPR3_PRI_14_Field is STM32_SVD.Byte;
subtype SHPR3_PRI_15_Field is STM32_SVD.Byte;
-- System handler priority registers
type SHPR3_Register is record
-- unspecified
Reserved_0_15 : STM32_SVD.UInt16 := 16#0#;
-- Priority of system handler 14
PRI_14 : SHPR3_PRI_14_Field := 16#0#;
-- Priority of system handler 15
PRI_15 : SHPR3_PRI_15_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SHPR3_Register use record
Reserved_0_15 at 0 range 0 .. 15;
PRI_14 at 0 range 16 .. 23;
PRI_15 at 0 range 24 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- System control block
type SCB_Peripheral is record
-- CPUID base register
CPUID : aliased CPUID_Register;
-- Interrupt control and state register
ICSR : aliased ICSR_Register;
-- Vector table offset register
VTOR : aliased VTOR_Register;
-- Application interrupt and reset control register
AIRCR : aliased AIRCR_Register;
-- System control register
SCR : aliased SCR_Register;
-- Configuration and control register
CCR : aliased CCR_Register;
-- System handler priority registers
SHPR2 : aliased SHPR2_Register;
-- System handler priority registers
SHPR3 : aliased SHPR3_Register;
end record
with Volatile;
for SCB_Peripheral use record
CPUID at 16#0# range 0 .. 31;
ICSR at 16#4# range 0 .. 31;
VTOR at 16#8# range 0 .. 31;
AIRCR at 16#C# range 0 .. 31;
SCR at 16#10# range 0 .. 31;
CCR at 16#14# range 0 .. 31;
SHPR2 at 16#1C# range 0 .. 31;
SHPR3 at 16#20# range 0 .. 31;
end record;
-- System control block
SCB_Periph : aliased SCB_Peripheral
with Import, Address => SCB_Base;
end STM32_SVD.SCB;
|
reznikmm/matreshka | Ada | 3,933 | 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.Db_Port_Attributes;
package Matreshka.ODF_Db.Port_Attributes is
type Db_Port_Attribute_Node is
new Matreshka.ODF_Db.Abstract_Db_Attribute_Node
and ODF.DOM.Db_Port_Attributes.ODF_Db_Port_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Db_Port_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Db_Port_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Db.Port_Attributes;
|
zhmu/ananas | Ada | 1,443 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- A D A . S T R I N G S . W I D E _ W I D E _ F I X E D . --
-- W I D E _ W I D E _ H A S H --
-- --
-- S p e c --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
with Ada.Containers;
with Ada.Strings.Wide_Wide_Hash;
function Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash
(Key : Wide_Wide_String) return Containers.Hash_Type
renames Ada.Strings.Wide_Wide_Hash;
pragma Pure (Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash);
|
PThierry/ewok-kernel | Ada | 916 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
package body default_handlers
with spark_mode => off
is
procedure dummy is
begin
null;
end dummy;
end default_handlers;
|
stcarrez/ada-keystore | Ada | 3,691 | adb | -----------------------------------------------------------------------
-- akt-commands-drivers -- Ada Keystore command driver
-- Copyright (C) 2019, 2023 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Directories;
with Ada.Command_Line;
with Util.Files;
with Util.Strings;
with AKT.Configs;
package body AKT.Commands.Drivers is
function Get_Help (Dir : in String;
Name : in String;
Locale : in String) return String;
function Get_Resources_Directory return String;
-- ------------------------------
-- 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) is
begin
GC.Set_Usage (Config => Config,
Usage => Command.Get_Name & " [arguments]",
Help => Command.Get_Description);
AKT.Commands.Setup (Config, Context);
end Setup;
function Get_Resources_Directory return String is
begin
if Ada.Directories.Exists (AKT.Configs.PREFIX & AKT.Configs.RESOURCES) then
return AKT.Configs.PREFIX & AKT.Configs.RESOURCES;
end if;
declare
Name : constant String := Ada.Command_Line.Command_Name;
Path : constant String := Ada.Directories.Containing_Directory (Name);
Dir : constant String := Ada.Directories.Containing_Directory (Path);
begin
return Dir & AKT.Configs.RESOURCES;
end;
end Get_Resources_Directory;
function Get_Help (Dir : in String;
Name : in String;
Locale : in String) return String is
Pos : constant Natural := Util.Strings.Index (Locale, '_');
begin
if Pos > 0 then
return Dir & Locale (Locale'First .. Pos - 1) & "/" & Name & ".txt";
elsif Locale'Length > 0 then
return Dir & Locale & "/" & Name & ".txt";
else
return Dir & "en/" & Name & ".txt";
end if;
end Get_Help;
-- ------------------------------
-- Write the help associated with the command.
-- ------------------------------
overriding
procedure Help (Command : in out Command_Type;
Name : in String;
Context : in out Context_Type) is
pragma Unreferenced (Command, Context);
Dir : constant String := Get_Resources_Directory;
Path : constant String := Get_Help (Dir, Name, Intl.Current_Locale);
begin
if Ada.Directories.Exists (Path) then
Util.Files.Read_File (Path => Path,
Process => Util.Commands.Put_Raw_Line'Access);
else
Util.Files.Read_File (Path => Get_Help (Dir, Name, "en"),
Process => Util.Commands.Put_Raw_Line'Access);
end if;
end Help;
end AKT.Commands.Drivers;
|
optikos/oasis | Ada | 6,716 | adb | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Program.Nodes.Formal_Type_Declarations is
function Create
(Type_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Definition : not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Formal_Type_Declaration is
begin
return Result : Formal_Type_Declaration :=
(Type_Token => Type_Token, Name => Name,
Discriminant_Part => Discriminant_Part, Is_Token => Is_Token,
Definition => Definition, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Definition : not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Formal_Type_Declaration is
begin
return Result : Implicit_Formal_Type_Declaration :=
(Name => Name, Discriminant_Part => Discriminant_Part,
Definition => Definition, Aspects => Aspects,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Name
(Self : Base_Formal_Type_Declaration)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access is
begin
return Self.Name;
end Name;
overriding function Discriminant_Part
(Self : Base_Formal_Type_Declaration)
return Program.Elements.Definitions.Definition_Access is
begin
return Self.Discriminant_Part;
end Discriminant_Part;
overriding function Definition
(Self : Base_Formal_Type_Declaration)
return not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access is
begin
return Self.Definition;
end Definition;
overriding function Aspects
(Self : Base_Formal_Type_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is
begin
return Self.Aspects;
end Aspects;
overriding function Type_Token
(Self : Formal_Type_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Type_Token;
end Type_Token;
overriding function Is_Token
(Self : Formal_Type_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Is_Token;
end Is_Token;
overriding function With_Token
(Self : Formal_Type_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.With_Token;
end With_Token;
overriding function Semicolon_Token
(Self : Formal_Type_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Semicolon_Token;
end Semicolon_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Formal_Type_Declaration)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Formal_Type_Declaration)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Formal_Type_Declaration)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize
(Self : aliased in out Base_Formal_Type_Declaration'Class) is
begin
Set_Enclosing_Element (Self.Name, Self'Unchecked_Access);
if Self.Discriminant_Part.Assigned then
Set_Enclosing_Element (Self.Discriminant_Part, Self'Unchecked_Access);
end if;
Set_Enclosing_Element (Self.Definition, Self'Unchecked_Access);
for Item in Self.Aspects.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
null;
end Initialize;
overriding function Is_Formal_Type_Declaration_Element
(Self : Base_Formal_Type_Declaration)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Formal_Type_Declaration_Element;
overriding function Is_Declaration_Element
(Self : Base_Formal_Type_Declaration)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Declaration_Element;
overriding procedure Visit
(Self : not null access Base_Formal_Type_Declaration;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Formal_Type_Declaration (Self);
end Visit;
overriding function To_Formal_Type_Declaration_Text
(Self : aliased in out Formal_Type_Declaration)
return Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Text_Access is
begin
return Self'Unchecked_Access;
end To_Formal_Type_Declaration_Text;
overriding function To_Formal_Type_Declaration_Text
(Self : aliased in out Implicit_Formal_Type_Declaration)
return Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Formal_Type_Declaration_Text;
end Program.Nodes.Formal_Type_Declarations;
|
charlie5/lace | Ada | 1,021 | ads | package openGL.Geometry.colored_textured
--
-- Supports per-vertex site, color and texture.
--
is
type Item is new openGL.Geometry.item with private;
function new_Geometry return access Geometry.colored_textured.item'Class;
----------
-- Vertex
--
type Vertex is
record
Site : Vector_3;
Color : rgba_Color;
Coords : Coordinate_2D;
end record;
type Vertex_array is array (long_Index_t range <>) of aliased Vertex;
type Vertex_array_view is access Vertex_array;
--------------
-- Attributes
--
procedure Vertices_are (Self : in out Item; Now : in Vertex_array);
overriding
procedure Indices_are (Self : in out Item; Now : in Indices;
for_Facia : in Positive);
private
type Item is new Geometry.item with
record
null;
end record;
overriding
procedure enable_Texture (Self : in Item);
end openGL.Geometry.colored_textured;
|
reznikmm/matreshka | Ada | 3,785 | 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.Style.Writing_Mode is
type Style_Writing_Mode_Node is
new Matreshka.ODF_Attributes.Style.Style_Node_Base with null record;
type Style_Writing_Mode_Access is access all Style_Writing_Mode_Node'Class;
overriding function Get_Local_Name
(Self : not null access constant Style_Writing_Mode_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Attributes.Style.Writing_Mode;
|
reznikmm/matreshka | Ada | 3,772 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.Constants;
package body Matreshka.ODF_Attributes.FO.Keep_With_Next is
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant FO_Keep_With_Next_Node)
return League.Strings.Universal_String is
begin
return ODF.Constants.Keep_With_Next_Name;
end Get_Local_Name;
end Matreshka.ODF_Attributes.FO.Keep_With_Next;
|
KipodAfterFree/KAF-2019-FireHog | Ada | 4,730 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo.Handler --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer <[email protected]> 1996
-- Version Control
-- $Revision: 1.5 $
-- Binding Version 00.93
------------------------------------------------------------------------------
with Sample.Menu_Demo.Aux;
with Sample.Explanation; use Sample.Explanation;
with Sample.Manifest; use Sample.Manifest;
package body Sample.Menu_Demo.Handler is
package Aux renames Sample.Menu_Demo.Aux;
procedure Drive_Me (M : in Menu;
Title : in String := "")
is
L : Line_Count;
C : Column_Count;
Y : Line_Position;
X : Column_Position;
begin
Aux.Geometry (M, L, C, Y, X);
Drive_Me (M, Y, X, Title);
end Drive_Me;
procedure Drive_Me (M : in Menu;
Lin : in Line_Position;
Col : in Column_Position;
Title : in String := "")
is
Pan : Panel := Aux.Create (M, Title, Lin, Col);
V : Cursor_Visibility := Invisible;
begin
Set_Cursor_Visibility (V);
loop
declare
K : Key_Code := Aux.Get_Request (M, Pan);
R : Driver_Result := Driver (M, K);
begin
case R is
when Menu_Ok => null;
when Unknown_Request =>
declare
I : constant Item := Current (M);
O : Item_Option_Set;
begin
Get_Options (I, O);
if K = SELECT_ITEM and then not O.Selectable then
Beep;
else
if My_Driver (M, K, Pan) then
exit;
end if;
end if;
end;
when others => Beep;
end case;
end;
end loop;
Set_Cursor_Visibility (V);
Aux.Destroy (M, Pan);
end Drive_Me;
end Sample.Menu_Demo.Handler;
|
reznikmm/matreshka | Ada | 6,878 | 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.Character_Set_Elements is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Db_Character_Set_Element_Node is
begin
return Self : Db_Character_Set_Element_Node do
Matreshka.ODF_Db.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Db_Prefix);
end return;
end Create;
----------------
-- Enter_Node --
----------------
overriding procedure Enter_Node
(Self : not null access Db_Character_Set_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_Db_Character_Set
(ODF.DOM.Db_Character_Set_Elements.ODF_Db_Character_Set_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 Db_Character_Set_Element_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Character_Set_Element;
end Get_Local_Name;
----------------
-- Leave_Node --
----------------
overriding procedure Leave_Node
(Self : not null access Db_Character_Set_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_Db_Character_Set
(ODF.DOM.Db_Character_Set_Elements.ODF_Db_Character_Set_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 Db_Character_Set_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_Db_Character_Set
(Visitor,
ODF.DOM.Db_Character_Set_Elements.ODF_Db_Character_Set_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.Db_URI,
Matreshka.ODF_String_Constants.Character_Set_Element,
Db_Character_Set_Element_Node'Tag);
end Matreshka.ODF_Db.Character_Set_Elements;
|
zhmu/ananas | Ada | 2,511 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G . R E S T R I C T E D --
-- --
-- S p e c --
-- --
-- Copyright (C) 1998-2022, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is the parent package of the GNAT restricted tasking run time
package System.Tasking.Restricted is
end System.Tasking.Restricted;
|
HeisenbugLtd/flac-ada | Ada | 14,265 | 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);
------------------------------------------------------------------------------
-- FLAC/Ada
--
-- Frames
--
-- Defines various frame headers of FLAC files.
------------------------------------------------------------------------------
with Ada.Streams.Stream_IO;
with Flac.CRC;
with Flac.Headers.Stream_Info;
with Flac.Types;
with SPARK_Stream_IO;
package Flac.Frames with
SPARK_Mode => On
is
-- <14> Sync code '11_1111_1111_1110'
type Sync_Code is mod 2 ** 14;
-- <1> Blocking strategy:
-- 0 : fixed-blocksize stream; frame header encodes the frame number
-- 1 : variable-blocksize stream; frame header encodes the sample number
type Blocking_Strategy is (Fixed, Variable);
for Blocking_Strategy use (Fixed => 0,
Variable => 1);
-- <4> Block size in inter-channel samples:
-- 0000 : reserved
-- 0001 : 192 samples
-- 0010-0101 : 576 * (2^(n-2)) samples, i.e. 576/1152/2304/4608
-- 0110 : get 8 bit (blocksize-1) from end of header
-- 0111 : get 16 bit (blocksize-1) from end of header
-- 1000-1111 : 256 * (2^(n-8)) samples, i.e. 256/512/1024/2048/4096/
-- 8192/16384/32768
type Block_Size is (Reserved,
Samples_192,
Samples_576,
Samples_1152,
Samples_2304,
Samples_4608,
Samples_8_Bit_From_EOH,
Samples_16_Bit_From_EOH,
Samples_256,
Samples_512,
Samples_1024,
Samples_2048,
Samples_4096,
Samples_8192,
Samples_16384,
Samples_32768);
for Block_Size use (Reserved => 2#0000#,
Samples_192 => 2#0001#,
Samples_576 => 2#0010#,
Samples_1152 => 2#0011#,
Samples_2304 => 2#0100#,
Samples_4608 => 2#0101#,
Samples_8_Bit_From_EOH => 2#0110#,
Samples_16_Bit_From_EOH => 2#0111#,
Samples_256 => 2#1000#,
Samples_512 => 2#1001#,
Samples_1024 => 2#1010#,
Samples_2048 => 2#1011#,
Samples_4096 => 2#1100#,
Samples_8192 => 2#1101#,
Samples_16384 => 2#1110#,
Samples_32768 => 2#1111#);
-- <4> Sample rate:
-- 0000 : get from STREAMINFO metadata block
-- 0001 : 88.2kHz
-- 0010 : 176.4kHz
-- 0011 : 192kHz
-- 0100 : 8kHz
-- 0101 : 16kHz
-- 0110 : 22.05kHz
-- 0111 : 24kHz
-- 1000 : 32kHz
-- 1001 : 44.1kHz
-- 1010 : 48kHz
-- 1011 : 96kHz
-- 1100 : get 8 bit sample rate (in kHz) from end of header
-- 1101 : get 16 bit sample rate (in Hz) from end of header
-- 1110 : get 16 bit sample rate (in tens of Hz) from end of header
-- 1111 : invalid, to prevent sync-fooling string of 1s
type Sample_Rate is (Get_From_Stream_Info,
kHz_88_2,
kHz_176_4,
kHz_192,
kHz_8,
kHz_16,
kHz_22_05,
kHz_24,
kHz_32,
kHz_44_1,
kHz_48,
kHz_96,
Get_8_Bit_kHz_From_EOH,
Get_16_Bit_kHz_From_EOH,
Get_16_Bit_Ten_kHz_From_EOH,
Invalid);
for Sample_Rate use (Get_From_Stream_Info => 2#0000#,
kHz_88_2 => 2#0001#,
kHz_176_4 => 2#0010#,
kHz_192 => 2#0011#,
kHz_8 => 2#0100#,
kHz_16 => 2#0101#,
kHz_22_05 => 2#0110#,
kHz_24 => 2#0111#,
kHz_32 => 2#1000#,
kHz_44_1 => 2#1001#,
kHz_48 => 2#1010#,
kHz_96 => 2#1011#,
Get_8_Bit_kHz_From_EOH => 2#1100#,
Get_16_Bit_kHz_From_EOH => 2#1101#,
Get_16_Bit_Ten_kHz_From_EOH => 2#1110#,
Invalid => 2#1111#);
-- <4> Channel assignment
-- 0000-0111 : (number of independent channels)-1. Where defined, the
-- channel order follows SMPTE/ITU-R recommendations. The
-- assignments are as follows:
-- 1 channel : mono
-- 2 channels: left, right
-- 3 channels: left, right, center
-- 4 channels: front left, front right, back left,
-- back right
-- 5 channels: front left, front right, front center,
-- back/surround left, back/surround right
-- 6 channels: front left, front right, front center, LFE,
-- back/surround left, back/surround right
-- 7 channels: front left, front right, front center, LFE,
-- back center, side left, side right
-- 8 channels: front left, front right, front center, LFE,
-- back left, back right, side left, side right
-- 1000 : left/side stereo: channel 0 is the left channel, channel
-- 1 is the side (difference) channel
-- 1001 : right/side stereo: channel 0 is the side (difference)
-- channel, channel 1 is the right
-- channel
-- 1010 : mid/side stereo: channel 0 is the mid (average) channel,
-- channel 1 is the side (difference)
-- channel
-- 1011-1111 : reserved
type Channel_Assignment is (Mono,
L_R,
L_R_C,
FL_FR_BL_BR,
FL_FR_FC_BL_BR,
FL_FR_FC_LFE_BL_BR,
FL_FR_FC_LFE_BC_SL_SR,
FL_FR_FC_LFE_BL_BR_SL_SR,
Left_Side,
Right_Side,
Mid_Side,
Reserved_1011,
Reserved_1100,
Reserved_1101,
Reserved_1110,
Reserved_1111);
for Channel_Assignment use (Mono => 2#0000#,
L_R => 2#0001#,
L_R_C => 2#0010#,
FL_FR_BL_BR => 2#0011#,
FL_FR_FC_BL_BR => 2#0100#,
FL_FR_FC_LFE_BL_BR => 2#0101#,
FL_FR_FC_LFE_BC_SL_SR => 2#0110#,
FL_FR_FC_LFE_BL_BR_SL_SR => 2#0111#,
Left_Side => 2#1000#,
Right_Side => 2#1001#,
Mid_Side => 2#1010#,
Reserved_1011 => 2#1011#,
Reserved_1100 => 2#1100#,
Reserved_1101 => 2#1101#,
Reserved_1110 => 2#1110#,
Reserved_1111 => 2#1111#);
-- <3> Sample size in bits:
-- 000 : get from STREAMINFO metadata block
-- 001 : 8 bits per sample
-- 010 : 12 bits per sample
-- 011 : reserved
-- 100 : 16 bits per sample
-- 101 : 20 bits per sample
-- 110 : 24 bits per sample
-- 111 : reserved
type Sample_Size is (Get_From_Stream_Info,
Bits_8,
Bits_12,
Reserved_011,
Bits_16,
Bits_20,
Bits_24,
Reserved_111);
for Sample_Size use (Get_From_Stream_Info => 2#000#,
Bits_8 => 2#001#,
Bits_12 => 2#010#,
Reserved_011 => 2#011#,
Bits_16 => 2#100#,
Bits_20 => 2#101#,
Bits_24 => 2#110#,
Reserved_111 => 2#111#);
-- FRAME_HEADER
-- <14> Sync code '11_1111_1111_1110'
-- <1> Reserved: [1]
-- 0 : mandatory value
-- 1 : reserved for future use
-- <1> Blocking strategy:
-- 0 : fixed-blocksize stream; frame header encodes the frame number
-- 1 : variable-blocksize stream; frame header encodes the sample number
-- <4> Block size in inter-channel samples:
-- 0000 : reserved
-- 0001 : 192 samples
-- 0010-0101 : 576 * (2^(n-2)) samples, i.e. 576/1152/2304/4608
-- 0110 : get 8 bit (blocksize-1) from end of header
-- 0111 : get 16 bit (blocksize-1) from end of header
-- 1000-1111 : 256 * (2^(n-8)) samples, i.e. 256/512/1024/2048/4096/
-- 8192/16384/32768
-- <4> Sample rate:
-- 0000 : get from STREAMINFO metadata block
-- 0001 : 88.2kHz
-- 0010 : 176.4kHz
-- 0011 : 192kHz
-- 0100 : 8kHz
-- 0101 : 16kHz
-- 0110 : 22.05kHz
-- 0111 : 24kHz
-- 1000 : 32kHz
-- 1001 : 44.1kHz
-- 1010 : 48kHz
-- 1011 : 96kHz
-- 1100 : get 8 bit sample rate (in kHz) from end of header
-- 1101 : get 16 bit sample rate (in Hz) from end of header
-- 1110 : get 16 bit sample rate (in tens of Hz) from end of header
-- 1111 : invalid, to prevent sync-fooling string of 1s
-- <4> Channel assignment
-- 0000-0111 : (number of independent channels)-1. Where defined, the
-- channel order follows SMPTE/ITU-R recommendations. See
-- above for the assignments.
-- <3> Sample size in bits:
-- 000 : get from STREAMINFO metadata block
-- 001 : 8 bits per sample
-- 010 : 12 bits per sample
-- 011 : reserved
-- 100 : 16 bits per sample
-- 101 : 20 bits per sample
-- 110 : 24 bits per sample
-- 111 : reserved
-- <1> Reserved:
-- 0 : mandatory value
-- 1 : reserved for future use
-- <?> if (variable blocksize)
-- <8-56>:"UTF-8" coded sample number (decoded number is 36 bits)
-- else
-- <8-48>:"UTF-8" coded frame number (decoded number is 31 bits)
-- <?> if (blocksize bits == 011x)
-- 8/16 bit (blocksize-1)
-- <?> if (sample rate bits == 11xx)
-- 8/16 bit sample rate
-- <8> CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) of
-- everything before the crc, including the sync code
type T (Blocking_Strategy : Frames.Blocking_Strategy := Fixed) is
record
Block_Size : Types.Block_Size;
Sample_Rate : Types.Sample_Rate;
Channel_Assignment : Types.Channel_Count;
Sample_Size : Types.Bits_Per_Sample;
CRC_16 : Flac.CRC.Checksum_16;
case Blocking_Strategy is
when Variable =>
Sample_Number : Types.Sample_Count; -- 36 bits
when Fixed =>
Frame_Number : Types.Frame_Count; -- 31 bits
end case;
end record;
---------------------------------------------------------------------------
-- Read
---------------------------------------------------------------------------
procedure Read (File : in Ada.Streams.Stream_IO.File_Type;
Sample_Rate : in Types.Sample_Rate;
Sample_Size : in Types.Bits_Per_Sample;
Item : out T;
Error : out Boolean)
with
Relaxed_Initialization => Item,
Global => (Input => Flac.CRC.Constant_State),
Pre => (SPARK_Stream_IO.Is_Open (File => File) and
not Item'Constrained),
Post => (if not Error then Item'Initialized),
Depends => (Error => (File, Flac.CRC.Constant_State),
Item => (File,
Sample_Rate,
Sample_Size,
Item,
Flac.CRC.Constant_State));
end Flac.Frames;
|
reznikmm/matreshka | Ada | 4,299 | 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.Language_Asian.Internals is
------------
-- Create --
------------
function Create
(Node : Matreshka.ODF_Attributes.Style.Language_Asian.Style_Language_Asian_Access)
return ODF.DOM.Attributes.Style.Language_Asian.ODF_Style_Language_Asian 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.Language_Asian.Style_Language_Asian_Access)
return ODF.DOM.Attributes.Style.Language_Asian.ODF_Style_Language_Asian is
begin
return
(XML.DOM.Attributes.Internals.Wrap
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Wrap;
end ODF.DOM.Attributes.Style.Language_Asian.Internals;
|
ftigeot/ravensource | Ada | 441 | adb | --- src/core/aws-net.adb.orig 2018-05-23 05:03:23 UTC
+++ src/core/aws-net.adb
@@ -638,7 +638,7 @@ package body AWS.Net is
-- to be shure that it is S1 and S2 connected together
- exit when Peer_Addr (STC (S2)) = Local_Host
+ exit when Peer_Addr (STC (S2)) = Get_Addr (STC (S1))
and then Peer_Port (STC (S2)) = Get_Port (STC (S1))
and then Peer_Port (STC (S1)) = Get_Port (STC (S2));
|
reznikmm/matreshka | Ada | 7,956 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.CMOF.Elements;
with AMF.DI.Styles;
with AMF.Internals.UMLDI_UML_Labels;
with AMF.UML.Elements.Collections;
with AMF.UMLDI.UML_Keyword_Labels;
with AMF.UMLDI.UML_Styles;
with AMF.Visitors;
with League.Strings;
package AMF.Internals.UMLDI_UML_Keyword_Labels is
type UMLDI_UML_Keyword_Label_Proxy is
limited new AMF.Internals.UMLDI_UML_Labels.UMLDI_UML_Label_Proxy
and AMF.UMLDI.UML_Keyword_Labels.UMLDI_UML_Keyword_Label with null record;
overriding function Get_Text
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy)
return League.Strings.Universal_String;
-- Getter of UMLLabel::text.
--
-- String to be rendered.
overriding procedure Set_Text
(Self : not null access UMLDI_UML_Keyword_Label_Proxy;
To : League.Strings.Universal_String);
-- Setter of UMLLabel::text.
--
-- String to be rendered.
overriding function Get_Is_Icon
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy)
return Boolean;
-- Getter of UMLDiagramElement::isIcon.
--
-- For modelElements that have an option to be shown with shapes other
-- than rectangles, such as Actors, or with other identifying shapes
-- inside them, such as arrows distinguishing InputPins and OutputPins, or
-- edges that have an option to be shown with lines other than solid with
-- open arrow heads, such as Realization. A value of true for isIcon
-- indicates the alternative notation shall be shown.
overriding procedure Set_Is_Icon
(Self : not null access UMLDI_UML_Keyword_Label_Proxy;
To : Boolean);
-- Setter of UMLDiagramElement::isIcon.
--
-- For modelElements that have an option to be shown with shapes other
-- than rectangles, such as Actors, or with other identifying shapes
-- inside them, such as arrows distinguishing InputPins and OutputPins, or
-- edges that have an option to be shown with lines other than solid with
-- open arrow heads, such as Realization. A value of true for isIcon
-- indicates the alternative notation shall be shown.
overriding function Get_Local_Style
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy)
return AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access;
-- Getter of UMLDiagramElement::localStyle.
--
-- Restricts owned styles to UMLStyles.
overriding procedure Set_Local_Style
(Self : not null access UMLDI_UML_Keyword_Label_Proxy;
To : AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access);
-- Setter of UMLDiagramElement::localStyle.
--
-- Restricts owned styles to UMLStyles.
overriding function Get_Model_Element
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy)
return AMF.UML.Elements.Collections.Set_Of_UML_Element;
-- Getter of UMLDiagramElement::modelElement.
--
-- Restricts UMLDiagramElements to show UML Elements, rather than other
-- language elements.
overriding function Get_Model_Element
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy)
return AMF.CMOF.Elements.CMOF_Element_Access;
-- Getter of DiagramElement::modelElement.
--
-- a reference to a depicted model element, which can be any MOF-based
-- element
overriding function Get_Local_Style
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy)
return AMF.DI.Styles.DI_Style_Access;
-- Getter of DiagramElement::localStyle.
--
-- a reference to an optional locally-owned style for this diagram element.
overriding procedure Set_Local_Style
(Self : not null access UMLDI_UML_Keyword_Label_Proxy;
To : AMF.DI.Styles.DI_Style_Access);
-- Setter of DiagramElement::localStyle.
--
-- a reference to an optional locally-owned style for this diagram element.
overriding procedure Enter_Element
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Leave_Element
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Visit_Element
(Self : not null access constant UMLDI_UML_Keyword_Label_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
end AMF.Internals.UMLDI_UML_Keyword_Labels;
|
zhmu/ananas | Ada | 3,055 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . R E S T R I C T I O N S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2004-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package body System.Restrictions is
use Rident;
-------------------
-- Abort_Allowed --
-------------------
function Abort_Allowed return Boolean is
begin
return Run_Time_Restrictions.Violated (No_Abort_Statements)
or else
Run_Time_Restrictions.Violated (Max_Asynchronous_Select_Nesting);
end Abort_Allowed;
---------------------
-- Tasking_Allowed --
---------------------
function Tasking_Allowed return Boolean is
begin
return Run_Time_Restrictions.Violated (Max_Tasks)
or else
Run_Time_Restrictions.Violated (No_Tasking);
end Tasking_Allowed;
end System.Restrictions;
|
reznikmm/matreshka | Ada | 4,647 | 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_Draw.Shadow_Offset_X_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Draw_Shadow_Offset_X_Attribute_Node is
begin
return Self : Draw_Shadow_Offset_X_Attribute_Node do
Matreshka.ODF_Draw.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Draw_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Draw_Shadow_Offset_X_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Shadow_Offset_X_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Draw_URI,
Matreshka.ODF_String_Constants.Shadow_Offset_X_Attribute,
Draw_Shadow_Offset_X_Attribute_Node'Tag);
end Matreshka.ODF_Draw.Shadow_Offset_X_Attributes;
|
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.Style_Wrap_Dynamic_Threshold_Attributes is
pragma Preelaborate;
type ODF_Style_Wrap_Dynamic_Threshold_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Style_Wrap_Dynamic_Threshold_Attribute_Access is
access all ODF_Style_Wrap_Dynamic_Threshold_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Style_Wrap_Dynamic_Threshold_Attributes;
|
zhmu/ananas | Ada | 3,425 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . I M A G E _ U --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the routines for supporting the Image attribute for
-- modular integer types, and also for conversion operations required in
-- Text_IO.Modular_IO for such types.
generic
type Uns is mod <>;
package System.Image_U is
pragma Pure;
procedure Image_Unsigned
(V : Uns;
S : in out String;
P : out Natural);
pragma Inline (Image_Unsigned);
-- Computes Uns'Image (V) and stores the result in S (1 .. P) setting
-- the resulting value of P. The caller guarantees that S is long enough to
-- hold the result, and that S'First is 1.
procedure Set_Image_Unsigned
(V : Uns;
S : in out String;
P : in out Natural);
-- Stores the image of V in S starting at S (P + 1), P is updated to point
-- to the last character stored. The value stored is identical to the value
-- of Uns'Image (V) except that no leading space is stored. The caller
-- guarantees that S is long enough to hold the result. S need not have a
-- lower bound of 1.
end System.Image_U;
|
reznikmm/matreshka | Ada | 4,800 | 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.CMOF.Types.Collections is
pragma Preelaborate;
package CMOF_Type_Collections is
new AMF.Generic_Collections
(CMOF_Type,
CMOF_Type_Access);
type Set_Of_CMOF_Type is
new CMOF_Type_Collections.Set with null record;
Empty_Set_Of_CMOF_Type : constant Set_Of_CMOF_Type;
type Ordered_Set_Of_CMOF_Type is
new CMOF_Type_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_CMOF_Type : constant Ordered_Set_Of_CMOF_Type;
type Bag_Of_CMOF_Type is
new CMOF_Type_Collections.Bag with null record;
Empty_Bag_Of_CMOF_Type : constant Bag_Of_CMOF_Type;
type Sequence_Of_CMOF_Type is
new CMOF_Type_Collections.Sequence with null record;
Empty_Sequence_Of_CMOF_Type : constant Sequence_Of_CMOF_Type;
private
Empty_Set_Of_CMOF_Type : constant Set_Of_CMOF_Type
:= (CMOF_Type_Collections.Set with null record);
Empty_Ordered_Set_Of_CMOF_Type : constant Ordered_Set_Of_CMOF_Type
:= (CMOF_Type_Collections.Ordered_Set with null record);
Empty_Bag_Of_CMOF_Type : constant Bag_Of_CMOF_Type
:= (CMOF_Type_Collections.Bag with null record);
Empty_Sequence_Of_CMOF_Type : constant Sequence_Of_CMOF_Type
:= (CMOF_Type_Collections.Sequence with null record);
end AMF.CMOF.Types.Collections;
|
AdaCore/libadalang | Ada | 945 | ads | package Test is
package Pack is
G_count : Integer;
end Pack;
type T is tagged null record;
function F (Dummy : T; Unused : Integer) return Boolean;
function Pr1 (X : in out T; Y : in out Integer) return Integer;
pragma Pre (X.F (30) = False);
pragma Post (X.F (30)'Old = X.F (20)
and then Test.Pack.G_count'Old > 0
and then Y'Old > Y
and then Pr1'Result = Bar (Y));
pragma Test_Case
(Name => "Pr test 1",
Mode => Nominal,
Requires => X.F (30) = False,
Ensures => X.F (30)'Old = X.F (20)
and then Test.Pack.G_count'Old > 0
and then Y'Old > Y
and then Pr1'Result = Bar (Y));
pragma Precondition
(X.F (30) = False);
pragma Postcondition
(X.F (30)'Old = X.F (20) and then Pr1'Result = Bar (Y));
function Bar (X : Integer) return Integer is (X);
end Test;
pragma Test_Block;
|
onox/orka | Ada | 2,116 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2017 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.Containers.Ring_Buffers;
with Orka.Futures.Slots;
generic
Maximum_Graphs : Positive;
-- Maximum number of separate job graphs
Capacity : Positive;
package Orka.Jobs.Queues is
type Executor_Kind is (CPU, GPU);
type Pair is record
Job : Job_Ptr := Null_Job;
Future : Futures.Pointers.Mutable_Pointer;
end record;
package Buffers is new Orka.Containers.Ring_Buffers (Pair);
type Buffer_Array is array (Executor_Kind) of Buffers.Buffer (Capacity);
protected type Queue is
entry Enqueue (Element : Job_Ptr; Future : in out Futures.Pointers.Mutable_Pointer);
-- with Pre => not Element.Has_Dependencies
-- and then Element.all not in Parallel_Job'Class
-- and then Element /= Null_Job
entry Dequeue (Executor_Kind)
(Element : out Pair; Stop : out Boolean)
with Post => Stop or else not Element.Job.Has_Dependencies;
procedure Shutdown;
function Length (Kind : Executor_Kind) return Natural;
private
entry Enqueue_Job (Executor_Kind)
(Element : Job_Ptr; Future : in out Futures.Pointers.Mutable_Pointer);
Buffers : Buffer_Array;
Should_Stop : Boolean := False;
end Queue;
type Queue_Ptr is not null access all Queue;
-----------------------------------------------------------------------------
package Slots is new Orka.Futures.Slots (Count => Maximum_Graphs);
end Orka.Jobs.Queues;
|
BrickBot/Bound-T-H8-300 | Ada | 4,482 | ads | -- Flow.Origins.Opt (decl)
--
-- Command-line options for the value-origin analysis.
--
-- 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.6 $
-- $Date: 2015/10/24 19:36:49 $
--
-- $Log: flow-origins-opt.ads,v $
-- Revision 1.6 2015/10/24 19:36:49 niklas
-- Moved to free licence.
--
-- Revision 1.5 2014/06/01 10:30:00 niklas
-- Added Trace_Flag_Origins option.
--
-- Revision 1.4 2013-02-12 08:47:19 niklas
-- BT-CH-0245: Global volatile cells and "volatile" assertions.
--
-- Revision 1.3 2011-08-31 04:23:34 niklas
-- BT-CH-0222: Option registry. Option -dump. External help files.
--
-- Revision 1.2 2007/01/25 21:25:15 niklas
-- BT-CH-0043.
--
-- Revision 1.1 2005/05/09 15:24:22 niklas
-- First version.
--
with Options.Bool;
package Flow.Origins.Opt is
pragma Elaborate_Body;
--
-- To register the options.
Propagate_Opt : aliased Options.Bool.Option_T (Default => True);
--
-- Whether to apply value-origin analysis at all.
-- If this is False, the options below are irrelevant.
--
Propagate : Boolean renames Propagate_Opt.Value;
Trace_Iteration_Opt : aliased Options.Bool.Option_T (Default => False);
--
-- Whether to trace the steps in the least-fixpoint iteration that
-- propagates the origins of values of cells.
--
Trace_Iteration : Boolean renames Trace_Iteration_Opt.Value;
Trace_Volatile_Opt : aliased Options.Bool.Option_T (Default => False);
--
-- Whether to trace the occurrences of volatile cells in the value-origin
-- analysis: firstly, when a volatile cell is omitted from the analysis,
-- and secondly, when a copy assignment is considered an origin (and not
-- a copy) because the source cell is volatile.
--
Trace_Volatile : Boolean renames Trace_Volatile_Opt.Value;
Show_Results_Opt : aliased Options.Bool.Option_T (Default => False);
--
-- Whether to display the results of the value-origin propagation.
--
Show_Results : Boolean renames Show_Results_Opt.Value;
Trace_Invariant_Cells_Opt : aliased Options.Bool.Option_T (Default => False);
--
-- Whether to show the cells that are found to be invariant as
-- a result of the value-origin analysis.
--
Trace_Invariant_Cells : Boolean renames Trace_Invariant_Cells_Opt.Value;
Trace_Flag_Origins_Opt : aliased Options.Bool.Option_T (Default => False);
--
-- Whether to trace problems (and perhaps successes) in the
-- analysis and use of the origins of condition flags.
--
Trace_Flag_Origins : Boolean renames Trace_Flag_Origins_Opt.Value;
Deallocate : Boolean := True;
--
-- Whether to use Unchecked_Deallocation to release unused
-- heap memory.
end Flow.Origins.Opt;
|
onox/orka | Ada | 5,174 | adb | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2012 Felix Krause <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with GL.API;
with GL.Enums.Getter;
package body GL.Pixels is
procedure Set_Pack_Alignment (Value : Alignment) is
begin
API.Pixel_Store_Alignment.Ref (Enums.Pack_Alignment, Value);
end Set_Pack_Alignment;
function Pack_Alignment return Alignment is
Ret : Alignment := Words;
begin
API.Get_Alignment.Ref (Enums.Getter.Pack_Alignment, Ret);
return Ret;
end Pack_Alignment;
procedure Set_Unpack_Alignment (Value : Alignment) is
begin
API.Pixel_Store_Alignment.Ref (Enums.Unpack_Alignment, Value);
end Set_Unpack_Alignment;
function Unpack_Alignment return Alignment is
Ret : Alignment := Words;
begin
API.Get_Alignment.Ref (Enums.Getter.Unpack_Alignment, Ret);
return Ret;
end Unpack_Alignment;
-----------------------------------------------------------------------------
procedure Set_Pack_Compressed_Block_Width (Value : Size) is
begin
API.Pixel_Store_Size.Ref (Enums.Pack_Compressed_Block_Width, Value);
end Set_Pack_Compressed_Block_Width;
procedure Set_Pack_Compressed_Block_Height (Value : Size) is
begin
API.Pixel_Store_Size.Ref (Enums.Pack_Compressed_Block_Height, Value);
end Set_Pack_Compressed_Block_Height;
procedure Set_Pack_Compressed_Block_Depth (Value : Size) is
begin
API.Pixel_Store_Size.Ref (Enums.Pack_Compressed_Block_Depth, Value);
end Set_Pack_Compressed_Block_Depth;
procedure Set_Pack_Compressed_Block_Size (Value : Size) is
begin
API.Pixel_Store_Size.Ref (Enums.Pack_Compressed_Block_Size, Value);
end Set_Pack_Compressed_Block_Size;
-----------------------------------------------------------------------------
function Pack_Compressed_Block_Width return Size is
Ret : Types.Int := 0;
begin
API.Get_Integer.Ref (Enums.Getter.Pack_Compressed_Block_Width, Ret);
return Size (Ret);
end Pack_Compressed_Block_Width;
function Pack_Compressed_Block_Height return Size is
Ret : Types.Int := 0;
begin
API.Get_Integer.Ref (Enums.Getter.Pack_Compressed_Block_Height, Ret);
return Size (Ret);
end Pack_Compressed_Block_Height;
function Pack_Compressed_Block_Depth return Size is
Ret : Types.Int := 0;
begin
API.Get_Integer.Ref (Enums.Getter.Pack_Compressed_Block_Depth, Ret);
return Size (Ret);
end Pack_Compressed_Block_Depth;
function Pack_Compressed_Block_Size return Size is
Ret : Types.Int := 0;
begin
API.Get_Integer.Ref (Enums.Getter.Pack_Compressed_Block_Size, Ret);
return Size (Ret);
end Pack_Compressed_Block_Size;
-----------------------------------------------------------------------------
procedure Set_Unpack_Compressed_Block_Width (Value : Size) is
begin
API.Pixel_Store_Size.Ref (Enums.Unpack_Compressed_Block_Width, Value);
end Set_Unpack_Compressed_Block_Width;
procedure Set_Unpack_Compressed_Block_Height (Value : Size) is
begin
API.Pixel_Store_Size.Ref (Enums.Unpack_Compressed_Block_Height, Value);
end Set_Unpack_Compressed_Block_Height;
procedure Set_Unpack_Compressed_Block_Depth (Value : Size) is
begin
API.Pixel_Store_Size.Ref (Enums.Unpack_Compressed_Block_Depth, Value);
end Set_Unpack_Compressed_Block_Depth;
procedure Set_Unpack_Compressed_Block_Size (Value : Size) is
begin
API.Pixel_Store_Size.Ref (Enums.Unpack_Compressed_Block_Size, Value);
end Set_Unpack_Compressed_Block_Size;
-----------------------------------------------------------------------------
function Unpack_Compressed_Block_Width return Size is
Ret : Types.Int := 0;
begin
API.Get_Integer.Ref (Enums.Getter.Unpack_Compressed_Block_Width, Ret);
return Size (Ret);
end Unpack_Compressed_Block_Width;
function Unpack_Compressed_Block_Height return Size is
Ret : Types.Int := 0;
begin
API.Get_Integer.Ref (Enums.Getter.Unpack_Compressed_Block_Height, Ret);
return Size (Ret);
end Unpack_Compressed_Block_Height;
function Unpack_Compressed_Block_Depth return Size is
Ret : Types.Int := 0;
begin
API.Get_Integer.Ref (Enums.Getter.Unpack_Compressed_Block_Depth, Ret);
return Size (Ret);
end Unpack_Compressed_Block_Depth;
function Unpack_Compressed_Block_Size return Size is
Ret : Types.Int := 0;
begin
API.Get_Integer.Ref (Enums.Getter.Unpack_Compressed_Block_Size, Ret);
return Size (Ret);
end Unpack_Compressed_Block_Size;
end GL.Pixels;
|
charlie5/lace | Ada | 1,229 | ads | private
with
sdl.Video.Windows,
sdl.Video.GL;
package gel.Window.sdl
--
-- Provides an SDL implementation of a window.
--
is
type Item is new gel.Window.item with private;
type View is access all Item'Class;
---------
--- Forge
--
procedure define (Self : in View; Title : in String;
Width : in Natural;
Height : in Natural);
overriding
procedure destroy (Self : in out Item);
package Forge
is
function new_Window (Title : in String;
Width : in Natural;
Height : in Natural) return Window.sdl.view;
end Forge;
--------------
--- Operations
--
overriding
procedure emit_Events (Self : in out Item);
overriding
procedure enable_GL (Self : in Item);
overriding
procedure disable_GL (Self : in Item);
overriding
procedure swap_GL (Self : in out Item);
private
type Item is new gel.Window.item with
record
window_Handle : standard.sdl.Video.Windows.Window;
GL_Context : standard.sdl.Video.GL.Contexts;
end record;
end gel.Window.sdl;
|
reznikmm/matreshka | Ada | 3,719 | 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.Svg_Font_Stretch_Attributes is
pragma Preelaborate;
type ODF_Svg_Font_Stretch_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Svg_Font_Stretch_Attribute_Access is
access all ODF_Svg_Font_Stretch_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Svg_Font_Stretch_Attributes;
|
guillaume-lin/tsc | Ada | 5,983 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
with Terminal_Interface.Curses.Forms.Field_User_Data;
with Terminal_Interface.Curses.Forms.Form_User_Data;
with Sample.My_Field_Type; use Sample.My_Field_Type;
with Sample.Explanation; use Sample.Explanation;
with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Form_Demo.Handler;
with Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
with Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
use Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
with Terminal_Interface.Curses.Forms.Field_Types.IntField;
use Terminal_Interface.Curses.Forms.Field_Types.IntField;
package body Sample.Form_Demo is
type User_Data is
record
Data : Integer;
end record;
type User_Access is access User_Data;
package Fld_U is new
Terminal_Interface.Curses.Forms.Field_User_Data (User_Data,
User_Access);
package Frm_U is new
Terminal_Interface.Curses.Forms.Form_User_Data (User_Data,
User_Access);
type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday,
Friday, Saturday);
package Weekday_Enum is new
Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada (Weekday);
Enum_Field : constant Enumeration_Field :=
Weekday_Enum.Create;
procedure Demo
is
Mft : My_Data := (Ch => 'X');
FA : Field_Array_Access := new Field_Array'
(Make (0, 14, "Sample Entry Form"),
Make (2, 0, "WeekdayEnumeration"),
Make (2, 20, "Numeric 1-10"),
Make (2, 34, "Only 'X'"),
Make (5, 0, "Multiple Lines offscreen(Scroll)"),
Make (Width => 18, Top => 3, Left => 0),
Make (Width => 12, Top => 3, Left => 20),
Make (Width => 12, Top => 3, Left => 34),
Make (Width => 46, Top => 6, Left => 0, Height => 4, Off_Screen => 2),
Null_Field
);
Frm : Terminal_Interface.Curses.Forms.Form := Create (FA);
I_F : constant Integer_Field := (Precision => 0,
Lower_Limit => 1,
Upper_Limit => 10);
F1, F2 : User_Access;
package Fh is new Sample.Form_Demo.Handler (Default_Driver);
begin
Push_Environment ("FORM00");
Notepad ("FORM-PAD00");
Default_Labels;
Set_Field_Type (FA (6), Enum_Field);
Set_Field_Type (FA (7), I_F);
Set_Field_Type (FA (8), Mft);
F1 := new User_Data'(Data => 4711);
Fld_U.Set_User_Data (FA (1), F1);
Fh.Drive_Me (Frm);
Fld_U.Get_User_Data (FA (1), F2);
pragma Assert (F1 = F2);
pragma Assert (F1.Data = F2.Data);
Pop_Environment;
Delete (Frm);
Free (FA, True);
end Demo;
end Sample.Form_Demo;
|
reznikmm/matreshka | Ada | 3,714 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Chart_Stock_Loss_Marker_Elements is
pragma Preelaborate;
type ODF_Chart_Stock_Loss_Marker is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Chart_Stock_Loss_Marker_Access is
access all ODF_Chart_Stock_Loss_Marker'Class
with Storage_Size => 0;
end ODF.DOM.Chart_Stock_Loss_Marker_Elements;
|
MinimSecure/unum-sdk | Ada | 1,062 | adb | -- 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/>.
procedure Foo is
type Bar (N : Natural) is record
S : String (1 .. N);
end record;
function Get (S : String) return Bar is
begin
return (N => S'Length, S => S);
end Get;
procedure Do_Nothing (B : Bar) is
begin
null;
end Do_Nothing;
B : Bar := Get ("Foo");
begin
Do_Nothing (B); -- STOP
end Foo;
|
reznikmm/matreshka | Ada | 4,538 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Signals;
private with League.Signals.Emitters;
with League.Strings;
with AWF.HTML_Writers;
with AWF.Internals.AWF_Widgets;
with AWF.Widgets;
package AWF.Push_Buttons is
type AWF_Push_Button is
new AWF.Internals.AWF_Widgets.AWF_Widget_Proxy with private;
type AWF_Push_Button_Access is access all AWF_Push_Button'Class;
function Create
(Parent : access AWF.Widgets.AWF_Widget'Class := null)
return not null AWF_Push_Button_Access;
not overriding procedure Set_Text
(Self : not null access AWF_Push_Button;
Text : League.Strings.Universal_String);
not overriding function Clicked
(Self : not null access AWF_Push_Button) return League.Signals.Signal;
private
type AWF_Push_Button is
new AWF.Internals.AWF_Widgets.AWF_Widget_Proxy with record
Text : League.Strings.Universal_String;
Clicked : League.Signals.Emitters.Emitter (AWF_Push_Button'Access);
end record;
overriding procedure Render_Body
(Self : not null access AWF_Push_Button;
Context : in out AWF.HTML_Writers.HTML_Writer'Class);
overriding procedure Click_Event (Self : not null access AWF_Push_Button);
end AWF.Push_Buttons;
|
reznikmm/matreshka | Ada | 17,115 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Connectors is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Connector_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Connector
(AMF.UML.Connectors.UML_Connector_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Connector_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Connector
(AMF.UML.Connectors.UML_Connector_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Connector_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Connector
(Visitor,
AMF.UML.Connectors.UML_Connector_Access (Self),
Control);
end if;
end Visit_Element;
------------------
-- Get_Contract --
------------------
overriding function Get_Contract
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior is
begin
return
AMF.UML.Behaviors.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Contract
(Self.Element)));
end Get_Contract;
-------------
-- Get_End --
-------------
overriding function Get_End
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Connector_Ends.Collections.Ordered_Set_Of_UML_Connector_End is
begin
return
AMF.UML.Connector_Ends.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_End
(Self.Element)));
end Get_End;
--------------
-- Get_Kind --
--------------
overriding function Get_Kind
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.UML_Connector_Kind is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Kind
(Self.Element);
end Get_Kind;
-----------------------------
-- Get_Redefined_Connector --
-----------------------------
overriding function Get_Redefined_Connector
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Connectors.Collections.Set_Of_UML_Connector is
begin
return
AMF.UML.Connectors.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Connector
(Self.Element)));
end Get_Redefined_Connector;
--------------
-- Get_Type --
--------------
overriding function Get_Type
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Associations.UML_Association_Access is
begin
return
AMF.UML.Associations.UML_Association_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Type
(Self.Element)));
end Get_Type;
--------------
-- Set_Type --
--------------
overriding procedure Set_Type
(Self : not null access UML_Connector_Proxy;
To : AMF.UML.Associations.UML_Association_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Type
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Type;
------------------------------
-- Get_Featuring_Classifier --
------------------------------
overriding function Get_Featuring_Classifier
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Featuring_Classifier
(Self.Element)));
end Get_Featuring_Classifier;
-------------------
-- Get_Is_Static --
-------------------
overriding function Get_Is_Static
(Self : not null access constant UML_Connector_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Static
(Self.Element);
end Get_Is_Static;
-------------------
-- Set_Is_Static --
-------------------
overriding procedure Set_Is_Static
(Self : not null access UML_Connector_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Static
(Self.Element, To);
end Set_Is_Static;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Connector_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
(Self.Element);
end Get_Is_Leaf;
-----------------
-- Set_Is_Leaf --
-----------------
overriding procedure Set_Is_Leaf
(Self : not null access UML_Connector_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
(Self.Element, To);
end Set_Is_Leaf;
---------------------------
-- Get_Redefined_Element --
---------------------------
overriding function Get_Redefined_Element
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
begin
return
AMF.UML.Redefinable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
(Self.Element)));
end Get_Redefined_Element;
------------------------------
-- Get_Redefinition_Context --
------------------------------
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Connector_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Connector_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
----------
-- Kind --
----------
overriding function Kind
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.UML_Connector_Kind is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Kind unimplemented");
raise Program_Error with "Unimplemented procedure UML_Connector_Proxy.Kind";
return Kind (Self);
end Kind;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Connector_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Connector_Proxy.Is_Consistent_With";
return Is_Consistent_With (Self, Redefinee);
end Is_Consistent_With;
-----------------------------------
-- Is_Redefinition_Context_Valid --
-----------------------------------
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Connector_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
raise Program_Error with "Unimplemented procedure UML_Connector_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Connector_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Connector_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Connector_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Connector_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Connector_Proxy.Namespace";
return Namespace (Self);
end Namespace;
end AMF.Internals.UML_Connectors;
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.