repo_name
stringlengths 9
74
| language
stringclasses 1
value | length_bytes
int64 11
9.34M
| extension
stringclasses 2
values | content
stringlengths 11
9.34M
|
---|---|---|---|---|
AdaCore/training_material | Ada | 431 | adb | with Data_Type;
with Generic_List;
procedure Main is
package List is new Generic_List (Element_T => Data_Type.Record_T);
-- Need to add formal parameters as necessary
My_List : List.List_T;
Element : Data_Type.Record_T;
begin
-- Add some items to the list
List.Add (My_List, Element);
List.Add (My_List, Element);
List.Add (My_List, Element);
List.Sort (My_List);
List.Print (My_List);
end Main;
|
reznikmm/matreshka | Ada | 3,503 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- 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$
------------------------------------------------------------------------------
package XML.Schema.Namespace_Item_Lists is
pragma Preelaborate;
type XS_Namespace_Item_List is tagged null record;
end XML.Schema.Namespace_Item_Lists;
|
charlie5/lace | Ada | 2,307 | ads | with
openGL,
Physics,
float_Math.Geometry.D2,
float_Math.Geometry.D3,
float_Math.Algebra.linear.D2,
float_Math.Algebra.linear.D3;
package GEL
--
-- A game engine library.
--
is
pragma Pure;
Error : exception;
--------
--- Math
--
package Math renames float_Math;
package Geometry renames math.Geometry;
package Geometry_2d renames Geometry.D2;
package Geometry_3d renames Geometry.D3;
package Algebra renames math.Algebra;
package linear_Algebra renames Algebra.linear;
package linear_Algebra_2D renames linear_Algebra.D2;
package linear_Algebra_3D renames linear_Algebra.D3;
---------------
--- Constraints
--
max_Worlds : constant := 1_000;
max_Cameras : constant := 1_000;
max_graphics_Models : constant := 2**32 - 1;
-- max_physics_Models : constant := 2**32 - 1;
max_Sprites : constant := 2**32 - 1;
-------
--- Ids
--
type world_Id is range 0 .. max_Worlds;
type camera_Id is range 0 .. max_Cameras;
subtype graphics_model_Id is openGL.model_Id;
-- type physics_model_Id is range 0 .. max_physics_Models;
type sprite_Id is range 0 .. max_Sprites;
null_graphics_model_Id : constant graphics_model_Id;
-- null_physics_model_Id : constant physics.model_Id;
null_sprite_Id : constant sprite_Id;
type graphics_model_Ids is array (Positive range <>) of graphics_model_Id;
type physics_model_Ids is array (Positive range <>) of physics.model_Id;
type sprite_Ids is array (Positive range <>) of sprite_Id;
----------
--- Assets
--
type asset_Name is new String (1 .. 128); -- TODO: Make private.
--
-- Name of a file containing textures, images, fonts, sounds, media or other resources.
null_Asset : constant asset_Name;
function to_Asset (Self : in String) return asset_Name;
function to_String (Self : in asset_Name) return String;
private
null_graphics_model_Id : constant graphics_model_Id := 0;
-- null_physics_model_Id : constant physics.model_Id := 0;
null_sprite_Id : constant sprite_Id := 0;
null_Asset : constant asset_Name := (others => ' ');
end GEL;
|
persan/A-gst | Ada | 6,163 | ads | pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
with glib;
with glib.Values;
with System;
with glib;
with System;
with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_interfaces_xoverlay_h is
-- unsupported macro: GST_TYPE_X_OVERLAY (gst_x_overlay_get_type ())
-- arg-macro: function GST_X_OVERLAY (obj)
-- return GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_X_OVERLAY, GstXOverlay);
-- arg-macro: function GST_X_OVERLAY_CLASS (klass)
-- return G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_X_OVERLAY, GstXOverlayClass);
-- arg-macro: function GST_IS_X_OVERLAY (obj)
-- return GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_X_OVERLAY);
-- arg-macro: function GST_IS_X_OVERLAY_CLASS (klass)
-- return G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_X_OVERLAY);
-- arg-macro: function GST_X_OVERLAY_GET_CLASS (inst)
-- return G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_X_OVERLAY, GstXOverlayClass);
-- GStreamer X-based Overlay
-- * Copyright (C) 2003 Ronald Bultje <[email protected]>
-- * Copyright (C) 2003 Julien Moutte <[email protected]>
-- *
-- * x-overlay.h: X-based overlay interface design
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the
-- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-- * Boston, MA 02111-1307, USA.
--
--*
-- * GstXOverlay:
-- *
-- * Opaque #GstXOverlay data structure.
--
-- skipped empty struct u_GstXOverlay
-- skipped empty struct GstXOverlay
type GstXOverlayClass;
type u_GstXOverlayClass_u_gst_reserved_array is array (0 .. 0) of System.Address;
--subtype GstXOverlayClass is u_GstXOverlayClass; -- gst/interfaces/xoverlay.h:50
--*
-- * GstXOverlayClass:
-- * @klass: parent interface type.
-- * @set_xwindow_id: (deprecated) virtual method to configure the XWindow handle
-- * @expose: virtual method to handle expose events
-- * @handle_events: virtual method to handle events
-- * @set_render_rectangle: virtual method to set the render rectangle (since 0.10.29)
-- * @set_window_handle: virtual method to configure the window handle
-- *
-- * #GstXOverlay interface
--
type GstXOverlayClass is record
klass : aliased GStreamer.GST_Low_Level.glib_2_0_gobject_gtype_h.GTypeInterface; -- gst/interfaces/xoverlay.h:64
set_xwindow_id : access procedure (arg1 : System.Address; arg2 : GLIB.gulong); -- gst/interfaces/xoverlay.h:69
expose : access procedure (arg1 : System.Address); -- gst/interfaces/xoverlay.h:77
handle_events : access procedure (arg1 : System.Address; arg2 : GLIB.gboolean); -- gst/interfaces/xoverlay.h:80
set_render_rectangle : access procedure
(arg1 : System.Address;
arg2 : GLIB.gint;
arg3 : GLIB.gint;
arg4 : GLIB.gint;
arg5 : GLIB.gint); -- gst/interfaces/xoverlay.h:84
set_window_handle : access procedure (arg1 : System.Address; arg2 : access GLIB.guint); -- gst/interfaces/xoverlay.h:87
u_gst_reserved : u_GstXOverlayClass_u_gst_reserved_array; -- gst/interfaces/xoverlay.h:89
end record;
pragma Convention (C_Pass_By_Copy, GstXOverlayClass); -- gst/interfaces/xoverlay.h:63
-- virtual functions
--< private >
function gst_x_overlay_get_type return GLIB.GType; -- gst/interfaces/xoverlay.h:92
pragma Import (C, gst_x_overlay_get_type, "gst_x_overlay_get_type");
-- virtual class function wrappers
procedure gst_x_overlay_set_xwindow_id (overlay : System.Address; xwindow_id : GLIB.gulong); -- gst/interfaces/xoverlay.h:96
pragma Import (C, gst_x_overlay_set_xwindow_id, "gst_x_overlay_set_xwindow_id");
function gst_x_overlay_set_render_rectangle
(overlay : System.Address;
x : GLIB.gint;
y : GLIB.gint;
width : GLIB.gint;
height : GLIB.gint) return GLIB.gboolean; -- gst/interfaces/xoverlay.h:100
pragma Import (C, gst_x_overlay_set_render_rectangle, "gst_x_overlay_set_render_rectangle");
procedure gst_x_overlay_expose (overlay : System.Address); -- gst/interfaces/xoverlay.h:104
pragma Import (C, gst_x_overlay_expose, "gst_x_overlay_expose");
procedure gst_x_overlay_handle_events (overlay : System.Address; handle_events : GLIB.gboolean); -- gst/interfaces/xoverlay.h:106
pragma Import (C, gst_x_overlay_handle_events, "gst_x_overlay_handle_events");
procedure gst_x_overlay_set_window_handle (overlay : System.Address; handle : access GLIB.guint); -- gst/interfaces/xoverlay.h:109
pragma Import (C, gst_x_overlay_set_window_handle, "gst_x_overlay_set_window_handle");
-- public methods to dispatch bus messages
procedure gst_x_overlay_got_xwindow_id (overlay : System.Address; xwindow_id : GLIB.gulong); -- gst/interfaces/xoverlay.h:114
pragma Import (C, gst_x_overlay_got_xwindow_id, "gst_x_overlay_got_xwindow_id");
procedure gst_x_overlay_got_window_handle (overlay : System.Address; handle : access GLIB.guint); -- gst/interfaces/xoverlay.h:117
pragma Import (C, gst_x_overlay_got_window_handle, "gst_x_overlay_got_window_handle");
procedure gst_x_overlay_prepare_xwindow_id (overlay : System.Address); -- gst/interfaces/xoverlay.h:120
pragma Import (C, gst_x_overlay_prepare_xwindow_id, "gst_x_overlay_prepare_xwindow_id");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_interfaces_xoverlay_h;
|
docandrew/sdlada | Ada | 13,015 | adb | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
with Interfaces.C;
with Ada.Unchecked_Conversion;
with SDL.Error;
package body SDL.Video.Textures is
package C renames Interfaces.C;
use type C.int;
use type SDL.C_Pointers.Texture_Pointer;
procedure Destroy (Self : in out Texture) is
procedure SDL_Destroy_Texture (T : in SDL.C_Pointers.Texture_Pointer) with
Import => True,
Convention => C,
External_Name => "SDL_DestroyTexture";
begin
SDL_Destroy_Texture (Self.Internal);
Self.Internal := null;
end Destroy;
function Get_Alpha (Self : in Texture) return SDL.Video.Palettes.Colour_Component is
function SDL_Get_Texture_Alpha_Mod (T : in SDL.C_Pointers.Texture_Pointer;
Alpha : out SDL.Video.Palettes.Colour_Component) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GetTextureAlphaMod";
Data : SDL.Video.Palettes.Colour_Component;
Result : C.int := SDL_Get_Texture_Alpha_Mod (Self.Internal, Data);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
return Data;
end Get_Alpha;
procedure Set_Alpha (Self : in out Texture; Alpha : in SDL.Video.Palettes.Colour_Component) is
function SDL_Set_Texture_Alpha_Mod (T : in SDL.C_Pointers.Texture_Pointer;
Alpha : in SDL.Video.Palettes.Colour_Component) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_SetTextureAlphaMod";
Result : C.int := SDL_Set_Texture_Alpha_Mod (Self.Internal, Alpha);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
end Set_Alpha;
function Get_Blend_Mode (Self : in Texture) return Blend_Modes is
function SDL_Get_Texture_Blend_Mode (T : in SDL.C_Pointers.Texture_Pointer;
Blend : out Blend_Modes) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GetTextureBlendMode";
Data : Blend_Modes;
Result : C.int := SDL_Get_Texture_Blend_Mode (Self.Internal, Data);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
return Data;
end Get_Blend_Mode;
procedure Set_Blend_Mode (Self : in out Texture; Mode : in Blend_Modes) is
function SDL_Set_Texture_Blend_Mode (T : in SDL.C_Pointers.Texture_Pointer;
Mode : in Blend_Modes) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_SetTextureBlendMode";
Result : C.int := SDL_Set_Texture_Blend_Mode (Self.Internal, Mode);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
end Set_Blend_Mode;
function Get_Modulate_Colour (Self : in Texture) return SDL.Video.Palettes.RGB_Colour is
function SDL_Get_Texture_Color_Mod (T : in SDL.C_Pointers.Texture_Pointer;
R, G, B : out SDL.Video.Palettes.Colour_Component) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GetTextureColorMod";
Data : SDL.Video.Palettes.RGB_Colour;
Result : C.int := SDL_Get_Texture_Color_Mod (Self.Internal, Data.Red, Data.Green, Data.Blue);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
return Data;
end Get_Modulate_Colour;
procedure Set_Modulate_Colour (Self : in out Texture; Colour : in SDL.Video.Palettes.RGB_Colour) is
function SDL_Set_Texture_Color_Mod (T : in SDL.C_Pointers.Texture_Pointer;
R, G, B : in SDL.Video.Palettes.Colour_Component) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_SetTextureColorMod";
Result : C.int := SDL_Set_Texture_Color_Mod (Self.Internal, Colour.Red, Colour.Green, Colour.Blue);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
end Set_Modulate_Colour;
-- procedure Lock_Texture (Self : in out Texture;
-- Pixels : out SDL.Video.Pixels.Pixel_ARGB_8888_Array_Access) is
-- type Int_Ptr is access C.int with
-- Convention => C;
--
-- function SDL_Lock_Texture (T : in System.Address;
-- Area : in System.Address;
-- Pixels : out SDL.Video.Pixels.C_Pixel_Ptr;
-- Pitch : out Int_Ptr) return C.int with
-- Import => True,
-- Convention => C,
-- External_Name => "SDL_LockTexture";
--
-- C_Pixels : SDL.Video.Pixels.C_Pixel_Ptr := null;
-- C_Pitch : Int_Ptr := null;
-- Result : C.int := SDL_Lock_Texture (Self.Internal, System.Null_Address, C_Pixels, C_Pitch);
-- begin
-- if Result /= Success then
-- raise Texture_Error with SDL.Error.Get;
-- end if;
--
-- Self.Locked := True;
--
-- Pixels := SDL.Video.Pixels.Create (C_Pixels, C_Pitch.all, Self.Size);
-- end Lock_Texture;
procedure Lock (Self : in out Texture;
Pixels : out Pixel_Pointer_Type) is
function SDL_Lock_Texture (T : in SDL.C_Pointers.Texture_Pointer;
Area : in System.Address;
Pixels : out Pixel_Pointer_Type;
Pitch : out SDL.Video.Pixels.Pitches) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_LockTexture";
-- Don't care about Pitch value.
Dummy : SDL.Video.Pixels.Pitches := 0;
Result : C.int := SDL_Lock_Texture (Self.Internal, System.Null_Address, Pixels, Dummy);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
Self.Locked := True;
end Lock;
procedure Lock_Area (Self : in out Texture;
Area : in SDL.Video.Rectangles.Rectangle;
Pixels : out Pixel_Pointer_Type;
Pitch : out SDL.Video.Pixels.Pitches) is
function SDL_Lock_Texture (T : in SDL.C_Pointers.Texture_Pointer;
Area : in SDL.Video.Rectangles.Rectangle;
Pixels : out Pixel_Pointer_Type;
Pitch : out SDL.Video.Pixels.Pitches) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_LockTexture";
Result : C.int := SDL_Lock_Texture (Self.Internal, Area, Pixels, Pitch);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
Self.Locked := True;
end Lock_Area;
procedure Unlock (Self : in out Texture) is
procedure SDL_Unlock_Texture (T : in SDL.C_Pointers.Texture_Pointer) with
Import => True,
Convention => C,
External_Name => "SDL_UnlockTexture";
begin
if Self.Locked then
SDL_Unlock_Texture (Self.Internal);
Self.Locked := False;
end if;
end Unlock;
procedure Query (Self : in Texture;
Pixel_Format_Name : out SDL.Video.Pixel_Formats.Pixel_Format_Names;
Kind : out Kinds;
Size : out SDL.Sizes) is
function SDL_Query_Texture (T : in SDL.C_Pointers.Texture_Pointer;
Pixel_Format_Name : out SDL.Video.Pixel_Formats.Pixel_Format_Names;
Kind : out Kinds;
Width : out SDL.Dimension;
Height : out SDL.Dimension) return C.int with
import => True,
Convention => C,
External_Name => "SDL_QueryTexture";
W : SDL.Dimension := 0;
H : SDL.Dimension := 0;
Result : C.int := SDL_Query_Texture (Self.Internal, Pixel_Format_Name, Kind, W, H);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
Size := SDL.Sizes'(W, H);
end Query;
function Get_Pixel_Format (Self : in Texture) return SDL.Video.Pixel_Formats.Pixel_Format_Names is
function SDL_Query_Texture (T : in SDL.C_Pointers.Texture_Pointer;
Pixel_Format_Name : out SDL.Video.Pixel_Formats.Pixel_Format_Names;
Kind : in System.Address := System.Null_Address;
Width : in System.Address := System.Null_Address;
Height : in System.Address := System.Null_Address) return C.int with
import => True,
Convention => C,
External_Name => "SDL_QueryTexture";
Format_Name : SDL.Video.Pixel_Formats.Pixel_Format_Names;
Result : C.int := SDL_Query_Texture (T => Self.Internal, Pixel_Format_Name => Format_Name);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
return Format_Name;
end Get_Pixel_Format;
function Get_Kind (Self : in Texture) return Kinds is
function SDL_Query_Texture (T : in SDL.C_Pointers.Texture_Pointer;
Pixel_Format_Name : in System.Address := System.Null_Address;
Kind : out Kinds;
Width : in System.Address := System.Null_Address;
Height : in System.Address := System.Null_Address) return C.int with
import => True,
Convention => C,
External_Name => "SDL_QueryTexture";
Kind : Kinds;
Result : C.int := SDL_Query_Texture (T => Self.Internal, Kind => Kind);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
return Kind;
end Get_Kind;
function Get_Size (Self : in Texture) return SDL.Sizes is
function SDL_Query_Texture (T : in SDL.C_Pointers.Texture_Pointer;
Pixel_Format_Name : in System.Address := System.Null_Address;
Kind : in System.Address := System.Null_Address;
Width : out SDL.Dimension;
Height : out SDL.Dimension) return C.int with
import => True,
Convention => C,
External_Name => "SDL_QueryTexture";
Size : SDL.Sizes := SDL.Zero_Size;
Result : C.int := SDL_Query_Texture (T => Self.Internal, Width => Size.Width, Height => Size.Height);
begin
if Result /= Success then
raise Texture_Error with SDL.Error.Get;
end if;
return Size;
end Get_Size;
overriding
procedure Finalize (Self : in out Texture) is
begin
if Self.Internal /= null and then Self.Owns then
Destroy (Self);
end if;
end Finalize;
function Get_Internal_Texture (Self : in Texture) return SDL.C_Pointers.Texture_Pointer is
begin
return Self.Internal;
end Get_Internal_Texture;
end SDL.Video.Textures;
|
reznikmm/matreshka | Ada | 4,662 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Visitors;
with ODF.DOM.Form_Radio_Elements;
package Matreshka.ODF_Form.Radio_Elements is
type Form_Radio_Element_Node is
new Matreshka.ODF_Form.Abstract_Form_Element_Node
and ODF.DOM.Form_Radio_Elements.ODF_Form_Radio
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Form_Radio_Element_Node;
overriding function Get_Local_Name
(Self : not null access constant Form_Radio_Element_Node)
return League.Strings.Universal_String;
overriding procedure Enter_Node
(Self : not null access Form_Radio_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Leave_Node
(Self : not null access Form_Radio_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Visit_Node
(Self : not null access Form_Radio_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
end Matreshka.ODF_Form.Radio_Elements;
|
reznikmm/matreshka | Ada | 4,739 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Visitors;
with ODF.DOM.Meta_User_Defined_Elements;
package Matreshka.ODF_Meta.User_Defined_Elements is
type Meta_User_Defined_Element_Node is
new Matreshka.ODF_Meta.Abstract_Meta_Element_Node
and ODF.DOM.Meta_User_Defined_Elements.ODF_Meta_User_Defined
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Meta_User_Defined_Element_Node;
overriding function Get_Local_Name
(Self : not null access constant Meta_User_Defined_Element_Node)
return League.Strings.Universal_String;
overriding procedure Enter_Node
(Self : not null access Meta_User_Defined_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Leave_Node
(Self : not null access Meta_User_Defined_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Visit_Node
(Self : not null access Meta_User_Defined_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
end Matreshka.ODF_Meta.User_Defined_Elements;
|
stcarrez/ada-el | Ada | 10,731 | adb | -----------------------------------------------------------------------
-- el-objects-tests - Generic simple test for discrete object types
-- Copyright (C) 2009, 2010 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Containers;
with Util.Test_Caller;
with Ada.Strings.Fixed;
with Ada.Text_IO;
with Ada.Calendar;
with EL.Objects.Hash;
package body EL.Objects.Discrete_Tests is
use EL.Objects;
use Ada.Strings.Fixed;
use Ada.Containers;
procedure Test_Eq (T : Test; V : String; N : Test_Type);
procedure Test_Conversion (T : Test; V : String; N : Test_Type);
procedure Test_Lt_Gt (T : Test; V : String; N : Test_Type);
procedure Test_Sub (T : Test; V : String; N : Test_Type);
procedure Test_Add (T : Test; V : String; N : Test_Type);
-- Generic test for To_Object and To_XXX types
-- Several values are specified in the Test_Values string.
generic
with procedure Basic_Test (T : in Test; V : String; N : Test_Type);
procedure Test_Basic_Object (T : in out Test);
procedure Test_Basic_Object (T : in out Test) is
pragma Unmodified (T);
Pos, Next : Natural;
begin
Pos := Test_Values'First;
while Pos <= Test_Values'Last loop
Next := Index (Test_Values, ",", Pos);
if Next < Pos then
Next := Test_Values'Last + 1;
end if;
declare
V : constant String := Test_Values (Pos .. Next - 1);
N : constant Test_Type := Value (V);
begin
Basic_Test (T, V, N);
end;
Pos := Next + 1;
end loop;
end Test_Basic_Object;
-- ------------------------------
-- Test EL.Objects.To_Object
-- ------------------------------
procedure Test_Conversion (T : Test; V : String; N : Test_Type) is
Value : EL.Objects.Object;
begin
Value := To_Object (V);
T.Assert (Condition => To_Type (Value) = N,
Message => Test_Name & " returned invalid value: "
& To_String (Value) & " when we expected: " & V);
T.Assert (Condition => V = To_String (Value),
Message => Test_Name & ".To_String returned invalid value: "
& To_String (Value) & " when we expected: " & V);
end Test_Conversion;
procedure Test_To_Object is new Test_Basic_Object (Basic_Test => Test_Conversion);
-- ------------------------------
-- Test EL.Objects.Hash
-- ------------------------------
procedure Test_Hash (T : in out Test) is
pragma Unmodified (T);
Pos, Next : Natural;
Hash_Values : array (Test_Values'Range) of Hash_Type := (others => 0);
Nb_Hash : Natural := 0;
begin
Pos := Test_Values'First;
while Pos <= Test_Values'Last loop
Next := Index (Test_Values, ",", Pos);
if Next < Pos then
Next := Test_Values'Last + 1;
end if;
declare
V : constant String := Test_Values (Pos .. Next - 1);
N : constant Test_Type := Value (V);
Value : constant EL.Objects.Object := To_Object_Test (N);
H : constant Hash_Type := EL.Objects.Hash (Value);
Found : Boolean := False;
begin
for J in 1 .. Nb_Hash loop
if Hash_Values (J) = H then
Found := True;
end if;
end loop;
if not Found then
Nb_Hash := Nb_Hash + 1;
Hash_Values (Nb_Hash) := H;
end if;
end;
Pos := Next + 1;
end loop;
Ada.Text_IO.Put_Line ("Found " & Natural'Image (Nb_Hash) & " hash values");
Assert (T, Nb_Hash > 1, "Only one hash value found");
end Test_Hash;
-- ------------------------------
-- Test EL.Objects."+"
-- ------------------------------
procedure Test_Add (T : Test; V : String; N : Test_Type) is
Value : EL.Objects.Object := To_Object_Test (N);
begin
Value := Value + To_Object_Test (N);
T.Assert (Condition => To_Type (Value) = N + N,
Message => Test_Name & " returned invalid value: "
& To_String (Value) & " when we expected: " & V);
end Test_Add;
procedure Test_Add is new Test_Basic_Object (Test_Add);
-- ------------------------------
-- Test EL.Objects."-"
-- ------------------------------
procedure Test_Sub (T : Test; V : String; N : Test_Type) is
pragma Unreferenced (V);
Value : EL.Objects.Object;
begin
Value := To_Object_Test (N) - To_Object_Test (N);
T.Assert (Condition => To_Type (Value) = N - N,
Message => Test_Name & " returned invalid value: "
& To_String (Value) & " when we expected: 0");
end Test_Sub;
procedure Test_Sub is new Test_Basic_Object (Test_Sub);
-- ------------------------------
-- Test EL.Objects."<" and EL.Objects.">"
-- ------------------------------
procedure Test_Lt_Gt (T : Test; V : String; N : Test_Type) is
Res : Boolean;
Is_Neg : constant Boolean := Index (V, "-") = V'First;
O : EL.Objects.Object := To_Object_Test (N);
begin
Res := To_Object_Test (N) < To_Object_Test (N);
T.Assert (Condition => Res = False,
Message => Test_Name & ".'<' returned invalid value: "
& Boolean'Image (Res) & " when we expected: false");
Res := To_Object_Test (N) > To_Object_Test (N);
T.Assert (Condition => Res = False,
Message => Test_Name & ".'>' returned invalid value: "
& Boolean'Image (Res) & " when we expected: false");
Res := To_Object_Test (N) + To_Object_Test (N) < To_Object_Test (N);
T.Assert (Condition => Res = Is_Neg,
Message => Test_Name & ".'<' returned invalid value: "
& Boolean'Image (Res) & " when we expected: "
& Boolean'Image (Is_Neg)
& " with value: " & V & "Num=" & Long_Long_Integer'Image (To_Long_Long_Integer (O))
& " Sum=" & Long_Long_Integer'Image (To_Long_Long_Integer (O + O)));
Res := To_Object_Test (N) > To_Object_Test (N) + To_Object_Test (N);
T.Assert (Condition => Res = Is_Neg,
Message => Test_Name & ".'>' returned invalid value: "
& Boolean'Image (Res) & " when we expected: "
& Boolean'Image (Is_Neg)
& " with value: " & V);
if V /= "0" and V /= "false" and V /= "true" then
Res := To_Object_Test (N) < To_Object_Test (N) + To_Object_Test (N);
T.Assert (Condition => Res = not Is_Neg,
Message => Test_Name & ".'<' returned invalid value: "
& Boolean'Image (Res) & " when we expected: "
& Boolean'Image (not Is_Neg)
& " with value: " & V);
Res := To_Object_Test (N) + To_Object_Test (N) > To_Object_Test (N);
T.Assert (Condition => Res = not Is_Neg,
Message => Test_Name & ".'>' returned invalid value: "
& Boolean'Image (Res) & " when we expected: "
& Boolean'Image (not Is_Neg)
& " with value: " & V);
end if;
end Test_Lt_Gt;
procedure Test_Lt_Gt is new Test_Basic_Object (Test_Lt_Gt);
-- ------------------------------
-- Test EL.Objects."="
-- ------------------------------
procedure Test_Eq (T : Test; V : String; N : Test_Type) is
Res : Boolean;
begin
Res := To_Object_Test (N) = To_Object_Test (N);
T.Assert (Condition => Res,
Message => Test_Name & ".'=' returned invalid value: "
& Boolean'Image (Res) & " when we expected: true");
Res := To_Object_Test (N) = To_Object ("Something" & V);
T.Assert (Condition => Res = False,
Message => Test_Name & ".'=' returned invalid value: "
& Boolean'Image (Res) & " where we expected: False");
end Test_Eq;
procedure Test_Eq is new Test_Basic_Object (Test_Eq);
-- ------------------------------
-- Test EL.Objects."="
-- ------------------------------
procedure Test_Perf (T : Test; V : String; N : Test_Type) is
pragma Unreferenced (T, V);
use Ada.Calendar;
Start : Ada.Calendar.Time;
Value : constant EL.Objects.Object := To_Object_Test (N);
D : Duration;
begin
Start := Ada.Calendar.Clock;
for I in 1 .. 1_000 loop
declare
V : EL.Objects.Object := Value;
begin
V := V + V;
pragma Unreferenced (V);
end;
end loop;
D := Ada.Calendar.Clock - Start;
Ada.Text_IO.Put_Line ("Perf " & Test_Name & ": " & Duration'Image (D * 1000.0));
end Test_Perf;
procedure Test_Perf is new Test_Basic_Object (Test_Perf);
package Caller is new Util.Test_Caller (Test, "EL.Objects");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test EL.Objects.To_Object." & Test_Name,
Test_To_Object'Access);
Caller.Add_Test (Suite, "Test EL.Objects.To_String." & Test_Name,
Test_To_Object'Access);
Caller.Add_Test (Suite, "Test EL.Objects.'='." & Test_Name,
Test_Eq'Access);
Caller.Add_Test (Suite, "Test EL.Objects.'+'." & Test_Name,
Test_Add'Access);
Caller.Add_Test (Suite, "Test EL.Objects.'-'." & Test_Name,
Test_Sub'Access);
Caller.Add_Test (Suite, "Test EL.Objects.'<'." & Test_Name,
Test_Lt_Gt'Access);
Caller.Add_Test (Suite, "Test EL.Objects.'>'." & Test_Name,
Test_Lt_Gt'Access);
Caller.Add_Test (Suite, "Performance EL.Objects.'>'." & Test_Name,
Test_Perf'Access);
Caller.Add_Test (Suite, "Test EL.Objects.Hash." & Test_Name,
Test_Hash'Access);
end Add_Tests;
end EL.Objects.Discrete_Tests;
|
twdroeger/ada-awa | Ada | 11,842 | adb | -----------------------------------------------------------------------
-- awa-applications-configs -- Read application configuration files
-- Copyright (C) 2011, 2012, 2015, 2017, 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.
-----------------------------------------------------------------------
with Ada.Command_Line;
with Ada.Directories;
with Ada.Strings.Unbounded;
with Util.Properties;
with Util.Beans.Objects;
with Util.Files;
with Util.Log.Loggers;
with Util.Serialize.IO.XML;
with ASF.Contexts.Faces;
with ASF.Applications.Main.Configs;
with Security.Policies;
with AWA.Events.Configs.Reader_Config;
with AWA.Services.Contexts;
package body AWA.Applications.Configs is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Applications.Configs");
type Wallet_Manager is limited new Util.Properties.Implementation.Manager with record
Wallet : Keystore.Properties.Manager;
Props : ASF.Applications.Config;
Length : Positive;
Prefix : String (1 .. MAX_PREFIX_LENGTH);
end record;
type Keystore_Manager_Access is access all Wallet_Manager'Class;
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
overriding
function Get_Value (From : in Wallet_Manager;
Name : in String) return Util.Beans.Objects.Object;
-- Set the value identified by the name.
-- If the map contains the given name, the value changed.
-- Otherwise name is added to the map and the value associated with it.
overriding
procedure Set_Value (From : in out Wallet_Manager;
Name : in String;
Value : in Util.Beans.Objects.Object);
-- Returns TRUE if the property exists.
overriding
function Exists (Self : in Wallet_Manager;
Name : in String)
return Boolean;
-- Remove the property given its name.
overriding
procedure Remove (Self : in out Wallet_Manager;
Name : in String);
-- Iterate over the properties and execute the given procedure passing the
-- property name and its value.
overriding
procedure Iterate (Self : in Wallet_Manager;
Process : access procedure (Name : in String;
Item : in Util.Beans.Objects.Object));
-- Deep copy of properties stored in 'From' to 'To'.
function Create_Copy (Self : in Wallet_Manager)
return Util.Properties.Implementation.Manager_Access;
package Shared_Manager is
new Util.Properties.Implementation.Shared_Implementation (Wallet_Manager);
subtype Property_Map is Shared_Manager.Manager;
type Property_Map_Access is access all Property_Map;
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
overriding
function Get_Value (From : in Wallet_Manager;
Name : in String) return Util.Beans.Objects.Object is
Prefixed_Name : constant String := From.Prefix (1 .. From.Length) & Name;
begin
if From.Wallet.Exists (Prefixed_Name) then
declare
Value : constant String := From.Wallet.Get (Prefixed_Name);
begin
return Util.Beans.Objects.To_Object (Value);
end;
else
return From.Props.Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- If the map contains the given name, the value changed.
-- Otherwise name is added to the map and the value associated with it.
-- ------------------------------
overriding
procedure Set_Value (From : in out Wallet_Manager;
Name : in String;
Value : in Util.Beans.Objects.Object) is
Prefixed_Name : constant String := From.Prefix (1 .. From.Length) & Name;
begin
if From.Wallet.Exists (Prefixed_Name) then
From.Wallet.Set_Value (Prefixed_Name, Value);
else
From.Props.Set_Value (Name, Value);
end if;
end Set_Value;
-- ------------------------------
-- Returns TRUE if the property exists.
-- ------------------------------
function Exists (Self : in Wallet_Manager;
Name : in String)
return Boolean is
begin
return Self.Props.Exists (Name)
or else Self.Wallet.Exists (Self.Prefix (1 .. Self.Length) & Name);
end Exists;
-- ------------------------------
-- Remove the property given its name.
-- ------------------------------
procedure Remove (Self : in out Wallet_Manager;
Name : in String) is
Prefixed_Name : constant String := Self.Prefix (1 .. Self.Length) & Name;
begin
if Self.Wallet.Exists (Prefixed_Name) then
Self.Wallet.Remove (Prefixed_Name);
else
Self.Props.Remove (Name);
end if;
end Remove;
-- ------------------------------
-- Iterate over the properties and execute the given procedure passing the
-- property name and its value.
-- ------------------------------
procedure Iterate (Self : in Wallet_Manager;
Process : access procedure (Name : in String;
Item : in Util.Beans.Objects.Object)) is
begin
Self.Props.Iterate (Process);
end Iterate;
-- ------------------------------
-- Deep copy of properties stored in 'From' to 'To'.
-- ------------------------------
function Create_Copy (Self : in Wallet_Manager)
return Util.Properties.Implementation.Manager_Access is
Result : constant Property_Map_Access := new Property_Map;
begin
Result.Length := Self.Length;
Result.Wallet := Self.Wallet;
Result.Props := Self.Props;
Result.Prefix := Self.Prefix;
return Result.all'Access;
end Create_Copy;
-- ------------------------------
-- Merge the configuration content and the keystore to a final configuration object.
-- The keystore can be used to store sensitive information such as database connection,
-- secret keys while the rest of the configuration remains in clear property files.
-- The keystore must be unlocked to have access to its content.
-- The prefix parameter is used to prefix names from the keystore so that the same
-- keystore could be used by several applications.
-- ------------------------------
procedure Merge (Into : in out ASF.Applications.Config;
Config : in out ASF.Applications.Config;
Wallet : in out Keystore.Properties.Manager;
Prefix : in String) is
function Allocate return Util.Properties.Implementation.Shared_Manager_Access;
function Allocate return Util.Properties.Implementation.Shared_Manager_Access is
Result : constant Property_Map_Access := new Property_Map;
begin
Result.Length := Prefix'Length;
Result.Wallet := Wallet;
Result.Props := Config;
Result.Prefix (1 .. Result.Length) := Prefix;
return Result.all'Access;
end Allocate;
procedure Setup is
new Util.Properties.Implementation.Initialize (Allocate);
begin
Setup (Into);
end Merge;
-- ------------------------------
-- XML reader configuration. By instantiating this generic package, the XML parser
-- gets initialized to read the configuration for servlets, filters, managed beans,
-- permissions, events and other configuration elements.
-- ------------------------------
package body Reader_Config is
App_Access : constant ASF.Contexts.Faces.Application_Access := App.all'Unchecked_Access;
package Bean_Config is
new ASF.Applications.Main.Configs.Reader_Config (Mapper, App_Access,
Context.all'Access,
Override_Context);
package Event_Config is
new AWA.Events.Configs.Reader_Config (Mapper => Mapper,
Manager => App.Events'Unchecked_Access,
Context => Context.all'Access);
pragma Warnings (Off, Bean_Config);
pragma Warnings (Off, Event_Config);
begin
Event_Config.Initialize;
end Reader_Config;
-- ------------------------------
-- Read the application configuration file and configure the application
-- ------------------------------
procedure Read_Configuration (App : in out Application'Class;
File : in String;
Context : in EL.Contexts.Default.Default_Context_Access;
Override_Context : in Boolean) is
Reader : Util.Serialize.IO.XML.Parser;
Mapper : Util.Serialize.Mappers.Processing;
Ctx : AWA.Services.Contexts.Service_Context;
Sec : constant Security.Policies.Policy_Manager_Access := App.Get_Security_Manager;
begin
Log.Info ("Reading application configuration file {0}", File);
Ctx.Set_Context (App'Unchecked_Access, null);
declare
package Config is new Reader_Config (Mapper, App'Unchecked_Access, Context,
Override_Context);
pragma Warnings (Off, Config);
begin
Sec.Prepare_Config (Mapper);
-- Initialize the parser with the module configuration mappers (if any).
Initialize_Parser (App, Reader);
if Log.Get_Level >= Util.Log.DEBUG_LEVEL then
Util.Serialize.Mappers.Dump (Mapper, Log);
end if;
-- Read the configuration file and record managed beans, navigation rules.
Reader.Parse (File, Mapper);
end;
exception
when others =>
Log.Error ("Error while reading {0}", File);
raise;
end Read_Configuration;
-- ------------------------------
-- Get the configuration path for the application name.
-- The configuration path is search from:
-- o the current directory,
-- o the 'config' directory,
-- o the Dynamo installation directory in share/dynamo
-- ------------------------------
function Get_Config_Path (Name : in String) return String is
use Ada.Strings.Unbounded;
use Ada.Directories;
Command : constant String := Ada.Command_Line.Command_Name;
Path : constant String := Ada.Directories.Containing_Directory (Command);
Dir : constant String := Containing_Directory (Path);
Paths : Ada.Strings.Unbounded.Unbounded_String;
begin
Append (Paths, ".;");
Append (Paths, Util.Files.Compose (Dir, "config"));
Append (Paths, ";");
Append (Paths, Util.Files.Compose (Dir, "share/dynamo/" & Name));
return Util.Files.Find_File_Path (Name & ".properties", To_String (Paths));
end Get_Config_Path;
end AWA.Applications.Configs;
|
Fabien-Chouteau/samd51-hal | Ada | 63,247 | ads | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2019, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with System;
with HAL;
package SAM.SERCOM is
type Pad_Id is new HAL.UInt2;
-- Identifier for the pads (IO line) of SERCOM devices
type SERCOM_Internal is private;
-- Register mapping for internal use only
type SERCOM_Device
(Periph : not null access SERCOM_Internal)
is abstract tagged limited
private;
function Configured (This : SERCOM_Device) return Boolean;
-- Return True if the device is configure for one of its operation mode
-- (I2C, SPI, UART).
--
-- Configuration can only be done by one of the specific mode drivers, see
-- SAM.SERCOM.SPI, SAM.SERCOM.I2C, etc.
function Enabled (This : SERCOM_Device) return Boolean;
-- Return True if the device is enableds
procedure Enable (This : in out SERCOM_Device)
with Pre => This.Configured and then not This.Enabled,
Post => This.Configured and then This.Enabled;
-- Enable the device that was previously configured for a specific mode
procedure Disable (This : in out SERCOM_Device)
with Pre => This.Enabled,
Post => not This.Enabled;
-- Disable the device
procedure Reset (This : in out SERCOM_Device)
with Post => not This.Configured;
-- Reset the device and its configuration
procedure Debug_Stop_Mode (This : in out SERCOM_Device;
Enabled : Boolean := True);
-- Stop the device when the CPU is halted by an external debugger.
-- This mode is disabled by default.
--
-- When this mdoe is disabled, the device will continue to send and receive
-- data when the CPU is halted which may lead to data loss.
private
type SERCOM_Device
(Periph : not null access SERCOM_Internal)
is abstract tagged limited
record
Config_Done : Boolean := False;
end record;
---------------
-- Registers --
---------------
------------------------------------
-- SercomI2cm cluster's Registers --
------------------------------------
subtype SERCOM_CTRLA_SERCOM_I2CM_MODE_Field is HAL.UInt3;
subtype SERCOM_CTRLA_SERCOM_I2CM_SDAHOLD_Field is HAL.UInt2;
subtype SERCOM_CTRLA_SERCOM_I2CM_SPEED_Field is HAL.UInt2;
subtype SERCOM_CTRLA_SERCOM_I2CM_INACTOUT_Field is HAL.UInt2;
-- I2CM Control A
type SERCOM_CTRLA_SERCOM_I2CM_Register is record
-- Software Reset
SWRST : Boolean := False;
-- Enable
ENABLE : Boolean := False;
-- Operating Mode
MODE : SERCOM_CTRLA_SERCOM_I2CM_MODE_Field := 16#0#;
-- unspecified
Reserved_5_6 : HAL.UInt2 := 16#0#;
-- Run in Standby
RUNSTDBY : Boolean := False;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Pin Usage
PINOUT : Boolean := False;
-- unspecified
Reserved_17_19 : HAL.UInt3 := 16#0#;
-- SDA Hold Time
SDAHOLD : SERCOM_CTRLA_SERCOM_I2CM_SDAHOLD_Field := 16#0#;
-- Master SCL Low Extend Timeout
MEXTTOEN : Boolean := False;
-- Slave SCL Low Extend Timeout
SEXTTOEN : Boolean := False;
-- Transfer Speed
SPEED : SERCOM_CTRLA_SERCOM_I2CM_SPEED_Field := 16#0#;
-- unspecified
Reserved_26_26 : HAL.Bit := 16#0#;
-- SCL Clock Stretch Mode
SCLSM : Boolean := False;
-- Inactive Time-Out
INACTOUT : SERCOM_CTRLA_SERCOM_I2CM_INACTOUT_Field := 16#0#;
-- SCL Low Timeout Enable
LOWTOUTEN : 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 SERCOM_CTRLA_SERCOM_I2CM_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
MODE at 0 range 2 .. 4;
Reserved_5_6 at 0 range 5 .. 6;
RUNSTDBY at 0 range 7 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
PINOUT at 0 range 16 .. 16;
Reserved_17_19 at 0 range 17 .. 19;
SDAHOLD at 0 range 20 .. 21;
MEXTTOEN at 0 range 22 .. 22;
SEXTTOEN at 0 range 23 .. 23;
SPEED at 0 range 24 .. 25;
Reserved_26_26 at 0 range 26 .. 26;
SCLSM at 0 range 27 .. 27;
INACTOUT at 0 range 28 .. 29;
LOWTOUTEN at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype SERCOM_CTRLB_SERCOM_I2CM_CMD_Field is HAL.UInt2;
-- I2CM Control B
type SERCOM_CTRLB_SERCOM_I2CM_Register is record
-- unspecified
Reserved_0_7 : HAL.UInt8 := 16#0#;
-- Smart Mode Enable
SMEN : Boolean := False;
-- Quick Command Enable
QCEN : Boolean := False;
-- unspecified
Reserved_10_15 : HAL.UInt6 := 16#0#;
-- Write-only. Command
CMD : SERCOM_CTRLB_SERCOM_I2CM_CMD_Field := 16#0#;
-- Acknowledge Action
ACKACT : Boolean := False;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_CTRLB_SERCOM_I2CM_Register use record
Reserved_0_7 at 0 range 0 .. 7;
SMEN at 0 range 8 .. 8;
QCEN at 0 range 9 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
CMD at 0 range 16 .. 17;
ACKACT at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
-- I2CM Control C
type SERCOM_CTRLC_SERCOM_I2CM_Register is record
-- unspecified
Reserved_0_23 : HAL.UInt24 := 16#0#;
-- Data 32 Bit
DATA32B : Boolean := False;
-- unspecified
Reserved_25_31 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_CTRLC_SERCOM_I2CM_Register use record
Reserved_0_23 at 0 range 0 .. 23;
DATA32B at 0 range 24 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype SERCOM_BAUD_SERCOM_I2CM_BAUD_Field is HAL.UInt8;
subtype SERCOM_BAUD_SERCOM_I2CM_BAUDLOW_Field is HAL.UInt8;
subtype SERCOM_BAUD_SERCOM_I2CM_HSBAUD_Field is HAL.UInt8;
subtype SERCOM_BAUD_SERCOM_I2CM_HSBAUDLOW_Field is HAL.UInt8;
-- I2CM Baud Rate
type SERCOM_BAUD_SERCOM_I2CM_Register is record
-- Baud Rate Value
BAUD : SERCOM_BAUD_SERCOM_I2CM_BAUD_Field := 16#0#;
-- Baud Rate Value Low
BAUDLOW : SERCOM_BAUD_SERCOM_I2CM_BAUDLOW_Field := 16#0#;
-- High Speed Baud Rate Value
HSBAUD : SERCOM_BAUD_SERCOM_I2CM_HSBAUD_Field := 16#0#;
-- High Speed Baud Rate Value Low
HSBAUDLOW : SERCOM_BAUD_SERCOM_I2CM_HSBAUDLOW_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_BAUD_SERCOM_I2CM_Register use record
BAUD at 0 range 0 .. 7;
BAUDLOW at 0 range 8 .. 15;
HSBAUD at 0 range 16 .. 23;
HSBAUDLOW at 0 range 24 .. 31;
end record;
-- I2CM Interrupt Enable Clear
type SERCOM_INTENCLR_SERCOM_I2CM_Register is record
-- Master On Bus Interrupt Disable
MB : Boolean := False;
-- Slave On Bus Interrupt Disable
SB : Boolean := False;
-- unspecified
Reserved_2_6 : HAL.UInt5 := 16#0#;
-- Combined Error Interrupt Disable
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTENCLR_SERCOM_I2CM_Register use record
MB at 0 range 0 .. 0;
SB at 0 range 1 .. 1;
Reserved_2_6 at 0 range 2 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- I2CM Interrupt Enable Set
type SERCOM_INTENSET_SERCOM_I2CM_Register is record
-- Master On Bus Interrupt Enable
MB : Boolean := False;
-- Slave On Bus Interrupt Enable
SB : Boolean := False;
-- unspecified
Reserved_2_6 : HAL.UInt5 := 16#0#;
-- Combined Error Interrupt Enable
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTENSET_SERCOM_I2CM_Register use record
MB at 0 range 0 .. 0;
SB at 0 range 1 .. 1;
Reserved_2_6 at 0 range 2 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- I2CM Interrupt Flag Status and Clear
type SERCOM_INTFLAG_SERCOM_I2CM_Register is record
-- Master On Bus Interrupt
MB : Boolean := False;
-- Slave On Bus Interrupt
SB : Boolean := False;
-- unspecified
Reserved_2_6 : HAL.UInt5 := 16#0#;
-- Combined Error Interrupt
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTFLAG_SERCOM_I2CM_Register use record
MB at 0 range 0 .. 0;
SB at 0 range 1 .. 1;
Reserved_2_6 at 0 range 2 .. 6;
ERROR at 0 range 7 .. 7;
end record;
subtype SERCOM_STATUS_SERCOM_I2CM_BUSSTATE_Field is HAL.UInt2;
-- I2CM Status
type SERCOM_STATUS_SERCOM_I2CM_Register is record
-- Bus Error
BUSERR : Boolean := False;
-- Arbitration Lost
ARBLOST : Boolean := False;
-- Read-only. Received Not Acknowledge
RXNACK : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- Bus State
BUSSTATE : SERCOM_STATUS_SERCOM_I2CM_BUSSTATE_Field := 16#0#;
-- SCL Low Timeout
LOWTOUT : Boolean := False;
-- Read-only. Clock Hold
CLKHOLD : Boolean := False;
-- Master SCL Low Extend Timeout
MEXTTOUT : Boolean := False;
-- Slave SCL Low Extend Timeout
SEXTTOUT : Boolean := False;
-- Length Error
LENERR : Boolean := False;
-- unspecified
Reserved_11_15 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_STATUS_SERCOM_I2CM_Register use record
BUSERR at 0 range 0 .. 0;
ARBLOST at 0 range 1 .. 1;
RXNACK at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
BUSSTATE at 0 range 4 .. 5;
LOWTOUT at 0 range 6 .. 6;
CLKHOLD at 0 range 7 .. 7;
MEXTTOUT at 0 range 8 .. 8;
SEXTTOUT at 0 range 9 .. 9;
LENERR at 0 range 10 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
end record;
-- I2CM Synchronization Busy
type SERCOM_SYNCBUSY_SERCOM_I2CM_Register is record
-- Read-only. Software Reset Synchronization Busy
SWRST : Boolean;
-- Read-only. SERCOM Enable Synchronization Busy
ENABLE : Boolean;
-- Read-only. System Operation Synchronization Busy
SYSOP : Boolean;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Length Synchronization Busy
LENGTH : Boolean;
-- unspecified
Reserved_5_31 : HAL.UInt27;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_SYNCBUSY_SERCOM_I2CM_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
SYSOP at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
LENGTH at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype SERCOM_ADDR_SERCOM_I2CM_ADDR_Field is HAL.UInt11;
subtype SERCOM_ADDR_SERCOM_I2CM_LEN_Field is HAL.UInt8;
-- I2CM Address
type SERCOM_ADDR_SERCOM_I2CM_Register is record
-- Address Value
ADDR : SERCOM_ADDR_SERCOM_I2CM_ADDR_Field := 16#0#;
-- unspecified
Reserved_11_12 : HAL.UInt2 := 16#0#;
-- Length Enable
LENEN : Boolean := False;
-- High Speed Mode
HS : Boolean := False;
-- Ten Bit Addressing Enable
TENBITEN : Boolean := False;
-- Length
LEN : SERCOM_ADDR_SERCOM_I2CM_LEN_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_ADDR_SERCOM_I2CM_Register use record
ADDR at 0 range 0 .. 10;
Reserved_11_12 at 0 range 11 .. 12;
LENEN at 0 range 13 .. 13;
HS at 0 range 14 .. 14;
TENBITEN at 0 range 15 .. 15;
LEN at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- I2CM Debug Control
type SERCOM_DBGCTRL_SERCOM_I2CM_Register is record
-- Debug Mode
DBGSTOP : Boolean := False;
-- unspecified
Reserved_1_7 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_DBGCTRL_SERCOM_I2CM_Register use record
DBGSTOP at 0 range 0 .. 0;
Reserved_1_7 at 0 range 1 .. 7;
end record;
-- I2C Master Mode
type SercomI2cm_Cluster is record
-- I2CM Control A
CTRLA : aliased SERCOM_CTRLA_SERCOM_I2CM_Register;
-- I2CM Control B
CTRLB : aliased SERCOM_CTRLB_SERCOM_I2CM_Register;
-- I2CM Control C
CTRLC : aliased SERCOM_CTRLC_SERCOM_I2CM_Register;
-- I2CM Baud Rate
BAUD : aliased SERCOM_BAUD_SERCOM_I2CM_Register;
-- I2CM Interrupt Enable Clear
INTENCLR : aliased SERCOM_INTENCLR_SERCOM_I2CM_Register;
-- I2CM Interrupt Enable Set
INTENSET : aliased SERCOM_INTENSET_SERCOM_I2CM_Register;
-- I2CM Interrupt Flag Status and Clear
INTFLAG : aliased SERCOM_INTFLAG_SERCOM_I2CM_Register;
-- I2CM Status
STATUS : aliased SERCOM_STATUS_SERCOM_I2CM_Register;
-- I2CM Synchronization Busy
SYNCBUSY : aliased SERCOM_SYNCBUSY_SERCOM_I2CM_Register;
-- I2CM Address
ADDR : aliased SERCOM_ADDR_SERCOM_I2CM_Register;
-- I2CM Data
DATA : aliased HAL.UInt32;
-- I2CM Debug Control
DBGCTRL : aliased SERCOM_DBGCTRL_SERCOM_I2CM_Register;
end record
with Size => 416;
for SercomI2cm_Cluster use record
CTRLA at 16#0# range 0 .. 31;
CTRLB at 16#4# range 0 .. 31;
CTRLC at 16#8# range 0 .. 31;
BAUD at 16#C# range 0 .. 31;
INTENCLR at 16#14# range 0 .. 7;
INTENSET at 16#16# range 0 .. 7;
INTFLAG at 16#18# range 0 .. 7;
STATUS at 16#1A# range 0 .. 15;
SYNCBUSY at 16#1C# range 0 .. 31;
ADDR at 16#24# range 0 .. 31;
DATA at 16#28# range 0 .. 31;
DBGCTRL at 16#30# range 0 .. 7;
end record;
------------------------------------
-- SercomI2cs cluster's Registers --
------------------------------------
subtype SERCOM_CTRLA_SERCOM_I2CS_MODE_Field is HAL.UInt3;
subtype SERCOM_CTRLA_SERCOM_I2CS_SDAHOLD_Field is HAL.UInt2;
subtype SERCOM_CTRLA_SERCOM_I2CS_SPEED_Field is HAL.UInt2;
-- I2CS Control A
type SERCOM_CTRLA_SERCOM_I2CS_Register is record
-- Software Reset
SWRST : Boolean := False;
-- Enable
ENABLE : Boolean := False;
-- Operating Mode
MODE : SERCOM_CTRLA_SERCOM_I2CS_MODE_Field := 16#0#;
-- unspecified
Reserved_5_6 : HAL.UInt2 := 16#0#;
-- Run during Standby
RUNSTDBY : Boolean := False;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Pin Usage
PINOUT : Boolean := False;
-- unspecified
Reserved_17_19 : HAL.UInt3 := 16#0#;
-- SDA Hold Time
SDAHOLD : SERCOM_CTRLA_SERCOM_I2CS_SDAHOLD_Field := 16#0#;
-- unspecified
Reserved_22_22 : HAL.Bit := 16#0#;
-- Slave SCL Low Extend Timeout
SEXTTOEN : Boolean := False;
-- Transfer Speed
SPEED : SERCOM_CTRLA_SERCOM_I2CS_SPEED_Field := 16#0#;
-- unspecified
Reserved_26_26 : HAL.Bit := 16#0#;
-- SCL Clock Stretch Mode
SCLSM : Boolean := False;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
-- SCL Low Timeout Enable
LOWTOUTEN : 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 SERCOM_CTRLA_SERCOM_I2CS_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
MODE at 0 range 2 .. 4;
Reserved_5_6 at 0 range 5 .. 6;
RUNSTDBY at 0 range 7 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
PINOUT at 0 range 16 .. 16;
Reserved_17_19 at 0 range 17 .. 19;
SDAHOLD at 0 range 20 .. 21;
Reserved_22_22 at 0 range 22 .. 22;
SEXTTOEN at 0 range 23 .. 23;
SPEED at 0 range 24 .. 25;
Reserved_26_26 at 0 range 26 .. 26;
SCLSM at 0 range 27 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
LOWTOUTEN at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype SERCOM_CTRLB_SERCOM_I2CS_AMODE_Field is HAL.UInt2;
subtype SERCOM_CTRLB_SERCOM_I2CS_CMD_Field is HAL.UInt2;
-- I2CS Control B
type SERCOM_CTRLB_SERCOM_I2CS_Register is record
-- unspecified
Reserved_0_7 : HAL.UInt8 := 16#0#;
-- Smart Mode Enable
SMEN : Boolean := False;
-- PMBus Group Command
GCMD : Boolean := False;
-- Automatic Address Acknowledge
AACKEN : Boolean := False;
-- unspecified
Reserved_11_13 : HAL.UInt3 := 16#0#;
-- Address Mode
AMODE : SERCOM_CTRLB_SERCOM_I2CS_AMODE_Field := 16#0#;
-- Write-only. Command
CMD : SERCOM_CTRLB_SERCOM_I2CS_CMD_Field := 16#0#;
-- Acknowledge Action
ACKACT : Boolean := False;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_CTRLB_SERCOM_I2CS_Register use record
Reserved_0_7 at 0 range 0 .. 7;
SMEN at 0 range 8 .. 8;
GCMD at 0 range 9 .. 9;
AACKEN at 0 range 10 .. 10;
Reserved_11_13 at 0 range 11 .. 13;
AMODE at 0 range 14 .. 15;
CMD at 0 range 16 .. 17;
ACKACT at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype SERCOM_CTRLC_SERCOM_I2CS_SDASETUP_Field is HAL.UInt4;
-- I2CS Control C
type SERCOM_CTRLC_SERCOM_I2CS_Register is record
-- SDA Setup Time
SDASETUP : SERCOM_CTRLC_SERCOM_I2CS_SDASETUP_Field := 16#0#;
-- unspecified
Reserved_4_23 : HAL.UInt20 := 16#0#;
-- Data 32 Bit
DATA32B : Boolean := False;
-- unspecified
Reserved_25_31 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_CTRLC_SERCOM_I2CS_Register use record
SDASETUP at 0 range 0 .. 3;
Reserved_4_23 at 0 range 4 .. 23;
DATA32B at 0 range 24 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
-- I2CS Interrupt Enable Clear
type SERCOM_INTENCLR_SERCOM_I2CS_Register is record
-- Stop Received Interrupt Disable
PREC : Boolean := False;
-- Address Match Interrupt Disable
AMATCH : Boolean := False;
-- Data Interrupt Disable
DRDY : Boolean := False;
-- unspecified
Reserved_3_6 : HAL.UInt4 := 16#0#;
-- Combined Error Interrupt Disable
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTENCLR_SERCOM_I2CS_Register use record
PREC at 0 range 0 .. 0;
AMATCH at 0 range 1 .. 1;
DRDY at 0 range 2 .. 2;
Reserved_3_6 at 0 range 3 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- I2CS Interrupt Enable Set
type SERCOM_INTENSET_SERCOM_I2CS_Register is record
-- Stop Received Interrupt Enable
PREC : Boolean := False;
-- Address Match Interrupt Enable
AMATCH : Boolean := False;
-- Data Interrupt Enable
DRDY : Boolean := False;
-- unspecified
Reserved_3_6 : HAL.UInt4 := 16#0#;
-- Combined Error Interrupt Enable
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTENSET_SERCOM_I2CS_Register use record
PREC at 0 range 0 .. 0;
AMATCH at 0 range 1 .. 1;
DRDY at 0 range 2 .. 2;
Reserved_3_6 at 0 range 3 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- I2CS Interrupt Flag Status and Clear
type SERCOM_INTFLAG_SERCOM_I2CS_Register is record
-- Stop Received Interrupt
PREC : Boolean := False;
-- Address Match Interrupt
AMATCH : Boolean := False;
-- Data Interrupt
DRDY : Boolean := False;
-- unspecified
Reserved_3_6 : HAL.UInt4 := 16#0#;
-- Combined Error Interrupt
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTFLAG_SERCOM_I2CS_Register use record
PREC at 0 range 0 .. 0;
AMATCH at 0 range 1 .. 1;
DRDY at 0 range 2 .. 2;
Reserved_3_6 at 0 range 3 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- I2CS Status
type SERCOM_STATUS_SERCOM_I2CS_Register is record
-- Bus Error
BUSERR : Boolean := False;
-- Transmit Collision
COLL : Boolean := False;
-- Read-only. Received Not Acknowledge
RXNACK : Boolean := False;
-- Read-only. Read/Write Direction
DIR : Boolean := False;
-- Read-only. Repeated Start
SR : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- SCL Low Timeout
LOWTOUT : Boolean := False;
-- Read-only. Clock Hold
CLKHOLD : Boolean := False;
-- unspecified
Reserved_8_8 : HAL.Bit := 16#0#;
-- Slave SCL Low Extend Timeout
SEXTTOUT : Boolean := False;
-- High Speed
HS : Boolean := False;
-- Transaction Length Error
LENERR : Boolean := False;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_STATUS_SERCOM_I2CS_Register use record
BUSERR at 0 range 0 .. 0;
COLL at 0 range 1 .. 1;
RXNACK at 0 range 2 .. 2;
DIR at 0 range 3 .. 3;
SR at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
LOWTOUT at 0 range 6 .. 6;
CLKHOLD at 0 range 7 .. 7;
Reserved_8_8 at 0 range 8 .. 8;
SEXTTOUT at 0 range 9 .. 9;
HS at 0 range 10 .. 10;
LENERR at 0 range 11 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
end record;
-- I2CS Synchronization Busy
type SERCOM_SYNCBUSY_SERCOM_I2CS_Register is record
-- Read-only. Software Reset Synchronization Busy
SWRST : Boolean;
-- Read-only. SERCOM Enable Synchronization Busy
ENABLE : Boolean;
-- unspecified
Reserved_2_3 : HAL.UInt2;
-- Read-only. Length Synchronization Busy
LENGTH : Boolean;
-- unspecified
Reserved_5_31 : HAL.UInt27;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_SYNCBUSY_SERCOM_I2CS_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
LENGTH at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype SERCOM_LENGTH_SERCOM_I2CS_LEN_Field is HAL.UInt8;
-- I2CS Length
type SERCOM_LENGTH_SERCOM_I2CS_Register is record
-- Data Length
LEN : SERCOM_LENGTH_SERCOM_I2CS_LEN_Field := 16#0#;
-- Data Length Enable
LENEN : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_LENGTH_SERCOM_I2CS_Register use record
LEN at 0 range 0 .. 7;
LENEN at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
end record;
subtype SERCOM_ADDR_SERCOM_I2CS_ADDR_Field is HAL.UInt10;
subtype SERCOM_ADDR_SERCOM_I2CS_ADDRMASK_Field is HAL.UInt10;
-- I2CS Address
type SERCOM_ADDR_SERCOM_I2CS_Register is record
-- General Call Address Enable
GENCEN : Boolean := False;
-- Address Value
ADDR : SERCOM_ADDR_SERCOM_I2CS_ADDR_Field := 16#0#;
-- unspecified
Reserved_11_14 : HAL.UInt4 := 16#0#;
-- Ten Bit Addressing Enable
TENBITEN : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Address Mask
ADDRMASK : SERCOM_ADDR_SERCOM_I2CS_ADDRMASK_Field := 16#0#;
-- unspecified
Reserved_27_31 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_ADDR_SERCOM_I2CS_Register use record
GENCEN at 0 range 0 .. 0;
ADDR at 0 range 1 .. 10;
Reserved_11_14 at 0 range 11 .. 14;
TENBITEN at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
ADDRMASK at 0 range 17 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
-- I2C Slave Mode
type SercomI2cs_Cluster is record
-- I2CS Control A
CTRLA : aliased SERCOM_CTRLA_SERCOM_I2CS_Register;
-- I2CS Control B
CTRLB : aliased SERCOM_CTRLB_SERCOM_I2CS_Register;
-- I2CS Control C
CTRLC : aliased SERCOM_CTRLC_SERCOM_I2CS_Register;
-- I2CS Interrupt Enable Clear
INTENCLR : aliased SERCOM_INTENCLR_SERCOM_I2CS_Register;
-- I2CS Interrupt Enable Set
INTENSET : aliased SERCOM_INTENSET_SERCOM_I2CS_Register;
-- I2CS Interrupt Flag Status and Clear
INTFLAG : aliased SERCOM_INTFLAG_SERCOM_I2CS_Register;
-- I2CS Status
STATUS : aliased SERCOM_STATUS_SERCOM_I2CS_Register;
-- I2CS Synchronization Busy
SYNCBUSY : aliased SERCOM_SYNCBUSY_SERCOM_I2CS_Register;
-- I2CS Length
LENGTH : aliased SERCOM_LENGTH_SERCOM_I2CS_Register;
-- I2CS Address
ADDR : aliased SERCOM_ADDR_SERCOM_I2CS_Register;
-- I2CS Data
DATA : aliased HAL.UInt32;
end record
with Size => 352;
for SercomI2cs_Cluster use record
CTRLA at 16#0# range 0 .. 31;
CTRLB at 16#4# range 0 .. 31;
CTRLC at 16#8# range 0 .. 31;
INTENCLR at 16#14# range 0 .. 7;
INTENSET at 16#16# range 0 .. 7;
INTFLAG at 16#18# range 0 .. 7;
STATUS at 16#1A# range 0 .. 15;
SYNCBUSY at 16#1C# range 0 .. 31;
LENGTH at 16#22# range 0 .. 15;
ADDR at 16#24# range 0 .. 31;
DATA at 16#28# range 0 .. 31;
end record;
-----------------------------------
-- SercomSpi cluster's Registers --
-----------------------------------
subtype SERCOM_CTRLA_SERCOM_SPI_MODE_Field is HAL.UInt3;
subtype SERCOM_CTRLA_SERCOM_SPI_DOPO_Field is HAL.UInt2;
subtype SERCOM_CTRLA_SERCOM_SPI_DIPO_Field is HAL.UInt2;
subtype SERCOM_CTRLA_SERCOM_SPI_FORM_Field is HAL.UInt4;
-- SPI Control A
type SERCOM_CTRLA_SERCOM_SPI_Register is record
-- Software Reset
SWRST : Boolean := False;
-- Enable
ENABLE : Boolean := False;
-- Operating Mode
MODE : SERCOM_CTRLA_SERCOM_SPI_MODE_Field := 16#0#;
-- unspecified
Reserved_5_6 : HAL.UInt2 := 16#0#;
-- Run during Standby
RUNSTDBY : Boolean := False;
-- Immediate Buffer Overflow Notification
IBON : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
-- Data Out Pinout
DOPO : SERCOM_CTRLA_SERCOM_SPI_DOPO_Field := 16#0#;
-- unspecified
Reserved_18_19 : HAL.UInt2 := 16#0#;
-- Data In Pinout
DIPO : SERCOM_CTRLA_SERCOM_SPI_DIPO_Field := 16#0#;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Frame Format
FORM : SERCOM_CTRLA_SERCOM_SPI_FORM_Field := 16#0#;
-- Clock Phase
CPHA : Boolean := False;
-- Clock Polarity
CPOL : Boolean := False;
-- Data Order
DORD : 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 SERCOM_CTRLA_SERCOM_SPI_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
MODE at 0 range 2 .. 4;
Reserved_5_6 at 0 range 5 .. 6;
RUNSTDBY at 0 range 7 .. 7;
IBON at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
DOPO at 0 range 16 .. 17;
Reserved_18_19 at 0 range 18 .. 19;
DIPO at 0 range 20 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
FORM at 0 range 24 .. 27;
CPHA at 0 range 28 .. 28;
CPOL at 0 range 29 .. 29;
DORD at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype SERCOM_CTRLB_SERCOM_SPI_CHSIZE_Field is HAL.UInt3;
subtype SERCOM_CTRLB_SERCOM_SPI_AMODE_Field is HAL.UInt2;
-- SPI Control B
type SERCOM_CTRLB_SERCOM_SPI_Register is record
-- Character Size
CHSIZE : SERCOM_CTRLB_SERCOM_SPI_CHSIZE_Field := 16#0#;
-- unspecified
Reserved_3_5 : HAL.UInt3 := 16#0#;
-- Data Preload Enable
PLOADEN : Boolean := False;
-- unspecified
Reserved_7_8 : HAL.UInt2 := 16#0#;
-- Slave Select Low Detect Enable
SSDE : Boolean := False;
-- unspecified
Reserved_10_12 : HAL.UInt3 := 16#0#;
-- Master Slave Select Enable
MSSEN : Boolean := False;
-- Address Mode
AMODE : SERCOM_CTRLB_SERCOM_SPI_AMODE_Field := 16#0#;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Receiver Enable
RXEN : Boolean := False;
-- unspecified
Reserved_18_31 : HAL.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_CTRLB_SERCOM_SPI_Register use record
CHSIZE at 0 range 0 .. 2;
Reserved_3_5 at 0 range 3 .. 5;
PLOADEN at 0 range 6 .. 6;
Reserved_7_8 at 0 range 7 .. 8;
SSDE at 0 range 9 .. 9;
Reserved_10_12 at 0 range 10 .. 12;
MSSEN at 0 range 13 .. 13;
AMODE at 0 range 14 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
RXEN at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
subtype SERCOM_CTRLC_SERCOM_SPI_ICSPACE_Field is HAL.UInt6;
-- SPI Control C
type SERCOM_CTRLC_SERCOM_SPI_Register is record
-- Inter-Character Spacing
ICSPACE : SERCOM_CTRLC_SERCOM_SPI_ICSPACE_Field := 16#0#;
-- unspecified
Reserved_6_23 : HAL.UInt18 := 16#0#;
-- Data 32 Bit
DATA32B : Boolean := False;
-- unspecified
Reserved_25_31 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_CTRLC_SERCOM_SPI_Register use record
ICSPACE at 0 range 0 .. 5;
Reserved_6_23 at 0 range 6 .. 23;
DATA32B at 0 range 24 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
-- SPI Interrupt Enable Clear
type SERCOM_INTENCLR_SERCOM_SPI_Register is record
-- Data Register Empty Interrupt Disable
DRE : Boolean := False;
-- Transmit Complete Interrupt Disable
TXC : Boolean := False;
-- Receive Complete Interrupt Disable
RXC : Boolean := False;
-- Slave Select Low Interrupt Disable
SSL : Boolean := False;
-- unspecified
Reserved_4_6 : HAL.UInt3 := 16#0#;
-- Combined Error Interrupt Disable
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTENCLR_SERCOM_SPI_Register use record
DRE at 0 range 0 .. 0;
TXC at 0 range 1 .. 1;
RXC at 0 range 2 .. 2;
SSL at 0 range 3 .. 3;
Reserved_4_6 at 0 range 4 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- SPI Interrupt Enable Set
type SERCOM_INTENSET_SERCOM_SPI_Register is record
-- Data Register Empty Interrupt Enable
DRE : Boolean := False;
-- Transmit Complete Interrupt Enable
TXC : Boolean := False;
-- Receive Complete Interrupt Enable
RXC : Boolean := False;
-- Slave Select Low Interrupt Enable
SSL : Boolean := False;
-- unspecified
Reserved_4_6 : HAL.UInt3 := 16#0#;
-- Combined Error Interrupt Enable
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTENSET_SERCOM_SPI_Register use record
DRE at 0 range 0 .. 0;
TXC at 0 range 1 .. 1;
RXC at 0 range 2 .. 2;
SSL at 0 range 3 .. 3;
Reserved_4_6 at 0 range 4 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- SPI Interrupt Flag Status and Clear
type SERCOM_INTFLAG_SERCOM_SPI_Register is record
-- Read-only. Data Register Empty Interrupt
DRE : Boolean := False;
-- Transmit Complete Interrupt
TXC : Boolean := False;
-- Read-only. Receive Complete Interrupt
RXC : Boolean := False;
-- Slave Select Low Interrupt Flag
SSL : Boolean := False;
-- unspecified
Reserved_4_6 : HAL.UInt3 := 16#0#;
-- Combined Error Interrupt
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTFLAG_SERCOM_SPI_Register use record
DRE at 0 range 0 .. 0;
TXC at 0 range 1 .. 1;
RXC at 0 range 2 .. 2;
SSL at 0 range 3 .. 3;
Reserved_4_6 at 0 range 4 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- SPI Status
type SERCOM_STATUS_SERCOM_SPI_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Buffer Overflow
BUFOVF : Boolean := False;
-- unspecified
Reserved_3_10 : HAL.UInt8 := 16#0#;
-- Transaction Length Error
LENERR : Boolean := False;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_STATUS_SERCOM_SPI_Register use record
Reserved_0_1 at 0 range 0 .. 1;
BUFOVF at 0 range 2 .. 2;
Reserved_3_10 at 0 range 3 .. 10;
LENERR at 0 range 11 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
end record;
-- SPI Synchronization Busy
type SERCOM_SYNCBUSY_SERCOM_SPI_Register is record
-- Read-only. Software Reset Synchronization Busy
SWRST : Boolean;
-- Read-only. SERCOM Enable Synchronization Busy
ENABLE : Boolean;
-- Read-only. CTRLB Synchronization Busy
CTRLB : Boolean;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. LENGTH Synchronization Busy
LENGTH : Boolean;
-- unspecified
Reserved_5_31 : HAL.UInt27;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_SYNCBUSY_SERCOM_SPI_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
CTRLB at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
LENGTH at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype SERCOM_LENGTH_SERCOM_SPI_LEN_Field is HAL.UInt8;
-- SPI Length
type SERCOM_LENGTH_SERCOM_SPI_Register is record
-- Data Length
LEN : SERCOM_LENGTH_SERCOM_SPI_LEN_Field := 16#0#;
-- Data Length Enable
LENEN : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_LENGTH_SERCOM_SPI_Register use record
LEN at 0 range 0 .. 7;
LENEN at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
end record;
subtype SERCOM_ADDR_SERCOM_SPI_ADDR_Field is HAL.UInt8;
subtype SERCOM_ADDR_SERCOM_SPI_ADDRMASK_Field is HAL.UInt8;
-- SPI Address
type SERCOM_ADDR_SERCOM_SPI_Register is record
-- Address Value
ADDR : SERCOM_ADDR_SERCOM_SPI_ADDR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Address Mask
ADDRMASK : SERCOM_ADDR_SERCOM_SPI_ADDRMASK_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_ADDR_SERCOM_SPI_Register use record
ADDR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
ADDRMASK at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- SPI Debug Control
type SERCOM_DBGCTRL_SERCOM_SPI_Register is record
-- Debug Mode
DBGSTOP : Boolean := False;
-- unspecified
Reserved_1_7 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_DBGCTRL_SERCOM_SPI_Register use record
DBGSTOP at 0 range 0 .. 0;
Reserved_1_7 at 0 range 1 .. 7;
end record;
-- SPI Mode
type SercomSpi_Cluster is record
-- SPI Control A
CTRLA : aliased SERCOM_CTRLA_SERCOM_SPI_Register;
-- SPI Control B
CTRLB : aliased SERCOM_CTRLB_SERCOM_SPI_Register;
-- SPI Control C
CTRLC : aliased SERCOM_CTRLC_SERCOM_SPI_Register;
-- SPI Baud Rate
BAUD : aliased HAL.UInt8;
-- SPI Interrupt Enable Clear
INTENCLR : aliased SERCOM_INTENCLR_SERCOM_SPI_Register;
-- SPI Interrupt Enable Set
INTENSET : aliased SERCOM_INTENSET_SERCOM_SPI_Register;
-- SPI Interrupt Flag Status and Clear
INTFLAG : aliased SERCOM_INTFLAG_SERCOM_SPI_Register;
-- SPI Status
STATUS : aliased SERCOM_STATUS_SERCOM_SPI_Register;
-- SPI Synchronization Busy
SYNCBUSY : aliased SERCOM_SYNCBUSY_SERCOM_SPI_Register;
-- SPI Length
LENGTH : aliased SERCOM_LENGTH_SERCOM_SPI_Register;
-- SPI Address
ADDR : aliased SERCOM_ADDR_SERCOM_SPI_Register;
-- SPI Data
DATA : aliased HAL.UInt32;
-- SPI Debug Control
DBGCTRL : aliased SERCOM_DBGCTRL_SERCOM_SPI_Register;
end record
with Size => 416;
for SercomSpi_Cluster use record
CTRLA at 16#0# range 0 .. 31;
CTRLB at 16#4# range 0 .. 31;
CTRLC at 16#8# range 0 .. 31;
BAUD at 16#C# range 0 .. 7;
INTENCLR at 16#14# range 0 .. 7;
INTENSET at 16#16# range 0 .. 7;
INTFLAG at 16#18# range 0 .. 7;
STATUS at 16#1A# range 0 .. 15;
SYNCBUSY at 16#1C# range 0 .. 31;
LENGTH at 16#22# range 0 .. 15;
ADDR at 16#24# range 0 .. 31;
DATA at 16#28# range 0 .. 31;
DBGCTRL at 16#30# range 0 .. 7;
end record;
-------------------------------------
-- SercomUsart cluster's Registers --
-------------------------------------
subtype SERCOM_CTRLA_SERCOM_USART_MODE_Field is HAL.UInt3;
subtype SERCOM_CTRLA_SERCOM_USART_SAMPR_Field is HAL.UInt3;
subtype SERCOM_CTRLA_SERCOM_USART_TXPO_Field is HAL.UInt2;
subtype SERCOM_CTRLA_SERCOM_USART_RXPO_Field is HAL.UInt2;
subtype SERCOM_CTRLA_SERCOM_USART_SAMPA_Field is HAL.UInt2;
subtype SERCOM_CTRLA_SERCOM_USART_FORM_Field is HAL.UInt4;
-- USART Control A
type SERCOM_CTRLA_SERCOM_USART_Register is record
-- Software Reset
SWRST : Boolean := False;
-- Enable
ENABLE : Boolean := False;
-- Operating Mode
MODE : SERCOM_CTRLA_SERCOM_USART_MODE_Field := 16#0#;
-- unspecified
Reserved_5_6 : HAL.UInt2 := 16#0#;
-- Run during Standby
RUNSTDBY : Boolean := False;
-- Immediate Buffer Overflow Notification
IBON : Boolean := False;
-- Transmit Data Invert
TXINV : Boolean := False;
-- Receive Data Invert
RXINV : Boolean := False;
-- unspecified
Reserved_11_12 : HAL.UInt2 := 16#0#;
-- Sample
SAMPR : SERCOM_CTRLA_SERCOM_USART_SAMPR_Field := 16#0#;
-- Transmit Data Pinout
TXPO : SERCOM_CTRLA_SERCOM_USART_TXPO_Field := 16#0#;
-- unspecified
Reserved_18_19 : HAL.UInt2 := 16#0#;
-- Receive Data Pinout
RXPO : SERCOM_CTRLA_SERCOM_USART_RXPO_Field := 16#0#;
-- Sample Adjustment
SAMPA : SERCOM_CTRLA_SERCOM_USART_SAMPA_Field := 16#0#;
-- Frame Format
FORM : SERCOM_CTRLA_SERCOM_USART_FORM_Field := 16#0#;
-- Communication Mode
CMODE : Boolean := False;
-- Clock Polarity
CPOL : Boolean := False;
-- Data Order
DORD : 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 SERCOM_CTRLA_SERCOM_USART_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
MODE at 0 range 2 .. 4;
Reserved_5_6 at 0 range 5 .. 6;
RUNSTDBY at 0 range 7 .. 7;
IBON at 0 range 8 .. 8;
TXINV at 0 range 9 .. 9;
RXINV at 0 range 10 .. 10;
Reserved_11_12 at 0 range 11 .. 12;
SAMPR at 0 range 13 .. 15;
TXPO at 0 range 16 .. 17;
Reserved_18_19 at 0 range 18 .. 19;
RXPO at 0 range 20 .. 21;
SAMPA at 0 range 22 .. 23;
FORM at 0 range 24 .. 27;
CMODE at 0 range 28 .. 28;
CPOL at 0 range 29 .. 29;
DORD at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype SERCOM_CTRLB_SERCOM_USART_CHSIZE_Field is HAL.UInt3;
subtype SERCOM_CTRLB_SERCOM_USART_LINCMD_Field is HAL.UInt2;
-- USART Control B
type SERCOM_CTRLB_SERCOM_USART_Register is record
-- Character Size
CHSIZE : SERCOM_CTRLB_SERCOM_USART_CHSIZE_Field := 16#0#;
-- unspecified
Reserved_3_5 : HAL.UInt3 := 16#0#;
-- Stop Bit Mode
SBMODE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Collision Detection Enable
COLDEN : Boolean := False;
-- Start of Frame Detection Enable
SFDE : Boolean := False;
-- Encoding Format
ENC : Boolean := False;
-- unspecified
Reserved_11_12 : HAL.UInt2 := 16#0#;
-- Parity Mode
PMODE : Boolean := False;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- Transmitter Enable
TXEN : Boolean := False;
-- Receiver Enable
RXEN : Boolean := False;
-- unspecified
Reserved_18_23 : HAL.UInt6 := 16#0#;
-- Write-only. LIN Command
LINCMD : SERCOM_CTRLB_SERCOM_USART_LINCMD_Field := 16#0#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_CTRLB_SERCOM_USART_Register use record
CHSIZE at 0 range 0 .. 2;
Reserved_3_5 at 0 range 3 .. 5;
SBMODE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
COLDEN at 0 range 8 .. 8;
SFDE at 0 range 9 .. 9;
ENC at 0 range 10 .. 10;
Reserved_11_12 at 0 range 11 .. 12;
PMODE at 0 range 13 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
TXEN at 0 range 16 .. 16;
RXEN at 0 range 17 .. 17;
Reserved_18_23 at 0 range 18 .. 23;
LINCMD at 0 range 24 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype SERCOM_CTRLC_SERCOM_USART_GTIME_Field is HAL.UInt3;
subtype SERCOM_CTRLC_SERCOM_USART_BRKLEN_Field is HAL.UInt2;
subtype SERCOM_CTRLC_SERCOM_USART_HDRDLY_Field is HAL.UInt2;
subtype SERCOM_CTRLC_SERCOM_USART_MAXITER_Field is HAL.UInt3;
subtype SERCOM_CTRLC_SERCOM_USART_DATA32B_Field is HAL.UInt2;
-- USART Control C
type SERCOM_CTRLC_SERCOM_USART_Register is record
-- Guard Time
GTIME : SERCOM_CTRLC_SERCOM_USART_GTIME_Field := 16#0#;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
-- LIN Master Break Length
BRKLEN : SERCOM_CTRLC_SERCOM_USART_BRKLEN_Field := 16#0#;
-- LIN Master Header Delay
HDRDLY : SERCOM_CTRLC_SERCOM_USART_HDRDLY_Field := 16#0#;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- Inhibit Not Acknowledge
INACK : Boolean := False;
-- Disable Successive NACK
DSNACK : Boolean := False;
-- unspecified
Reserved_18_19 : HAL.UInt2 := 16#0#;
-- Maximum Iterations
MAXITER : SERCOM_CTRLC_SERCOM_USART_MAXITER_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- Data 32 Bit
DATA32B : SERCOM_CTRLC_SERCOM_USART_DATA32B_Field := 16#0#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_CTRLC_SERCOM_USART_Register use record
GTIME at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
BRKLEN at 0 range 8 .. 9;
HDRDLY at 0 range 10 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
INACK at 0 range 16 .. 16;
DSNACK at 0 range 17 .. 17;
Reserved_18_19 at 0 range 18 .. 19;
MAXITER at 0 range 20 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
DATA32B at 0 range 24 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype SERCOM_BAUD_FRAC_MODE_SERCOM_USART_BAUD_Field is HAL.UInt13;
subtype SERCOM_BAUD_FRAC_MODE_SERCOM_USART_FP_Field is HAL.UInt3;
-- USART Baud Rate
type SERCOM_BAUD_FRAC_MODE_SERCOM_USART_Register is record
-- Baud Rate Value
BAUD : SERCOM_BAUD_FRAC_MODE_SERCOM_USART_BAUD_Field := 16#0#;
-- Fractional Part
FP : SERCOM_BAUD_FRAC_MODE_SERCOM_USART_FP_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_BAUD_FRAC_MODE_SERCOM_USART_Register use record
BAUD at 0 range 0 .. 12;
FP at 0 range 13 .. 15;
end record;
subtype SERCOM_BAUD_FRACFP_MODE_SERCOM_USART_BAUD_Field is HAL.UInt13;
subtype SERCOM_BAUD_FRACFP_MODE_SERCOM_USART_FP_Field is HAL.UInt3;
-- USART Baud Rate
type SERCOM_BAUD_FRACFP_MODE_SERCOM_USART_Register is record
-- Baud Rate Value
BAUD : SERCOM_BAUD_FRACFP_MODE_SERCOM_USART_BAUD_Field := 16#0#;
-- Fractional Part
FP : SERCOM_BAUD_FRACFP_MODE_SERCOM_USART_FP_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_BAUD_FRACFP_MODE_SERCOM_USART_Register use record
BAUD at 0 range 0 .. 12;
FP at 0 range 13 .. 15;
end record;
-- USART Interrupt Enable Clear
type SERCOM_INTENCLR_SERCOM_USART_Register is record
-- Data Register Empty Interrupt Disable
DRE : Boolean := False;
-- Transmit Complete Interrupt Disable
TXC : Boolean := False;
-- Receive Complete Interrupt Disable
RXC : Boolean := False;
-- Receive Start Interrupt Disable
RXS : Boolean := False;
-- Clear To Send Input Change Interrupt Disable
CTSIC : Boolean := False;
-- Break Received Interrupt Disable
RXBRK : Boolean := False;
-- unspecified
Reserved_6_6 : HAL.Bit := 16#0#;
-- Combined Error Interrupt Disable
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTENCLR_SERCOM_USART_Register use record
DRE at 0 range 0 .. 0;
TXC at 0 range 1 .. 1;
RXC at 0 range 2 .. 2;
RXS at 0 range 3 .. 3;
CTSIC at 0 range 4 .. 4;
RXBRK at 0 range 5 .. 5;
Reserved_6_6 at 0 range 6 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- USART Interrupt Enable Set
type SERCOM_INTENSET_SERCOM_USART_Register is record
-- Data Register Empty Interrupt Enable
DRE : Boolean := False;
-- Transmit Complete Interrupt Enable
TXC : Boolean := False;
-- Receive Complete Interrupt Enable
RXC : Boolean := False;
-- Receive Start Interrupt Enable
RXS : Boolean := False;
-- Clear To Send Input Change Interrupt Enable
CTSIC : Boolean := False;
-- Break Received Interrupt Enable
RXBRK : Boolean := False;
-- unspecified
Reserved_6_6 : HAL.Bit := 16#0#;
-- Combined Error Interrupt Enable
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTENSET_SERCOM_USART_Register use record
DRE at 0 range 0 .. 0;
TXC at 0 range 1 .. 1;
RXC at 0 range 2 .. 2;
RXS at 0 range 3 .. 3;
CTSIC at 0 range 4 .. 4;
RXBRK at 0 range 5 .. 5;
Reserved_6_6 at 0 range 6 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- USART Interrupt Flag Status and Clear
type SERCOM_INTFLAG_SERCOM_USART_Register is record
-- Read-only. Data Register Empty Interrupt
DRE : Boolean := False;
-- Transmit Complete Interrupt
TXC : Boolean := False;
-- Read-only. Receive Complete Interrupt
RXC : Boolean := False;
-- Write-only. Receive Start Interrupt
RXS : Boolean := False;
-- Clear To Send Input Change Interrupt
CTSIC : Boolean := False;
-- Break Received Interrupt
RXBRK : Boolean := False;
-- unspecified
Reserved_6_6 : HAL.Bit := 16#0#;
-- Combined Error Interrupt
ERROR : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_INTFLAG_SERCOM_USART_Register use record
DRE at 0 range 0 .. 0;
TXC at 0 range 1 .. 1;
RXC at 0 range 2 .. 2;
RXS at 0 range 3 .. 3;
CTSIC at 0 range 4 .. 4;
RXBRK at 0 range 5 .. 5;
Reserved_6_6 at 0 range 6 .. 6;
ERROR at 0 range 7 .. 7;
end record;
-- USART Status
type SERCOM_STATUS_SERCOM_USART_Register is record
-- Parity Error
PERR : Boolean := False;
-- Frame Error
FERR : Boolean := False;
-- Buffer Overflow
BUFOVF : Boolean := False;
-- Read-only. Clear To Send
CTS : Boolean := False;
-- Inconsistent Sync Field
ISF : Boolean := False;
-- Collision Detected
COLL : Boolean := False;
-- Read-only. Transmitter Empty
TXE : Boolean := False;
-- Maximum Number of Repetitions Reached
ITER : Boolean := False;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_STATUS_SERCOM_USART_Register use record
PERR at 0 range 0 .. 0;
FERR at 0 range 1 .. 1;
BUFOVF at 0 range 2 .. 2;
CTS at 0 range 3 .. 3;
ISF at 0 range 4 .. 4;
COLL at 0 range 5 .. 5;
TXE at 0 range 6 .. 6;
ITER at 0 range 7 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
end record;
-- USART Synchronization Busy
type SERCOM_SYNCBUSY_SERCOM_USART_Register is record
-- Read-only. Software Reset Synchronization Busy
SWRST : Boolean;
-- Read-only. SERCOM Enable Synchronization Busy
ENABLE : Boolean;
-- Read-only. CTRLB Synchronization Busy
CTRLB : Boolean;
-- Read-only. RXERRCNT Synchronization Busy
RXERRCNT : Boolean;
-- Read-only. LENGTH Synchronization Busy
LENGTH : Boolean;
-- unspecified
Reserved_5_31 : HAL.UInt27;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SERCOM_SYNCBUSY_SERCOM_USART_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
CTRLB at 0 range 2 .. 2;
RXERRCNT at 0 range 3 .. 3;
LENGTH at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype SERCOM_LENGTH_SERCOM_USART_LEN_Field is HAL.UInt8;
subtype SERCOM_LENGTH_SERCOM_USART_LENEN_Field is HAL.UInt2;
-- USART Length
type SERCOM_LENGTH_SERCOM_USART_Register is record
-- Data Length
LEN : SERCOM_LENGTH_SERCOM_USART_LEN_Field := 16#0#;
-- Data Length Enable
LENEN : SERCOM_LENGTH_SERCOM_USART_LENEN_Field := 16#0#;
-- unspecified
Reserved_10_15 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for SERCOM_LENGTH_SERCOM_USART_Register use record
LEN at 0 range 0 .. 7;
LENEN at 0 range 8 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
end record;
-- USART Debug Control
type SERCOM_DBGCTRL_SERCOM_USART_Register is record
-- Debug Mode
DBGSTOP : Boolean := False;
-- unspecified
Reserved_1_7 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for SERCOM_DBGCTRL_SERCOM_USART_Register use record
DBGSTOP at 0 range 0 .. 0;
Reserved_1_7 at 0 range 1 .. 7;
end record;
type SercomUsart_Disc is
(Default,
Frac_Mode,
Fracfp_Mode,
Usartfp_Mode);
pragma Warnings (Off, "bits of * unused");
-- USART Mode
type SercomUsart_Cluster
(Discriminent : SercomUsart_Disc := Default)
is record
-- USART Control A
CTRLA : aliased SERCOM_CTRLA_SERCOM_USART_Register;
-- USART Control B
CTRLB : aliased SERCOM_CTRLB_SERCOM_USART_Register;
-- USART Control C
CTRLC : aliased SERCOM_CTRLC_SERCOM_USART_Register;
-- USART Receive Pulse Length
RXPL : aliased HAL.UInt8;
-- USART Interrupt Enable Clear
INTENCLR : aliased SERCOM_INTENCLR_SERCOM_USART_Register;
-- USART Interrupt Enable Set
INTENSET : aliased SERCOM_INTENSET_SERCOM_USART_Register;
-- USART Interrupt Flag Status and Clear
INTFLAG : aliased SERCOM_INTFLAG_SERCOM_USART_Register;
-- USART Status
STATUS : aliased SERCOM_STATUS_SERCOM_USART_Register;
-- USART Synchronization Busy
SYNCBUSY : aliased SERCOM_SYNCBUSY_SERCOM_USART_Register;
-- USART Receive Error Count
RXERRCNT : aliased HAL.UInt8;
-- USART Length
LENGTH : aliased SERCOM_LENGTH_SERCOM_USART_Register;
-- USART Data
DATA : aliased HAL.UInt32;
-- USART Debug Control
DBGCTRL : aliased SERCOM_DBGCTRL_SERCOM_USART_Register;
case Discriminent is
when Default =>
-- USART Baud Rate
BAUD : aliased HAL.UInt16;
when Frac_Mode =>
-- USART Baud Rate
BAUD_FRAC_MODE : aliased
SERCOM_BAUD_FRAC_MODE_SERCOM_USART_Register;
when Fracfp_Mode =>
-- USART Baud Rate
BAUD_FRACFP_MODE : aliased
SERCOM_BAUD_FRACFP_MODE_SERCOM_USART_Register;
when Usartfp_Mode =>
-- USART Baud Rate
BAUD_USARTFP_MODE : aliased HAL.UInt16;
end case;
end record
with Unchecked_Union, Size => 416;
pragma Warnings (On, "bits of * unused");
for SercomUsart_Cluster use record
CTRLA at 16#0# range 0 .. 31;
CTRLB at 16#4# range 0 .. 31;
CTRLC at 16#8# range 0 .. 31;
RXPL at 16#E# range 0 .. 7;
INTENCLR at 16#14# range 0 .. 7;
INTENSET at 16#16# range 0 .. 7;
INTFLAG at 16#18# range 0 .. 7;
STATUS at 16#1A# range 0 .. 15;
SYNCBUSY at 16#1C# range 0 .. 31;
RXERRCNT at 16#20# range 0 .. 7;
LENGTH at 16#22# range 0 .. 15;
DATA at 16#28# range 0 .. 31;
DBGCTRL at 16#30# range 0 .. 7;
BAUD at 16#C# range 0 .. 15;
BAUD_FRAC_MODE at 16#C# range 0 .. 15;
BAUD_FRACFP_MODE at 16#C# range 0 .. 15;
BAUD_USARTFP_MODE at 16#C# range 0 .. 15;
end record;
-----------------
-- Peripherals --
-----------------
type SERCOM0_Disc is
(I2Cm,
I2Cs,
Spi_Mode,
Usart_Mode);
-- Serial Communication Interface 0
type SERCOM_Internal
(Discriminent : SERCOM0_Disc := I2Cm)
is record
case Discriminent is
when I2Cm =>
-- I2C Master Mode
SERCOM_I2CM : aliased SercomI2cm_Cluster;
when I2Cs =>
-- I2C Slave Mode
SERCOM_I2CS : aliased SercomI2cs_Cluster;
when Spi_Mode =>
-- SPI Mode
SERCOM_SPI : aliased SercomSpi_Cluster;
when Usart_Mode =>
-- USART Mode
SERCOM_USART : aliased SercomUsart_Cluster;
end case;
end record
with Unchecked_Union, Volatile;
for SERCOM_Internal use record
SERCOM_I2CM at 0 range 0 .. 415;
SERCOM_I2CS at 0 range 0 .. 351;
SERCOM_SPI at 0 range 0 .. 415;
SERCOM_USART at 0 range 0 .. 415;
end record;
end SAM.SERCOM;
|
reznikmm/matreshka | Ada | 4,025 | 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.Form_Detail_Fields_Attributes;
package Matreshka.ODF_Form.Detail_Fields_Attributes is
type Form_Detail_Fields_Attribute_Node is
new Matreshka.ODF_Form.Abstract_Form_Attribute_Node
and ODF.DOM.Form_Detail_Fields_Attributes.ODF_Form_Detail_Fields_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Form_Detail_Fields_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Form_Detail_Fields_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Form.Detail_Fields_Attributes;
|
reznikmm/gela | Ada | 3,756 | ads | with Ada.Containers.Doubly_Linked_Lists;
with Ada.Containers.Hashed_Maps;
with Gela.Int;
with Gela.Int_Sets;
with Gela.Interpretations;
package Gela.Plain_Int_Sets is
pragma Preelaborate;
type Interpretation_Set (Ids : access Gela.Int_Sets.Index_Provider'Class) is
new Gela.Int_Sets.Interpretation_Set with private;
type Interpretation_Set_Access is access all Interpretation_Set'Class;
not overriding procedure Add
(Self : access Interpretation_Set;
Index : in out Gela.Interpretations.Interpretation_Set_Index;
Item : Gela.Int.Interpretation_Access);
not overriding procedure Add
(Self : access Interpretation_Set;
Index : out Gela.Interpretations.Interpretation_Index;
Item : Gela.Int.Interpretation_Access);
private
package Int_Lists is new Ada.Containers.Doubly_Linked_Lists
(Element_Type => Gela.Int.Interpretation_Access,
"=" => Gela.Int."=");
function Hash
(Value : Gela.Interpretations.Interpretation_Set_Index)
return Ada.Containers.Hash_Type;
package Int_List_Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Gela.Interpretations.Interpretation_Set_Index,
Element_Type => Int_Lists.List,
Hash => Hash,
Equivalent_Keys => Gela.Interpretations."=",
"=" => Int_Lists."=");
function Hash
(Value : Gela.Interpretations.Interpretation_Index)
return Ada.Containers.Hash_Type;
package Int_Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Gela.Interpretations.Interpretation_Index,
Element_Type => Gela.Int.Interpretation_Access,
Hash => Hash,
Equivalent_Keys => Gela.Interpretations."=",
"=" => Gela.Int."=");
type Interpretation_Set (Ids : access Gela.Int_Sets.Index_Provider'Class) is
new Gela.Int_Sets.Interpretation_Set with
record
Set_From, Set_To : Gela.Interpretations.Interpretation_Set_Index := 0;
Item_From, Item_To : Gela.Interpretations.Interpretation_Index := 0;
Map : Int_List_Maps.Map;
Int_Map : Int_Maps.Map;
end record;
overriding function Element
(Self : Interpretation_Set;
Index : Gela.Interpretations.Interpretation_Index)
return Gela.Int.Interpretation_Access;
overriding function Symbols
(Self : access Interpretation_Set;
Index : Gela.Interpretations.Interpretation_Set_Index)
return Gela.Interpretations.Symbol_Iterators
.Forward_Iterator'Class;
overriding function Categories
(Self : access Interpretation_Set;
Index : Gela.Interpretations.Interpretation_Set_Index)
return Gela.Interpretations.Category_Iterators
.Forward_Iterator'Class;
overriding function Defining_Names
(Self : access Interpretation_Set;
Index : Gela.Interpretations.Interpretation_Set_Index)
return Gela.Interpretations.Defining_Name_Iterators
.Forward_Iterator'Class;
overriding function Expressions
(Self : access Interpretation_Set;
Index : Gela.Interpretations.Interpretation_Set_Index)
return Gela.Interpretations.Expression_Iterators
.Forward_Iterator'Class;
overriding function Profiles
(Self : access Interpretation_Set;
Index : Gela.Interpretations.Interpretation_Set_Index)
return Gela.Interpretations.Profile_Iterators
.Forward_Iterator'Class;
overriding function Each
(Self : access Interpretation_Set;
Index : Gela.Interpretations.Interpretation_Set_Index)
return Gela.Interpretations.Any_Iterators
.Forward_Iterator'Class;
end Gela.Plain_Int_Sets;
|
AdaCore/gpr | Ada | 83,909 | adb | --
-- Copyright (C) 2014-2022, AdaCore
-- SPDX-License-Identifier: Apache-2.0
--
with Ada.Containers.Generic_Array_Sort;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Wide_Wide_Unbounded; use Ada.Strings.Wide_Wide_Unbounded;
with Ada.Text_IO; use Ada.Text_IO;
with System.Address_Image;
with System.Assertions;
with Gpr_Parser_Support.Errors; use Gpr_Parser_Support.Errors;
with Gpr_Parser_Support.Images; use Gpr_Parser_Support.Images;
package body Gpr_Parser_Support.Lexical_Envs_Impl is
procedure Invalidate_Cache (Env : Lexical_Env_Access);
procedure Initialize_Foreign_Nodes (El : in out Internal_Map_Element)
with Inline_Always;
-- Initialize foreign nodes map in ``El``
function Image (E : Entity) return String
is
(Image (Node_Text_Image (E.Node, False)));
function Entity_Vectors_Image is new Entity_Vectors.Image (Image);
No_Entity_Info : constant Entity_Info := (Empty_Metadata, null, False);
function Is_Lookup_Cache_Valid (Self : Lexical_Env) return Boolean
with Pre => Self.Kind = Static_Primary;
-- Return whether Env's lookup cache is valid. This will check every
-- Lookup_Cache_Valid flag up Env's parent chain.
function Wrap
(Env : Lexical_Env_Access;
Owner : Generic_Unit_Ptr := No_Generic_Unit) return Lexical_Env
is
((Env => Wrap (Env),
Hash => Hash (Env),
Kind => (if Env = null then Static_Primary else Env.Kind),
Owner => Owner,
Version => (if Owner /= No_Generic_Unit
then Get_Unit_Version (Owner) else 0)));
function OK_For_Rebindings (Self : Lexical_Env) return Boolean is
(Self.Kind in Primary_Kind and then Env_Node (Self) /= No_Node);
function Extract_Rebinding
(Rebindings : in out Env_Rebindings;
Rebound_Env : Lexical_Env;
Found : out Boolean) return Lexical_Env;
-- Look for a pair in Rebindings whose Old_Env field is "Rebound_Env".
--
-- If there is one, return the env it is associated to, and put the
-- remaining set of rebindings in rebindings. Otherwise, return
-- "Rebound_Env".
--
-- If Rebindings is bound to a new set of rebindings upon return, the
-- ownership share of the old rebinding set will have been forfeited.
function Shed_Rebindings
(From_Env : Lexical_Env;
Rebindings : Env_Rebindings) return Env_Rebindings
with Inline;
-- Shed env rebindings that are not in the parent chain for From_Env
procedure Check_Rebindings_Uniqueness (Self : Env_Rebindings);
-- Perform a uniqueness check on the various rebindings in Self. In
-- particular, check that there are no two identical Old_Env and no two
-- identical New_Env in the set of rebindings. If there are, raise a
-- property error.
procedure Get_Internal_Impl
(Self : Lexical_Env;
Key : Symbol_Type;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Rebindings : Env_Rebindings := null;
Metadata : Node_Metadata := Empty_Metadata;
Categories : Ref_Categories;
Local_Results : in out Lookup_Result_Vector;
Toplevel : Boolean := True;
Recursive_Check_Reached : in out Boolean);
-- This is the real Env.Get implementation.
--
-- ``Toplevel`` is used to discriminate between the toplevel call and
-- further calls, for the ``Toplevel_Only`` cache mode.
--
-- ``Recursive_Check_Reached`` is an helper variable passed down to
-- recursive calls, to down propagate to parent calls when the recursion
-- protection is activated, i.e. when an lexical environment is visited a
-- second time in a recursive call. When this recursive check is reached,
-- all intermediate calls won't be cached because the origin of the request
-- has potentially changed the results. See the Ada example below::
--
-- package R is
-- package N is
-- type O is ...;
-- -- <- Original env request on "O" from here
-- end N;
-- -- <- When exploring parents, env_get will get here. The cache
-- -- is empty.
-- use N;
-- -- <- When traversing the "use", since the request originates
-- -- from `N`, the recursion protection will stop it's
-- -- re-traversal
-- -- <- If we cache, we'll cache a wrong result for the request
-- -- `R_env.get("O")`, when the request starts from `R`'s env
-- end R;
procedure Get_Internal
(Self : Lexical_Env;
Key : Symbol_Type;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Rebindings : Env_Rebindings := null;
Metadata : Node_Metadata := Empty_Metadata;
Categories : Ref_Categories;
Local_Results : in out Lookup_Result_Vector);
-- This is the ``Get_Internal_Impl`` wrapper. It is used to forward default
-- values to some internal parameters used by ``Get_Internal_Impl``. We're
-- not using a nested function for ``Get_Internal_Impl`` because the level
-- of nesting is bad enough already.
--
-- ``Local_Results`` is the vector in which results will be accumulated by
-- the recursive calls.
--
-- TODO: It might be exactly the same to return Local_Result rather than
-- make it an in out param, now that we have a wrapper.
procedure Reset_Lookup_Cache (Self : Lexical_Env);
-- Reset Self's lexical environment lookup cache
----------------
-- Text_Image --
----------------
function Text_Image (Cats : Ref_Categories) return Text_Type is
Ret : Unbounded_Text_Type;
begin
Append (Ret, "(");
for Cat in Ref_Category'Range loop
Append (Ret, To_Text (Cat'Image & " => " & Cats (Cat)'Image & ", "));
end loop;
Append (Ret, ")");
return To_Text (Ret);
end Text_Image;
---------------------------
-- Is_Lookup_Cache_Valid --
---------------------------
function Is_Lookup_Cache_Valid (Self : Lexical_Env) return Boolean is
P : Lexical_Env;
begin
if Unwrap (Self).Lookup_Cache_Valid then
P := Parent (Self);
return (P in Null_Lexical_Env | Empty_Env
or else Is_Lookup_Cache_Valid (P));
else
return False;
end if;
end Is_Lookup_Cache_Valid;
------------------------
-- Reset_Lookup_Cache --
------------------------
procedure Reset_Lookup_Cache (Self : Lexical_Env) is
Env : constant Lexical_Env_Access := Unwrap (Self);
begin
for C of Env.Lookup_Cache loop
C.Elements.Destroy;
end loop;
Env.Lookup_Cache.Clear;
Env.Lookup_Cache_Valid := True;
end Reset_Lookup_Cache;
-----------------------
-- Simple_Env_Getter --
-----------------------
function Simple_Env_Getter (E : Lexical_Env) return Env_Getter is
begin
Inc_Ref (E);
return Env_Getter'(Dynamic => False,
Env => E);
end Simple_Env_Getter;
--------------------
-- Dyn_Env_Getter --
--------------------
function Dyn_Env_Getter
(Resolver : Lexical_Env_Resolver; Node : Node_Type) return Env_Getter is
begin
return Env_Getter'(True, Null_Lexical_Env, Node, Resolver);
end Dyn_Env_Getter;
-------------
-- Resolve --
-------------
procedure Resolve (Self : in out Env_Getter; Info : Entity_Info) is
Env : Lexical_Env;
begin
case Self.Dynamic is
when True =>
Env := Get_Env (Self, Info);
-- Get_Env returns an ownership share for the returned reference,
-- but we don't use it here, so dec ref.
Dec_Ref (Env);
when False =>
null;
end case;
exception
when Exc : others =>
-- Resolution failed. If ``Exc`` is an exception that properties are
-- allowed to raise, there is nothing else to do as ``Get_Env`` took
-- care of invalidating the cache.
--
-- Note that in that case there is no need to propagate the error, as
-- the job of this procedure is just to do precomputation for
-- ``Get_Env``. The next call to ``Get_Env`` will propagate this
-- error, so all is fine.
if not Properties_May_Raise (Exc) then
raise;
end if;
end Resolve;
-------------
-- Get_Env --
-------------
function Get_Env (Self : in out Env_Getter;
Info : Entity_Info) return Lexical_Env
is
Cache_Enabled : constant Boolean := Info = No_Entity_Info;
-- The cache (Self.Env) can be used only if No_Entity_Info is passed
-- Note: in this whole function, we take special care for empty
-- environments: while these are represented using the ``Empty_Env``
-- constant through the whole codebase, here rules are slightly twisted
-- for performance and appropriate cache invalidation (see documentation
-- for the ``Env_Getter.Env`` field).
--
-- The bottom line is: cached empty environments differ from the
-- ``Empty_Env`` constant: the ``Version`` component is not 0 and is
-- used to determine if the cached empty environment is stale (see
-- ``Is_Stale``), and we must not returned these "twisted" empty
-- environments to ``Get_Env``'s caller, but rather return the
-- ``Empty_Env`` constant instead (the version hack shall not go to the
-- outside world).
function Is_Stale (Env : Lexical_Env) return Boolean
with Pre => Self.Dynamic;
-- Return whether the ``Env`` cached environment refers to an obsolete.
-- ``Node`` is the node used to compute it.
--------------
-- Is_Stale --
--------------
function Is_Stale (Env : Lexical_Env) return Boolean is
E : constant Lexical_Env_Access := Unwrap (Env);
L : Lexical_Env;
begin
-- Take care of the special case of empty environments, which may
-- differ from ``Empty_Env`` in ``Env.Version`` (see above).
if Env.Env = Empty_Env.Env then
return Env.Version < Get_Context_Version (Self.Node);
end if;
case Env.Kind is
when Primary_Kind =>
if Env.Owner /= No_Generic_Unit then
-- If there is an owner, check that the unit version has not
-- been incremented since then.
return Get_Unit_Version (Env.Owner) > Env.Version;
end if;
for I in E.Referenced_Envs.First_Index
.. E.Referenced_Envs.Last_Index
loop
L := Get_Env
(E.Referenced_Envs.Get_Access (I).Getter, No_Entity_Info);
if Is_Stale (L) then
return True;
end if;
Dec_Ref (L);
end loop;
return False;
when Orphaned =>
pragma Assert (Env.Owner = No_Generic_Unit);
return Is_Stale (E.Orphaned_Env);
when Grouped =>
pragma Assert (Env.Owner = No_Generic_Unit);
return (for some GE of E.Grouped_Envs.all => Is_Stale (GE));
when Rebound =>
-- This env is stale as soon as either the rebound env or the
-- rebindings are stale.
return Is_Stale (E.Rebound_Env)
or else E.Rebindings.Version /= E.Rebindings_Version;
end case;
end Is_Stale;
begin
if Self.Dynamic then
-- Resolve the dynamic lexical env getter. For this, use the cache if
-- possible.
if Cache_Enabled and then Self.Env /= Null_Lexical_Env then
-- If it is not stale, return it. Make sure to return genuine
-- ``Empty_Env`` copies for empty environments.
if not Is_Stale (Self.Env) then
if Self.Env.Env = Empty_Env.Env then
return Empty_Env;
else
Inc_Ref (Self.Env);
return Self.Env;
end if;
end if;
-- If it is stale, release and clear it
Dec_Ref (Self.Env);
end if;
-- For some reason we could not use the cache: do the resolution and
-- cache its result if applicable.
declare
E : constant Entity := (Node => Self.Node, Info => Info);
Result : constant Lexical_Env := Self.Resolver.all (E);
begin
if Cache_Enabled then
-- Since the call to Self.Resolver above may have invoked
-- Get_Env on the same Env_Getter object (Self), we need to be
-- re-entrant. This means that though called Dec_Ref on
-- Self.Env above, once we got here, Self.Env may have another
-- value: we need to remove its ownership share before
-- overriding below.
Dec_Ref (Self.Env);
-- The ownership share returned by the resolver goes to the
-- cache: the call to Inc_Ref below will create a new one for
-- the returned value.
Self.Env := Result;
-- Don't forget to record the context version for caches in the
-- case of Empty_Env (see Env_Getter.Env and the cache hit code
-- above).
if Self.Env.Env = Empty_Env.Env then
Self.Env.Version := Get_Context_Version (Self.Node);
end if;
else
return Result;
end if;
end;
end if;
-- Return a copy of the cached resolved lexical env, so create a new
-- ownership share.
Inc_Ref (Self.Env);
return Self.Env;
end Get_Env;
----------------
-- Equivalent --
----------------
function Equivalent (L, R : Env_Getter) return Boolean is
begin
if L.Dynamic or else R.Dynamic then
raise Constraint_Error with "trying to compare dynamic env getters";
else
return L.Env = R.Env;
end if;
end Equivalent;
-------------
-- Inc_Ref --
-------------
procedure Inc_Ref (Self : Env_Getter) is
begin
Inc_Ref (Self.Env);
end Inc_Ref;
-------------
-- Dec_Ref --
-------------
procedure Dec_Ref (Self : in out Env_Getter) is
begin
Dec_Ref (Self.Env);
end Dec_Ref;
-------------
-- Combine --
-------------
function Combine (L, R : Env_Rebindings) return Env_Rebindings is
function Append_All (Cur : Env_Rebindings) return Env_Rebindings;
-- Given Cur = C1 -> C2 .. -> Cn, return C1 -> C2 .. -> Cn -> L
----------------
-- Append_All --
----------------
function Append_All (Cur : Env_Rebindings) return Env_Rebindings is
begin
if Cur = null then
return L;
end if;
return Append (Append_All (Cur.Parent), Cur.Old_Env, Cur.New_Env);
end Append_All;
begin
if L = null then
return R;
elsif R = null then
return L;
end if;
return Result : constant Env_Rebindings := Append_All (R) do
Check_Rebindings_Uniqueness (Result);
end return;
end Combine;
------------
-- Append --
------------
function Append
(Self : Env_Rebindings;
Old_Env, New_Env : Lexical_Env) return Env_Rebindings
is
O : constant Lexical_Env_Access := Unwrap (Old_Env);
begin
-- Look for an existing rebinding for the result: in the Old_Env's pool
-- if there is no parent, otherwise in the parent's children.
if Self = null then
if O.Rebindings_Pool /= null then
declare
use Env_Rebindings_Pools;
Cur : constant Cursor := O.Rebindings_Pool.Find (New_Env);
begin
if Cur /= Env_Rebindings_Pools.No_Element then
return Element (Cur);
end if;
end;
end if;
else
for C of Self.Children loop
if C.Old_Env = Old_Env and then C.New_Env = New_Env then
return C;
end if;
end loop;
end if;
-- No luck? then create a new rebinding and register it where required
declare
Result : constant Env_Rebindings := Acquire_Rebinding
(Env_Node (Old_Env), Self, Old_Env, New_Env);
begin
if Self /= null then
Self.Children.Append (Result);
else
if O.Rebindings_Pool = null then
O.Rebindings_Pool := new Env_Rebindings_Pools.Map;
end if;
O.Rebindings_Pool.Insert (New_Env, Result);
end if;
Register_Rebinding (Env_Node (Old_Env), Result);
Register_Rebinding (Env_Node (New_Env), Result);
Check_Rebindings_Uniqueness (Result);
return Result;
end;
end Append;
----------------------
-- Append_Rebinding --
----------------------
function Append_Rebinding
(Self : Env_Rebindings;
Old_Env : Lexical_Env;
New_Env : Lexical_Env) return Env_Rebindings is
begin
if not Is_Rebindable (Env_Node (Old_Env)) then
raise Property_Error with "Illegal lexical environment rebinding";
end if;
return Append (Self, Old_Env, New_Env);
end Append_Rebinding;
-------------------
-- Create_Entity --
-------------------
function Create_Entity (Node : Node_Type; Md : Node_Metadata) return Entity
is
begin
return Entity'
(Node => Node,
Info => (Md => Md, Rebindings => null, From_Rebound => False));
end Create_Entity;
----------------
-- Equivalent --
----------------
function Equivalent (L, R : Entity_Info) return Boolean is
begin
return L.Md = R.Md and then L.Rebindings = R.Rebindings;
end Equivalent;
----------------
-- Equivalent --
----------------
function Equivalent (L, R : Entity) return Boolean is
begin
if L.Node /= R.Node then
return False;
end if;
-- All null nodes are equals, regardless of their entity info
if L.Node = No_Node then
return True;
end if;
-- For all other cases, make sure the entity info is equivalent
return Equivalent (L.Info, R.Info);
end Equivalent;
------------------------
-- Create_Lexical_Env --
------------------------
function Create_Lexical_Env
(Parent : Lexical_Env;
Node : Node_Type;
Transitive_Parent : Boolean := False;
Owner : Generic_Unit_Ptr) return Lexical_Env is
begin
if Parent /= Null_Lexical_Env then
Inc_Ref (Parent);
end if;
return Wrap
(new Lexical_Env_Record'
(Kind => Static_Primary,
Parent => Parent,
Transitive_Parent => Transitive_Parent,
Node => Node,
Referenced_Envs => <>,
Map => new Internal_Envs.Map,
Rebindings_Pool => null,
Lookup_Cache_Valid => True,
Lookup_Cache => Lookup_Cache_Maps.Empty_Map,
Rebindings_Assoc_Ref_Env => -1),
Owner => Owner);
end Create_Lexical_Env;
--------------------------------
-- Create_Dynamic_Lexical_Env --
--------------------------------
function Create_Dynamic_Lexical_Env
(Parent : Lexical_Env;
Node : Node_Type;
Transitive_Parent : Boolean := False;
Owner : Generic_Unit_Ptr;
Assocs_Getter : Inner_Env_Assocs_Resolver;
Assoc_Resolver : Entity_Resolver := null) return Lexical_Env is
begin
if Parent /= Null_Lexical_Env then
Inc_Ref (Parent);
end if;
return Wrap
(new Lexical_Env_Record'
(Kind => Dynamic_Primary,
Parent => Parent,
Transitive_Parent => Transitive_Parent,
Node => Node,
Rebindings_Pool => null,
Assocs_Getter => Assocs_Getter,
Assoc_Resolver => Assoc_Resolver),
Owner => Owner);
end Create_Dynamic_Lexical_Env;
------------------------------
-- Initialize_Foreign_Nodes --
------------------------------
procedure Initialize_Foreign_Nodes (El : in out Internal_Map_Element) is
begin
if El.Foreign_Nodes = null then
El.Foreign_Nodes := new Internal_Map_Node_Maps.Map;
end if;
end Initialize_Foreign_Nodes;
---------
-- Add --
---------
procedure Add
(Self : Lexical_Env;
Key : Symbol_Type;
Value : Node_Type;
Md : Node_Metadata := Empty_Metadata;
Resolver : Entity_Resolver := null)
is
use Internal_Envs;
Env : constant Lexical_Env_Access := Unwrap (Self);
Node : constant Internal_Map_Node := (Value, Md, Resolver);
C : Cursor;
Dummy : Boolean;
Map : Internal_Envs.Map renames Env.Map.all;
begin
-- See Empty_Env's documentation
if Self = Empty_Env then
return;
end if;
Me.Trace
("ADDING VAL key=""" & Image (Key) & """, env=" & Env_Image (Self));
-- Invalidate the cache, and make sure we have an entry in the internal
-- map for the given key.
Invalidate_Cache (Env);
Map.Insert (Key, Empty_Internal_Map_Element, C, Dummy);
declare
E : Internal_Map_Element renames Reference (Map, C).Element.all;
begin
-- If Self and Value belong to the same analysis unit, consider Node
-- as native. In all other cases, it's a foreign node.
if Is_Foreign (Self, Value) then
Initialize_Foreign_Nodes (E);
E.Foreign_Nodes.Insert (Node.Node, Node);
else
E.Native_Nodes.Append (Node);
end if;
end;
end Add;
------------
-- Remove --
------------
procedure Remove (Self : Lexical_Env; Key : Symbol_Type; Value : Node_Type)
is
Env : constant Lexical_Env_Access := Unwrap (Self);
begin
if Self = Empty_Env then
return;
end if;
declare
Ref : constant Internal_Envs.Reference_Type :=
Env.Map.Reference (Key);
V : Internal_Map_Node_Vectors.Vector renames Ref.Native_Nodes;
begin
if Is_Foreign (Self, Value) then
Ref.Foreign_Nodes.Delete (Value);
else
-- Get rid of the element. Do this in reverse order so that
-- removing one element does not make us "step over" the next
-- item. Also don't do this in place (using V.Pop) as we need to
-- preserve the order of elements.
for I in reverse 1 .. V.Length loop
if V.Get (I).Node = Value then
V.Remove_At (I);
exit;
end if;
end loop;
end if;
Invalidate_Cache (Env);
end;
end Remove;
---------------
-- Reference --
---------------
procedure Reference
(Self : Lexical_Env;
Referenced_From : Node_Type;
Resolver : Lexical_Env_Resolver;
Kind : Ref_Kind := Normal;
Categories : Ref_Categories := All_Cats;
Rebindings_Assoc : Boolean := False)
is
Env : constant Lexical_Env_Access := Unwrap (Self);
Refd_Env : Referenced_Env :=
(Kind,
Dyn_Env_Getter (Resolver, Referenced_From),
False, Inactive, Categories);
begin
if Self = Empty_Env then
return;
end if;
if Has_Trace then
Rec.Trace ("REFERENCE " & Env_Image (Self));
end if;
Resolve (Refd_Env.Getter, No_Entity_Info);
Refd_Env.State := Active;
Referenced_Envs_Vectors.Append (Env.Referenced_Envs, Refd_Env);
if Rebindings_Assoc then
if Env.Rebindings_Assoc_Ref_Env /= -1 then
raise Property_Error with
"Env already has a rebindings associated reference env";
end if;
Env.Rebindings_Assoc_Ref_Env := Env.Referenced_Envs.Last_Index;
end if;
Invalidate_Cache (Env);
end Reference;
---------------
-- Reference --
---------------
procedure Reference
(Self : Lexical_Env;
To_Reference : Lexical_Env;
Kind : Ref_Kind := Normal;
Categories : Ref_Categories := All_Cats;
Rebindings_Assoc : Boolean := False)
is
Env : constant Lexical_Env_Access := Unwrap (Self);
Ref : constant Referenced_Env :=
(Kind, Simple_Env_Getter (To_Reference), False, Active, Categories);
begin
if Has_Trace then
Rec.Trace ("REFERENCE" & Env_Image (Self));
end if;
if Self = Empty_Env then
return;
end if;
Referenced_Envs_Vectors.Append (Env.Referenced_Envs, Ref);
if Rebindings_Assoc then
Env.Rebindings_Assoc_Ref_Env := Env.Referenced_Envs.Last_Index;
end if;
Invalidate_Cache (Env);
end Reference;
------------------
-- Get_Internal --
------------------
procedure Get_Internal
(Self : Lexical_Env;
Key : Symbol_Type;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Rebindings : Env_Rebindings := null;
Metadata : Node_Metadata := Empty_Metadata;
Categories : Ref_Categories;
Local_Results : in out Lookup_Result_Vector)
is
Dummy : Boolean := False;
begin
Get_Internal_Impl
(Self, Key, Lookup_Kind, Rebindings,
Metadata, Categories, Local_Results,
Toplevel => True,
Recursive_Check_Reached => Dummy);
end Get_Internal;
-----------------------
-- Get_Internal_Impl --
-----------------------
procedure Get_Internal_Impl
(Self : Lexical_Env;
Key : Symbol_Type;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Rebindings : Env_Rebindings := null;
Metadata : Node_Metadata := Empty_Metadata;
Categories : Ref_Categories;
Local_Results : in out Lookup_Result_Vector;
Toplevel : Boolean := True;
Recursive_Check_Reached : in out Boolean)
is
function Do_Cache return Boolean
is
(Has_Lookup_Cache (Self)
and then
(Lookup_Cache_Mode = Full
or else (Lookup_Cache_Mode = Toplevel_Only and then Toplevel)));
-- Return whether to cache a particular request or not
function Log_Id return String is
("env=" & Env_Image (Self) & ", key=" & Image (Key.all));
Env : constant Lexical_Env_Access := Unwrap (Self);
Outer_Results : Lookup_Result_Vector :=
Lookup_Result_Item_Vectors.Empty_Vector;
Need_Cache : Boolean := False;
Current_Rebindings : Env_Rebindings;
procedure Get_Refd_Nodes (Self : in out Referenced_Env);
procedure Append_Result
(Node : Internal_Map_Node;
Md : Node_Metadata;
Rebindings : Env_Rebindings;
From_Rebound : Boolean := False);
-- Add E to results, if it passes the Can_Reach filter. Return whether
-- result was appended or not.
use Internal_Envs;
procedure Append_All_Nodes
(Self : Lexical_Env; From_Rebound : Boolean);
-- Add all nodes of the given Env to the results. Make sure the output
-- is deterministic using a sorting procedure.
function Get_Nodes
(Self : Lexical_Env; From_Rebound : Boolean := False) return Boolean;
-- Lookup for matching nodes in Env's internal map and append them to
-- Local_Results. Return whether we found some.
procedure Recurse
(Self : Lexical_Env;
Key : Symbol_Type;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Rebindings : Env_Rebindings := null;
Metadata : Node_Metadata := Empty_Metadata;
Categories : Ref_Categories;
Local_Results : in out Lookup_Result_Vector);
-- Helper procedure for all env lookup recursions, so that the Toplevel
-- argument is automatically passed to False for recursive calls, and
-- ``Recursive_Check_Reached`` is automatically passed down the call
-- chain.
--
-- NOTE: Every recursive call to ``Get_Internal_Impl`` should go through
-- this helper.
-------------
-- Recurse --
-------------
procedure Recurse
(Self : Lexical_Env;
Key : Symbol_Type;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Rebindings : Env_Rebindings := null;
Metadata : Node_Metadata := Empty_Metadata;
Categories : Ref_Categories;
Local_Results : in out Lookup_Result_Vector)
is
begin
Get_Internal_Impl
(Self, Key, Lookup_Kind, Rebindings, Metadata,
Categories, Local_Results,
Toplevel => False,
Recursive_Check_Reached => Recursive_Check_Reached);
end Recurse;
----------------------
-- Append_All_Nodes --
----------------------
procedure Append_All_Nodes
(Self : Lexical_Env; From_Rebound : Boolean)
is
Env : constant Lexical_Env_Access := Unwrap (Self);
type Cursor_Array is array
(Natural range <>) of Internal_Envs.Cursor;
function "<" (A, B : Internal_Envs.Cursor) return Boolean is
(Internal_Envs.Key (A).all < Internal_Envs.Key (B).all);
procedure Cursor_Array_Sort is new Ada.Containers.Generic_Array_Sort
(Index_Type => Natural,
Element_Type => Internal_Envs.Cursor,
Array_Type => Cursor_Array);
All_Elements : Cursor_Array (1 .. Natural (Env.Map.Length));
I : Positive := All_Elements'First;
begin
for C in Env.Map.Iterate loop
All_Elements (I) := C;
I := I + 1;
end loop;
Cursor_Array_Sort (All_Elements);
for C of All_Elements loop
declare
I_Nodes : constant Internal_Map_Node_Vectors.Vector :=
Internal_Envs.Element (C).Native_Nodes;
F_Nodes : constant Internal_Map_Node_Map :=
Internal_Envs.Element (C).Foreign_Nodes;
begin
-- Append internal nodes
for I in reverse I_Nodes.First_Index .. I_Nodes.Last_Index loop
Append_Result
(I_Nodes.Get (I), Metadata, Current_Rebindings,
From_Rebound);
end loop;
-- Append foreign nodes
if F_Nodes /= null then
for C in F_Nodes.Iterate loop
Append_Result
(Internal_Map_Node_Maps.Element (C),
Metadata, Current_Rebindings,
From_Rebound);
end loop;
end if;
end;
end loop;
end Append_All_Nodes;
---------------
-- Get_Nodes --
---------------
function Get_Nodes
(Self : Lexical_Env; From_Rebound : Boolean := False) return Boolean
is
Env : constant Lexical_Env_Access := Unwrap (Self);
Map : Internal_Map;
C : Cursor;
begin
if Self.Kind = Static_Primary then
Map := Env.Map;
C := Internal_Envs.No_Element;
if Env.Map /= null then
-- If Key is null, we want to get every entity stored in the
-- map regardless of the symbol.
if Key = null then
Append_All_Nodes (Self, From_Rebound);
return True;
end if;
-- Else, find the elements in the map corresponding to Key
C := Map.Find (Key);
end if;
if Has_Element (C) then
declare
E : Internal_Map_Element renames Reference (Map.all, C);
begin
-- First add nodes that belong to the same environment as
-- Self. Add them in reverse order, so that last inserted
-- results are returned first.
for I in reverse 1 .. E.Native_Nodes.Last_Index loop
Append_Result
(E.Native_Nodes.Get (I),
Metadata, Current_Rebindings, From_Rebound);
end loop;
-- Then add foreign nodes: just iterate on the ordered map
if E.Foreign_Nodes /= null then
for Pos in E.Foreign_Nodes.Iterate loop
Append_Result
(Internal_Map_Node_Maps.Element (Pos),
Metadata, Current_Rebindings, From_Rebound);
end loop;
end if;
end;
return True;
end if;
else
pragma Assert (Self.Kind = Dynamic_Primary);
declare
-- Query the dynamic list of associations for this env
Assocs : Inner_Env_Assoc_Array :=
Env.Assocs_Getter.all ((Env.Node, No_Entity_Info));
A : Inner_Env_Assoc;
begin
for I in 1 .. Length (Assocs) loop
-- For each individual assoc: add it if Key is null, or only
-- assocs with matching symbols.
A := Get (Assocs, I);
if Key = null or else Key = Get_Key (A) then
declare
IMN : constant Internal_Map_Node :=
(Get_Node (A), Get_Metadata (A), Env.Assoc_Resolver);
begin
Append_Result
(IMN, Metadata, Current_Rebindings, From_Rebound);
end;
end if;
end loop;
Dec_Ref (Assocs);
end;
end if;
return False;
end Get_Nodes;
-------------------
-- Append_Result --
-------------------
procedure Append_Result
(Node : Internal_Map_Node;
Md : Node_Metadata;
Rebindings : Env_Rebindings;
From_Rebound : Boolean := False)
is
E : constant Entity :=
(Node => Node.Node,
Info => (Md => Combine (Node.Md, Md),
Rebindings => Rebindings,
From_Rebound => From_Rebound));
begin
if Has_Trace then
Rec.Trace
("Found " & Image (Node_Text_Image (E.Node, False))
& " from_rebound => " & From_Rebound'Img);
end if;
declare
Resolved_Entity : Entity :=
(if Node.Resolver = null
then E
else Node.Resolver.all (E));
begin
-- Silently discard null resolved nodes: we tolerate them as they
-- likely come from semantic analysis routines running on invalid
-- code.
if Resolved_Entity.Node = No_Node then
return;
end if;
Resolved_Entity.Info.From_Rebound := From_Rebound;
Local_Results.Append
(Lookup_Result_Item'
(E => Resolved_Entity,
Filter_From => Node.Resolver = null,
Override_Filter_Node => No_Node));
end;
end Append_Result;
--------------------
-- Get_Refd_Nodes --
--------------------
procedure Get_Refd_Nodes (Self : in out Referenced_Env) is
Env : Lexical_Env := Empty_Env;
-- Make sure this holds a valid environment at all times so that the
-- exception handler below can always call Dec_Ref on it.
begin
-- Don't follow the referenced environment if either:
-- * the node from which this reference starts cannot reach From;
-- * the node that created this environment reference is a parent of
-- From.
if (Lookup_Kind /= Recursive and then Self.Kind /= Transitive)
or else Self.Being_Visited
or else Self.State = Inactive
then
-- We reached a loop in the env graph, propagate the information
-- back to callers.
Recursive_Check_Reached := True;
return;
end if;
if Self.Categories /= All_Cats
and then Categories /= All_Cats
and then not (for some C
of Ref_Categories'(Categories and Self.Categories)
=> C)
then
return;
end if;
Self.Being_Visited := True;
-- Get the env for the referenced env getter. Pass the metadata and
-- the relevant rebindings.
Env := Get_Env
(Self.Getter, Entity_Info'(Metadata, Rebindings, False));
-- TODO: Do not create a temp vector here, rather keep track of prior
-- size, and only modify appended elements if the getter is dynamic.
declare
Refd_Results : Lookup_Result_Vector;
begin
Recurse
(Env, Key,
Lookup_Kind =>
(if Lookup_Kind = Recursive and then Self.Kind = Transitive
then Recursive
elsif Lookup_Kind = Minimal
then raise System.Assertions.Assert_Failure
with "Should not happen"
else Flat),
-- We do not force the propagation of rebindings here:
-- the call to ``Get_Env`` above also receives them, and
-- therefore can decide itself how they should be propagated
-- by returning a Rebound_Env. If it doesn't return a
-- Rebound_Env, we propagate them normally.
Rebindings =>
(if Env.Kind in Rebound
then null
else Shed_Rebindings (Env, Current_Rebindings)),
Metadata => Metadata,
Categories => Categories,
Local_Results => Refd_Results);
if Self.Getter.Dynamic then
for Res of Refd_Results loop
declare
New_Res : Lookup_Result_Item := Res;
begin
New_Res.Override_Filter_Node := Self.Getter.Node;
Local_Results.Append (New_Res);
end;
end loop;
else
Local_Results.Concat (Refd_Results);
end if;
Refd_Results.Destroy;
end;
Self.Being_Visited := False;
Dec_Ref (Env);
exception
when others =>
-- Make sure that we always Dec_Ref the returned environment so we
-- don't leak in case of error.
Dec_Ref (Env);
Self.Being_Visited := False;
raise;
end Get_Refd_Nodes;
Extracted : Lexical_Env;
Res_Key : constant Lookup_Cache_Key :=
(Key, Rebindings, Metadata, Categories);
Cached_Res_Cursor : Lookup_Cache_Maps.Cursor;
Res_Val : Lookup_Cache_Entry;
Inserted, Dummy : Boolean;
use Lookup_Cache_Maps;
Found_Rebinding : Boolean := False;
begin
if Self in Empty_Env then
return;
end if;
if Has_Trace then
Rec.Trace
("GET_INTERNAL "
& Log_Id
& " lookup kind = " & Lookup_Kind_Type'Image (Lookup_Kind));
end if;
case Self.Kind is
when Orphaned =>
Recurse
(Env.Orphaned_Env, Key, Flat, Rebindings, Metadata,
Categories, Local_Results);
return;
when Grouped =>
-- Just concatenate lookups for all grouped environments
if Has_Trace then
Rec.Increase_Indent;
end if;
declare
Md : constant Node_Metadata :=
Combine (Env.Default_Md, Metadata);
begin
for E of Env.Grouped_Envs.all loop
Recurse (E, Key, Lookup_Kind, Rebindings, Md,
Categories, Local_Results);
end loop;
end;
if Has_Trace then
Rec.Decrease_Indent;
end if;
return;
when Rebound =>
Recurse
(Env.Rebound_Env, Key, Lookup_Kind,
Combine (Env.Rebindings, Rebindings),
Metadata, Categories, Local_Results);
return;
when Primary_Kind =>
-- Handled below to avoid extra nesting levels
null;
end case;
-- At this point, we know that Self is a primary lexical environment
if Do_Cache
and then Lookup_Kind = Recursive
then
if not Is_Lookup_Cache_Valid (Self) then
Reset_Lookup_Cache (Self);
end if;
declare
Val : constant Lookup_Cache_Entry :=
(Computing, Empty_Lookup_Result_Vector);
begin
Env.Lookup_Cache.Insert
(Res_Key, Val, Cached_Res_Cursor, Inserted);
end;
if Inserted then
Need_Cache := True;
Outer_Results := Local_Results;
Local_Results := Lookup_Result_Item_Vectors.Empty_Vector;
else
Res_Val := Element (Cached_Res_Cursor);
if Has_Trace then
Caches_Trace.Trace
("CACHE ENTRY " & Log_Id & ": "
& Lookup_Cache_Entry_State'Image (Res_Val.State));
end if;
case Res_Val.State is
when Computing =>
-- When the cache state is "Computing", it means that we're
-- doing a given env request inside the same env request.
-- This is a thing that legitimately happens in some cases,
-- and in this case you need to return the correct results,
-- not using the cache mechanism at all. So we just bail out
-- of the caching setup, and this will behave like a no
-- cache request.
null;
when Computed =>
Local_Results.Concat (Res_Val.Elements);
return;
when None =>
Need_Cache := True;
Outer_Results := Local_Results;
Local_Results := Lookup_Result_Item_Vectors.Empty_Vector;
end case;
end if;
end if;
-- If there is an environment corresponding to Self in env rebindings,
-- we'll get it here. We'll also shed it from the set of current
-- rebindings.
Current_Rebindings := Rebindings;
-- Phase 1: Get nodes in own env if there are any
Extracted :=
Extract_Rebinding (Current_Rebindings, Self, Found_Rebinding);
if not Get_Nodes (Extracted, Found_Rebinding)
and then Extracted /= Self
then
-- Getting the nodes in Self (env before extract rebinding) should
-- still have the proper env rebindings, so we do Get_Nodes in the
-- context of Old rebindings. TODO??? This code is kludgy ugly. There
-- might be a better way, for example, passing rebindings to
-- Get_Nodes explicitly.
declare
Tmp : Env_Rebindings;
begin
Tmp := Current_Rebindings;
Current_Rebindings := Rebindings;
Dummy := Get_Nodes (Self);
Current_Rebindings := Tmp;
end;
end if;
if Lookup_Kind /= Minimal then
-- Phase 2: Get nodes in transitive and prioritary referenced envs
if Self.Kind = Static_Primary then
for I in Env.Referenced_Envs.First_Index
.. Env.Referenced_Envs.Last_Index
loop
if Env.Referenced_Envs.Get_Access (I).Kind
in Transitive | Prioritary
then
Get_Refd_Nodes (Env.Referenced_Envs.Get_Access (I).all);
end if;
end loop;
end if;
-- Phase 3: Get nodes in parent envs
if Lookup_Kind = Recursive or else Env.Transitive_Parent then
declare
Parent_Env : Lexical_Env := Parent (Self);
Parent_Rebindings : constant Env_Rebindings :=
Shed_Rebindings (Parent_Env, Current_Rebindings);
begin
if Has_Trace then
Rec.Trace ("Recursing on parent environments");
Rec.Increase_Indent;
end if;
Recurse
(Parent_Env, Key, Lookup_Kind,
Parent_Rebindings,
Metadata, Categories, Local_Results);
if Has_Trace then
Rec.Decrease_Indent;
end if;
Dec_Ref (Parent_Env);
end;
end if;
-- Phase 4: Get nodes in normal referenced envs
if Self.Kind = Static_Primary and then Lookup_Kind = Recursive then
if Has_Trace then
Rec.Trace
("Recursing on non transitive referenced environments");
Rec.Increase_Indent;
end if;
for I in Env.Referenced_Envs.First_Index
.. Env.Referenced_Envs.Last_Index
loop
if Env.Referenced_Envs.Get_Access (I).Kind
not in Transitive | Prioritary
then
Get_Refd_Nodes (Env.Referenced_Envs.Get_Access (I).all);
end if;
end loop;
if Has_Trace then
Rec.Decrease_Indent;
end if;
end if;
end if;
Dec_Ref (Extracted);
if Do_Cache
and then Lookup_Kind = Recursive
and then Need_Cache
then
-- Only cache if there was no loop in the env graph (see comment on
-- ``Get_Internal_Impl``).
if Recursive_Check_Reached then
Env.Lookup_Cache.Include
(Res_Key, (None, Empty_Lookup_Result_Vector));
Outer_Results.Concat (Local_Results);
-- We won't keep the local results in the cache, so destroy them
Local_Results.Destroy;
Local_Results := Outer_Results;
else
if Has_Trace then
Caches_Trace.Trace ("INSERTING CACHE ENTRY " & Log_Id);
end if;
Env.Lookup_Cache.Include (Res_Key, (Computed, Local_Results));
Outer_Results.Concat (Local_Results);
Local_Results := Outer_Results;
end if;
end if;
exception
when Exc : others =>
-- If ``Exc`` is an exception that properties are allowed to raise,
-- free the locally allocated resources and propagate the exception.
-- All bets are off for other kinds of exceptions: just propagate in
-- that case.
if Properties_May_Raise (Exc) then
Local_Results.Destroy;
end if;
raise;
end Get_Internal_Impl;
function Get
(Self : Lexical_Env;
Key : Symbol_Type;
From : Node_Type := No_Node;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Categories : Ref_Categories := All_Cats) return Entity_Array
is
Vec : Entity_Vectors.Vector :=
Get (Self, Key, From, Lookup_Kind, Categories);
begin
return Ret : constant Entity_Array := Vec.To_Array do
Vec.Destroy;
end return;
end Get;
---------
-- Get --
---------
function Get
(Self : Lexical_Env;
Key : Symbol_Type;
From : Node_Type := No_Node;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Categories : Ref_Categories := All_Cats)
return Entity_Vectors.Vector
is
FV : Entity_Vectors.Vector;
begin
if Has_Trace then
Me.Trace
("===== In Env get, key=" & Image (Key)
& ", env=" & Lexical_Env_Image (Self, Dump_Content => False)
& " =====");
Me.Increase_Indent;
end if;
declare
Results : Lookup_Result_Vector;
begin
Get_Internal
(Self, Key, Lookup_Kind, null, Empty_Metadata, Categories, Results);
for El of Results loop
if From = No_Node
or else (if El.Override_Filter_Node /= No_Node
then Can_Reach (El.Override_Filter_Node, From)
else Can_Reach (El.E.Node, From))
or else not El.Filter_From
then
FV.Append (El.E);
end if;
end loop;
if Has_Trace then
Me.Trace ("Returning vector " & Entity_Vectors_Image (FV));
end if;
if Min.Active then
Min.Trace
("Env.Get("
& (if Self.Kind = Static_Primary
then Image
(Node_Text_Image (Lexical_Env_Record (Self.Env.all).Node))
else Env_Image (Self))
& ", " & Image (Key.all) & ") -> " & Entity_Vectors_Image (FV));
end if;
if Has_Trace then
Me.Decrease_Indent;
Me.Trace ("===== Out Env get =====");
end if;
Results.Destroy;
return FV;
end;
end Get;
---------------
-- Get_First --
---------------
function Get_First
(Self : Lexical_Env;
Key : Symbol_Type;
From : Node_Type := No_Node;
Lookup_Kind : Lookup_Kind_Type := Recursive;
Categories : Ref_Categories := All_Cats) return Entity
is
FV : Entity_Vectors.Vector;
begin
if Has_Trace then
Me.Trace ("==== In Env Get_First, key=" & Image (Key) & " ====");
Me.Increase_Indent;
end if;
declare
V : Lookup_Result_Vector;
begin
Get_Internal
(Self, Key, Lookup_Kind, null, Empty_Metadata, Categories, V);
for El of V loop
if From = No_Node
or else (if El.Override_Filter_Node /= No_Node
then Can_Reach (El.Override_Filter_Node, From)
else Can_Reach (El.E.Node, From))
or else not El.Filter_From
then
FV.Append (El.E);
end if;
end loop;
V.Destroy;
if Has_Trace then
Me.Trace ("Returning vector with length " & FV.Length'Image);
end if;
return Ret : constant Entity :=
(if FV.Length > 0 then FV.First_Element
else (No_Node, No_Entity_Info))
do
FV.Destroy;
if Has_Trace then
Me.Decrease_Indent;
Me.Trace ("===== Out Env Get_First =====");
end if;
end return;
end;
end Get_First;
------------
-- Orphan --
------------
function Orphan (Self : Lexical_Env) return Lexical_Env is
procedure Check_Valid (Self : Lexical_Env);
-- Raise a property error if we can't create an orphan for Env. Do
-- nothing otherwise.
-----------------
-- Check_Valid --
-----------------
procedure Check_Valid (Self : Lexical_Env) is
Env : constant Lexical_Env_Access := Unwrap (Self);
begin
case Env.Kind is
when Primary_Kind =>
if Env.Transitive_Parent then
raise Property_Error with
"Cannot create an orphan for an environment with a"
& " transitive parent";
end if;
when Orphaned => null;
when Grouped =>
raise Property_Error with
"Cannot create an orphan for a grouped environment";
when Rebound =>
Check_Valid (Env.Rebound_Env);
end case;
end Check_Valid;
begin
Check_Valid (Self);
-- If Self is already an orphan, don't create yet another lexical env
-- wrapper: just return Self itself.
Inc_Ref (Self);
return (if Self.Kind = Orphaned
then Self
else Wrap (new Lexical_Env_Record'
(Kind => Orphaned,
Ref_Count => <>,
Orphaned_Env => Self),
Owner => Self.Owner));
end Orphan;
-----------
-- Group --
-----------
function Group
(Envs : Lexical_Env_Array;
With_Md : Node_Metadata := Empty_Metadata) return Lexical_Env
is
V : Lexical_Env_Vectors.Vector;
procedure Append_Envs (E : Lexical_Env);
-- Append envs from E to the envs vector. This takes care of flattening
-- potential grouped envs.
function Already_Has (E : Lexical_Env) return Boolean;
-- Returns whether the results already contain E
-----------------
-- Already_Has --
-----------------
function Already_Has (E : Lexical_Env) return Boolean is
begin
for El of V loop
if Equivalent (El, E) then
return True;
end if;
end loop;
return False;
end Already_Has;
-----------------
-- Append_Envs --
-----------------
procedure Append_Envs (E : Lexical_Env) is
begin
-- Flatten grouped envs only when we don't lose the `default_md`
-- field of a nested grouped env.
if E.Kind in Grouped
and then Unwrap (E).Default_Md in Empty_Metadata | With_Md
then
for C of Unwrap (E).Grouped_Envs.all loop
Append_Envs (C);
end loop;
elsif not Already_Has (E) then
Inc_Ref (E);
V.Append (E);
end if;
end Append_Envs;
begin
if Envs'Length = 0 then
return Empty_Env;
end if;
for E of Envs loop
Append_Envs (E);
end loop;
return L : constant Lexical_Env := Wrap
(new Lexical_Env_Record'
(Kind => Grouped,
Ref_Count => <>,
Grouped_Envs =>
new Lexical_Env_Array'(Lexical_Env_Array (V.To_Array)),
Default_Md => With_Md))
do
Lexical_Env_Vectors.Destroy (V);
end return;
end Group;
----------------
-- Rebind_Env --
----------------
function Rebind_Env
(Base_Env : Lexical_Env; Rebindings : Env_Rebindings) return Lexical_Env
is
begin
-- If no rebindings were passed, just return the original base env
Inc_Ref (Base_Env);
return (if Rebindings = null
then Base_Env
else Wrap (new Lexical_Env_Record'
(Kind => Rebound,
Ref_Count => <>,
Rebound_Env => Base_Env,
Rebindings => Rebindings,
Rebindings_Version => Rebindings.Version),
Owner => Base_Env.Owner));
end Rebind_Env;
----------------
-- Rebind_Env --
----------------
function Rebind_Env
(Base_Env : Lexical_Env; E_Info : Entity_Info) return Lexical_Env is
begin
return Rebind_Env (Base_Env, E_Info.Rebindings);
end Rebind_Env;
-------------
-- Destroy --
-------------
procedure Destroy (Self : in out Lexical_Env) is
Env : Lexical_Env_Access := Unwrap (Self);
procedure Free is new Ada.Unchecked_Deallocation
(Lexical_Env_Record, Lexical_Env_Access);
procedure Free is new Ada.Unchecked_Deallocation
(Lexical_Env_Array, Lexical_Env_Array_Access);
procedure Free is new Ada.Unchecked_Deallocation
(Internal_Map_Node_Maps.Map, Internal_Map_Node_Map);
begin
if Self in Null_Lexical_Env | Empty_Env then
return;
end if;
case Self.Kind is
when Primary_Kind =>
-- Release the reference to the parent environment
Dec_Ref (Env.Parent);
-- Release the pool of rebindings
Destroy (Env.Rebindings_Pool);
if Self.Kind = Static_Primary then
-- Release referenced environments
for Ref_Env of Env.Referenced_Envs loop
declare
Getter : Env_Getter := Ref_Env.Getter;
begin
Dec_Ref (Getter);
end;
end loop;
Env.Referenced_Envs.Destroy;
-- Release the internal map. Don't assume it was allocated, as
-- it's convenient for testing not to allocate it.
if Env.Map /= null then
for Element of Env.Map.all loop
Internal_Map_Node_Vectors.Destroy (Element.Native_Nodes);
Free (Element.Foreign_Nodes);
end loop;
Destroy (Env.Map);
end if;
-- Release the lookup cache
Reset_Lookup_Cache (Self);
end if;
when Orphaned =>
Dec_Ref (Env.Orphaned_Env);
when Grouped =>
for E of Env.Grouped_Envs.all loop
Dec_Ref (E);
end loop;
Free (Env.Grouped_Envs);
when Rebound =>
Dec_Ref (Env.Rebound_Env);
end case;
Free (Env);
Self := Null_Lexical_Env;
end Destroy;
-------------
-- Inc_Ref --
-------------
procedure Inc_Ref (Self : Lexical_Env) is
Env : constant Lexical_Env_Access := Unwrap (Self);
begin
if Self.Kind not in Primary_Kind then
Env.Ref_Count := Env.Ref_Count + 1;
end if;
end Inc_Ref;
-------------
-- Dec_Ref --
-------------
procedure Dec_Ref (Self : in out Lexical_Env) is
Env : constant Lexical_Env_Access := Unwrap (Self);
begin
if Self.Kind in Primary_Kind then
return;
end if;
Env.Ref_Count := Env.Ref_Count - 1;
if Env.Ref_Count = 0 then
Destroy (Self);
end if;
Self := Null_Lexical_Env;
end Dec_Ref;
function Pop (Rebindings : Env_Rebindings) return Env_Rebindings is
(if Rebindings = null then null else Rebindings.Parent);
-----------------------
-- Extract_Rebinding --
-----------------------
function Extract_Rebinding
(Rebindings : in out Env_Rebindings;
Rebound_Env : Lexical_Env;
Found : out Boolean) return Lexical_Env
is
Return_Env : Lexical_Env := Rebound_Env;
begin
Found := False;
if Rebindings /= null then
-- Look for a rebinding in the chain whose Old_Env is Rebound_Env.
-- The correct behavior is to extract the *last* rebinding, because
-- due to the stacked nature of rebindings, the user is never
-- supposed to extract a rebinding other than the last one that was
-- added.
--
-- TODO: We're still doing a full for-loop to check if this invariant
-- is consistently respected. This means that the case where the env
-- is not found is linear, which is probably the most common case.
-- Ideally we would have the loop only in debug builds.
declare
R : Env_Rebindings := Rebindings;
begin
while R /= null loop
declare
R_Old_Env : constant Lexical_Env := R.Old_Env;
begin
if Rebound_Env = R_Old_Env then
Return_Env := R.New_Env;
Found := True;
-- Extracted rebinding *must* be the last one
if R /= Rebindings then
raise Property_Error with "Incorrect rebindings";
end if;
exit;
end if;
end;
R := R.Parent;
end loop;
end;
end if;
Inc_Ref (Return_Env);
-- If we found the rebinding to extract, create the new rebindings set
if Return_Env /= Rebound_Env then
Rebindings := Pop (Rebindings);
end if;
return Return_Env;
end Extract_Rebinding;
---------------------
-- Shed_Rebindings --
---------------------
function Shed_Rebindings
(From_Env : Lexical_Env;
Rebindings : Env_Rebindings) return Env_Rebindings
is
First_Rebindable_Parent : Lexical_Env;
Assoc_Ref_Env : Lexical_Env;
Result : Env_Rebindings := Rebindings;
begin
-- If there is no bindings, nothing to do here
if Rebindings = null then
return null;
end if;
-- Look for the first environment in From_Env's parent chain whose Node
-- is rebindable. Use null if there is no such env.
First_Rebindable_Parent := From_Env;
Inc_Ref (First_Rebindable_Parent);
while
First_Rebindable_Parent /= Empty_Env
and then
(Env_Node (First_Rebindable_Parent) = No_Node
or else not Is_Rebindable (Env_Node (First_Rebindable_Parent)))
loop
-- Search for an environment that would be associated to this one and
-- that is rebindable.
if First_Rebindable_Parent.Kind in Primary_Kind
and then
Unwrap (First_Rebindable_Parent).Rebindings_Assoc_Ref_Env /= -1
then
Assoc_Ref_Env := Get_Env
(Unwrap (First_Rebindable_Parent).Referenced_Envs.Get_Access
(Unwrap (First_Rebindable_Parent).Rebindings_Assoc_Ref_Env)
.Getter, No_Entity_Info);
declare
N : Node_Type renames Env_Node (Assoc_Ref_Env);
begin
if N /= No_Node and then Is_Rebindable (N) then
Dec_Ref (First_Rebindable_Parent);
First_Rebindable_Parent := Assoc_Ref_Env;
exit;
end if;
end;
end if;
declare
Next : constant Lexical_Env := Parent (First_Rebindable_Parent);
begin
Dec_Ref (First_Rebindable_Parent);
First_Rebindable_Parent := Next;
end;
end loop;
-- If there is no rebindable parent anywhere, it means we cannot have
-- rebindings. In that case, shed them all, i.e. return null rebindings.
if First_Rebindable_Parent = Empty_Env then
return null;
end if;
-- If we found a rebindable parent, then we will shed all rebindings
-- between the top of the rebinding stack and the corresponding
-- rebinding.
while Result /= null and then Result.Old_Env /= First_Rebindable_Parent
loop
Result := Result.Parent;
end loop;
Dec_Ref (First_Rebindable_Parent);
return Result;
end Shed_Rebindings;
---------------------
-- Shed_Rebindings --
---------------------
function Shed_Rebindings
(E_Info : Entity_Info; Env : Lexical_Env) return Entity_Info is
begin
return (Md => E_Info.Md,
Rebindings => Shed_Rebindings (Env, E_Info.Rebindings),
From_Rebound => False);
end Shed_Rebindings;
---------------------------------
-- Check_Rebindings_Uniqueness --
---------------------------------
procedure Check_Rebindings_Uniqueness (Self : Env_Rebindings) is
L, R : Env_Rebindings := Self;
begin
while L /= null loop
R := L.Parent;
while R /= null loop
if L.Old_Env = R.Old_Env then
raise Property_Error with
"Old_Env present twice in rebindings";
elsif L.New_Env = R.New_Env then
raise Property_Error with
"New_Env present twice in rebindings";
end if;
R := R.Parent;
end loop;
L := L.Parent;
end loop;
end Check_Rebindings_Uniqueness;
----------------
-- Text_Image --
----------------
function Text_Image (Self : Env_Rebindings) return Text_Type is
function Text_Image (Self : Lexical_Env) return Text_Type is
(Node_Text_Image (Env_Node (Self)));
function Text_Image (Self : Env_Rebindings) return Text_Type is
(Text_Image (Self.New_Env));
begin
if Self = null then
return "<null>";
end if;
declare
use Env_Rebindings_Vectors;
Rebindings_Vector : Vector := Empty_Vector;
Cur : Env_Rebindings := Self;
Buffer : Unbounded_Wide_Wide_String;
begin
-- Get rebindings in reverse order: older first, most recent last
while Cur /= null loop
Rebindings_Vector.Append (Cur);
Cur := Cur.Parent;
end loop;
Append (Buffer, "[");
for I in reverse 1 .. Rebindings_Vector.Last_Index loop
if I < Rebindings_Vector.Last_Index then
Append (Buffer, ", ");
end if;
Append (Buffer, Text_Image (Rebindings_Vector.Get (I)));
end loop;
Append (Buffer, "]");
Rebindings_Vector.Destroy;
return To_Wide_Wide_String (Buffer);
end;
end Text_Image;
----------------
-- Equivalent --
----------------
function Equivalent (Left, Right : Lexical_Env) return Boolean is
L : constant Lexical_Env_Access := Unwrap (Left);
R : constant Lexical_Env_Access := Unwrap (Right);
begin
if L = R then
return True;
elsif L.Kind /= R.Kind then
return False;
end if;
case L.Kind is
when Primary_Kind =>
-- If we have two primary environments, don't go through
-- structural comparison: we can use pointer equality as each
-- instance has its own identity.
return False;
when Orphaned =>
return Equivalent (L.Orphaned_Env, R.Orphaned_Env);
when Grouped =>
return (L.Grouped_Envs'Length = R.Grouped_Envs'Length
and then L.Default_Md = R.Default_Md
and then (for all I in L.Grouped_Envs'Range =>
Equivalent (L.Grouped_Envs (I),
R.Grouped_Envs (I))));
when Rebound =>
return (L.Rebindings = R.Rebindings
and then Equivalent (L.Rebound_Env,
R.Rebound_Env));
end case;
end Equivalent;
----------
-- Hash --
----------
function Hash (Env : Lexical_Env_Access) return Hash_Type is
function Convert is new Ada.Unchecked_Conversion
(Lexical_Env_Resolver, System.Address);
function Hash is new Hash_Address
(System.Word_Size / System.Storage_Unit);
function Hash is new Hash_Access (Internal_Envs.Map, Internal_Map);
function Hash (Getter : Env_Getter) return Hash_Type;
function Hash (Ref : Referenced_Env) return Hash_Type;
function Hash (Refs : Referenced_Envs_Vectors.Vector) return Hash_Type;
----------
-- Hash --
----------
function Hash (Getter : Env_Getter) return Hash_Type is
begin
case Getter.Dynamic is
when True =>
return Combine
((1,
Node_Hash (Getter.Node),
Hash (Convert (Getter.Resolver))));
when False =>
return Combine (0, Hash (Getter.Env));
end case;
end Hash;
----------
-- Hash --
----------
function Hash (Ref : Referenced_Env) return Hash_Type is
begin
return Combine ((Ref_Kind'Pos (Ref.Kind), Hash (Ref.Getter)));
end Hash;
----------
-- Hash --
----------
function Hash (Refs : Referenced_Envs_Vectors.Vector) return Hash_Type is
Hashes : Hash_Array (1 .. Refs.Length);
begin
for I in Hashes'Range loop
Hashes (I) := Hash (Refs.Get (I));
end loop;
return Combine (Hashes);
end Hash;
Base_Hash : constant Hash_Type :=
(if Env = null
then Initial_Hash
else Lexical_Env_Kind'Pos (Env.Kind));
begin
if Env = null then
return Base_Hash;
end if;
case Env.Kind is
when Static_Primary =>
return Combine
((Base_Hash,
Hash (Env.Parent),
(if Env.Transitive_Parent then 1 else 0),
Node_Hash (Env.Node),
Hash (Env.Referenced_Envs),
Hash (Env.Map)));
when Dynamic_Primary =>
return Combine
((Base_Hash,
Hash (Env.Parent),
(if Env.Transitive_Parent then 1 else 0),
Node_Hash (Env.Node)));
when Orphaned =>
return Combine (Base_Hash, Hash (Env.Orphaned_Env));
when Grouped =>
declare
Result : Hash_Type := Base_Hash;
begin
for E of Env.Grouped_Envs.all loop
Result := Combine (Result, Hash (E));
end loop;
return Combine (Result, Metadata_Hash (Env.Default_Md));
end;
when Rebound =>
return Combine
((Base_Hash, Hash (Env.Rebound_Env), Hash (Env.Rebindings)));
end case;
end Hash;
-- We want lexical env dumps to be deterministic, so sort maps before
-- iterating through their key/value pairs.
type Env_Pair is record
Key : Symbol_Type;
Value : Internal_Map_Node_Vectors.Vector;
end record;
function "<" (L, R : Env_Pair) return Boolean
is (L.Key.all < R.Key.all);
package Env_Pair_Vectors is new Gpr_Parser_Support.Vectors (Env_Pair);
procedure Sort is new Env_Pair_Vectors.Generic_Sort;
function To_Sorted_Env
(Env : Internal_Envs.Map) return Env_Pair_Vectors.Vector;
-------------------
-- To_Sorted_Env --
-------------------
function To_Sorted_Env
(Env : Internal_Envs.Map) return Env_Pair_Vectors.Vector
is
use Internal_Envs;
begin
return Vector : Env_Pair_Vectors.Vector do
for Pos in Env.Iterate loop
-- Append a new entry, and then fill it in place to avoid needless
-- copying.
Vector.Append
((Key (Pos), Internal_Map_Node_Vectors.Empty_Vector));
declare
Element : Internal_Map_Element renames
Env.Constant_Reference (Pos);
V : Internal_Map_Node_Vectors.Vector renames
Vector.Last_Element.all.Value;
begin
V.Concat (Element.Native_Nodes);
if Element.Foreign_Nodes /= null then
for Node of Element.Foreign_Nodes.all loop
V.Append (Node);
end loop;
end if;
end;
end loop;
Sort (Vector);
end return;
end To_Sorted_Env;
----------
-- Dump --
----------
function Lexical_Env_Image
(Self : Lexical_Env;
Env_Id : String := "";
Parent_Env_Id : String := "";
Dump_Addresses : Boolean := False;
Dump_Content : Boolean := True;
Prefix : String := "";
Short_Node : Boolean := False) return String
is
Env : constant Lexical_Env_Access := Unwrap (Self);
Result : Unbounded_String;
Sub_Prefix : constant String := Prefix & " ";
function Image (N : Node_Type) return String
is (if N = No_Node then "<null>"
else Image (Node_Text_Image (N, Short => Short_Node)));
-- Wrapper around Node_Text_Image to handle null nodes.
--
-- TODO??? This is slightly hackish, because we're converting a wide
-- string back to string. But since we're using this solely for
-- test/debug purposes, it should not matter. Still, would be good to
-- have Text_Type everywhere at some point.
function Image (Node : Internal_Map_Node) return String is
(Image (Node.Node));
-- Wrapper around Node_Text_Image to format a lexical env map node
function Image is new Internal_Map_Node_Vectors.Image (Image);
procedure New_Arg;
-- Helper to be called before emitting a new lexical env. "argument".
-- Used to separate each argument with a comma in Result.
-------------
-- New_Arg --
-------------
procedure New_Arg is
begin
Append (Result, ", ");
end New_Arg;
begin
if Self = Null_Lexical_Env then
return "";
end if;
-- No matter what, emit a short description of this environment: kind,
-- whether it's empty, parent/node/... if asked.
if Env_Id'Length /= 0 then
Append (Result, Env_Id & " = ");
end if;
Append (Result, "LexEnv(" & (case Self.Kind is
when Static_Primary => "Static_Primary",
when Dynamic_Primary => "Dynamic_Primary",
when Orphaned => "Orphaned",
when Grouped => "Grouped",
when Rebound => "Rebound"));
if Self = Empty_Env then
New_Arg;
Append (Result, "Empty");
end if;
if Self.Kind in Primary_Kind then
if Parent_Env_Id'Length > 0 then
New_Arg;
Append (Result,
"Parent="
& (if Parent (Self) /= Empty_Env
then Parent_Env_Id else "null"));
end if;
if Env_Node (Self) /= No_Node then
New_Arg;
Append (Result, "Node="
& Image (Env_Node (Self)));
end if;
end if;
if Dump_Addresses then
New_Arg;
Append (Result, "0x" & System.Address_Image (Env.all'Address));
end if;
Append (Result, ")");
-- If that was all that was asked, stop here
if not Dump_Content then
return To_String (Result);
end if;
-- Otherwise, go to details...
Append (Result, ":" & ASCII.LF);
case Self.Kind is
when Static_Primary =>
declare
Refs : Referenced_Envs_Vectors.Vector
renames Env.Referenced_Envs;
begin
for I in Refs.First_Index .. Refs.Last_Index loop
declare
G : Env_Getter renames Refs.Get_Access (I).Getter;
Env : Lexical_Env := Get_Env (G, No_Entity_Info);
begin
if Env /= Empty_Env then
Append (Result, Sub_Prefix & "Referenced: ");
if G.Dynamic then
Append (Result, Image (G.Node) & ": ");
end if;
Append
(Result,
Lexical_Env_Image (Self => Env,
Dump_Addresses => Dump_Addresses,
Dump_Content => False));
Append (Result, ASCII.LF);
Dec_Ref (Env);
end if;
end;
end loop;
end;
if Env.Map.Is_Empty then
Append (Result, Sub_Prefix & " <empty>" & ASCII.LF);
else
declare
V : Env_Pair_Vectors.Vector := To_Sorted_Env (Env.Map.all);
begin
for I in V.First_Index .. V.Last_Index loop
declare
Pair : Env_Pair renames V.Get_Access (I).all;
begin
Append
(Result,
Sub_Prefix & " "
& Gpr_Parser_Support.Text.Image (Pair.Key.all) & ": "
& Image (Pair.Value)
& ASCII.LF);
Internal_Map_Node_Vectors.Destroy (Pair.Value);
end;
end loop;
V.Destroy;
end;
end if;
when Dynamic_Primary =>
Append (Result, Sub_Prefix & "... dynamic");
when Orphaned =>
Append
(Result, Sub_Prefix & "Orphaned: " & Lexical_Env_Image
(Self => Env.Orphaned_Env,
Dump_Addresses => Dump_Addresses,
Dump_Content => Dump_Content,
Prefix => Sub_Prefix));
when Grouped =>
for E of Env.Grouped_Envs.all loop
Append
(Result, Sub_Prefix & "Grouped: " & Lexical_Env_Image
(Self => E,
Dump_Addresses => Dump_Addresses,
Dump_Content => Dump_Content,
Prefix => Sub_Prefix));
end loop;
when Rebound =>
Append
(Result, Sub_Prefix & "Rebindings: "
& Image (Text_Image (Env.Rebindings))
& ASCII.LF);
Append
(Result, Sub_Prefix & "Rebound: " & Lexical_Env_Image
(Self => Env.Rebound_Env,
Dump_Addresses => Dump_Addresses,
Dump_Content => Dump_Content,
Prefix => Sub_Prefix));
end case;
return To_String (Result);
end Lexical_Env_Image;
------------------------------
-- Lexical_Env_Parent_Chain --
------------------------------
function Lexical_Env_Parent_Chain (Self : Lexical_Env) return String is
Id : Positive := 1;
E : Lexical_Env := Self;
Result : Unbounded_String;
begin
if E = Null_Lexical_Env then
Append (Result, "<null>" & ASCII.LF);
end if;
while E /= Empty_Env loop
declare
Id_Str : constant String := '@' & Stripped_Image (Id);
begin
Append
(Result,
Lexical_Env_Image
(Self => E,
Env_Id => Id_Str,
Parent_Env_Id => '@' & Stripped_Image (Id + 1),
Dump_Addresses => True));
end;
Id := Id + 1;
E := Parent (E);
end loop;
return To_String (Result);
end Lexical_Env_Parent_Chain;
--------------------------
-- Dump_One_Lexical_Env --
--------------------------
procedure Dump_One_Lexical_Env
(Self : Lexical_Env;
Env_Id : String := "";
Parent_Env_Id : String := "";
Dump_Addresses : Boolean := False;
Dump_Content : Boolean := True)
is
begin
Put_Line
(Lexical_Env_Image
(Self, Env_Id, Parent_Env_Id, Dump_Addresses, Dump_Content));
end Dump_One_Lexical_Env;
-----------------------------------
-- Dump_Lexical_Env_Parent_Chain --
-----------------------------------
procedure Dump_Lexical_Env_Parent_Chain (Self : Lexical_Env) is
begin
Put_Line (Lexical_Env_Parent_Chain (Self));
end Dump_Lexical_Env_Parent_Chain;
------------
-- Parent --
------------
function Parent (Self : Lexical_Env) return Lexical_Env is
Env : constant Lexical_Env_Access := Unwrap (Self);
begin
case Self.Kind is
when Primary_Kind =>
return (if Env.Parent = Null_Lexical_Env
then Empty_Env
else Env.Parent);
when Orphaned =>
return Parent (Env.Orphaned_Env);
when Grouped =>
return Empty_Env;
when Rebound =>
return Parent (Env.Rebound_Env);
end case;
end Parent;
--------------
-- Env_Node --
--------------
function Env_Node (Self : Lexical_Env) return Node_Type is
Env : constant Lexical_Env_Access := Unwrap (Self);
begin
return (case Self.Kind is
when Primary_Kind => Env.Node,
when Orphaned => Env_Node (Env.Orphaned_Env),
when Grouped => No_Node,
when Rebound => Env_Node (Env.Rebound_Env));
end Env_Node;
--------------------------------
-- Deactivate_Referenced_Envs --
--------------------------------
procedure Deactivate_Referenced_Envs (Self : Lexical_Env) is
Env : constant Lexical_Env_Access := Unwrap (Self);
R : access Referenced_Env;
begin
if Self in Null_Lexical_Env | Empty_Env then
return;
end if;
Invalidate_Cache (Env);
for I in Env.Referenced_Envs.First_Index
.. Env.Referenced_Envs.Last_Index
loop
R := Env.Referenced_Envs.Get_Access (I);
R.State := Inactive;
end loop;
end Deactivate_Referenced_Envs;
-------------------------------
-- Recompute_Referenced_Envs --
-------------------------------
procedure Recompute_Referenced_Envs (Self : Lexical_Env) is
Env : constant Lexical_Env_Access := Unwrap (Self);
R : access Referenced_Env;
begin
if Self in Null_Lexical_Env | Empty_Env then
return;
end if;
for I in Env.Referenced_Envs.First_Index
.. Env.Referenced_Envs.Last_Index
loop
R := Env.Referenced_Envs.Get_Access (I);
Resolve (R.Getter, No_Entity_Info);
R.State := Active;
end loop;
end Recompute_Referenced_Envs;
------------------
-- Reset_Caches --
------------------
procedure Reset_Caches (Self : Lexical_Env) is
begin
Unwrap (Self).Lookup_Cache_Valid := False;
end Reset_Caches;
----------------------
-- Invalidate_Cache --
----------------------
procedure Invalidate_Cache (Env : Lexical_Env_Access) is
begin
if Has_Trace and then Env.Lookup_Cache_Valid = True then
Caches_Trace.Trace ("INVALIDATING CACHES " & Env_Image (Wrap (Env)));
end if;
Env.Lookup_Cache_Valid := False;
end Invalidate_Cache;
end Gpr_Parser_Support.Lexical_Envs_Impl;
|
zhmu/ananas | Ada | 6,643 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T A S K _ I D E N T I F I C A T I O N --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Address_Image;
with System.Soft_Links;
with System.Task_Primitives;
with System.Task_Primitives.Operations;
with Ada.Unchecked_Conversion;
pragma Warnings (Off);
-- Allow withing of non-Preelaborated units in Ada 2005 mode where this
-- package will be categorized as Preelaborate. See AI-362 for details.
-- It is safe in the context of the run-time to violate the rules.
with System.Tasking.Utilities;
pragma Warnings (On);
package body Ada.Task_Identification with
SPARK_Mode => Off
is
package STPO renames System.Task_Primitives.Operations;
-----------------------
-- Local Subprograms --
-----------------------
function Convert_Ids (T : Task_Id) return System.Tasking.Task_Id;
function Convert_Ids (T : System.Tasking.Task_Id) return Task_Id;
pragma Inline (Convert_Ids);
-- Conversion functions between different forms of Task_Id
---------
-- "=" --
---------
function "=" (Left, Right : Task_Id) return Boolean is
begin
return System.Tasking."=" (Convert_Ids (Left), Convert_Ids (Right));
end "=";
-----------------
-- Abort_Task --
----------------
procedure Abort_Task (T : Task_Id) is
begin
if T = Null_Task_Id then
raise Program_Error;
else
System.Tasking.Utilities.Abort_Tasks
(System.Tasking.Task_List'(1 => Convert_Ids (T)));
end if;
end Abort_Task;
----------------------------
-- Activation_Is_Complete --
----------------------------
function Activation_Is_Complete (T : Task_Id) return Boolean is
use type System.Tasking.Task_Id;
begin
if T = Null_Task_Id then
raise Program_Error;
else
return Convert_Ids (T).Common.Activator = null;
end if;
end Activation_Is_Complete;
-----------------
-- Convert_Ids --
-----------------
function Convert_Ids (T : Task_Id) return System.Tasking.Task_Id is
begin
return System.Tasking.Task_Id (T);
end Convert_Ids;
function Convert_Ids (T : System.Tasking.Task_Id) return Task_Id is
begin
return Task_Id (T);
end Convert_Ids;
------------------
-- Current_Task --
------------------
function Current_Task return Task_Id is
begin
return Convert_Ids (System.Task_Primitives.Operations.Self);
end Current_Task;
----------------------
-- Environment_Task --
----------------------
function Environment_Task return Task_Id is
begin
return Convert_Ids (System.Task_Primitives.Operations.Environment_Task);
end Environment_Task;
-----------
-- Image --
-----------
function Image (T : Task_Id) return String is
function To_Address is new
Ada.Unchecked_Conversion
(Task_Id, System.Task_Primitives.Task_Address);
begin
if T = Null_Task_Id then
return "";
elsif T.Common.Task_Image_Len = 0 then
return System.Address_Image (To_Address (T));
else
return T.Common.Task_Image (1 .. T.Common.Task_Image_Len)
& "_" & System.Address_Image (To_Address (T));
end if;
end Image;
-----------------
-- Is_Callable --
-----------------
function Is_Callable (T : Task_Id) return Boolean is
Result : Boolean;
Id : constant System.Tasking.Task_Id := Convert_Ids (T);
begin
if T = Null_Task_Id then
raise Program_Error;
else
System.Soft_Links.Abort_Defer.all;
STPO.Write_Lock (Id);
Result := Id.Callable;
STPO.Unlock (Id);
System.Soft_Links.Abort_Undefer.all;
return Result;
end if;
end Is_Callable;
-------------------
-- Is_Terminated --
-------------------
function Is_Terminated (T : Task_Id) return Boolean is
Result : Boolean;
Id : constant System.Tasking.Task_Id := Convert_Ids (T);
use System.Tasking;
begin
if T = Null_Task_Id then
raise Program_Error;
else
System.Soft_Links.Abort_Defer.all;
STPO.Write_Lock (Id);
Result := Id.Common.State = Terminated;
STPO.Unlock (Id);
System.Soft_Links.Abort_Undefer.all;
return Result;
end if;
end Is_Terminated;
end Ada.Task_Identification;
|
reznikmm/matreshka | Ada | 4,807 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Visitors;
with ODF.DOM.Chart_Stock_Loss_Marker_Elements;
package Matreshka.ODF_Chart.Stock_Loss_Marker_Elements is
type Chart_Stock_Loss_Marker_Element_Node is
new Matreshka.ODF_Chart.Abstract_Chart_Element_Node
and ODF.DOM.Chart_Stock_Loss_Marker_Elements.ODF_Chart_Stock_Loss_Marker
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Chart_Stock_Loss_Marker_Element_Node;
overriding function Get_Local_Name
(Self : not null access constant Chart_Stock_Loss_Marker_Element_Node)
return League.Strings.Universal_String;
overriding procedure Enter_Node
(Self : not null access Chart_Stock_Loss_Marker_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Leave_Node
(Self : not null access Chart_Stock_Loss_Marker_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Visit_Node
(Self : not null access Chart_Stock_Loss_Marker_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
end Matreshka.ODF_Chart.Stock_Loss_Marker_Elements;
|
tum-ei-rcs/StratoX | Ada | 2,822 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- SYSTEM.BB.CPU_PRIMITIVES.MULTIPROCESSORS --
-- --
-- S p e c --
-- --
-- Copyright (C) 2010-2015, AdaCore --
-- --
-- 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. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
with System.Multiprocessors;
package System.BB.CPU_Primitives.Multiprocessors
with SPARK_Mode => On is
pragma Preelaborate;
function Current_CPU return System.Multiprocessors.CPU;
pragma Inline (Current_CPU);
-- Return the id of the current CPU
procedure Poke_CPU (CPU_Id : System.Multiprocessors.CPU);
-- Poke the given CPU to signal that a rescheduling may be required
procedure Start_CPU (CPU_Id : System.Multiprocessors.CPU);
-- Start given CPU
procedure Start_All_CPUs;
pragma Export (C, Start_All_CPUs, "__gnat_start_slave_cpus");
-- Start all CPUs
end System.BB.CPU_Primitives.Multiprocessors;
|
AdaCore/training_material | Ada | 227 | ads | --Datastore
package Datastore is
type Register_T is (One, Two, Three);
function Read (Register : Register_T) return Integer;
procedure Write (Register : Register_T;
Value : Integer);
end Datastore;
|
reznikmm/matreshka | Ada | 3,450 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010, 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$
------------------------------------------------------------------------------
-- Root package for Streaming API for XML.
package Matreshka.StAX is
pragma Pure;
end Matreshka.StAX;
|
AdaCore/libadalang | Ada | 228 | adb | package body Test is
-- Test 1: no box
procedure Foo is
begin
null;
end Foo;
-- Test 2: wrong box
---------
-- Bar --
---------
procedure Foo is
begin
null;
end Foo;
end Test;
|
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.Table is
-----------------------
-- Get_Namespace_URI --
-----------------------
overriding function Get_Namespace_URI
(Self : not null access constant Table_Node_Base)
return League.Strings.Universal_String is
begin
return ODF.Constants.Table_URI;
end Get_Namespace_URI;
end Matreshka.ODF_Attributes.Table;
|
AaronC98/PlaneSystem | Ada | 3,280 | adb | ------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2000-2015, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
------------------------------------------------------------------------------
with AWS.Messages;
with AWS.MIME;
with SOAP.Message.XML;
package body SOAP.Message.Response is
-----------
-- Build --
-----------
function Build
(R : Object'Class;
Schema : WSDL.Schema.Definition := WSDL.Schema.Empty)
return AWS.Response.Data
is
use AWS.Messages;
begin
return AWS.Response.Build
(AWS.MIME.Text_XML,
UString_Message => SOAP.Message.XML.Image (R, Schema),
Status_Code => (if Is_Error (R) then S500 else S200));
end Build;
----------
-- From --
----------
function From (P : Message.Payload.Object) return Object is
NP : Object;
begin
Set_Wrapper_Name (NP, Payload.Procedure_Name (P) & "Response");
Set_Parameters (NP, Parameters (P));
Set_Name_Space (NP, Name_Space (P));
return NP;
end From;
--------------
-- Is_Error --
--------------
function Is_Error (R : Object) return Boolean is
pragma Warnings (Off, R);
begin
return False;
end Is_Error;
end SOAP.Message.Response;
|
limkokholefork/original-bsd | Ada | 8,204 | adb | /*-
* Copyright (c) 1980 The Regents of the University of California.
* All rights reserved.
*
* %sccs.include.proprietary.c%
*
* @(#)instrs.adb 5.1 (Berkeley) 04/04/91
*/
OP("adda",0x8e,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("addb2",0x08,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0),
OP("addb3",0x18,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0),
OP("addd",0xc7,1,ACCR+TYPD,0,0,0,0,0),
OP("addf",0xc6,1,ACCR+TYPF,0,0,0,0,0),
OP("addl2",0x0c,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("addl3",0x1c,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("addw2",0x0a,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0),
OP("addw3",0x1a,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0),
OP("adwc",0x8d,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("andb2",0xa8,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0),
OP("andb3",0xb8,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0),
OP("andl2",0xac,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("andl3",0xbc,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("andw2",0xaa,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0),
OP("andw3",0xba,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0),
OP("aobleq",0x3f,3,ACCR+TYPL,ACCM+TYPL,ACCB+TYPW,0,0,0),
OP("aoblss",0x2f,3,ACCR+TYPL,ACCM+TYPL,ACCB+TYPW,0,0,0),
OP("atanf",0x25,0,0,0,0,0,0,0),
OP("bbc",0x1e,3,ACCR+TYPL,ACCR+TYPL,ACCB+TYPW,0,0,0),
OP("bbs",0x0e,3,ACCR+TYPL,ACCR+TYPL,ACCB+TYPW,0,0,0),
OP("bbssi",0x5f,3,ACCR+TYPL,ACCM+TYPL,ACCB+TYPW,0,0,0),
OP("bcc",0xf1,1,ACCB+TYPB,0,0,0,0,0),
OP("bcs",0xe1,1,ACCB+TYPB,0,0,0,0,0),
OP("beql",0x31,1,ACCB+TYPB,0,0,0,0,0),
OP("beqlu",0x31,1,ACCB+TYPB,0,0,0,0,0),
OP("bgeq",0x81,1,ACCB+TYPB,0,0,0,0,0),
OP("bgequ",0xe1,1,ACCB+TYPB,0,0,0,0,0),
OP("bgtr",0x41,1,ACCB+TYPB,0,0,0,0,0),
OP("bgtru",0xa1,1,ACCB+TYPB,0,0,0,0,0),
OP("bicpsw",0x9b,1,ACCR+TYPW,0,0,0,0,0),
OP("bispsw",0x8b,1,ACCR+TYPW,0,0,0,0,0),
OP("bitb",0x39,2,ACCR+TYPB,ACCR+TYPB,0,0,0,0),
OP("bitl",0x3d,2,ACCR+TYPL,ACCR+TYPL,0,0,0,0),
OP("bitw",0x3b,2,ACCR+TYPW,ACCR+TYPW,0,0,0,0),
OP("bleq",0x51,1,ACCB+TYPB,0,0,0,0,0),
OP("blequ",0xb1,1,ACCB+TYPB,0,0,0,0,0),
OP("blss",0x91,1,ACCB+TYPB,0,0,0,0,0),
OP("blssu",0xf1,1,ACCB+TYPB,0,0,0,0,0),
OP("bneq",0x21,1,ACCB+TYPB,0,0,0,0,0),
OP("bnequ",0x21,1,ACCB+TYPB,0,0,0,0,0),
OP("bpt",0x30,0,0,0,0,0,0,0),
OP("brb",0x11,1,ACCB+TYPB,0,0,0,0,0),
OP("brw",0x13,1,ACCB+TYPW,0,0,0,0,0),
OP("btcs",0xce,1,ACCR+TYPB,0,0,0,0,0),
OP("bvc",0xc1,1,ACCB+TYPB,0,0,0,0,0),
OP("bvs",0xd1,1,ACCB+TYPB,0,0,0,0,0),
OP("callf",0xfe,2,ACCR+TYPB,ACCA+TYPB,0,0,0,0),
OP("calls",0xbf,2,ACCR+TYPB,ACCA+TYPB,0,0,0,0),
OP("casel",0xfc,3,ACCR+TYPL,ACCR+TYPL,ACCR+TYPL,0,0,0),
OP("clrb",0x49,1,ACCW+TYPB,0,0,0,0,0),
OP("clrl",0x4d,1,ACCW+TYPL,0,0,0,0,0),
OP("clrw",0x4b,1,ACCW+TYPW,0,0,0,0,0),
OP("cmpb",0x19,2,ACCR+TYPB,ACCR+TYPB,0,0,0,0),
OP("cmpd",0x37,1,ACCR+TYPD,0,0,0,0,0),
OP("cmpd2",0x47,2,ACCR+TYPD,ACCR+TYPD,0,0,0,0),
OP("cmpf",0x36,1,ACCR+TYPF,0,0,0,0,0),
OP("cmpf2",0x46,2,ACCR+TYPF,ACCR+TYPF,0,0,0,0),
OP("cmpl",0x1d,2,ACCR+TYPL,ACCR+TYPL,0,0,0,0),
OP("cmps2",0x92,0,0,0,0,0,0,0),
OP("cmps3",0xd2,0,0,0,0,0,0,0),
OP("cmpw",0x1b,2,ACCR+TYPW,ACCR+TYPW,0,0,0,0),
OP("cosf",0x15,0,0,0,0,0,0,0),
OP("cvdf",0xa6,0,0,0,0,0,0,0),
OP("cvdl",0x87,1,ACCW+TYPL,0,0,0,0,0),
OP("cvfl",0x86,1,ACCW+TYPL,0,0,0,0,0),
OP("cvld",0x77,1,ACCR+TYPL,0,0,0,0,0),
OP("cvlf",0x76,1,ACCR+TYPL,0,0,0,0,0),
OP("cvtbl",0x89,2,ACCR+TYPB,ACCW+TYPL,0,0,0,0),
OP("cvtbw",0x99,2,ACCR+TYPB,ACCW+TYPW,0,0,0,0),
OP("cvtlb",0x6f,2,ACCR+TYPL,ACCW+TYPB,0,0,0,0),
OP("cvtlw",0x7f,2,ACCR+TYPL,ACCW+TYPW,0,0,0,0),
OP("cvtwb",0x33,2,ACCR+TYPW,ACCW+TYPB,0,0,0,0),
OP("cvtwl",0x23,2,ACCR+TYPW,ACCW+TYPL,0,0,0,0),
OP("decb",0x79,1,ACCM+TYPB,0,0,0,0,0),
OP("decl",0x7d,1,ACCM+TYPL,0,0,0,0,0),
OP("decw",0x7b,1,ACCM+TYPW,0,0,0,0,0),
OP("divd",0xf7,1,ACCR+TYPD,0,0,0,0,0),
OP("divf",0xf6,1,ACCR+TYPF,0,0,0,0,0),
OP("divl2",0x6c,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("divl3",0x7c,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("ediv",0x3e,4,ACCR+TYPL,ACCR+TYPQ,ACCW+TYPL,ACCW+TYPL,0,0),
OP("emul",0x2e,4,ACCR+TYPL,ACCR+TYPL,ACCR+TYPL,ACCW+TYPQ,0,0),
OP("expf",0x55,0,0,0,0,0,0,0),
OP("ffc",0xbe,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0),
OP("ffs",0xae,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0),
OP("halt",0x00,0,0,0,0,0,0,0),
OP("incb",0x69,1,ACCM+TYPB,0,0,0,0,0),
OP("incl",0x6d,1,ACCM+TYPL,0,0,0,0,0),
OP("incw",0x6b,1,ACCM+TYPW,0,0,0,0,0),
OP("insque",0xe0,2,ACCA+TYPL,ACCA+TYPL,0,0,0,0),
OP("jmp",0x71,1,ACCA+TYPB,0,0,0,0,0),
OP("kcall",0xcf,1,ACCR+TYPW,0,0,0,0,0),
OP("ldd",0x07,1,ACCR+TYPD,0,0,0,0,0),
OP("ldf",0x06,1,ACCR+TYPF,0,0,0,0,0),
OP("ldfd",0x97,1,ACCR+TYPF,0,0,0,0,0),
OP("ldpctx",0x60,0,0,0,0,0,0,0),
OP("lnd",0x17,1,ACCR+TYPD,0,0,0,0,0),
OP("lnf",0x16,1,ACCR+TYPF,0,0,0,0,0),
OP("loadr",0xab,2,ACCR+TYPW,ACCA+TYPL,0,0,0,0),
OP("logf",0x35,0,0,0,0,0,0,0),
OP("mcomb",0x29,2,ACCR+TYPB,ACCW+TYPB,0,0,0,0),
OP("mcoml",0x2d,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0),
OP("mcomw",0x2b,2,ACCR+TYPW,ACCW+TYPW,0,0,0,0),
OP("mfpr",0xbd,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0),
OP("mnegb",0xe8,2,ACCR+TYPB,ACCW+TYPB,0,0,0,0),
OP("mnegl",0xec,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0),
OP("mnegw",0xea,2,ACCR+TYPW,ACCW+TYPW,0,0,0,0),
OP("movab",0xe9,2,ACCA+TYPB,ACCW+TYPL,0,0,0,0),
OP("moval",0xed,2,ACCA+TYPL,ACCW+TYPL,0,0,0,0),
OP("movaw",0xeb,2,ACCA+TYPW,ACCW+TYPL,0,0,0,0),
OP("movb",0x09,2,ACCR+TYPB,ACCW+TYPB,0,0,0,0),
OP("movblk",0xf8,0,0,0,0,0,0,0),
OP("movl",0x0d,2,ACCR+TYPL,ACCW+TYPL,0,0,0,0),
OP("movob",0xc9,2,ACCR+TYPB,ACCW+TYPB,0,0,0,0),
OP("movow",0xcb,2,ACCR+TYPW,ACCW+TYPW,0,0,0,0),
OP("movpsl",0xcd,1,ACCW+TYPL,0,0,0,0,0),
OP("movs2",0x82,0,0,0,0,0,0,0),
OP("movs3",0xc2,0,0,0,0,0,0,0),
OP("movw",0x0b,2,ACCR+TYPW,ACCW+TYPW,0,0,0,0),
OP("movzbl",0xa9,2,ACCR+TYPB,ACCW+TYPL,0,0,0,0),
OP("movzbw",0xb9,2,ACCR+TYPB,ACCW+TYPW,0,0,0,0),
OP("movzwl",0xc3,2,ACCR+TYPW,ACCW+TYPL,0,0,0,0),
OP("mtpr",0xad,2,ACCR+TYPL,ACCR+TYPL,0,0,0,0),
OP("muld",0xe7,1,ACCR+TYPD,0,0,0,0,0),
OP("mulf",0xe6,1,ACCR+TYPF,0,0,0,0,0),
OP("mull2",0x4c,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("mull3",0x5c,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("negd",0xb7,0,0,0,0,0,0,0),
OP("negf",0xb6,0,0,0,0,0,0,0),
OP("nop",0x10,0,0,0,0,0,0,0),
OP("orb2",0x88,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0),
OP("orb3",0x98,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0),
OP("orl2",0x8c,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("orl3",0x9c,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("orw2",0x8a,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0),
OP("orw3",0x9a,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0),
OP("prober",0xc0,3,ACCR+TYPB,ACCA+TYPB,ACCR+TYPL,0,0,0),
OP("probew",0xd0,3,ACCR+TYPB,ACCA+TYPB,ACCR+TYPL,0,0,0),
OP("pushab",0xf9,1,ACCA+TYPB,0,0,0,0,0),
OP("pushal",0xfd,1,ACCA+TYPL,0,0,0,0,0),
OP("pushaw",0xfb,1,ACCA+TYPW,0,0,0,0,0),
OP("pushb",0xd9,1,ACCR+TYPB,0,0,0,0,0),
OP("pushd",0x67,0,0,0,0,0,0,0),
OP("pushl",0xdd,1,ACCR+TYPL,0,0,0,0,0),
OP("pushw",0xdb,1,ACCR+TYPW,0,0,0,0,0),
OP("rei",0x20,0,0,0,0,0,0,0),
OP("remque",0xf0,1,ACCA+TYPL,0,0,0,0,0),
OP("ret",0x40,0,0,0,0,0,0,0),
OP("sbwc",0x9d,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("shal",0x4e,3,ACCR+TYPB,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("shar",0x5e,3,ACCR+TYPB,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("shll",0x48,3,ACCR+TYPB,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("shlq",0x4a,3,ACCR+TYPB,ACCR+TYPQ,ACCW+TYPQ,0,0,0),
OP("shrl",0x58,3,ACCR+TYPB,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("shrq",0x5a,3,ACCR+TYPB,ACCR+TYPQ,ACCW+TYPQ,0,0,0),
OP("sinf",0x05,0,0,0,0,0,0,0),
OP("sqrtf",0x45,0,0,0,0,0,0,0),
OP("std",0x27,1,ACCW+TYPD,0,0,0,0,0),
OP("stf",0x26,1,ACCW+TYPF,0,0,0,0,0),
OP("storer",0xbb,2,ACCR+TYPW,ACCA+TYPL,0,0,0,0),
OP("suba",0x9e,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("subb2",0x28,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0),
OP("subb3",0x38,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0),
OP("subd",0xd7,1,ACCR+TYPD,0,0,0,0,0),
OP("subf",0xd6,1,ACCR+TYPF,0,0,0,0,0),
OP("subl2",0x2c,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("subl3",0x3c,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("subw2",0x2a,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0),
OP("subw3",0x3a,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0),
OP("svpctx",0x70,0,0,0,0,0,0,0),
OP("tstb",0x59,1,ACCR+TYPB,0,0,0,0,0),
OP("tstd",0x57,0,0,0,0,0,0,0),
OP("tstf",0x56,0,0,0,0,0,0,0),
OP("tstl",0x5d,1,ACCR+TYPL,0,0,0,0,0),
OP("tstw",0x5b,1,ACCR+TYPW,0,0,0,0,0),
OP("xorb2",0xc8,2,ACCR+TYPB,ACCM+TYPB,0,0,0,0),
OP("xorb3",0xd8,3,ACCR+TYPB,ACCR+TYPB,ACCW+TYPB,0,0,0),
OP("xorl2",0xcc,2,ACCR+TYPL,ACCM+TYPL,0,0,0,0),
OP("xorl3",0xdc,3,ACCR+TYPL,ACCR+TYPL,ACCW+TYPL,0,0,0),
OP("xorw2",0xca,2,ACCR+TYPW,ACCM+TYPW,0,0,0,0),
OP("xorw3",0xda,3,ACCR+TYPW,ACCR+TYPW,ACCW+TYPW,0,0,0),
|
AaronC98/PlaneSystem | Ada | 33,651 | ads | ------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2000-2019, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
------------------------------------------------------------------------------
pragma Ada_2012;
-- This package provide an easy way to handle server configuration options.
--
-- If initialization of this package is not done all functions below will
-- return the default value as declared in AWS.Default.
with System;
with GNAT.Regexp;
private with Ada.Strings.Unbounded;
private with AWS.Containers.String_Vectors;
private with AWS.Default;
package AWS.Config is
type Object is private;
Default_Config : constant Object;
-- For the external configuration to be loaded either Get_Current or
-- Load_Config must be called explicitely.
function Get_Current return Object;
-- Returns a configuration record. This is the properties as read in files
-- 'aws.ini' and 'progname.ini'. This configuration object holds only the
-- per-server options.
procedure Load_Config;
-- Load configuration and store it into an internal object. This can be
-- called when only some server-wide configuration are to be set from
-- .ini files for example.
------------------------
-- Per Server options --
------------------------
------------
-- Server --
------------
function Server_Name (O : Object) return String with Inline;
-- This is the name of the server as set by AWS.Server.Start
function Protocol_Family (O : Object) return String with Inline;
-- Server protocol family. Family_Inet for IPv4, Family_Inet6 for IPv6 and
-- Family_Unspec for unspecified protocol family.
function IPv6_Only (O : Object) return Boolean with Inline;
-- IPv6 server accepts only IPv6 connections
function Server_Host (O : Object) return String with Inline;
-- This is the server host. Can be used if the computer has a more than
-- one IP address. It is possible to have two servers at the same port
-- on the same machine, both being binded on different IP addresses.
function Server_Port (O : Object) return Natural with Inline;
-- This is the server port as set by the HTTP object declaration
function Hotplug_Port (O : Object) return Positive with Inline;
-- This is the hotplug communication port needed to register and
-- un-register an hotplug module.
function Session (O : Object) return Boolean with Inline;
-- Returns True if the server session is activated
function Case_Sensitive_Parameters (O : Object) return Boolean with Inline;
-- HTTP parameters are case sensitive
function Session_Name (O : Object) return String with Inline;
-- Name of the cookie session
function Session_Private_Name (O : Object) return String with Inline;
-- Name of the private cookie session
function Server_Priority (O : Object) return System.Any_Priority
with Inline;
-- Returns the priority used by the HTTP and WebSockets servers
function Server_Header (O : Object) return String with Inline;
-- Returns the Server header value
----------------
-- Connection --
----------------
function Max_Connection (O : Object) return Positive with Inline;
-- This is the max simultaneous connections as set by the HTTP object
-- declaration.
function Send_Buffer_Size (O : Object) return Natural with Inline;
-- This is the socket buffer size used for sending data. Increasing this
-- value will give better performances on slow or long distances
-- connections.
function TCP_No_Delay (O : Object) return Boolean with Inline;
-- Returns wether the TCP_NODELAY option is set for this server
function Free_Slots_Keep_Alive_Limit (O : Object) return Natural
with Inline;
-- The minimum number of free slots where keep-alive connections are still
-- enabled. After this limit no more keep-alive connection will be
-- accepted by the server. This parameter must be used for heavy-loaded
-- servers to make sure the server will never run out of slots. This limit
-- must be less than Max_Connection.
function Keep_Alive_Force_Limit (O : Object) return Positive with Inline;
-- Server could have more than Max_Connection keep-alive sockets. Keep
-- alive sockets are waiting for client input in the internal server socket
-- set. This parameter defines the maximum number of keep alive sockets
-- processed by the server with standard timeouts. If number of keep-alive
-- sockets becomes more than Keep_Alive_Force_Limit the server starts to
-- use shorter timeouts. If this parameter is not defined in the
-- configuration, the server uses Max_Connection * 2 as value.
function Keep_Alive_Close_Limit (O : Object) return Positive with Inline;
-- This parameter defines the limit of keep alive sockets in the internal
-- server socket set. If the number of sockets in socket set became more
-- than Keep_Alive_Close_Limit, most close to timeout socket would be
-- closed. If this parameter is not defined in the configuration,
-- the server uses Max_Connection * 4 as value.
function Accept_Queue_Size (O : Object) return Positive with Inline;
-- This is the size of the queue for the incoming requests. Higher this
-- value will be and less "connection refused" will be reported to the
-- client.
function Line_Stack_Size (O : Object) return Positive with Inline;
-- HTTP lines stack size
function Reuse_Address (O : Object) return Boolean with Inline;
-- Returns true if bind is allowed to reuse an address (not waiting for
-- the delay between two bind to the same port).
----------
-- Data --
----------
function WWW_Root (O : Object) return String with Inline;
-- This is the root directory name for the server. This variable is not
-- used internally by AWS. It is supposed to be used by the callback
-- procedures who want to retrieve physical objects (images, Web pages...).
-- The default value is the current working directory. The returned
-- directory ends with a directory separator.
function Upload_Directory (O : Object) return String with Inline;
-- This point to the directory where uploaded files will be stored. The
-- directory returned will end with a directory separator.
function Upload_Size_Limit (O : Object) return Positive with Inline;
function Directory_Browser_Page (O : Object) return String with Inline;
-- Filename for the directory browser template page
function Max_POST_Parameters (O : Object) return Positive with Inline;
-- Returns the maximum number of POST parameters handled. Past this limit
-- the exception Too_Many_Parameters is raised.
---------
-- Log --
---------
function Log_Activated (O : Object) return Boolean with Inline;
-- Whether the default log should be activated
function Log_File_Directory (O : Object) return String with Inline;
-- This point to the directory where log files will be written. The
-- directory returned will end with a directory separator.
function Log_Filename_Prefix (O : Object) return String with Inline;
-- This is the prefix to use for the log filename
function Log_Split_Mode (O : Object) return String with Inline;
-- This is split mode for the log file. Possible values are : Each_Run,
-- Daily, Monthly and None. Any other values will raise an exception.
function Log_Size_Limit (O : Object) return Natural with Inline;
generic
with procedure Field_Id (Id : String);
procedure Log_Extended_Fields_Generic_Iterate (O : Object);
-- Calls procedure Field_Id for each extended http log field identifier
function Log_Extended_Fields_Length (O : Object) return Natural with Inline;
-- Returns the number of extended http log fileds identifiers.
-- If returned value is zero then http log is not extended.
function Error_Log_Activated (O : Object) return Boolean with Inline;
-- Whether the error log should be activated
function Error_Log_Filename_Prefix (O : Object) return String with Inline;
-- This is the prefix to use for the log filename
function Error_Log_Split_Mode (O : Object) return String with Inline;
-- This is split mode for the log file. Possible values are : Each_Run,
-- Daily, Monthly and None. Any other values will raise an exception.
------------
-- Status --
------------
function Admin_Password (O : Object) return String with Inline;
-- The admin password
function Admin_Realm (O : Object) return String with Inline;
-- The admin password
function Admin_URI (O : Object) return String with Inline;
-- This is the name of the admin server page as set by AWS.Server.Start.
-- It is also known as the status page.
function Status_Page (O : Object) return String with Inline;
-- Filename for the status template page
function Up_Image (O : Object) return String with Inline;
-- Filename for the up arrow image used in the status page
function Down_Image (O : Object) return String with Inline;
-- Filename for the down arrow image used in the status page
function Logo_Image (O : Object) return String with Inline;
-- Filename for the AWS logo image used in the status page
--------------
-- Timeouts --
--------------
function Cleaner_Wait_For_Client_Timeout (O : Object) return Duration
with Inline;
-- Number of seconds to timout on waiting for a client request.
-- This is a timeout for regular cleaning task.
function Cleaner_Client_Header_Timeout (O : Object) return Duration
with Inline;
-- Number of seconds to timout on waiting for client header.
-- This is a timeout for regular cleaning task.
function Cleaner_Client_Data_Timeout (O : Object) return Duration
with Inline;
-- Number of seconds to timout on waiting for client message body.
-- This is a timeout for regular cleaning task.
function Cleaner_Server_Response_Timeout (O : Object) return Duration
with Inline;
-- Number of seconds to timout on waiting for client to accept answer.
-- This is a timeout for regular cleaning task.
function Force_Wait_For_Client_Timeout (O : Object) return Duration
with Inline;
-- Number of seconds to timout on waiting for a client request.
-- This is a timeout for urgent request when resources are missing.
function Force_Client_Header_Timeout (O : Object) return Duration
with Inline;
-- Number of seconds to timout on waiting for client header.
-- This is a timeout for urgent request when resources are missing.
function Force_Client_Data_Timeout (O : Object) return Duration with Inline;
-- Number of seconds to timout on waiting for client message body.
-- This is a timeout for urgent request when resources are missing.
function Force_Server_Response_Timeout (O : Object) return Duration
with Inline;
-- Number of seconds to timout on waiting for client to accept answer.
-- This is a timeout for urgent request when resources are missing.
function Send_Timeout (O : Object) return Duration with Inline;
-- Number of seconds to timeout when sending chunck of data
function Receive_Timeout (O : Object) return Duration with Inline;
-- Number of seconds to timeout when receiving chunck of data
--------------
-- Security --
--------------
function Check_URL_Validity (O : Object) return Boolean with Inline;
-- Server have to check URI for validity. For example it checks that an
-- URL does not reference a resource above the Web root.
function Security (O : Object) return Boolean with Inline;
-- Is the server working through th SSL
function Certificate (O : Object) return String with Inline;
-- Returns the certificate to be used with the secure server. Returns the
-- empty string if the server is not a secure one.
function Key (O : Object) return String with Inline;
-- Returns the key to be used with the secure server. Returns the
-- empty string if the server is not a secure one.
function Security_Mode (O : Object) return String with Inline;
-- Returns the security mode to be used with the secure server. Returns the
-- empty string if the server is not a secure one.
function Cipher_Priorities (O : Object) return String with Inline;
-- Returns the cipher priorities for the security communication
function TLS_Ticket_Support (O : Object) return Boolean with Inline;
-- Is security communication side has support stateless TLS session
-- resumption. See RFC 5077.
function Exchange_Certificate (O : Object) return Boolean with Inline;
-- Returns True if the client is requested to send its certificate to the
-- server.
function Certificate_Required (O : Object) return Boolean with Inline;
-- Returns True if the server must abort the connection if the
-- client did not provide trusted certificate. If this option is set
-- the Exchange_Certificate must also be set.
function Trusted_CA (O : Object) return String with Inline;
-- Returns the filename containing a list of trusted CA, this is to be used
-- with the Exchange_Certificate option. The filename is on bundle of CAs
-- that can be trusted. A client certificate signed with one of those CA
-- will be accetped by the server.
function CRL_File (O : Object) return String with Inline;
-- Returns the filename containing the Certificate Revocation List. This
-- list is used by the server to check for revoked certificate.
function SSL_Session_Cache_Size (O : Object) return Natural with Inline;
-- Returns SSL session cashe size
-------------------------
-- Per Process options --
-------------------------
function Session_Cleanup_Interval return Duration with Inline;
-- Number of seconds between each run of the cleaner task to remove
-- obsolete session data.
function Session_Lifetime return Duration with Inline;
-- Number of seconds to keep a session if not used. After this period the
-- session data is obsoleted and will be removed during next cleanup.
function Session_Id_Length return Positive with Inline;
-- Returns the length (number of characters) of the session id
function Session_Cleaner_Priority return System.Any_Priority with Inline;
-- Returns the priority used by the session cleaner task
function Service_Priority return System.Any_Priority with Inline;
-- Returns the priority used by the others services (SMTP server, Jabber
-- server, Push server...).
function Config_Directory return String with Inline;
-- Directory where AWS parameter files are located
function Transient_Cleanup_Interval return Duration with Inline;
-- Number of seconds between each run of the cleaner task to remove
-- transient pages.
function Transient_Lifetime return Duration with Inline;
-- Number of seconds to keep a transient page. After this period the
-- transient page is obsoleted and will be removed during next cleanup.
function Max_Concurrent_Download return Positive with Inline;
-- Number of maximum concurrent download supported by the download manager
-- service.
function MIME_Types return String with Inline;
-- Returns the file name of the MIME types to use
function Input_Line_Size_Limit return Positive with Inline;
-- Limit of the HTTP protocol text lines length
function Context_Lifetime return Duration with Inline;
-- Number of seconds to keep a context if not used. After this period the
-- context data is obsoleted and will be removed during next cleanup.
function Max_WebSocket_Handler return Positive with Inline;
-- This is the max simultaneous connections handling WebSocket's messages
function WebSocket_Message_Queue_Size return Positive with Inline;
-- This is the size of the queue containing incoming messages
function WebSocket_Send_Message_Queue_Size return Positive with Inline;
-- This is the size of the queue containing messages to send
function Max_WebSocket return Positive with Inline;
-- The maximum number of simultaneous WebSocket opened. Note that that
-- there could be more WebSocket registered when counting the closing
-- WebSockets.
function WebSocket_Timeout return Duration with Inline;
-- Returns the WebSocket activity timeout. After this number of seconds
-- without any activity the WebSocket can be closed when needed.
function Is_WebSocket_Origin_Set return Boolean with Inline;
-- Returns True if the Origin has been set
function WebSocket_Origin return GNAT.Regexp.Regexp;
-- This is regular expression to restrict WebSocket to a specific origin
function WebSocket_Origin return String;
-- This is the string regular expression to restrict WebSocket to a
-- specific origin.
function WebSocket_Priority return System.Any_Priority;
-- Set the priority used by the WebSocket service
function User_Agent return String with Inline;
-- Returns the User_Agent header value
private
use Ada.Strings.Unbounded;
package SV renames AWS.Containers.String_Vectors;
-- List of token (keyword) recognized by the parser. There must be one
-- entry for every option name to be handled.
type Parameter_Name is
-- Per server option
(Server_Name,
WWW_Root,
Admin_URI,
Admin_Password,
Admin_Realm,
Protocol_Family,
IPv6_Only,
Server_Host,
Server_Port,
Server_Priority,
Server_Header,
Security,
Certificate,
Key,
Security_Mode,
Cipher_Priorities,
TLS_Ticket_Support,
Exchange_Certificate,
Certificate_Required,
Trusted_CA,
CRL_File,
SSL_Session_Cache_Size,
Hotplug_Port,
Max_Connection,
Send_Buffer_Size,
TCP_No_Delay,
Free_Slots_Keep_Alive_Limit,
Keep_Alive_Force_Limit,
Keep_Alive_Close_Limit,
Accept_Queue_Size,
Log_File_Directory,
Log_Filename_Prefix,
Log_Extended_Fields,
Log_Split_Mode,
Log_Size_Limit,
Log_Activated,
Error_Log_Filename_Prefix,
Error_Log_Split_Mode,
Error_Log_Activated,
Upload_Directory,
Upload_Size_Limit,
Session,
Session_Name,
Session_Private_Name,
Cleaner_Wait_For_Client_Timeout,
Cleaner_Client_Header_Timeout,
Cleaner_Client_Data_Timeout,
Cleaner_Server_Response_Timeout,
Force_Wait_For_Client_Timeout,
Force_Client_Header_Timeout,
Force_Client_Data_Timeout,
Force_Server_Response_Timeout,
Send_Timeout,
Receive_Timeout,
Status_Page,
Directory_Browser_Page,
Up_Image,
Down_Image,
Logo_Image,
Line_Stack_Size,
Reuse_Address,
Check_URL_Validity,
Case_Sensitive_Parameters,
Max_POST_Parameters,
-- Per process options
Session_Cleanup_Interval,
Session_Lifetime,
Session_Id_Length,
Session_Cleaner_Priority,
Service_Priority,
Config_Directory,
User_Agent,
Transient_Cleanup_Interval,
Transient_Lifetime,
Input_Line_Size_Limit,
Max_Concurrent_Download,
Max_WebSocket_Handler,
MIME_Types,
WebSocket_Message_Queue_Size,
WebSocket_Send_Message_Queue_Size,
WebSocket_Origin,
WebSocket_Priority,
Max_WebSocket,
WebSocket_Timeout,
Context_Lifetime);
subtype Server_Parameter_Name is Parameter_Name
range Server_Name .. Max_POST_Parameters;
subtype Process_Parameter_Name is Parameter_Name
range Session_Cleanup_Interval .. Context_Lifetime;
type Value_Type is (Str, Dir, Nat, Pos, Dur, Bool, Str_Vect, Regexp);
type Values (Kind : Value_Type := Str) is record
case Kind is
when Str =>
Str_Value : Unbounded_String;
when Dir =>
Dir_Value : Unbounded_String;
when Pos =>
Pos_Value : Positive;
when Nat =>
Nat_Value : Natural;
when Dur =>
Dur_Value : Duration;
when Bool =>
Bool_Value : Boolean;
when Str_Vect =>
Strs_Value : SV.Vector;
when Regexp =>
Is_Set : Boolean;
Pattern : GNAT.Regexp.Regexp;
Regexp_Str : Unbounded_String;
end case;
end record;
type Parameter_Set is array (Parameter_Name range <>) of Values;
function "+"
(Str : String) return Unbounded_String renames To_Unbounded_String;
Default_Parameters : constant Parameter_Set (Server_Parameter_Name) :=
(Cleaner_Wait_For_Client_Timeout =>
(Dur, Default.Cleaner_Wait_For_Client_Timeout),
Cleaner_Client_Header_Timeout =>
(Dur, Default.Cleaner_Client_Header_Timeout),
Cleaner_Client_Data_Timeout =>
(Dur, Default.Cleaner_Client_Data_Timeout),
Cleaner_Server_Response_Timeout =>
(Dur, Default.Cleaner_Server_Response_Timeout),
Force_Wait_For_Client_Timeout =>
(Dur, Default.Force_Wait_For_Client_Timeout),
Force_Client_Header_Timeout =>
(Dur, Default.Force_Client_Header_Timeout),
Force_Client_Data_Timeout =>
(Dur, Default.Force_Client_Data_Timeout),
Force_Server_Response_Timeout =>
(Dur, Default.Force_Server_Response_Timeout),
Send_Timeout =>
(Dur, Default.Send_Timeout),
Receive_Timeout =>
(Dur, Default.Receive_Timeout),
Status_Page =>
(Str, +Default.Status_Page),
Directory_Browser_Page =>
(Str, +Default.Directory_Browser_Page),
Up_Image =>
(Str, +Default.Up_Image),
Down_Image =>
(Str, +Default.Down_Image),
Logo_Image =>
(Str, +Default.Logo_Image),
Admin_Password =>
(Str, +Default.Admin_Password),
Admin_Realm =>
(Str, +Default.Admin_Realm),
Admin_URI =>
(Str, +Default.Admin_URI),
Server_Name =>
(Str, +Default.Server_Name),
WWW_Root =>
(Dir, +Default.WWW_Root),
Log_File_Directory =>
(Dir, +Default.Log_File_Directory),
Log_Filename_Prefix =>
(Str, +Default.Log_Filename_Prefix),
Log_Extended_Fields =>
(Str_Vect, SV.Empty_Vector),
Log_Split_Mode =>
(Str, +Default.Log_Split_Mode),
Log_Size_Limit =>
(Nat, Default.Log_Size_Limit),
Log_Activated =>
(Bool, Default.Log_Activated),
Error_Log_Filename_Prefix =>
(Str, +Default.Error_Log_Filename_Prefix),
Error_Log_Split_Mode =>
(Str, +Default.Error_Log_Split_Mode),
Error_Log_Activated =>
(Bool, Default.Error_Log_Activated),
Upload_Directory =>
(Dir, +Default.Upload_Directory),
Upload_Size_Limit =>
(Pos, Default.Upload_Size_Limit),
Max_Connection =>
(Pos, Default.Max_Connection),
Send_Buffer_Size =>
(Nat, Default.Send_Buffer_Size),
TCP_No_Delay =>
(Bool, Default.TCP_No_Delay),
Free_Slots_Keep_Alive_Limit =>
(Nat, Default.Free_Slots_Keep_Alive_Limit),
Keep_Alive_Force_Limit =>
(Nat, Default.Keep_Alive_Force_Limit),
Keep_Alive_Close_Limit =>
(Nat, Default.Keep_Alive_Close_Limit),
Accept_Queue_Size =>
(Pos, Default.Accept_Queue_Size),
Protocol_Family =>
(Str, +Default.Protocol_Family),
IPv6_Only =>
(Bool, Default.IPv6_Only),
Server_Host =>
(Str, Null_Unbounded_String),
Server_Port =>
(Nat, Default.Server_Port),
Server_Priority =>
(Nat, Default.Server_Priority),
Server_Header =>
(Str, +Default.Server_Header),
Hotplug_Port =>
(Pos, Default.Hotplug_Port),
Session =>
(Bool, Default.Session),
Session_Name =>
(Str, +Default.Session_Name),
Session_Private_Name =>
(Str, +Default.Session_Private_Name),
Security =>
(Bool, Default.Security),
Certificate =>
(Str, +Default.Certificate),
Key =>
(Str, +Default.Key),
Security_Mode =>
(Str, +Default.Security_Mode),
Cipher_Priorities =>
(Str, +Default.Cipher_Priorities),
TLS_Ticket_Support =>
(Bool, Default.TLS_Ticket_Support),
Exchange_Certificate =>
(Bool, Default.Exchange_Certificate),
Certificate_Required =>
(Bool, Default.Certificate_Required),
Trusted_CA =>
(Str, +Default.Trusted_CA),
CRL_File =>
(Str, +Default.CRL_File),
SSL_Session_Cache_Size =>
(Nat, Default.SSL_Session_Cache_Size),
Case_Sensitive_Parameters =>
(Bool, Default.Case_Sensitive_Parameters),
Check_URL_Validity =>
(Bool, Default.Check_URL_Validity),
Line_Stack_Size =>
(Pos, Default.Line_Stack_Size),
Reuse_Address =>
(Bool, Default.Reuse_Address),
Max_POST_Parameters =>
(Pos, Default.Max_POST_Parameters));
type Object is record
P : Parameter_Set (Server_Parameter_Name) := Default_Parameters;
end record;
Default_Config : constant Object := (P => Default_Parameters);
Process_Options : Parameter_Set (Process_Parameter_Name) :=
(Session_Cleanup_Interval =>
(Dur, Default.Session_Cleanup_Interval),
Session_Lifetime =>
(Dur, Default.Session_Lifetime),
Session_Id_Length =>
(Pos, Default.Session_Id_Length),
Session_Cleaner_Priority =>
(Nat, Default.Session_Cleaner_Priority),
Service_Priority =>
(Nat, Default.Service_Priority),
Config_Directory =>
(Str, +Default.Config_Directory),
User_Agent =>
(Str, +Default.User_Agent),
Transient_Cleanup_Interval =>
(Dur, Default.Transient_Cleanup_Interval),
Transient_Lifetime =>
(Dur, Default.Transient_Lifetime),
Input_Line_Size_Limit =>
(Pos, Default.Input_Line_Size_Limit),
Max_Concurrent_Download =>
(Pos, Default.Max_Concurrent_Download),
Max_WebSocket =>
(Pos, Default.Max_WebSocket),
Max_WebSocket_Handler =>
(Pos, Default.Max_WebSocket_Handler),
MIME_Types =>
(Str, +Default.MIME_Types),
WebSocket_Message_Queue_Size =>
(Pos, Default.WebSocket_Message_Queue_Size),
WebSocket_Send_Message_Queue_Size =>
(Pos, Default.WebSocket_Send_Message_Queue_Size),
WebSocket_Origin =>
(Regexp, False, Pattern => <>,
Regexp_Str => Null_Unbounded_String),
WebSocket_Priority =>
(Nat, Default.WebSocket_Priority),
WebSocket_Timeout =>
(Dur, Default.WebSocket_Timeout),
Context_Lifetime =>
(Dur, Default.Context_Lifetime));
end AWS.Config;
|
reznikmm/matreshka | Ada | 4,011 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Style_Page_Usage_Attributes;
package Matreshka.ODF_Style.Page_Usage_Attributes is
type Style_Page_Usage_Attribute_Node is
new Matreshka.ODF_Style.Abstract_Style_Attribute_Node
and ODF.DOM.Style_Page_Usage_Attributes.ODF_Style_Page_Usage_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Style_Page_Usage_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Style_Page_Usage_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Style.Page_Usage_Attributes;
|
stcarrez/ada-servlet | Ada | 16,763 | adb | -----------------------------------------------------------------------
-- servlet-routes-tests - Unit tests for Servlet.Routes
-- Copyright (C) 2015, 2016, 2017, 2020, 2021 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Measures;
with Util.Log.Loggers;
with Util.Test_Caller;
package body Servlet.Routes.Tests is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Servlet.Routes.Tests");
package Caller is new Util.Test_Caller (Test, "Routes");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Servlet.Routes.Add_Route (/)",
Test_Add_Route_With_Root_Path'Access);
Caller.Add_Test (Suite, "Test Servlet.Routes.Add_Route (fixed path)",
Test_Add_Route_With_Path'Access);
Caller.Add_Test (Suite, "Test Servlet.Routes.Add_Route (:param path)",
Test_Add_Route_With_Param'Access);
Caller.Add_Test (Suite, "Test Servlet.Routes.Add_Route ({param} path)",
Test_Add_Route_With_Param_Alt'Access);
Caller.Add_Test (Suite, "Test Servlet.Routes.Add_Route (*.ext path)",
Test_Add_Route_With_Ext'Access);
Caller.Add_Test (Suite, "Test Servlet.Routes.Add_Route (#{} path)",
Test_Add_Route_With_EL'Access);
Caller.Add_Test (Suite, "Test Servlet.Routes.Iterate",
Test_Iterate'Access);
Caller.Add_Test (Suite, "Test Servlet.Routes.Add_Route (/*)",
Test_Wildcard_Route'Access);
end Add_Tests;
overriding
function Get_Value (Bean : in Test_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Bean.Id);
elsif Name = "name" then
return Util.Beans.Objects.To_Object (Bean.Name);
else
return Util.Beans.Objects.Null_Object;
end if;
end Get_Value;
overriding
procedure Set_Value (Bean : in out Test_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Bean.Id := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "name" then
Bean.Name := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
-- ------------------------------
-- Setup the test instance.
-- ------------------------------
overriding
procedure Set_Up (T : in out Test) is
begin
T.Bean := new Test_Bean;
Servlet.Tests.EL_Test (T).Set_Up;
T.Root_Resolver.Register (Ada.Strings.Unbounded.To_Unbounded_String ("user"),
Util.Beans.Objects.To_Object (T.Bean.all'Access));
for I in T.Routes'Range loop
T.Routes (I) := Route_Type_Refs.Create
(new Test_Route_Type '(Util.Refs.Ref_Entity with Index => I));
end loop;
end Set_Up;
-- ------------------------------
-- Verify that the path matches the given route.
-- ------------------------------
procedure Verify_Route (T : in out Test;
Router : in out Router_Type;
Path : in String;
Index : in Positive;
Bean : in out Test_Bean'Class) is
use type Route_Type_Refs.Ref;
Route : constant Route_Type_Ref := T.Routes (Index);
R : Route_Context_Type;
begin
Router.Find_Route (Path, R);
declare
P : constant String := Get_Path (R);
begin
T.Assert_Equals (Path, P, "Add_Route + Find_Route with " & Path);
T.Assert (not Is_Null (R), "Get_Route returns a null route for " & Path);
T.Assert (Get_Route (R) = Route, "Get_Route returns a wrong route for " & Path);
-- Inject the path parameters in the bean instance.
Inject_Parameters (R, Bean, T.ELContext.all);
end;
end Verify_Route;
-- ------------------------------
-- Add the route associated with the path pattern.
-- ------------------------------
procedure Add_Route (T : in out Test;
Router : in out Router_Type;
Path : in String;
Index : in Positive;
Bean : in out Test_Bean'Class) is
procedure Insert (Route : in out Servlet.Routes.Route_Type_Ref);
procedure Insert (Route : in out Servlet.Routes.Route_Type_Ref) is
begin
Route := T.Routes (Index);
end Insert;
begin
Router.Add_Route (Path, T.ELContext.all, Insert'Access);
Verify_Route (T, Router, Path, Index, Bean);
end Add_Route;
-- ------------------------------
-- Test the Add_Route with "/".
-- ------------------------------
procedure Test_Add_Route_With_Root_Path (T : in out Test) is
Router : Router_Type;
Bean : Test_Bean;
begin
Add_Route (T, Router, "/", 1, Bean);
Add_Route (T, Router, "/item", 2, Bean);
Verify_Route (T, Router, "/", 1, Bean);
Verify_Route (T, Router, "/item", 2, Bean);
Add_Route (T, Router, "/", 3, Bean);
Verify_Route (T, Router, "/", 3, Bean);
Verify_Route (T, Router, "/item", 2, Bean);
end Test_Add_Route_With_Root_Path;
-- ------------------------------
-- Test the Add_Route with simple fixed path components.
-- Example: /list/index.html
-- ------------------------------
procedure Test_Add_Route_With_Path (T : in out Test) is
Router : Router_Type;
Bean : Test_Bean;
begin
Add_Route (T, Router, "/page.html", 1, Bean);
Add_Route (T, Router, "/list/page.html", 2, Bean);
Add_Route (T, Router, "/list/index.html", 3, Bean);
Add_Route (T, Router, "/view/page/content/index.html", 4, Bean);
Add_Route (T, Router, "/list//page/view.html", 5, Bean);
Add_Route (T, Router, "/list////page/content.html", 6, Bean);
Verify_Route (T, Router, "/list/index.html", 3, Bean);
end Test_Add_Route_With_Path;
-- ------------------------------
-- Test the Add_Route with extension mapping.
-- Example: /list/*.html
-- ------------------------------
procedure Test_Add_Route_With_Ext (T : in out Test) is
Router : Router_Type;
Bean : Test_Bean;
begin
Add_Route (T, Router, "/page.html", 1, Bean);
Add_Route (T, Router, "/list/*.html", 2, Bean);
Add_Route (T, Router, "/list/index.html", 3, Bean);
Add_Route (T, Router, "/view/page/content/page1.html", 4, Bean);
Add_Route (T, Router, "/view/page/content/page2.html", 5, Bean);
Add_Route (T, Router, "/view/page/content/*.html", 6, Bean);
Add_Route (T, Router, "/ajax/*", 7, Bean);
Add_Route (T, Router, "*.html", 8, Bean);
-- Verify precedence and wildcard matching.
Verify_Route (T, Router, "/list/index.html", 3, Bean);
Verify_Route (T, Router, "/list/admin.html", 2, Bean);
Verify_Route (T, Router, "/list/1/2/3/admin.html", 2, Bean);
Verify_Route (T, Router, "/view/page/content/t.html", 6, Bean);
Verify_Route (T, Router, "/view/page/content/1/t.html", 6, Bean);
Verify_Route (T, Router, "/view/page/content/1/2/t.html", 6, Bean);
Verify_Route (T, Router, "/ajax/form/save", 7, Bean);
Verify_Route (T, Router, "/view/index.html", 8, Bean);
Add_Route (T, Router, "/ajax/timeKeeper/*", 9, Bean);
Verify_Route (T, Router, "/ajax/form/save", 7, Bean);
Verify_Route (T, Router, "/ajax/timeKeeper/save", 9, Bean);
end Test_Add_Route_With_Ext;
-- ------------------------------
-- Test the wildcard route /* with a path whose starting index is > 1.
-- ------------------------------
procedure Test_Wildcard_Route (T : in out Test) is
Router : Router_Type;
Bean : Test_Bean;
Path : constant String := "/v1";
begin
Add_Route (T, Router, "/*", 1, Bean);
Verify_Route (T, Router, Path (4 .. 3), 1, Bean);
end Test_Wildcard_Route;
-- ------------------------------
-- Test the Add_Route with fixed path components and path parameters.
-- Example: /users/:id/view.html
-- ------------------------------
procedure Test_Add_Route_With_Param (T : in out Test) is
use Ada.Strings.Unbounded;
Router : Router_Type;
Bean : Test_Bean;
begin
Add_Route (T, Router, "/users/:id/view.html", 1, Bean);
T.Assert_Equals (":id", To_String (Bean.Id), "Bean injection failed for :id");
Bean.Id := To_Unbounded_String ("");
Add_Route (T, Router, "/users/:id/list.html", 2, Bean);
T.Assert_Equals (":id", To_String (Bean.Id), "Bean injection failed for :id");
Bean.Id := To_Unbounded_String ("");
Add_Route (T, Router, "/users/:id/index.html", 3, Bean);
T.Assert_Equals (":id", To_String (Bean.Id), "Bean injection failed for :id");
Bean.Id := To_Unbounded_String ("");
Add_Route (T, Router, "/view/page/content/index.html", 4, Bean);
Add_Route (T, Router, "/list//page/view.html", 5, Bean);
Add_Route (T, Router, "/list////page/content.html", 6, Bean);
T.Assert_Equals ("", To_String (Bean.Id), "Bean injection failed for fixed path");
Add_Route (T, Router, "/users/:id/:name/index.html", 7, Bean);
T.Assert_Equals (":id", To_String (Bean.Id), "Bean injection failed for :id");
T.Assert_Equals (":name", To_String (Bean.Name), "Bean injection failed for :name");
Add_Route (T, Router, "/users/list/index.html", 8, Bean);
Verify_Route (T, Router, "/users/1234/view.html", 1, Bean);
T.Assert_Equals ("1234", To_String (Bean.Id), "Bean injection failed for :id");
Verify_Route (T, Router, "/users/234/567/index.html", 7, Bean);
T.Assert_Equals ("234", To_String (Bean.Id), "Bean injection failed for :id");
T.Assert_Equals ("567", To_String (Bean.Name), "Bean injection failed for :name");
end Test_Add_Route_With_Param;
-- ------------------------------
-- Test the Add_Route with fixed path components and path parameters.
-- Example: /users/{id}/view.html
-- ------------------------------
procedure Test_Add_Route_With_Param_Alt (T : in out Test) is
use Ada.Strings.Unbounded;
Router : Router_Type;
Bean : Test_Bean;
begin
Add_Route (T, Router, "/users/{id}/view.html", 1, Bean);
T.Assert_Equals ("{id}", To_String (Bean.Id), "Bean injection failed for {id}");
Bean.Id := To_Unbounded_String ("");
Add_Route (T, Router, "/users/{id}/list.html", 2, Bean);
T.Assert_Equals ("{id}", To_String (Bean.Id), "Bean injection failed for {id}");
Bean.Id := To_Unbounded_String ("");
Add_Route (T, Router, "/users/{id}/index.html", 3, Bean);
T.Assert_Equals ("{id}", To_String (Bean.Id), "Bean injection failed for {id}");
Bean.Id := To_Unbounded_String ("");
Add_Route (T, Router, "/view/page/content/index.html", 4, Bean);
Add_Route (T, Router, "/list//page/view.html", 5, Bean);
Add_Route (T, Router, "/list////page/content.html", 6, Bean);
T.Assert_Equals ("", To_String (Bean.Id), "Bean injection failed for fixed path");
Add_Route (T, Router, "/users/{id}/{name}/index.html", 7, Bean);
T.Assert_Equals ("{id}", To_String (Bean.Id), "Bean injection failed for {id}");
T.Assert_Equals ("{name}", To_String (Bean.Name), "Bean injection failed for {name}");
Add_Route (T, Router, "/users/list/index.html", 8, Bean);
Verify_Route (T, Router, "/users/1234/view.html", 1, Bean);
T.Assert_Equals ("1234", To_String (Bean.Id), "Bean injection failed for {id}");
Verify_Route (T, Router, "/users/234/567/index.html", 7, Bean);
T.Assert_Equals ("234", To_String (Bean.Id), "Bean injection failed for {id}");
T.Assert_Equals ("567", To_String (Bean.Name), "Bean injection failed for {name}");
end Test_Add_Route_With_Param_Alt;
-- ------------------------------
-- Test the Add_Route with fixed path components and EL path injection.
-- Example: /users/#{user.id}/view.html
-- ------------------------------
procedure Test_Add_Route_With_EL (T : in out Test) is
use Ada.Strings.Unbounded;
Router : Router_Type;
Bean : aliased Test_Bean;
begin
Add_Route (T, Router, "/users/#{user.id}", 1, Bean);
Add_Route (T, Router, "/users/view.html", 2, Bean);
Add_Route (T, Router, "/users/#{user.id}/#{user.name}/index.html", 3, Bean);
Add_Route (T, Router, "/users/admin/#{user.id}/pages/#{user.name}", 4, Bean);
-- Verify that the path parameters are injected in the 'user' bean (= T.Bean).
Verify_Route (T, Router, "/users/234/567/index.html", 3, Bean);
T.Assert_Equals ("234", To_String (T.Bean.Id), "Bean injection failed for :id");
T.Assert_Equals ("567", To_String (T.Bean.Name), "Bean injection failed for :name");
end Test_Add_Route_With_EL;
P_1 : aliased constant String := "/list/index.html";
P_2 : aliased constant String := "/users/:id";
P_3 : aliased constant String := "/users/:id/view";
P_4 : aliased constant String := "/users/index.html";
P_5 : aliased constant String := "/users/:id/:name";
P_6 : aliased constant String := "/users/:id/:name/view.html";
P_7 : aliased constant String := "/users/:id/list";
P_8 : aliased constant String := "/users/test.html";
P_9 : aliased constant String := "/admin/1/2/3/4/5/list.html";
P_10 : aliased constant String := "/admin/*.html";
P_11 : aliased constant String := "/admin/*.png";
P_12 : aliased constant String := "/admin/*.jpg";
P_13 : aliased constant String := "/users/:id/page/*.xml";
P_14 : aliased constant String := "/*.jsf";
type Const_String_Access is access constant String;
type String_Array is array (Positive range <>) of Const_String_Access;
Path_Array : constant String_Array :=
(P_1'Access, P_2'Access, P_3'Access, P_4'Access,
P_5'Access, P_6'Access, P_7'Access, P_8'Access,
P_9'Access, P_10'Access, P_11'Access, P_12'Access,
P_13'Access, P_14'Access);
-- ------------------------------
-- Test the Iterate over several paths.
-- ------------------------------
procedure Test_Iterate (T : in out Test) is
procedure Process (Pattern : in String;
Route : in Route_Type_Accessor);
Router : Router_Type;
Bean : Test_Bean;
procedure Process (Pattern : in String;
Route : in Route_Type_Accessor) is
begin
-- T.Assert (Route /= null, "The route is null for " & Pattern);
T.Assert (Route in Test_Route_Type'Class, "Invalid route for " & Pattern);
Log.Info ("Route {0} to {1}", Pattern,
Natural'Image (Test_Route_Type (Route.Element.all).Index));
T.Assert_Equals (Pattern, Path_Array (Test_Route_Type (Route.Element.all).Index).all,
"Invalid route for " & Pattern);
end Process;
begin
for I in Path_Array'Range loop
Add_Route (T, Router, Path_Array (I).all, I, Bean);
end loop;
Router.Iterate (Process'Access);
declare
St : Util.Measures.Stamp;
begin
for I in 1 .. 1000 loop
declare
R : Route_Context_Type;
begin
Router.Find_Route ("/admin/1/2/3/4/5/list.html", R);
end;
end loop;
Util.Measures.Report (St, "Find 1000 routes (fixed path)");
end;
declare
St : Util.Measures.Stamp;
begin
for I in 1 .. 1000 loop
declare
R : Route_Context_Type;
begin
Router.Find_Route ("/admin/1/2/3/4/5/list.jsf", R);
end;
end loop;
Util.Measures.Report (St, "Find 1000 routes (extension)");
end;
end Test_Iterate;
end Servlet.Routes.Tests;
|
RREE/ada-util | Ada | 4,963 | ads | -----------------------------------------------------------------------
-- Util.Beans.Objects.Datasets -- Datasets
-- Copyright (C) 2013, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Hash;
with Ada.Finalization;
with Ada.Containers.Indefinite_Hashed_Maps;
with Util.Beans.Basic;
-- == Datasets ==
-- The `Datasets` package implements the `Dataset` list bean which
-- defines a set of objects organized in rows and columns. The `Dataset`
-- implements the `List_Bean` interface and allows to iterate over its rows.
-- Each row defines a `Bean` instance and allows to access each column value.
-- Each column is associated with a unique name. The row `Bean` allows to
-- get or set the column by using the column name.
package Util.Beans.Objects.Datasets is
Invalid_State : exception;
-- An array of objects.
type Object_Array is array (Positive range <>) of Object;
type Dataset is new Util.Beans.Basic.List_Bean with private;
-- Get the number of elements in the list.
overriding
function Get_Count (From : in Dataset) return Natural;
-- Set the current row index. Valid row indexes start at 1.
overriding
procedure Set_Row_Index (From : in out Dataset;
Index : in Natural);
-- Get the element at the current row index.
overriding
function Get_Row (From : in Dataset) return Util.Beans.Objects.Object;
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
overriding
function Get_Value (From : in Dataset;
Name : in String) return Util.Beans.Objects.Object;
-- Append a row in the dataset and call the fill procedure to populate
-- the row content.
procedure Append (Into : in out Dataset;
Fill : not null access procedure (Data : in out Object_Array));
-- Add a column to the dataset. If the position is not specified,
-- the column count is incremented and the name associated with the last column.
-- Raises Invalid_State exception if the dataset contains some rows,
procedure Add_Column (Into : in out Dataset;
Name : in String;
Pos : in Natural := 0);
-- Clear the content of the dataset.
procedure Clear (Set : in out Dataset);
private
type Object_Array_Access is access all Object_Array;
type Dataset_Array is array (Positive range <>) of Object_Array_Access;
type Dataset_Array_Access is access all Dataset_Array;
package Dataset_Map is
new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String,
Element_Type => Positive,
Hash => Ada.Strings.Hash,
Equivalent_Keys => "=",
"=" => "=");
type Row is new Util.Beans.Basic.Bean with record
Data : Object_Array_Access;
Map : access Dataset_Map.Map;
end record;
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
overriding
function Get_Value (From : in Row;
Name : in String) return Util.Beans.Objects.Object;
-- Set the value identified by the name.
-- If the name cannot be found, the method should raise the No_Value
-- exception.
overriding
procedure Set_Value (From : in out Row;
Name : in String;
Value : in Util.Beans.Objects.Object);
type Dataset is new Ada.Finalization.Controlled and Util.Beans.Basic.List_Bean with record
Data : Dataset_Array_Access;
Count : Natural := 0;
Columns : Natural := 0;
Map : aliased Dataset_Map.Map;
Current : aliased Row;
Current_Pos : Natural := 0;
Row : Util.Beans.Objects.Object;
end record;
-- Initialize the dataset and the row bean instance.
overriding
procedure Initialize (Set : in out Dataset);
-- Release the dataset storage.
overriding
procedure Finalize (Set : in out Dataset);
end Util.Beans.Objects.Datasets;
|
AdaCore/libadalang | Ada | 154 | adb | with Ada.Text_IO; use Ada.Text_IO;
separate (P) procedure X (F : Integer) is
begin
Put_Line ("YO");
end X;
--% node.parent.f_name.p_referenced_decl()
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 671 | adb | with STM32_SVD; use STM32_SVD;
with STM32_SVD.RCC;
with STM32GD.Startup;
package body STM32GD.Board is
procedure Init is
begin
STM32_SVD.RCC.RCC_Periph.AHBENR.IOPAEN := 1;
STM32_SVD.RCC.RCC_Periph.AHBENR.IOPBEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.USART1EN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.SPI1EN := 1;
CLOCKS.Init;
BUTTON.Init;
LED.Init;
LED2.Init;
CSN.Init;
CSN.Set;
SCLK.Init;
MISO.Init;
MOSI.Init;
IRQ.Init;
CE.Init;
TX.Init;
RX.Init;
USART.Init;
SPI.Init;
RTC.Init;
STM32GD.Clear_Event;
end Init;
end STM32GD.Board;
|
reznikmm/matreshka | Ada | 4,551 | 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.Red_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Draw_Red_Attribute_Node is
begin
return Self : Draw_Red_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_Red_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Red_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Draw_URI,
Matreshka.ODF_String_Constants.Red_Attribute,
Draw_Red_Attribute_Node'Tag);
end Matreshka.ODF_Draw.Red_Attributes;
|
francesco-bongiovanni/ewok-kernel | Ada | 1,529 | 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 ewok.tasks_shared; use ewok.tasks_shared;
package ewok.sched
with SPARK_Mode => On
is
-----------------------------------------------
-- SPARK/ghost specific functions & procedures
-----------------------------------------------
function current_task_is_valid
return boolean
with ghost;
----------------------------------------------
-- sched functions
----------------------------------------------
function get_current return ewok.tasks_shared.t_task_id
with
inline,
pre => (current_task_is_valid);
procedure request_schedule
with SPARK_Mode => Off;
function task_elect return t_task_id
with SPARK_Mode => Off;
procedure init
with SPARK_Mode => Off;
end ewok.sched;
|
jwarwick/aoc_2020 | Ada | 1,035 | adb | with AUnit.Assertions; use AUnit.Assertions;
package body Day.Test is
procedure Test_Part1 (T : in out AUnit.Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
sum : constant Natural := anyone_sum("test1.txt");
begin
Assert(sum = 11, "Wrong group sum, expected 11, got " & Natural'IMAGE(sum));
end Test_Part1;
procedure Test_Part2 (T : in out AUnit.Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
sum : constant Natural := everyone_sum("test1.txt");
begin
Assert(sum = 6, "Wrong group sum, expected 6, got " & Natural'IMAGE(sum));
end Test_Part2;
function Name (T : Test) return AUnit.Message_String is
pragma Unreferenced (T);
begin
return AUnit.Format ("Test Day package");
end Name;
procedure Register_Tests (T : in out Test) is
use AUnit.Test_Cases.Registration;
begin
Register_Routine (T, Test_Part1'Access, "Test Part 1");
Register_Routine (T, Test_Part2'Access, "Test Part 2");
end Register_Tests;
end Day.Test;
|
zhmu/ananas | Ada | 244 | ads | -- { dg-do compile }
-- { dg-options "-gnatws" }
package Delta_Small is
type T is delta 0.1 range -0.8 .. 0.8;
for T'Small use 0.1;
for T'Size use 4;
type T2 is new T range -0.4 .. 0.4;
for T2'Small use 0.0625;
end Delta_Small;
|
damaki/libkeccak | Ada | 3,072 | ads | -------------------------------------------------------------------------------
-- Copyright (c) 2019, Daniel King
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * The name of the copyright holder may not be used to endorse or promote
-- Products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with Keccak.Generic_Duplex;
with Keccak.Generic_Sponge;
with Keccak.Padding;
pragma Elaborate_All (Keccak.Generic_Duplex);
pragma Elaborate_All (Keccak.Generic_Sponge);
-- @summary
-- Instantiation of Keccak-p[100,16], with a Sponge and Duplex built on top of it.
package Keccak.Keccak_100.Rounds_16
with SPARK_Mode => On
is
procedure Permute is new KeccakF_100_Permutation.Permute
(Num_Rounds => 16);
package Sponge is new Keccak.Generic_Sponge
(State_Size_Bits => KeccakF_100.State_Size_Bits,
State_Type => State,
Init_State => KeccakF_100.Init,
Permute => Permute,
XOR_Bits_Into_State => KeccakF_100_Lanes.XOR_Bits_Into_State,
Extract_Data => KeccakF_100_Lanes.Extract_Bytes,
Pad => Keccak.Padding.Pad101_Multi_Blocks);
package Duplex is new Keccak.Generic_Duplex
(State_Size_Bits => KeccakF_100.State_Size_Bits,
State_Type => State,
Init_State => KeccakF_100.Init,
Permute => Permute,
XOR_Bits_Into_State => KeccakF_100_Lanes.XOR_Bits_Into_State,
Extract_Bits => KeccakF_100_Lanes.Extract_Bits,
Pad => Keccak.Padding.Pad101_Single_Block,
Min_Padding_Bits => Keccak.Padding.Pad101_Min_Bits);
end Keccak.Keccak_100.Rounds_16;
|
MinimSecure/unum-sdk | Ada | 913 | adb | -- Copyright 2015-2016 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pack is
function Next (I : Integer) return Integer is
begin
return I + 1;
end Next;
procedure Discard (I : Integer) is
begin
null;
end Discard;
end Pack;
|
charlie5/lace | Ada | 2,576 | ads | with
openGL.Screen,
GLX;
package openGL.surface_Profile
--
-- Models an openGL surface profile.
--
is
type Item is tagged private;
type View is access all Item'Class;
type Items is array (Positive range <>) of Item;
type Views is array (Positive range <>) of View;
-------------------
-- Surface Quality
--
Irrelevant : constant Natural := Natural'Last;
type color_Buffer is
record
Bits_red : Natural := Irrelevant;
Bits_green : Natural := Irrelevant;
Bits_blue : Natural := Irrelevant;
Bits_luminence : Natural := Irrelevant;
Bits_alpha : Natural := Irrelevant;
Bits_alpha_mask : Natural := Irrelevant;
end record;
function Image (Self : in color_Buffer) return String;
type Qualities is
record
color_Buffer : surface_Profile.color_Buffer;
depth_buffer_Bits : Natural := Irrelevant;
stencil_buffer_Bits : Natural := Irrelevant;
end record;
default_Qualities : constant Qualities;
function Image (Self : in Qualities) return String;
---------
-- Forge
--
desired_Qualitites_unavailable : exception;
procedure define (Self : in out Item; Screen : access openGL.Screen.item'Class;
Desired : in Qualities := default_Qualities);
function fetch_All return surface_Profile.items;
--------------
-- Attributes
--
function Quality (Self : in Item) return Qualities;
function get_Visual (Self : in Item) return access glx.XVisualInfo;
private
type Item is tagged
record
glx_Config : glx.FBConfig;
Visual : access glx.XVisualInfo;
end record;
default_Qualities : constant Qualities := (color_Buffer => (Bits_red => 8,
Bits_green => 8,
Bits_blue => 8,
Bits_luminence => Irrelevant,
Bits_alpha => Irrelevant,
Bits_alpha_mask => Irrelevant),
depth_buffer_Bits => 24,
stencil_buffer_Bits => Irrelevant);
end openGL.surface_Profile;
|
reznikmm/matreshka | Ada | 9,495 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A named element supports using a string expression to specify its name.
-- This allows names of model elements to involve template parameters. The
-- actual name is evaluated from the string expression only when it is
-- sensible to do so (e.g., when a template is bound).
--
-- A named element is an element in a model that may have a name.
------------------------------------------------------------------------------
limited with AMF.UML.Dependencies.Collections;
with AMF.UML.Elements;
limited with AMF.UML.Namespaces.Collections;
limited with AMF.UML.Packages.Collections;
limited with AMF.UML.String_Expressions;
with League.Strings;
package AMF.UML.Named_Elements is
pragma Preelaborate;
type UML_Named_Element is limited interface
and AMF.UML.Elements.UML_Element;
type UML_Named_Element_Access is
access all UML_Named_Element'Class;
for UML_Named_Element_Access'Storage_Size use 0;
not overriding function Get_Client_Dependency
(Self : not null access constant UML_Named_Element)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is abstract;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
not overriding function Get_Name
(Self : not null access constant UML_Named_Element)
return AMF.Optional_String is abstract;
-- Getter of NamedElement::name.
--
-- The name of the NamedElement.
not overriding procedure Set_Name
(Self : not null access UML_Named_Element;
To : AMF.Optional_String) is abstract;
-- Setter of NamedElement::name.
--
-- The name of the NamedElement.
not overriding function Get_Name_Expression
(Self : not null access constant UML_Named_Element)
return AMF.UML.String_Expressions.UML_String_Expression_Access is abstract;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
not overriding procedure Set_Name_Expression
(Self : not null access UML_Named_Element;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is abstract;
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
not overriding function Get_Namespace
(Self : not null access constant UML_Named_Element)
return AMF.UML.Namespaces.UML_Namespace_Access is abstract;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
not overriding function Get_Qualified_Name
(Self : not null access constant UML_Named_Element)
return AMF.Optional_String is abstract;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
not overriding function Get_Visibility
(Self : not null access constant UML_Named_Element)
return AMF.UML.Optional_UML_Visibility_Kind is abstract;
-- Getter of NamedElement::visibility.
--
-- Determines where the NamedElement appears within different Namespaces
-- within the overall model, and its accessibility.
not overriding procedure Set_Visibility
(Self : not null access UML_Named_Element;
To : AMF.UML.Optional_UML_Visibility_Kind) is abstract;
-- Setter of NamedElement::visibility.
--
-- Determines where the NamedElement appears within different Namespaces
-- within the overall model, and its accessibility.
not overriding function All_Namespaces
(Self : not null access constant UML_Named_Element)
return AMF.UML.Namespaces.Collections.Ordered_Set_Of_UML_Namespace is abstract;
-- Operation NamedElement::allNamespaces.
--
-- The query allNamespaces() gives the sequence of namespaces in which the
-- NamedElement is nested, working outwards.
not overriding function All_Owning_Packages
(Self : not null access constant UML_Named_Element)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is abstract;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
not overriding function Is_Distinguishable_From
(Self : not null access constant UML_Named_Element;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is abstract;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
not overriding function Namespace
(Self : not null access constant UML_Named_Element)
return AMF.UML.Namespaces.UML_Namespace_Access is abstract;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
not overriding function Qualified_Name
(Self : not null access constant UML_Named_Element)
return League.Strings.Universal_String is abstract;
-- Operation NamedElement::qualifiedName.
--
-- When there is a name, and all of the containing namespaces have a name,
-- the qualified name is constructed from the names of the containing
-- namespaces.
not overriding function Separator
(Self : not null access constant UML_Named_Element)
return League.Strings.Universal_String is abstract;
-- Operation NamedElement::separator.
--
-- The query separator() gives the string that is used to separate names
-- when constructing a qualified name.
end AMF.UML.Named_Elements;
|
riccardo-bernardini/pulsada | Ada | 2,732 | adb | pragma Ada_2012;
with Ada.Command_Line;
with System.Address_To_Access_Conversions;
with Interfaces.C.Strings;
with Pulse_Def_H, Pulse_Sample_H;
use Ada;
package body Pulsada.Thin is
----------
-- Open --
----------
procedure Open
(Session : in out Session_Type;
Rate : Sampling_Frequency;
N_Channels : Channel_Index;
Application_Name : String := "";
Stream_Name : String := "")
is
use Pulse_Simple_H;
use Pulse_Sample_H;
use Interfaces;
function Use_Default (X, Default : String) return C.Strings.Chars_Ptr
is (C.Strings.New_String ((if X = "" then Default else X)));
Sample_Spec : aliased Pa_Sample_Spec := (Format => PA_SAMPLE_S16LE,
Rate => Unsigned_32 (Rate),
Channels => Unsigned_8 (N_Channels));
begin
Session.S := Pa_Simple_New
(Server => C.Strings.Null_Ptr,
Name => Use_Default (Application_Name, Command_Line.Command_Name),
Dir => Pulse_Def_H.PA_STREAM_RECORD,
Dev => C.Strings.Null_Ptr,
Stream_Name => Use_Default (Stream_Name, "stream"),
Ss => Sample_Spec'Access,
Map => null,
Attr => null,
Error => null);
end Open;
----------
-- Read --
----------
procedure Read
(Session : in out Session_Type;
Data : Frame_Block)
is
use Interfaces;
use Pulse_Simple_H;
use type Interfaces.C.Int;
pragma Warnings (Off);
package Convert is
new System.Address_To_Access_Conversions (Block_Buffer);
function Size (Data : Frame_Block) return C.Size_T
is (C.Size_T (Integer (Data.N_Frames) * Integer (Data.N_Channels) * 2));
Err : aliased C.Int;
begin
if Pa_Simple_Read (S => Session.S,
Data => Convert.To_Address (Convert.Object_Pointer (Data.Data)),
Bytes => Size (Data),
Error => Err'Access) < 0 then
null;
end if;
end Read;
-----------
-- Close --
-----------
procedure Close (Session : in out Session_Type) is
begin
Pulse_Simple_H.Pa_Simple_Free (Session.S);
end Close;
----------------
-- Initialize --
----------------
overriding procedure Initialize (Obj : in out Session_Type) is
begin
Obj.S := null;
end Initialize;
--------------
-- Finalize --
--------------
overriding procedure Finalize (Obj : in out Session_Type) is
begin
Obj.Close;
end Finalize;
end Pulsada.Thin;
|
gitter-badger/libAnne | Ada | 194,510 | adb | package body Mathematics.Arrays is
-------------------------------
-- Short Short Integer Array --
-------------------------------
function "+"(Value : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Assert is new Integer_Assert_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Negate is new Integer_Negate_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Absolute_Value is new Integer_Absolute_Value_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Add is new Integer_Add_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Short_Short_Integer_Array is
function Add is new Integer_Add_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Add is new Integer_Add_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Subtract is new Integer_Subtract_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Short_Short_Integer_Array is
function Subtract is new Integer_Subtract_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Subtract is new Integer_Subtract_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Multiply is new Integer_Multiply_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Short_Short_Integer_Array is
function Multiply is new Integer_Multiply_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Multiply is new Integer_Multiply_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Divide is new Integer_Divide_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Short_Short_Integer_Array is
function Divide is new Integer_Divide_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Divide is new Integer_Divide_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Remainder is new Integer_Remainder_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Short_Short_Integer_Array is
function Remainder is new Integer_Remainder_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Remainder is new Integer_Remainder_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Modulus is new Integer_Modulus_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Short_Short_Integer_Array is
function Modulus is new Integer_Modulus_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Short_Short_Integer_Array is
function Modulus is new Integer_Modulus_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Boolean is
function Equal is new Integer_Equal_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Boolean is
function Equal is new Integer_Equal_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Boolean is
function Equal is new Integer_Equal_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Boolean is
function Lesser is new Integer_Lesser_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Boolean is
function Greater is new Integer_Greater_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Boolean is
function Greater is new Integer_Greater_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Boolean is
function Greater is new Integer_Greater_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Short_Short_Integer_Array; Right : Short_Short_Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Short_Integer_Array; Right : Short_Short_Integer) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Scalar(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Short_Integer; Right : Short_Short_Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Scalar_Array(Short_Short_Integer, Short_Short_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------------
-- Short Integer Array --
-------------------------
function "+"(Value : Short_Integer_Array) return Short_Integer_Array is
function Assert is new Integer_Assert_Array(Short_Integer, Short_Integer_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Short_Integer_Array) return Short_Integer_Array is
function Negate is new Integer_Negate_Array(Short_Integer, Short_Integer_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Short_Integer_Array) return Short_Integer_Array is
function Absolute_Value is new Integer_Absolute_Value_Array(Short_Integer, Short_Integer_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Short_Integer_Array; Right : Short_Integer_Array) return Short_Integer_Array is
function Add is new Integer_Add_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Integer_Array; Right : Short_Integer) return Short_Integer_Array is
function Add is new Integer_Add_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Integer; Right : Short_Integer_Array) return Short_Integer_Array is
function Add is new Integer_Add_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Short_Integer_Array; Right : Short_Integer_Array) return Short_Integer_Array is
function Subtract is new Integer_Subtract_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Integer_Array; Right : Short_Integer) return Short_Integer_Array is
function Subtract is new Integer_Subtract_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Integer; Right : Short_Integer_Array) return Short_Integer_Array is
function Subtract is new Integer_Subtract_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Short_Integer_Array; Right : Short_Integer_Array) return Short_Integer_Array is
function Multiply is new Integer_Multiply_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Integer_Array; Right : Short_Integer) return Short_Integer_Array is
function Multiply is new Integer_Multiply_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Integer; Right : Short_Integer_Array) return Short_Integer_Array is
function Multiply is new Integer_Multiply_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Short_Integer_Array; Right : Short_Integer_Array) return Short_Integer_Array is
function Divide is new Integer_Divide_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Integer_Array; Right : Short_Integer) return Short_Integer_Array is
function Divide is new Integer_Divide_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Integer; Right : Short_Integer_Array) return Short_Integer_Array is
function Divide is new Integer_Divide_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Short_Integer_Array; Right : Short_Integer_Array) return Short_Integer_Array is
function Remainder is new Integer_Remainder_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Integer_Array; Right : Short_Integer) return Short_Integer_Array is
function Remainder is new Integer_Remainder_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Integer; Right : Short_Integer_Array) return Short_Integer_Array is
function Remainder is new Integer_Remainder_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Short_Integer_Array; Right : Short_Integer_Array) return Short_Integer_Array is
function Modulus is new Integer_Modulus_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Integer_Array; Right : Short_Integer) return Short_Integer_Array is
function Modulus is new Integer_Modulus_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Integer; Right : Short_Integer_Array) return Short_Integer_Array is
function Modulus is new Integer_Modulus_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Short_Integer_Array; Right : Short_Integer_Array) return Boolean is
function Equal is new Integer_Equal_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Integer_Array; Right : Short_Integer) return Boolean is
function Equal is new Integer_Equal_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Integer; Right : Short_Integer_Array) return Boolean is
function Equal is new Integer_Equal_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Short_Integer_Array; Right : Short_Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Integer_Array; Right : Short_Integer) return Boolean is
function Lesser is new Integer_Lesser_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Integer; Right : Short_Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Short_Integer_Array; Right : Short_Integer_Array) return Boolean is
function Greater is new Integer_Greater_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Integer_Array; Right : Short_Integer) return Boolean is
function Greater is new Integer_Greater_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Integer; Right : Short_Integer_Array) return Boolean is
function Greater is new Integer_Greater_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Short_Integer_Array; Right : Short_Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Integer_Array; Right : Short_Integer) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Integer; Right : Short_Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Short_Integer_Array; Right : Short_Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Array(Short_Integer, Short_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Integer_Array; Right : Short_Integer) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Scalar(Short_Integer, Short_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Integer; Right : Short_Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Scalar_Array(Short_Integer, Short_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------
-- Integer Array --
-------------------
function "+"(Value : Integer_Array) return Integer_Array is
function Assert is new Integer_Assert_Array(Integer, Integer_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Integer_Array) return Integer_Array is
function Negate is new Integer_Negate_Array(Integer, Integer_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Integer_Array) return Integer_Array is
function Absolute_Value is new Integer_Absolute_Value_Array(Integer, Integer_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Integer_Array; Right : Integer_Array) return Integer_Array is
function Add is new Integer_Add_Array_Array(Integer, Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Integer_Array; Right : Integer) return Integer_Array is
function Add is new Integer_Add_Array_Scalar(Integer, Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Integer; Right : Integer_Array) return Integer_Array is
function Add is new Integer_Add_Scalar_Array(Integer, Integer_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Integer_Array; Right : Integer_Array) return Integer_Array is
function Subtract is new Integer_Subtract_Array_Array(Integer, Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Integer_Array; Right : Integer) return Integer_Array is
function Subtract is new Integer_Subtract_Array_Scalar(Integer, Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Integer; Right : Integer_Array) return Integer_Array is
function Subtract is new Integer_Subtract_Scalar_Array(Integer, Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Integer_Array; Right : Integer_Array) return Integer_Array is
function Multiply is new Integer_Multiply_Array_Array(Integer, Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Integer_Array; Right : Integer) return Integer_Array is
function Multiply is new Integer_Multiply_Array_Scalar(Integer, Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Integer; Right : Integer_Array) return Integer_Array is
function Multiply is new Integer_Multiply_Scalar_Array(Integer, Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Integer_Array; Right : Integer_Array) return Integer_Array is
function Divide is new Integer_Divide_Array_Array(Integer, Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Integer_Array; Right : Integer) return Integer_Array is
function Divide is new Integer_Divide_Array_Scalar(Integer, Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Integer; Right : Integer_Array) return Integer_Array is
function Divide is new Integer_Divide_Scalar_Array(Integer, Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Integer_Array; Right : Integer_Array) return Integer_Array is
function Remainder is new Integer_Remainder_Array_Array(Integer, Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Integer_Array; Right : Integer) return Integer_Array is
function Remainder is new Integer_Remainder_Array_Scalar(Integer, Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Integer; Right : Integer_Array) return Integer_Array is
function Remainder is new Integer_Remainder_Scalar_Array(Integer, Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Integer_Array; Right : Integer_Array) return Integer_Array is
function Modulus is new Integer_Modulus_Array_Array(Integer, Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Integer_Array; Right : Integer) return Integer_Array is
function Modulus is new Integer_Modulus_Array_Scalar(Integer, Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Integer; Right : Integer_Array) return Integer_Array is
function Modulus is new Integer_Modulus_Scalar_Array(Integer, Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Integer_Array; Right : Integer_Array) return Boolean is
function Equal is new Integer_Equal_Array_Array(Integer, Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Integer_Array; Right : Integer) return Boolean is
function Equal is new Integer_Equal_Array_Scalar(Integer, Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Integer; Right : Integer_Array) return Boolean is
function Equal is new Integer_Equal_Scalar_Array(Integer, Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Integer_Array; Right : Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Array_Array(Integer, Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Integer_Array; Right : Integer) return Boolean is
function Lesser is new Integer_Lesser_Array_Scalar(Integer, Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Integer; Right : Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Scalar_Array(Integer, Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Integer_Array; Right : Integer_Array) return Boolean is
function Greater is new Integer_Greater_Array_Array(Integer, Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Integer_Array; Right : Integer) return Boolean is
function Greater is new Integer_Greater_Array_Scalar(Integer, Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Integer; Right : Integer_Array) return Boolean is
function Greater is new Integer_Greater_Scalar_Array(Integer, Integer_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Integer_Array; Right : Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Array(Integer, Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Integer_Array; Right : Integer) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Scalar(Integer, Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Integer; Right : Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Scalar_Array(Integer, Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Integer_Array; Right : Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Array(Integer, Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Integer_Array; Right : Integer) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Scalar(Integer, Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Integer; Right : Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Scalar_Array(Integer, Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
------------------------
-- Long Integer Array --
------------------------
function "+"(Value : Long_Integer_Array) return Long_Integer_Array is
function Assert is new Integer_Assert_Array(Long_Integer, Long_Integer_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Long_Integer_Array) return Long_Integer_Array is
function Negate is new Integer_Negate_Array(Long_Integer, Long_Integer_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Long_Integer_Array) return Long_Integer_Array is
function Absolute_Value is new Integer_Absolute_Value_Array(Long_Integer, Long_Integer_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Integer_Array; Right : Long_Integer_Array) return Long_Integer_Array is
function Add is new Integer_Add_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Integer_Array; Right : Long_Integer) return Long_Integer_Array is
function Add is new Integer_Add_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Integer; Right : Long_Integer_Array) return Long_Integer_Array is
function Add is new Integer_Add_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Integer_Array; Right : Long_Integer_Array) return Long_Integer_Array is
function Subtract is new Integer_Subtract_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Integer_Array; Right : Long_Integer) return Long_Integer_Array is
function Subtract is new Integer_Subtract_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Integer; Right : Long_Integer_Array) return Long_Integer_Array is
function Subtract is new Integer_Subtract_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Integer_Array; Right : Long_Integer_Array) return Long_Integer_Array is
function Multiply is new Integer_Multiply_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Integer_Array; Right : Long_Integer) return Long_Integer_Array is
function Multiply is new Integer_Multiply_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Integer; Right : Long_Integer_Array) return Long_Integer_Array is
function Multiply is new Integer_Multiply_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Integer_Array; Right : Long_Integer_Array) return Long_Integer_Array is
function Divide is new Integer_Divide_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Integer_Array; Right : Long_Integer) return Long_Integer_Array is
function Divide is new Integer_Divide_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Integer; Right : Long_Integer_Array) return Long_Integer_Array is
function Divide is new Integer_Divide_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Integer_Array; Right : Long_Integer_Array) return Long_Integer_Array is
function Remainder is new Integer_Remainder_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Integer_Array; Right : Long_Integer) return Long_Integer_Array is
function Remainder is new Integer_Remainder_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Integer; Right : Long_Integer_Array) return Long_Integer_Array is
function Remainder is new Integer_Remainder_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Integer_Array; Right : Long_Integer_Array) return Long_Integer_Array is
function Modulus is new Integer_Modulus_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Integer_Array; Right : Long_Integer) return Long_Integer_Array is
function Modulus is new Integer_Modulus_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Integer; Right : Long_Integer_Array) return Long_Integer_Array is
function Modulus is new Integer_Modulus_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Long_Integer_Array; Right : Long_Integer_Array) return Boolean is
function Equal is new Integer_Equal_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Integer_Array; Right : Long_Integer) return Boolean is
function Equal is new Integer_Equal_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Integer; Right : Long_Integer_Array) return Boolean is
function Equal is new Integer_Equal_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Integer_Array; Right : Long_Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Integer_Array; Right : Long_Integer) return Boolean is
function Lesser is new Integer_Lesser_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Integer; Right : Long_Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Integer_Array; Right : Long_Integer_Array) return Boolean is
function Greater is new Integer_Greater_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Integer_Array; Right : Long_Integer) return Boolean is
function Greater is new Integer_Greater_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Integer; Right : Long_Integer_Array) return Boolean is
function Greater is new Integer_Greater_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Integer_Array; Right : Long_Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Integer_Array; Right : Long_Integer) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Integer; Right : Long_Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Integer_Array; Right : Long_Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Array(Long_Integer, Long_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Integer_Array; Right : Long_Integer) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Scalar(Long_Integer, Long_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Integer; Right : Long_Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Scalar_Array(Long_Integer, Long_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-----------------------------
-- Long Long Integer Array --
-----------------------------
function "+"(Value : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Assert is new Integer_Assert_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Negate is new Integer_Negate_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Absolute_Value is new Integer_Absolute_Value_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Add is new Integer_Add_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Long_Long_Integer_Array is
function Add is new Integer_Add_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Add is new Integer_Add_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Subtract is new Integer_Subtract_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Long_Long_Integer_Array is
function Subtract is new Integer_Subtract_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Subtract is new Integer_Subtract_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Multiply is new Integer_Multiply_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Long_Long_Integer_Array is
function Multiply is new Integer_Multiply_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Multiply is new Integer_Multiply_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Divide is new Integer_Divide_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Long_Long_Integer_Array is
function Divide is new Integer_Divide_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Divide is new Integer_Divide_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Remainder is new Integer_Remainder_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Long_Long_Integer_Array is
function Remainder is new Integer_Remainder_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Remainder is new Integer_Remainder_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Modulus is new Integer_Modulus_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Long_Long_Integer_Array is
function Modulus is new Integer_Modulus_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Long_Long_Integer_Array is
function Modulus is new Integer_Modulus_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Boolean is
function Equal is new Integer_Equal_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Boolean is
function Equal is new Integer_Equal_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Boolean is
function Equal is new Integer_Equal_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Boolean is
function Lesser is new Integer_Lesser_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Boolean is
function Lesser is new Integer_Lesser_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Boolean is
function Greater is new Integer_Greater_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Boolean is
function Greater is new Integer_Greater_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Boolean is
function Greater is new Integer_Greater_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Boolean is
function Lesser_Or_Equal is new Integer_Lesser_Or_Equal_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Long_Integer_Array; Right : Long_Long_Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Long_Integer_Array; Right : Long_Long_Integer) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Array_Scalar(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Long_Integer; Right : Long_Long_Integer_Array) return Boolean is
function Greater_Or_Equal is new Integer_Greater_Or_Equal_Scalar_Array(Long_Long_Integer, Long_Long_Integer_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------------------
-- Short Short Modular Array --
-------------------------------
function "+"(Value : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Assert is new Modular_Assert_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Assert(Value);
end "+";
function "abs"(Value : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Absolute_Value is new Modular_Absolute_Value_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Add is new Modular_Add_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function Add is new Modular_Add_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Add is new Modular_Add_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Subtract is new Modular_Subtract_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function Subtract is new Modular_Subtract_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Subtract is new Modular_Subtract_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Multiply is new Modular_Multiply_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function Multiply is new Modular_Multiply_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Multiply is new Modular_Multiply_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Divide is new Modular_Divide_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function Divide is new Modular_Divide_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Divide is new Modular_Divide_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Remainder is new Modular_Remainder_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function Remainder is new Modular_Remainder_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Remainder is new Modular_Remainder_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Modulus is new Modular_Modulus_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function Modulus is new Modular_Modulus_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function Modulus is new Modular_Modulus_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "not"(Value : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function "not" is new Modular_Not_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return not Value;
end "not";
function "and"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function "and" is new Modular_And_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function "and" is new Modular_And_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function "and" is new Modular_And_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left and Right;
end "and";
function "or"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function "or" is new Modular_Or_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function "or" is new Modular_Or_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function "or" is new Modular_Or_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left or Right;
end "or";
function "xor"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function "xor" is new Modular_Xor_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Short_Short_Modular_Array is
function "xor" is new Modular_Xor_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Short_Short_Modular_Array is
function "xor" is new Modular_Xor_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Left xor Right;
end "xor";
function "="(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Boolean is
function Equal is new Modular_Equal_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Boolean is
function Equal is new Modular_Equal_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Boolean is
function Equal is new Modular_Equal_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Boolean is
function Lesser is new Modular_Lesser_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Boolean is
function Greater is new Modular_Greater_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Boolean is
function Greater is new Modular_Greater_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Boolean is
function Greater is new Modular_Greater_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Short_Short_Modular_Array; Right : Short_Short_Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Short_Modular_Array; Right : Short_Short_Modular) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Scalar(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Short_Modular; Right : Short_Short_Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Scalar_Array(Short_Short_Modular, Short_Short_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------------
-- Short Modular Array --
-------------------------
function "+"(Value : Short_Modular_Array) return Short_Modular_Array is
function Assert is new Modular_Assert_Array(Short_Modular, Short_Modular_Array);
begin
return Assert(Value);
end "+";
function "abs"(Value : Short_Modular_Array) return Short_Modular_Array is
function Absolute_Value is new Modular_Absolute_Value_Array(Short_Modular, Short_Modular_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function Add is new Modular_Add_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function Add is new Modular_Add_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function Add is new Modular_Add_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function Subtract is new Modular_Subtract_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function Subtract is new Modular_Subtract_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function Subtract is new Modular_Subtract_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function Multiply is new Modular_Multiply_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function Multiply is new Modular_Multiply_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function Multiply is new Modular_Multiply_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function Divide is new Modular_Divide_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function Divide is new Modular_Divide_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function Divide is new Modular_Divide_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function Remainder is new Modular_Remainder_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function Remainder is new Modular_Remainder_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function Remainder is new Modular_Remainder_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function Modulus is new Modular_Modulus_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function Modulus is new Modular_Modulus_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function Modulus is new Modular_Modulus_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "not"(Value : Short_Modular_Array) return Short_Modular_Array is
function "not" is new Modular_Not_Array(Short_Modular, Short_Modular_Array);
begin
return not Value;
end "not";
function "and"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function "and" is new Modular_And_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function "and" is new Modular_And_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function "and" is new Modular_And_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Left and Right;
end "and";
function "or"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function "or" is new Modular_Or_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function "or" is new Modular_Or_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function "or" is new Modular_Or_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Left or Right;
end "or";
function "xor"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Short_Modular_Array is
function "xor" is new Modular_Xor_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Short_Modular_Array; Right : Short_Modular) return Short_Modular_Array is
function "xor" is new Modular_Xor_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Short_Modular; Right : Short_Modular_Array) return Short_Modular_Array is
function "xor" is new Modular_Xor_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Left xor Right;
end "xor";
function "="(Left : Short_Modular_Array; Right : Short_Modular_Array) return Boolean is
function Equal is new Modular_Equal_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Modular_Array; Right : Short_Modular) return Boolean is
function Equal is new Modular_Equal_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Modular; Right : Short_Modular_Array) return Boolean is
function Equal is new Modular_Equal_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Modular_Array; Right : Short_Modular) return Boolean is
function Lesser is new Modular_Lesser_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Modular; Right : Short_Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Short_Modular_Array; Right : Short_Modular_Array) return Boolean is
function Greater is new Modular_Greater_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Modular_Array; Right : Short_Modular) return Boolean is
function Greater is new Modular_Greater_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Modular; Right : Short_Modular_Array) return Boolean is
function Greater is new Modular_Greater_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Short_Modular_Array; Right : Short_Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Modular_Array; Right : Short_Modular) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Modular; Right : Short_Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Short_Modular_Array; Right : Short_Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Array(Short_Modular, Short_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Modular_Array; Right : Short_Modular) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Scalar(Short_Modular, Short_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Modular; Right : Short_Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Scalar_Array(Short_Modular, Short_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------
-- Modular Array --
-------------------
function "+"(Value : Modular_Array) return Modular_Array is
function Assert is new Modular_Assert_Array(Modular, Modular_Array);
begin
return Assert(Value);
end "+";
function "abs"(Value : Modular_Array) return Modular_Array is
function Absolute_Value is new Modular_Absolute_Value_Array(Modular, Modular_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function Add is new Modular_Add_Array_Array(Modular, Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Modular_Array; Right : Modular) return Modular_Array is
function Add is new Modular_Add_Array_Scalar(Modular, Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Modular; Right : Modular_Array) return Modular_Array is
function Add is new Modular_Add_Scalar_Array(Modular, Modular_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function Subtract is new Modular_Subtract_Array_Array(Modular, Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Modular_Array; Right : Modular) return Modular_Array is
function Subtract is new Modular_Subtract_Array_Scalar(Modular, Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Modular; Right : Modular_Array) return Modular_Array is
function Subtract is new Modular_Subtract_Scalar_Array(Modular, Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function Multiply is new Modular_Multiply_Array_Array(Modular, Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Modular_Array; Right : Modular) return Modular_Array is
function Multiply is new Modular_Multiply_Array_Scalar(Modular, Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Modular; Right : Modular_Array) return Modular_Array is
function Multiply is new Modular_Multiply_Scalar_Array(Modular, Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function Divide is new Modular_Divide_Array_Array(Modular, Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Modular_Array; Right : Modular) return Modular_Array is
function Divide is new Modular_Divide_Array_Scalar(Modular, Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Modular; Right : Modular_Array) return Modular_Array is
function Divide is new Modular_Divide_Scalar_Array(Modular, Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function Remainder is new Modular_Remainder_Array_Array(Modular, Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Modular_Array; Right : Modular) return Modular_Array is
function Remainder is new Modular_Remainder_Array_Scalar(Modular, Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Modular; Right : Modular_Array) return Modular_Array is
function Remainder is new Modular_Remainder_Scalar_Array(Modular, Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function Modulus is new Modular_Modulus_Array_Array(Modular, Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Modular_Array; Right : Modular) return Modular_Array is
function Modulus is new Modular_Modulus_Array_Scalar(Modular, Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Modular; Right : Modular_Array) return Modular_Array is
function Modulus is new Modular_Modulus_Scalar_Array(Modular, Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "not"(Value : Modular_Array) return Modular_Array is
function "not" is new Modular_Not_Array(Modular, Modular_Array);
begin
return not Value;
end "not";
function "and"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function "and" is new Modular_And_Array_Array(Modular, Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Modular_Array; Right : Modular) return Modular_Array is
function "and" is new Modular_And_Array_Scalar(Modular, Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Modular; Right : Modular_Array) return Modular_Array is
function "and" is new Modular_And_Scalar_Array(Modular, Modular_Array);
begin
return Left and Right;
end "and";
function "or"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function "or" is new Modular_Or_Array_Array(Modular, Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Modular_Array; Right : Modular) return Modular_Array is
function "or" is new Modular_Or_Array_Scalar(Modular, Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Modular; Right : Modular_Array) return Modular_Array is
function "or" is new Modular_Or_Scalar_Array(Modular, Modular_Array);
begin
return Left or Right;
end "or";
function "xor"(Left : Modular_Array; Right : Modular_Array) return Modular_Array is
function "xor" is new Modular_Xor_Array_Array(Modular, Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Modular_Array; Right : Modular) return Modular_Array is
function "xor" is new Modular_Xor_Array_Scalar(Modular, Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Modular; Right : Modular_Array) return Modular_Array is
function "xor" is new Modular_Xor_Scalar_Array(Modular, Modular_Array);
begin
return Left xor Right;
end "xor";
function "="(Left : Modular_Array; Right : Modular_Array) return Boolean is
function Equal is new Modular_Equal_Array_Array(Modular, Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Modular_Array; Right : Modular) return Boolean is
function Equal is new Modular_Equal_Array_Scalar(Modular, Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Modular; Right : Modular_Array) return Boolean is
function Equal is new Modular_Equal_Scalar_Array(Modular, Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Modular_Array; Right : Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Array_Array(Modular, Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Modular_Array; Right : Modular) return Boolean is
function Lesser is new Modular_Lesser_Array_Scalar(Modular, Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Modular; Right : Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Scalar_Array(Modular, Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Modular_Array; Right : Modular_Array) return Boolean is
function Greater is new Modular_Greater_Array_Array(Modular, Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Modular_Array; Right : Modular) return Boolean is
function Greater is new Modular_Greater_Array_Scalar(Modular, Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Modular; Right : Modular_Array) return Boolean is
function Greater is new Modular_Greater_Scalar_Array(Modular, Modular_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Modular_Array; Right : Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Array(Modular, Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Modular_Array; Right : Modular) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Scalar(Modular, Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Modular; Right : Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Scalar_Array(Modular, Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Modular_Array; Right : Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Array(Modular, Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Modular_Array; Right : Modular) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Scalar(Modular, Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Modular; Right : Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Scalar_Array(Modular, Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
------------------------
-- Long Modular Array --
------------------------
function "+"(Value : Long_Modular_Array) return Long_Modular_Array is
function Assert is new Modular_Assert_Array(Long_Modular, Long_Modular_Array);
begin
return Assert(Value);
end "+";
function "abs"(Value : Long_Modular_Array) return Long_Modular_Array is
function Absolute_Value is new Modular_Absolute_Value_Array(Long_Modular, Long_Modular_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function Add is new Modular_Add_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function Add is new Modular_Add_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function Add is new Modular_Add_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function Subtract is new Modular_Subtract_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function Subtract is new Modular_Subtract_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function Subtract is new Modular_Subtract_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function Multiply is new Modular_Multiply_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function Multiply is new Modular_Multiply_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function Multiply is new Modular_Multiply_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function Divide is new Modular_Divide_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function Divide is new Modular_Divide_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function Divide is new Modular_Divide_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function Remainder is new Modular_Remainder_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function Remainder is new Modular_Remainder_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function Remainder is new Modular_Remainder_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function Modulus is new Modular_Modulus_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function Modulus is new Modular_Modulus_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function Modulus is new Modular_Modulus_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "not"(Value : Long_Modular_Array) return Long_Modular_Array is
function "not" is new Modular_Not_Array(Long_Modular, Long_Modular_Array);
begin
return not Value;
end "not";
function "and"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function "and" is new Modular_And_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function "and" is new Modular_And_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function "and" is new Modular_And_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Left and Right;
end "and";
function "or"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function "or" is new Modular_Or_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function "or" is new Modular_Or_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function "or" is new Modular_Or_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Left or Right;
end "or";
function "xor"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Long_Modular_Array is
function "xor" is new Modular_Xor_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Long_Modular_Array; Right : Long_Modular) return Long_Modular_Array is
function "xor" is new Modular_Xor_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Long_Modular; Right : Long_Modular_Array) return Long_Modular_Array is
function "xor" is new Modular_Xor_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Left xor Right;
end "xor";
function "="(Left : Long_Modular_Array; Right : Long_Modular_Array) return Boolean is
function Equal is new Modular_Equal_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Modular_Array; Right : Long_Modular) return Boolean is
function Equal is new Modular_Equal_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Modular; Right : Long_Modular_Array) return Boolean is
function Equal is new Modular_Equal_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Modular_Array; Right : Long_Modular) return Boolean is
function Lesser is new Modular_Lesser_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Modular; Right : Long_Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Modular_Array; Right : Long_Modular_Array) return Boolean is
function Greater is new Modular_Greater_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Modular_Array; Right : Long_Modular) return Boolean is
function Greater is new Modular_Greater_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Modular; Right : Long_Modular_Array) return Boolean is
function Greater is new Modular_Greater_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Modular_Array; Right : Long_Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Modular_Array; Right : Long_Modular) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Modular; Right : Long_Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Modular_Array; Right : Long_Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Array(Long_Modular, Long_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Modular_Array; Right : Long_Modular) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Scalar(Long_Modular, Long_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Modular; Right : Long_Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Scalar_Array(Long_Modular, Long_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-----------------------------
-- Long Long Modular Array --
-----------------------------
function "+"(Value : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Assert is new Modular_Assert_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Assert(Value);
end "+";
function "abs"(Value : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Absolute_Value is new Modular_Absolute_Value_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Add is new Modular_Add_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function Add is new Modular_Add_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Add is new Modular_Add_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Subtract is new Modular_Subtract_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function Subtract is new Modular_Subtract_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Subtract is new Modular_Subtract_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Multiply is new Modular_Multiply_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function Multiply is new Modular_Multiply_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Multiply is new Modular_Multiply_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Divide is new Modular_Divide_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function Divide is new Modular_Divide_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Divide is new Modular_Divide_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Remainder is new Modular_Remainder_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function Remainder is new Modular_Remainder_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Remainder is new Modular_Remainder_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Modulus is new Modular_Modulus_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function Modulus is new Modular_Modulus_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function Modulus is new Modular_Modulus_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Modulus(Left, Right);
end "mod";
function "not"(Value : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function "not" is new Modular_Not_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return not Value;
end "not";
function "and"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function "and" is new Modular_And_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function "and" is new Modular_And_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left and Right;
end "and";
function "and"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function "and" is new Modular_And_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left and Right;
end "and";
function "or"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function "or" is new Modular_Or_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function "or" is new Modular_Or_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left or Right;
end "or";
function "or"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function "or" is new Modular_Or_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left or Right;
end "or";
function "xor"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function "xor" is new Modular_Xor_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Long_Long_Modular_Array is
function "xor" is new Modular_Xor_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left xor Right;
end "xor";
function "xor"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Long_Long_Modular_Array is
function "xor" is new Modular_Xor_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Left xor Right;
end "xor";
function "="(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Boolean is
function Equal is new Modular_Equal_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Boolean is
function Equal is new Modular_Equal_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Boolean is
function Equal is new Modular_Equal_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Boolean is
function Lesser is new Modular_Lesser_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Boolean is
function Lesser is new Modular_Lesser_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Boolean is
function Greater is new Modular_Greater_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Boolean is
function Greater is new Modular_Greater_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Boolean is
function Greater is new Modular_Greater_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Boolean is
function Lesser_Or_Equal is new Modular_Lesser_Or_Equal_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Long_Modular_Array; Right : Long_Long_Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Long_Modular_Array; Right : Long_Long_Modular) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Array_Scalar(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Long_Modular; Right : Long_Long_Modular_Array) return Boolean is
function Greater_Or_Equal is new Modular_Greater_Or_Equal_Scalar_Array(Long_Long_Modular, Long_Long_Modular_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-----------------------------
-- Short Short Fixed Array --
-----------------------------
function "+"(Value : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Assert is new Fixed_Assert_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Negate is new Fixed_Negate_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Absolute_Value is new Fixed_Absolute_Value_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Add is new Fixed_Add_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Short_Short_Fixed_Array is
function Add is new Fixed_Add_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Add is new Fixed_Add_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Subtract is new Fixed_Subtract_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Short_Short_Fixed_Array is
function Subtract is new Fixed_Subtract_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Subtract is new Fixed_Subtract_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Multiply is new Fixed_Multiply_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Short_Short_Fixed_Array is
function Multiply is new Fixed_Multiply_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Multiply is new Fixed_Multiply_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Divide is new Fixed_Divide_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Short_Short_Fixed_Array is
function Divide is new Fixed_Divide_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Divide is new Fixed_Divide_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Remainder is new Fixed_Remainder_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Short_Short_Fixed_Array is
function Remainder is new Fixed_Remainder_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Remainder is new Fixed_Remainder_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Modulus is new Fixed_Modulus_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Short_Short_Fixed_Array is
function Modulus is new Fixed_Modulus_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Short_Short_Fixed_Array is
function Modulus is new Fixed_Modulus_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Boolean is
function Equal is new Fixed_Equal_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Boolean is
function Equal is new Fixed_Equal_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Boolean is
function Equal is new Fixed_Equal_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Boolean is
function Lesser is new Fixed_Lesser_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Boolean is
function Lesser is new Fixed_Lesser_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Boolean is
function Lesser is new Fixed_Lesser_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Boolean is
function Greater is new Fixed_Greater_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Boolean is
function Greater is new Fixed_Greater_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Boolean is
function Greater is new Fixed_Greater_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed_Array) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Array_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Short_Fixed_Array; Right : Short_Short_Fixed) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Array_Scalar(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Short_Fixed; Right : Short_Short_Fixed_Array) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Scalar_Array(Short_Short_Fixed, Short_Short_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-----------------------
-- Short Fixed Array --
-----------------------
function "+"(Value : Short_Fixed_Array) return Short_Fixed_Array is
function Assert is new Fixed_Assert_Array(Short_Fixed, Short_Fixed_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Short_Fixed_Array) return Short_Fixed_Array is
function Negate is new Fixed_Negate_Array(Short_Fixed, Short_Fixed_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Short_Fixed_Array) return Short_Fixed_Array is
function Absolute_Value is new Fixed_Absolute_Value_Array(Short_Fixed, Short_Fixed_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Add is new Fixed_Add_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Fixed_Array; Right : Short_Fixed) return Short_Fixed_Array is
function Add is new Fixed_Add_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Fixed; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Add is new Fixed_Add_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Subtract is new Fixed_Subtract_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Fixed_Array; Right : Short_Fixed) return Short_Fixed_Array is
function Subtract is new Fixed_Subtract_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Fixed; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Subtract is new Fixed_Subtract_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Multiply is new Fixed_Multiply_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Fixed_Array; Right : Short_Fixed) return Short_Fixed_Array is
function Multiply is new Fixed_Multiply_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Fixed; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Multiply is new Fixed_Multiply_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Divide is new Fixed_Divide_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Fixed_Array; Right : Short_Fixed) return Short_Fixed_Array is
function Divide is new Fixed_Divide_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Fixed; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Divide is new Fixed_Divide_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Remainder is new Fixed_Remainder_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Fixed_Array; Right : Short_Fixed) return Short_Fixed_Array is
function Remainder is new Fixed_Remainder_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Fixed; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Remainder is new Fixed_Remainder_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Modulus is new Fixed_Modulus_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Fixed_Array; Right : Short_Fixed) return Short_Fixed_Array is
function Modulus is new Fixed_Modulus_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Fixed; Right : Short_Fixed_Array) return Short_Fixed_Array is
function Modulus is new Fixed_Modulus_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Boolean is
function Equal is new Fixed_Equal_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Fixed_Array; Right : Short_Fixed) return Boolean is
function Equal is new Fixed_Equal_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Fixed; Right : Short_Fixed_Array) return Boolean is
function Equal is new Fixed_Equal_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Boolean is
function Lesser is new Fixed_Lesser_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Fixed_Array; Right : Short_Fixed) return Boolean is
function Lesser is new Fixed_Lesser_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Fixed; Right : Short_Fixed_Array) return Boolean is
function Lesser is new Fixed_Lesser_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Boolean is
function Greater is new Fixed_Greater_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Fixed_Array; Right : Short_Fixed) return Boolean is
function Greater is new Fixed_Greater_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Fixed; Right : Short_Fixed_Array) return Boolean is
function Greater is new Fixed_Greater_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Fixed_Array; Right : Short_Fixed) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Fixed; Right : Short_Fixed_Array) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Short_Fixed_Array; Right : Short_Fixed_Array) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Array_Array(Short_Fixed, Short_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Fixed_Array; Right : Short_Fixed) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Array_Scalar(Short_Fixed, Short_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Fixed; Right : Short_Fixed_Array) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Scalar_Array(Short_Fixed, Short_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-----------------
-- Fixed Array --
-----------------
function "+"(Value : Fixed_Array) return Fixed_Array is
function Assert is new Fixed_Assert_Array(Fixed, Fixed_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Fixed_Array) return Fixed_Array is
function Negate is new Fixed_Negate_Array(Fixed, Fixed_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Fixed_Array) return Fixed_Array is
function Absolute_Value is new Fixed_Absolute_Value_Array(Fixed, Fixed_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Fixed_Array; Right : Fixed_Array) return Fixed_Array is
function Add is new Fixed_Add_Array_Array(Fixed, Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Fixed_Array; Right : Fixed) return Fixed_Array is
function Add is new Fixed_Add_Array_Scalar(Fixed, Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Fixed; Right : Fixed_Array) return Fixed_Array is
function Add is new Fixed_Add_Scalar_Array(Fixed, Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Fixed_Array; Right : Fixed_Array) return Fixed_Array is
function Subtract is new Fixed_Subtract_Array_Array(Fixed, Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Fixed_Array; Right : Fixed) return Fixed_Array is
function Subtract is new Fixed_Subtract_Array_Scalar(Fixed, Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Fixed; Right : Fixed_Array) return Fixed_Array is
function Subtract is new Fixed_Subtract_Scalar_Array(Fixed, Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Fixed_Array; Right : Fixed_Array) return Fixed_Array is
function Multiply is new Fixed_Multiply_Array_Array(Fixed, Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Fixed_Array; Right : Fixed) return Fixed_Array is
function Multiply is new Fixed_Multiply_Array_Scalar(Fixed, Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Fixed; Right : Fixed_Array) return Fixed_Array is
function Multiply is new Fixed_Multiply_Scalar_Array(Fixed, Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Fixed_Array; Right : Fixed_Array) return Fixed_Array is
function Divide is new Fixed_Divide_Array_Array(Fixed, Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Fixed_Array; Right : Fixed) return Fixed_Array is
function Divide is new Fixed_Divide_Array_Scalar(Fixed, Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Fixed; Right : Fixed_Array) return Fixed_Array is
function Divide is new Fixed_Divide_Scalar_Array(Fixed, Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Fixed_Array; Right : Fixed_Array) return Fixed_Array is
function Remainder is new Fixed_Remainder_Array_Array(Fixed, Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Fixed_Array; Right : Fixed) return Fixed_Array is
function Remainder is new Fixed_Remainder_Array_Scalar(Fixed, Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Fixed; Right : Fixed_Array) return Fixed_Array is
function Remainder is new Fixed_Remainder_Scalar_Array(Fixed, Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Fixed_Array; Right : Fixed_Array) return Fixed_Array is
function Modulus is new Fixed_Modulus_Array_Array(Fixed, Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Fixed_Array; Right : Fixed) return Fixed_Array is
function Modulus is new Fixed_Modulus_Array_Scalar(Fixed, Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Fixed; Right : Fixed_Array) return Fixed_Array is
function Modulus is new Fixed_Modulus_Scalar_Array(Fixed, Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Fixed_Array; Right : Fixed_Array) return Boolean is
function Equal is new Fixed_Equal_Array_Array(Fixed, Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Fixed_Array; Right : Fixed) return Boolean is
function Equal is new Fixed_Equal_Array_Scalar(Fixed, Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Fixed; Right : Fixed_Array) return Boolean is
function Equal is new Fixed_Equal_Scalar_Array(Fixed, Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Fixed_Array; Right : Fixed_Array) return Boolean is
function Lesser is new Fixed_Lesser_Array_Array(Fixed, Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Fixed_Array; Right : Fixed) return Boolean is
function Lesser is new Fixed_Lesser_Array_Scalar(Fixed, Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Fixed; Right : Fixed_Array) return Boolean is
function Lesser is new Fixed_Lesser_Scalar_Array(Fixed, Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Fixed_Array; Right : Fixed_Array) return Boolean is
function Greater is new Fixed_Greater_Array_Array(Fixed, Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Fixed_Array; Right : Fixed) return Boolean is
function Greater is new Fixed_Greater_Array_Scalar(Fixed, Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Fixed; Right : Fixed_Array) return Boolean is
function Greater is new Fixed_Greater_Scalar_Array(Fixed, Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Fixed_Array; Right : Fixed_Array) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Array_Array(Fixed, Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Fixed_Array; Right : Fixed) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Array_Scalar(Fixed, Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Fixed; Right : Fixed_Array) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Scalar_Array(Fixed, Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Fixed_Array; Right : Fixed_Array) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Array_Array(Fixed, Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Fixed_Array; Right : Fixed) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Array_Scalar(Fixed, Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Fixed; Right : Fixed_Array) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Scalar_Array(Fixed, Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
----------------------
-- Long Fixed Array --
----------------------
function "+"(Value : Long_Fixed_Array) return Long_Fixed_Array is
function Assert is new Fixed_Assert_Array(Long_Fixed, Long_Fixed_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Long_Fixed_Array) return Long_Fixed_Array is
function Negate is new Fixed_Negate_Array(Long_Fixed, Long_Fixed_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Long_Fixed_Array) return Long_Fixed_Array is
function Absolute_Value is new Fixed_Absolute_Value_Array(Long_Fixed, Long_Fixed_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Add is new Fixed_Add_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Fixed_Array; Right : Long_Fixed) return Long_Fixed_Array is
function Add is new Fixed_Add_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Fixed; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Add is new Fixed_Add_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Subtract is new Fixed_Subtract_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Fixed_Array; Right : Long_Fixed) return Long_Fixed_Array is
function Subtract is new Fixed_Subtract_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Fixed; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Subtract is new Fixed_Subtract_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Multiply is new Fixed_Multiply_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Fixed_Array; Right : Long_Fixed) return Long_Fixed_Array is
function Multiply is new Fixed_Multiply_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Fixed; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Multiply is new Fixed_Multiply_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Divide is new Fixed_Divide_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Fixed_Array; Right : Long_Fixed) return Long_Fixed_Array is
function Divide is new Fixed_Divide_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Fixed; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Divide is new Fixed_Divide_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Remainder is new Fixed_Remainder_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Fixed_Array; Right : Long_Fixed) return Long_Fixed_Array is
function Remainder is new Fixed_Remainder_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Fixed; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Remainder is new Fixed_Remainder_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Modulus is new Fixed_Modulus_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Fixed_Array; Right : Long_Fixed) return Long_Fixed_Array is
function Modulus is new Fixed_Modulus_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Fixed; Right : Long_Fixed_Array) return Long_Fixed_Array is
function Modulus is new Fixed_Modulus_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Boolean is
function Equal is new Fixed_Equal_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Fixed_Array; Right : Long_Fixed) return Boolean is
function Equal is new Fixed_Equal_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Fixed; Right : Long_Fixed_Array) return Boolean is
function Equal is new Fixed_Equal_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Boolean is
function Lesser is new Fixed_Lesser_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Fixed_Array; Right : Long_Fixed) return Boolean is
function Lesser is new Fixed_Lesser_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Fixed; Right : Long_Fixed_Array) return Boolean is
function Lesser is new Fixed_Lesser_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Boolean is
function Greater is new Fixed_Greater_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Fixed_Array; Right : Long_Fixed) return Boolean is
function Greater is new Fixed_Greater_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Fixed; Right : Long_Fixed_Array) return Boolean is
function Greater is new Fixed_Greater_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Fixed_Array; Right : Long_Fixed) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Fixed; Right : Long_Fixed_Array) return Boolean is
function Lesser_Or_Equal is new Fixed_Lesser_Or_Equal_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Fixed_Array; Right : Long_Fixed_Array) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Array_Array(Long_Fixed, Long_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Fixed_Array; Right : Long_Fixed) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Array_Scalar(Long_Fixed, Long_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Fixed; Right : Long_Fixed_Array) return Boolean is
function Greater_Or_Equal is new Fixed_Greater_Or_Equal_Scalar_Array(Long_Fixed, Long_Fixed_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------------
-- Short Decimal Array --
-------------------------
function "+"(Value : Short_Decimal_Array) return Short_Decimal_Array is
function Assert is new Decimal_Assert_Array(Short_Decimal, Short_Decimal_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Short_Decimal_Array) return Short_Decimal_Array is
function Negate is new Decimal_Negate_Array(Short_Decimal, Short_Decimal_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Short_Decimal_Array) return Short_Decimal_Array is
function Absolute_Value is new Decimal_Absolute_Value_Array(Short_Decimal, Short_Decimal_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Add is new Decimal_Add_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Decimal_Array; Right : Short_Decimal) return Short_Decimal_Array is
function Add is new Decimal_Add_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Decimal; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Add is new Decimal_Add_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Subtract is new Decimal_Subtract_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Decimal_Array; Right : Short_Decimal) return Short_Decimal_Array is
function Subtract is new Decimal_Subtract_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Decimal; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Subtract is new Decimal_Subtract_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Multiply is new Decimal_Multiply_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Decimal_Array; Right : Short_Decimal) return Short_Decimal_Array is
function Multiply is new Decimal_Multiply_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Decimal; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Multiply is new Decimal_Multiply_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Divide is new Decimal_Divide_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Decimal_Array; Right : Short_Decimal) return Short_Decimal_Array is
function Divide is new Decimal_Divide_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Decimal; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Divide is new Decimal_Divide_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Remainder is new Decimal_Remainder_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Decimal_Array; Right : Short_Decimal) return Short_Decimal_Array is
function Remainder is new Decimal_Remainder_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Decimal; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Remainder is new Decimal_Remainder_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Modulus is new Decimal_Modulus_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Decimal_Array; Right : Short_Decimal) return Short_Decimal_Array is
function Modulus is new Decimal_Modulus_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Decimal; Right : Short_Decimal_Array) return Short_Decimal_Array is
function Modulus is new Decimal_Modulus_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Boolean is
function Equal is new Decimal_Equal_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Decimal_Array; Right : Short_Decimal) return Boolean is
function Equal is new Decimal_Equal_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Decimal; Right : Short_Decimal_Array) return Boolean is
function Equal is new Decimal_Equal_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Boolean is
function Lesser is new Decimal_Lesser_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Decimal_Array; Right : Short_Decimal) return Boolean is
function Lesser is new Decimal_Lesser_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Decimal; Right : Short_Decimal_Array) return Boolean is
function Lesser is new Decimal_Lesser_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Boolean is
function Greater is new Decimal_Greater_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Decimal_Array; Right : Short_Decimal) return Boolean is
function Greater is new Decimal_Greater_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Decimal; Right : Short_Decimal_Array) return Boolean is
function Greater is new Decimal_Greater_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Decimal_Array; Right : Short_Decimal) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Decimal; Right : Short_Decimal_Array) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Short_Decimal_Array; Right : Short_Decimal_Array) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Array_Array(Short_Decimal, Short_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Decimal_Array; Right : Short_Decimal) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Array_Scalar(Short_Decimal, Short_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Decimal; Right : Short_Decimal_Array) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Scalar_Array(Short_Decimal, Short_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------
-- Decimal Array --
-------------------
function "+"(Value : Decimal_Array) return Decimal_Array is
function Assert is new Decimal_Assert_Array(Decimal, Decimal_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Decimal_Array) return Decimal_Array is
function Negate is new Decimal_Negate_Array(Decimal, Decimal_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Decimal_Array) return Decimal_Array is
function Absolute_Value is new Decimal_Absolute_Value_Array(Decimal, Decimal_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Decimal_Array; Right : Decimal_Array) return Decimal_Array is
function Add is new Decimal_Add_Array_Array(Decimal, Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Decimal_Array; Right : Decimal) return Decimal_Array is
function Add is new Decimal_Add_Array_Scalar(Decimal, Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Decimal; Right : Decimal_Array) return Decimal_Array is
function Add is new Decimal_Add_Scalar_Array(Decimal, Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Decimal_Array; Right : Decimal_Array) return Decimal_Array is
function Subtract is new Decimal_Subtract_Array_Array(Decimal, Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Decimal_Array; Right : Decimal) return Decimal_Array is
function Subtract is new Decimal_Subtract_Array_Scalar(Decimal, Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Decimal; Right : Decimal_Array) return Decimal_Array is
function Subtract is new Decimal_Subtract_Scalar_Array(Decimal, Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Decimal_Array; Right : Decimal_Array) return Decimal_Array is
function Multiply is new Decimal_Multiply_Array_Array(Decimal, Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Decimal_Array; Right : Decimal) return Decimal_Array is
function Multiply is new Decimal_Multiply_Array_Scalar(Decimal, Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Decimal; Right : Decimal_Array) return Decimal_Array is
function Multiply is new Decimal_Multiply_Scalar_Array(Decimal, Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Decimal_Array; Right : Decimal_Array) return Decimal_Array is
function Divide is new Decimal_Divide_Array_Array(Decimal, Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Decimal_Array; Right : Decimal) return Decimal_Array is
function Divide is new Decimal_Divide_Array_Scalar(Decimal, Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Decimal; Right : Decimal_Array) return Decimal_Array is
function Divide is new Decimal_Divide_Scalar_Array(Decimal, Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Decimal_Array; Right : Decimal_Array) return Decimal_Array is
function Remainder is new Decimal_Remainder_Array_Array(Decimal, Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Decimal_Array; Right : Decimal) return Decimal_Array is
function Remainder is new Decimal_Remainder_Array_Scalar(Decimal, Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Decimal; Right : Decimal_Array) return Decimal_Array is
function Remainder is new Decimal_Remainder_Scalar_Array(Decimal, Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Decimal_Array; Right : Decimal_Array) return Decimal_Array is
function Modulus is new Decimal_Modulus_Array_Array(Decimal, Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Decimal_Array; Right : Decimal) return Decimal_Array is
function Modulus is new Decimal_Modulus_Array_Scalar(Decimal, Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Decimal; Right : Decimal_Array) return Decimal_Array is
function Modulus is new Decimal_Modulus_Scalar_Array(Decimal, Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Decimal_Array; Right : Decimal_Array) return Boolean is
function Equal is new Decimal_Equal_Array_Array(Decimal, Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Decimal_Array; Right : Decimal) return Boolean is
function Equal is new Decimal_Equal_Array_Scalar(Decimal, Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Decimal; Right : Decimal_Array) return Boolean is
function Equal is new Decimal_Equal_Scalar_Array(Decimal, Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Decimal_Array; Right : Decimal_Array) return Boolean is
function Lesser is new Decimal_Lesser_Array_Array(Decimal, Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Decimal_Array; Right : Decimal) return Boolean is
function Lesser is new Decimal_Lesser_Array_Scalar(Decimal, Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Decimal; Right : Decimal_Array) return Boolean is
function Lesser is new Decimal_Lesser_Scalar_Array(Decimal, Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Decimal_Array; Right : Decimal_Array) return Boolean is
function Greater is new Decimal_Greater_Array_Array(Decimal, Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Decimal_Array; Right : Decimal) return Boolean is
function Greater is new Decimal_Greater_Array_Scalar(Decimal, Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Decimal; Right : Decimal_Array) return Boolean is
function Greater is new Decimal_Greater_Scalar_Array(Decimal, Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Decimal_Array; Right : Decimal_Array) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Array_Array(Decimal, Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Decimal_Array; Right : Decimal) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Array_Scalar(Decimal, Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Decimal; Right : Decimal_Array) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Scalar_Array(Decimal, Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Decimal_Array; Right : Decimal_Array) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Array_Array(Decimal, Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Decimal_Array; Right : Decimal) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Array_Scalar(Decimal, Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Decimal; Right : Decimal_Array) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Scalar_Array(Decimal, Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
------------------------
-- Long Decimal Array --
------------------------
function "+"(Value : Long_Decimal_Array) return Long_Decimal_Array is
function Assert is new Decimal_Assert_Array(Long_Decimal, Long_Decimal_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Long_Decimal_Array) return Long_Decimal_Array is
function Negate is new Decimal_Negate_Array(Long_Decimal, Long_Decimal_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Long_Decimal_Array) return Long_Decimal_Array is
function Absolute_Value is new Decimal_Absolute_Value_Array(Long_Decimal, Long_Decimal_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Add is new Decimal_Add_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Decimal_Array; Right : Long_Decimal) return Long_Decimal_Array is
function Add is new Decimal_Add_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Decimal; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Add is new Decimal_Add_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Subtract is new Decimal_Subtract_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Decimal_Array; Right : Long_Decimal) return Long_Decimal_Array is
function Subtract is new Decimal_Subtract_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Decimal; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Subtract is new Decimal_Subtract_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Multiply is new Decimal_Multiply_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Decimal_Array; Right : Long_Decimal) return Long_Decimal_Array is
function Multiply is new Decimal_Multiply_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Decimal; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Multiply is new Decimal_Multiply_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Divide is new Decimal_Divide_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Decimal_Array; Right : Long_Decimal) return Long_Decimal_Array is
function Divide is new Decimal_Divide_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Decimal; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Divide is new Decimal_Divide_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Remainder is new Decimal_Remainder_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Decimal_Array; Right : Long_Decimal) return Long_Decimal_Array is
function Remainder is new Decimal_Remainder_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Decimal; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Remainder is new Decimal_Remainder_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Modulus is new Decimal_Modulus_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Decimal_Array; Right : Long_Decimal) return Long_Decimal_Array is
function Modulus is new Decimal_Modulus_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Decimal; Right : Long_Decimal_Array) return Long_Decimal_Array is
function Modulus is new Decimal_Modulus_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Boolean is
function Equal is new Decimal_Equal_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Decimal_Array; Right : Long_Decimal) return Boolean is
function Equal is new Decimal_Equal_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Decimal; Right : Long_Decimal_Array) return Boolean is
function Equal is new Decimal_Equal_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Boolean is
function Lesser is new Decimal_Lesser_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Decimal_Array; Right : Long_Decimal) return Boolean is
function Lesser is new Decimal_Lesser_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Decimal; Right : Long_Decimal_Array) return Boolean is
function Lesser is new Decimal_Lesser_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Boolean is
function Greater is new Decimal_Greater_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Decimal_Array; Right : Long_Decimal) return Boolean is
function Greater is new Decimal_Greater_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Decimal; Right : Long_Decimal_Array) return Boolean is
function Greater is new Decimal_Greater_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Decimal_Array; Right : Long_Decimal) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Decimal; Right : Long_Decimal_Array) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Decimal_Array; Right : Long_Decimal_Array) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Array_Array(Long_Decimal, Long_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Decimal_Array; Right : Long_Decimal) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Array_Scalar(Long_Decimal, Long_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Decimal; Right : Long_Decimal_Array) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Scalar_Array(Long_Decimal, Long_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-----------------------------
-- Long Long Decimal Array --
-----------------------------
function "+"(Value : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Assert is new Decimal_Assert_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Negate is new Decimal_Negate_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Absolute_Value is new Decimal_Absolute_Value_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Add is new Decimal_Add_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Long_Long_Decimal_Array is
function Add is new Decimal_Add_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Add is new Decimal_Add_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Subtract is new Decimal_Subtract_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Long_Long_Decimal_Array is
function Subtract is new Decimal_Subtract_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Subtract is new Decimal_Subtract_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Multiply is new Decimal_Multiply_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Long_Long_Decimal_Array is
function Multiply is new Decimal_Multiply_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Multiply is new Decimal_Multiply_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Divide is new Decimal_Divide_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Long_Long_Decimal_Array is
function Divide is new Decimal_Divide_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Divide is new Decimal_Divide_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Remainder is new Decimal_Remainder_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Long_Long_Decimal_Array is
function Remainder is new Decimal_Remainder_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Remainder is new Decimal_Remainder_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Modulus is new Decimal_Modulus_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Long_Long_Decimal_Array is
function Modulus is new Decimal_Modulus_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Long_Long_Decimal_Array is
function Modulus is new Decimal_Modulus_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Boolean is
function Equal is new Decimal_Equal_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Boolean is
function Equal is new Decimal_Equal_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Boolean is
function Equal is new Decimal_Equal_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Boolean is
function Lesser is new Decimal_Lesser_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Boolean is
function Lesser is new Decimal_Lesser_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Boolean is
function Lesser is new Decimal_Lesser_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Boolean is
function Greater is new Decimal_Greater_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Boolean is
function Greater is new Decimal_Greater_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Boolean is
function Greater is new Decimal_Greater_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Boolean is
function Lesser_Or_Equal is new Decimal_Lesser_Or_Equal_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal_Array) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Array_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Long_Decimal_Array; Right : Long_Long_Decimal) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Array_Scalar(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Long_Decimal; Right : Long_Long_Decimal_Array) return Boolean is
function Greater_Or_Equal is new Decimal_Greater_Or_Equal_Scalar_Array(Long_Long_Decimal, Long_Long_Decimal_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------------
-- Short Float Array --
-------------------------
function "+"(Value : Short_Float_Array) return Short_Float_Array is
function Assert is new Float_Assert_Array(Short_Float, Short_Float_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Short_Float_Array) return Short_Float_Array is
function Negate is new Float_Negate_Array(Short_Float, Short_Float_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Short_Float_Array) return Short_Float_Array is
function Absolute_Value is new Float_Absolute_Value_Array(Short_Float, Short_Float_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Short_Float_Array; Right : Short_Float_Array) return Short_Float_Array is
function Add is new Float_Add_Array_Array(Short_Float, Short_Float_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Float_Array; Right : Short_Float) return Short_Float_Array is
function Add is new Float_Add_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Short_Float; Right : Short_Float_Array) return Short_Float_Array is
function Add is new Float_Add_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Short_Float_Array; Right : Short_Float_Array) return Short_Float_Array is
function Subtract is new Float_Subtract_Array_Array(Short_Float, Short_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Float_Array; Right : Short_Float) return Short_Float_Array is
function Subtract is new Float_Subtract_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Short_Float; Right : Short_Float_Array) return Short_Float_Array is
function Subtract is new Float_Subtract_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Short_Float_Array; Right : Short_Float_Array) return Short_Float_Array is
function Multiply is new Float_Multiply_Array_Array(Short_Float, Short_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Float_Array; Right : Short_Float) return Short_Float_Array is
function Multiply is new Float_Multiply_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Short_Float; Right : Short_Float_Array) return Short_Float_Array is
function Multiply is new Float_Multiply_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Short_Float_Array; Right : Short_Float_Array) return Short_Float_Array is
function Divide is new Float_Divide_Array_Array(Short_Float, Short_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Float_Array; Right : Short_Float) return Short_Float_Array is
function Divide is new Float_Divide_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Short_Float; Right : Short_Float_Array) return Short_Float_Array is
function Divide is new Float_Divide_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Short_Float_Array; Right : Short_Float_Array) return Short_Float_Array is
function Remainder is new Float_Remainder_Array_Array(Short_Float, Short_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Float_Array; Right : Short_Float) return Short_Float_Array is
function Remainder is new Float_Remainder_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Short_Float; Right : Short_Float_Array) return Short_Float_Array is
function Remainder is new Float_Remainder_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Short_Float_Array; Right : Short_Float_Array) return Short_Float_Array is
function Modulus is new Float_Modulus_Array_Array(Short_Float, Short_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Float_Array; Right : Short_Float) return Short_Float_Array is
function Modulus is new Float_Modulus_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Short_Float; Right : Short_Float_Array) return Short_Float_Array is
function Modulus is new Float_Modulus_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Short_Float_Array; Right : Short_Float_Array) return Boolean is
function Equal is new Float_Equal_Array_Array(Short_Float, Short_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Float_Array; Right : Short_Float) return Boolean is
function Equal is new Float_Equal_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Short_Float; Right : Short_Float_Array) return Boolean is
function Equal is new Float_Equal_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Short_Float_Array; Right : Short_Float_Array) return Boolean is
function Lesser is new Float_Lesser_Array_Array(Short_Float, Short_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Float_Array; Right : Short_Float) return Boolean is
function Lesser is new Float_Lesser_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Short_Float; Right : Short_Float_Array) return Boolean is
function Lesser is new Float_Lesser_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Short_Float_Array; Right : Short_Float_Array) return Boolean is
function Greater is new Float_Greater_Array_Array(Short_Float, Short_Float_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Float_Array; Right : Short_Float) return Boolean is
function Greater is new Float_Greater_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Short_Float; Right : Short_Float_Array) return Boolean is
function Greater is new Float_Greater_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Short_Float_Array; Right : Short_Float_Array) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Array_Array(Short_Float, Short_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Float_Array; Right : Short_Float) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Short_Float; Right : Short_Float_Array) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Short_Float_Array; Right : Short_Float_Array) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Array_Array(Short_Float, Short_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Float_Array; Right : Short_Float) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Array_Scalar(Short_Float, Short_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Short_Float; Right : Short_Float_Array) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Scalar_Array(Short_Float, Short_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-------------------
-- Float Array --
-------------------
function "+"(Value : Float_Array) return Float_Array is
function Assert is new Float_Assert_Array(Float, Float_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Float_Array) return Float_Array is
function Negate is new Float_Negate_Array(Float, Float_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Float_Array) return Float_Array is
function Absolute_Value is new Float_Absolute_Value_Array(Float, Float_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Float_Array; Right : Float_Array) return Float_Array is
function Add is new Float_Add_Array_Array(Float, Float_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Float_Array; Right : Float) return Float_Array is
function Add is new Float_Add_Array_Scalar(Float, Float_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Float; Right : Float_Array) return Float_Array is
function Add is new Float_Add_Scalar_Array(Float, Float_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Float_Array; Right : Float_Array) return Float_Array is
function Subtract is new Float_Subtract_Array_Array(Float, Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Float_Array; Right : Float) return Float_Array is
function Subtract is new Float_Subtract_Array_Scalar(Float, Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Float; Right : Float_Array) return Float_Array is
function Subtract is new Float_Subtract_Scalar_Array(Float, Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Float_Array; Right : Float_Array) return Float_Array is
function Multiply is new Float_Multiply_Array_Array(Float, Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Float_Array; Right : Float) return Float_Array is
function Multiply is new Float_Multiply_Array_Scalar(Float, Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Float; Right : Float_Array) return Float_Array is
function Multiply is new Float_Multiply_Scalar_Array(Float, Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Float_Array; Right : Float_Array) return Float_Array is
function Divide is new Float_Divide_Array_Array(Float, Float_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Float_Array; Right : Float) return Float_Array is
function Divide is new Float_Divide_Array_Scalar(Float, Float_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Float; Right : Float_Array) return Float_Array is
function Divide is new Float_Divide_Scalar_Array(Float, Float_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Float_Array; Right : Float_Array) return Float_Array is
function Remainder is new Float_Remainder_Array_Array(Float, Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Float_Array; Right : Float) return Float_Array is
function Remainder is new Float_Remainder_Array_Scalar(Float, Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Float; Right : Float_Array) return Float_Array is
function Remainder is new Float_Remainder_Scalar_Array(Float, Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Float_Array; Right : Float_Array) return Float_Array is
function Modulus is new Float_Modulus_Array_Array(Float, Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Float_Array; Right : Float) return Float_Array is
function Modulus is new Float_Modulus_Array_Scalar(Float, Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Float; Right : Float_Array) return Float_Array is
function Modulus is new Float_Modulus_Scalar_Array(Float, Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Float_Array; Right : Float_Array) return Boolean is
function Equal is new Float_Equal_Array_Array(Float, Float_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Float_Array; Right : Float) return Boolean is
function Equal is new Float_Equal_Array_Scalar(Float, Float_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Float; Right : Float_Array) return Boolean is
function Equal is new Float_Equal_Scalar_Array(Float, Float_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Float_Array; Right : Float_Array) return Boolean is
function Lesser is new Float_Lesser_Array_Array(Float, Float_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Float_Array; Right : Float) return Boolean is
function Lesser is new Float_Lesser_Array_Scalar(Float, Float_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Float; Right : Float_Array) return Boolean is
function Lesser is new Float_Lesser_Scalar_Array(Float, Float_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Float_Array; Right : Float_Array) return Boolean is
function Greater is new Float_Greater_Array_Array(Float, Float_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Float_Array; Right : Float) return Boolean is
function Greater is new Float_Greater_Array_Scalar(Float, Float_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Float; Right : Float_Array) return Boolean is
function Greater is new Float_Greater_Scalar_Array(Float, Float_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Float_Array; Right : Float_Array) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Array_Array(Float, Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Float_Array; Right : Float) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Array_Scalar(Float, Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Float; Right : Float_Array) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Scalar_Array(Float, Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Float_Array; Right : Float_Array) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Array_Array(Float, Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Float_Array; Right : Float) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Array_Scalar(Float, Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Float; Right : Float_Array) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Scalar_Array(Float, Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
------------------------
-- Long Float Array --
------------------------
function "+"(Value : Long_Float_Array) return Long_Float_Array is
function Assert is new Float_Assert_Array(Long_Float, Long_Float_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Long_Float_Array) return Long_Float_Array is
function Negate is new Float_Negate_Array(Long_Float, Long_Float_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Long_Float_Array) return Long_Float_Array is
function Absolute_Value is new Float_Absolute_Value_Array(Long_Float, Long_Float_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Float_Array; Right : Long_Float_Array) return Long_Float_Array is
function Add is new Float_Add_Array_Array(Long_Float, Long_Float_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Float_Array; Right : Long_Float) return Long_Float_Array is
function Add is new Float_Add_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Float; Right : Long_Float_Array) return Long_Float_Array is
function Add is new Float_Add_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Float_Array; Right : Long_Float_Array) return Long_Float_Array is
function Subtract is new Float_Subtract_Array_Array(Long_Float, Long_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Float_Array; Right : Long_Float) return Long_Float_Array is
function Subtract is new Float_Subtract_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Float; Right : Long_Float_Array) return Long_Float_Array is
function Subtract is new Float_Subtract_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Float_Array; Right : Long_Float_Array) return Long_Float_Array is
function Multiply is new Float_Multiply_Array_Array(Long_Float, Long_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Float_Array; Right : Long_Float) return Long_Float_Array is
function Multiply is new Float_Multiply_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Float; Right : Long_Float_Array) return Long_Float_Array is
function Multiply is new Float_Multiply_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Float_Array; Right : Long_Float_Array) return Long_Float_Array is
function Divide is new Float_Divide_Array_Array(Long_Float, Long_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Float_Array; Right : Long_Float) return Long_Float_Array is
function Divide is new Float_Divide_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Float; Right : Long_Float_Array) return Long_Float_Array is
function Divide is new Float_Divide_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Float_Array; Right : Long_Float_Array) return Long_Float_Array is
function Remainder is new Float_Remainder_Array_Array(Long_Float, Long_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Float_Array; Right : Long_Float) return Long_Float_Array is
function Remainder is new Float_Remainder_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Float; Right : Long_Float_Array) return Long_Float_Array is
function Remainder is new Float_Remainder_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Float_Array; Right : Long_Float_Array) return Long_Float_Array is
function Modulus is new Float_Modulus_Array_Array(Long_Float, Long_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Float_Array; Right : Long_Float) return Long_Float_Array is
function Modulus is new Float_Modulus_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Float; Right : Long_Float_Array) return Long_Float_Array is
function Modulus is new Float_Modulus_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Long_Float_Array; Right : Long_Float_Array) return Boolean is
function Equal is new Float_Equal_Array_Array(Long_Float, Long_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Float_Array; Right : Long_Float) return Boolean is
function Equal is new Float_Equal_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Float; Right : Long_Float_Array) return Boolean is
function Equal is new Float_Equal_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Float_Array; Right : Long_Float_Array) return Boolean is
function Lesser is new Float_Lesser_Array_Array(Long_Float, Long_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Float_Array; Right : Long_Float) return Boolean is
function Lesser is new Float_Lesser_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Float; Right : Long_Float_Array) return Boolean is
function Lesser is new Float_Lesser_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Float_Array; Right : Long_Float_Array) return Boolean is
function Greater is new Float_Greater_Array_Array(Long_Float, Long_Float_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Float_Array; Right : Long_Float) return Boolean is
function Greater is new Float_Greater_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Float; Right : Long_Float_Array) return Boolean is
function Greater is new Float_Greater_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Float_Array; Right : Long_Float_Array) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Array_Array(Long_Float, Long_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Float_Array; Right : Long_Float) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Float; Right : Long_Float_Array) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Float_Array; Right : Long_Float_Array) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Array_Array(Long_Float, Long_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Float_Array; Right : Long_Float) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Array_Scalar(Long_Float, Long_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Float; Right : Long_Float_Array) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Scalar_Array(Long_Float, Long_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
-----------------------------
-- Long Long Float Array --
-----------------------------
function "+"(Value : Long_Long_Float_Array) return Long_Long_Float_Array is
function Assert is new Float_Assert_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Assert(Value);
end "+";
function "-"(Value : Long_Long_Float_Array) return Long_Long_Float_Array is
function Negate is new Float_Negate_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Negate(Value);
end "-";
function "abs"(Value : Long_Long_Float_Array) return Long_Long_Float_Array is
function Absolute_Value is new Float_Absolute_Value_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Absolute_Value(Value);
end "abs";
function "+"(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Add is new Float_Add_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Long_Long_Float_Array is
function Add is new Float_Add_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Add(Left, Right);
end "+";
function "+"(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Add is new Float_Add_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Add(Left, Right);
end "+";
function "-"(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Subtract is new Float_Subtract_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Long_Long_Float_Array is
function Subtract is new Float_Subtract_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "-"(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Subtract is new Float_Subtract_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Subtract(Left, Right);
end "-";
function "*"(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Multiply is new Float_Multiply_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Long_Long_Float_Array is
function Multiply is new Float_Multiply_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "*"(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Multiply is new Float_Multiply_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Multiply(Left, Right);
end "*";
function "/"(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Divide is new Float_Divide_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Long_Long_Float_Array is
function Divide is new Float_Divide_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "/"(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Divide is new Float_Divide_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Divide(Left, Right);
end "/";
function "rem"(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Remainder is new Float_Remainder_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Long_Long_Float_Array is
function Remainder is new Float_Remainder_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "rem"(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Remainder is new Float_Remainder_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Remainder(Left, Right);
end "rem";
function "mod"(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Modulus is new Float_Modulus_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Long_Long_Float_Array is
function Modulus is new Float_Modulus_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "mod"(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Long_Long_Float_Array is
function Modulus is new Float_Modulus_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Modulus(Left, Right);
end "mod";
function "="(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Boolean is
function Equal is new Float_Equal_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Boolean is
function Equal is new Float_Equal_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "="(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Boolean is
function Equal is new Float_Equal_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Equal(Left, Right);
end "=";
function "<"(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Boolean is
function Lesser is new Float_Lesser_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Boolean is
function Lesser is new Float_Lesser_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function "<"(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Boolean is
function Lesser is new Float_Lesser_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Lesser(Left, Right);
end "<";
function ">"(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Boolean is
function Greater is new Float_Greater_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Boolean is
function Greater is new Float_Greater_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Greater(Left, Right);
end ">";
function ">"(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Boolean is
function Greater is new Float_Greater_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Greater(Left, Right);
end ">";
function "<="(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function "<="(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Boolean is
function Lesser_Or_Equal is new Float_Lesser_Or_Equal_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Lesser_Or_Equal(Left, Right);
end "<=";
function ">="(Left : Long_Long_Float_Array; Right : Long_Long_Float_Array) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Array_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Long_Float_Array; Right : Long_Long_Float) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Array_Scalar(Long_Long_Float, Long_Long_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
function ">="(Left : Long_Long_Float; Right : Long_Long_Float_Array) return Boolean is
function Greater_Or_Equal is new Float_Greater_Or_Equal_Scalar_Array(Long_Long_Float, Long_Long_Float_Array);
begin
return Greater_Or_Equal(Left, Right);
end ">=";
end Mathematics.Arrays;
|
AdaCore/gpr | Ada | 25 | ads | package Pkg is
end Pkg;
|
reznikmm/matreshka | Ada | 3,943 | 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.Svg_Bbox_Attributes;
package Matreshka.ODF_Svg.Bbox_Attributes is
type Svg_Bbox_Attribute_Node is
new Matreshka.ODF_Svg.Abstract_Svg_Attribute_Node
and ODF.DOM.Svg_Bbox_Attributes.ODF_Svg_Bbox_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Svg_Bbox_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Svg_Bbox_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Svg.Bbox_Attributes;
|
onox/orka | Ada | 1,502 | adb | -- 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.SIMD.SSE.Singles.Arithmetic;
with Orka.SIMD.SSE.Singles.Swizzle;
package body Orka.SIMD.SSE.Singles.Math is
function Cross_Product (Left, Right : m128) return m128 is
use SIMD.SSE.Singles.Arithmetic;
use SIMD.SSE.Singles.Swizzle;
Mask_1_2_0_3 : constant := 1 + 2 * 4 + 0 * 16 + 3 * 64;
Left_YZX : constant m128 := Shuffle (Left, Left, Mask_1_2_0_3);
Right_YZX : constant m128 := Shuffle (Right, Right, Mask_1_2_0_3);
-- Z := Left (X) * Right (Y) - Left (Y) * Right (X)
-- X := Left (Y) * Right (Z) - Left (Z) * Right (Y)
-- Y := Left (Z) * Right (X) - Left (X) * Right (Z)
Result_ZXY : constant m128 := Left * Right_YZX - Left_YZX * Right;
begin
return Shuffle (Result_ZXY, Result_ZXY, Mask_1_2_0_3);
end Cross_Product;
end Orka.SIMD.SSE.Singles.Math;
|
wooky/aoc | Ada | 4,714 | adb | with Ada.Containers; use Ada.Containers;
with Ada.Containers.Generic_Array_Sort;
with Ada.Containers.Vectors;
with Ada.Strings; use Ada.Strings;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with AOC; use AOC;
function Day11 (F : Aoc_File) return Solution is
package Item_List_Vector is new Ada.Containers.Vectors (
Index_Type => Natural,
Element_Type => Long_Long_Integer
);
subtype Item_List is Item_List_Vector.Vector;
type Operand is (Add, Multiply, Square);
type Monkey is record
Items : Item_List;
Op : Operand;
Op_Scalar : Natural;
Test_Divisible : Positive;
Test_True : Natural;
Test_False : Natural;
Items_Inspected : Natural := 0;
end record;
package Monkey_Vector_Type is new Ada.Containers.Vectors (
Index_Type => Natural,
Element_Type => Monkey
);
subtype Monkey_Vector is Monkey_Vector_Type.Vector;
function Keep_Away (Monkeys_Original: Monkey_Vector; Rounds: Positive; Worry_Divide: Long_Long_Integer) return Long_Long_Integer is
Monkeys : Monkey_Vector := Monkeys_Original;
begin
for Round in 1 .. Rounds loop
for M of Monkeys loop
while not M.Items.Is_Empty loop
declare
Worry : Long_Long_Integer := M.Items.First_Element;
begin
M.Items.Delete_First;
case M.Op is
when Add => Worry := Worry + Long_Long_Integer (M.Op_Scalar);
when Multiply => Worry := Worry * Long_Long_Integer (M.Op_Scalar);
when Square => Worry := Worry * Worry;
end case;
Worry := Worry / Worry_Divide;
Worry := Worry mod (2 * 3 * 5 * 7 * 11 * 13 * 17 * 19);
if Worry mod Long_Long_Integer (M.Test_Divisible) = 0 then
Monkeys (M.Test_True).Items.Append (Worry);
else
Monkeys (M.Test_False).Items.Append (Worry);
end if;
M.Items_Inspected := M.Items_Inspected + 1;
end;
end loop;
end loop;
end loop;
declare
type Inspection_Array is array(Natural range <>) of Long_Long_Integer;
Inspections : Inspection_Array(Monkeys.First_Index .. Monkeys.Last_Index);
procedure Array_Sort is new Ada.Containers.Generic_Array_Sort (Index_Type => Natural, Element_Type => Long_Long_Integer, Array_Type => Inspection_Array);
begin
for I in Inspections'Range loop
Inspections (I) := Long_Long_Integer (Monkeys (I).Items_Inspected);
end loop;
Array_Sort (Inspections);
return Inspections (Inspections'Last - 1) * Inspections (Inspections'Last);
end;
end Keep_Away;
Monkeys : Monkey_Vector;
begin
declare
begin
while not End_Of_File (F) loop
declare
Line_Monkey : String := Get_Line (F);
Line_Starting_Items : String := Get_Line (F);
Line_Operation : String := Get_Line (F);
Line_Test : String := Get_Line (F);
Line_If_True : String := Get_Line (F);
Line_If_False : String := Get_Line (F);
Line_Blank : String := Get_Line (F);
M : Monkey;
From : Positive;
To : Natural;
begin
-- Parse starting items
From := 19;
loop
To := Index (Line_Starting_Items, ",", From);
if To = 0 then
M.Items.Append (Long_Long_Integer'Value (Line_Starting_Items (From .. Line_Starting_Items'Last)));
exit;
end if;
M.Items.Append (Long_Long_Integer'Value (Line_Starting_Items (From .. To - 1)));
From := To + 2;
end loop;
-- Parse operands
From := Index (Line_Operation, " ", Line_Operation'Last, Backward) + 1;
if Line_Operation (From .. Line_Operation'Last) = "old" then
M.Op := Square;
else
M.Op_Scalar := Positive'Value (Line_Operation (From .. Line_Operation'Last));
case Line_Operation (From - 2) is
when '+' => M.Op := Add;
when '*' => M.Op := Multiply;
when others => raise Program_Error with "Invalid operand " & Line_Operation (From - 2);
end case;
end if;
-- Parse tests
From := Index (Line_Test, " ", Line_Test'Last, Backward) + 1;
M.Test_Divisible := Positive'Value (Line_Test (From .. Line_Test'Last));
M.Test_True := Natural'Value (Line_If_True (Line_If_True'Last .. Line_If_True'Last));
M.Test_False := Natural'Value (Line_If_False (Line_If_False'Last .. Line_If_False'Last));
-- Add monkey
Monkeys.Append (M);
end;
end loop;
end;
return New_Solution (
S1 => Keep_Away (Monkeys, 20, 3)'Image,
S2 => Keep_Away (Monkeys, 10000, 1)'Image
);
end Day11;
|
AdaCore/Ada-IntelliJ | Ada | 541 | adb |
with AWS.Config.Set;
with AWS.Server;
with @[email protected];
procedure @[email protected] is
use AWS;
Web_Server : Server.HTTP;
Web_Config : Config.Object;
begin
-- Setup
Config.Set.Server_Host (Web_Config, Host);
Config.Set.Server_Port (Web_Config, Port);
-- Start the server
Server.Start (Web_Server, Callbacks.Default'Access, Web_Config);
-- Wait for the Q key
Server.Wait (Server.Q_Key_Pressed);
-- Stop the server
Server.Shutdown (Web_Server);
end @[email protected];
|
ptrebuc/ewok-kernel | Ada | 21,273 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with ewok.perm; use ewok.perm;
with ewok.exported.devices; use ewok.exported.devices;
with ewok.exported.interrupts; use ewok.exported.interrupts;
with ewok.exported.gpios; use ewok.exported.gpios;
with ewok.interrupts; use ewok.interrupts;
with ewok.sanitize;
with ewok.gpio;
with ewok.exti;
with ewok.mpu;
with ewok.debug;
with ewok.devices.perms;
with soc.devmap; use soc.devmap;
with soc.interrupts; use soc.interrupts;
with soc.nvic;
with soc.gpio;
with soc.rcc;
with types.c;
package body ewok.devices
with spark_mode => off
is
--pragma debug_policy (IGNORE);
procedure init
is begin
for i in registered_device'range loop
registered_device(i).status := DEV_STATE_UNUSED;
registered_device(i).task_id := ID_UNUSED;
registered_device(i).periph_id := NO_PERIPH;
-- FIXME initialize registered_device(i).udev with 0 values
end loop;
end init;
function get_task_from_id (dev_id : t_device_id)
return t_task_id
is
begin
return registered_device(dev_id).task_id;
end get_task_from_id;
function get_user_device (dev_id : t_device_id)
return t_checked_user_device_access
is
begin
return registered_device(dev_id).udev'access;
end get_user_device;
function get_user_device_size (dev_id : t_device_id)
return unsigned_32
is
begin
return registered_device(dev_id).udev.size;
end get_user_device_size;
function get_user_device_addr (dev_id : t_device_id)
return system_address
is
begin
return registered_device(dev_id).udev.base_addr;
end get_user_device_addr;
function is_user_device_region_ro (dev_id : t_device_id)
return boolean
is
begin
return soc.devmap.periphs(registered_device(dev_id).periph_id).ro;
end is_user_device_region_ro;
function get_user_device_subregions_mask (dev_id : t_device_id)
return unsigned_8
is
begin
return soc.devmap.periphs(registered_device(dev_id).periph_id).subregions;
end get_user_device_subregions_mask;
function get_interrupt_config_from_interrupt
(interrupt : soc.interrupts.t_interrupt)
return ewok.exported.interrupts.t_interrupt_config_access
is
dev_id : t_device_id;
begin
-- Retrieving the dev_id from the interrupt
dev_id := ewok.interrupts.get_device_from_interrupt (interrupt);
if dev_id = ID_DEV_UNUSED then
return NULL;
end if;
-- Looking at each interrupts configured for this device
-- to retrieve the proper interrupt configuration informations
for i in 1 .. registered_device(dev_id).udev.interrupt_num loop
if registered_device(dev_id).udev.interrupts(i).interrupt = interrupt
then
return registered_device(dev_id).udev.interrupts(i)'access;
end if;
end loop;
return NULL;
end get_interrupt_config_from_interrupt;
------------------------
-- Device registering --
------------------------
procedure get_registered_device_entry
(dev_id : out t_device_id;
success : out boolean)
is
begin
for id in registered_device'range loop
if registered_device(id).status = DEV_STATE_UNUSED then
registered_device(id).status := DEV_STATE_RESERVED;
dev_id := id;
success := true;
return;
end if;
end loop;
dev_id := ID_DEV_UNUSED;
success := false;
end get_registered_device_entry;
procedure release_registered_device_entry (dev_id : t_device_id)
is begin
registered_device(dev_id).status := DEV_STATE_UNUSED;
registered_device(dev_id).task_id := ID_UNUSED;
registered_device(dev_id).periph_id := NO_PERIPH;
-- FIXME initialize registered_device(dev_id).udev with 0 values
end release_registered_device_entry;
procedure register_device
(task_id : in t_task_id;
udev : in ewok.exported.devices.t_user_device_access;
dev_id : out t_device_id;
success : out boolean)
is
periph_id: soc.devmap.t_periph_id;
len : constant natural := types.c.len (udev.all.name);
name : string (1 .. len);
found : boolean;
begin
-- Convert C name to Ada string type for further log messages
types.c.to_ada (name, udev.all.name);
-- Is it an existing device ?
-- Note: GPIOs (size = 0) are not considered as devices despite a task
-- can register them. Thus, we don't look for them in soc.devmap.periphs
-- table.
if udev.all.size /= 0 then
periph_id :=
soc.devmap.find_periph (udev.all.base_addr, udev.all.size);
if periph_id = NO_PERIPH then
pragma DEBUG (debug.log (debug.ERROR, "Device not existing: " & name));
success := false;
return;
end if;
end if;
-- Is it already used ?
-- Note: GPIOs alone are not considered as devices. When the user
-- declares lone GPIOs, periph_id is NO_PERIPH
for id in registered_device'range loop
if registered_device(id).status /= DEV_STATE_UNUSED and then
registered_device(id).periph_id /= NO_PERIPH and then
registered_device(id).periph_id = periph_id
then
pragma DEBUG (debug.log (debug.ERROR, "Device already used: " & name));
success := false;
return;
end if;
end loop;
-- Are the GPIOs already used ?
for i in 1 .. udev.gpio_num loop
if ewok.gpio.is_used (udev.gpios(i).kref) then
pragma DEBUG (debug.log (debug.ERROR, "GPIOs already used: " & name));
success := false;
return;
end if;
end loop;
-- Are the related EXTIs already used ?
for i in 1 .. udev.gpio_num loop
if boolean (udev.gpios(i).settings.set_exti) and then
ewok.exti.is_used (udev.gpios(i).kref)
then
pragma DEBUG (debug.log (debug.ERROR, "EXTIs already used: " & name));
success := false;
return;
end if;
end loop;
-- We verify that the interrupts declared by this device really belong
-- to it
for declared_it in 1 .. udev.interrupt_num loop
found := false;
inner_loop:
for i in soc.devmap.periphs(periph_id).interrupt_list'range loop
if soc.devmap.periphs(periph_id).interrupt_list(i)
= udev.interrupts(declared_it).interrupt
then
found := true;
exit inner_loop;
end if;
end loop inner_loop;
if not found then
pragma DEBUG (debug.log (debug.ERROR, "Invalid interrupts: " & name));
success := false;
return;
end if;
end loop;
-- Is it possible to register interrupt handlers ?
for i in 1 .. udev.interrupt_num loop
if ewok.interrupts.is_interrupt_already_used
(udev.interrupts(i).interrupt)
then
pragma DEBUG (debug.log (debug.ERROR, "Interrupts already used: " & name));
success := false;
return;
end if;
end loop;
-- Is it possible to register a device ?
get_registered_device_entry (dev_id, success);
if not success then
pragma DEBUG (debug.log (debug.ERROR, "register_device(): no free slot!"));
return;
end if;
-- Registering the device
pragma DEBUG (debug.log (debug.INFO, "Registered device: " & name));
registered_device(dev_id).udev := t_checked_user_device (udev.all);
registered_device(dev_id).task_id := task_id;
registered_device(dev_id).periph_id := periph_id;
registered_device(dev_id).status := DEV_STATE_REGISTERED;
-- Registering GPIOs
for i in 1 .. udev.gpio_num loop
ewok.gpio.register
(task_id,
dev_id,
registered_device(dev_id).udev.gpios(i)'access,
success);
if not success then
raise program_error;
end if;
pragma DEBUG (debug.log (debug.INFO,
"Registered GPIO port" &
soc.gpio.t_gpio_port_index'image (udev.gpios(i).kref.port) &
" pin " &
soc.gpio.t_gpio_pin_index'image (udev.gpios(i).kref.pin)));
end loop;
-- Registering EXTIs
for i in 1 .. udev.gpio_num loop
ewok.exti.register (udev.gpios(i)'access, success);
if not success then
raise program_error;
end if;
end loop;
-- Registering handlers
for i in 1 .. udev.interrupt_num loop
ewok.interrupts.set_interrupt_handler
(udev.interrupts(i).interrupt,
udev.interrupts(i).handler,
task_id,
dev_id,
success);
if not success then
raise program_error;
end if;
end loop;
success := true;
end register_device;
procedure release_device
(task_id : in t_task_id;
dev_id : in t_device_id;
success : out boolean)
is
begin
-- That device belongs to the task?
if registered_device(dev_id).task_id /= task_id then
success := false;
return;
end if;
-- Releasing GPIOs and EXTIs
for i in 1 .. registered_device(dev_id).udev.gpio_num loop
ewok.gpio.release
(task_id, dev_id, registered_device(dev_id).udev.gpios(i)'access);
ewok.exti.release (registered_device(dev_id).udev.gpios(i)'access);
end loop;
-- Releasing interrupts
for i in 1 .. registered_device(dev_id).udev.interrupt_num loop
ewok.interrupts.reset_interrupt_handler
(registered_device(dev_id).udev.interrupts(i).interrupt,
task_id,
dev_id);
end loop;
-- Releasing the device
release_registered_device_entry (dev_id);
end release_device;
procedure enable_device
(dev_id : in t_device_id;
success : out boolean)
is
irq : soc.nvic.t_irq_index;
interrupt : t_interrupt;
begin
-- Check if the device was already configured
-- the device can be registered (first mapping) or enabled (successive (un)mappings)
if registered_device(dev_id).status /= DEV_STATE_REGISTERED and
registered_device(dev_id).status /= DEV_STATE_ENABLED then
raise program_error;
end if;
-- Configure and enable GPIOs
for i in 1 .. registered_device(dev_id).udev.gpio_num loop
ewok.gpio.config (registered_device(dev_id).udev.gpios(i)'access);
if registered_device(dev_id).udev.gpios(i).exti_trigger /=
GPIO_EXTI_TRIGGER_NONE
then
ewok.exti.enable (registered_device(dev_id).udev.gpios(i).kref);
end if;
end loop;
-- For each interrupt, enable its associated IRQ in the NVIC
for i in 1 .. registered_device(dev_id).udev.interrupt_num loop
interrupt := registered_device(dev_id).udev.interrupts(i).interrupt;
irq := soc.nvic.to_irq_number (interrupt);
soc.nvic.enable_irq (irq);
pragma DEBUG (debug.log (debug.INFO, "IRQ enabled: " & soc.nvic.t_irq_index'image (irq)));
end loop;
-- Enable device's clock
if registered_device(dev_id).periph_id /= NO_PERIPH then
if registered_device(dev_id).status = DEV_STATE_REGISTERED then
soc.rcc.enable_clock (registered_device(dev_id).periph_id);
end if;
pragma DEBUG (debug.log (debug.INFO, "Enabled device: "
& soc.devmap.periphs(registered_device(dev_id).periph_id).name));
end if;
registered_device(dev_id).status := DEV_STATE_ENABLED;
success := true;
end enable_device;
function sanitize_user_defined_interrupt
(udev : in ewok.exported.devices.t_user_device_access;
config : in ewok.exported.interrupts.t_interrupt_config;
task_id : in t_task_id)
return boolean
is
begin
if not ewok.sanitize.is_word_in_txt_slot
(to_system_address (config.handler), task_id)
then
pragma DEBUG (debug.log (debug.ERROR, "Handler not in .text section"));
return false;
end if;
if config.interrupt not in INT_WWDG .. INT_HASH_RNG
then
pragma DEBUG (debug.log (debug.ERROR, "Interrupt not in range"));
return false;
end if;
if config.mode = ISR_FORCE_MAINTHREAD and then
not ewok.perm.ressource_is_granted (PERM_RES_TSK_FISR, task_id)
then
pragma DEBUG (debug.log (debug.ERROR, "ISR_FORCE_MAINTHREAD not allowed"));
return false;
end if;
--
-- Verify posthooks
--
for i in 1 .. MAX_POSTHOOK_INSTR loop
if not config.posthook.action(i).instr'valid then
pragma DEBUG (debug.log (debug.ERROR, "Posthook: invalid action requested"));
return false;
end if;
case config.posthook.action(i).instr is
when POSTHOOK_NIL => null;
when POSTHOOK_READ =>
if config.posthook.action(i).read.offset > udev.all.size - 4 or
(config.posthook.action(i).read.offset and 2#11#) > 0
then
pragma DEBUG (debug.log (debug.ERROR, "Posthook: wrong READ offset"));
return false;
end if;
when POSTHOOK_WRITE =>
if config.posthook.action(i).write.offset > udev.all.size - 4 or
(config.posthook.action(i).write.offset and 2#11#) > 0
then
pragma DEBUG (debug.log (debug.ERROR, "Posthook: wrong WRITE offset"));
return false;
end if;
when POSTHOOK_WRITE_REG =>
if config.posthook.action(i).write_reg.offset_dest >
udev.all.size - 4
or (config.posthook.action(i).write_reg.offset_dest and 2#11#)
> 0
or config.posthook.action(i).write_reg.offset_src >
udev.all.size - 4
or (config.posthook.action(i).write_reg.offset_src and 2#11#)
> 0
then
pragma DEBUG (debug.log (debug.ERROR, "Posthook: wrong AND offset"));
return false;
end if;
when POSTHOOK_WRITE_MASK =>
if config.posthook.action(i).write_mask.offset_dest >
udev.all.size - 4
or (config.posthook.action(i).write_mask.offset_dest and 2#11#)
> 0
or config.posthook.action(i).write_mask.offset_src >
udev.all.size - 4
or (config.posthook.action(i).write_mask.offset_src and 2#11#)
> 0
or config.posthook.action(i).write_mask.offset_mask >
udev.all.size - 4
or (config.posthook.action(i).write_mask.offset_mask and 2#11#)
> 0
then
pragma DEBUG (debug.log (debug.ERROR, "Posthook: wrong MASK offset"));
return false;
end if;
end case;
end loop;
return true;
end sanitize_user_defined_interrupt;
function sanitize_user_defined_gpio
(udev : in ewok.exported.devices.t_user_device_access;
config : in ewok.exported.gpios.t_gpio_config;
task_id : in t_task_id)
return boolean
is
pragma unreferenced (udev);
begin
if config.exti_trigger /= GPIO_EXTI_TRIGGER_NONE and then
not ewok.perm.ressource_is_granted (PERM_RES_DEV_EXTI, task_id)
then
pragma DEBUG (debug.log (debug.ERROR, "PERM_RES_DEV_EXTI not allowed"));
return false;
end if;
if config.exti_handler /= 0 and then
not ewok.sanitize.is_word_in_txt_slot (config.exti_handler, task_id)
then
pragma DEBUG (debug.log (debug.ERROR, "EXTI handler not in .text section"));
return false;
end if;
if not config.exti_lock'valid
then
pragma DEBUG (debug.log (debug.ERROR, "EXTI invalid lock mode"));
return false;
end if;
return true;
end sanitize_user_defined_gpio;
function sanitize_user_defined_device
(udev : in ewok.exported.devices.t_user_device_access;
task_id : in t_task_id)
return boolean
is
len : constant natural := types.c.len (udev.all.name);
name : string (1 .. natural'min (t_device_name'length, len));
periph_id: soc.devmap.t_periph_id;
ok : boolean;
begin
if udev.all.name(t_device_name'last) /= ASCII.NUL then
types.c.to_ada (name, udev.all.name(1 .. t_device_name'length));
pragma DEBUG (debug.log (debug.ERROR, "Out-of-bound device name: " & name));
return false;
else
types.c.to_ada (name, udev.all.name);
end if;
if udev.all.size /= 0 then
periph_id := soc.devmap.find_periph (udev.all.base_addr, udev.all.size);
if periph_id = NO_PERIPH then
pragma DEBUG (debug.log (debug.ERROR, "Device at addr" & system_address'image
(udev.all.base_addr) & -- " with size" & unsigned_32'image (udev.all.size) &
": not found"));
return false;
end if;
if not ewok.perm.ressource_is_granted
(ewok.devices.perms.permissions(periph_id), task_id)
then
pragma DEBUG (debug.log (debug.ERROR, "No access to device: " & name));
return false;
end if;
end if;
for i in 1 .. udev.all.interrupt_num loop
ok := sanitize_user_defined_interrupt
(udev, udev.all.interrupts(i), task_id);
if not ok then
pragma DEBUG (debug.log (debug.ERROR, name & ": invalid udev.interrupts parameter"));
return false;
end if;
end loop;
for i in 1 .. udev.all.gpio_num loop
ok := sanitize_user_defined_gpio (udev, udev.all.gpios(i), task_id);
if not ok then
pragma DEBUG (debug.log (debug.ERROR, name & ": invalid udev.gpios parameter"));
return false;
end if;
end loop;
if udev.all.map_mode = DEV_MAP_VOLUNTARY then
if not ewok.perm.ressource_is_granted (PERM_RES_MEM_DYNAMIC_MAP, task_id) then
pragma DEBUG (debug.log (debug.ERROR, name & ": voluntary mapping not permited"));
return false;
end if;
end if;
return true;
end sanitize_user_defined_device;
procedure mpu_mapping_device
(dev_id : in t_device_id;
region : in m4.mpu.t_region_number;
success : out boolean)
is
dev_size : unsigned_32;
mpu_region_size : m4.mpu.t_region_size;
region_type : ewok.mpu.t_region_type;
ok : boolean;
begin
if dev_id = ID_DEV_UNUSED then
pragma DEBUG (debug.log ("mpu_mapping_device(): unused device"));
success := false;
return;
end if;
dev_size := get_user_device_size (dev_id);
if dev_size = 0 then
pragma DEBUG (debug.log ("mpu_mapping_device(): device size = 0"));
success := false;
return;
end if;
ewok.mpu.bytes_to_region_size
(dev_size, mpu_region_size, ok);
if not ok then
pragma DEBUG
(debug.log ("mpu_mapping_device(): bytes_to_region_size() failed!"));
success := false;
return;
end if;
if is_user_device_region_ro (dev_id) then
region_type := ewok.mpu.REGION_TYPE_USER_DEV_RO;
else
region_type := ewok.mpu.REGION_TYPE_USER_DEV;
end if;
ewok.mpu.set_region
(region_number => region,
addr => get_user_device_addr (dev_id),
size => mpu_region_size,
region_type => region_type,
subregion_mask => get_user_device_subregions_mask (dev_id));
success := true;
end mpu_mapping_device;
end ewok.devices;
|
AdaCore/langkit | Ada | 685 | adb | with Langkit_Support.Adalog.Main_Support;
use Langkit_Support.Adalog.Main_Support;
with Support;
-- Test a combination of features at the same time:
-- * Predicates
-- * Custom bind
-- * Domains.
procedure Main is
use T_Solver, Refs, Solver_Ifc;
X : constant Refs.Logic_Var := Create ("X");
Y : constant Refs.Logic_Var := Create ("Y");
function Is_Even (Val : Integer) return Boolean is (Val mod 2 = 0);
R3 : constant Relation :=
Domain (X, (1, 2, 3, 4, 5, 6))
and Propagate (X, Y, Conv => Support.Transformer_Singleton)
and Predicate (X, Predicate(Is_Even'Access, "Is_Even"))
and Domain (Y, (12, 18));
begin
Solve_All (R3);
end Main;
|
de-jcup/sechub | Ada | 169 | adb | -- SPDX-License-Identifier: MIT
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
-- NOSECHUB
Put_Line ("Hello, world!");
-- END-NOSECHUB
end Hello;
|
reznikmm/matreshka | Ada | 3,606 | 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_Edges.Hash is
new AMF.Elements.Generic_Hash (UMLDI_UML_Edge, UMLDI_UML_Edge_Access);
|
reznikmm/matreshka | Ada | 4,911 | 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 subprogram to insert/remove nodes from lists:
-- - list of children nodes of some node
-- - list of detached nodes of document node
-- - list of attribute nodes of element node
------------------------------------------------------------------------------
with Matreshka.DOM_Nodes;
package Matreshka.DOM_Lists is
pragma Preelaborate;
procedure Insert_Into_Children
(Parent : not null Matreshka.DOM_Nodes.Node_Access;
Node : not null Matreshka.DOM_Nodes.Node_Access);
-- Inserts node into the list of children nodes of given parent node.
procedure Remove_From_Children
(Node : not null Matreshka.DOM_Nodes.Node_Access);
-- Removes node from the list of children nodes of its parent node. Do
-- nothing if there is no parent node.
procedure Insert_Into_Attributes
(Element : not null Matreshka.DOM_Nodes.Element_Access;
Attribute : not null Matreshka.DOM_Nodes.Node_Access);
-- Inserts node into the list of attribute nodes of given element node.
procedure Remove_From_Attributes
(Attribute : not null Matreshka.DOM_Nodes.Node_Access);
-- Removes attribute node from the list of attribute nodes of owner element
-- node.
procedure Insert_Into_Detached
(Node : not null Matreshka.DOM_Nodes.Node_Access);
-- Inserts node into the list of detached nodes of its document.
procedure Remove_From_Detached
(Node : not null Matreshka.DOM_Nodes.Node_Access);
-- Removes node from the list of detached nodes of its document.
end Matreshka.DOM_Lists;
|
stcarrez/ada-servlet | Ada | 1,181 | ads | -----------------------------------------------------------------------
-- asf-routes-servlets-faces -- faces request routing
-- Copyright (C) 2015, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
package Servlet.Routes.Servlets.Faces is
type Faces_Route_Type is new Servlet_Route_Type with record
View : Ada.Strings.Unbounded.Unbounded_String;
end record;
type Faces_Route_Type_Access is access all Faces_Route_Type'Class;
end Servlet.Routes.Servlets.Faces;
|
PThierry/ewok-kernel | Ada | 6,837 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with ada.unchecked_conversion;
with soc.devmap; use soc.devmap;
with soc.pwr;
with soc.flash;
with soc.rcc.default;
package body soc.rcc
with spark_mode => off
is
procedure reset
is
function to_rcc_cfgr is new ada.unchecked_conversion
(unsigned_32, t_RCC_CFGR);
function to_rcc_pllcfgr is new ada.unchecked_conversion
(unsigned_32, t_RCC_PLLCFGR);
begin
RCC.CR.HSION := true;
RCC.CFGR := to_rcc_cfgr (0);
RCC.CR.HSEON := false;
RCC.CR.CSSON := false;
RCC.CR.PLLON := false;
-- Magic number. Cf. STM32F4 datasheet
RCC.PLLCFGR := to_rcc_pllcfgr (16#2400_3010#);
RCC.CR.HSEBYP := false;
RCC.CIR := 0; -- Reset all interrupts
end reset;
procedure init
is
begin
-- Power interface clock enable
RCC.APB1ENR.PWREN := true;
-- Regulator voltage scaling output selection
-- This bit controls the main internal voltage regulator output voltage
-- to achieve a trade-off between performance and power consumption when
-- the device does not operate at the maximum frequency.
soc.pwr.PWR.CR.VOS := soc.pwr.VOS_SCALE1;
if default.enable_hse then
RCC.CR.HSEON := true;
loop
exit when RCC.CR.HSERDY;
end loop;
else -- Enable HSI
RCC.CR.HSION := true;
loop
exit when RCC.CR.HSIRDY;
end loop;
end if;
if default.enable_pll then
RCC.CR.PLLON := false;
RCC.PLLCFGR :=
(PLLM => default.PLL_M, -- Division factor for the main PLL
PLLN => default.PLL_N, -- Main PLL multiplication factor for VCO
PLLP => default.PLL_P, -- Main PLL division factor for main system clock
PLLSRC => (if default.enable_hse then 1 else 0),
-- HSE or HSI oscillator clock selected as PLL
PLLQ => default.PLL_Q);
-- Main PLL division factor for USB OTG FS, SDIO and random
-- number generator
-- Enable the main PLL
RCC.CR.PLLON := true;
loop
exit when RCC.CR.PLLRDY;
end loop;
end if;
-- Configuring flash (prefetch, instruction cache, data cache, wait state)
soc.flash.FLASH.ACR.ICEN := true; -- Instruction cache enable
soc.flash.FLASH.ACR.DCEN := true; -- Data cache is enabled
soc.flash.FLASH.ACR.PRFTEN := false; -- Prefetch is disabled to avoid
-- SPA or DPA side channel attacks
soc.flash.FLASH.ACR.LATENCY := 5; -- Latency = 5 wait states
-- Set clock dividers
RCC.CFGR.HPRE := default.AHB_DIV; -- AHB prescaler
RCC.CFGR.PPRE1 := default.APB1_DIV; -- APB1 low speed prescaler
RCC.CFGR.PPRE2 := default.APB2_DIV; -- APB2 high speed prescaler
if default.enable_pll then
RCC.CFGR.SW := 2#10#; -- PLL selected as system clock
loop
exit when RCC.CFGR.SWS = 2#10#;
end loop;
end if;
end init;
procedure enable_clock (periph : in soc.devmap.t_periph_id)
is
begin
case periph is
when NO_PERIPH => return;
when DMA1_INFO .. DMA1_STR7 => soc.rcc.RCC.AHB1ENR.DMA1EN := true;
when DMA2_INFO .. DMA2_STR7 => soc.rcc.RCC.AHB1ENR.DMA2EN := true;
when CRYP_CFG .. CRYP => soc.rcc.RCC.AHB2ENR.CRYPEN := true;
when HASH => soc.rcc.RCC.AHB2ENR.HASHEN := true;
when RNG => soc.rcc.RCC.AHB2ENR.RNGEN := true;
when USB_OTG_FS => soc.rcc.RCC.AHB2ENR.OTGFSEN := true;
when USB_OTG_HS =>
soc.rcc.RCC.AHB1ENR.OTGHSEN := true;
soc.rcc.RCC.AHB1ENR.OTGHSULPIEN := true;
when SDIO => soc.rcc.RCC.APB2ENR.SDIOEN := true;
when ETH_MAC => soc.rcc.RCC.AHB1ENR.ETHMACEN := true;
when CRC => soc.rcc.RCC.AHB1ENR.CRCEN := true;
when SPI1 => soc.rcc.RCC.APB2ENR.SPI1EN := true;
when SPI2 => soc.rcc.RCC.APB1ENR.SPI2EN := true;
when SPI3 => soc.rcc.RCC.APB1ENR.SPI3EN := true;
when I2C1 => soc.rcc.RCC.APB1ENR.I2C1EN := true;
when I2C2 => soc.rcc.RCC.APB1ENR.I2C2EN := true;
when I2C3 => soc.rcc.RCC.APB1ENR.I2C3EN := true;
when CAN1 => soc.rcc.RCC.APB1ENR.CAN1EN := true;
when CAN2 => soc.rcc.RCC.APB1ENR.CAN2EN := true;
when USART1 => soc.rcc.RCC.APB2ENR.USART1EN := true;
when USART6 => soc.rcc.RCC.APB2ENR.USART6EN := true;
when USART2 => soc.rcc.RCC.APB1ENR.USART2EN := true;
when USART3 => soc.rcc.RCC.APB1ENR.USART3EN := true;
when UART4 => soc.rcc.RCC.APB1ENR.UART4EN := true;
when UART5 => soc.rcc.RCC.APB1ENR.UART5EN := true;
when TIM1 => soc.rcc.RCC.APB2ENR.TIM1EN := true;
when TIM8 => soc.rcc.RCC.APB2ENR.TIM8EN := true;
when TIM9 => soc.rcc.RCC.APB2ENR.TIM9EN := true;
when TIM10 => soc.rcc.RCC.APB2ENR.TIM10EN := true;
when TIM11 => soc.rcc.RCC.APB2ENR.TIM11EN := true;
when TIM2 => soc.rcc.RCC.APB1ENR.TIM2EN := true;
when TIM3 => soc.rcc.RCC.APB1ENR.TIM3EN := true;
when TIM4 => soc.rcc.RCC.APB1ENR.TIM4EN := true;
when TIM5 => soc.rcc.RCC.APB1ENR.TIM5EN := true;
when TIM6 => soc.rcc.RCC.APB1ENR.TIM6EN := true;
when TIM7 => soc.rcc.RCC.APB1ENR.TIM7EN := true;
when TIM12 => soc.rcc.RCC.APB1ENR.TIM12EN := true;
when TIM13 => soc.rcc.RCC.APB1ENR.TIM13EN := true;
when TIM14 => soc.rcc.RCC.APB1ENR.TIM14EN := true;
when FLASH_CTRL .. FLASH_FLOP => null;
end case;
end enable_clock;
end soc.rcc;
|
onox/orka | Ada | 2,849 | 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.Transforms.Doubles.Vectors;
package Orka.Behaviors is
pragma Preelaborate;
subtype Vector4 is Orka.Transforms.Doubles.Vectors.Vector4;
type Visibility is (Invisible, Visible);
-----------------------------------------------------------------------------
type Behavior is limited interface;
type Behavior_Ptr is not null access all Behavior'Class;
function Position (Object : Behavior) return Vector4 is abstract;
procedure Fixed_Update (Object : in out Behavior; Delta_Time : Duration) is null;
-- Called zero to multiple times per frame and before Update
--
-- Fixed_Update can be used to perform physics or other computations
-- that require a stable Delta_Time that does not depend on the frame
-- rate. If the game needs to catch up then Fixed_Update is called
-- multiple times. If the game renders at a very high frame rate then
-- Fixed_Update will not be called at all.
procedure Update (Object : in out Behavior; Delta_Time : Duration) is null;
-- Called once per frame and after any calls to Fixed_Update
procedure After_Update
(Object : in out Behavior;
Delta_Time : Duration;
View_Position : Vector4) is null;
-- Called once per frame and after Update
procedure Visibility_Changed (Object : in out Behavior; State : Visibility) is null;
procedure Render (Object : in out Behavior) is null;
procedure After_Render (Object : in out Behavior) is null;
-----------------------------------------------------------------------------
type Behavior_Array is array (Positive range <>) of Behaviors.Behavior_Ptr;
type Behavior_Array_Access is access Behavior_Array;
Null_Behavior : constant Behavior_Ptr;
function Empty_Behavior_Array return Behavior_Array_Access;
private
type Origin_Behavior is new Behavior with null record;
overriding
function Position (Object : Origin_Behavior) return Vector4 is
((0.0, 0.0, 0.0, 1.0));
Null_Behavior : constant Behavior_Ptr := new Origin_Behavior;
function Empty_Behavior_Array return Behavior_Array_Access is
(new Behavior_Array'(1 .. 0 => Null_Behavior));
end Orka.Behaviors;
|
reznikmm/matreshka | Ada | 3,894 | 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$
------------------------------------------------------------------------------
package body XML.DOM.Visitors is
-----------
-- Visit --
-----------
procedure Visit
(Self : in out Abstract_Iterator'Class;
Visitor : in out Abstract_Visitor'Class;
Element : not null XML.DOM.Nodes.DOM_Node_Access;
Control : in out Traverse_Control) is
begin
Element.Enter_Element (Visitor, Control);
Element.Visit_Element (Self, Visitor, Control);
if Control /= Terminate_Immediately then
Element.Leave_Element (Visitor, Control);
end if;
end Visit;
end XML.DOM.Visitors;
|
reznikmm/matreshka | Ada | 4,083 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Table_Display_Member_Mode_Attributes;
package Matreshka.ODF_Table.Display_Member_Mode_Attributes is
type Table_Display_Member_Mode_Attribute_Node is
new Matreshka.ODF_Table.Abstract_Table_Attribute_Node
and ODF.DOM.Table_Display_Member_Mode_Attributes.ODF_Table_Display_Member_Mode_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Table_Display_Member_Mode_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Table_Display_Member_Mode_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Table.Display_Member_Mode_Attributes;
|
godunko/adagl | Ada | 3,481 | adb | ------------------------------------------------------------------------------
-- --
-- Ada binding for OpenGL/WebGL --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016-2018, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
package body OpenGL.Renderbuffers.Internals is
----------------------------
-- Get_WebGL_Renderbuffer --
----------------------------
function Get_WebGL_Renderbuffer
(Self : OpenGL_Renderbuffer'Class)
return WebAPI.WebGL.Renderbuffers.WebGL_Renderbuffer_Access is
begin
return Self.Renderbuffer;
end Get_WebGL_Renderbuffer;
end OpenGL.Renderbuffers.Internals;
|
reznikmm/matreshka | Ada | 4,695 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Visitors;
with ODF.DOM.Text_Keywords_Elements;
package Matreshka.ODF_Text.Keywords_Elements is
type Text_Keywords_Element_Node is
new Matreshka.ODF_Text.Abstract_Text_Element_Node
and ODF.DOM.Text_Keywords_Elements.ODF_Text_Keywords
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Text_Keywords_Element_Node;
overriding function Get_Local_Name
(Self : not null access constant Text_Keywords_Element_Node)
return League.Strings.Universal_String;
overriding procedure Enter_Node
(Self : not null access Text_Keywords_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Leave_Node
(Self : not null access Text_Keywords_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Visit_Node
(Self : not null access Text_Keywords_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
end Matreshka.ODF_Text.Keywords_Elements;
|
AdaCore/libadalang | Ada | 172 | ads | package Foo is
A : constant Character := 'a';
Single_Quote : constant Character := ''';
Eacute : constant Wide_Wide_Character := 'é';
end Foo;
|
reznikmm/matreshka | Ada | 4,720 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Chart.Label_Position_Negative_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Chart_Label_Position_Negative_Attribute_Node is
begin
return Self : Chart_Label_Position_Negative_Attribute_Node do
Matreshka.ODF_Chart.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Chart_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Chart_Label_Position_Negative_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Label_Position_Negative_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Chart_URI,
Matreshka.ODF_String_Constants.Label_Position_Negative_Attribute,
Chart_Label_Position_Negative_Attribute_Node'Tag);
end Matreshka.ODF_Chart.Label_Position_Negative_Attributes;
|
albinjal/ada_basic | Ada | 633 | adb | with Date_Package; use Date_Package;
with Ada.Text_IO; use Ada.Text_IO;
procedure Lab4a is
type Dates is array (1..10) of Date_Type;
procedure Test_Get(Date: out Date_Type) is
begin
loop
begin
Get(Date);
exit;
exception
when YEAR_ERROR => Put_Line("FEL: YEAR_ERROR");
when MONTH_ERROR => Put_Line("FEL: MONTH_ERROR");
when DAY_ERROR => Put_Line("FEL: DAY_ERROR");
when FORMAT_ERROR => Put_Line("FEL: FORMAT_ERROR");
end;
end loop;
end Test_Get;
Date: Date_Type;
begin
Put("Ange ett datum: ");
Test_Get(Date);
Put("Ett datum: ");
Put(Date); New_Line;
end Lab4a;
|
reznikmm/matreshka | Ada | 4,695 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Text.Animation_Stop_Inside_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Text_Animation_Stop_Inside_Attribute_Node is
begin
return Self : Text_Animation_Stop_Inside_Attribute_Node do
Matreshka.ODF_Text.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Text_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Text_Animation_Stop_Inside_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Animation_Stop_Inside_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Text_URI,
Matreshka.ODF_String_Constants.Animation_Stop_Inside_Attribute,
Text_Animation_Stop_Inside_Attribute_Node'Tag);
end Matreshka.ODF_Text.Animation_Stop_Inside_Attributes;
|
zhmu/ananas | Ada | 253 | adb | -- { dg-do compile }
package body Renaming10 is
function F (Input : Rec) return Natural is
Position : Natural renames Input.Position;
Index : Natural renames Natural'Succ(Position);
begin
return Index;
end;
end Renaming10;
|
io7m/coreland-sdl-ada | Ada | 4,396 | ads | with Interfaces.C.Strings;
package SDL.Joystick is
package CS renames Interfaces.C.Strings;
type Joystick_Access_t is new Void_Ptr_t;
pragma Convention (C, Joystick_Access_t);
type Hat_State_t is new Uint8_t;
pragma Convention (C, Hat_State_t);
type Button_State_t is new Uint8_t;
pragma Convention (C, Button_State_t);
Hat_Centered : constant Hat_State_t := 16#00#;
Hat_Up : constant Hat_State_t := 16#01#;
Hat_Right : constant Hat_State_t := 16#02#;
Hat_Down : constant Hat_State_t := 16#04#;
Hat_Left : constant Hat_State_t := 16#08#;
Hat_Rightup : constant Hat_State_t := (Hat_Right or Hat_Up);
Hat_Rightdown : constant Hat_State_t := (Hat_Right or Hat_Down);
Hat_Leftup : constant Hat_State_t := (Hat_Left or Hat_Up);
Hat_Leftdown : constant Hat_State_t := (Hat_Left or Hat_Down);
Pressed : constant Button_State_t := 1;
Released : constant Button_State_t := 0;
-- Closes a previously opened joystick.
procedure Close (Joystick : Joystick_Access_t);
pragma Import (C, Close, "SDL_JoystickClose");
-- Enable/disable joystick event polling.
function EventState (State : C.int) return C.int;
pragma Import (C, EventState, "SDL_JoystickEventState");
-- Gets the current state of an axis.
function GetAxis (Joystick : Joystick_Access_t; Axis : C.int) return Int16_t;
function Get_Axis (Joystick : Joystick_Access_t; Axis : C.int) return Int16_t renames GetAxis;
pragma Import (C, GetAxis, "SDL_JoystickGetAxis");
-- Gets relative trackball motion
function Getball
(Joystick : Joystick_Access_t;
Ball : C.int;
Delta_X : Int_Ptr_t;
Delta_Y : Int_Ptr_t)
return C.int;
function Get_Ball
(Joystick : Joystick_Access_t;
Ball : C.int;
Delta_X : Int_Ptr_t;
Delta_Y : Int_Ptr_t)
return C.int renames Getball;
pragma Import (C, Getball, "SDL_JoystickGetBall");
-- Gets the current state of a joystick hat
function GetHat (Joystick : Joystick_Access_t; Hat : C.int) return Uint8_t;
function Get_Hat (Joystick : Joystick_Access_t; Hat : C.int) return Uint8_t renames GetHat;
pragma Import (C, GetHat, "SDL_JoystickGetHat");
-- Gets the current state of a given button on a given joystick
function GetButton (Joystick : Joystick_Access_t; Button : C.int) return Button_State_t;
function Get_Button (Joystick : Joystick_Access_t; Button : C.int) return Button_State_t renames GetButton;
pragma Import (C, GetButton, "SDL_JoystickGetButton");
-- Get the device index of an opened joystick.
function Index (Joystick : Joystick_Access_t) return C.int;
pragma Import (C, Index, "SDL_JoystickIndex");
-- Gets joystick name.
function Name (Device_Index : C.int) return CS.chars_ptr;
pragma Import (C, Name, "SDL_JoystickName");
-- Counts available joysticks.
function NumJoysticks return C.int;
function Num_Joysticks return C.int renames NumJoysticks;
pragma Import (C, NumJoysticks, "SDL_NumJoysticks");
-- Gets the number of joystick axes
function NumAxes (Joystick : Joystick_Access_t) return C.int;
function Num_Axes (Joystick : Joystick_Access_t) return C.int renames NumAxes;
pragma Import (C, NumAxes, "SDL_JoystickNumAxes");
-- Gets the number of joystick trackballs
function NumBalls (Joystick : Joystick_Access_t) return C.int;
function Num_Balls (Joystick : Joystick_Access_t) return C.int renames NumBalls;
pragma Import (C, NumBalls, "SDL_JoystickNumBalls");
-- Gets the number of joystick hats
function NumHats (Joystick : Joystick_Access_t) return C.int;
function Num_Hats (Joystick : Joystick_Access_t) return C.int renames NumHats;
pragma Import (C, NumHats, "SDL_JoystickNumHats");
-- Gets the number of joystick buttons
function NumButtons (Joystick : Joystick_Access_t) return C.int;
function Num_Buttons (Joystick : Joystick_Access_t) return C.int renames NumButtons;
pragma Import (C, NumButtons, "SDL_JoystickNumButtons");
-- Opens a joystick for use.
function Open (Device_Index : C.int) return Joystick_Access_t;
pragma Import (C, Open, "SDL_JoystickOpen");
-- Determines if a joystick has been opened
function Opened (Device_Index : C.int) return C.int;
pragma Import (C, Opened, "SDL_JoystickOpened");
-- Updates the state of all joysticks.
procedure Update;
pragma Import (C, Update, "SDL_JoystickUpdate");
end SDL.Joystick;
|
LionelDraghi/smk | Ada | 1,132 | ads | -- -----------------------------------------------------------------------------
-- smk, the smart make (http://lionel.draghi.free.fr/smk/)
-- © 2018, 2019 Lionel Draghi <[email protected]>
-- SPDX-License-Identifier: APSL-2.0
-- -----------------------------------------------------------------------------
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
-- http://www.apache.org/licenses/LICENSE-2.0
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- -----------------------------------------------------------------------------
with Ada.Containers.Ordered_Maps;
package Smk.Files.File_Lists is
new Ada.Containers.Ordered_Maps (Key_Type => File_Name,
Element_Type => File_Type);
|
HackInvent/Ada_Drivers_Library | Ada | 6,768 | adb | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with HAL.SPI;
use type HAL.SPI.SPI_Status;
package body STM32.Board is
------------------
-- All_LEDs_Off --
------------------
procedure All_LEDs_Off is
begin
Clear (All_LEDs);
end All_LEDs_Off;
-----------------
-- All_LEDs_On --
-----------------
procedure All_LEDs_On is
begin
Set (All_LEDs);
end All_LEDs_On;
---------------------
-- Initialize_LEDs --
---------------------
procedure Initialize_LEDs is
begin
Enable_Clock (All_LEDs);
Configure_IO
(All_LEDs,
(Mode => Mode_Out,
Output_Type => Push_Pull,
Speed => Speed_100MHz,
Resistors => Floating));
end Initialize_LEDs;
procedure WriteRegister_SPI4(add : in HAL.UInt8; val : in HAL.UInt8)
is
Status : HAL.SPI.SPI_Status;
begin
STM32.SPI.Enable(EXT_SPI);
STM32.SPI.Transmit(This => EXT_SPI,Status => Status,Data => HAL.SPI.SPI_Data_8b'(1 => (add)));
if Status /= HAL.SPI.Ok then
raise Program_Error;
end if;
STM32.SPI.Transmit(This => EXT_SPI,Status => Status,Data => HAL.SPI.SPI_Data_8b'(1 => (val)));
if Status /= HAL.SPI.Ok then
raise Program_Error;
end if;
end WriteRegister_SPI4;
procedure Initialize_SPI4 is
SPI_Conf : STM32.SPI.SPI_Configuration;
GPIO_Conf : STM32.GPIO.GPIO_Port_Configuration;
Status : HAL.SPI.SPI_Status;
begin
Enable_Clock(GPIO_E);
Enable_Clock(SPI4_Points);
GPIO_Conf := (Mode => STM32.GPIO.Mode_AF,
AF => GPIO_AF_SPI4_5,
Resistors => STM32.GPIO.Floating,
AF_Speed => STM32.GPIO.Speed_100MHz,
AF_Output_Type => STM32.GPIO.Push_Pull);
Enable_Clock (EXT_SPI);
STM32.GPIO.Configure_IO (SPI4_Points, GPIO_Conf);
-- disable the SPI before configuration
EXT_SPI.Disable;
-- configure the SPI
SPI_Conf.Direction := STM32.SPI.D2Lines_FullDuplex;
SPI_Conf.Mode := STM32.SPI.Master;
SPI_Conf.Data_Size := HAL.SPI.Data_Size_8b;
SPI_Conf.Clock_Polarity := STM32.SPI.Low;
SPI_Conf.Clock_Phase := STM32.SPI.P1Edge;
SPI_Conf.Slave_Management := STM32.SPI.Software_Managed;
SPI_Conf.Baud_Rate_Prescaler := STM32.SPI.BRP_2;
SPI_Conf.First_Bit := STM32.SPI.LSB;
SPI_Conf.CRC_Poly := 7;
EXT_SPI.testConfigure(SPI_Conf);
-- enable the SPI
EXT_SPI.Enable;
-- set the configuration
--
-- EXT_SPI.Configure (SPI_Conf);
--
-- -- enable the SPI
-- EXT_SPI.Enable;
end Initialize_SPI4;
-------------------------
-- Initialize_I2C_GPIO --
-------------------------
--
-- procedure Initialize_I2C_GPIO (Port : in out I2C_Port)
-- is
-- Id : constant I2C_Port_Id := As_Port_Id (Port);
-- Points : GPIO_Points (1 .. 2);
--
-- begin
-- if Port_Enabled (Port) then
-- return;
-- end if;
--
-- case Id is
-- when I2C_Id_1 =>
-- Points := (I2C1_SDA, I2C1_SCL);
-- when I2C_Id_4 =>
-- Points := (I2C4_SDA, I2C4_SCL);
-- when others =>
-- raise Unknown_Device with
-- "This I2C_Port cannot be used on this board";
-- end case;
--
-- Enable_Clock (Points);
--
-- Configure_IO (Points,
-- (Mode => Mode_AF,
-- AF => GPIO_AF_I2C1_4,
-- AF_Speed => Speed_50MHz,
-- AF_Output_Type => Open_Drain,
-- Resistors => Floating));
--
-- if Id /= I2C_Id_1 then
-- Configure_Alternate_Function (I2C4_SCL, GPIO_AF_I2C4_4);
-- Configure_Alternate_Function (I2C4_SDA, GPIO_AF_I2C4_11);
-- end if;
--
-- Lock (Points);
-- end Initialize_I2C_GPIO;
--------------------------------
-- Configure_User_Button_GPIO --
--------------------------------
-- procedure Configure_User_Button_GPIO is
-- begin
-- Enable_Clock (User_Button_Point);
-- Configure_IO (User_Button_Point, (Mode_In, Resistors => Floating));
-- end Configure_User_Button_GPIO;
end STM32.Board;
|
rveenker/sdlada | Ada | 10,715 | adb | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
with Interfaces.C;
with Interfaces.C.Strings;
with SDL.Error;
package body SDL.Inputs.Joysticks is
package C renames Interfaces.C;
use type C.int;
function Total return All_Devices is
function SDL_Num_Joysticks return C.int with
Import => True,
Convention => C,
External_Name => "SDL_NumJoysticks";
Result : C.int := SDL_Num_Joysticks;
begin
if Result < 0 then
raise Joystick_Error with SDL.Error.Get;
end if;
return All_Devices (Result);
end Total;
function Name (Device : in Devices) return String is
function SDL_Joystick_Name_For_Index (Device : in C.int) return C.Strings.chars_ptr with
Import => True,
Convention => C,
External_Name => "SDL_JoystickNameForIndex";
begin
return C.Strings.Value (SDL_Joystick_Name_For_Index (C.int (Device) - 1));
end Name;
function GUID (Device : in Devices) return GUIDs is
function SDL_Joystick_Get_Device_GUID (Device : in C.int) return GUIDs with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetDeviceGUID";
begin
return SDL_Joystick_Get_Device_GUID (C.int (Device) - 1);
end GUID;
function Image (GUID : in GUIDs) return String is
procedure SDL_Joystick_Get_GUID_String (GUID : in GUIDs;
Buffer : out C.char_array;
Size : in C.int) with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetGUIDString";
Data_Buffer : C.char_array (0 .. 127) := (others => C.nul);
L : C.int := C.int (Data_Buffer'Length);
begin
SDL_Joystick_Get_GUID_String (GUID, Data_Buffer, L);
return C.To_Ada (Data_Buffer);
end Image;
function Value (GUID : in String) return GUIDs is
function SDL_Joystick_Get_GUID_From_String (Buffer : in C.char_array) return GUIDs with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetGUIDFromString";
begin
return SDL_Joystick_Get_GUID_From_String (C.To_C (GUID));
end Value;
function "=" (Left, Right : in Joystick) return Boolean is
use type SDL.C_Pointers.Joystick_Pointer;
begin
return Left.Internal = Right.Internal and then Left.Owns = Right.Owns;
end "=";
procedure Close (Self : in out Joystick) is
procedure SDL_Joystick_Close (Stick : in SDL.C_Pointers.Joystick_Pointer) with
Import => True,
Convention => C,
External_Name => "SDL_JoystickClose";
begin
SDL_Joystick_Close (Self.Internal);
-- Reinitialise the object so it's actually a Null_Joystick.
Self.Internal := null;
Self.Owns := True;
end Close;
function Axes (Self : in Joystick) return SDL.Events.Joysticks.Axes is
function SDL_Joystick_Num_Axes (Stick : in SDL.C_Pointers.Joystick_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_JoystickNumAxes";
Total : C.int := SDL_Joystick_Num_Axes (Self.Internal);
begin
if Total < 0 then
raise Joystick_Error with SDL.Error.Get;
end if;
return SDL.Events.Joysticks.Axes (Total);
end Axes;
function Balls (Self : in Joystick) return SDL.Events.Joysticks.Balls is
function SDL_Joystick_Num_Balls (Stick : in SDL.C_Pointers.Joystick_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_JoystickNumBalls";
Total : C.int := SDL_Joystick_Num_Balls (Self.Internal);
begin
if Total < 0 then
raise Joystick_Error with SDL.Error.Get;
end if;
return SDL.Events.Joysticks.Balls (Total);
end Balls;
function Buttons (Self : in Joystick) return SDL.Events.Joysticks.Buttons is
function SDL_Joystick_Num_Buttons (Stick : in SDL.C_Pointers.Joystick_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_JoystickNumButtons";
Total : C.int := SDL_Joystick_Num_Buttons (Self.Internal);
begin
if Total < 0 then
raise Joystick_Error with SDL.Error.Get;
end if;
return SDL.Events.Joysticks.Buttons (Total);
end Buttons;
function Hats (Self : in Joystick) return SDL.Events.Joysticks.Hats is
function SDL_Joystick_Num_Hats (Stick : in SDL.C_Pointers.Joystick_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_JoystickNumHats";
Total : C.int := SDL_Joystick_Num_Hats (Self.Internal);
begin
if Total < 0 then
raise Joystick_Error with SDL.Error.Get;
end if;
return SDL.Events.Joysticks.Hats (Total);
end Hats;
function Name (Self : in Joystick) return String is
function SDL_Joystick_Name (Stick : in SDL.C_Pointers.Joystick_Pointer) return C.Strings.chars_ptr with
Import => True,
Convention => C,
External_Name => "SDL_JoystickName";
begin
return C.Strings.Value (SDL_Joystick_Name (Self.Internal));
end Name;
function Is_Haptic (Self : in Joystick) return Boolean is
function SDL_Joystick_Is_Haptic (Stick : in SDL.C_Pointers.Joystick_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_JoystickIsHaptic";
Result : C.int := SDL_Joystick_Is_Haptic (Self.Internal);
begin
if Result < 0 then
raise Joystick_Error with SDL.Error.Get;
elsif Result = 1 then
return True;
end if;
return False;
end Is_Haptic;
function Is_Attached (Self : in Joystick) return Boolean is
function SDL_Joystick_Is_Attached (Stick : in SDL.C_Pointers.Joystick_Pointer) return SDL_Bool with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetAttached";
begin
return SDL_Joystick_Is_Attached (Self.Internal) = SDL_True;
end Is_Attached;
function GUID (Self : in Joystick) return GUIDs is
function SDL_Joystick_Get_GUID (Stick : in SDL.C_Pointers.Joystick_Pointer) return GUIDs with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetGUID";
begin
return SDL_Joystick_Get_GUID (Self.Internal);
end GUID;
function Instance (Self : in Joystick) return Instances is
function SDL_Joystick_Instance_ID (Stick : in SDL.C_Pointers.Joystick_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_JoystickInstanceID";
Result : C.int := SDL_Joystick_Instance_ID (Self.Internal);
begin
if Result < Success then
raise Joystick_Error with SDL.Error.Get;
end if;
return Instances (Result);
end Instance;
function Axis_Value (Self : in Joystick;
Axis : in SDL.Events.Joysticks.Axes) return SDL.Events.Joysticks.Axes_Values is
function SDL_Joystick_Get_Axis (Stick : in SDL.C_Pointers.Joystick_Pointer;
Axis : in SDL.Events.Joysticks.Axes) return SDL.Events.Joysticks.Axes_Values with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetAxis";
begin
return SDL_Joystick_Get_Axis (Self.Internal, Axis);
end Axis_Value;
procedure Ball_Value (Self : in Joystick;
Ball : in SDL.Events.Joysticks.Balls;
Delta_X, Delta_Y : out SDL.Events.Joysticks.Ball_Values) is
function SDL_Joystick_Get_Ball (Stick : in SDL.C_Pointers.Joystick_Pointer;
Ball : in SDL.Events.Joysticks.Balls;
Delta_X, Delta_Y : out SDL.Events.Joysticks.Ball_Values) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetBall";
Result : C.int := SDL_Joystick_Get_Ball (Self.Internal, Ball, Delta_X, Delta_Y);
begin
if Result < Success then
raise Joystick_Error with SDL.Error.Get;
end if;
end Ball_Value;
function Hat_Value (Self : in Joystick;
Hat : in SDL.Events.Joysticks.Hats) return SDL.Events.Joysticks.Hat_Positions is
function SDL_Joystick_Get_Hat (Stick : in SDL.C_Pointers.Joystick_Pointer;
Ball : in SDL.Events.Joysticks.Hats)
return SDL.Events.Joysticks.Hat_Positions with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetHat";
begin
return SDL_Joystick_Get_Hat (Self.Internal, Hat);
end Hat_Value;
function Is_Button_Pressed (Self : in Joystick; Button : in SDL.Events.Joysticks.Buttons)
return SDL.Events.Button_State is
function SDL_Joystick_Get_Button (Stick : in SDL.C_Pointers.Joystick_Pointer;
Button : in SDL.Events.Joysticks.Buttons) return SDL.Events.Button_State with
Import => True,
Convention => C,
External_Name => "SDL_JoystickGetButton";
begin
return SDL_Joystick_Get_Button (Self.Internal, Button);
end Is_Button_Pressed;
end SDL.Inputs.Joysticks;
|
faelys/natools | Ada | 1,694 | adb | ------------------------------------------------------------------------------
-- Copyright (c) 2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
package body Natools.S_Expressions.Atom_Ref_Constructors is
function Create (Data : in Atom) return Atom_Refs.Immutable_Reference is
function Create_Atom return Atom is (Data);
begin
return Atom_Refs.Create (Create_Atom'Access);
end Create;
function Create (Data : in Atom) return Atom_Refs.Reference is
function Create_Atom return Atom is (Data);
begin
return Atom_Refs.Create (Create_Atom'Access);
end Create;
end Natools.S_Expressions.Atom_Ref_Constructors;
|
charlie5/cBound | Ada | 1,496 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_render_glyph_set_error_t is
-- Item
--
type Item is record
response_type : aliased Interfaces.Unsigned_8;
error_code : aliased Interfaces.Unsigned_8;
sequence : aliased Interfaces.Unsigned_16;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_render_glyph_set_error_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_render_glyph_set_error_t.Item,
Element_Array => xcb.xcb_render_glyph_set_error_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_render_glyph_set_error_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_render_glyph_set_error_t.Pointer,
Element_Array => xcb.xcb_render_glyph_set_error_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_render_glyph_set_error_t;
|
reznikmm/matreshka | Ada | 3,603 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Elements.Generic_Hash;
function AMF.OCL.Void_Types.Hash is
new AMF.Elements.Generic_Hash (OCL_Void_Type, OCL_Void_Type_Access);
|
io7m/coreland-openal-ada | Ada | 4,984 | ads | -- Automatically generated, do not edit.
with Interfaces.C;
with System;
with OpenAL.Types;
package OpenAL.ALC_Thin is
package C renames Interfaces.C;
-- Constants
ALC_INVALID : constant := 16#0#;
ALC_FALSE : constant := 16#0#;
ALC_TRUE : constant := 16#1#;
ALC_FREQUENCY : constant := 16#1007#;
ALC_REFRESH : constant := 16#1008#;
ALC_SYNC : constant := 16#1009#;
ALC_MONO_SOURCES : constant := 16#1010#;
ALC_STEREO_SOURCES : constant := 16#1011#;
ALC_NO_ERROR : constant := 16#0#;
ALC_INVALID_DEVICE : constant := 16#A001#;
ALC_INVALID_CONTEXT : constant := 16#A002#;
ALC_INVALID_ENUM : constant := 16#A003#;
ALC_INVALID_VALUE : constant := 16#A004#;
ALC_OUT_OF_MEMORY : constant := 16#A005#;
ALC_DEFAULT_DEVICE_SPECIFIER : constant := 16#1004#;
ALC_DEVICE_SPECIFIER : constant := 16#1005#;
ALC_EXTENSIONS : constant := 16#1006#;
ALC_MAJOR_VERSION : constant := 16#1000#;
ALC_MINOR_VERSION : constant := 16#1001#;
ALC_ATTRIBUTES_SIZE : constant := 16#1002#;
ALC_ALL_ATTRIBUTES : constant := 16#1003#;
ALC_CAPTURE_DEVICE_SPECIFIER : constant := 16#310#;
ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER : constant := 16#311#;
ALC_CAPTURE_SAMPLES : constant := 16#312#;
--
-- Types
--
type Device_t is new System.Address;
type Context_t is new System.Address;
Invalid_Device : constant Device_t := Device_t (System.Null_Address);
Invalid_Context : constant Context_t := Context_t (System.Null_Address);
--
-- OpenALC 1.1
--
function Create_Context
(Device : Device_t;
Attribute_List : System.Address) return Context_t;
pragma Import (C, Create_Context, "alcCreateContext");
function Make_Context_Current
(Context : Context_t) return Types.Boolean_t;
pragma Import (C, Make_Context_Current, "alcMakeContextCurrent");
procedure Process_Context
(Context : Context_t);
pragma Import (C, Process_Context, "alcProcessContext");
procedure Suspend_Context
(Context : Context_t);
pragma Import (C, Suspend_Context, "alcSuspendContext");
procedure Destroy_Context
(Context : Context_t);
pragma Import (C, Destroy_Context, "alcDestroyContext");
function Get_Current_Context return Context_t;
pragma Import (C, Get_Current_Context, "alcGetCurrentContext");
function Get_Contexts_Device
(Context : Context_t) return Device_t;
pragma Import (C, Get_Contexts_Device, "alcGetContextsDevice");
function Open_Device
(Specifier : System.Address) return Device_t;
pragma Import (C, Open_Device, "alcOpenDevice");
function Close_Device
(Device : Device_t) return Types.Boolean_t;
pragma Import (C, Close_Device, "alcCloseDevice");
function Get_Error
(Device : Device_t) return Types.Enumeration_t;
pragma Import (C, Get_Error, "alcGetError");
function Is_Extension_Present
(Device : Device_t;
Extension_Name : System.Address) return Types.Boolean_t;
pragma Import (C, Is_Extension_Present, "alcIsExtensionPresent");
function Get_Proc_Address
(Device : Device_t;
Name : System.Address) return Types.Void_Pointer_t;
pragma Import (C, Get_Proc_Address, "alcGetProcAddress");
function Get_Enum_Value
(Device : Device_t;
Name : System.Address) return Types.Enumeration_t;
pragma Import (C, Get_Enum_Value, "alcGetEnumValue");
function Get_String
(Device : Device_t;
Token : Types.Enumeration_t) return System.Address;
pragma Import (C, Get_String, "alcGetString");
procedure Get_Integerv
(Device : Device_t;
Token : Types.Enumeration_t;
Size : Types.Size_t;
Data : System.Address);
pragma Import (C, Get_Integerv, "alcGetIntegerv");
function Capture_Open_Device
(Name : System.Address;
Frequency : Types.Unsigned_Integer_t;
Format : Types.Enumeration_t;
Buffer_Size : Types.Size_t) return Device_t;
pragma Import (C, Capture_Open_Device, "alcCaptureOpenDevice");
function Capture_Close_Device
(Device : Device_t) return Types.Boolean_t;
pragma Import (C, Capture_Close_Device, "alcCaptureCloseDevice");
procedure Capture_Start
(Device : Device_t);
pragma Import (C, Capture_Start, "alcCaptureStart");
procedure Capture_Stop
(Device : Device_t);
pragma Import (C, Capture_Stop, "alcCaptureStop");
procedure Capture_Samples
(Device : Device_t;
Buffer : Types.Void_Pointer_t;
Samples : Types.Size_t);
pragma Import (C, Capture_Samples, "alcCaptureSamples");
end OpenAL.ALC_Thin;
|
AdaCore/training_material | Ada | 1,220 | ads | pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
package clwbintrin_h is
-- Copyright (C) 2013-2017 Free Software Foundation, Inc.
-- This file is part of GCC.
-- GCC is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3, or (at your option)
-- any later version.
-- GCC is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- Under Section 7 of GPL version 3, you are granted additional
-- permissions described in the GCC Runtime Library Exception, version
-- 3.1, as published by the Free Software Foundation.
-- You should have received a copy of the GNU General Public License and
-- a copy of the GCC Runtime Library Exception along with this program;
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-- <http://www.gnu.org/licenses/>.
-- skipped func _mm_clwb
end clwbintrin_h;
|
seL4/isabelle | Ada | 648 | ads | package Complex_Types
is
type Day is (Mon, Tue, Wed, Thu, Fri, Sat, Sun);
subtype Array_Index is Natural range 0 .. 9;
type Array_Type1 is array (Array_Index, Day) of Integer;
type Record_Type is
record
Field1 : Array_Type1;
Field2 : Integer;
end record;
type Array_Type2 is array (Array_Index) of Record_Type;
--# function Initialized
--# (A: Array_Type2; I : Natural) return Boolean;
--# function Initialized2
--# (A: Array_Type1; I : Natural) return Boolean;
--# function Initialized3
--# (A: Array_Type1; I : Natural; K : Natural) return Boolean;
end Complex_Types;
|
msrLi/portingSources | Ada | 811 | adb | -- Copyright 2008-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pck is
procedure Do_Nothing is
begin
null;
end Do_Nothing;
end Pck;
|
thierr26/ada-keystore | Ada | 15,682 | ads | -----------------------------------------------------------------------
-- keystore -- Ada keystore
-- 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 Util.Encoders;
with Util.Streams;
with Ada.Streams;
with Ada.Calendar;
with Ada.Containers.Indefinite_Ordered_Maps;
with Interfaces;
with GNAT.Regpat;
private with Ada.Exceptions;
private with Ada.Finalization;
private with Util.Executors;
-- == Keystore ==
-- The `Keystore` package provides operations to store information in secure wallets and
-- protect the stored information by encrypting the content. It is necessary to know one
-- of the wallet password to access its content. Wallets are protected by a master key
-- using AES-256 and the wallet master key is protected by a user password. The wallet
-- defines up to 7 slots that identify a password key that is able to unlock the master key.
-- To open a wallet, it is necessary to unlock one of the 7 slots by providing the correct
-- password. Wallet key slots are protected by the user's password and the PBKDF2-HMAC-256
-- algorithm, a random salt, a random counter and they are encrypted using AES-256.
--
-- === Creation ===
-- To create a keystore you will first declare a `Wallet_File` instance. You will also need
-- a password that will be used to protect the wallet master key.
--
-- with Keystore.Files;
-- ...
-- WS : Keystore.Files.Wallet_File;
-- Pass : Keystore.Secret_Key := Keystore.Create ("There was no choice but to be pioneers");
--
-- You can then create the keystore file by using the `Create` operation:
--
-- WS.Create ("secure.akt", Pass);
--
-- === Storing ===
-- Values stored in the wallet are protected by their own encryption keys using AES-256.
-- The encryption key is generated when the value is added to the wallet by using the `Add`
-- operation.
--
-- WS.Add ("Grace Hopper", "If it's a good idea, go ahead and do it.");
--
-- The `Get` function allows to retrieve the value. The value is decrypted only when the `Get`
-- operation is called.
--
-- Citation : constant String := WS.Get ("Grace Hopper");
--
-- The `Delete` procedure can be used to remove the value. When the value is removed,
-- the encryption key and the data are erased.
--
-- WS.Delete ("Grace Hopper");
--
package Keystore is
subtype Secret_Key is Util.Encoders.Secret_Key;
subtype Key_Length is Util.Encoders.Key_Length;
function Create (Password : in String) return Secret_Key
renames Util.Encoders.Create;
-- Exception raised when a keystore entry was not found.
Not_Found : exception;
-- Exception raised when a keystore entry already exist.
Name_Exist : exception;
-- Exception raised when the wallet cannot be opened with the given password.
Bad_Password : exception;
-- Exception raised by Set_Key when there is no available free slot to add a new key.
No_Key_Slot : exception;
-- Exception raised by Set_Header_Data when the slot index is out of range.
No_Header_Slot : exception;
-- Exception raised when trying to get/set an item which is a wallet.
No_Content : exception;
-- The key slot is used (it cannot be erased unless the operation is forced).
Used_Key_Slot : exception;
-- Exception raised when the wallet is corrupted.
Corrupted : exception;
-- Exception raised when opening the keystore and the header is invalid.
Invalid_Keystore : exception;
-- Exception raised when there is a configuration issue.
Invalid_Config : exception;
-- Invalid data block when reading the wallet.
Invalid_Block : exception;
-- Invalid HMAC signature when reading a block.
Invalid_Signature : exception;
-- Invalid storage identifier when loading a wallet data block.
Invalid_Storage : exception;
-- The wallet state.
type State_Type is (S_INVALID, S_PROTECTED, S_OPEN, S_CLOSED);
-- Identifies the type of data stored for a named entry in the wallet.
type Entry_Type is (T_INVALID, T_STRING, T_FILE, T_DIRECTORY, T_BINARY, T_WALLET);
type Filter_Type is array (Entry_Type) of Boolean;
-- Defines the key operation mode.
type Mode_Type is (KEY_ADD, KEY_REPLACE, KEY_REMOVE, KEY_REMOVE_LAST);
-- Defines the key slot number.
type Key_Slot is new Positive range 1 .. 7;
-- Defines which key slot is used.
type Key_Slot_Allocation is array (Key_Slot) of Boolean;
type Header_Slot_Count_Type is new Natural range 0 .. 32;
subtype Header_Slot_Index_Type is Header_Slot_Count_Type range 1 .. Header_Slot_Count_Type'Last;
-- Header slot type is a 16-bit values that identifies the data type slot.
type Header_Slot_Type is new Interfaces.Unsigned_16;
SLOT_EMPTY : constant Header_Slot_Type := 0;
SLOT_KEY_GPG1 : constant Header_Slot_Type := 1; -- Contains key encrypted using GPG1
SLOT_KEY_GPG2 : constant Header_Slot_Type := 2; -- Contains key encrypted using GPG2
type UUID_Type is private;
function To_String (UUID : in UUID_Type) return String;
type Wallet_Info is record
UUID : UUID_Type;
Header_Count : Header_Slot_Count_Type := 0;
Storage_Count : Natural := 0;
end record;
-- Information about a keystore entry.
type Entry_Info is record
Size : Interfaces.Unsigned_64 := 0;
Kind : Entry_Type := T_INVALID;
Create_Date : Ada.Calendar.Time;
Update_Date : Ada.Calendar.Time;
Block_Count : Natural := 0;
end record;
package Entry_Maps is
new Ada.Containers.Indefinite_Ordered_Maps (Key_Type => String,
Element_Type => Entry_Info);
subtype Entry_Map is Entry_Maps.Map;
subtype Entry_Cursor is Entry_Maps.Cursor;
-- Task manager to run encryption and decryption work.
-- It can be assigned to the wallet through the `Set_Task_Manager` procedure.
type Task_Manager (Count : Positive) is limited private;
type Task_Manager_Access is access all Task_Manager;
-- Start the tasks of the task manager.
procedure Start (Manager : in Task_Manager_Access);
-- Stop the tasks.
procedure Stop (Manager : in Task_Manager_Access);
-- Configuration to create or open a keystore.
type Wallet_Config is record
Randomize : Boolean := True;
Overwrite : Boolean := False;
Max_Counter : Positive := 300_000;
Min_Counter : Positive := 100_000;
Max_File_Size : Positive := Positive'Last;
Storage_Count : Positive := 1;
end record;
-- Fast configuration but less secure.
Unsecure_Config : constant Wallet_Config
:= (Randomize => False, Overwrite => False,
Min_Counter => 10_000, Max_Counter => 100_000,
Max_File_Size => Positive'Last,
Storage_Count => 1);
-- Slow configuration but more secure.
Secure_Config : constant Wallet_Config
:= (Randomize => True, Overwrite => False,
Min_Counter => 500_000, Max_Counter => 1_000_000,
Max_File_Size => Positive'Last,
Storage_Count => 1);
type Wallet_Stats is record
UUID : UUID_Type;
Keys : Key_Slot_Allocation := (others => False);
Entry_Count : Natural := 0;
Total_Size : Natural := 0;
Block_Count : Natural := 0;
Free_Block_Count : Natural := 0;
Storage_Count : Natural := 0;
end record;
-- The wallet base type.
type Wallet is abstract tagged limited private;
-- Return True if the container was configured.
function Is_Configured (Container : in Wallet) return Boolean is abstract;
-- Return True if the container can be accessed.
function Is_Open (Container : in Wallet) return Boolean is abstract;
-- Get the wallet state.
function State (Container : in Wallet) return State_Type is abstract;
-- Set the key to encrypt and decrypt the container meta data.
procedure Set_Key (Container : in out Wallet;
Secret : in Secret_Key;
New_Secret : in Secret_Key;
Config : in Wallet_Config := Secure_Config;
Mode : in Mode_Type := KEY_REPLACE) is abstract with
Pre'Class => Container.Is_Open;
-- Return True if the container contains the given named entry.
function Contains (Container : in Wallet;
Name : in String) return Boolean is abstract with
Pre'Class => Container.Is_Open;
-- Add in the wallet the named entry and associate it the content.
-- The content is encrypted in AES-CBC with a secret key and an IV vector
-- that is created randomly for the new named entry.
procedure Add (Container : in out Wallet;
Name : in String;
Content : in String) with
Pre => Wallet'Class (Container).Is_Open,
Post => Wallet'Class (Container).Contains (Name);
-- Add in the wallet the named entry and associate it the content.
-- The content is encrypted in AES-CBC with a secret key and an IV vector
-- that is created randomly for the new named entry.
procedure Add (Container : in out Wallet;
Name : in String;
Kind : in Entry_Type := T_BINARY;
Content : in Ada.Streams.Stream_Element_Array) is abstract with
Pre'Class => Container.Is_Open,
Post'Class => Container.Contains (Name);
procedure Add (Container : in out Wallet;
Name : in String;
Kind : in Entry_Type := T_BINARY;
Input : in out Util.Streams.Input_Stream'Class) is abstract with
Pre'Class => Container.Is_Open,
Post'Class => Container.Contains (Name);
-- Add or update in the wallet the named entry and associate it the content.
-- The content is encrypted in AES-CBC with a secret key and an IV vector
-- that is created randomly for the new or updated named entry.
procedure Set (Container : in out Wallet;
Name : in String;
Kind : in Entry_Type := T_BINARY;
Content : in Ada.Streams.Stream_Element_Array) is abstract with
Pre'Class => Container.Is_Open,
Post'Class => Container.Contains (Name);
-- Add or update in the wallet the named entry and associate it the content.
-- The content is encrypted in AES-CBC with a secret key and an IV vector
-- that is created randomly for the new or updated named entry.
procedure Set (Container : in out Wallet;
Name : in String;
Content : in String) with
Pre => Wallet'Class (Container).Is_Open,
Post => Wallet'Class (Container).Contains (Name);
procedure Set (Container : in out Wallet;
Name : in String;
Kind : in Entry_Type := T_BINARY;
Input : in out Util.Streams.Input_Stream'Class) is abstract with
Pre'Class => Container.Is_Open,
Post'Class => Container.Contains (Name);
-- Update in the wallet the named entry and associate it the new content.
-- The secret key and IV vectors are not changed.
procedure Update (Container : in out Wallet;
Name : in String;
Content : in String) with
Pre => Wallet'Class (Container).Is_Open,
Post => Wallet'Class (Container).Contains (Name);
-- Update in the wallet the named entry and associate it the new content.
-- The secret key and IV vectors are not changed.
procedure Update (Container : in out Wallet;
Name : in String;
Kind : in Entry_Type := T_BINARY;
Content : in Ada.Streams.Stream_Element_Array) is abstract with
Pre'Class => Container.Is_Open,
Post'Class => Container.Contains (Name);
-- Delete from the wallet the named entry.
procedure Delete (Container : in out Wallet;
Name : in String) is abstract with
Pre'Class => Container.Is_Open,
Post'Class => not Container.Contains (Name);
-- Get from the wallet the named entry.
function Get (Container : in out Wallet;
Name : in String) return String with
Pre => Wallet'Class (Container).Is_Open;
procedure Get (Container : in out Wallet;
Name : in String;
Info : out Entry_Info;
Content : out Ada.Streams.Stream_Element_Array) is abstract with
Pre'Class => Wallet'Class (Container).Is_Open;
-- Write in the output stream the named entry value from the wallet.
procedure Get (Container : in out Wallet;
Name : in String;
Output : in out Util.Streams.Output_Stream'Class) is abstract with
Pre'Class => Container.Is_Open;
-- Get the list of entries contained in the wallet that correspond to the optional filter.
procedure List (Container : in out Wallet;
Filter : in Filter_Type := (others => True);
Content : out Entry_Map) is abstract with
Pre'Class => Container.Is_Open;
-- Get the list of entries contained in the wallet that correspond to the optiona filter
-- and whose name matches the pattern.
procedure List (Container : in out Wallet;
Pattern : in GNAT.Regpat.Pattern_Matcher;
Filter : in Filter_Type := (others => True);
Content : out Entry_Map) is abstract with
Pre'Class => Container.Is_Open;
function Find (Container : in out Wallet;
Name : in String) return Entry_Info is abstract with
Pre'Class => Container.Is_Open;
DEFAULT_WALLET_KEY : constant String
:= "If you can't give me poetry, can't you give me poetical science?";
private
type UUID_Type is array (1 .. 4) of Interfaces.Unsigned_32;
type Wallet_Identifier is new Positive;
type Wallet_Entry_Index is new Interfaces.Unsigned_32 range 1 .. Interfaces.Unsigned_32'Last;
type Wallet is abstract limited new Ada.Finalization.Limited_Controlled with null record;
type Work_Type is limited interface;
type Work_Type_Access is access all Work_Type'Class;
procedure Execute (Work : in out Work_Type) is abstract;
procedure Execute (Work : in out Work_Type_Access);
procedure Error (Work : in out Work_Type_Access;
Ex : in Ada.Exceptions.Exception_Occurrence);
package Executors is
new Util.Executors (Work_Type => Work_Type_Access,
Execute => Execute,
Error => Error);
type Task_Manager (Count : Positive) is limited
new Executors.Executor_Manager (Count) with null record;
procedure Execute (Manager : in out Task_Manager;
Work : in Work_Type_Access);
end Keystore;
|
godunko/adawebui | Ada | 5,977 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2017-2020, 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: 5743 $ $Date: 2017-01-29 12:06:05 +0300 (Sun, 29 Jan 2017) $
------------------------------------------------------------------------------
with Web.Window;
with Web.Core.Connectables;
package body Web.UI.Widgets.Buttons.Boolean_Check_Boxes is
------------------
-- Constructors --
------------------
package body Constructors is
------------
-- Create --
------------
function Create
(Element : Web.HTML.Inputs.HTML_Input_Element'Class)
return not null Boolean_Check_Box_Access
is
Aux : constant not null Web.Core.Connectables.Object_Access
:= new Boolean_Check_Box;
begin
return Result : constant not null Boolean_Check_Box_Access
:= Boolean_Check_Box_Access (Aux)
do
Initialize (Result.all, Element);
end return;
end Create;
------------
-- Create --
------------
function Create
(Id : Web.Strings.Web_String)
return not null Boolean_Check_Box_Access is
begin
return
Create (Web.Window.Document.Get_Element_By_Id (Id).As_HTML_Input);
end Create;
----------------
-- Initialize --
----------------
procedure Initialize
(Self : in out Boolean_Check_Box'Class;
Element : Web.HTML.Inputs.HTML_Input_Element'Class) is
begin
Web.UI.Widgets.Buttons.Constructors.Initialize (Self, Element);
end Initialize;
end Constructors;
------------------
-- Change_Event --
------------------
overriding procedure Change_Event (Self : in out Boolean_Check_Box) is
begin
Self.State_Changed.Emit (Self.Element.As_HTML_Input.Get_Checked);
end Change_Event;
---------------------
-- Get_Check_State --
---------------------
function Get_Check_State
(Self : Boolean_Check_Box'Class) return Boolean is
begin
return Self.Element.As_HTML_Input.Get_Checked;
end Get_Check_State;
------------------
-- Set_Disabled --
------------------
overriding procedure Set_Disabled
(Self : in out Boolean_Check_Box;
Disabled : Boolean := True)
is
Element : Web.HTML.Inputs.HTML_Input_Element
:= Self.Element.As_HTML_Input;
begin
Element.Set_Disabled (Disabled);
end Set_Disabled;
--------------------------
-- State_Changed_Signal --
--------------------------
function State_Changed_Signal
(Self : in out Boolean_Check_Box'Class)
return not null access Web.UI.Boolean_Slots.Signal'Class is
begin
return Self.State_Changed'Unchecked_Access;
end State_Changed_Signal;
end Web.UI.Widgets.Buttons.Boolean_Check_Boxes;
|
AdaCore/libadalang | Ada | 72 | adb | package body Pkg is
function Foo return T is (null record);
end Pkg;
|
AdaCore/libadalang | Ada | 637 | ads | with Ada.Streams;
package Streamable_Types is
use Ada;
type Int is new Integer;
procedure Print (Stream : not null access Streams.Root_Stream_Type'Class;
Item : Int);
procedure Parse (Stream : not null access Streams.Root_Stream_Type'Class;
Item : out Int);
procedure Output (Stream : not null access Streams.Root_Stream_Type'Class;
Item : Int);
for Int'Read use Parse;
pragma Test_Statement;
for Int'Write use Print;
pragma Test_Statement;
for Int'Output use Output;
pragma Test_Statement;
Parsing_Error : exception;
end Streamable_Types;
|
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_V_Alphabetic_Attributes is
pragma Preelaborate;
type ODF_Svg_V_Alphabetic_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Svg_V_Alphabetic_Attribute_Access is
access all ODF_Svg_V_Alphabetic_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Svg_V_Alphabetic_Attributes;
|
Gabriel-Degret/adalib | Ada | 593 | ads | -- Standard Ada library specification
-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
with Ada.Wide_Wide_Text_IO;
package Ada.Integer_Wide_Wide_Text_IO is
new Ada.Wide_Wide_Text_IO.Integer_IO (Integer);
|
tum-ei-rcs/StratoX | Ada | 38 | adb | ../../../../software/modules/sdlog.adb |
Blady-Com/AARM_Examples | Ada | 7,926 | adb | with Ada.Finalization;
procedure AARM_2012_CH04 is
package Needed_To_Compile is
-- Needed to compile, sometimes dummy
-- K : constant := 99;
-- G : constant Character := '@';
-- type Coordinate is (X, Y);
type Real is digits 8;
type Matrix is array (Integer range <>, Integer range <>) of Real;
-- subtype Month_Name is String (1 .. 3);
-- type Gender is (M, F);
-- type Date is record
-- Day : Integer range 1 .. 31;
-- Month : Month_Name;
-- Year : Integer range 0 .. 4000;
-- end record;
-- type Person (<>);
-- type Person_Name is access Person;
-- type Person (Sex : Gender) is record
-- Name : String (1 .. 20);
-- Birth : Date;
-- Age : Integer range 0 .. 130;
-- case Sex is
-- when M =>
-- Wife : Person_Name (Sex => F);
-- when F =>
-- Husband : Person_Name (Sex => M);
-- end case;
-- end record;
-- type Binop_Ptr is access all Integer;
type Bit_Vector is array (Integer range <>) of Boolean;
type Table is array (1 .. 10) of Integer;
M : constant := 99;
N : constant := 199;
PI : constant := 3.14;
-- type Day is (
-- Mon,
-- Tue,
-- Wed,
-- Thu,
-- Fri,
-- Sat,
-- Sun);
-- package Key_Manager is
-- subtype Key is Integer;
-- end Key_Manager;
-- Max : constant := 500; -- an integer number
-- Page_Size : constant := 100;
-- subtype Cylinder_Index is Natural;
-- subtype Track_Number is Natural;
-- function Dispersion (X : Real) return Real;
end Needed_To_Compile;
-- package body Needed_To_Compile is
-- function Dispersion (X : Real) return Real is
-- begin
-- return e * X;
-- end Dispersion;
-- end Needed_To_Compile;
-- 4.1 Names
--4.1.5 User-Defined References
package Parapraph_4_1_5_9 is
type Element is new Integer;
type Barrel is tagged record -- holds objects of type Element
E : aliased Element;
end record;
type Ref_Element (Data : access Element) is limited private -- MODIF PP
-- new Ada.Finalization.Limited_Controlled with private -- MODIF PP
with
Implicit_Dereference => Data;
-- This Ref_Element type is a "reference" type.
-- "Data" is its reference discriminant.
function Find (B : aliased in out Barrel; Key : String) return Ref_Element;
-- Return a reference to an element of a barrel.
B : aliased Barrel; -- MODIF PP
private
type Ref_Element (Data : access Element) is null record;
--with Implicit_Dereference => Data;
end Parapraph_4_1_5_9;
package body Parapraph_4_1_5_9 is
function Find (B : aliased in out Barrel; Key : String) return Ref_Element is
begin
return R : Ref_Element (B.E'Access);
end Find;
begin
Find (B, "grape") := Element'(0); -- Assign through a reference.
Find (B, "grape").Data.all := Element'(1);
end Parapraph_4_1_5_9;
-- 4.1.6 User-Defined Indexing
package Parapraph_4_1_6_18 is
type Element is new Integer;
type Indexed_Barrel is tagged record
E : aliased Element;
end record with
Variable_Indexing => Find;
-- Indexed_Barrel is an indexable container type,
-- Find is the generalized indexing operation.
type Ref_Element (Data : access Element) is limited private
-- new Ada.Finalization.Limited_Controlled with private -- MODIF PP
with
Implicit_Dereference => Data;
-- This Ref_Element type is a "reference" type.
-- "Data" is its reference discriminant.
function Find (B : aliased in out Indexed_Barrel; Key : String) return Ref_Element;
-- Return a reference to an element of a barrel (see 4.1.5).
private
type Ref_Element (Data : access Element) is null record;
--with Implicit_Dereference => Data;
end Parapraph_4_1_6_18;
package body Parapraph_4_1_6_18 is
function Find (B : aliased in out Indexed_Barrel; Key : String) return Ref_Element is
begin
return R : Ref_Element (B.E'Access);
end Find;
IB : aliased Indexed_Barrel;
begin
-- All of the following calls are then equivalent:
Find (IB, "pear").Data.all := Element'(2); -- Traditional call
IB.Find ("pear").Data.all := Element'(3); -- Call of prefixed view
IB.Find ("pear") := Element'(4); -- Implicit dereference (see 4.1.5)
IB ("pear") := Element'(5); -- Implicit indexing and dereference
IB ("pear").Data.all := Element'(6); -- Implicit indexing only
end Parapraph_4_1_6_18;
-- 4.3.3 Array Aggregates
package Parapraph_4_3_3_42 is
use Needed_To_Compile;
A : Table := (7, 9, 5, 1, 3, 2, 4, 8, 6, 0); -- A(1)=7, A(10)=0
B : Table := (2 | 4 | 10 => 1, others => 0); -- B(1)=0, B(10)=1
C : constant Matrix := (1 .. 5 => (1 .. 8 => 0.0)); -- C'Last(1)=5, C'Last(2)=8
D : Bit_Vector (M .. N) := (M .. N => True); -- see 3.6
E : Bit_Vector (M .. N) := (others => True);
F : String (1 .. 1) := (1 => 'F'); -- a one component aggregate: same as "F"
end Parapraph_4_3_3_42;
-- 4.5.7 Conditional Expressions
package Parapraph_4_5_7_19 is
generic
with function Int_Func return Integer;
package G is
X : Float := (case Int_Func is when Integer'First .. -1 => -1.0, when 0 => 0.0, when Positive => 1.0);
end G;
function Nat_Func return Natural is (123);
-- package I is new G (Int_Func => Nat_Func); -- Legal -- MODIF PP
end Parapraph_4_5_7_19;
-- 4.5.8 Quantified Expressions
package Parapraph_4_5_8_13 is
use Needed_To_Compile;
pragma Assert (for some X in 2 .. N / 2 => N mod X = 0);
-- 4.6 Type Conversions
-- 70
type Sequence is array (Integer range <>) of Integer;
subtype Dozen is Sequence (1 .. 12);
Ledger : array (1 .. 100) of Integer;
-- 4.7 Qualified Expressions
end Parapraph_4_5_8_13;
-- 4.9 Static Expressions and Static Subtypes
procedure Parapraph_4_9_26_37_39_43_44 is
subtype Int10 is Integer range 1 .. 10;
generic
F : in out Int10;
procedure G;
procedure G is
begin
case F is
when 1 .. 10 =>
null;
-- Illegal!
when others =>
null; -- so the choices have to cover all values of Integer
end case;
end G;
X : Integer range 1 .. 20;
procedure I is new G (F => X); -- OK.
N : constant := 0.0;
X1 : constant Boolean := (N = 0.0) or else (1.0 / N > 0.5); -- Static.
X2 : Float := Float'(1.0E+32) + 1.0 - Float'(1.0E+32); -- MODIF PP was E+400 overflow GNAT FLoat
Kilo : constant := 1000;
Mega : constant := Kilo * Kilo; -- 1_000_000
Long : constant := Float'Digits * 2;
use Needed_To_Compile;
Half_Pi : constant := PI / 2; -- see 3.3.2
Deg_To_Rad : constant := Half_Pi / 90;
Rad_To_Deg : constant := 1.0 / Deg_To_Rad; -- equivalent to 1.0/((3.14159_26536/2)/90)
-- Bad: constant := 1/0; -- Illegal!
begin
null;
end Parapraph_4_9_26_37_39_43_44;
begin
null;
end AARM_2012_CH04;
|
charlesdaniels/libagar | Ada | 3,167 | adb | with Ada.Text_IO;
----------------------------
-- Agar(Object) -> Animal --
----------------------------
--
-- Ada implementation of the Agar object class "Animal".
--
package body Animal is
package C_obj is new System.Address_To_Access_Conversions (Animal);
package T_IO renames Ada.Text_IO;
function Create_Class return OBJ.Class_Not_Null_Access is
begin
--
-- Register our "Animal" class with the Agar object system.
--
Generic_Object_Class := OBJ.Create_Class
(Hierarchy => "Animal",
Object_Size => Animal'Size,
Class_Size => Animal_Class'Size,
Major => 1,
Minor => 2,
Init_Func => Init'Access,
Destroy_Func => Destroy'Access,
Load_Func => Load'Access,
Save_Func => Save'Access);
--
-- Initialize our derived class description structure. This will be
-- shared between all instances of Animal.
--
Animal_Object_Class := C_cls.To_Pointer(Generic_Object_Class.all'Address);
Animal_Object_Class.Ecological_Group := Undefined;
Animal_Object_Class.Description := (others => '_');
return Generic_Object_Class;
end;
procedure Destroy_Class is
begin
OBJ.Destroy_Class (Generic_Object_Class);
Generic_Object_Class := null;
Animal_Object_Class := null;
end;
--
-- Initialize an instance of the Animal class.
--
procedure Init (Object : OBJ.Object_Access)
is
Ani : constant C_obj.Object_Pointer := C_obj.To_Pointer(Object.all'Address);
begin
T_IO.Put_Line("Animal init");
Ani.Age := 123;
Ani.Exp := 11111;
Ani.Name := "Here is Ada string! ";
Ani.Bio := (others => 'x');
Ani.X := 3.14159265358979323846;
Ani.Y := 3.40282346638528860e+38;
Ani.Z := -1.0;
end;
--
-- Release all resources allocated by an instance of Animal.
--
procedure Destroy (Object : OBJ.Object_Access)
is begin
T_IO.Put_Line("Animal destroy");
end;
--
-- Serialize an Animal to a machine-independent format.
--
function Save
(Object : OBJ.Object_Access;
Dest : DS.Data_Source_Access) return C.int
is
Ani : constant C_obj.Object_Pointer := C_obj.To_Pointer(Object.all'Address);
begin
DS.Write_Unsigned_8 (Dest, Ani.Age);
DS.Write_Unsigned_16 (Dest, Ani.Exp);
DS.Write_Padded_String (Dest, Ani.Name, 40);
DS.Write_String (Dest, Ani.Bio);
DS.Write_Double (Dest, Ani.X);
DS.Write_Double (Dest, Ani.Y);
DS.Write_Double (Dest, Ani.Z);
return Success;
end;
--
-- Deserialize an Animal from machine-independent format.
--
function Load
(Object : OBJ.Object_Access;
Source : DS.Data_Source_Access;
Version : OBJ.Version_Access) return C.int
is
Ani : constant C_obj.Object_Pointer := C_obj.To_Pointer(Object.all'Address);
begin
Ani.Age := DS.Read_Unsigned_8 (Source);
Ani.Exp := DS.Read_Unsigned_16 (Source);
Ani.Name := DS.Read_Padded_String (Source, 40);
Ani.Bio := DS.Read_String (Source);
Ani.X := DS.Read_Double (Source);
Ani.Y := DS.Read_Double (Source);
Ani.Z := DS.Read_Double (Source);
return Success;
end;
end Animal;
|
msrLi/portingSources | Ada | 813 | ads | -- Copyright 2013-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Caller is
procedure Verbose_Increment (Val : in out Float; Msg : String);
end Caller;
|
riccardo-bernardini/eugen | Ada | 2,889 | ads | with EU_Projects.Nodes;
with EU_Projects.Times.Time_Expressions;
with Eu_Projects.Event_Names;
with EU_Projects.Node_Tables;
package Eu_Projects.Nodes.Timed_Nodes.Project_Infos is
type Project_Info is new Timed_Node with private;
type Info_Access is access all Project_Info;
function Create (Label : Node_Label;
Name : String;
Short_Name : String;
Stop_At : String;
Node_Dir : in out Node_Tables.Node_Table)
return Info_Access;
procedure Add_WP (Info : in out Project_Info;
WP : Node_Label);
overriding function Full_Index (Item : Project_Info;
Prefixed : Boolean) return String;
overriding function Get_Symbolic_Instant (Item : Project_Info;
Var : Simple_Identifier)
return Times.Time_Expressions.Symbolic_Instant;
overriding function Get_Symbolic_Duration (Item : Project_Info;
Var : Simple_Identifier)
return Times.Time_Expressions.Symbolic_Duration;
overriding function Dependency_List (Item : Project_Info)
return Node_Label_Lists.Vector;
overriding function Dependency_Ready_Var (Item : Project_Info) return String
is ("end");
function Variables (Item : Project_Info) return Variable_List
is ((1 => To_Id("end")));
overriding function Is_A (Item : Project_Info;
Var : Simple_Identifier;
Class : Times.Time_Type)
return Boolean
is (case Class is
when Times.Instant_Value =>
Var = "end",
when Times.Duration_Value =>
False);
private
type Project_Info is new Timed_Node
with
record
WPs : Node_Label_Lists.Vector;
end record;
overriding function Dependency_List (Item : Project_Info)
return Node_Label_Lists.Vector
is (Item.Wps);
overriding function Get_Symbolic_Instant
(Item : Project_Info;
Var : Simple_Identifier)
return Times.Time_Expressions.Symbolic_Instant
is (if Var = Event_Names.End_Name then
Item.Expected_Symbolic
else
raise Unknown_Instant_Var);
overriding function Get_Symbolic_Duration
(Item : Project_Info;
Var : Simple_Identifier)
return Times.Time_Expressions.Symbolic_Duration
is (raise Unknown_Duration_Var);
overriding function Full_Index (Item : Project_Info;
Prefixed : Boolean) return String
is ("");
end Eu_Projects.Nodes.Timed_Nodes.Project_Infos;
|
mitchelhaan/ncurses | Ada | 6,231 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer <[email protected]> 1996
-- Version Control:
-- $Revision: 1.8 $
-- Binding Version 00.93
------------------------------------------------------------------------------
with System;
with System.Parameters;
with Ada.Text_IO;
with Ada.IO_Exceptions;
package Terminal_Interface.Curses.Text_IO is
use type Ada.Text_IO.Count;
subtype Count is Ada.Text_IO.Count;
subtype Positive_Count is Count range 1 .. Count'Last;
subtype Field is Integer range 0 .. System.Parameters.Field_Max;
subtype Number_Base is Integer range 2 .. 16;
type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
-- For most of the routines you will see a version without a Window
-- type parameter. They will operate on a default window, which can
-- be set by the user. It is initially equal to Standard_Window.
procedure Set_Window (Win : in Window);
-- Set Win as the default window
function Get_Window return Window;
-- Get the current default window
procedure Flush (Win : in Window);
procedure Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
-- There are no set routines in this package. I assume, that you allocate
-- the window with an appropriate size.
-- A scroll-window is interpreted as an page with unbounded page length,
-- i.e. it returns the conventional 0 as page length.
function Line_Length (Win : in Window) return Count;
function Line_Length return Count;
function Page_Length (Win : in Window) return Count;
function Page_Length return Count;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1);
procedure New_Line (Spacing : in Positive_Count := 1);
procedure New_Page (Win : in Window);
procedure New_Page;
procedure Set_Col (Win : in Window; To : in Positive_Count);
procedure Set_Col (To : in Positive_Count);
procedure Set_Line (Win : in Window; To : in Positive_Count);
procedure Set_Line (To : in Positive_Count);
function Col (Win : in Window) return Positive_Count;
function Col return Positive_Count;
function Line (Win : in Window) return Positive_Count;
function Line return Positive_Count;
-----------------------
-- Characters-Output --
-----------------------
procedure Put (Win : in Window; Item : in Character);
procedure Put (Item : in Character);
--------------------
-- Strings-Output --
--------------------
procedure Put (Win : in Window; Item : in String);
procedure Put (Item : in String);
procedure Put_Line
(Win : in Window;
Item : in String);
procedure Put_Line
(Item : in String);
-- Exceptions
Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error;
Name_Error : exception renames Ada.IO_Exceptions.Name_Error;
Use_Error : exception renames Ada.IO_Exceptions.Use_Error;
Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
End_Error : exception renames Ada.IO_Exceptions.End_Error;
Data_Error : exception renames Ada.IO_Exceptions.Data_Error;
Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;
end Terminal_Interface.Curses.Text_IO;
|
osannolik/ada-canopen | Ada | 9,944 | adb | package body ACO.Protocols.Service_Data.Servers is
overriding
procedure Handle_Message
(This : in out Server;
Msg : in ACO.Messages.Message;
Endpoint : in ACO.SDO_Sessions.Endpoint_Type)
is
use ACO.SDO_Commands;
use type ACO.SDO_Sessions.Services;
Service : constant ACO.SDO_Sessions.Services :=
This.Sessions.Service (Endpoint.Id);
State_Error : Boolean := False;
begin
case Get_CS (Msg) is
when Download_Initiate_Req =>
This.SDO_Log (ACO.Log.Debug, "Server: Handling Download Initiate");
if Service = ACO.SDO_Sessions.None then
This.Download_Init (Msg, Endpoint);
else
State_Error := True;
end if;
when Download_Segment_Req =>
This.SDO_Log (ACO.Log.Debug, "Server: Handling Download Segment");
if Service = ACO.SDO_Sessions.Download then
This.Download_Segment (Msg, Endpoint);
else
State_Error := True;
end if;
when Upload_Initiate_Req =>
This.SDO_Log (ACO.Log.Debug, "Server: Handling Upload Initiate");
if Service = ACO.SDO_Sessions.None then
This.Upload_Init (Msg, Endpoint);
else
State_Error := True;
end if;
when Upload_Segment_Req =>
This.SDO_Log (ACO.Log.Debug, "Server: Handling Upload Segment");
if Service = ACO.SDO_Sessions.Upload then
This.Upload_Segment (Msg, Endpoint);
else
State_Error := True;
end if;
when Abort_Req =>
This.SDO_Log (ACO.Log.Debug, "Server: Handling Abort");
This.Abort_All (Msg, Endpoint);
when others =>
null;
end case;
if State_Error then
This.Send_Abort
(Endpoint => Endpoint,
Error => Failed_To_Transfer_Or_Store_Data_Due_To_Local_Control);
end if;
end Handle_Message;
procedure Upload_Init
(This : in out Server;
Msg : in ACO.Messages.Message;
Endpoint : in ACO.SDO_Sessions.Endpoint_Type)
is
use ACO.SDO_Commands;
Index : constant ACO.OD_Types.Entry_Index := Get_Index (Msg);
Error : Error_Type := Nothing;
Session : ACO.SDO_Sessions.SDO_Session;
begin
if not This.Od.Entry_Exist (Index.Object, Index.Sub) then
Error := Object_Does_Not_Exist_In_The_Object_Dictionary;
elsif not This.Od.Is_Entry_Readable (Index) then
Error := Attempt_To_Read_A_Write_Only_Object;
end if;
Session := ACO.SDO_Sessions.Create_Upload (Endpoint, Index);
if Error /= Nothing then
This.Send_Abort (Endpoint, Error, Index);
This.Indicate_Status (Session, ACO.SDO_Sessions.Error);
return;
end if;
declare
Ety : constant ACO.OD_Types.Entry_Base'Class :=
This.Od.Get_Entry (Index.Object, Index.Sub);
Size : Natural;
Resp : Upload_Initiate_Resp;
begin
Size := Ety.Data_Length;
if Size > ACO.Configuration.Max_SDO_Transfer_Size then
This.Send_Abort (Endpoint, General_Error, Index);
This.Indicate_Status (Session, ACO.SDO_Sessions.Error);
return;
end if;
if Size <= Expedited_Data'Length then
Resp := Create (Index, ACO.Messages.Data_Array (Ety.Read));
This.Indicate_Status (Session, ACO.SDO_Sessions.Complete);
else
Resp := Create (Index, Size);
This.Sessions.Clear_Buffer (Endpoint.Id);
This.Sessions.Put_Buffer
(Endpoint.Id, ACO.Messages.Data_Array (Ety.Read));
This.Start_Alarm (Endpoint.Id);
This.Indicate_Status (Session, ACO.SDO_Sessions.Pending);
end if;
This.Send_SDO (Endpoint, Resp.Raw);
end;
end Upload_Init;
procedure Upload_Segment
(This : in out Server;
Msg : in ACO.Messages.Message;
Endpoint : in ACO.SDO_Sessions.Endpoint_Type)
is
use ACO.SDO_Commands;
Cmd : constant Upload_Segment_Cmd := Convert (Msg);
Id : constant ACO.SDO_Sessions.Valid_Endpoint_Nr := Endpoint.Id;
Bytes_Remain : constant Natural := This.Sessions.Length_Buffer (Id);
Session : ACO.SDO_Sessions.SDO_Session;
Error : Error_Type := Nothing;
begin
Session := This.Sessions.Get (Id);
if Cmd.Toggle /= Session.Toggle then
Error := Toggle_Bit_Not_Altered;
elsif Bytes_Remain = 0 then
Error := General_Error;
end if;
if Error /= Nothing then
This.Send_Abort (Endpoint => Endpoint,
Error => Error,
Index => Session.Index);
This.Stop_Alarm (Id);
This.Indicate_Status (Session, ACO.SDO_Sessions.Error);
return;
end if;
declare
Bytes_To_Send : constant Positive :=
Natural'Min (Bytes_Remain, Segment_Data'Length);
Data : ACO.Messages.Data_Array (0 .. Bytes_To_Send - 1);
Resp : Upload_Segment_Resp;
Is_Complete : constant Boolean := (Bytes_To_Send = Bytes_Remain);
begin
This.Sessions.Get_Buffer (Endpoint.Id, Data);
Resp := Create (Toggle => Session.Toggle,
Is_Complete => Is_Complete,
Data => Data);
This.Send_SDO (Endpoint => Endpoint,
Raw_Data => Resp.Raw);
This.SDO_Log
(ACO.Log.Debug, "Server: Sent data of length" & Bytes_To_Send'Img);
if Is_Complete then
This.Stop_Alarm (Id);
This.Indicate_Status (Session, ACO.SDO_Sessions.Complete);
else
Session.Toggle := not Session.Toggle;
This.Start_Alarm (Id);
This.Indicate_Status (Session, ACO.SDO_Sessions.Pending);
end if;
end;
end Upload_Segment;
procedure Download_Init
(This : in out Server;
Msg : in ACO.Messages.Message;
Endpoint : in ACO.SDO_Sessions.Endpoint_Type)
is
use ACO.SDO_Commands;
Cmd : constant Download_Initiate_Cmd := Convert (Msg);
Index : constant ACO.OD_Types.Entry_Index := Get_Index (Msg);
Error : Error_Type := Nothing;
Session : ACO.SDO_Sessions.SDO_Session;
Resp : Download_Initiate_Resp;
begin
if not This.Od.Entry_Exist (Index.Object, Index.Sub) then
Error := Object_Does_Not_Exist_In_The_Object_Dictionary;
elsif not This.Od.Is_Entry_Writable (Index) then
Error := Attempt_To_Write_A_Read_Only_Object;
elsif not Cmd.Is_Size_Indicated then
Error := Command_Specifier_Not_Valid_Or_Unknown;
elsif Get_Data_Size (Cmd) > ACO.Configuration.Max_SDO_Transfer_Size then
Error := General_Error;
end if;
Session := ACO.SDO_Sessions.Create_Download (Endpoint, Index);
if Error /= Nothing then
This.Send_Abort (Endpoint, Error, Index);
This.Indicate_Status (Session, ACO.SDO_Sessions.Error);
return;
end if;
if Cmd.Is_Expedited then
This.Write
(Index => Index,
Data => Cmd.Data (0 .. 3 - Natural (Cmd.Nof_No_Data)),
Error => Error);
if Error = Nothing then
Resp := Create (Index);
This.Send_SDO (Endpoint, Resp.Raw);
This.Indicate_Status (Session, ACO.SDO_Sessions.Complete);
else
This.Send_Abort (Endpoint, Error, Index);
This.Indicate_Status (Session, ACO.SDO_Sessions.Error);
end if;
else
Resp := Create (Index);
This.Send_SDO (Endpoint, Resp.Raw);
This.Start_Alarm (Endpoint.Id);
This.Indicate_Status (Session, ACO.SDO_Sessions.Pending);
end if;
end Download_Init;
procedure Download_Segment
(This : in out Server;
Msg : in ACO.Messages.Message;
Endpoint : in ACO.SDO_Sessions.Endpoint_Type)
is
use ACO.SDO_Commands;
Cmd : constant Download_Segment_Cmd := Convert (Msg);
Id : constant ACO.SDO_Sessions.Valid_Endpoint_Nr := Endpoint.Id;
Session : ACO.SDO_Sessions. SDO_Session := This.Sessions.Get (Id);
Error : Error_Type := Nothing;
Resp : Download_Segment_Resp;
begin
if Cmd.Toggle /= Session.Toggle then
This.Send_Abort (Endpoint => Endpoint,
Error => Toggle_Bit_Not_Altered,
Index => Session.Index);
This.Stop_Alarm (Id);
This.Indicate_Status (Session, ACO.SDO_Sessions.Error);
return;
end if;
This.Sessions.Put_Buffer
(Id => Id,
Data => Cmd.Data (0 .. 6 - Natural (Cmd.Nof_No_Data)));
Session.Toggle := not Session.Toggle;
if Cmd.Is_Complete then
This.Write
(Index => Session.Index,
Data => This.Sessions.Peek_Buffer (Id),
Error => Error);
This.Stop_Alarm (Id);
if Error = Nothing then
Resp := Create (Cmd.Toggle);
This.Send_SDO (Endpoint, Resp.Raw);
This.Indicate_Status (Session, ACO.SDO_Sessions.Complete);
else
This.Send_Abort (Endpoint => Endpoint,
Error => Failed_To_Transfer_Or_Store_Data,
Index => Session.Index);
This.Indicate_Status (Session, ACO.SDO_Sessions.Error);
end if;
else
This.Start_Alarm (Id);
This.Indicate_Status (Session, ACO.SDO_Sessions.Pending);
end if;
end Download_Segment;
end ACO.Protocols.Service_Data.Servers;
|
mmarx/lovelace | Ada | 4,609 | adb | with Ada.Strings;
with Ada.Strings.Fixed;
with Ada.Text_IO.Editing;
with sys_resource_h;
with x86_64_linux_gnu_bits_time_h;
with x86_64_linux_gnu_bits_resource_h;
package body Timings is
use Ada.Text_IO;
subtype Long is Interfaces.C.long;
package I_IO is new Ada.Text_IO.Integer_IO (Long);
function "-" (Left, Right : in Usage_Type) return Usage_Type is
Result : constant Usage_Type := (User_Time =>
Left.User_Time - Right.User_Time,
System_Time =>
Left.System_Time - Right.System_Time,
In_IO =>
Left.In_IO - Right.In_IO,
Out_IO =>
Left.Out_IO - Right.Out_IO,
Voluntary_Context_Switches =>
Left.Voluntary_Context_Switches -
Right.Voluntary_Context_Switches,
Involuntary_Context_Switches =>
Left.Involuntary_Context_Switches -
Right.Involuntary_Context_Switches);
begin
return Result;
end "-";
function Resource_Usage (Who : in Usage_Who) return Usage_Type is
package R renames sys_resource_h;
package BT renames x86_64_linux_gnu_bits_time_h;
package BR renames x86_64_linux_gnu_bits_resource_h;
Usage : Usage_Type;
The_Result : Interfaces.C.int;
The_Who : BR.uu_rusage_who;
The_Usage : aliased BR.rusage;
use type Interfaces.C.int;
function Time_Type_From_Timeval (Tv : in BT.timeval) return Time_Type is
T : constant Time_Type := (Time_Type (Tv.tv_sec) +
10.0 ** (-6) * Time_Type (Tv.tv_usec));
begin
return T;
end Time_Type_From_Timeval;
begin
case Who is
when Self =>
The_Who := BR.RUSAGE_SELF;
when Children =>
The_Who := BR.RUSAGE_CHILDREN;
when Thread =>
The_Who := BR.RUSAGE_THREAD;
end case;
The_Result := R.getrusage (R.uu_rusage_who_t (The_Who),
The_Usage'Access);
if The_Result /= 0 then
raise Program_Error;
end if;
Usage.User_Time := Time_Type_From_Timeval (The_Usage.ru_utime);
Usage.System_Time := Time_Type_From_Timeval (The_Usage.ru_stime);
Usage.In_IO := IO_Operations_Type (The_Usage.ru_inblock);
Usage.Out_IO := IO_Operations_Type (The_Usage.ru_oublock);
Usage.Voluntary_Context_Switches :=
Context_Switches_Type (The_Usage.ru_nvcsw);
Usage.Involuntary_Context_Switches :=
Context_Switches_Type (The_Usage.ru_nivcsw);
return Usage;
end Resource_Usage;
procedure Put (Item : in Time_Type) is
begin
Put (File => Standard_Output,
Item => Item);
end Put;
procedure Put (File : in File_Type;
Item : in Time_Type) is
package D_IO is new Editing.Decimal_Output (Time_Type);
use Ada.Strings;
use Editing;
use Fixed;
use D_IO;
Pic : constant Picture := To_Picture ("Z(11)9.9(6)");
Time : String (1 .. 19) := (others => ' ');
begin
Put (To => Time, Item => Item, Pic => Pic);
Put (File => File, Item => Trim (Source => Time, Side => Both));
end Put;
procedure Put (Item : in Usage_Type) is
begin
Put (File => Standard_Output,
Item => Item);
end Put;
procedure Put (File : in File_Type;
Item : in Usage_Type) is
use I_IO;
begin
Put (File => File, Item => "User time: ");
Put (File => File, Item => Item.User_Time);
New_Line (File => File);
Put (File => File, Item => "System time: ");
Put (File => File, Item => Item.System_Time);
New_Line (File => File);
Put (File => File, Item => "Input I/O operations: ");
Put (File => File, Item => Long (Item.In_IO), Width => 0);
New_Line (File => File);
Put (File => File, Item => "Output I/O operations: ");
Put (File => File, Item => Long (Item.Out_IO), Width => 0);
New_Line (File => File);
Put (File => File, Item => "Voluntary context switches: ");
Put (File => File,
Item => Long (Item.Voluntary_Context_Switches),
Width => 0);
New_Line (File => File);
Put (File => File, Item => "Involuntary context switches: ");
Put (File => File,
Item => Long (Item.Involuntary_Context_Switches),
Width => 0);
New_Line (File => File);
end Put;
end Timings;
|
stcarrez/bbox-ada-api | Ada | 1,777 | ads | -----------------------------------------------------------------------
-- druss-commands-devices -- Print information about the devices
-- Copyright (C) 2017, 2018, 2019, 2021 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package Druss.Commands.Devices is
type Command_Type is new Druss.Commands.Drivers.Command_Type with null record;
procedure Do_List (Command : in Command_Type;
Args : in Argument_List'Class;
Selector : in Device_Selector_Type;
Context : in out Context_Type);
-- Execute a status command to report information about the Bbox.
overriding
procedure Execute (Command : in out Command_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type);
-- Write the help associated with the command.
overriding
procedure Help (Command : in out Command_Type;
Name : in String;
Context : in out Context_Type);
end Druss.Commands.Devices;
|
reznikmm/matreshka | Ada | 4,126 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016-2017, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Strings;
with WUI.Events.Mouse.Click;
package WUI.Actions is
type Action is abstract tagged private;
type Action_Access is access all Action'Class;
-- with Storage_Size => 0;
not overriding procedure Triggered_Event
(Self : in out Action;
Event : in out WUI.Events.Mouse.Click.Click_Event'Class) is null;
-- XXX Should it be signal/slot/etc?
not overriding function Text
(Self : Action) return League.Strings.Universal_String;
package Constructors is
procedure Initialize
(Self : in out Action'Class;
Text : League.Strings.Universal_String);
end Constructors;
private
type Action is abstract tagged record
Action_Text : League.Strings.Universal_String;
end record;
end WUI.Actions;
|
AdaCore/training_material | Ada | 2,082 | adb | with Except;
with Input;
with Screen_Output;
package body Tokens is
----------
-- Next --
----------
function Next return Token is
begin
loop -- until we have read a valid token.
-- Open block to catch exceptions raised for user errors.
Read_A_Valid_Token : declare
Word : String := Input.Next_Word;
begin
-- Figure out which kind of token we have from the first
-- character and delegate the full token recognition to
-- the Read routine in the appropriate Instruction, Values
-- or Values.Operations package.
case Word (Word'First) is
when '0' .. '9' | '.' =>
return Token'(Kind => Val, Val => Values.Read (Word));
when '+' | '*' | '/' =>
return
Token'(Kind => Op, Op => Values.Operations.Read (Word));
when '-' =>
if Word'Length > 1 then
return Token'(Kind => Val, Val => Values.Read (Word));
else
return
Token'(Kind => Op, Op => Values.Operations.Read (Word));
end if;
when 'a' .. 'z'
| 'A' .. 'Z' =>
return
Token'(Kind => Instr, Instr => Instructions.Read (Word));
when others =>
raise Except.User_Error;
end case;
exception
when Except.User_Error =>
Screen_Output.Syntax_Error ("Input ignored till end of line.");
Input.Skip_Line;
end Read_A_Valid_Token;
end loop;
end Next;
-------------
-- Process --
-------------
procedure Process (T : Token) is
begin
case T.Kind is
when Val =>
Values.Process (T.Val);
when Op =>
Values.Operations.Process (T.Op);
when Instr =>
Instructions.Process (T.Instr);
end case;
end Process;
end Tokens;
|
zhmu/ananas | Ada | 28,527 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ D I S T --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Casing; use Casing;
with Einfo; use Einfo;
with Einfo.Entities; use Einfo.Entities;
with Einfo.Utils; use Einfo.Utils;
with Errout; use Errout;
with Exp_Dist; use Exp_Dist;
with Exp_Tss; use Exp_Tss;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Namet; use Namet;
with Opt; use Opt;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Aux; use Sem_Aux;
with Sem_Disp; use Sem_Disp;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Sinfo.Nodes; use Sinfo.Nodes;
with Sinfo.Utils; use Sinfo.Utils;
with Stand; use Stand;
with Stringt; use Stringt;
with Tbuild; use Tbuild;
with Uintp; use Uintp;
package body Sem_Dist is
-----------------------
-- Local Subprograms --
-----------------------
procedure RAS_E_Dereference (Pref : Node_Id);
-- Handles explicit dereference of Remote Access to Subprograms
function Full_Qualified_Name (E : Entity_Id) return String_Id;
-- returns the full qualified name of the entity in lower case
-------------------------
-- Add_Stub_Constructs --
-------------------------
procedure Add_Stub_Constructs (N : Node_Id) is
U : constant Node_Id := Unit (N);
Spec : Entity_Id := Empty;
Exp : Node_Id := U;
-- Unit that will be expanded
begin
pragma Assert (Distribution_Stub_Mode /= No_Stubs);
if Nkind (U) = N_Package_Declaration then
Spec := Defining_Entity (Specification (U));
elsif Nkind (U) = N_Package_Body then
Spec := Corresponding_Spec (U);
else pragma Assert (Nkind (U) = N_Package_Instantiation);
Exp := Instance_Spec (U);
Spec := Defining_Entity (Specification (Exp));
end if;
pragma Assert (Is_Shared_Passive (Spec)
or else Is_Remote_Call_Interface (Spec));
if Distribution_Stub_Mode = Generate_Caller_Stub_Body then
if Is_Shared_Passive (Spec) then
null;
elsif Nkind (U) = N_Package_Body then
Error_Msg_N
("Specification file expected from command line", U);
else
Expand_Calling_Stubs_Bodies (Exp);
end if;
else
if Is_Shared_Passive (Spec) then
Build_Passive_Partition_Stub (Exp);
else
Expand_Receiving_Stubs_Bodies (Exp);
end if;
end if;
end Add_Stub_Constructs;
---------------------------------------
-- Build_RAS_Primitive_Specification --
---------------------------------------
function Build_RAS_Primitive_Specification
(Subp_Spec : Node_Id;
Remote_Object_Type : Node_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (Subp_Spec);
Primitive_Spec : constant Node_Id :=
Copy_Specification (Loc,
Spec => Subp_Spec,
New_Name => Name_uCall);
Subtype_Mark_For_Self : Node_Id;
begin
if No (Parameter_Specifications (Primitive_Spec)) then
Set_Parameter_Specifications (Primitive_Spec, New_List);
end if;
if Nkind (Remote_Object_Type) in N_Entity then
Subtype_Mark_For_Self :=
New_Occurrence_Of (Remote_Object_Type, Loc);
else
Subtype_Mark_For_Self := Remote_Object_Type;
end if;
Prepend_To (
Parameter_Specifications (Primitive_Spec),
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uS),
Parameter_Type =>
Make_Access_Definition (Loc,
Subtype_Mark =>
Subtype_Mark_For_Self)));
-- Trick later semantic analysis into considering this operation as a
-- primitive (dispatching) operation of tagged type Obj_Type.
Set_Comes_From_Source (
Defining_Unit_Name (Primitive_Spec), True);
return Primitive_Spec;
end Build_RAS_Primitive_Specification;
-------------------------
-- Full_Qualified_Name --
-------------------------
function Full_Qualified_Name (E : Entity_Id) return String_Id is
Ent : Entity_Id := E;
Parent_Name : String_Id := No_String;
begin
-- Deals properly with child units
if Nkind (Ent) = N_Defining_Program_Unit_Name then
Ent := Defining_Identifier (Ent);
end if;
-- Compute recursively the qualification (only "Standard" has no scope)
if Present (Scope (Scope (Ent))) then
Parent_Name := Full_Qualified_Name (Scope (Ent));
end if;
-- Every entity should have a name except some expanded blocks. Do not
-- bother about those.
if Chars (Ent) = No_Name then
return Parent_Name;
end if;
-- Add a period between Name and qualification
if Parent_Name /= No_String then
Start_String (Parent_Name);
Store_String_Char (Get_Char_Code ('.'));
else
Start_String;
end if;
-- Generates the entity name in upper case
Get_Name_String (Chars (Ent));
Set_Casing (All_Lower_Case);
Store_String_Chars (Name_Buffer (1 .. Name_Len));
return End_String;
end Full_Qualified_Name;
------------------
-- Get_PCS_Name --
------------------
function Get_PCS_Name return PCS_Names is
begin
return
Chars (Entity (Expression (Parent (RTE (RE_DSA_Implementation)))));
end Get_PCS_Name;
---------------------
-- Get_PCS_Version --
---------------------
function Get_PCS_Version return Int is
PCS_Version_Entity : Entity_Id;
PCS_Version : Int;
begin
if RTE_Available (RE_PCS_Version) then
PCS_Version_Entity := RTE (RE_PCS_Version);
pragma Assert (Ekind (PCS_Version_Entity) = E_Named_Integer);
PCS_Version :=
UI_To_Int (Expr_Value (Constant_Value (PCS_Version_Entity)));
else
-- Case of System.Partition_Interface.PCS_Version not found:
-- return a null version.
PCS_Version := 0;
end if;
return PCS_Version;
end Get_PCS_Version;
------------------------
-- Is_All_Remote_Call --
------------------------
function Is_All_Remote_Call (N : Node_Id) return Boolean is
Par : Node_Id;
begin
if Nkind (N) in N_Subprogram_Call
and then Nkind (Name (N)) in N_Has_Entity
and then Is_Remote_Call_Interface (Entity (Name (N)))
and then Has_All_Calls_Remote (Scope (Entity (Name (N))))
and then Comes_From_Source (N)
then
Par := Parent (Entity (Name (N)));
while Present (Par)
and then (Nkind (Par) /= N_Package_Specification
or else Is_Wrapper_Package (Defining_Entity (Par)))
loop
Par := Parent (Par);
end loop;
if Present (Par) then
return
not Scope_Within_Or_Same (Current_Scope, Defining_Entity (Par));
else
return False;
end if;
else
return False;
end if;
end Is_All_Remote_Call;
---------------------------------
-- Is_RACW_Stub_Type_Operation --
---------------------------------
function Is_RACW_Stub_Type_Operation (Op : Entity_Id) return Boolean is
Typ : Entity_Id;
begin
case Ekind (Op) is
when E_Function
| E_Procedure
=>
Typ := Find_Dispatching_Type (Op);
return
Present (Typ)
and then Is_RACW_Stub_Type (Typ)
and then not Is_Internal (Op);
when others =>
return False;
end case;
end Is_RACW_Stub_Type_Operation;
---------------------------------
-- Is_Valid_Remote_Object_Type --
---------------------------------
function Is_Valid_Remote_Object_Type (E : Entity_Id) return Boolean is
P : constant Node_Id := Parent (E);
begin
pragma Assert (Is_Tagged_Type (E));
-- Simple case: a limited private type
if Nkind (P) = N_Private_Type_Declaration
and then Is_Limited_Record (E)
then
return True;
-- AI05-0060 (Binding Interpretation): A limited interface is a legal
-- ancestor for the designated type of an RACW type.
elsif Is_Limited_Record (E) and then Is_Limited_Interface (E) then
return True;
-- A generic tagged limited type is a valid candidate. Limitedness will
-- be checked again on the actual at instantiation point.
elsif Nkind (P) = N_Formal_Type_Declaration
and then Ekind (E) = E_Record_Type_With_Private
and then Is_Generic_Type (E)
and then Is_Limited_Record (E)
then
return True;
-- A private extension declaration is a valid candidate if its parent
-- type is.
elsif Nkind (P) = N_Private_Extension_Declaration then
return Is_Valid_Remote_Object_Type (Etype (E));
else
return False;
end if;
end Is_Valid_Remote_Object_Type;
------------------------------------
-- Package_Specification_Of_Scope --
------------------------------------
function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id is
N : Node_Id;
begin
N := Parent (E);
while Nkind (N) /= N_Package_Specification loop
N := Parent (N);
end loop;
return N;
end Package_Specification_Of_Scope;
--------------------------
-- Process_Partition_Id --
--------------------------
procedure Process_Partition_Id (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Ety : Entity_Id;
Get_Pt_Id : Node_Id;
Get_Pt_Id_Call : Node_Id;
Prefix_String : String_Id;
Typ : constant Entity_Id := Etype (N);
begin
-- In case prefix is not a library unit entity, get the entity
-- of library unit.
Ety := Entity (Prefix (N));
while (Present (Scope (Ety))
and then Scope (Ety) /= Standard_Standard)
and not Is_Child_Unit (Ety)
loop
Ety := Scope (Ety);
end loop;
-- Retrieve the proper function to call
if Is_Remote_Call_Interface (Ety) then
Get_Pt_Id := New_Occurrence_Of
(RTE (RE_Get_Active_Partition_Id), Loc);
elsif Is_Shared_Passive (Ety) then
Get_Pt_Id := New_Occurrence_Of
(RTE (RE_Get_Passive_Partition_Id), Loc);
else
Get_Pt_Id := New_Occurrence_Of
(RTE (RE_Get_Local_Partition_Id), Loc);
end if;
-- Get and store the String_Id corresponding to the name of the
-- library unit whose Partition_Id is needed.
Get_Library_Unit_Name_String (Unit_Declaration_Node (Ety));
Prefix_String := String_From_Name_Buffer;
-- Build the function call which will replace the attribute
if Is_Remote_Call_Interface (Ety) or else Is_Shared_Passive (Ety) then
Get_Pt_Id_Call :=
Make_Function_Call (Loc,
Name => Get_Pt_Id,
Parameter_Associations =>
New_List (Make_String_Literal (Loc, Prefix_String)));
else
Get_Pt_Id_Call := Make_Function_Call (Loc, Get_Pt_Id);
end if;
-- Replace the attribute node by a conversion of the function call
-- to the target type.
Rewrite (N, Convert_To (Typ, Get_Pt_Id_Call));
Analyze_And_Resolve (N, Typ);
end Process_Partition_Id;
----------------------------------
-- Process_Remote_AST_Attribute --
----------------------------------
procedure Process_Remote_AST_Attribute
(N : Node_Id;
New_Type : Entity_Id)
is
Loc : constant Source_Ptr := Sloc (N);
Remote_Subp : Entity_Id;
Tick_Access_Conv_Call : Node_Id;
Remote_Subp_Decl : Node_Id;
RS_Pkg_Specif : Node_Id;
RS_Pkg_E : Entity_Id;
RAS_Type : Entity_Id := New_Type;
Async_E : Entity_Id;
All_Calls_Remote_E : Entity_Id;
Attribute_Subp : Entity_Id;
begin
-- Check if we have to expand the access attribute
Remote_Subp := Entity (Prefix (N));
if not Expander_Active or else Get_PCS_Name = Name_No_DSA then
return;
end if;
if Ekind (RAS_Type) /= E_Record_Type then
RAS_Type := Equivalent_Type (RAS_Type);
end if;
Attribute_Subp := TSS (RAS_Type, TSS_RAS_Access);
pragma Assert (Present (Attribute_Subp));
Remote_Subp_Decl := Unit_Declaration_Node (Remote_Subp);
if Nkind (Remote_Subp_Decl) = N_Subprogram_Body then
Remote_Subp := Corresponding_Spec (Remote_Subp_Decl);
Remote_Subp_Decl := Unit_Declaration_Node (Remote_Subp);
end if;
RS_Pkg_Specif := Parent (Remote_Subp_Decl);
RS_Pkg_E := Defining_Entity (RS_Pkg_Specif);
Async_E :=
Boolean_Literals (Ekind (Remote_Subp) = E_Procedure
and then Is_Asynchronous (Remote_Subp));
All_Calls_Remote_E :=
Boolean_Literals (Has_All_Calls_Remote (RS_Pkg_E));
Tick_Access_Conv_Call :=
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Attribute_Subp, Loc),
Parameter_Associations =>
New_List (
Make_String_Literal (Loc,
Strval => Full_Qualified_Name (RS_Pkg_E)),
Build_Subprogram_Id (Loc, Remote_Subp),
New_Occurrence_Of (Async_E, Loc),
New_Occurrence_Of (All_Calls_Remote_E, Loc)));
Rewrite (N, Tick_Access_Conv_Call);
Analyze_And_Resolve (N, RAS_Type);
end Process_Remote_AST_Attribute;
------------------------------------
-- Process_Remote_AST_Declaration --
------------------------------------
procedure Process_Remote_AST_Declaration (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
User_Type : constant Node_Id := Defining_Identifier (N);
Scop : constant Entity_Id := Scope (User_Type);
Is_RCI : constant Boolean := Is_Remote_Call_Interface (Scop);
Is_RT : constant Boolean := Is_Remote_Types (Scop);
Type_Def : constant Node_Id := Type_Definition (N);
Parameter : Node_Id;
Is_Degenerate : Boolean;
-- True iff this RAS has an access formal parameter (see
-- Exp_Dist.Add_RAS_Dereference_TSS for details).
Subpkg : constant Entity_Id := Make_Temporary (Loc, 'S');
Subpkg_Decl : Node_Id;
Subpkg_Body : Node_Id;
Vis_Decls : constant List_Id := New_List;
Priv_Decls : constant List_Id := New_List;
Obj_Type : constant Entity_Id :=
Make_Defining_Identifier (Loc,
New_External_Name (Chars (User_Type), 'R'));
Full_Obj_Type : constant Entity_Id :=
Make_Defining_Identifier (Loc, Chars (Obj_Type));
RACW_Type : constant Entity_Id :=
Make_Defining_Identifier (Loc,
New_External_Name (Chars (User_Type), 'P'));
Fat_Type : constant Entity_Id :=
Make_Defining_Identifier (Loc, Chars (User_Type));
Fat_Type_Decl : Node_Id;
begin
Is_Degenerate := False;
Parameter := First (Parameter_Specifications (Type_Def));
while Present (Parameter) loop
if Nkind (Parameter_Type (Parameter)) = N_Access_Definition then
Error_Msg_N
("formal parameter& has anonymous access type??",
Defining_Identifier (Parameter));
Is_Degenerate := True;
exit;
end if;
Next (Parameter);
end loop;
if Is_Degenerate then
Error_Msg_NE
("remote access-to-subprogram type& can only be null??",
Defining_Identifier (Parameter), User_Type);
-- The only legal value for a RAS with a formal parameter of an
-- anonymous access type is null, because it cannot be subtype-
-- conformant with any legal remote subprogram declaration. In this
-- case, we cannot generate a corresponding primitive operation.
end if;
if Get_PCS_Name = Name_No_DSA then
return;
end if;
-- The tagged private type, primitive operation and RACW type associated
-- with a RAS need to all be declared in a subpackage of the one that
-- contains the RAS declaration, because the primitive of the object
-- type, and the associated primitive of the stub type, need to be
-- dispatching operations of these types, and the profile of the RAS
-- might contain tagged types declared in the same scope.
Append_To (Vis_Decls,
Make_Private_Type_Declaration (Loc,
Defining_Identifier => Obj_Type,
Abstract_Present => True,
Tagged_Present => True,
Limited_Present => True));
Append_To (Priv_Decls,
Make_Full_Type_Declaration (Loc,
Defining_Identifier => Full_Obj_Type,
Type_Definition =>
Make_Record_Definition (Loc,
Abstract_Present => True,
Tagged_Present => True,
Limited_Present => True,
Null_Present => True,
Component_List => Empty)));
-- Trick semantic analysis into swapping the public and full view when
-- freezing the public view.
Set_Comes_From_Source (Full_Obj_Type, True);
if not Is_Degenerate then
Append_To (Vis_Decls,
Make_Abstract_Subprogram_Declaration (Loc,
Specification => Build_RAS_Primitive_Specification (
Subp_Spec => Type_Def,
Remote_Object_Type => Obj_Type)));
end if;
Append_To (Vis_Decls,
Make_Full_Type_Declaration (Loc,
Defining_Identifier => RACW_Type,
Type_Definition =>
Make_Access_To_Object_Definition (Loc,
All_Present => True,
Subtype_Indication =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Obj_Type, Loc),
Attribute_Name => Name_Class))));
Set_Is_Remote_Call_Interface (RACW_Type, Is_RCI);
Set_Is_Remote_Types (RACW_Type, Is_RT);
Subpkg_Decl :=
Make_Package_Declaration (Loc,
Make_Package_Specification (Loc,
Defining_Unit_Name => Subpkg,
Visible_Declarations => Vis_Decls,
Private_Declarations => Priv_Decls,
End_Label => New_Occurrence_Of (Subpkg, Loc)));
Set_Is_Remote_Call_Interface (Subpkg, Is_RCI);
Set_Is_Remote_Types (Subpkg, Is_RT);
Insert_After_And_Analyze (N, Subpkg_Decl);
-- Generate package body to receive RACW calling stubs
-- Note: Analyze_Declarations has an absolute requirement that the
-- declaration list be non-empty, so provide dummy null statement here.
Subpkg_Body :=
Make_Package_Body (Loc,
Defining_Unit_Name => Make_Defining_Identifier (Loc, Chars (Subpkg)),
Declarations => New_List (Make_Null_Statement (Loc)));
Insert_After_And_Analyze (Subpkg_Decl, Subpkg_Body);
-- Many parts of the analyzer and expander expect
-- that the fat pointer type used to implement remote
-- access to subprogram types be a record.
-- Note: The structure of this type must be kept consistent
-- with the code generated by Remote_AST_Null_Value for the
-- corresponding 'null' expression.
Fat_Type_Decl := Make_Full_Type_Declaration (Loc,
Defining_Identifier => Fat_Type,
Type_Definition =>
Make_Record_Definition (Loc,
Component_List =>
Make_Component_List (Loc,
Component_Items => New_List (
Make_Component_Declaration (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_Ras),
Component_Definition =>
Make_Component_Definition (Loc,
Aliased_Present => False,
Subtype_Indication =>
New_Occurrence_Of (RACW_Type, Loc)))))));
Set_Equivalent_Type (User_Type, Fat_Type);
-- Set Fat_Type's Etype early so that we can use its
-- Corresponding_Remote_Type attribute, whose presence indicates that
-- this is the record type used to implement a RAS.
Mutate_Ekind (Fat_Type, E_Record_Type);
Set_Corresponding_Remote_Type (Fat_Type, User_Type);
Insert_After_And_Analyze (Subpkg_Body, Fat_Type_Decl);
-- The reason we suppress the initialization procedure is that we know
-- that no initialization is required (even if Initialize_Scalars mode
-- is active), and there are order of elaboration problems if we do try
-- to generate an init proc for this created record type.
Set_Suppress_Initialization (Fat_Type);
if Expander_Active then
Add_RAST_Features (Parent (User_Type));
end if;
end Process_Remote_AST_Declaration;
-----------------------
-- RAS_E_Dereference --
-----------------------
procedure RAS_E_Dereference (Pref : Node_Id) is
Loc : constant Source_Ptr := Sloc (Pref);
Call_Node : Node_Id;
New_Type : constant Entity_Id := Etype (Pref);
Explicit_Deref : constant Node_Id := Parent (Pref);
Deref_Subp_Call : constant Node_Id := Parent (Explicit_Deref);
Deref_Proc : Entity_Id;
Params : List_Id;
begin
if Nkind (Deref_Subp_Call) = N_Procedure_Call_Statement then
Params := Parameter_Associations (Deref_Subp_Call);
if Present (Params) then
Prepend (Pref, Params);
else
Params := New_List (Pref);
end if;
elsif Nkind (Deref_Subp_Call) = N_Indexed_Component then
Params := Expressions (Deref_Subp_Call);
if Present (Params) then
Prepend (Pref, Params);
else
Params := New_List (Pref);
end if;
else
-- Context is not a call
return;
end if;
if not Expander_Active or else Get_PCS_Name = Name_No_DSA then
return;
end if;
Deref_Proc := TSS (New_Type, TSS_RAS_Dereference);
pragma Assert (Present (Deref_Proc));
if Ekind (Deref_Proc) = E_Function then
Call_Node :=
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Deref_Proc, Loc),
Parameter_Associations => Params);
else
Call_Node :=
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Deref_Proc, Loc),
Parameter_Associations => Params);
end if;
Rewrite (Deref_Subp_Call, Call_Node);
Analyze (Deref_Subp_Call);
end RAS_E_Dereference;
------------------------------
-- Remote_AST_E_Dereference --
------------------------------
function Remote_AST_E_Dereference (P : Node_Id) return Boolean is
ET : constant Entity_Id := Etype (P);
begin
-- Perform the changes only on original dereferences, and only if
-- we are generating code.
if Comes_From_Source (P)
and then Expander_Active
and then Is_Record_Type (ET)
and then (Is_Remote_Call_Interface (ET) or else Is_Remote_Types (ET))
and then Present (Corresponding_Remote_Type (ET))
and then Nkind (Parent (Parent (P))) in
N_Procedure_Call_Statement | N_Indexed_Component
then
RAS_E_Dereference (P);
return True;
else
return False;
end if;
end Remote_AST_E_Dereference;
------------------------------
-- Remote_AST_I_Dereference --
------------------------------
function Remote_AST_I_Dereference (P : Node_Id) return Boolean is
ET : constant Entity_Id := Etype (P);
Deref : Node_Id;
begin
if Comes_From_Source (P)
and then (Is_Remote_Call_Interface (ET)
or else Is_Remote_Types (ET))
and then Present (Corresponding_Remote_Type (ET))
and then Ekind (Entity (P)) /= E_Function
then
Deref :=
Make_Explicit_Dereference (Sloc (P),
Prefix => Relocate_Node (P));
Rewrite (P, Deref);
Set_Etype (P, ET);
RAS_E_Dereference (Prefix (P));
return True;
end if;
return False;
end Remote_AST_I_Dereference;
---------------------------
-- Remote_AST_Null_Value --
---------------------------
function Remote_AST_Null_Value
(N : Node_Id;
Typ : Entity_Id) return Boolean
is
Loc : constant Source_Ptr := Sloc (N);
Target_Type : Entity_Id;
begin
if not Expander_Active or else Get_PCS_Name = Name_No_DSA then
return False;
elsif Ekind (Typ) = E_Access_Subprogram_Type
and then (Is_Remote_Call_Interface (Typ)
or else Is_Remote_Types (Typ))
and then Comes_From_Source (N)
and then Expander_Active
then
-- Any null that comes from source and is of the RAS type must
-- be expanded, except if expansion is not active (nothing
-- gets expanded into the equivalent record type).
Target_Type := Equivalent_Type (Typ);
elsif Ekind (Typ) = E_Record_Type
and then Present (Corresponding_Remote_Type (Typ))
then
-- This is a record type representing a RAS type, this must be
-- expanded.
Target_Type := Typ;
else
-- We do not have to handle this case
return False;
end if;
Rewrite (N,
Make_Aggregate (Loc,
Component_Associations => New_List (
Make_Component_Association (Loc,
Choices => New_List (Make_Identifier (Loc, Name_Ras)),
Expression => Make_Null (Loc)))));
Analyze_And_Resolve (N, Target_Type);
return True;
end Remote_AST_Null_Value;
end Sem_Dist;
|
Rodeo-McCabe/orka | Ada | 9,811 | adb | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Numerics.Generic_Elementary_Functions;
package body Orka.Transforms.SIMD_Matrices is
package EF is new Ada.Numerics.Generic_Elementary_Functions (Element_Type);
function "-" (Elements : Vectors.Vector_Type) return Vectors.Vector_Type renames Vectors."-";
function T (Offset : Vector_Type) return Matrix_Type is
Result : Matrix_Type := Identity_Value;
Old_W : constant Element_Type := Result (W) (W);
begin
Result (W) := Offset;
Result (W) (W) := Old_W;
return Result;
end T;
function Rx (Angle : Element_Type) return Matrix_Type is
CA : constant Element_Type := EF.Cos (Angle);
SA : constant Element_Type := EF.Sin (Angle);
Result : Matrix_Type := Identity_Value;
begin
Result (Y) := (0.0, CA, SA, 0.0);
Result (Z) := (0.0, -SA, CA, 0.0);
return Result;
end Rx;
function Ry (Angle : Element_Type) return Matrix_Type is
CA : constant Element_Type := EF.Cos (Angle);
SA : constant Element_Type := EF.Sin (Angle);
Result : Matrix_Type := Identity_Value;
begin
Result (X) := (CA, 0.0, -SA, 0.0);
Result (Z) := (SA, 0.0, CA, 0.0);
return Result;
end Ry;
function Rz (Angle : Element_Type) return Matrix_Type is
CA : constant Element_Type := EF.Cos (Angle);
SA : constant Element_Type := EF.Sin (Angle);
Result : Matrix_Type := Identity_Value;
begin
Result (X) := (CA, SA, 0.0, 0.0);
Result (Y) := (-SA, CA, 0.0, 0.0);
return Result;
end Rz;
function R (Axis : Vector_Type; Angle : Element_Type) return Matrix_Type is
CA : constant Element_Type := EF.Cos (Angle);
SA : constant Element_Type := EF.Sin (Angle);
MCA : constant Element_Type := 1.0 - CA;
MCARXY : constant Element_Type := MCA * Axis (X) * Axis (Y);
MCARXZ : constant Element_Type := MCA * Axis (X) * Axis (Z);
MCARYZ : constant Element_Type := MCA * Axis (Y) * Axis (Z);
RXSA : constant Element_Type := Axis (X) * SA;
RYSA : constant Element_Type := Axis (Y) * SA;
RZSA : constant Element_Type := Axis (Z) * SA;
R11 : constant Element_Type := CA + MCA * Axis (X)**2;
R12 : constant Element_Type := MCARXY + RZSA;
R13 : constant Element_Type := MCARXZ - RYSA;
R21 : constant Element_Type := MCARXY - RZSA;
R22 : constant Element_Type := CA + MCA * Axis (Y)**2;
R23 : constant Element_Type := MCARYZ + RXSA;
R31 : constant Element_Type := MCARXZ + RYSA;
R32 : constant Element_Type := MCARYZ - RXSA;
R33 : constant Element_Type := CA + MCA * Axis (Z)**2;
Result : Matrix_Type;
begin
Result (X) := (R11, R12, R13, 0.0);
Result (Y) := (R21, R22, R23, 0.0);
Result (Z) := (R31, R32, R33, 0.0);
Result (W) := (0.0, 0.0, 0.0, 1.0);
return Result;
end R;
function R (Quaternion : Vector_Type) return Matrix_Type is
Result : Matrix_Type := Identity_Value;
begin
Result (X) (X) := 1.0 - 2.0 * (Quaternion (Y) * Quaternion (Y) + Quaternion (Z) * Quaternion (Z));
Result (X) (Y) := 2.0 * (Quaternion (X) * Quaternion (Y) - Quaternion (Z) * Quaternion (W));
Result (X) (Z) := 2.0 * (Quaternion (X) * Quaternion (Z) + Quaternion (Y) * Quaternion (W));
Result (Y) (X) := 2.0 * (Quaternion (X) * Quaternion (Y) + Quaternion (Z) * Quaternion (W));
Result (Y) (Y) := 1.0 - 2.0 * (Quaternion (X) * Quaternion (X) + Quaternion (Z) * Quaternion (Z));
Result (Y) (Z) := 2.0 * (Quaternion (Y) * Quaternion (Z) - Quaternion (X) * Quaternion (W));
Result (Z) (X) := 2.0 * (Quaternion (X) * Quaternion (Z) - Quaternion (Y) * Quaternion (W));
Result (Z) (Y) := 2.0 * (Quaternion (Y) * Quaternion (Z) + Quaternion (X) * Quaternion (W));
Result (Z) (Z) := 1.0 - 2.0 * (Quaternion (X) * Quaternion (X) + Quaternion (Y) * Quaternion (Y));
return Result;
end R;
function S (Factors : Vector_Type) return Matrix_Type is
Result : Matrix_Type := Identity_Value;
begin
Result (X) (X) := Factors (X);
Result (Y) (Y) := Factors (Y);
Result (Z) (Z) := Factors (Z);
return Result;
end S;
function "+" (Offset : Vector_Type; Matrix : Matrix_Type) return Matrix_Type is
begin
return T (Offset) * Matrix;
end "+";
function "*" (Factor : Element_Type; Matrix : Matrix_Type) return Matrix_Type is
begin
return S ((Factor, Factor, Factor, 1.0)) * Matrix;
end "*";
procedure Rotate_At_Origin (Matrix : in out Matrix_Type; Axis : Vector_Type; Angle : Element_Type) is
begin
Matrix := R (Axis, Angle) * Matrix;
end Rotate_At_Origin;
procedure Rotate (Matrix : in out Matrix_Type; Axis : Vector_Type;
Angle : Element_Type; Point : Vector_Type) is
begin
Matrix := T (Point) * R (Axis, Angle) * T (-Point) * Matrix;
end Rotate;
procedure Rotate_At_Origin (Matrix : in out Matrix_Type; Quaternion : Vector_Type) is
begin
Matrix := R (Quaternion) * Matrix;
end Rotate_At_Origin;
procedure Rotate (Matrix : in out Matrix_Type; Quaternion : Vector_Type;
Point : Vector_Type) is
begin
Matrix := T (Point) * R (Quaternion) * T (-Point) * Matrix;
end Rotate;
procedure Rotate_X_At_Origin (Matrix : in out Matrix_Type; Angle : Element_Type) is
begin
Matrix := Rx (Angle) * Matrix;
end Rotate_X_At_Origin;
procedure Rotate_X (Matrix : in out Matrix_Type; Angle : Element_Type; Point : Vector_Type) is
begin
Matrix := T (Point) * Rx (Angle) * T (-Point) * Matrix;
end Rotate_X;
procedure Rotate_Y_At_Origin (Matrix : in out Matrix_Type; Angle : Element_Type) is
begin
Matrix := Ry (Angle) * Matrix;
end Rotate_Y_At_Origin;
procedure Rotate_Y (Matrix : in out Matrix_Type; Angle : Element_Type; Point : Vector_Type) is
begin
Matrix := T (Point) * Ry (Angle) * T (-Point) * Matrix;
end Rotate_Y;
procedure Rotate_Z_At_Origin (Matrix : in out Matrix_Type; Angle : Element_Type) is
begin
Matrix := Rz (Angle) * Matrix;
end Rotate_Z_At_Origin;
procedure Rotate_Z (Matrix : in out Matrix_Type; Angle : Element_Type; Point : Vector_Type) is
begin
Matrix := T (Point) * Rz (Angle) * T (-Point) * Matrix;
end Rotate_Z;
procedure Translate (Matrix : in out Matrix_Type; Offset : Vector_Type) is
begin
Matrix := Offset + Matrix;
end Translate;
procedure Scale (Matrix : in out Matrix_Type; Factors : Vector_Type) is
begin
Matrix := S (Factors) * Matrix;
end Scale;
procedure Scale (Matrix : in out Matrix_Type; Factor : Element_Type) is
begin
Matrix := Factor * Matrix;
end Scale;
procedure Transpose (Matrix : in out Matrix_Type) is
begin
Matrix := Transpose_Matrix (Matrix);
end Transpose;
function FOV (Width, Distance : Element_Type) return Element_Type is
(2.0 * EF.Arctan (Width / (2.0 * Distance)));
function Finite_Perspective (FOV, Aspect, Z_Near, Z_Far : Element_Type) return Matrix_Type is
F : constant Element_Type := 1.0 / EF.Tan (0.5 * FOV);
Result : Matrix_Type := Identity_Value;
begin
Result (X) (X) := F / Aspect;
Result (Y) (Y) := F;
-- Depth normalized to [0, 1] instead of [-1 , 1]
Result (Z) (Z) := Z_Far / (Z_Near - Z_Far);
Result (W) (Z) := (Z_Near * Z_Far) / (Z_Near - Z_Far);
Result (Z) (W) := Element_Type (-1.0);
Result (W) (W) := Element_Type (0.0);
return Result;
end Finite_Perspective;
function Infinite_Perspective (FOV, Aspect, Z_Near : Element_Type) return Matrix_Type is
F : constant Element_Type := 1.0 / EF.Tan (0.5 * FOV);
Result : Matrix_Type := Identity_Value;
begin
Result (X) (X) := F / Aspect;
Result (Y) (Y) := F;
-- Depth normalized to [0, 1] instead of [-1 , 1]
Result (Z) (Z) := Element_Type (-1.0);
Result (W) (Z) := -Z_Near;
Result (Z) (W) := Element_Type (-1.0);
Result (W) (W) := Element_Type (0.0);
return Result;
end Infinite_Perspective;
function Infinite_Perspective_Reversed_Z
(FOV, Aspect, Z_Near : Element_Type) return Matrix_Type
is
F : constant Element_Type := 1.0 / EF.Tan (0.5 * FOV);
Result : Matrix_Type := Identity_Value;
begin
Result (X) (X) := F / Aspect;
Result (Y) (Y) := F;
-- Depth normalized to [1, 0] instead of [-1 , 1]
Result (Z) (Z) := Element_Type (0.0);
Result (W) (Z) := Z_Near;
Result (Z) (W) := Element_Type (-1.0);
Result (W) (W) := Element_Type (0.0);
return Result;
end Infinite_Perspective_Reversed_Z;
function Orthographic (X_Mag, Y_Mag, Z_Near, Z_Far : Element_Type) return Matrix_Type is
Result : Matrix_Type := Identity_Value;
begin
Result (X) (X) := 2.0 / X_Mag;
Result (Y) (Y) := 2.0 / Y_Mag;
-- Depth normalized to [0, 1] instead of [-1, 1]
Result (Z) (Z) := -1.0 / (Z_Far - Z_Near);
Result (W) (Z) := -Z_Near / (Z_Far - Z_Near);
return Result;
end Orthographic;
end Orka.Transforms.SIMD_Matrices;
|
Vovanium/Encodings | Ada | 926 | ads | generic
type Character_Type is (<>); -- Character, Wide_Character, Wide_Wide_Character (or whatever)
type String_Type is array(Positive range <>) of Character_Type;
Carriage_Return: in Character_Type; -- CR in the corresponding type
Line_Feed: in Character_Type; -- LF in the corresponding type
type Coder_Base is abstract tagged private; -- Type to derive
package Encodings.Line_Endings.Generic_Strip_CR is
type Coder is new Coder_Base with private;
procedure Convert(
This: in out Coder; -- Coder state
Source: in String_Type; -- String to be converted
Source_Last: out Natural; -- Last index of source string read (length if string is starting at 1)
Target: out String_Type; -- Converted string
Target_Last: out Natural -- Last Index of destination string written
);
private
type Coder is new Coder_Base with record
Have_CR: Boolean := False;
end record;
end Encodings.Line_Endings.Generic_Strip_CR;
|
persan/AdaYaml | Ada | 642 | ads | -- part of AdaYaml, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
with AUnit; use AUnit;
with AUnit.Test_Cases; use AUnit.Test_Cases;
with Text.Pool;
package Text.Chunk_Test is
type TC is new Test_Cases.Test_Case with record
P : Pool.Reference;
end record;
overriding procedure Register_Tests (T : in out TC);
overriding procedure Set_Up (T : in out TC);
function Name (T : TC) return Message_String;
procedure Test_One_String (T : in out Test_Cases.Test_Case'Class);
procedure Test_Two_Strings (T : in out Test_Cases.Test_Case'Class);
end Text.Chunk_Test;
|
reznikmm/matreshka | Ada | 34,413 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2017, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with Matreshka.Internals.Strings;
package AMF.Internals.Tables.DG_String_Data_01 is
-- "LineTo"
MS_0100 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 6,
Length => 6,
Value =>
(16#004C#, 16#0069#, 16#006E#, 16#0065#,
16#0054#, 16#006F#,
others => 16#0000#),
others => <>);
-- "a"
MS_0101 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 1,
Length => 1,
Value =>
(16#0061#,
others => 16#0000#),
others => <>);
-- "a real number (>=0 and >=1) representing a ratio of the graphical element's width that is the x end point of the gradient."
MS_0102 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 127,
Unused => 122,
Length => 122,
Value =>
(16#0061#, 16#0020#, 16#0072#, 16#0065#,
16#0061#, 16#006C#, 16#0020#, 16#006E#,
16#0075#, 16#006D#, 16#0062#, 16#0065#,
16#0072#, 16#0020#, 16#0028#, 16#003E#,
16#003D#, 16#0030#, 16#0020#, 16#0061#,
16#006E#, 16#0064#, 16#0020#, 16#003E#,
16#003D#, 16#0031#, 16#0029#, 16#0020#,
16#0072#, 16#0065#, 16#0070#, 16#0072#,
16#0065#, 16#0073#, 16#0065#, 16#006E#,
16#0074#, 16#0069#, 16#006E#, 16#0067#,
16#0020#, 16#0061#, 16#0020#, 16#0072#,
16#0061#, 16#0074#, 16#0069#, 16#006F#,
16#0020#, 16#006F#, 16#0066#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0067#, 16#0072#, 16#0061#, 16#0070#,
16#0068#, 16#0069#, 16#0063#, 16#0061#,
16#006C#, 16#0020#, 16#0065#, 16#006C#,
16#0065#, 16#006D#, 16#0065#, 16#006E#,
16#0074#, 16#0027#, 16#0073#, 16#0020#,
16#0077#, 16#0069#, 16#0064#, 16#0074#,
16#0068#, 16#0020#, 16#0074#, 16#0068#,
16#0061#, 16#0074#, 16#0020#, 16#0069#,
16#0073#, 16#0020#, 16#0074#, 16#0068#,
16#0065#, 16#0020#, 16#0078#, 16#0020#,
16#0065#, 16#006E#, 16#0064#, 16#0020#,
16#0070#, 16#006F#, 16#0069#, 16#006E#,
16#0074#, 16#0020#, 16#006F#, 16#0066#,
16#0020#, 16#0074#, 16#0068#, 16#0065#,
16#0020#, 16#0067#, 16#0072#, 16#0061#,
16#0064#, 16#0069#, 16#0065#, 16#006E#,
16#0074#, 16#002E#,
others => 16#0000#),
others => <>);
-- "RadialGradient is a kind of gradient that fills a graphical element by smoothly changing color values in a circle."
MS_0103 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 119,
Unused => 114,
Length => 114,
Value =>
(16#0052#, 16#0061#, 16#0064#, 16#0069#,
16#0061#, 16#006C#, 16#0047#, 16#0072#,
16#0061#, 16#0064#, 16#0069#, 16#0065#,
16#006E#, 16#0074#, 16#0020#, 16#0069#,
16#0073#, 16#0020#, 16#0061#, 16#0020#,
16#006B#, 16#0069#, 16#006E#, 16#0064#,
16#0020#, 16#006F#, 16#0066#, 16#0020#,
16#0067#, 16#0072#, 16#0061#, 16#0064#,
16#0069#, 16#0065#, 16#006E#, 16#0074#,
16#0020#, 16#0074#, 16#0068#, 16#0061#,
16#0074#, 16#0020#, 16#0066#, 16#0069#,
16#006C#, 16#006C#, 16#0073#, 16#0020#,
16#0061#, 16#0020#, 16#0067#, 16#0072#,
16#0061#, 16#0070#, 16#0068#, 16#0069#,
16#0063#, 16#0061#, 16#006C#, 16#0020#,
16#0065#, 16#006C#, 16#0065#, 16#006D#,
16#0065#, 16#006E#, 16#0074#, 16#0020#,
16#0062#, 16#0079#, 16#0020#, 16#0073#,
16#006D#, 16#006F#, 16#006F#, 16#0074#,
16#0068#, 16#006C#, 16#0079#, 16#0020#,
16#0063#, 16#0068#, 16#0061#, 16#006E#,
16#0067#, 16#0069#, 16#006E#, 16#0067#,
16#0020#, 16#0063#, 16#006F#, 16#006C#,
16#006F#, 16#0072#, 16#0020#, 16#0076#,
16#0061#, 16#006C#, 16#0075#, 16#0065#,
16#0073#, 16#0020#, 16#0069#, 16#006E#,
16#0020#, 16#0061#, 16#0020#, 16#0063#,
16#0069#, 16#0072#, 16#0063#, 16#006C#,
16#0065#, 16#002E#,
others => 16#0000#),
others => <>);
-- "a list of path commands that define the geometry of the custom shape."
MS_0104 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 71,
Unused => 69,
Length => 69,
Value =>
(16#0061#, 16#0020#, 16#006C#, 16#0069#,
16#0073#, 16#0074#, 16#0020#, 16#006F#,
16#0066#, 16#0020#, 16#0070#, 16#0061#,
16#0074#, 16#0068#, 16#0020#, 16#0063#,
16#006F#, 16#006D#, 16#006D#, 16#0061#,
16#006E#, 16#0064#, 16#0073#, 16#0020#,
16#0074#, 16#0068#, 16#0061#, 16#0074#,
16#0020#, 16#0064#, 16#0065#, 16#0066#,
16#0069#, 16#006E#, 16#0065#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0067#, 16#0065#, 16#006F#, 16#006D#,
16#0065#, 16#0074#, 16#0072#, 16#0079#,
16#0020#, 16#006F#, 16#0066#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0063#, 16#0075#, 16#0073#, 16#0074#,
16#006F#, 16#006D#, 16#0020#, 16#0073#,
16#0068#, 16#0061#, 16#0070#, 16#0065#,
16#002E#,
others => 16#0000#),
others => <>);
-- "a real number (>=0 and <=1) representing the opacity of the stroke used for a graphical element. A value of 0 means totally transparent, while a value of 1 means totally opaque. The default is 1."
MS_0105 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 207,
Unused => 195,
Length => 195,
Value =>
(16#0061#, 16#0020#, 16#0072#, 16#0065#,
16#0061#, 16#006C#, 16#0020#, 16#006E#,
16#0075#, 16#006D#, 16#0062#, 16#0065#,
16#0072#, 16#0020#, 16#0028#, 16#003E#,
16#003D#, 16#0030#, 16#0020#, 16#0061#,
16#006E#, 16#0064#, 16#0020#, 16#003C#,
16#003D#, 16#0031#, 16#0029#, 16#0020#,
16#0072#, 16#0065#, 16#0070#, 16#0072#,
16#0065#, 16#0073#, 16#0065#, 16#006E#,
16#0074#, 16#0069#, 16#006E#, 16#0067#,
16#0020#, 16#0074#, 16#0068#, 16#0065#,
16#0020#, 16#006F#, 16#0070#, 16#0061#,
16#0063#, 16#0069#, 16#0074#, 16#0079#,
16#0020#, 16#006F#, 16#0066#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0073#, 16#0074#, 16#0072#, 16#006F#,
16#006B#, 16#0065#, 16#0020#, 16#0075#,
16#0073#, 16#0065#, 16#0064#, 16#0020#,
16#0066#, 16#006F#, 16#0072#, 16#0020#,
16#0061#, 16#0020#, 16#0067#, 16#0072#,
16#0061#, 16#0070#, 16#0068#, 16#0069#,
16#0063#, 16#0061#, 16#006C#, 16#0020#,
16#0065#, 16#006C#, 16#0065#, 16#006D#,
16#0065#, 16#006E#, 16#0074#, 16#002E#,
16#0020#, 16#0041#, 16#0020#, 16#0076#,
16#0061#, 16#006C#, 16#0075#, 16#0065#,
16#0020#, 16#006F#, 16#0066#, 16#0020#,
16#0030#, 16#0020#, 16#006D#, 16#0065#,
16#0061#, 16#006E#, 16#0073#, 16#0020#,
16#0074#, 16#006F#, 16#0074#, 16#0061#,
16#006C#, 16#006C#, 16#0079#, 16#0020#,
16#0074#, 16#0072#, 16#0061#, 16#006E#,
16#0073#, 16#0070#, 16#0061#, 16#0072#,
16#0065#, 16#006E#, 16#0074#, 16#002C#,
16#0020#, 16#0077#, 16#0068#, 16#0069#,
16#006C#, 16#0065#, 16#0020#, 16#0061#,
16#0020#, 16#0076#, 16#0061#, 16#006C#,
16#0075#, 16#0065#, 16#0020#, 16#006F#,
16#0066#, 16#0020#, 16#0031#, 16#0020#,
16#006D#, 16#0065#, 16#0061#, 16#006E#,
16#0073#, 16#0020#, 16#0074#, 16#006F#,
16#0074#, 16#0061#, 16#006C#, 16#006C#,
16#0079#, 16#0020#, 16#006F#, 16#0070#,
16#0061#, 16#0071#, 16#0075#, 16#0065#,
16#002E#, 16#0020#, 16#0054#, 16#0068#,
16#0065#, 16#0020#, 16#0064#, 16#0065#,
16#0066#, 16#0061#, 16#0075#, 16#006C#,
16#0074#, 16#0020#, 16#0069#, 16#0073#,
16#0020#, 16#0031#, 16#002E#,
others => 16#0000#),
others => <>);
-- "a reference to a fill that is used to paint the enclosed regions of a graphical element. A fill value is exclusive with a fillColor value. If both are specified, the fill value is used. If none is specified, no fill is applied (i.e. the element becomes see-through)."
MS_0106 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 279,
Unused => 266,
Length => 266,
Value =>
(16#0061#, 16#0020#, 16#0072#, 16#0065#,
16#0066#, 16#0065#, 16#0072#, 16#0065#,
16#006E#, 16#0063#, 16#0065#, 16#0020#,
16#0074#, 16#006F#, 16#0020#, 16#0061#,
16#0020#, 16#0066#, 16#0069#, 16#006C#,
16#006C#, 16#0020#, 16#0074#, 16#0068#,
16#0061#, 16#0074#, 16#0020#, 16#0069#,
16#0073#, 16#0020#, 16#0075#, 16#0073#,
16#0065#, 16#0064#, 16#0020#, 16#0074#,
16#006F#, 16#0020#, 16#0070#, 16#0061#,
16#0069#, 16#006E#, 16#0074#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0065#, 16#006E#, 16#0063#, 16#006C#,
16#006F#, 16#0073#, 16#0065#, 16#0064#,
16#0020#, 16#0072#, 16#0065#, 16#0067#,
16#0069#, 16#006F#, 16#006E#, 16#0073#,
16#0020#, 16#006F#, 16#0066#, 16#0020#,
16#0061#, 16#0020#, 16#0067#, 16#0072#,
16#0061#, 16#0070#, 16#0068#, 16#0069#,
16#0063#, 16#0061#, 16#006C#, 16#0020#,
16#0065#, 16#006C#, 16#0065#, 16#006D#,
16#0065#, 16#006E#, 16#0074#, 16#002E#,
16#0020#, 16#0041#, 16#0020#, 16#0066#,
16#0069#, 16#006C#, 16#006C#, 16#0020#,
16#0076#, 16#0061#, 16#006C#, 16#0075#,
16#0065#, 16#0020#, 16#0069#, 16#0073#,
16#0020#, 16#0065#, 16#0078#, 16#0063#,
16#006C#, 16#0075#, 16#0073#, 16#0069#,
16#0076#, 16#0065#, 16#0020#, 16#0077#,
16#0069#, 16#0074#, 16#0068#, 16#0020#,
16#0061#, 16#0020#, 16#0066#, 16#0069#,
16#006C#, 16#006C#, 16#0043#, 16#006F#,
16#006C#, 16#006F#, 16#0072#, 16#0020#,
16#0076#, 16#0061#, 16#006C#, 16#0075#,
16#0065#, 16#002E#, 16#0020#, 16#0049#,
16#0066#, 16#0020#, 16#0062#, 16#006F#,
16#0074#, 16#0068#, 16#0020#, 16#0061#,
16#0072#, 16#0065#, 16#0020#, 16#0073#,
16#0070#, 16#0065#, 16#0063#, 16#0069#,
16#0066#, 16#0069#, 16#0065#, 16#0064#,
16#002C#, 16#0020#, 16#0074#, 16#0068#,
16#0065#, 16#0020#, 16#0066#, 16#0069#,
16#006C#, 16#006C#, 16#0020#, 16#0076#,
16#0061#, 16#006C#, 16#0075#, 16#0065#,
16#0020#, 16#0069#, 16#0073#, 16#0020#,
16#0075#, 16#0073#, 16#0065#, 16#0064#,
16#002E#, 16#0020#, 16#0049#, 16#0066#,
16#0020#, 16#006E#, 16#006F#, 16#006E#,
16#0065#, 16#0020#, 16#0069#, 16#0073#,
16#0020#, 16#0073#, 16#0070#, 16#0065#,
16#0063#, 16#0069#, 16#0066#, 16#0069#,
16#0065#, 16#0064#, 16#002C#, 16#0020#,
16#006E#, 16#006F#, 16#0020#, 16#0066#,
16#0069#, 16#006C#, 16#006C#, 16#0020#,
16#0069#, 16#0073#, 16#0020#, 16#0061#,
16#0070#, 16#0070#, 16#006C#, 16#0069#,
16#0065#, 16#0064#, 16#0020#, 16#0028#,
16#0069#, 16#002E#, 16#0065#, 16#002E#,
16#0020#, 16#0074#, 16#0068#, 16#0065#,
16#0020#, 16#0065#, 16#006C#, 16#0065#,
16#006D#, 16#0065#, 16#006E#, 16#0074#,
16#0020#, 16#0062#, 16#0065#, 16#0063#,
16#006F#, 16#006D#, 16#0065#, 16#0073#,
16#0020#, 16#0073#, 16#0065#, 16#0065#,
16#002D#, 16#0074#, 16#0068#, 16#0072#,
16#006F#, 16#0075#, 16#0067#, 16#0068#,
16#0029#, 16#002E#,
others => 16#0000#),
others => <>);
-- "packagedFill"
MS_0107 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 12,
Length => 12,
Value =>
(16#0070#, 16#0061#, 16#0063#, 16#006B#,
16#0061#, 16#0067#, 16#0065#, 16#0064#,
16#0046#, 16#0069#, 16#006C#, 16#006C#,
others => 16#0000#),
others => <>);
-- "packagedStyle"
MS_0108 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 13,
Length => 13,
Value =>
(16#0070#, 16#0061#, 16#0063#, 16#006B#,
16#0061#, 16#0067#, 16#0065#, 16#0064#,
16#0053#, 16#0074#, 16#0079#, 16#006C#,
16#0065#,
others => 16#0000#),
others => <>);
-- "Group defines a group of graphical elements that can be styled, clipped and/or transformed together."
MS_0109 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 103,
Unused => 100,
Length => 100,
Value =>
(16#0047#, 16#0072#, 16#006F#, 16#0075#,
16#0070#, 16#0020#, 16#0064#, 16#0065#,
16#0066#, 16#0069#, 16#006E#, 16#0065#,
16#0073#, 16#0020#, 16#0061#, 16#0020#,
16#0067#, 16#0072#, 16#006F#, 16#0075#,
16#0070#, 16#0020#, 16#006F#, 16#0066#,
16#0020#, 16#0067#, 16#0072#, 16#0061#,
16#0070#, 16#0068#, 16#0069#, 16#0063#,
16#0061#, 16#006C#, 16#0020#, 16#0065#,
16#006C#, 16#0065#, 16#006D#, 16#0065#,
16#006E#, 16#0074#, 16#0073#, 16#0020#,
16#0074#, 16#0068#, 16#0061#, 16#0074#,
16#0020#, 16#0063#, 16#0061#, 16#006E#,
16#0020#, 16#0062#, 16#0065#, 16#0020#,
16#0073#, 16#0074#, 16#0079#, 16#006C#,
16#0065#, 16#0064#, 16#002C#, 16#0020#,
16#0063#, 16#006C#, 16#0069#, 16#0070#,
16#0070#, 16#0065#, 16#0064#, 16#0020#,
16#0061#, 16#006E#, 16#0064#, 16#002F#,
16#006F#, 16#0072#, 16#0020#, 16#0074#,
16#0072#, 16#0061#, 16#006E#, 16#0073#,
16#0066#, 16#006F#, 16#0072#, 16#006D#,
16#0065#, 16#0064#, 16#0020#, 16#0074#,
16#006F#, 16#0067#, 16#0065#, 16#0074#,
16#0068#, 16#0065#, 16#0072#, 16#002E#,
others => 16#0000#),
others => <>);
-- "command"
MS_010A : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 7,
Length => 7,
Value =>
(16#0063#, 16#006F#, 16#006D#, 16#006D#,
16#0061#, 16#006E#, 16#0064#,
others => 16#0000#),
others => <>);
-- "angle"
MS_010B : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 5,
Length => 5,
Value =>
(16#0061#, 16#006E#, 16#0067#, 16#006C#,
16#0065#,
others => 16#0000#),
others => <>);
-- "Canvas"
MS_010C : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 6,
Length => 6,
Value =>
(16#0043#, 16#0061#, 16#006E#, 16#0076#,
16#0061#, 16#0073#,
others => 16#0000#),
others => <>);
-- "fill"
MS_010D : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 4,
Length => 4,
Value =>
(16#0066#, 16#0069#, 16#006C#, 16#006C#,
others => 16#0000#),
others => <>);
-- "a real number (>=0 and >=1) representing a ratio of the graphical element's height that is the y end point of the gradient."
MS_010E : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 127,
Unused => 123,
Length => 123,
Value =>
(16#0061#, 16#0020#, 16#0072#, 16#0065#,
16#0061#, 16#006C#, 16#0020#, 16#006E#,
16#0075#, 16#006D#, 16#0062#, 16#0065#,
16#0072#, 16#0020#, 16#0028#, 16#003E#,
16#003D#, 16#0030#, 16#0020#, 16#0061#,
16#006E#, 16#0064#, 16#0020#, 16#003E#,
16#003D#, 16#0031#, 16#0029#, 16#0020#,
16#0072#, 16#0065#, 16#0070#, 16#0072#,
16#0065#, 16#0073#, 16#0065#, 16#006E#,
16#0074#, 16#0069#, 16#006E#, 16#0067#,
16#0020#, 16#0061#, 16#0020#, 16#0072#,
16#0061#, 16#0074#, 16#0069#, 16#006F#,
16#0020#, 16#006F#, 16#0066#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0067#, 16#0072#, 16#0061#, 16#0070#,
16#0068#, 16#0069#, 16#0063#, 16#0061#,
16#006C#, 16#0020#, 16#0065#, 16#006C#,
16#0065#, 16#006D#, 16#0065#, 16#006E#,
16#0074#, 16#0027#, 16#0073#, 16#0020#,
16#0068#, 16#0065#, 16#0069#, 16#0067#,
16#0068#, 16#0074#, 16#0020#, 16#0074#,
16#0068#, 16#0061#, 16#0074#, 16#0020#,
16#0069#, 16#0073#, 16#0020#, 16#0074#,
16#0068#, 16#0065#, 16#0020#, 16#0079#,
16#0020#, 16#0065#, 16#006E#, 16#0064#,
16#0020#, 16#0070#, 16#006F#, 16#0069#,
16#006E#, 16#0074#, 16#0020#, 16#006F#,
16#0066#, 16#0020#, 16#0074#, 16#0068#,
16#0065#, 16#0020#, 16#0067#, 16#0072#,
16#0061#, 16#0064#, 16#0069#, 16#0065#,
16#006E#, 16#0074#, 16#002E#,
others => 16#0000#),
others => <>);
-- "A_startMarker_markedElement"
MS_010F : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 31,
Unused => 27,
Length => 27,
Value =>
(16#0041#, 16#005F#, 16#0073#, 16#0074#,
16#0061#, 16#0072#, 16#0074#, 16#004D#,
16#0061#, 16#0072#, 16#006B#, 16#0065#,
16#0072#, 16#005F#, 16#006D#, 16#0061#,
16#0072#, 16#006B#, 16#0065#, 16#0064#,
16#0045#, 16#006C#, 16#0065#, 16#006D#,
16#0065#, 16#006E#, 16#0074#,
others => 16#0000#),
others => <>);
-- "Rotate"
MS_0110 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 6,
Length => 6,
Value =>
(16#0052#, 16#006F#, 16#0074#, 16#0061#,
16#0074#, 16#0065#,
others => 16#0000#),
others => <>);
-- "the center point of the circle in the x-y coordinate system."
MS_0111 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 63,
Unused => 60,
Length => 60,
Value =>
(16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0063#, 16#0065#, 16#006E#, 16#0074#,
16#0065#, 16#0072#, 16#0020#, 16#0070#,
16#006F#, 16#0069#, 16#006E#, 16#0074#,
16#0020#, 16#006F#, 16#0066#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0063#, 16#0069#, 16#0072#, 16#0063#,
16#006C#, 16#0065#, 16#0020#, 16#0069#,
16#006E#, 16#0020#, 16#0074#, 16#0068#,
16#0065#, 16#0020#, 16#0078#, 16#002D#,
16#0079#, 16#0020#, 16#0063#, 16#006F#,
16#006F#, 16#0072#, 16#0064#, 16#0069#,
16#006E#, 16#0061#, 16#0074#, 16#0065#,
16#0020#, 16#0073#, 16#0079#, 16#0073#,
16#0074#, 16#0065#, 16#006D#, 16#002E#,
others => 16#0000#),
others => <>);
-- "scale factors cannot be negative."
MS_0112 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 39,
Unused => 33,
Length => 33,
Value =>
(16#0073#, 16#0063#, 16#0061#, 16#006C#,
16#0065#, 16#0020#, 16#0066#, 16#0061#,
16#0063#, 16#0074#, 16#006F#, 16#0072#,
16#0073#, 16#0020#, 16#0063#, 16#0061#,
16#006E#, 16#006E#, 16#006F#, 16#0074#,
16#0020#, 16#0062#, 16#0065#, 16#0020#,
16#006E#, 16#0065#, 16#0067#, 16#0061#,
16#0074#, 16#0069#, 16#0076#, 16#0065#,
16#002E#,
others => 16#0000#),
others => <>);
-- "A_clipPath_clippedElement"
MS_0113 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 31,
Unused => 25,
Length => 25,
Value =>
(16#0041#, 16#005F#, 16#0063#, 16#006C#,
16#0069#, 16#0070#, 16#0050#, 16#0061#,
16#0074#, 16#0068#, 16#005F#, 16#0063#,
16#006C#, 16#0069#, 16#0070#, 16#0070#,
16#0065#, 16#0064#, 16#0045#, 16#006C#,
16#0065#, 16#006D#, 16#0065#, 16#006E#,
16#0074#,
others => 16#0000#),
others => <>);
-- "backgroundFill"
MS_0114 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 14,
Length => 14,
Value =>
(16#0062#, 16#0061#, 16#0063#, 16#006B#,
16#0067#, 16#0072#, 16#006F#, 16#0075#,
16#006E#, 16#0064#, 16#0046#, 16#0069#,
16#006C#, 16#006C#,
others => 16#0000#),
others => <>);
-- "a list of locally-owned styles for this graphical element."
MS_0115 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 63,
Unused => 58,
Length => 58,
Value =>
(16#0061#, 16#0020#, 16#006C#, 16#0069#,
16#0073#, 16#0074#, 16#0020#, 16#006F#,
16#0066#, 16#0020#, 16#006C#, 16#006F#,
16#0063#, 16#0061#, 16#006C#, 16#006C#,
16#0079#, 16#002D#, 16#006F#, 16#0077#,
16#006E#, 16#0065#, 16#0064#, 16#0020#,
16#0073#, 16#0074#, 16#0079#, 16#006C#,
16#0065#, 16#0073#, 16#0020#, 16#0066#,
16#006F#, 16#0072#, 16#0020#, 16#0074#,
16#0068#, 16#0069#, 16#0073#, 16#0020#,
16#0067#, 16#0072#, 16#0061#, 16#0070#,
16#0068#, 16#0069#, 16#0063#, 16#0061#,
16#006C#, 16#0020#, 16#0065#, 16#006C#,
16#0065#, 16#006D#, 16#0065#, 16#006E#,
16#0074#, 16#002E#,
others => 16#0000#),
others => <>);
-- "a set of styles packaged by the canvas and referenced by graphical elements in the canvas as shared styles."
MS_0116 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 111,
Unused => 107,
Length => 107,
Value =>
(16#0061#, 16#0020#, 16#0073#, 16#0065#,
16#0074#, 16#0020#, 16#006F#, 16#0066#,
16#0020#, 16#0073#, 16#0074#, 16#0079#,
16#006C#, 16#0065#, 16#0073#, 16#0020#,
16#0070#, 16#0061#, 16#0063#, 16#006B#,
16#0061#, 16#0067#, 16#0065#, 16#0064#,
16#0020#, 16#0062#, 16#0079#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0063#, 16#0061#, 16#006E#, 16#0076#,
16#0061#, 16#0073#, 16#0020#, 16#0061#,
16#006E#, 16#0064#, 16#0020#, 16#0072#,
16#0065#, 16#0066#, 16#0065#, 16#0072#,
16#0065#, 16#006E#, 16#0063#, 16#0065#,
16#0064#, 16#0020#, 16#0062#, 16#0079#,
16#0020#, 16#0067#, 16#0072#, 16#0061#,
16#0070#, 16#0068#, 16#0069#, 16#0063#,
16#0061#, 16#006C#, 16#0020#, 16#0065#,
16#006C#, 16#0065#, 16#006D#, 16#0065#,
16#006E#, 16#0074#, 16#0073#, 16#0020#,
16#0069#, 16#006E#, 16#0020#, 16#0074#,
16#0068#, 16#0065#, 16#0020#, 16#0063#,
16#0061#, 16#006E#, 16#0076#, 16#0061#,
16#0073#, 16#0020#, 16#0061#, 16#0073#,
16#0020#, 16#0073#, 16#0068#, 16#0061#,
16#0072#, 16#0065#, 16#0064#, 16#0020#,
16#0073#, 16#0074#, 16#0079#, 16#006C#,
16#0065#, 16#0073#, 16#002E#,
others => 16#0000#),
others => <>);
-- "backgroundColor"
MS_0117 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 23,
Unused => 15,
Length => 15,
Value =>
(16#0062#, 16#0061#, 16#0063#, 16#006B#,
16#0067#, 16#0072#, 16#006F#, 16#0075#,
16#006E#, 16#0064#, 16#0043#, 16#006F#,
16#006C#, 16#006F#, 16#0072#,
others => 16#0000#),
others => <>);
-- "f"
MS_0118 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 1,
Length => 1,
Value =>
(16#0066#,
others => 16#0000#),
others => <>);
-- "fontItalic"
MS_0119 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 10,
Length => 10,
Value =>
(16#0066#, 16#006F#, 16#006E#, 16#0074#,
16#0049#, 16#0074#, 16#0061#, 16#006C#,
16#0069#, 16#0063#,
others => 16#0000#),
others => <>);
-- "valid_focus_point"
MS_011A : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 23,
Unused => 17,
Length => 17,
Value =>
(16#0076#, 16#0061#, 16#006C#, 16#0069#,
16#0064#, 16#005F#, 16#0066#, 16#006F#,
16#0063#, 16#0075#, 16#0073#, 16#005F#,
16#0070#, 16#006F#, 16#0069#, 16#006E#,
16#0074#,
others => 16#0000#),
others => <>);
-- "ClosePath"
MS_011B : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 9,
Length => 9,
Value =>
(16#0043#, 16#006C#, 16#006F#, 16#0073#,
16#0065#, 16#0050#, 16#0061#, 16#0074#,
16#0068#,
others => 16#0000#),
others => <>);
-- "strokeDashLength"
MS_011C : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 23,
Unused => 16,
Length => 16,
Value =>
(16#0073#, 16#0074#, 16#0072#, 16#006F#,
16#006B#, 16#0065#, 16#0044#, 16#0061#,
16#0073#, 16#0068#, 16#004C#, 16#0065#,
16#006E#, 16#0067#, 16#0074#, 16#0068#,
others => 16#0000#),
others => <>);
-- "member"
MS_011D : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 6,
Length => 6,
Value =>
(16#006D#, 16#0065#, 16#006D#, 16#0062#,
16#0065#, 16#0072#,
others => 16#0000#),
others => <>);
-- "CubicCurveTo"
MS_011E : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 12,
Length => 12,
Value =>
(16#0043#, 16#0075#, 16#0062#, 16#0069#,
16#0063#, 16#0043#, 16#0075#, 16#0072#,
16#0076#, 16#0065#, 16#0054#, 16#006F#,
others => 16#0000#),
others => <>);
-- "Gradient"
MS_011F : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 8,
Length => 8,
Value =>
(16#0047#, 16#0072#, 16#0061#, 16#0064#,
16#0069#, 16#0065#, 16#006E#, 16#0074#,
others => 16#0000#),
others => <>);
-- "startMarker"
MS_0120 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 15,
Unused => 11,
Length => 11,
Value =>
(16#0073#, 16#0074#, 16#0061#, 16#0072#,
16#0074#, 16#004D#, 16#0061#, 16#0072#,
16#006B#, 16#0065#, 16#0072#,
others => 16#0000#),
others => <>);
-- "0"
MS_0121 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 1,
Length => 1,
Value =>
(16#0030#,
others => 16#0000#),
others => <>);
-- "Group"
MS_0122 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 7,
Unused => 5,
Length => 5,
Value =>
(16#0047#, 16#0072#, 16#006F#, 16#0075#,
16#0070#,
others => 16#0000#),
others => <>);
-- "a real number (>=0 and<=1) representing the offset of this gradient stop as a ratio of the distance between the start and end positions of the gradient."
MS_0123 : aliased Matreshka.Internals.Strings.Shared_String
:= (Capacity => 159,
Unused => 152,
Length => 152,
Value =>
(16#0061#, 16#0020#, 16#0072#, 16#0065#,
16#0061#, 16#006C#, 16#0020#, 16#006E#,
16#0075#, 16#006D#, 16#0062#, 16#0065#,
16#0072#, 16#0020#, 16#0028#, 16#003E#,
16#003D#, 16#0030#, 16#0020#, 16#0061#,
16#006E#, 16#0064#, 16#003C#, 16#003D#,
16#0031#, 16#0029#, 16#0020#, 16#0072#,
16#0065#, 16#0070#, 16#0072#, 16#0065#,
16#0073#, 16#0065#, 16#006E#, 16#0074#,
16#0069#, 16#006E#, 16#0067#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#006F#, 16#0066#, 16#0066#, 16#0073#,
16#0065#, 16#0074#, 16#0020#, 16#006F#,
16#0066#, 16#0020#, 16#0074#, 16#0068#,
16#0069#, 16#0073#, 16#0020#, 16#0067#,
16#0072#, 16#0061#, 16#0064#, 16#0069#,
16#0065#, 16#006E#, 16#0074#, 16#0020#,
16#0073#, 16#0074#, 16#006F#, 16#0070#,
16#0020#, 16#0061#, 16#0073#, 16#0020#,
16#0061#, 16#0020#, 16#0072#, 16#0061#,
16#0074#, 16#0069#, 16#006F#, 16#0020#,
16#006F#, 16#0066#, 16#0020#, 16#0074#,
16#0068#, 16#0065#, 16#0020#, 16#0064#,
16#0069#, 16#0073#, 16#0074#, 16#0061#,
16#006E#, 16#0063#, 16#0065#, 16#0020#,
16#0062#, 16#0065#, 16#0074#, 16#0077#,
16#0065#, 16#0065#, 16#006E#, 16#0020#,
16#0074#, 16#0068#, 16#0065#, 16#0020#,
16#0073#, 16#0074#, 16#0061#, 16#0072#,
16#0074#, 16#0020#, 16#0061#, 16#006E#,
16#0064#, 16#0020#, 16#0065#, 16#006E#,
16#0064#, 16#0020#, 16#0070#, 16#006F#,
16#0073#, 16#0069#, 16#0074#, 16#0069#,
16#006F#, 16#006E#, 16#0073#, 16#0020#,
16#006F#, 16#0066#, 16#0020#, 16#0074#,
16#0068#, 16#0065#, 16#0020#, 16#0067#,
16#0072#, 16#0061#, 16#0064#, 16#0069#,
16#0065#, 16#006E#, 16#0074#, 16#002E#,
others => 16#0000#),
others => <>);
end AMF.Internals.Tables.DG_String_Data_01;
|
jrcarter/Ada_GUI | Ada | 5,551 | ads | -- --
-- package Tables.Names Copyright (c) Dmitry A. Kazakov --
-- Interface Luebeck --
-- Spring, 2003 --
-- --
-- Last revision : 13:11 14 Sep 2019 --
-- --
-- This library 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 2 of --
-- the License, or (at your option) any later version. This library --
-- is distributed in the hope that it will be useful, but WITHOUT --
-- ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. You should have --
-- received a copy of the GNU General Public License along with --
-- this library; if not, write to the Free Software Foundation, --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
--____________________________________________________________________--
--
-- This package defines type Dictionary derived from Table. It has same
-- functionality as the base type, but intended for keeping only valid
-- case-insensitive names. The case is ignored when matched (Find,
-- Get), but kept by the table. Additionally, any non-empty chain of
-- characters from the set Blanks is considered equivalent when
-- matched. The procedure Check_Spelling is used to check spelling of a
-- name before placing it into the table. It may raise Constraint_Error
-- to indicate a wrong spelling. The procedure Check_Matched is used to
-- check whether the matched keyword is a proper name. It is called
-- from Get with Pointer set to the first character following the
-- matched name. It returns True if the name fits. Usually an
-- implementation checks whether Source (Pointer) is neither a letter
-- nor a digit. Check_Matched is never called with Pointer outside
-- Source'Range.
--
with Ada.Strings.Maps;
with Ada.Characters.Latin_1;
generic
with procedure Check_Spelling (Name : String) is <>;
with function Check_Matched (Source : String; Pointer : Integer)
return Boolean is <>;
Blanks : Ada.Strings.Maps.Character_Set :=
Ada.Strings.Maps.To_Set (' ' & Ada.Characters.Latin_1.HT);
package Tables.Names is
type Dictionary is new Table with private;
--
-- Add -- Overrides Tables...
--
-- Constraint_Error is propagated if Name is spelled incorrectly.
--
procedure Add
( Folder : in out Dictionary;
Name : String;
Data : Tag
);
procedure Add
( Folder : in out Dictionary;
Name : String;
Data : Tag;
Offset : out Positive
);
--
-- Delete -- Overrides Tables...
--
procedure Delete (Folder : in out Dictionary; Name : String);
--
-- Find -- Overrides Tables...
--
function Find (Folder : Dictionary; Name : String) return Tag;
--
-- Get -- Overrides Tables...
--
procedure Get
( Source : String;
Pointer : in out Integer;
Folder : Dictionary;
Data : out Tag
);
procedure Get
( Source : String;
Pointer : in out Integer;
Folder : Dictionary;
Data : out Tag;
Got_It : out Boolean
);
--
-- IsIn -- Overrides Tables...
--
function IsIn (Folder : Dictionary; Name : String) return Boolean;
--
-- Locate -- Overrides Tables...
--
function Locate (Folder : Dictionary; Name : String) return Natural;
procedure Locate
( Source : String;
Pointer : in out Integer;
Folder : Dictionary;
Offset : out Natural
);
--
-- Replace -- Overrides Tables...
--
-- Constraint_Error is propagated if Name is spelled incorrectly.
--
procedure Replace
( Folder : in out Dictionary;
Name : String;
Data : Tag
);
procedure Replace
( Folder : in out Dictionary;
Name : String;
Data : Tag;
Offset : out Positive
);
private
pragma Inline (Find);
pragma Inline (IsIn);
type Dictionary is new Table with null record;
--
-- Search -- Overrides Tables...
--
function Search (Folder : Dictionary; Name : String)
return Integer;
end Tables.Names;
|
melwyncarlo/ProjectEuler | Ada | 399 | adb | with Ada.Integer_Text_IO;
-- Copyright 2021 Melwyn Francis Carlo
procedure A006 is
use Ada.Integer_Text_IO;
N, Sum, Square_Of_Sum, Sum_Of_Square : Integer;
begin
N := 100;
Sum := Integer ((N * (N + 1)) / 2);
Square_Of_Sum := Sum * Sum;
Sum_Of_Square := (N * (N + 1) * ((2 * N) + 1)) / 6;
Put (Square_Of_Sum - Sum_Of_Square, Width => 0);
end A006;
|
charlie5/lace | Ada | 2,912 | ads | private package GID.Decoding_JPG is
use JPEG_defs;
type JPEG_marker is
(
SOI , -- Start Of Image
--
SOF_0 , -- Start Of Frame - Baseline DCT
SOF_1 , -- Extended sequential DCT
SOF_2 , -- Progressive DCT
SOF_3 , -- Lossless (sequential)
SOF_5 , -- Differential sequential DCT
SOF_6 , -- Differential progressive DCT
SOF_7 , -- Differential lossless (sequential)
SOF_8 , -- Reserved for JPEG extensions
SOF_9 , -- Extended sequential DCT
SOF_10 , -- Progressive DCT
SOF_11 , -- Lossless (sequential)
SOF_13 , -- Differential sequential DCT
SOF_14 , -- Differential progressive DCT
SOF_15 , -- Differential lossless (sequential)
--
DHT , -- Define Huffman Table
DAC , -- Define Arithmetic Coding
DQT , -- Define Quantization Table
DRI , -- Define Restart Interval
--
APP_0 , -- JFIF - JFIF JPEG image - AVI1 - Motion JPEG (MJPG)
APP_1 , -- EXIF Metadata, TIFF IFD format, JPEG Thumbnail (160x120)
APP_2 , -- ICC color profile, FlashPix
APP_3 ,
APP_4 ,
APP_5 ,
APP_6 ,
APP_7 ,
APP_8 ,
APP_9 ,
APP_10 ,
APP_11 ,
APP_12 , -- Picture Info
APP_13 , -- Photoshop Save As: IRB, 8BIM, IPTC
APP_14 , -- Copyright Entries
--
COM , -- Comments
SOS , -- Start of Scan
EOI -- End of Image
);
YCbCr_set : constant Compo_set:= (Y|Cb|Cr => True, others => False);
Y_Grey_set: constant Compo_set:= (Y => True, others => False);
CMYK_set : constant Compo_set:= (Y|Cb|Cr|I => True, others => False);
type Segment_head is record
length : U16;
kind : JPEG_marker;
end record;
procedure Read(image: in out Image_descriptor; sh: out Segment_head);
-- SOF - Start Of Frame (the real header)
procedure Read_SOF(image: in out Image_descriptor; sh: Segment_head);
procedure Read_DHT(image: in out Image_descriptor; data_length: Natural);
procedure Read_DQT(image: in out Image_descriptor; data_length: Natural);
procedure Read_DRI(image: in out Image_descriptor);
procedure Read_EXIF(image: in out Image_descriptor; data_length: Natural);
--------------------
-- Image decoding --
--------------------
generic
type Primary_color_range is mod <>;
with procedure Set_X_Y (x, y: Natural);
with procedure Put_Pixel (
red, green, blue : Primary_color_range;
alpha : Primary_color_range
);
with procedure Feedback (percents: Natural);
-- mode: Display_mode; -- nice -> progressive nicely displayed
--
procedure Load (
image : in out Image_descriptor;
next_frame: out Ada.Calendar.Day_Duration
);
end GID.Decoding_JPG;
|
Rodeo-McCabe/orka | Ada | 2,721 | adb | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2020 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with GL.Barriers;
with GL.Compute;
with GL.Types.Compute;
with Orka.Rendering.Programs.Modules;
package body Orka.Algorithms.FFT is
function Create_FFT
(Location : Resources.Locations.Location_Ptr) return FFT
is
use Rendering.Programs;
begin
return Result : FFT :=
(Program_FFT => Create_Program (Modules.Create_Module
(Location, CS => "algorithms/fft.comp")),
others => <>)
do
Result.Uniform_Size := Result.Program_FFT.Uniform ("size");
Result.Uniform_Transpose := Result.Program_FFT.Uniform ("transposeData");
Result.Uniform_Inverse := Result.Program_FFT.Uniform ("inverseFFT");
declare
Work_Group_Size : constant GL.Types.Compute.Dimension_Size_Array
:= Result.Program_FFT.Compute_Work_Group_Size;
begin
Result.Local_Size := Positive (Work_Group_Size (GL.X));
end;
end return;
end Create_FFT;
procedure Compute_FFT
(Object : in out FFT;
Buffer : Rendering.Buffers.Buffer;
Width, Height : Positive;
Transpose, Inverse : Boolean)
is
use GL.Types;
use all type Rendering.Buffers.Indexed_Buffer_Target;
Columns : constant Positive := (if Transpose then Height else Width);
Rows : constant Positive := (if Transpose then Width else Height);
pragma Assert (Columns <= Object.Local_Size);
Rows_In_Shared : constant Size := Size (Object.Local_Size / Columns);
begin
Object.Uniform_Size.Set_Vector (GL.Types.UInt_Array'(UInt (Width), UInt (Height)));
Object.Uniform_Transpose.Set_Boolean (Transpose);
Object.Uniform_Inverse.Set_Boolean (Inverse);
Object.Program_FFT.Use_Program;
Buffer.Bind (Shader_Storage, 0);
GL.Barriers.Memory_Barrier
((By_Region => False, Shader_Storage => True, others => False));
GL.Compute.Dispatch_Compute
(X => UInt (Single'Ceiling (Single (Rows) / Single (Rows_In_Shared))));
end Compute_FFT;
end Orka.Algorithms.FFT;
|
AaronC98/PlaneSystem | Ada | 3,881 | ads | ------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2006-2017, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
------------------------------------------------------------------------------
pragma Ada_2012;
private with AWS.OS_Lib;
package AWS.Net.Poll_Events is
Socket_Error : exception renames Net.Socket_Error;
type Set (Size : Natural) is new FD_Set with private;
overriding procedure Add
(FD_Set : in out Set;
FD : FD_Type;
Event : Wait_Event_Set);
overriding procedure Replace
(FD_Set : in out Set;
Index : Positive;
FD : FD_Type);
overriding procedure Set_Mode
(FD_Set : in out Set; Index : Positive; Mode : Wait_Event_Set);
overriding procedure Set_Event
(FD_Set : in out Set;
Index : Positive;
Event : Wait_Event_Type;
Value : Boolean);
overriding function Copy
(FD_Set : not null access Set; Size : Natural) return FD_Set_Access;
overriding procedure Remove (FD_Set : in out Set; Index : Positive);
overriding function Length (FD_Set : Set) return Natural;
overriding procedure Wait
(FD_Set : in out Set; Timeout : Duration; Count : out Natural);
overriding procedure Next (FD_Set : Set; Index : in out Positive);
overriding function Status
(FD_Set : Set; Index : Positive) return Event_Set;
private
subtype Timeout_Type is Interfaces.C.int;
type Pollfd is record
FD : OS_Lib.FD_Type;
Events : OS_Lib.Events_Type := 0;
REvents : OS_Lib.Events_Type := 0;
end record with Convention => C;
type Poll_Set is array (Positive range <>) of Pollfd with Convention => C;
type Set (Size : Natural) is new FD_Set (Size) with record
Length : Natural := 0;
Fds : Poll_Set (1 .. Size);
Max_FD : OS_Lib.FD_Type := 0;
end record;
end AWS.Net.Poll_Events;
|
micahwelf/FLTK-Ada | Ada | 1,961 | ads |
package FLTK.Widgets.Groups.Scrolls is
type Scroll is new Group with private;
type Scroll_Reference (Data : not null access Scroll'Class) is limited null record
with Implicit_Dereference => Data;
type Scroll_Kind is
(Horizontal,
Vertical,
Both,
Always_On,
Horizontal_Always,
Vertical_Always,
Both_Always);
package Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Scroll;
end Forge;
procedure Clear
(This : in out Scroll);
procedure Scroll_To
(This : in out Scroll;
X, Y : in Integer);
procedure Set_Type
(This : in out Scroll;
Mode : in Scroll_Kind);
function Get_Scrollbar_Size
(This : in Scroll)
return Integer;
procedure Set_Scrollbar_Size
(This : in out Scroll;
To : in Integer);
-- These two functions are far too similar in name and
-- function to the Get_X and Get_Y for Widgets.
function Get_Scroll_X
(This : in Scroll)
return Integer;
function Get_Scroll_Y
(This : in Scroll)
return Integer;
procedure Draw
(This : in out Scroll);
function Handle
(This : in out Scroll;
Event : in Event_Kind)
return Event_Outcome;
private
type Scroll is new Group with null record;
overriding procedure Finalize
(This : in out Scroll);
pragma Inline (Clear);
pragma Inline (Scroll_To);
pragma Inline (Set_Type);
pragma Inline (Get_Scrollbar_Size);
pragma Inline (Set_Scrollbar_Size);
pragma Inline (Get_Scroll_X);
pragma Inline (Get_Scroll_Y);
pragma Inline (Draw);
pragma Inline (Handle);
end FLTK.Widgets.Groups.Scrolls;
|
optikos/oasis | Ada | 4,078 | adb | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Program.Nodes.Formal_Modular_Type_Definitions is
function Create
(Mod_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Box_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return Formal_Modular_Type_Definition is
begin
return Result : Formal_Modular_Type_Definition :=
(Mod_Token => Mod_Token, Box_Token => Box_Token,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Formal_Modular_Type_Definition is
begin
return Result : Implicit_Formal_Modular_Type_Definition :=
(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 Mod_Token
(Self : Formal_Modular_Type_Definition)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Mod_Token;
end Mod_Token;
overriding function Box_Token
(Self : Formal_Modular_Type_Definition)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Box_Token;
end Box_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Formal_Modular_Type_Definition)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Formal_Modular_Type_Definition)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Formal_Modular_Type_Definition)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize
(Self : aliased in out Base_Formal_Modular_Type_Definition'Class) is
begin
null;
end Initialize;
overriding function Is_Formal_Modular_Type_Definition_Element
(Self : Base_Formal_Modular_Type_Definition)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Formal_Modular_Type_Definition_Element;
overriding function Is_Formal_Type_Definition_Element
(Self : Base_Formal_Modular_Type_Definition)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Formal_Type_Definition_Element;
overriding function Is_Definition_Element
(Self : Base_Formal_Modular_Type_Definition)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Definition_Element;
overriding procedure Visit
(Self : not null access Base_Formal_Modular_Type_Definition;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Formal_Modular_Type_Definition (Self);
end Visit;
overriding function To_Formal_Modular_Type_Definition_Text
(Self : aliased in out Formal_Modular_Type_Definition)
return Program.Elements.Formal_Modular_Type_Definitions
.Formal_Modular_Type_Definition_Text_Access is
begin
return Self'Unchecked_Access;
end To_Formal_Modular_Type_Definition_Text;
overriding function To_Formal_Modular_Type_Definition_Text
(Self : aliased in out Implicit_Formal_Modular_Type_Definition)
return Program.Elements.Formal_Modular_Type_Definitions
.Formal_Modular_Type_Definition_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Formal_Modular_Type_Definition_Text;
end Program.Nodes.Formal_Modular_Type_Definitions;
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.