hexsha
stringlengths 40
40
| size
int64 3
1.05M
| ext
stringclasses 163
values | lang
stringclasses 53
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
112
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
sequencelengths 1
10
| max_stars_count
float64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
113
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
sequencelengths 1
10
| max_issues_count
float64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
113
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
sequencelengths 1
10
| max_forks_count
float64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 3
1.05M
| avg_line_length
float64 1
966k
| max_line_length
int64 1
977k
| alphanum_fraction
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1cbe1c8d86ccb6ef6603fcbd98647da0886a5873 | 33,916 | ads | Ada | ada_gui-gnoga-gui-element.ads | jrcarter/Ada_GUI | 65a829c55dec91fd48a0b72f88d76137768bf4fb | [
"BSD-3-Clause"
] | 19 | 2018-03-18T18:07:14.000Z | 2022-03-30T03:10:12.000Z | ada_gui-gnoga-gui-element.ads | jrcarter/Ada_GUI | 65a829c55dec91fd48a0b72f88d76137768bf4fb | [
"BSD-3-Clause"
] | 4 | 2021-08-23T12:52:06.000Z | 2022-03-31T10:48:43.000Z | ada_gui-gnoga-gui-element.ads | jrcarter/Ada_GUI | 65a829c55dec91fd48a0b72f88d76137768bf4fb | [
"BSD-3-Clause"
] | null | null | null | -- Ada_GUI implementation based on Gnoga. Adapted 2021
-- --
-- GNOGA - The GNU Omnificent GUI for Ada --
-- --
-- G N O G A . G U I . E L E M E N T --
-- --
-- S p e c --
-- --
-- --
-- Copyright (C) 2014 David Botton --
-- --
-- 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. --
-- --
-- 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/>. --
-- --
-- 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. --
-- --
-- For more information please go to http://www.gnoga.com --
------------------------------------------------------------------------------
with Ada.Containers.Vectors;
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Hash;
with Ada_GUI.Gnoga.Colors;
package Ada_GUI.Gnoga.Gui.Element is
-------------------------------------------------------------------------
-- Element_Type
-------------------------------------------------------------------------
type Element_Type is new Gnoga.Gui.Base_Type with private;
type Element_Access is access all Element_Type;
type Pointer_To_Element_Class is access all Element_Type'Class;
-- Element_Type is the parent class of all Gnoga GUI elements.
-- It is generally used internally to create and bind Gnoga elements to
-- HTML5 DOM elements.
package Element_Type_Arrays is
new Ada.Containers.Vectors
(Index_Type => Positive,
Element_Type => Pointer_To_Element_Class,
"=" => Element."=");
package Element_Type_Maps is
new Ada.Containers.Indefinite_Hashed_Maps (String,
Pointer_To_Element_Class,
Ada.Strings.Hash,
Equivalent_Keys => "=");
subtype Element_Type_Array is Element_Type_Arrays.Vector;
-- Arrays of Base_Types
subtype Element_Type_Map is Element_Type_Maps.Map;
-- String to Base_Type associative array
-------------------------------------------------------------------------
-- Element_Type - Creation Methods
-------------------------------------------------------------------------
procedure Create_From_HTML (Element : in out Element_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
HTML : in String;
ID : in String := "");
-- Create a Gnoga element with HTML not attached to the DOM. If ID is blank
-- Gnoga will generate a unique one for it. The created object will be
-- stored on the browser but will not be inserted in to the DOM until
-- Place_Inside_Top_Of, Place_Inside_Bottom_Of, Place_Before, Place_After
-- is called. This is done automatically if Parent is a child type of
-- Gnoga_Gui.View.View_Base_Type unless the Auto_Place property is
-- set to False _before_ any creation method is called.
-- Quotes in HTML have to be escaped if any.
--
-- Note: All IDs _must_ be unique for use in Gnoga.
HTML_Namespace : constant String := "http://www.w3.org/1999/xhtml";
MathML_Namespace : constant String := "http://www.w3.org/1998/Math/MathML";
SVG_Namespace : constant String := "http://www.w3.org/2000/svg";
XLink_Namespace : constant String := "http://www.w3.org/1999/xlink";
XMLNS_Namespace : constant String := "http://www.w3.org/2000/xmlns/";
XML_Namespace : constant String :=
"http://www.w3.org/XML/1998/namespace";
procedure Create_XML_Element
(Element : in out Element_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
Namespace : in String;
Element_Type : in String;
ID : in String := "");
-- Create an XML element using XML Namespace.
-------------------------------------------------------------------------
-- Element_Type - Properties
-------------------------------------------------------------------------
-- Element Properties --
procedure Access_Key (Element : in out Element_Type; Value : String);
function Access_Key (Element : Element_Type) return String;
-- Used for hot key access to element. [special key] + Access_Key
-- The [special key] per browser and platform is:
--
-- Browser Windows Linux Mac
-- ----------------- ------- ----- ---
-- Internet Explorer [Alt] N/A N/A
-- Chrome [Alt] [Alt] [Control][Alt]
-- Firefox [Alt][Shift] [Alt][Shift] [Control][Alt]
-- Safari [Alt] N/A [Control][Alt]
-- Opera 15+ [Alt] [Alt] [Alt]
procedure Advisory_Title (Element : in out Element_Type; Value : in String);
function Advisory_Title (Element : Element_Type) return String;
-- Advisory_Title of Element, usually used for body and image maps
procedure Class_Name (Element : in out Element_Type; Value : in String);
function Class_Name (Element : Element_Type) return String;
-- CSS Class name, can be multiple separated by <space>
-- See Add_Class, Remove_Class and Toggle_Class Methods for adding and
-- removing individual or groups of classes in an easier way.
procedure Editable (Element : in out Element_Type;
Value : in Boolean := True);
function Editable (Element : Element_Type) return Boolean;
-- Note: This will make almost any element with content editable, even
-- non form types in most browsers.
procedure Draggable (Element : in out Element_Type;
Value : in Boolean := True);
function Draggable (Element : Element_Type) return Boolean;
-- In order to make an object draggable in addition to Draggable being true
-- the On_Drag_Start event _must_ be bound as well to set the Drag_Text.
-- To receive a drop, you need to bind On_Drop. See Gnoga.Gui
procedure Inner_HTML (Element : in out Element_Type; Value : in String);
function Inner_HTML (Element : Element_Type) return String;
-- This will completely replace the inner html of an element. This will
-- remove any Elements within Element from the DOM. If those elements
-- have ID_Types of Gnoga_ID they are still available and can be placed
-- in the DOM again using the Element.Place_* methods. However if they
-- were of ID_Type DOM_ID they are lost forever.
function Outer_HTML (Element : Element_Type) return String;
-- Returns the HTML for Element and all its contents.
-- Text Content Properties --
-- <tag>Text Content</tag> - Text content is the content contained by the
-- tag. This should not be confused with the
-- "Value" of a Form Tag.
-- (See. Gnoga.Gui.Element.Form.Value)
procedure Language_Code (Element : in out Element_Type; Value : in String);
function Language_Code (Element : Element_Type) return String;
procedure Tab_Index (Element : in out Element_Type; Value : in Natural);
function Tab_Index (Element : Element_Type) return Natural;
procedure Spell_Check (Element : in out Element_Type;
Value : in Boolean := True);
function Spell_Check (Element : Element_Type) return Boolean;
-- If true Element is subject to browser spell checking if Editable is
-- also true.
procedure Text (Element : in out Element_Type; Value : in String);
function Text (Element : Element_Type) return String;
-- Text content of element.
type Text_Direction_Type is (Left_To_Right, Right_To_Left);
procedure Text_Direction (Element : in out Element_Type;
Value : in Text_Direction_Type);
function Text_Direction (Element : Element_Type) return Text_Direction_Type;
-- BiDi text direction
-- Visibility and Layout Properties --
procedure Hidden (Element : in out Element_Type;
Value : in Boolean := True);
function Hidden (Element : Element_Type) return Boolean;
-- The hidden property will make an element invisible, however unlike
-- the property Visible which uses CSS to hide the Element, Hidden implies
-- the element is semantically not relevant not just visually and will
-- _also_ remove it from layout similar to setting Element.Display (None).
procedure Visible (Element : in out Element_Type;
Value : in Boolean := True);
function Visible (Element : Element_Type) return Boolean;
-- This will cause the Element to no longer be visible but it will still
-- take up space where it was in the layout. Use Element.Hidden to also
-- remove from layout.
-- Note: that each property, Visible, Hidden and Display (None) all work
-- independently and do not reflect the actual client side visual state
-- but the property state. To check if an object is for sure not visible
-- would require checking all three properties.
procedure Display (Element : in out Element_Type;
Value : in String);
function Display (Element : Element_Type) return String;
-- Display sets the CSS Display property that handles how elements are
-- treated by the browser layout engine.
--
-- Common Values:
--
-- none - Remove Element from layout but remain in the DOM this is
-- similar to Element.Hidden, but not like Element.Visible
-- that makes the element not visible but still take up
-- space in layout.
--
-- block - Displays an element starting on a new line and stretches
-- out to the left and right as far as it can. e.g. <div> by
-- default
--
-- inline - Wraps with text in a paragraph. e.g. <span> by default
--
-- inline-block - Flows with paragraph but will always fill from left to
-- right.
--
-- flex - Use the "flexbox" model
-- Box Properties --
type Clear_Side_Type is (Left, Right, Both);
procedure Clear_Side (Element : in out Element_Type;
Value : in Clear_Side_Type);
-- When using "float" for layout sets if the right or left side
-- of Block should be clear of any "floated" Element.
type Float_Type is (None, Left, Right);
procedure Layout_Float (Element : in out Element_Type;
Value : in Float_Type);
-- Sets if Element should "float" to the left or right until touching
-- the closest element.
type Overflow_Type is (Visible, Hidden, Scroll, Auto);
procedure Overflow (Element : in out Element_Type;
Value : in Overflow_Type);
function Overflow (Element : Element_Type) return Overflow_Type;
-- How to handle overflow of contents of an element's box
-- The default is Visible - no clipping.
procedure Overflow_X (Element : in out Element_Type;
Value : in Overflow_Type);
procedure Overflow_Y (Element : in out Element_Type;
Value : in Overflow_Type);
-- How to handle overflow of contents of an element's box for X or Y
-- The default is Visible - no clipping.
type Resizable_Type is (None, Both, Horizontal, Vertical);
procedure Resizable (Element : in out Element_Type;
Value : in Resizable_Type);
function Resizable (Element : Element_Type) return Resizable_Type;
-- If overflow is not set to visible, sets if element can be resized
-- by user.
type Position_Type is (Static, Absolute, Fixed, Relative);
procedure Position (Element : in out Element_Type;
Value : in Position_Type);
function Position (Element : Element_Type) return Position_Type;
-- Determines how the properties left, right, top and bottom are
-- interpreted.
--
-- Static - According to document flow, position properties have no
-- affect.
-- Absolute - Position properties are relative to the first non-static
-- element in the DOM before Element
-- Fixed - Position properties are relative to browser window
-- Relative - Position properties are relative to where the static position
-- of the element would in the normal document flow.
type Vertical_Align_Type is (Baseline, Sub, Super, Top, Middle, Bottom,
Text_Top, Text_Bottom);
procedure Vertical_Align (Element : in out Element_Type;
Value : in Vertical_Align_Type);
-- Vertical alignment of Element
type Box_Sizing_Type is (Content_Box, Border_Box);
procedure Box_Sizing (Element : in out Element_Type;
Value : in Box_Sizing_Type);
function Box_Sizing (Element : Element_Type) return Box_Sizing_Type;
-- Affects if height and width properties represent just the content or
-- the border, margin, padding, scroll and content area as a whole.
-- The default is Content_Box
procedure Z_Index (Element : in out Element_Type;
Value : in Integer);
-- Set stack order of element
-- Note: Z_Index only works on Elements with Position Type of absolute,
-- relative and fixed.
procedure Margin (Element : in out Element_Type;
Top : in String := "0";
Right : in String := "0";
Bottom : in String := "0";
Left : in String := "0");
-- Each can be - length|auto|initial|inherit
procedure Padding (Element : in out Element_Type;
Top : in String := "0";
Right : in String := "0";
Bottom : in String := "0";
Left : in String := "0");
-- Each can be - length|initial|inherit
function Position_Top (Element : Element_Type) return Integer;
function Position_Left (Element : Element_Type) return Integer;
-- Position in pixels relative to Element's parent in the DOM
function Offset_From_Top (Element : Element_Type) return Integer;
function Offset_From_Left (Element : Element_Type) return Integer;
-- Position in pixels relative to the document
procedure Left (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Left (Element : in out Element_Type;
Value : in String);
function Left (Element : Element_Type) return String;
procedure Right (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Right (Element : in out Element_Type;
Value : in String);
function Right (Element : Element_Type) return String;
procedure Top (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Top (Element : in out Element_Type;
Value : in String);
function Top (Element : Element_Type) return String;
procedure Bottom (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Bottom (Element : in out Element_Type;
Value : in String);
function Bottom (Element : Element_Type) return String;
procedure Box_Height (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Box_Height (Element : in out Element_Type;
Value : in String);
function Box_Height (Element : Element_Type) return String;
-- Box height based on Box_Sizing
procedure Box_Width (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Box_Width (Element : in out Element_Type;
Value : in String);
function Box_Width (Element : Element_Type) return String;
-- Box with based on Box_Sizing
procedure Minimum_Height (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Minimum_Height (Element : in out Element_Type;
Value : in String);
function Minimum_Height (Element : Element_Type) return String;
procedure Maximum_Height (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Maximum_Height (Element : in out Element_Type;
Value : in String);
function Maximum_Height (Element : Element_Type) return String;
procedure Minimum_Width (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Minimum_Width (Element : in out Element_Type;
Value : in String);
function Minimum_Width (Element : Element_Type) return String;
procedure Maximum_Width (Element : in out Element_Type;
Value : in Integer;
Unit : in String := "px");
procedure Maximum_Width (Element : in out Element_Type;
Value : in String);
function Maximum_Width (Element : Element_Type) return String;
-- For reference:
-- | Margin | Border | Padding | Scroll | [Element] | Scroll | Padding ...
-- Height and Width of Element are in Base_Type
-- All the following have the advantage of the CSS related size properties
-- in that the results are always pixels and numeric.
procedure Inner_Height (Element : in out Element_Type; Value : in Integer);
function Inner_Height (Element : Element_Type) return Integer;
-- Includes padding but not border
procedure Inner_Width (Element : in out Element_Type; Value : in Integer);
function Inner_Width (Element : Element_Type) return Integer;
-- Includes padding but not border
function Outer_Height (Element : Element_Type) return Integer;
-- Includes padding and border but not margin
function Outer_Width (Element : Element_Type) return Integer;
-- Includes padding and border but not margin
function Outer_Height_To_Margin (Element : Element_Type) return Integer;
-- Includes padding and border and margin
function Outer_Width_To_Margin
(Element : Element_Type) return Integer;
-- Includes padding and border and margin
function Client_Width (Element : Element_Type) return Natural;
-- Inner width of an element in pixels.
-- CSS width + CSS padding - width of vertical scrollbar (if present)
-- Does not include the border or margin.
function Client_Height (Element : Element_Type) return Natural;
-- Inner height of an element in pixels.
-- CSS height + CSS padding - height of horizontal scrollbar (if present)
-- Does not include the border or margin.
function Client_Left (Element : Element_Type) return Natural;
-- The width of the left border of an element in pixels.
--. It does not include the margin or padding.
function Client_Top (Element : Element_Type) return Natural;
-- The width of the top border of an element in pixels.
--. It does not include the margin or padding.
function Offset_Width (Element : Element_Type) return Integer;
-- CSS width + CSS padding + width of vertical scrollbar (if present) +
-- Border
function Offset_Height (Element : Element_Type) return Integer;
-- CSS height + CSS padding + height of horizontal scrollbar (if present) +
-- Border
function Offset_Left (Element : Element_Type) return Integer;
-- The width from parent element border to child border left
function Offset_Top (Element : Element_Type) return Integer;
-- The width from parent element border to child border top
function Scroll_Width (Element : Element_Type) return Natural;
-- Either the width in pixels of the content of an element or the width of
-- the element itself, whichever is greater
function Scroll_Height (Element : Element_Type) return Natural;
-- Height of an element's content, including content not visible on the
-- screen due to overflow.
procedure Scroll_Left (Element : in out Element_Type; Value : Integer);
function Scroll_Left (Element : Element_Type) return Integer;
-- The number of pixels that an element's content is scrolled to the left.
-- For RTL languages is negative.
procedure Scroll_Top (Element : in out Element_Type; Value : Integer);
function Scroll_Top (Element : Element_Type) return Integer;
-- The number of pixels that an element's content has been scrolled
-- upward.
-- Style Properties --
-- Color --
procedure Color (Element : in out Element_Type; Value : String);
procedure Color (Element : in out Element_Type;
RGBA : in Gnoga.RGBA_Type);
procedure Color (Element : in out Element_Type;
Enum : Gnoga.Colors.Color_Enumeration);
function Color (Element : Element_Type) return Gnoga.RGBA_Type;
procedure Opacity (Element : in out Element_Type;
Alpha : in Gnoga.Alpha_Type);
function Opacity (Element : Element_Type) return Gnoga.Alpha_Type;
-- Background --
type Background_Attachment_Type is (Scroll, Fixed, Local);
procedure Background_Attachment
(Element : in out Element_Type;
Value : in Background_Attachment_Type);
function Background_Attachment (Element : Element_Type)
return Background_Attachment_Type;
procedure Background_Color (Element : in out Element_Type;
Value : in String);
procedure Background_Color (Element : in out Element_Type;
RGBA : in Gnoga.RGBA_Type);
procedure Background_Color
(Element : in out Element_Type;
Enum : in Gnoga.Colors.Color_Enumeration);
function Background_Color (Element : Element_Type)
return Gnoga.RGBA_Type;
procedure Background_Image (Element : in out Element_Type;
Value : in String);
function Background_Image (Element : Element_Type) return String;
-- proper syntax is "url(...)" | "" to clear
procedure Background_Position (Element : in out Element_Type;
Value : in String);
function Background_Position (Element : Element_Type) return String;
-- combination of 2 - left/right/center/top/bottom | %x %y | x y
procedure Background_Origin (Element : in out Element_Type;
Value : in String);
function Background_Origin (Element : Element_Type) return String;
-- Background position property is relative to origin of:
-- padding-box|border-box|content-box
procedure Background_Repeat (Element : in out Element_Type;
Value : in String);
function Background_Repeat (Element : Element_Type) return String;
-- repeat|repeat-x|repeat-y|no-repeat
procedure Background_Clip (Element : in out Element_Type;
Value : in String);
function Background_Clip (Element : Element_Type) return String;
-- border-box|padding-box|content-box
procedure Background_Size (Element : in out Element_Type;
Value : in String);
function Background_Size (Element : Element_Type) return String;
-- auto| w h | % = cover of parent | contain
-- Border --
type Border_Style is (None, Hidden, Dotted, Dashed, Solid, Double, Groove,
Ridge, Inset, Outset);
procedure Border (Element : in out Element_Type;
Width : in String := "medium";
Style : in Border_Style := Solid;
Color : in Gnoga.Colors.Color_Enumeration :=
Gnoga.Colors.Black);
-- Width = medium|thin|thick|length|initial|inherit;
-- If Color is "" then border is same as Element.Color
procedure Border_Radius (Element : in out Element_Type;
Radius : in String := "0");
-- Curve of borders
-- Radius = length|%|initial|inherit
procedure Shadow (Element : in out Element_Type;
Horizontal_Position : in String;
Vertical_Position : in String;
Blur : in String := "";
Spread : in String := "";
Color : in Gnoga.Colors.Color_Enumeration := Gnoga.Colors.Black;
Inset_Shadow : in Boolean := False);
procedure Shadow_None (Element : in out Element_Type);
type Outline_Style_Type is (None, Hidden, Dotted, Dashed, Solid, Double,
Groove, Ridge, Inset, Outset);
procedure Outline (Element : in out Element_Type;
Color : in String := "invert";
Style : in Outline_Style_Type := None;
Width : in String := "medium");
procedure Cursor (Element : in out Element_Type;
Value : in String);
function Cursor (Element : Element_Type) return String;
-- Sets the cursor to a standard type or an image
-- if set to url(url_to_image). When using a url is best
-- to suggest an alternate cursor, e.g. "url(url_to_image),auto"
-- A list of standard cursor types can be found at:
-- http://www.w3schools.com/cssref/pr_class_cursor.asp
-- Text --
type Font_Style_Type is (Normal, Italic, Oblique);
type Font_Weight_Type is (Weight_Normal, Weight_Bold,
Weight_Bolder, Weight_Lighter,
Weight_100, Weight_200, Weight_300,
Weight_400, Weight_500, Weight_600,
Weight_700, Weight_800, Weight_900);
function Image (Value : in Gnoga.Gui.Element.Font_Weight_Type) return String;
function Value (Value : in String) return Gnoga.Gui.Element.Font_Weight_Type;
type Font_Variant_Type is (Normal, Small_Caps);
type System_Font_Type is (Caption, Icon, Menu, Message_Box, Small_Caption,
Status_Bar);
procedure Font (Element : in out Element_Type;
Family : in String := "sans-serif";
Height : in String := "medium";
Style : in Font_Style_Type := Normal;
Weight : in Font_Weight_Type := Weight_Normal;
Variant : in Font_Variant_Type := Normal);
procedure Font (Element : in out Element_Type;
System_Font : in System_Font_Type);
-- Sets or returns the current font properties for text content
type Alignment_Type is (Left, Right, Center, At_Start, To_End);
procedure Text_Alignment (Element : in out Element_Type;
Value : in Alignment_Type);
-- Text Alignment, At_Start = Left, and To_End = Right in ltr languages
-- in rtl languages At_Start = Right, and To_End = Left.
-- Framework Properties --
procedure Auto_Place (Element : in out Element_Type; Value : Boolean);
function Auto_Place (Element : Element_Type) return Boolean;
-- Elements by default are created outside the DOM and therefore not
-- visible. If Auto_Place is set to false _before_ Create is called on
-- an Element, View's will not place the Element in to the DOM as is
-- the View's default behavior. Custom widgets that have child widgets
-- should be designed to respect this property. Auto_Place if set to
-- False will also prevent Auto_Set_View if Element's Parent is a Window
-- General Access to Element --
procedure Style (Element : in out Element_Type;
Name : in String;
Value : in String);
procedure Style (Element : in out Element_Type;
Name : in String;
Value : in Integer);
function Style (Element : Element_Type; Name : String) return String;
function Style (Element : Element_Type; Name : String) return Integer;
-- General access to style Name
procedure Attribute (Element : in out Element_Type;
Name : in String;
Value : in String);
function Attribute (Element : Element_Type; Name : String) return String;
-- General access to attribute Name
-- Traversal Properties --
procedure First_Child (Element : in out Element_Type;
Child : in out Element_Type'Class);
-- If Child does not have an html id than Element_Type will have an
-- ID of undefined and therefore attached to no actual HTML element.
procedure Next_Sibling (Element : in out Element_Type;
Sibling : in out Element_Type'Class);
-- If Sibling does not have an html id than Element_Type will have an
-- ID of undefined and therefore attached to no actual HTML element.
-- Internal Properties --
function HTML_Tag (Element : Element_Type) return String;
-------------------------------------------------------------------------
-- Element_Type - Methods
-------------------------------------------------------------------------
-- Element Methods --
procedure Click (Element : in out Element_Type);
-- Simulate click on element
procedure Add_Class (Element : in out Element_Type; Class_Name : in String);
-- Adds one or more Class_Name(s) to Element
procedure Remove_Class (Element : in out Element_Type;
Class_Name : in String);
-- Removes one or more Class_Name(s) to Element
procedure Toggle_Class (Element : in out Element_Type;
Class_Name : in String);
-- Toggles on and off one or more Class_Name(s) to Element
-- DOM Placement Methods --
procedure Place_Inside_Top_Of (Element : in out Element_Type;
Target : in out Element_Type'Class);
procedure Place_Inside_Bottom_Of (Element : in out Element_Type;
Target : in out Element_Type'Class);
procedure Place_Before (Element : in out Element_Type;
Target : in out Element_Type'Class);
procedure Place_After (Element : in out Element_Type;
Target : in out Element_Type'Class);
procedure Remove (Element : in out Element_Type);
-- Removes an element from the DOM, if the ID_Type is DOM_ID, the ID
-- will be changed to a unique Gnoga_ID before removal.
private
type Element_Type is new Gnoga.Gui.Base_Type with
record
Auto_Place : Boolean := True;
end record;
end Ada_GUI.Gnoga.Gui.Element;
| 47.040222 | 103 | 0.590754 |
1c346c9eaa9f0c0bcc66821cb2e26e2c1ffd0de9 | 127 | ada | Ada | Task/Bitmap-B-zier-curves-Quadratic/Ada/bitmap-b-zier-curves-quadratic-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Bitmap-B-zier-curves-Quadratic/Ada/bitmap-b-zier-curves-quadratic-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Bitmap-B-zier-curves-Quadratic/Ada/bitmap-b-zier-curves-quadratic-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | X : Image (1..16, 1..16);
begin
Fill (X, White);
Quadratic_Bezier (X, (8, 2), (13, 8), (2, 15), Black);
Print (X);
| 21.166667 | 57 | 0.496063 |
39c6c988181343f076994783472b679f378dbff4 | 8,216 | adb | Ada | regtests/util-files-tests.adb | Letractively/ada-util | e4c63b93635dc07c46e95f12ba02d18903b307b3 | [
"Apache-2.0"
] | null | null | null | regtests/util-files-tests.adb | Letractively/ada-util | e4c63b93635dc07c46e95f12ba02d18903b307b3 | [
"Apache-2.0"
] | null | null | null | regtests/util-files-tests.adb | Letractively/ada-util | e4c63b93635dc07c46e95f12ba02d18903b307b3 | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- files.tests -- Unit tests for files
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Directories;
with Util.Test_Caller;
package body Util.Files.Tests is
use Util.Tests;
package Caller is new Util.Test_Caller (Test, "Files");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Util.Files.Read_File",
Test_Read_File'Access);
Caller.Add_Test (Suite, "Test Util.Files.Read_File (missing)",
Test_Read_File_Missing'Access);
Caller.Add_Test (Suite, "Test Util.Files.Read_File (truncate)",
Test_Read_File'Access);
Caller.Add_Test (Suite, "Test Util.Files.Write_File",
Test_Write_File'Access);
Caller.Add_Test (Suite, "Test Util.Files.Iterate_Path",
Test_Iterate_Path'Access);
Caller.Add_Test (Suite, "Test Util.Files.Find_File_Path",
Test_Find_File_Path'Access);
Caller.Add_Test (Suite, "Test Util.Files.Compose_Path",
Test_Compose_Path'Access);
Caller.Add_Test (Suite, "Test Util.Files.Get_Relative_Path",
Test_Get_Relative_Path'Access);
end Add_Tests;
-- ------------------------------
-- Test reading a file into a string
-- Reads this ada source file and checks we have read it correctly
-- ------------------------------
procedure Test_Read_File (T : in out Test) is
Result : Unbounded_String;
begin
Read_File (Path => "regtests/util-files-tests.adb", Into => Result);
T.Assert (Index (Result, "Util.Files.Tests") > 0,
"Content returned by Read_File is not correct");
T.Assert (Index (Result, "end Util.Files.Tests;") > 0,
"Content returned by Read_File is not correct");
end Test_Read_File;
procedure Test_Read_File_Missing (T : in out Test) is
Result : Unbounded_String;
pragma Unreferenced (Result);
begin
Read_File (Path => "regtests/files-test--util.adb", Into => Result);
T.Assert (False, "No exception raised");
exception
when others =>
null;
end Test_Read_File_Missing;
procedure Test_Read_File_Truncate (T : in out Test) is
Result : Unbounded_String;
begin
Read_File (Path => "regtests/util-files-tests.adb", Into => Result,
Max_Size => 50);
Assert_Equals (T, Length (Result), 50,
"Read_File did not truncate correctly");
T.Assert (Index (Result, "Apache License") > 0,
"Content returned by Read_File is not correct");
end Test_Read_File_Truncate;
-- ------------------------------
-- Check writing a file
-- ------------------------------
procedure Test_Write_File (T : in out Test) is
Path : constant String := Util.Tests.Get_Test_Path ("test-write.txt");
Content : constant String := "Testing Util.Files.Write_File" & ASCII.LF;
Result : Unbounded_String;
begin
Write_File (Path => Path, Content => Content);
Read_File (Path => Path, Into => Result);
Assert_Equals (T, To_String (Result), Content,
"Invalid content written or read");
end Test_Write_File;
-- ------------------------------
-- Check Find_File_Path
-- ------------------------------
procedure Test_Find_File_Path (T : in out Test) is
Dir : constant String := Util.Tests.Get_Path ("regtests");
Paths : constant String := ".;" & Dir;
begin
declare
P : constant String := Util.Files.Find_File_Path ("test.properties", Paths);
begin
Assert_Equals (T, Dir & "/test.properties", P,
"Invalid path returned");
end;
Assert_Equals (T, "blablabla.properties",
Util.Files.Find_File_Path ("blablabla.properties", Paths));
end Test_Find_File_Path;
-- ------------------------------
-- Check Iterate_Path
-- ------------------------------
procedure Test_Iterate_Path (T : in out Test) is
procedure Check_Path (Dir : in String;
Done : out Boolean);
Last : Unbounded_String;
procedure Check_Path (Dir : in String;
Done : out Boolean) is
begin
if Dir = "a" or Dir = "bc" or Dir = "de" then
Done := False;
else
Done := True;
end if;
Last := To_Unbounded_String (Dir);
end Check_Path;
begin
Iterate_Path ("a;bc;de;f", Check_Path'Access);
Assert_Equals (T, "f", Last, "Invalid last path");
Iterate_Path ("de;bc;de;b", Check_Path'Access);
Assert_Equals (T, "b", Last, "Invalid last path");
Iterate_Path ("de;bc;de;a", Check_Path'Access, Ada.Strings.Backward);
Assert_Equals (T, "de", Last, "Invalid last path");
end Test_Iterate_Path;
-- ------------------------------
-- Test the Compose_Path operation
-- ------------------------------
procedure Test_Compose_Path (T : in out Test) is
begin
Assert_Equals (T, "src/os-none",
Compose_Path ("src;regtests", "os-none"),
"Invalid path composition");
Assert_Equals (T, "regtests/bundles",
Compose_Path ("src;regtests", "bundles"),
"Invalid path composition");
if Ada.Directories.Exists ("/usr/bin") then
Assert_Equals (T, "/usr/bin;/usr/local/bin;/usr/bin",
Compose_Path ("/usr;/usr/local;/usr", "bin"),
"Invalid path composition");
end if;
end Test_Compose_Path;
-- ------------------------------
-- Test the Get_Relative_Path operation.
-- ------------------------------
procedure Test_Get_Relative_Path (T : in out Test) is
begin
Assert_Equals (T, "../util",
Get_Relative_Path ("/home/john/src/asf", "/home/john/src/util"),
"Invalid relative path");
Assert_Equals (T, "../util",
Get_Relative_Path ("/home/john/src/asf/", "/home/john/src/util"),
"Invalid relative path");
Assert_Equals (T, "../util/b",
Get_Relative_Path ("/home/john/src/asf", "/home/john/src/util/b"),
"Invalid relative path");
Assert_Equals (T, "../as",
Get_Relative_Path ("/home/john/src/asf", "/home/john/src/as"),
"Invalid relative path");
Assert_Equals (T, "../../",
Get_Relative_Path ("/home/john/src/asf", "/home/john"),
"Invalid relative path");
Assert_Equals (T, "/usr/share/admin",
Get_Relative_Path ("/home/john/src/asf", "/usr/share/admin"),
"Invalid absolute path");
Assert_Equals (T, "/home/john",
Get_Relative_Path ("home/john/src/asf", "/home/john"),
"Invalid relative path");
Assert_Equals (T, "e",
Get_Relative_Path ("/home/john/src/asf", "/home/john/src/asf/e"),
"Invalid relative path");
Assert_Equals (T, ".",
Get_Relative_Path ("/home/john/src/asf", "/home/john/src/asf/"),
"Invalid relative path");
end Test_Get_Relative_Path;
end Util.Files.Tests;
| 41.08 | 87 | 0.552215 |
1caf2110d83fd20e1fffd37cc2b1be310fffef26 | 2,022 | ads | Ada | interfaces-c-strings.ads | mgrojo/adalib | dc1355a5b65c2843e702ac76252addb2caf3c56b | [
"BSD-3-Clause"
] | 15 | 2018-07-08T07:09:19.000Z | 2021-11-21T09:58:55.000Z | interfaces-c-strings.ads | mgrojo/adalib | dc1355a5b65c2843e702ac76252addb2caf3c56b | [
"BSD-3-Clause"
] | 4 | 2019-11-17T20:04:33.000Z | 2021-08-29T21:24:55.000Z | interfaces-c-strings.ads | mgrojo/adalib | dc1355a5b65c2843e702ac76252addb2caf3c56b | [
"BSD-3-Clause"
] | 3 | 2020-04-23T11:17:11.000Z | 2021-08-29T19:31:09.000Z | -- 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
---------------------------------------------------------------------------
package Interfaces.C.Strings is
pragma Preelaborate (Strings);
type char_array_access is access all char_array;
type chars_ptr is private;
pragma Preelaborable_Initialization (chars_ptr);
type chars_ptr_array is array (size_t range <>) of aliased chars_ptr;
Null_Ptr : constant chars_ptr;
function To_Chars_Ptr (Item : in char_array_access;
Nul_Check : in Boolean := False)
return chars_ptr;
function New_Char_Array (Chars : in char_array) return chars_ptr;
function New_String (Str : in String) return chars_ptr;
procedure Free (Item : in out chars_ptr);
Dereference_Error : exception;
function Value (Item : in chars_ptr) return char_array;
function Value (Item : in chars_ptr; Length : in size_t)
return char_array;
function Value (Item : in chars_ptr) return String;
function Value (Item : in chars_ptr; Length : in size_t)
return String;
function Strlen (Item : in chars_ptr) return size_t;
procedure Update (Item : in chars_ptr;
Offset : in size_t;
Chars : in char_array;
Check : in Boolean := True);
procedure Update (Item : in chars_ptr;
Offset : in size_t;
Str : in String;
Check : in Boolean := True);
Update_Error : exception;
private
pragma Import (Ada, chars_ptr);
pragma Import (Ada, Null_Ptr);
end Interfaces.C.Strings;
| 31.107692 | 75 | 0.612265 |
39a3ba3707a851b8a5d487dcc1e51bc199aa77d1 | 1,152 | ads | Ada | examples/listeners.ads | reznikmm/network | d94878500ab8d87310eef5b9c88784e1eb53ba38 | [
"MIT"
] | 1 | 2021-01-14T20:52:45.000Z | 2021-01-14T20:52:45.000Z | examples/listeners.ads | reznikmm/network | d94878500ab8d87310eef5b9c88784e1eb53ba38 | [
"MIT"
] | null | null | null | examples/listeners.ads | reznikmm/network | d94878500ab8d87310eef5b9c88784e1eb53ba38 | [
"MIT"
] | null | null | null | -- Copyright (c) 2021 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Ada.Streams.Stream_IO;
with League.Strings;
with Network.Connection_Promises;
with Network.Connections;
with Network.Streams;
package Listeners is
type Listener is limited new Network.Connection_Promises.Listener
and Network.Connections.Listener
with record
Promise : Network.Connection_Promises.Promise;
Remote : Network.Connections.Connection_Access;
Output : Ada.Streams.Stream_IO.File_Type;
Done : Boolean := False;
end record;
overriding procedure On_Resolve
(Self : in out Listener;
Value : Network.Connections.Connection_Access);
overriding procedure On_Reject
(Self : in out Listener;
Value : League.Strings.Universal_String);
overriding procedure Closed
(Self : in out Listener;
Error : League.Strings.Universal_String);
overriding procedure Can_Write (Self : in out Listener);
overriding procedure Can_Read (Self : in out Listener);
end Listeners;
| 27.428571 | 68 | 0.689236 |
398fb01f4b638a67986da8af28023e97ff2630f2 | 782 | ads | Ada | src/interface/yaml-stream_concept.ads | robdaemon/AdaYaml | 2cb52c5e7eee3a2d9951945d5ddb4eeddc088f6e | [
"MIT"
] | 32 | 2017-08-02T16:45:34.000Z | 2021-08-18T20:12:57.000Z | src/interface/yaml-stream_concept.ads | robdaemon/AdaYaml | 2cb52c5e7eee3a2d9951945d5ddb4eeddc088f6e | [
"MIT"
] | 15 | 2017-09-13T09:43:38.000Z | 2022-01-20T23:21:47.000Z | src/interface/yaml-stream_concept.ads | robdaemon/AdaYaml | 2cb52c5e7eee3a2d9951945d5ddb4eeddc088f6e | [
"MIT"
] | 5 | 2017-09-19T16:54:22.000Z | 2020-04-09T07:17:02.000Z | -- part of AdaYaml, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
generic
type Instance is limited new Refcount_Base with private;
type Reference is tagged private;
type Accessor (Data : not null access Instance) is limited private;
with function Value (Object : Reference) return Accessor;
with function Next (Object : in out Instance) return Event;
package Yaml.Stream_Concept is
pragma Warnings (Off, Next);
pragma Warnings (Off, Value);
-- to not burden ourselves with too much dynamic dispatching, we define a
-- Stream as anything that is able to instantiate this package. any consumer
-- of a stream shall take as generic parameter an instance of this package.
end Yaml.Stream_Concept;
| 41.157895 | 80 | 0.744246 |
10936dccb6bf7ef18f7b366ba3997727030d8766 | 2,983 | ads | Ada | tools/scitools/conf/understand/ada/ada12/s-pack55.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/conf/understand/ada/ada12/s-pack55.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | tools/scitools/conf/understand/ada/ada12/s-pack55.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 5 5 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2009, 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. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 55
package System.Pack_55 is
pragma Preelaborate;
Bits : constant := 55;
type Bits_55 is mod 2 ** Bits;
for Bits_55'Size use Bits;
function Get_55 (Arr : System.Address; N : Natural) return Bits_55;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_55 (Arr : System.Address; N : Natural; E : Bits_55);
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is set to the given value.
end System.Pack_55;
| 58.490196 | 78 | 0.376802 |
39fe932822664ba06b85197c84dddf4560a2fd3d | 15,835 | ads | Ada | thirdparty/adasdl/thin/adasdl/AdaGL/GL_w32/adagl.ads | Lucretia/old_nehe_ada95 | d0378c3bfce202eb01bf00b57c128735dbe8582d | [
"BSD-3-Clause"
] | null | null | null | thirdparty/adasdl/thin/adasdl/AdaGL/GL_w32/adagl.ads | Lucretia/old_nehe_ada95 | d0378c3bfce202eb01bf00b57c128735dbe8582d | [
"BSD-3-Clause"
] | null | null | null | thirdparty/adasdl/thin/adasdl/AdaGL/GL_w32/adagl.ads | Lucretia/old_nehe_ada95 | d0378c3bfce202eb01bf00b57c128735dbe8582d | [
"BSD-3-Clause"
] | null | null | null |
-- ---------------------------------------------------------------- --
-- This file contains some improvements to the gl Ada binding --
-- in order to allow a better programming style. --
-- The prototypes below follow the Implementation advice from --
-- ARM Annex B (B.3). --
-- ---------------------------------------------------------------- --
-- ----------------------------------------------------------------- --
-- Copyright (C) 2001 A.M.F.Vargas --
-- Antonio M. F. Vargas --
-- Ponta Delgada - Azores - Portugal --
-- http://www.adapower.net/~avargas --
-- E-mail: [email protected] --
-- ----------------------------------------------------------------- --
-- --
-- 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. --
-- ----------------------------------------------------------------- --
with gl_h; use gl_h;
package AdaGL is
function glGetString (Chars_Ref : GLenum) return String;
type Three_GLfloat_Vector is array (0 .. 2) of GLfloat;
pragma Convention (C, Three_GLFloat_Vector);
type Four_GLfloat_Vector is array (0 .. 3) of GLfloat;
pragma Convention (C, Four_GLFloat_Vector);
type Three_GLint_Vector is array (0 .. 2) of GLint;
pragma Convention (C, Three_GLint_Vector);
type Four_GLint_Vector is array (0 .. 3) of GLint;
pragma Convention (C, Four_GLint_Vector);
procedure glVertex3fv (v : Three_GLFloat_Vector);
pragma Import (Stdcall, glVertex3fv, "glVertex3fv");
procedure glColor3fv (v : Three_GLFloat_Vector);
pragma Import (Stdcall, glColor3fv, "glColor3fv");
-- To be used with pname receiving one of:
-- GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION
procedure glLightfv (light : GLenum;
pname : GLenum;
params : Three_GLFloat_Vector);
-- To be used with pname receiving GL_SPOT_DIRECTION:
procedure glLightfv (light : GLenum;
pname : GLenum;
params : Four_GLFloat_Vector);
-- To be used with pname receiving:
-- GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION,
-- GL_LINEAR_ATTENUATION, GL_QUADRATIC_ATTENUATION
procedure glLightfv (light : GLenum;
pname : GLenum;
params : in out GLFloat); -- pseudo in
pragma Import (Stdcall, glLightfv, "glLightfv");
-- To be used with pname receiving one of:
-- GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION
procedure glLightiv (light : GLenum;
pname : GLenum;
params : Three_GLint_Vector);
-- To be used with pname receiving GL_SPOT_DIRECTION:
procedure glLightiv (light : GLenum;
pname : GLenum;
params : Four_GLint_Vector);
-- To be used with pname receiving:
-- GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION,
-- GL_LINEAR_ATTENUATION, GL_QUADRATIC_ATTENUATION
procedure glLightiv (light : GLenum;
pname : GLenum;
params : in out GLint); -- pseudo in
pragma Import (Stdcall, glLightiv, "glLightiv");
-- To be used with pname receiving:
-- GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION
-- GL_AMBIENT_AND_DIFFUSE
procedure glMaterialfv (face : GLenum;
pname : GLenum;
params : Four_GLfloat_Vector);
-- To be used with pname receiving:
-- GL_COLOR_INDEXES
procedure glMaterialfv (face : GLenum;
pname : GLenum;
params : Three_GLfloat_Vector);
-- To be used with pname receiving:
-- GL_SHININESS
procedure glMaterialfv (face : GLenum;
pname : GLenum;
params : in out GLfloat); -- pseudo in
pragma Import (Stdcall, glMaterialfv, "glMaterialfv");
-- To be used with pname receiving:
-- GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION
-- GL_AMBIENT_AND_DIFFUSE
procedure glMaterialiv (face : GLenum;
pname : GLenum;
params : Four_GLint_Vector);
-- To be used with pname receiving:
-- GL_COLOR_INDEXES
procedure glMaterialiv (face : GLenum;
pname : GLenum;
params : Three_GLint_Vector);
-- To be used with pname receiving:
-- GL_SHININESS
procedure glMaterialiv (face : GLenum;
pname : GLenum;
params : in out GLint); -- pseudo in
pragma Import (Stdcall, glMaterialiv, "glMaterialiv");
type GLubyte_Array is array (Integer range <>) of GLubyte;
-- type_Id = GL_UNSIGNED_BYTE
procedure glTexImage1D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLubyte_Array);
type GLbyte_Array is array (Integer range <>) of GLbyte;
-- type_Id = GL_BYTE
procedure glTexImage1D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLbyte_Array);
type GLushort_Array is array (Integer range <>) of GLushort;
-- type_Id = GL_UNSIGNED_SHORT
procedure glTexImage1D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLushort_Array);
type GLshort_Array is array (Integer range <>) of GLshort;
-- type_Id = GL_SHORT
procedure glTexImage1D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLshort_Array);
type GLuint_Array is array (Integer range <>) of GLuint;
-- type_Id = GL_UNSIGNED_INT
procedure glTexImage1D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLuint_Array);
type GLint_Array is array (Integer range <>) of GLint;
-- type_Id = GL_INT;
procedure glTexImage1D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLint_Array);
type GLfloat_Array is array (Integer range <>) of GLfloat;
-- type_Id = GL_FLOAT
procedure glTexImage1D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLfloat_Array);
pragma Import (Stdcall, glTexImage1D, "glTexImage1D");
-- type_Id = GL_UNSIGNED_BYTE
procedure glTexImage2D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
height : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLubyte_Array);
-- type_Id = GL_BYTE
procedure glTexImage2D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
height : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLbyte_Array);
-- type_Id = GL_UNSIGNED_SHORT
procedure glTexImage2D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
height : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLushort_Array);
-- type_Id = GL_SHORT
procedure glTexImage2D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
height : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLshort_Array);
-- type_Id = GL_UNSIGNED_INT
procedure glTexImage2D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
height : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLuint_Array);
-- type_Id = GL_INT
procedure glTexImage2D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
height : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLint_Array);
-- type_Id = GL_FLOAT
procedure glTexImage2D (target : GLenum;
level : GLint;
internalFormat : GLint;
width : GLsizei;
height : GLsizei;
border : GLint;
format : GLenum;
type_Id : GLenum;
pixels : GLfloat_Array);
pragma Import (Stdcall, glTexImage2D, "glTexImage2D");
-- type_Id = GL_UNSIGNED_BYTE
procedure glDrawPixels (width : GLsizei;
height : GLsizei;
format : GLenum;
type_Id : GLenum;
pixels : GLubyte_Array);
-- type_Id = GL_BYTE
procedure glDrawPixels (width : GLsizei;
height : GLsizei;
format : GLenum;
type_Id : GLenum;
pixels : GLbyte_Array);
-- type_Id = GL_UNSIGNED_SHORT
procedure glDrawPixels (width : GLsizei;
height : GLsizei;
format : GLenum;
type_Id : GLenum;
pixels : GLushort_Array);
-- type_Id = GL_SHORT
procedure glDrawPixels (width : GLsizei;
height : GLsizei;
format : GLenum;
type_Id : GLenum;
pixels : GLshort_Array);
-- type_Id = GL_UNSIGNED_INT
procedure glDrawPixels (width : GLsizei;
height : GLsizei;
format : GLenum;
type_Id : GLenum;
pixels : GLuint_Array);
-- type_Id = GL_INT
procedure glDrawPixels (width : GLsizei;
height : GLsizei;
format : GLenum;
type_Id : GLenum;
pixels : GLint_Array);
-- type_Id = GL_FLOAT
procedure glDrawPixels (width : GLsizei;
height : GLsizei;
format : GLenum;
type_Id : GLenum;
pixels : GLfloat_Array);
pragma Import (Stdcall, glDrawPixels, "glDrawPixels");
end AdaGL;
| 43.502747 | 71 | 0.426524 |
1c817ea8a24621daad71b96a403c93a9d9d485c4 | 27,040 | adb | Ada | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-tifiio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-tifiio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-tifiio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T E X T _ I O . F I X E D _ I O --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, 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. --
-- --
------------------------------------------------------------------------------
-- Fixed point I/O
-- ---------------
-- The following documents implementation details of the fixed point
-- input/output routines in the GNAT run time. The first part describes
-- general properties of fixed point types as defined by the Ada 95 standard,
-- including the Information Systems Annex.
-- Subsequently these are reduced to implementation constraints and the impact
-- of these constraints on a few possible approaches to I/O are given.
-- Based on this analysis, a specific implementation is selected for use in
-- the GNAT run time. Finally, the chosen algorithm is analyzed numerically in
-- order to provide user-level documentation on limits for range and precision
-- of fixed point types as well as accuracy of input/output conversions.
-- -------------------------------------------
-- - General Properties of Fixed Point Types -
-- -------------------------------------------
-- Operations on fixed point values, other than input and output, are not
-- important for the purposes of this document. Only the set of values that a
-- fixed point type can represent and the input and output operations are
-- significant.
-- Values
-- ------
-- Set set of values of a fixed point type comprise the integral
-- multiples of a number called the small of the type. The small can
-- either be a power of ten, a power of two or (if the implementation
-- allows) an arbitrary strictly positive real value.
-- Implementations need to support fixed-point types with a precision
-- of at least 24 bits, and (in order to comply with the Information
-- Systems Annex) decimal types need to support at least digits 18.
-- For the rest, however, no requirements exist for the minimal small
-- and range that need to be supported.
-- Operations
-- ----------
-- 'Image and 'Wide_Image (see RM 3.5(34))
-- These attributes return a decimal real literal best approximating
-- the value (rounded away from zero if halfway between) with a
-- single leading character that is either a minus sign or a space,
-- one or more digits before the decimal point (with no redundant
-- leading zeros), a decimal point, and N digits after the decimal
-- point. For a subtype S, the value of N is S'Aft, the smallest
-- positive integer such that (10**N)*S'Delta is greater or equal to
-- one, see RM 3.5.10(5).
-- For an arbitrary small, this means large number arithmetic needs
-- to be performed.
-- Put (see RM A.10.9(22-26))
-- The requirements for Put add no extra constraints over the image
-- attributes, although it would be nice to be able to output more
-- than S'Aft digits after the decimal point for values of subtype S.
-- 'Value and 'Wide_Value attribute (RM 3.5(40-55))
-- Since the input can be given in any base in the range 2..16,
-- accurate conversion to a fixed point number may require
-- arbitrary precision arithmetic if there is no limit on the
-- magnitude of the small of the fixed point type.
-- Get (see RM A.10.9(12-21))
-- The requirements for Get are identical to those of the Value
-- attribute.
-- ------------------------------
-- - Implementation Constraints -
-- ------------------------------
-- The requirements listed above for the input/output operations lead to
-- significant complexity, if no constraints are put on supported smalls.
-- Implementation Strategies
-- -------------------------
-- * Float arithmetic
-- * Arbitrary-precision integer arithmetic
-- * Fixed-precision integer arithmetic
-- Although it seems convenient to convert fixed point numbers to floating-
-- point and then print them, this leads to a number of restrictions.
-- The first one is precision. The widest floating-point type generally
-- available has 53 bits of mantissa. This means that Fine_Delta cannot
-- be less than 2.0**(-53).
-- In GNAT, Fine_Delta is 2.0**(-63), and Duration for example is a
-- 64-bit type. It would still be possible to use multi-precision
-- floating-point to perform calculations using longer mantissas,
-- but this is a much harder approach.
-- The base conversions needed for input and output of (non-decimal)
-- fixed point types can be seen as pairs of integer multiplications
-- and divisions.
-- Arbitrary-precision integer arithmetic would be suitable for the job
-- at hand, but has the draw-back that it is very heavy implementation-wise.
-- Especially in embedded systems, where fixed point types are often used,
-- it may not be desirable to require large amounts of storage and time
-- for fixed I/O operations.
-- Fixed-precision integer arithmetic has the advantage of simplicity and
-- speed. For the most common fixed point types this would be a perfect
-- solution. The downside however may be a too limited set of acceptable
-- fixed point types.
-- Extra Precision
-- ---------------
-- Using a scaled divide which truncates and returns a remainder R,
-- another E trailing digits can be calculated by computing the value
-- (R * (10.0**E)) / Z using another scaled divide. This procedure
-- can be repeated to compute an arbitrary number of digits in linear
-- time and storage. The last scaled divide should be rounded, with
-- a possible carry propagating to the more significant digits, to
-- ensure correct rounding of the unit in the last place.
-- An extension of this technique is to limit the value of Q to 9 decimal
-- digits, since 32-bit integers can be much more efficient than 64-bit
-- integers to output.
with Interfaces; use Interfaces;
with System.Arith_64; use System.Arith_64;
with System.Img_Real; use System.Img_Real;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Text_IO.Float_Aux;
with Ada.Text_IO.Generic_Aux;
package body Ada.Text_IO.Fixed_IO is
-- Note: we still use the floating-point I/O routines for input of
-- ordinary fixed-point and output using exponent format. This will
-- result in inaccuracies for fixed point types with a small that is
-- not a power of two, and for types that require more precision than
-- is available in Long_Long_Float.
package Aux renames Ada.Text_IO.Float_Aux;
Extra_Layout_Space : constant Field := 5 + Num'Fore;
-- Extra space that may be needed for output of sign, decimal point,
-- exponent indication and mandatory decimals after and before the
-- decimal point. A string with length
-- Fore + Aft + Exp + Extra_Layout_Space
-- is always long enough for formatting any fixed point number
-- Implementation of Put routines
-- The following section describes a specific implementation choice for
-- performing base conversions needed for output of values of a fixed
-- point type T with small T'Small. The goal is to be able to output
-- all values of types with a precision of 64 bits and a delta of at
-- least 2.0**(-63), as these are current GNAT limitations already.
-- The chosen algorithm uses fixed precision integer arithmetic for
-- reasons of simplicity and efficiency. It is important to understand
-- in what ways the most simple and accurate approach to fixed point I/O
-- is limiting, before considering more complicated schemes.
-- Without loss of generality assume T has a range (-2.0**63) * T'Small
-- .. (2.0**63 - 1) * T'Small, and is output with Aft digits after the
-- decimal point and T'Fore - 1 before. If T'Small is integer, or
-- 1.0 / T'Small is integer, let S = T'Small and E = 0. For other T'Small,
-- let S and E be integers such that S / 10**E best approximates T'Small
-- and S is in the range 10**17 .. 10**18 - 1. The extra decimal scaling
-- factor 10**E can be trivially handled during final output, by adjusting
-- the decimal point or exponent.
-- Convert a value X * S of type T to a 64-bit integer value Q equal
-- to 10.0**D * (X * S) rounded to the nearest integer.
-- This conversion is a scaled integer divide of the form
-- Q := (X * Y) / Z,
-- where all variables are 64-bit signed integers using 2's complement,
-- and both the multiplication and division are done using full
-- intermediate precision. The final decimal value to be output is
-- Q * 10**(E-D)
-- This value can be written to the output file or to the result string
-- according to the format described in RM A.3.10. The details of this
-- operation are omitted here.
-- A 64-bit value can contain all integers with 18 decimal digits, but
-- not all with 19 decimal digits. If the total number of requested output
-- digits (Fore - 1) + Aft is greater than 18, for purposes of the
-- conversion Aft is adjusted to 18 - (Fore - 1). In that case, or
-- when Fore > 19, trailing zeros can complete the output after writing
-- the first 18 significant digits, or the technique described in the
-- next section can be used.
-- The final expression for D is
-- D := Integer'Max (-18, Integer'Min (Aft, 18 - (Fore - 1)));
-- For Y and Z the following expressions can be derived:
-- Q / (10.0**D) = X * S
-- Q = X * S * (10.0**D) = (X * Y) / Z
-- S * 10.0**D = Y / Z;
-- If S is an integer greater than or equal to one, then Fore must be at
-- least 20 in order to print T'First, which is at most -2.0**63.
-- This means D < 0, so use
-- (1) Y = -S and Z = -10**(-D)
-- If 1.0 / S is an integer greater than one, use
-- (2) Y = -10**D and Z = -(1.0 / S), for D >= 0
-- or
-- (3) Y = 1 and Z = (1.0 / S) * 10**(-D), for D < 0
-- Negative values are used for nominator Y and denominator Z, so that S
-- can have a maximum value of 2.0**63 and a minimum of 2.0**(-63).
-- For Z in -1 .. -9, Fore will still be 20, and D will be negative, as
-- (-2.0**63) / -9 is greater than 10**18. In these cases there is room
-- in the denominator for the extra decimal scaling required, so case (3)
-- will not overflow.
pragma Assert (System.Fine_Delta >= 2.0**(-63));
pragma Assert (Num'Small in 2.0**(-63) .. 2.0**63);
pragma Assert (Num'Fore <= 37);
-- These assertions need to be relaxed to allow for a Small of
-- 2.0**(-64) at least, since there is an ACATS test for this ???
Max_Digits : constant := 18;
-- Maximum number of decimal digits that can be represented in a
-- 64-bit signed number, see above
-- The constants E0 .. E5 implement a binary search for the appropriate
-- power of ten to scale the small so that it has one digit before the
-- decimal point.
subtype Int is Integer;
E0 : constant Int := -(20 * Boolean'Pos (Num'Small >= 1.0E1));
E1 : constant Int := E0 + 10 * Boolean'Pos (Num'Small * 10.0**E0 < 1.0E-10);
E2 : constant Int := E1 + 5 * Boolean'Pos (Num'Small * 10.0**E1 < 1.0E-5);
E3 : constant Int := E2 + 3 * Boolean'Pos (Num'Small * 10.0**E2 < 1.0E-3);
E4 : constant Int := E3 + 2 * Boolean'Pos (Num'Small * 10.0**E3 < 1.0E-1);
E5 : constant Int := E4 + 1 * Boolean'Pos (Num'Small * 10.0**E4 < 1.0E-0);
Scale : constant Integer := E5;
pragma Assert (Num'Small * 10.0**Scale >= 1.0
and then Num'Small * 10.0**Scale < 10.0);
Exact : constant Boolean :=
Float'Floor (Num'Small) = Float'Ceiling (Num'Small)
or else Float'Floor (1.0 / Num'Small) = Float'Ceiling (1.0 / Num'Small)
or else Num'Small >= 10.0**Max_Digits;
-- True iff a numerator and denominator can be calculated such that
-- their ratio exactly represents the small of Num.
procedure Put
(To : out String;
Last : out Natural;
Item : Num;
Fore : Integer;
Aft : Field;
Exp : Field);
-- Actual output function, used internally by all other Put routines.
-- The formal Fore is an Integer, not a Field, because the routine is
-- also called from the version of Put that performs I/O to a string,
-- where the starting position depends on the size of the String, and
-- bears no relation to the bounds of Field.
---------
-- Get --
---------
procedure Get
(File : File_Type;
Item : out Num;
Width : Field := 0)
is
pragma Unsuppress (Range_Check);
begin
Aux.Get (File, Long_Long_Float (Item), Width);
exception
when Constraint_Error => raise Data_Error;
end Get;
procedure Get
(Item : out Num;
Width : Field := 0)
is
pragma Unsuppress (Range_Check);
begin
Aux.Get (Current_In, Long_Long_Float (Item), Width);
exception
when Constraint_Error => raise Data_Error;
end Get;
procedure Get
(From : String;
Item : out Num;
Last : out Positive)
is
pragma Unsuppress (Range_Check);
begin
Aux.Gets (From, Long_Long_Float (Item), Last);
exception
when Constraint_Error => raise Data_Error;
end Get;
---------
-- Put --
---------
procedure Put
(File : File_Type;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
S : String (1 .. Fore + Aft + Exp + Extra_Layout_Space);
Last : Natural;
begin
Put (S, Last, Item, Fore, Aft, Exp);
Generic_Aux.Put_Item (File, S (1 .. Last));
end Put;
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
S : String (1 .. Fore + Aft + Exp + Extra_Layout_Space);
Last : Natural;
begin
Put (S, Last, Item, Fore, Aft, Exp);
Generic_Aux.Put_Item (Text_IO.Current_Out, S (1 .. Last));
end Put;
procedure Put
(To : out String;
Item : Num;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
Fore : constant Integer :=
To'Length
- 1 -- Decimal point
- Field'Max (1, Aft) -- Decimal part
- Boolean'Pos (Exp /= 0) -- Exponent indicator
- Exp; -- Exponent
Last : Natural;
begin
if Fore - Boolean'Pos (Item < 0.0) < 1 then
raise Layout_Error;
end if;
Put (To, Last, Item, Fore, Aft, Exp);
if Last /= To'Last then
raise Layout_Error;
end if;
end Put;
procedure Put
(To : out String;
Last : out Natural;
Item : Num;
Fore : Integer;
Aft : Field;
Exp : Field)
is
subtype Digit is Int64 range 0 .. 9;
X : constant Int64 := Int64'Integer_Value (Item);
A : constant Field := Field'Max (Aft, 1);
Neg : constant Boolean := (Item < 0.0);
Pos : Integer := 0; -- Next digit X has value X * 10.0**Pos;
procedure Put_Character (C : Character);
pragma Inline (Put_Character);
-- Add C to the output string To, updating Last
procedure Put_Digit (X : Digit);
-- Add digit X to the output string (going from left to right), updating
-- Last and Pos, and inserting the sign, leading zeros or a decimal
-- point when necessary. After outputting the first digit, Pos must not
-- be changed outside Put_Digit anymore.
procedure Put_Int64 (X : Int64; Scale : Integer);
-- Output the decimal number abs X * 10**Scale
procedure Put_Scaled
(X, Y, Z : Int64;
A : Field;
E : Integer);
-- Output the decimal number (X * Y / Z) * 10**E, producing A digits
-- after the decimal point and rounding the final digit. The value
-- X * Y / Z is computed with full precision, but must be in the
-- range of Int64.
-------------------
-- Put_Character --
-------------------
procedure Put_Character (C : Character) is
begin
Last := Last + 1;
-- Never put a character outside of string To. Exception Layout_Error
-- will be raised later if Last is greater than To'Last.
if Last <= To'Last then
To (Last) := C;
end if;
end Put_Character;
---------------
-- Put_Digit --
---------------
procedure Put_Digit (X : Digit) is
Digs : constant array (Digit) of Character := "0123456789";
begin
if Last = To'First - 1 then
if X /= 0 or else Pos <= 0 then
-- Before outputting first digit, include leading space,
-- possible minus sign and, if the first digit is fractional,
-- decimal seperator and leading zeros.
-- The Fore part has Pos + 1 + Boolean'Pos (Neg) characters,
-- if Pos >= 0 and otherwise has a single zero digit plus minus
-- sign if negative. Add leading space if necessary.
for J in Integer'Max (0, Pos) + 2 + Boolean'Pos (Neg) .. Fore
loop
Put_Character (' ');
end loop;
-- Output minus sign, if number is negative
if Neg then
Put_Character ('-');
end if;
-- If starting with fractional digit, output leading zeros
if Pos < 0 then
Put_Character ('0');
Put_Character ('.');
for J in Pos .. -2 loop
Put_Character ('0');
end loop;
end if;
Put_Character (Digs (X));
end if;
else
-- This is not the first digit to be output, so the only
-- special handling is that for the decimal point
if Pos = -1 then
Put_Character ('.');
end if;
Put_Character (Digs (X));
end if;
Pos := Pos - 1;
end Put_Digit;
---------------
-- Put_Int64 --
---------------
procedure Put_Int64 (X : Int64; Scale : Integer) is
begin
if X = 0 then
return;
end if;
if X not in -9 .. 9 then
Put_Int64 (X / 10, Scale + 1);
end if;
-- Use Put_Digit to advance Pos. This fixes a case where the second
-- or later Scaled_Divide would omit leading zeroes, resulting in
-- too few digits produced and a Layout_Error as result.
while Pos > Scale loop
Put_Digit (0);
end loop;
-- If and only if more than one digit is output before the decimal
-- point, pos will be unequal to scale when outputting the first
-- digit.
pragma Assert (Pos = Scale or else Last = To'First - 1);
Pos := Scale;
Put_Digit (abs (X rem 10));
end Put_Int64;
----------------
-- Put_Scaled --
----------------
procedure Put_Scaled
(X, Y, Z : Int64;
A : Field;
E : Integer)
is
pragma Assert (E >= -Max_Digits);
AA : constant Field := E + A;
N : constant Natural := (AA + Max_Digits - 1) / Max_Digits + 1;
Q : array (0 .. N - 1) of Int64 := (others => 0);
-- Each element of Q has Max_Digits decimal digits, except the
-- last, which has eAA rem Max_Digits. Only Q (Q'First) may have an
-- absolute value equal to or larger than 10**Max_Digits. Only the
-- absolute value of the elements is not significant, not the sign.
XX : Int64 := X;
YY : Int64 := Y;
begin
for J in Q'Range loop
exit when XX = 0;
if J > 0 then
YY := 10**(Integer'Min (Max_Digits, AA - (J - 1) * Max_Digits));
end if;
Scaled_Divide (XX, YY, Z, Q (J), R => XX, Round => False);
end loop;
if -E > A then
pragma Assert (N = 1);
Discard_Extra_Digits : declare
Factor : constant Int64 := 10**(-E - A);
begin
-- The scaling factors were such that the first division
-- produced more digits than requested. So divide away extra
-- digits and compute new remainder for later rounding.
if abs (Q (0) rem Factor) >= Factor / 2 then
Q (0) := abs (Q (0) / Factor) + 1;
else
Q (0) := Q (0) / Factor;
end if;
XX := 0;
end Discard_Extra_Digits;
end if;
-- At this point XX is a remainder and we need to determine if the
-- quotient in Q must be rounded away from zero.
-- As XX is less than the divisor, it is safe to take its absolute
-- without chance of overflow. The check to see if XX is at least
-- half the absolute value of the divisor must be done carefully to
-- avoid overflow or lose precision.
XX := abs XX;
if XX >= 2**62
or else (Z < 0 and then (-XX) * 2 <= Z)
or else (Z >= 0 and then XX * 2 >= Z)
then
-- OK, rounding is necessary. As the sign is not significant,
-- take advantage of the fact that an extra negative value will
-- always be available when propagating the carry.
Q (Q'Last) := -abs Q (Q'Last) - 1;
Propagate_Carry :
for J in reverse 1 .. Q'Last loop
if Q (J) = YY or else Q (J) = -YY then
Q (J) := 0;
Q (J - 1) := -abs Q (J - 1) - 1;
else
exit Propagate_Carry;
end if;
end loop Propagate_Carry;
end if;
for J in Q'First .. Q'Last - 1 loop
Put_Int64 (Q (J), E - J * Max_Digits);
end loop;
Put_Int64 (Q (Q'Last), -A);
end Put_Scaled;
-- Start of processing for Put
begin
Last := To'First - 1;
if Exp /= 0 then
-- With the Exp format, it is not known how many output digits to
-- generate, as leading zeros must be ignored. Computing too many
-- digits and then truncating the output will not give the closest
-- output, it is necessary to round at the correct digit.
-- The general approach is as follows: as long as no digits have
-- been generated, compute the Aft next digits (without rounding).
-- Once a non-zero digit is generated, determine the exact number
-- of digits remaining and compute them with rounding.
-- Since a large number of iterations might be necessary in case
-- of Aft = 1, the following optimization would be desirable.
-- Count the number Z of leading zero bits in the integer
-- representation of X, and start with producing Aft + Z * 1000 /
-- 3322 digits in the first scaled division.
-- However, the floating-point routines are still used now ???
System.Img_Real.Set_Image_Real (Long_Long_Float (Item), To, Last,
Fore, Aft, Exp);
return;
end if;
if Exact then
declare
D : constant Integer := Integer'Min (A, Max_Digits
- (Num'Fore - 1));
Y : constant Int64 := Int64'Min (Int64 (-Num'Small), -1)
* 10**Integer'Max (0, D);
Z : constant Int64 := Int64'Min (Int64 (-(1.0 / Num'Small)), -1)
* 10**Integer'Max (0, -D);
begin
Put_Scaled (X, Y, Z, A, -D);
end;
else -- not Exact
declare
E : constant Integer := Max_Digits - 1 + Scale;
D : constant Integer := Scale - 1;
Y : constant Int64 := Int64 (-Num'Small * 10.0**E);
Z : constant Int64 := -10**Max_Digits;
begin
Put_Scaled (X, Y, Z, A, -D);
end;
end if;
-- If only zero digits encountered, unit digit has not been output yet
if Last < To'First then
Pos := 0;
elsif Last > To'Last then
raise Layout_Error; -- Not enough room in the output variable
end if;
-- Always output digits up to the first one after the decimal point
while Pos >= -A loop
Put_Digit (0);
end loop;
end Put;
end Ada.Text_IO.Fixed_IO;
| 37.712692 | 79 | 0.566975 |
df9d22a792fdbb3cfa7bfc1264bd206fa2f3c3e5 | 6,276 | ads | Ada | tools-src/gnu/gcc/gcc/ada/exp_code.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | tools-src/gnu/gcc/gcc/ada/exp_code.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | tools-src/gnu/gcc/gcc/ada/exp_code.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ C O D E --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1996 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 2, 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 COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Processing for handling code statements
with Types; use Types;
with System; use System;
package Exp_Code is
procedure Expand_Asm_Call (N : Node_Id);
-- Expands a call to Asm or Asm_Volatile into an equivalent
-- N_Code_Statement node.
-- The following routines provide an abstract interface to analyze
-- code statements, for use by Gigi processing for code statements.
-- Note that the implementations of these routines must not attempt
-- to expand tables that are frozen on entry to Gigi.
function Is_Asm_Volatile (N : Node_Id) return Boolean;
-- Given an N_Code_Statement node N, return True in the Asm_Volatile
-- case and False in the Asm case.
function Asm_Template (N : Node_Id) return Node_Id;
-- Given an N_Code_Statement node N, returns string literal node for
-- template in call
procedure Clobber_Setup (N : Node_Id);
-- Given an N_Code_Statement node N, setup to process the clobber list
-- with subsequent calls to Clobber_Get_Next.
function Clobber_Get_Next return System.Address;
-- Can only be called after a previous call to Clobber_Setup. The
-- returned value is a pointer to a null terminated (C format) string
-- for the next register argument. Null_Address is returned when there
-- are no more arguments.
procedure Setup_Asm_Inputs (N : Node_Id);
-- Given an N_Code_Statement node N, setup to read list of Asm_Input
-- arguments. The protocol is to construct a loop as follows:
--
-- Setup_Asm_Inputs (N);
-- while Present (Asm_Input_Value)
-- body
-- Next_Asm_Input;
-- end loop;
--
-- where the loop body calls Asm_Input_Constraint or Asm_Input_Value to
-- obtain the constraint string or input value expression from the current
-- Asm_Input argument.
function Asm_Input_Constraint return Node_Id;
-- Called within a loop initialized by Setup_Asm_Inputs and controlled
-- by Next_Asm_Input as described above. Returns a string literal node
-- for the constraint component of the current Asm_Input_Parameter, or
-- Empty if there are no more Asm_Input parameters.
function Asm_Input_Value return Node_Id;
-- Called within a loop initialized by Setup_Asm_Inputs and controlled
-- by Next_Asm_Input as described above. Returns the expression node for
-- the value component of the current Asm_Input parameter, or Empty if
-- there are no more Asm_Input parameters.
procedure Next_Asm_Input;
-- Step to next Asm_Input parameter. It is an error to call this procedure
-- if there are no more available parameters (which is impossible if the
-- call appears in a loop as in the above example).
procedure Setup_Asm_Outputs (N : Node_Id);
-- Given an N_Code_Statement node N, setup to read list of Asm_Output
-- arguments. The protocol is to construct a loop as follows:
--
-- Setup_Asm_Outputs (N);
-- while Present (Asm_Output_Value)
-- body
-- Next_Asm_Output;
-- end loop;
--
-- where the loop body calls Asm_Output_Constraint or Asm_Output_Variable
-- to obtain the constraint string or output variable name from the current
-- Asm_Output argument.
function Asm_Output_Constraint return Node_Id;
-- Called within a loop initialized by Setup_Asm_Outputs and controlled
-- by Next_Asm_Output as described above. Returns a string literal node
-- for the constraint component of the current Asm_Output_Parameter, or
-- Empty if there are no more Asm_Output parameters.
function Asm_Output_Variable return Node_Id;
-- Called within a loop initialized by Setup_Asm_Outputs and controlled
-- by Next_Asm_Output as described above. Returns the expression node for
-- the output variable component of the current Asm_Output parameter, or
-- Empty if there are no more Asm_Output parameters.
procedure Next_Asm_Output;
-- Step to next Asm_Output parameter. It is an error to call this procedure
-- if there are no more available parameters (which is impossible if the
-- call appears in a loop as in the above example).
end Exp_Code;
| 49.809524 | 79 | 0.59847 |
395ab26365d50d30f1db6dca149669734ffbb0cf | 17,058 | adb | Ada | .build/ada/asis-gela-elements-pathes.adb | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | 4 | 2016-02-05T15:51:56.000Z | 2022-03-25T20:38:32.000Z | .build/ada/asis-gela-elements-pathes.adb | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null | .build/ada/asis-gela-elements-pathes.adb | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null |
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, Maxim Reznik
-- 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 Maxim Reznik, 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 OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
package body Asis.Gela.Elements.Pathes is
function Condition_Expression
(Element : If_Path_Node) return Asis.Expression is
begin
return Element.Condition_Expression;
end Condition_Expression;
procedure Set_Condition_Expression
(Element : in out If_Path_Node;
Value : in Asis.Expression) is
begin
Element.Condition_Expression := Value;
end Set_Condition_Expression;
function New_If_Path_Node
(The_Context : ASIS.Context)
return If_Path_Ptr
is
Result : If_Path_Ptr :=
new If_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_If_Path_Node;
function Path_Kind (Element : If_Path_Node)
return Asis.Path_Kinds is
begin
return An_If_Path;
end;
function Children (Element : access If_Path_Node)
return Traverse_List is
begin
return ((False, Element.Condition_Expression'Access),
(True, Asis.Element (Element.Sequence_Of_Statements)));
end Children;
function Clone
(Element : If_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant If_Path_Ptr := new If_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access If_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Target.Condition_Expression :=
Copy (Cloner, Condition_Expression (Source.all), Asis.Element (Target));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function New_Elsif_Path_Node
(The_Context : ASIS.Context)
return Elsif_Path_Ptr
is
Result : Elsif_Path_Ptr :=
new Elsif_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Elsif_Path_Node;
function Path_Kind (Element : Elsif_Path_Node)
return Asis.Path_Kinds is
begin
return An_Elsif_Path;
end;
function Clone
(Element : Elsif_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Elsif_Path_Ptr := new Elsif_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Elsif_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Target.Condition_Expression :=
Copy (Cloner, Condition_Expression (Source.all), Asis.Element (Target));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function New_Else_Path_Node
(The_Context : ASIS.Context)
return Else_Path_Ptr
is
Result : Else_Path_Ptr :=
new Else_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Else_Path_Node;
function Path_Kind (Element : Else_Path_Node)
return Asis.Path_Kinds is
begin
return An_Else_Path;
end;
function Clone
(Element : Else_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Else_Path_Ptr := new Else_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Else_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function Case_Statement_Alternative_Choices
(Element : Case_Path_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List is
begin
return Primary_Choise_Lists.To_Element_List
(Element.Case_Statement_Alternative_Choices, Include_Pragmas);
end Case_Statement_Alternative_Choices;
procedure Set_Case_Statement_Alternative_Choices
(Element : in out Case_Path_Node;
Value : in Asis.Element) is
begin
Element.Case_Statement_Alternative_Choices := Primary_Choise_Lists.List (Value);
end Set_Case_Statement_Alternative_Choices;
function Case_Statement_Alternative_Choices_List
(Element : Case_Path_Node) return Asis.Element is
begin
return Asis.Element (Element.Case_Statement_Alternative_Choices);
end Case_Statement_Alternative_Choices_List;
function Pragmas
(Element : Case_Path_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List is
begin
return Primary_Pragma_Lists.To_Element_List
(Element.Pragmas, Include_Pragmas);
end Pragmas;
procedure Set_Pragmas
(Element : in out Case_Path_Node;
Value : in Asis.Element) is
begin
Element.Pragmas := Primary_Pragma_Lists.List (Value);
end Set_Pragmas;
function Pragmas_List
(Element : Case_Path_Node) return Asis.Element is
begin
return Asis.Element (Element.Pragmas);
end Pragmas_List;
function New_Case_Path_Node
(The_Context : ASIS.Context)
return Case_Path_Ptr
is
Result : Case_Path_Ptr :=
new Case_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Case_Path_Node;
function Path_Kind (Element : Case_Path_Node)
return Asis.Path_Kinds is
begin
return A_Case_Path;
end;
function Children (Element : access Case_Path_Node)
return Traverse_List is
begin
return ((True, Asis.Element (Element.Case_Statement_Alternative_Choices)),
(True, Asis.Element (Element.Pragmas)),
(True, Asis.Element (Element.Sequence_Of_Statements)));
end Children;
function Clone
(Element : Case_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Case_Path_Ptr := new Case_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Case_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Set_Case_Statement_Alternative_Choices
(Target.all,
Primary_Choise_Lists.Deep_Copy
(Case_Statement_Alternative_Choices (Source.all), Cloner, Asis.Element (Target)));
Set_Pragmas
(Target.all,
Primary_Pragma_Lists.Deep_Copy
(Pragmas (Source.all), Cloner, Asis.Element (Target)));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function Guard
(Element : Select_Path_Node) return Asis.Expression is
begin
return Element.Guard;
end Guard;
procedure Set_Guard
(Element : in out Select_Path_Node;
Value : in Asis.Expression) is
begin
Element.Guard := Value;
end Set_Guard;
function Pragmas
(Element : Select_Path_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List is
begin
return Primary_Pragma_Lists.To_Element_List
(Element.Pragmas, Include_Pragmas);
end Pragmas;
procedure Set_Pragmas
(Element : in out Select_Path_Node;
Value : in Asis.Element) is
begin
Element.Pragmas := Primary_Pragma_Lists.List (Value);
end Set_Pragmas;
function Pragmas_List
(Element : Select_Path_Node) return Asis.Element is
begin
return Asis.Element (Element.Pragmas);
end Pragmas_List;
function New_Select_Path_Node
(The_Context : ASIS.Context)
return Select_Path_Ptr
is
Result : Select_Path_Ptr :=
new Select_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Select_Path_Node;
function Path_Kind (Element : Select_Path_Node)
return Asis.Path_Kinds is
begin
return A_Select_Path;
end;
function Children (Element : access Select_Path_Node)
return Traverse_List is
begin
return ((False, Element.Guard'Access),
(True, Asis.Element (Element.Pragmas)),
(True, Asis.Element (Element.Sequence_Of_Statements)));
end Children;
function Clone
(Element : Select_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Select_Path_Ptr := new Select_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Select_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Target.Guard :=
Copy (Cloner, Guard (Source.all), Asis.Element (Target));
Set_Pragmas
(Target.all,
Primary_Pragma_Lists.Deep_Copy
(Pragmas (Source.all), Cloner, Asis.Element (Target)));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function New_Or_Path_Node
(The_Context : ASIS.Context)
return Or_Path_Ptr
is
Result : Or_Path_Ptr :=
new Or_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Or_Path_Node;
function Path_Kind (Element : Or_Path_Node)
return Asis.Path_Kinds is
begin
return An_Or_Path;
end;
function Clone
(Element : Or_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Or_Path_Ptr := new Or_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Or_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Target.Guard :=
Copy (Cloner, Guard (Source.all), Asis.Element (Target));
Set_Pragmas
(Target.all,
Primary_Pragma_Lists.Deep_Copy
(Pragmas (Source.all), Cloner, Asis.Element (Target)));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function New_Then_Abort_Path_Node
(The_Context : ASIS.Context)
return Then_Abort_Path_Ptr
is
Result : Then_Abort_Path_Ptr :=
new Then_Abort_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Then_Abort_Path_Node;
function Path_Kind (Element : Then_Abort_Path_Node)
return Asis.Path_Kinds is
begin
return A_Then_Abort_Path;
end;
function Clone
(Element : Then_Abort_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Then_Abort_Path_Ptr := new Then_Abort_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Then_Abort_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
end Asis.Gela.Elements.Pathes;
| 31.94382 | 93 | 0.685719 |
dc48799aebc8a901aadcccfbfde4e78eafb89a1d | 49,039 | ads | Ada | include/stdlib_h.ads | docandrew/troodon | 9240611708f92ffb5491fa677bffb6ecac58a51e | [
"MIT"
] | 5 | 2021-11-03T04:34:16.000Z | 2021-11-10T23:06:30.000Z | include/stdlib_h.ads | docandrew/troodon | 9240611708f92ffb5491fa677bffb6ecac58a51e | [
"MIT"
] | null | null | null | include/stdlib_h.ads | docandrew/troodon | 9240611708f92ffb5491fa677bffb6ecac58a51e | [
"MIT"
] | null | null | null | pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings;
with System;
with bits_floatn_common_h;
with Interfaces.C.Extensions;
with stddef_h;
with bits_types_locale_t_h;
with bits_stdint_intn_h;
package stdlib_h is
-- arg-macro: procedure WEXITSTATUS (status)
-- __WEXITSTATUS (status)
-- arg-macro: procedure WTERMSIG (status)
-- __WTERMSIG (status)
-- arg-macro: procedure WSTOPSIG (status)
-- __WSTOPSIG (status)
-- arg-macro: procedure WIFEXITED (status)
-- __WIFEXITED (status)
-- arg-macro: procedure WIFSIGNALED (status)
-- __WIFSIGNALED (status)
-- arg-macro: procedure WIFSTOPPED (status)
-- __WIFSTOPPED (status)
-- arg-macro: procedure WIFCONTINUED (status)
-- __WIFCONTINUED (status)
RAND_MAX : constant := 2147483647; -- /usr/include/stdlib.h:86
EXIT_FAILURE : constant := 1; -- /usr/include/stdlib.h:91
EXIT_SUCCESS : constant := 0; -- /usr/include/stdlib.h:92
-- unsupported macro: MB_CUR_MAX (__ctype_get_mb_cur_max ())
-- Copyright (C) 1991-2021 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- The GNU C Library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, see
-- <https://www.gnu.org/licenses/>.
-- * ISO C99 Standard: 7.20 General utilities <stdlib.h>
--
-- Get size_t, wchar_t and NULL from <stddef.h>.
-- XPG requires a few symbols from <sys/wait.h> being defined.
-- Define the macros <sys/wait.h> also would define this way.
-- _FloatN API tests for enablement.
-- Returned by `div'.
-- Quotient.
-- skipped anonymous struct anon_4
type div_t is record
quot : aliased int; -- /usr/include/stdlib.h:60
c_rem : aliased int; -- /usr/include/stdlib.h:61
end record
with Convention => C_Pass_By_Copy; -- /usr/include/stdlib.h:62
-- Remainder.
-- Returned by `ldiv'.
-- Quotient.
-- Remainder.
-- skipped anonymous struct anon_5
type ldiv_t is record
quot : aliased long; -- /usr/include/stdlib.h:68
c_rem : aliased long; -- /usr/include/stdlib.h:69
end record
with Convention => C_Pass_By_Copy; -- /usr/include/stdlib.h:70
-- Returned by `lldiv'.
-- Quotient.
-- Remainder.
-- skipped anonymous struct anon_6
type lldiv_t is record
quot : aliased Long_Long_Integer; -- /usr/include/stdlib.h:78
c_rem : aliased Long_Long_Integer; -- /usr/include/stdlib.h:79
end record
with Convention => C_Pass_By_Copy; -- /usr/include/stdlib.h:80
-- The largest number rand will return (same as INT_MAX).
-- We define these the same for all machines.
-- Changes from this to the outside world should be done in `_exit'.
-- Maximum length of a multibyte character in the current locale.
-- skipped func __ctype_get_mb_cur_max
-- Convert a string to a floating-point number.
function atof (uu_nptr : Interfaces.C.Strings.chars_ptr) return double -- /usr/include/stdlib.h:101
with Import => True,
Convention => C,
External_Name => "atof";
-- Convert a string to an integer.
function atoi (uu_nptr : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/stdlib.h:104
with Import => True,
Convention => C,
External_Name => "atoi";
-- Convert a string to a long integer.
function atol (uu_nptr : Interfaces.C.Strings.chars_ptr) return long -- /usr/include/stdlib.h:107
with Import => True,
Convention => C,
External_Name => "atol";
-- Convert a string to a long long integer.
function atoll (uu_nptr : Interfaces.C.Strings.chars_ptr) return Long_Long_Integer -- /usr/include/stdlib.h:112
with Import => True,
Convention => C,
External_Name => "atoll";
-- Convert a string to a floating-point number.
function strtod (uu_nptr : Interfaces.C.Strings.chars_ptr; uu_endptr : System.Address) return double -- /usr/include/stdlib.h:117
with Import => True,
Convention => C,
External_Name => "strtod";
-- Likewise for `float' and `long double' sizes of floating-point numbers.
function strtof (uu_nptr : Interfaces.C.Strings.chars_ptr; uu_endptr : System.Address) return float -- /usr/include/stdlib.h:123
with Import => True,
Convention => C,
External_Name => "strtof";
function strtold (uu_nptr : Interfaces.C.Strings.chars_ptr; uu_endptr : System.Address) return long_double -- /usr/include/stdlib.h:126
with Import => True,
Convention => C,
External_Name => "strtold";
-- Likewise for '_FloatN' and '_FloatNx'.
function strtof32 (uu_nptr : Interfaces.C.Strings.chars_ptr; uu_endptr : System.Address) return bits_floatn_common_h.u_Float32 -- /usr/include/stdlib.h:140
with Import => True,
Convention => C,
External_Name => "strtof32";
function strtof64 (uu_nptr : Interfaces.C.Strings.chars_ptr; uu_endptr : System.Address) return bits_floatn_common_h.u_Float64 -- /usr/include/stdlib.h:146
with Import => True,
Convention => C,
External_Name => "strtof64";
function strtof128 (uu_nptr : Interfaces.C.Strings.chars_ptr; uu_endptr : System.Address) return Extensions.Float_128 -- /usr/include/stdlib.h:152
with Import => True,
Convention => C,
External_Name => "strtof128";
function strtof32x (uu_nptr : Interfaces.C.Strings.chars_ptr; uu_endptr : System.Address) return bits_floatn_common_h.u_Float32x -- /usr/include/stdlib.h:158
with Import => True,
Convention => C,
External_Name => "strtof32x";
function strtof64x (uu_nptr : Interfaces.C.Strings.chars_ptr; uu_endptr : System.Address) return bits_floatn_common_h.u_Float64x -- /usr/include/stdlib.h:164
with Import => True,
Convention => C,
External_Name => "strtof64x";
-- Convert a string to a long integer.
function strtol
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int) return long -- /usr/include/stdlib.h:176
with Import => True,
Convention => C,
External_Name => "strtol";
-- Convert a string to an unsigned long integer.
function strtoul
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int) return unsigned_long -- /usr/include/stdlib.h:180
with Import => True,
Convention => C,
External_Name => "strtoul";
-- Convert a string to a quadword integer.
function strtoq
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int) return Long_Long_Integer -- /usr/include/stdlib.h:187
with Import => True,
Convention => C,
External_Name => "strtoq";
-- Convert a string to an unsigned quadword integer.
function strtouq
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int) return Extensions.unsigned_long_long -- /usr/include/stdlib.h:192
with Import => True,
Convention => C,
External_Name => "strtouq";
-- Convert a string to a quadword integer.
function strtoll
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int) return Long_Long_Integer -- /usr/include/stdlib.h:200
with Import => True,
Convention => C,
External_Name => "strtoll";
-- Convert a string to an unsigned quadword integer.
function strtoull
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int) return Extensions.unsigned_long_long -- /usr/include/stdlib.h:205
with Import => True,
Convention => C,
External_Name => "strtoull";
-- Convert a floating-point number to a string.
function strfromd
(uu_dest : Interfaces.C.Strings.chars_ptr;
uu_size : stddef_h.size_t;
uu_format : Interfaces.C.Strings.chars_ptr;
uu_f : double) return int -- /usr/include/stdlib.h:212
with Import => True,
Convention => C,
External_Name => "strfromd";
function strfromf
(uu_dest : Interfaces.C.Strings.chars_ptr;
uu_size : stddef_h.size_t;
uu_format : Interfaces.C.Strings.chars_ptr;
uu_f : float) return int -- /usr/include/stdlib.h:216
with Import => True,
Convention => C,
External_Name => "strfromf";
function strfroml
(uu_dest : Interfaces.C.Strings.chars_ptr;
uu_size : stddef_h.size_t;
uu_format : Interfaces.C.Strings.chars_ptr;
uu_f : long_double) return int -- /usr/include/stdlib.h:220
with Import => True,
Convention => C,
External_Name => "strfroml";
function strfromf32
(uu_dest : Interfaces.C.Strings.chars_ptr;
uu_size : stddef_h.size_t;
uu_format : Interfaces.C.Strings.chars_ptr;
uu_f : bits_floatn_common_h.u_Float32) return int -- /usr/include/stdlib.h:232
with Import => True,
Convention => C,
External_Name => "strfromf32";
function strfromf64
(uu_dest : Interfaces.C.Strings.chars_ptr;
uu_size : stddef_h.size_t;
uu_format : Interfaces.C.Strings.chars_ptr;
uu_f : bits_floatn_common_h.u_Float64) return int -- /usr/include/stdlib.h:238
with Import => True,
Convention => C,
External_Name => "strfromf64";
function strfromf128
(uu_dest : Interfaces.C.Strings.chars_ptr;
uu_size : stddef_h.size_t;
uu_format : Interfaces.C.Strings.chars_ptr;
uu_f : Extensions.Float_128) return int -- /usr/include/stdlib.h:244
with Import => True,
Convention => C,
External_Name => "strfromf128";
function strfromf32x
(uu_dest : Interfaces.C.Strings.chars_ptr;
uu_size : stddef_h.size_t;
uu_format : Interfaces.C.Strings.chars_ptr;
uu_f : bits_floatn_common_h.u_Float32x) return int -- /usr/include/stdlib.h:250
with Import => True,
Convention => C,
External_Name => "strfromf32x";
function strfromf64x
(uu_dest : Interfaces.C.Strings.chars_ptr;
uu_size : stddef_h.size_t;
uu_format : Interfaces.C.Strings.chars_ptr;
uu_f : bits_floatn_common_h.u_Float64x) return int -- /usr/include/stdlib.h:256
with Import => True,
Convention => C,
External_Name => "strfromf64x";
-- Parallel versions of the functions above which take the locale to
-- use as an additional parameter. These are GNU extensions inspired
-- by the POSIX.1-2008 extended locale API.
function strtol_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int;
uu_loc : bits_types_locale_t_h.locale_t) return long -- /usr/include/stdlib.h:274
with Import => True,
Convention => C,
External_Name => "strtol_l";
function strtoul_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int;
uu_loc : bits_types_locale_t_h.locale_t) return unsigned_long -- /usr/include/stdlib.h:278
with Import => True,
Convention => C,
External_Name => "strtoul_l";
function strtoll_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int;
uu_loc : bits_types_locale_t_h.locale_t) return Long_Long_Integer -- /usr/include/stdlib.h:284
with Import => True,
Convention => C,
External_Name => "strtoll_l";
function strtoull_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_base : int;
uu_loc : bits_types_locale_t_h.locale_t) return Extensions.unsigned_long_long -- /usr/include/stdlib.h:290
with Import => True,
Convention => C,
External_Name => "strtoull_l";
function strtod_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_loc : bits_types_locale_t_h.locale_t) return double -- /usr/include/stdlib.h:295
with Import => True,
Convention => C,
External_Name => "strtod_l";
function strtof_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_loc : bits_types_locale_t_h.locale_t) return float -- /usr/include/stdlib.h:299
with Import => True,
Convention => C,
External_Name => "strtof_l";
function strtold_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_loc : bits_types_locale_t_h.locale_t) return long_double -- /usr/include/stdlib.h:303
with Import => True,
Convention => C,
External_Name => "strtold_l";
function strtof32_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_loc : bits_types_locale_t_h.locale_t) return bits_floatn_common_h.u_Float32 -- /usr/include/stdlib.h:316
with Import => True,
Convention => C,
External_Name => "strtof32_l";
function strtof64_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_loc : bits_types_locale_t_h.locale_t) return bits_floatn_common_h.u_Float64 -- /usr/include/stdlib.h:323
with Import => True,
Convention => C,
External_Name => "strtof64_l";
function strtof128_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_loc : bits_types_locale_t_h.locale_t) return Extensions.Float_128 -- /usr/include/stdlib.h:330
with Import => True,
Convention => C,
External_Name => "strtof128_l";
function strtof32x_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_loc : bits_types_locale_t_h.locale_t) return bits_floatn_common_h.u_Float32x -- /usr/include/stdlib.h:337
with Import => True,
Convention => C,
External_Name => "strtof32x_l";
function strtof64x_l
(uu_nptr : Interfaces.C.Strings.chars_ptr;
uu_endptr : System.Address;
uu_loc : bits_types_locale_t_h.locale_t) return bits_floatn_common_h.u_Float64x -- /usr/include/stdlib.h:344
with Import => True,
Convention => C,
External_Name => "strtof64x_l";
-- Convert N to base 64 using the digits "./0-9A-Za-z", least-significant
-- digit first. Returns a pointer to static storage overwritten by the
-- next call.
function l64a (uu_n : long) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:385
with Import => True,
Convention => C,
External_Name => "l64a";
-- Read a number from a string S in base 64 as above.
function a64l (uu_s : Interfaces.C.Strings.chars_ptr) return long -- /usr/include/stdlib.h:388
with Import => True,
Convention => C,
External_Name => "a64l";
-- we need int32_t...
-- These are the functions that actually do things. The `random', `srandom',
-- `initstate' and `setstate' functions are those from BSD Unices.
-- The `rand' and `srand' functions are required by the ANSI standard.
-- We provide both interfaces to the same random number generator.
-- Return a random long integer between 0 and 2^31-1 inclusive.
function random return long -- /usr/include/stdlib.h:401
with Import => True,
Convention => C,
External_Name => "random";
-- Seed the random number generator with the given number.
procedure srandom (uu_seed : unsigned) -- /usr/include/stdlib.h:404
with Import => True,
Convention => C,
External_Name => "srandom";
-- Initialize the random number generator to use state buffer STATEBUF,
-- of length STATELEN, and seed it with SEED. Optimal lengths are 8, 16,
-- 32, 64, 128 and 256, the bigger the better; values less than 8 will
-- cause an error and values greater than 256 will be rounded down.
function initstate
(uu_seed : unsigned;
uu_statebuf : Interfaces.C.Strings.chars_ptr;
uu_statelen : stddef_h.size_t) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:410
with Import => True,
Convention => C,
External_Name => "initstate";
-- Switch the random number generator to state buffer STATEBUF,
-- which should have been previously initialized by `initstate'.
function setstate (uu_statebuf : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:415
with Import => True,
Convention => C,
External_Name => "setstate";
-- Reentrant versions of the `random' family of functions.
-- These functions all use the following data structure to contain
-- state, rather than global state variables.
-- Front pointer.
type random_data is record
fptr : access bits_stdint_intn_h.int32_t; -- /usr/include/stdlib.h:425
rptr : access bits_stdint_intn_h.int32_t; -- /usr/include/stdlib.h:426
state : access bits_stdint_intn_h.int32_t; -- /usr/include/stdlib.h:427
rand_type : aliased int; -- /usr/include/stdlib.h:428
rand_deg : aliased int; -- /usr/include/stdlib.h:429
rand_sep : aliased int; -- /usr/include/stdlib.h:430
end_ptr : access bits_stdint_intn_h.int32_t; -- /usr/include/stdlib.h:431
end record
with Convention => C_Pass_By_Copy; -- /usr/include/stdlib.h:423
-- Rear pointer.
-- Array of state values.
-- Type of random number generator.
-- Degree of random number generator.
-- Distance between front and rear.
-- Pointer behind state table.
function random_r (uu_buf : access random_data; uu_result : access bits_stdint_intn_h.int32_t) return int -- /usr/include/stdlib.h:434
with Import => True,
Convention => C,
External_Name => "random_r";
function srandom_r (uu_seed : unsigned; uu_buf : access random_data) return int -- /usr/include/stdlib.h:437
with Import => True,
Convention => C,
External_Name => "srandom_r";
function initstate_r
(uu_seed : unsigned;
uu_statebuf : Interfaces.C.Strings.chars_ptr;
uu_statelen : stddef_h.size_t;
uu_buf : access random_data) return int -- /usr/include/stdlib.h:440
with Import => True,
Convention => C,
External_Name => "initstate_r";
function setstate_r (uu_statebuf : Interfaces.C.Strings.chars_ptr; uu_buf : access random_data) return int -- /usr/include/stdlib.h:445
with Import => True,
Convention => C,
External_Name => "setstate_r";
-- Return a random integer between 0 and RAND_MAX inclusive.
function rand return int -- /usr/include/stdlib.h:453
with Import => True,
Convention => C,
External_Name => "rand";
-- Seed the random number generator with the given number.
procedure srand (uu_seed : unsigned) -- /usr/include/stdlib.h:455
with Import => True,
Convention => C,
External_Name => "srand";
-- Reentrant interface according to POSIX.1.
function rand_r (uu_seed : access unsigned) return int -- /usr/include/stdlib.h:459
with Import => True,
Convention => C,
External_Name => "rand_r";
-- System V style 48-bit random number generator functions.
-- Return non-negative, double-precision floating-point value in [0.0,1.0).
function drand48 return double -- /usr/include/stdlib.h:467
with Import => True,
Convention => C,
External_Name => "drand48";
function erand48 (uu_xsubi : access unsigned_short) return double -- /usr/include/stdlib.h:468
with Import => True,
Convention => C,
External_Name => "erand48";
-- Return non-negative, long integer in [0,2^31).
function lrand48 return long -- /usr/include/stdlib.h:471
with Import => True,
Convention => C,
External_Name => "lrand48";
function nrand48 (uu_xsubi : access unsigned_short) return long -- /usr/include/stdlib.h:472
with Import => True,
Convention => C,
External_Name => "nrand48";
-- Return signed, long integers in [-2^31,2^31).
function mrand48 return long -- /usr/include/stdlib.h:476
with Import => True,
Convention => C,
External_Name => "mrand48";
function jrand48 (uu_xsubi : access unsigned_short) return long -- /usr/include/stdlib.h:477
with Import => True,
Convention => C,
External_Name => "jrand48";
-- Seed random number generator.
procedure srand48 (uu_seedval : long) -- /usr/include/stdlib.h:481
with Import => True,
Convention => C,
External_Name => "srand48";
function seed48 (uu_seed16v : access unsigned_short) return access unsigned_short -- /usr/include/stdlib.h:482
with Import => True,
Convention => C,
External_Name => "seed48";
procedure lcong48 (uu_param : access unsigned_short) -- /usr/include/stdlib.h:484
with Import => True,
Convention => C,
External_Name => "lcong48";
-- Data structure for communication with thread safe versions. This
-- type is to be regarded as opaque. It's only exported because users
-- have to allocate objects of this type.
-- Current state.
type drand48_data_array1675 is array (0 .. 2) of aliased unsigned_short;
type drand48_data is record
uu_x : aliased drand48_data_array1675; -- /usr/include/stdlib.h:492
uu_old_x : aliased drand48_data_array1675; -- /usr/include/stdlib.h:493
uu_c : aliased unsigned_short; -- /usr/include/stdlib.h:494
uu_init : aliased unsigned_short; -- /usr/include/stdlib.h:495
uu_a : aliased Extensions.unsigned_long_long; -- /usr/include/stdlib.h:496
end record
with Convention => C_Pass_By_Copy; -- /usr/include/stdlib.h:490
-- Old state.
-- Additive const. in congruential formula.
-- Flag for initializing.
-- Factor in congruential
-- formula.
-- Return non-negative, double-precision floating-point value in [0.0,1.0).
function drand48_r (uu_buffer : access drand48_data; uu_result : access double) return int -- /usr/include/stdlib.h:501
with Import => True,
Convention => C,
External_Name => "drand48_r";
function erand48_r
(uu_xsubi : access unsigned_short;
uu_buffer : access drand48_data;
uu_result : access double) return int -- /usr/include/stdlib.h:503
with Import => True,
Convention => C,
External_Name => "erand48_r";
-- Return non-negative, long integer in [0,2^31).
function lrand48_r (uu_buffer : access drand48_data; uu_result : access long) return int -- /usr/include/stdlib.h:508
with Import => True,
Convention => C,
External_Name => "lrand48_r";
function nrand48_r
(uu_xsubi : access unsigned_short;
uu_buffer : access drand48_data;
uu_result : access long) return int -- /usr/include/stdlib.h:511
with Import => True,
Convention => C,
External_Name => "nrand48_r";
-- Return signed, long integers in [-2^31,2^31).
function mrand48_r (uu_buffer : access drand48_data; uu_result : access long) return int -- /usr/include/stdlib.h:517
with Import => True,
Convention => C,
External_Name => "mrand48_r";
function jrand48_r
(uu_xsubi : access unsigned_short;
uu_buffer : access drand48_data;
uu_result : access long) return int -- /usr/include/stdlib.h:520
with Import => True,
Convention => C,
External_Name => "jrand48_r";
-- Seed random number generator.
function srand48_r (uu_seedval : long; uu_buffer : access drand48_data) return int -- /usr/include/stdlib.h:526
with Import => True,
Convention => C,
External_Name => "srand48_r";
function seed48_r (uu_seed16v : access unsigned_short; uu_buffer : access drand48_data) return int -- /usr/include/stdlib.h:529
with Import => True,
Convention => C,
External_Name => "seed48_r";
function lcong48_r (uu_param : access unsigned_short; uu_buffer : access drand48_data) return int -- /usr/include/stdlib.h:532
with Import => True,
Convention => C,
External_Name => "lcong48_r";
-- Allocate SIZE bytes of memory.
function malloc (uu_size : stddef_h.size_t) return System.Address -- /usr/include/stdlib.h:539
with Import => True,
Convention => C,
External_Name => "malloc";
-- Allocate NMEMB elements of SIZE bytes each, all initialized to 0.
function calloc (uu_nmemb : stddef_h.size_t; uu_size : stddef_h.size_t) return System.Address -- /usr/include/stdlib.h:542
with Import => True,
Convention => C,
External_Name => "calloc";
-- Re-allocate the previously allocated block
-- in PTR, making the new block SIZE bytes long.
-- __attribute_malloc__ is not used, because if realloc returns
-- the same pointer that was passed to it, aliasing needs to be allowed
-- between objects pointed by the old and new pointers.
function realloc (uu_ptr : System.Address; uu_size : stddef_h.size_t) return System.Address -- /usr/include/stdlib.h:550
with Import => True,
Convention => C,
External_Name => "realloc";
-- Re-allocate the previously allocated block in PTR, making the new
-- block large enough for NMEMB elements of SIZE bytes each.
-- __attribute_malloc__ is not used, because if reallocarray returns
-- the same pointer that was passed to it, aliasing needs to be allowed
-- between objects pointed by the old and new pointers.
function reallocarray
(uu_ptr : System.Address;
uu_nmemb : stddef_h.size_t;
uu_size : stddef_h.size_t) return System.Address -- /usr/include/stdlib.h:559
with Import => True,
Convention => C,
External_Name => "reallocarray";
-- Free a block allocated by `malloc', `realloc' or `calloc'.
procedure free (uu_ptr : System.Address) -- /usr/include/stdlib.h:565
with Import => True,
Convention => C,
External_Name => "free";
-- Allocate SIZE bytes on a page boundary. The storage cannot be freed.
function valloc (uu_size : stddef_h.size_t) return System.Address -- /usr/include/stdlib.h:574
with Import => True,
Convention => C,
External_Name => "valloc";
-- Allocate memory of SIZE bytes with an alignment of ALIGNMENT.
function posix_memalign
(uu_memptr : System.Address;
uu_alignment : stddef_h.size_t;
uu_size : stddef_h.size_t) return int -- /usr/include/stdlib.h:580
with Import => True,
Convention => C,
External_Name => "posix_memalign";
-- ISO C variant of aligned allocation.
function aligned_alloc (uu_alignment : stddef_h.size_t; uu_size : stddef_h.size_t) return System.Address -- /usr/include/stdlib.h:586
with Import => True,
Convention => C,
External_Name => "aligned_alloc";
-- Abort execution and generate a core-dump.
procedure c_abort -- /usr/include/stdlib.h:591
with Import => True,
Convention => C,
External_Name => "abort";
-- Register a function to be called when `exit' is called.
function atexit (uu_func : access procedure) return int -- /usr/include/stdlib.h:595
with Import => True,
Convention => C,
External_Name => "atexit";
-- Register a function to be called when `quick_exit' is called.
function at_quick_exit (uu_func : access procedure) return int -- /usr/include/stdlib.h:600
with Import => True,
Convention => C,
External_Name => "at_quick_exit";
-- Register a function to be called with the status
-- given to `exit' and the given argument.
function on_exit (uu_func : access procedure (arg1 : int; arg2 : System.Address); uu_arg : System.Address) return int -- /usr/include/stdlib.h:610
with Import => True,
Convention => C,
External_Name => "on_exit";
-- Call all functions registered with `atexit' and `on_exit',
-- in the reverse of the order in which they were registered,
-- perform stdio cleanup, and terminate program execution with STATUS.
procedure c_exit (uu_status : int) -- /usr/include/stdlib.h:617
with Import => True,
Convention => C,
External_Name => "exit";
-- Call all functions registered with `at_quick_exit' in the reverse
-- of the order in which they were registered and terminate program
-- execution with STATUS.
procedure quick_exit (uu_status : int) -- /usr/include/stdlib.h:623
with Import => True,
Convention => C,
External_Name => "quick_exit";
-- Terminate the program with STATUS without calling any of the
-- functions registered with `atexit' or `on_exit'.
-- skipped func _Exit
-- Return the value of envariable NAME, or NULL if it doesn't exist.
function getenv (uu_name : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:634
with Import => True,
Convention => C,
External_Name => "getenv";
-- This function is similar to the above but returns NULL if the
-- programs is running with SUID or SGID enabled.
function secure_getenv (uu_name : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:639
with Import => True,
Convention => C,
External_Name => "secure_getenv";
-- The SVID says this is in <stdio.h>, but this seems a better place.
-- Put STRING, which is of the form "NAME=VALUE", in the environment.
-- If there is no `=', remove NAME from the environment.
function putenv (uu_string : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/stdlib.h:647
with Import => True,
Convention => C,
External_Name => "putenv";
-- Set NAME to VALUE in the environment.
-- If REPLACE is nonzero, overwrite an existing value.
function setenv
(uu_name : Interfaces.C.Strings.chars_ptr;
uu_value : Interfaces.C.Strings.chars_ptr;
uu_replace : int) return int -- /usr/include/stdlib.h:653
with Import => True,
Convention => C,
External_Name => "setenv";
-- Remove the variable NAME from the environment.
function unsetenv (uu_name : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/stdlib.h:657
with Import => True,
Convention => C,
External_Name => "unsetenv";
-- The `clearenv' was planned to be added to POSIX.1 but probably
-- never made it. Nevertheless the POSIX.9 standard (POSIX bindings
-- for Fortran 77) requires this function.
function clearenv return int -- /usr/include/stdlib.h:664
with Import => True,
Convention => C,
External_Name => "clearenv";
-- Generate a unique temporary file name from TEMPLATE.
-- The last six characters of TEMPLATE must be "XXXXXX";
-- they are replaced with a string that makes the file name unique.
-- Always returns TEMPLATE, it's either a temporary file name or a null
-- string if it cannot get a unique file name.
function mktemp (uu_template : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:675
with Import => True,
Convention => C,
External_Name => "mktemp";
-- Generate a unique temporary file name from TEMPLATE.
-- The last six characters of TEMPLATE must be "XXXXXX";
-- they are replaced with a string that makes the filename unique.
-- Returns a file descriptor open on the file for reading and writing,
-- or -1 if it cannot create a uniquely-named file.
-- This function is a possible cancellation point and therefore not
-- marked with __THROW.
function mkstemp (uu_template : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/stdlib.h:688
with Import => True,
Convention => C,
External_Name => "mkstemp";
function mkstemp64 (uu_template : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/stdlib.h:698
with Import => True,
Convention => C,
External_Name => "mkstemp64";
-- Similar to mkstemp, but the template can have a suffix after the
-- XXXXXX. The length of the suffix is specified in the second
-- parameter.
-- This function is a possible cancellation point and therefore not
-- marked with __THROW.
function mkstemps (uu_template : Interfaces.C.Strings.chars_ptr; uu_suffixlen : int) return int -- /usr/include/stdlib.h:710
with Import => True,
Convention => C,
External_Name => "mkstemps";
function mkstemps64 (uu_template : Interfaces.C.Strings.chars_ptr; uu_suffixlen : int) return int -- /usr/include/stdlib.h:720
with Import => True,
Convention => C,
External_Name => "mkstemps64";
-- Create a unique temporary directory from TEMPLATE.
-- The last six characters of TEMPLATE must be "XXXXXX";
-- they are replaced with a string that makes the directory name unique.
-- Returns TEMPLATE, or a null pointer if it cannot get a unique name.
-- The directory is created mode 700.
function mkdtemp (uu_template : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:731
with Import => True,
Convention => C,
External_Name => "mkdtemp";
-- Generate a unique temporary file name from TEMPLATE similar to
-- mkstemp. But allow the caller to pass additional flags which are
-- used in the open call to create the file..
-- This function is a possible cancellation point and therefore not
-- marked with __THROW.
function mkostemp (uu_template : Interfaces.C.Strings.chars_ptr; uu_flags : int) return int -- /usr/include/stdlib.h:742
with Import => True,
Convention => C,
External_Name => "mkostemp";
function mkostemp64 (uu_template : Interfaces.C.Strings.chars_ptr; uu_flags : int) return int -- /usr/include/stdlib.h:752
with Import => True,
Convention => C,
External_Name => "mkostemp64";
-- Similar to mkostemp, but the template can have a suffix after the
-- XXXXXX. The length of the suffix is specified in the second
-- parameter.
-- This function is a possible cancellation point and therefore not
-- marked with __THROW.
function mkostemps
(uu_template : Interfaces.C.Strings.chars_ptr;
uu_suffixlen : int;
uu_flags : int) return int -- /usr/include/stdlib.h:762
with Import => True,
Convention => C,
External_Name => "mkostemps";
function mkostemps64
(uu_template : Interfaces.C.Strings.chars_ptr;
uu_suffixlen : int;
uu_flags : int) return int -- /usr/include/stdlib.h:774
with Import => True,
Convention => C,
External_Name => "mkostemps64";
-- Execute the given line as a shell command.
-- This function is a cancellation point and therefore not marked with
-- __THROW.
function c_system (uu_command : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/stdlib.h:784
with Import => True,
Convention => C,
External_Name => "system";
-- Return a malloc'd string containing the canonical absolute name of the
-- existing named file.
function canonicalize_file_name (uu_name : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:790
with Import => True,
Convention => C,
External_Name => "canonicalize_file_name";
-- Return the canonical absolute name of file NAME. If RESOLVED is
-- null, the result is malloc'd; otherwise, if the canonical name is
-- PATH_MAX chars or more, returns null with `errno' set to
-- ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
-- returns the name in RESOLVED.
function realpath (uu_name : Interfaces.C.Strings.chars_ptr; uu_resolved : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:800
with Import => True,
Convention => C,
External_Name => "realpath";
-- Shorthand for type of comparison functions.
type uu_compar_fn_t is access function (arg1 : System.Address; arg2 : System.Address) return int
with Convention => C; -- /usr/include/stdlib.h:808
subtype comparison_fn_t is uu_compar_fn_t; -- /usr/include/stdlib.h:811
type uu_compar_d_fn_t is access function
(arg1 : System.Address;
arg2 : System.Address;
arg3 : System.Address) return int
with Convention => C; -- /usr/include/stdlib.h:815
-- Do a binary search for KEY in BASE, which consists of NMEMB elements
-- of SIZE bytes each, using COMPAR to perform the comparisons.
function bsearch
(uu_key : System.Address;
uu_base : System.Address;
uu_nmemb : stddef_h.size_t;
uu_size : stddef_h.size_t;
uu_compar : uu_compar_fn_t) return System.Address -- /usr/include/stdlib.h:820
with Import => True,
Convention => C,
External_Name => "bsearch";
-- Sort NMEMB elements of BASE, of SIZE bytes each,
-- using COMPAR to perform the comparisons.
procedure qsort
(uu_base : System.Address;
uu_nmemb : stddef_h.size_t;
uu_size : stddef_h.size_t;
uu_compar : uu_compar_fn_t) -- /usr/include/stdlib.h:830
with Import => True,
Convention => C,
External_Name => "qsort";
procedure qsort_r
(uu_base : System.Address;
uu_nmemb : stddef_h.size_t;
uu_size : stddef_h.size_t;
uu_compar : uu_compar_d_fn_t;
uu_arg : System.Address) -- /usr/include/stdlib.h:833
with Import => True,
Convention => C,
External_Name => "qsort_r";
-- Return the absolute value of X.
function c_abs (uu_x : int) return int -- /usr/include/stdlib.h:840
with Import => True,
Convention => C,
External_Name => "abs";
function labs (uu_x : long) return long -- /usr/include/stdlib.h:841
with Import => True,
Convention => C,
External_Name => "labs";
function llabs (uu_x : Long_Long_Integer) return Long_Long_Integer -- /usr/include/stdlib.h:844
with Import => True,
Convention => C,
External_Name => "llabs";
-- Return the `div_t', `ldiv_t' or `lldiv_t' representation
-- of the value of NUMER over DENOM.
-- GCC may have built-ins for these someday.
function div (uu_numer : int; uu_denom : int) return div_t -- /usr/include/stdlib.h:852
with Import => True,
Convention => C,
External_Name => "div";
function ldiv (uu_numer : long; uu_denom : long) return ldiv_t -- /usr/include/stdlib.h:854
with Import => True,
Convention => C,
External_Name => "ldiv";
function lldiv (uu_numer : Long_Long_Integer; uu_denom : Long_Long_Integer) return lldiv_t -- /usr/include/stdlib.h:858
with Import => True,
Convention => C,
External_Name => "lldiv";
-- Convert floating point numbers to strings. The returned values are
-- valid only until another call to the same function.
-- Convert VALUE to a string with NDIGIT digits and return a pointer to
-- this. Set *DECPT with the position of the decimal character and *SIGN
-- with the sign of the number.
function ecvt
(uu_value : double;
uu_ndigit : int;
uu_decpt : access int;
uu_sign : access int) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:872
with Import => True,
Convention => C,
External_Name => "ecvt";
-- Convert VALUE to a string rounded to NDIGIT decimal digits. Set *DECPT
-- with the position of the decimal character and *SIGN with the sign of
-- the number.
function fcvt
(uu_value : double;
uu_ndigit : int;
uu_decpt : access int;
uu_sign : access int) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:878
with Import => True,
Convention => C,
External_Name => "fcvt";
-- If possible convert VALUE to a string with NDIGIT significant digits.
-- Otherwise use exponential representation. The resulting string will
-- be written to BUF.
function gcvt
(uu_value : double;
uu_ndigit : int;
uu_buf : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:884
with Import => True,
Convention => C,
External_Name => "gcvt";
-- Long double versions of above functions.
function qecvt
(uu_value : long_double;
uu_ndigit : int;
uu_decpt : access int;
uu_sign : access int) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:890
with Import => True,
Convention => C,
External_Name => "qecvt";
function qfcvt
(uu_value : long_double;
uu_ndigit : int;
uu_decpt : access int;
uu_sign : access int) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:893
with Import => True,
Convention => C,
External_Name => "qfcvt";
function qgcvt
(uu_value : long_double;
uu_ndigit : int;
uu_buf : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:896
with Import => True,
Convention => C,
External_Name => "qgcvt";
-- Reentrant version of the functions above which provide their own
-- buffers.
function ecvt_r
(uu_value : double;
uu_ndigit : int;
uu_decpt : access int;
uu_sign : access int;
uu_buf : Interfaces.C.Strings.chars_ptr;
uu_len : stddef_h.size_t) return int -- /usr/include/stdlib.h:902
with Import => True,
Convention => C,
External_Name => "ecvt_r";
function fcvt_r
(uu_value : double;
uu_ndigit : int;
uu_decpt : access int;
uu_sign : access int;
uu_buf : Interfaces.C.Strings.chars_ptr;
uu_len : stddef_h.size_t) return int -- /usr/include/stdlib.h:905
with Import => True,
Convention => C,
External_Name => "fcvt_r";
function qecvt_r
(uu_value : long_double;
uu_ndigit : int;
uu_decpt : access int;
uu_sign : access int;
uu_buf : Interfaces.C.Strings.chars_ptr;
uu_len : stddef_h.size_t) return int -- /usr/include/stdlib.h:909
with Import => True,
Convention => C,
External_Name => "qecvt_r";
function qfcvt_r
(uu_value : long_double;
uu_ndigit : int;
uu_decpt : access int;
uu_sign : access int;
uu_buf : Interfaces.C.Strings.chars_ptr;
uu_len : stddef_h.size_t) return int -- /usr/include/stdlib.h:913
with Import => True,
Convention => C,
External_Name => "qfcvt_r";
-- Return the length of the multibyte character
-- in S, which is no longer than N.
function mblen (uu_s : Interfaces.C.Strings.chars_ptr; uu_n : stddef_h.size_t) return int -- /usr/include/stdlib.h:922
with Import => True,
Convention => C,
External_Name => "mblen";
-- Return the length of the given multibyte character,
-- putting its `wchar_t' representation in *PWC.
function mbtowc
(uu_pwc : access wchar_t;
uu_s : Interfaces.C.Strings.chars_ptr;
uu_n : stddef_h.size_t) return int -- /usr/include/stdlib.h:925
with Import => True,
Convention => C,
External_Name => "mbtowc";
-- Put the multibyte character represented
-- by WCHAR in S, returning its length.
function wctomb (uu_s : Interfaces.C.Strings.chars_ptr; uu_wchar : wchar_t) return int -- /usr/include/stdlib.h:929
with Import => True,
Convention => C,
External_Name => "wctomb";
-- Convert a multibyte string to a wide char string.
function mbstowcs
(uu_pwcs : access wchar_t;
uu_s : Interfaces.C.Strings.chars_ptr;
uu_n : stddef_h.size_t) return stddef_h.size_t -- /usr/include/stdlib.h:933
with Import => True,
Convention => C,
External_Name => "mbstowcs";
-- Convert a wide char string to multibyte string.
function wcstombs
(uu_s : Interfaces.C.Strings.chars_ptr;
uu_pwcs : access wchar_t;
uu_n : stddef_h.size_t) return stddef_h.size_t -- /usr/include/stdlib.h:937
with Import => True,
Convention => C,
External_Name => "wcstombs";
-- Determine whether the string value of RESPONSE matches the affirmation
-- or negative response expression as specified by the LC_MESSAGES category
-- in the program's current locale. Returns 1 if affirmative, 0 if
-- negative, and -1 if not matching.
function rpmatch (uu_response : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/stdlib.h:947
with Import => True,
Convention => C,
External_Name => "rpmatch";
-- Parse comma separated suboption from *OPTIONP and match against
-- strings in TOKENS. If found return index and set *VALUEP to
-- optional value introduced by an equal sign. If the suboption is
-- not part of TOKENS return in *VALUEP beginning of unknown
-- suboption. On exit *OPTIONP is set to the beginning of the next
-- token or at the terminating NUL character.
function getsubopt
(uu_optionp : System.Address;
uu_tokens : System.Address;
uu_valuep : System.Address) return int -- /usr/include/stdlib.h:958
with Import => True,
Convention => C,
External_Name => "getsubopt";
-- X/Open pseudo terminal handling.
-- Return a master pseudo-terminal handle.
function posix_openpt (uu_oflag : int) return int -- /usr/include/stdlib.h:969
with Import => True,
Convention => C,
External_Name => "posix_openpt";
-- The next four functions all take a master pseudo-tty fd and
-- perform an operation on the associated slave:
-- Chown the slave to the calling user.
function grantpt (uu_fd : int) return int -- /usr/include/stdlib.h:977
with Import => True,
Convention => C,
External_Name => "grantpt";
-- Release an internal lock so the slave can be opened.
-- Call after grantpt().
function unlockpt (uu_fd : int) return int -- /usr/include/stdlib.h:981
with Import => True,
Convention => C,
External_Name => "unlockpt";
-- Return the pathname of the pseudo terminal slave associated with
-- the master FD is open on, or NULL on errors.
-- The returned storage is good until the next call to this function.
function ptsname (uu_fd : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/stdlib.h:986
with Import => True,
Convention => C,
External_Name => "ptsname";
-- Store at most BUFLEN characters of the pathname of the slave pseudo
-- terminal associated with the master FD is open on in BUF.
-- Return 0 on success, otherwise an error number.
function ptsname_r
(uu_fd : int;
uu_buf : Interfaces.C.Strings.chars_ptr;
uu_buflen : stddef_h.size_t) return int -- /usr/include/stdlib.h:993
with Import => True,
Convention => C,
External_Name => "ptsname_r";
-- Open a master pseudo terminal and return its file descriptor.
function getpt return int -- /usr/include/stdlib.h:997
with Import => True,
Convention => C,
External_Name => "getpt";
-- Put the 1 minute, 5 minute and 15 minute load averages into the first
-- NELEM elements of LOADAVG. Return the number written (never more than
-- three, but may be less than NELEM), or -1 if an error occurred.
function getloadavg (uu_loadavg : access double; uu_nelem : int) return int -- /usr/include/stdlib.h:1004
with Import => True,
Convention => C,
External_Name => "getloadavg";
-- Return the index into the active-logins file (utmp) for
-- the controlling terminal.
-- Define some macros helping to catch buffer overflows.
end stdlib_h;
| 38.950755 | 177 | 0.659149 |
105e7ec994954b485ccfc6fb127992d340fd3174 | 7,353 | adb | Ada | src/Ada/ewok-posthook.adb | wookey-project/ewok-legacy | c973752dac3a0ebe3f7cfca062f50744578f051b | [
"Apache-2.0"
] | null | null | null | src/Ada/ewok-posthook.adb | wookey-project/ewok-legacy | c973752dac3a0ebe3f7cfca062f50744578f051b | [
"Apache-2.0"
] | null | null | null | src/Ada/ewok-posthook.adb | wookey-project/ewok-legacy | c973752dac3a0ebe3f7cfca062f50744578f051b | [
"Apache-2.0"
] | null | null | null | --
-- 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.exported.interrupts; use ewok.exported.interrupts;
with ewok.devices_shared; use ewok.devices_shared;
with ewok.interrupts;
with ewok.devices;
package body ewok.posthook
with spark_mode => off
is
function read_register (addr : system_address)
return unsigned_32
is
reg : unsigned_32
with import, volatile_full_access, address => to_address (addr);
begin
return reg;
end read_register;
pragma inline (read_register);
procedure set_bits_in_register
(addr : in system_address;
bits : in unsigned_32;
val : in unsigned_32)
is
reg : unsigned_32
with import, volatile_full_access, address => to_address (addr);
begin
if bits = 16#FFFF_FFFF# then
reg := val;
else
reg := (reg and (not bits)) or (val and bits);
end if;
end set_bits_in_register;
procedure exec
(intr : in soc.interrupts.t_interrupt;
status : out unsigned_32;
data : out unsigned_32)
is
dev_id : ewok.devices_shared.t_device_id;
dev_addr : system_address;
config : ewok.exported.interrupts.t_interrupt_config_access;
found : boolean;
val : unsigned_32;
mask : unsigned_32;
begin
config := ewok.devices.get_interrupt_config_from_interrupt (intr);
if config = NULL then
status := 0;
data := 0;
return;
end if;
dev_id := ewok.interrupts.get_device_from_interrupt (intr);
if dev_id = ID_DEV_UNUSED then
status := 0;
data := 0;
return;
end if;
dev_addr := ewok.devices.get_user_device_addr (dev_id);
for i in config.all.posthook.action'range loop
case config.all.posthook.action(i).instr is
when POSTHOOK_NIL =>
-- No subsequent action. Returning.
return;
when POSTHOOK_READ =>
val := read_register (dev_addr +
system_address (config.all.posthook.action(i).read.offset));
config.all.posthook.action(i).read.value := val;
-- This value need to be saved ?
if config.all.posthook.status =
config.all.posthook.action(i).read.offset
then
status := val;
end if;
-- This value need to be saved ?
if
config.all.posthook.data =
config.all.posthook.action(i).read.offset
then
data := val;
end if;
when POSTHOOK_WRITE =>
set_bits_in_register
(dev_addr + system_address
(config.all.posthook.action(i).write.offset),
config.all.posthook.action(i).write.mask,
config.all.posthook.action(i).write.value);
when POSTHOOK_WRITE_REG =>
-- Retrieving the already read register value
found := false;
for j in config.all.posthook.action'first .. i loop
if config.all.posthook.action(j).instr = POSTHOOK_READ and then
config.all.posthook.action(j).read.offset =
config.all.posthook.action(i).write_reg.offset_src
then
val := config.all.posthook.action(j).read.value;
found := true;
exit;
end if;
end loop;
if not found then
val := read_register (dev_addr + system_address
(config.all.posthook.action(i).write_reg.offset_src));
end if;
-- Calculating the mask to apply in order to write only active
-- bits
mask := config.all.posthook.action(i).write_reg.mask and val;
-- Inverted write might be needed
if config.all.posthook.action(i).write_reg.mode = MODE_NOT then
val := not val;
end if;
-- Writing into the destination register
set_bits_in_register
(dev_addr + system_address
(config.all.posthook.action(i).write_reg.offset_dest),
mask,
val);
when POSTHOOK_WRITE_MASK =>
-- Retrieving the value
found := false;
for j in config.all.posthook.action'first .. i loop
if config.all.posthook.action(j).instr = POSTHOOK_READ and then
config.all.posthook.action(j).read.offset =
config.all.posthook.action(i).write_mask.offset_src
then
val := config.all.posthook.action(j).read.value;
found := true;
exit;
end if;
end loop;
if not found then
val := read_register (dev_addr + system_address
(config.all.posthook.action(i).write_mask.offset_src));
end if;
-- Retrieving the mask
found := false;
for j in config.all.posthook.action'first .. i loop
if config.all.posthook.action(j).instr = POSTHOOK_READ and then
config.all.posthook.action(j).read.offset =
config.all.posthook.action(i).write_mask.offset_mask
then
mask := config.all.posthook.action(j).read.value;
found := true;
exit;
end if;
end loop;
if not found then
mask := read_register (dev_addr + system_address
(config.all.posthook.action(i).write_mask.offset_mask));
end if;
-- Calculating the mask
mask := mask and val;
-- Inverted write might be needed
if config.all.posthook.action(i).write_mask.mode = MODE_NOT then
val := not val;
end if;
-- Writing into the destination register
set_bits_in_register
(dev_addr + system_address
(config.all.posthook.action(i).write_mask.offset_dest),
mask,
val);
end case;
end loop;
end exec;
end ewok.posthook;
| 33.729358 | 81 | 0.538692 |
39de009278153de08318fdd8ad8cec546d5b97c6 | 13,878 | adb | Ada | linear_algebra/givens_qr_tst_1.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | 30 | 2018-12-09T01:15:04.000Z | 2022-03-20T16:14:54.000Z | linear_algebra/givens_qr_tst_1.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | null | null | null | linear_algebra/givens_qr_tst_1.adb | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | null | null | null |
-- Test QR decomposition real valued square matrices.
with Ada.Numerics.Generic_elementary_functions;
with Givens_QR;
with Test_Matrices;
With Text_IO; use Text_IO;
procedure givens_qr_tst_1 is
type Real is digits 15;
subtype Index is Integer range 1..137;
-- in this test, matrix is a square-shaped matrix on Index x Index.
-- eg Hilbert's matrix is a square matrix with unique elements on the range
-- Index'First .. Index'Last. However, you have the option to QR any rectangular
-- sub-block of the matrix that is defined on Index x Index (provided
-- number of rows is >= number of cols).
-- To do that you choose new values for Starting_Row, Starting_Col, Final_Row
-- Final_Col just below.
subtype Row_Index is Index;
subtype Col_Index is Index;
Starting_Row : constant Row_Index := Index'First + 0;
Starting_Col : constant Col_Index := Index'First + 0;
Final_Row : constant Row_Index := Index'Last- 0;
Final_Col : constant Col_Index := Index'Last- 0;
type Matrix is array(Row_Index, Col_Index) of Real;
--pragma Convention (Fortran, Matrix); --No! This QR prefers Ada convention.
package math is new Ada.Numerics.Generic_Elementary_Functions (Real);
use math;
package QR is new Givens_QR
(Real => Real,
R_Index => Index,
C_Index => Index,
A_Matrix => Matrix);
use QR;
-- QR exports Row_Vector and Col_Vector
package Make_Square_Matrix is new test_matrices (Real, Index, Matrix);
use Make_Square_Matrix;
package rio is new Float_IO(Real);
use rio;
--subtype Real_Extended is Real; -- general case, and for best speed
type Real_Extended is digits 18; -- 18 ok on intel
Zero : constant Real := +0.0;
One : constant Real := +1.0;
Two : constant Real := +2.0;
A, R : Matrix;
Q : Q_Matrix;
Max_Error : Real;
Frobenius_QR_Err_0 : Real;
Max_Error_qq, Max_Error_qr : Real;
Frobenius_QQ_Err, Frobenius_QR_Err : Real;
Scale : Col_Vector;
Permute : Permutation;
--------------------
-- Frobenius_Norm --
--------------------
function Frobenius_Norm
(A : in Matrix)
--Final_Row : in Index;
--Final_Col : in Index;
--Starting_Row : in Index;
--Starting_Col : in Index)
return Real
is
Max_A_Val : Real := Zero;
Sum, Scaling, tmp : Real := Zero;
begin
Max_A_Val := Zero;
for Row in Starting_Row .. Final_Row loop
for Col in Starting_Col .. Final_Col loop
if Max_A_Val < Abs A(Row, Col) then Max_A_Val := Abs A(Row, Col); end if;
end loop;
end loop;
Max_A_Val := Max_A_Val + Two ** (Real'Machine_Emin + 4);
Scaling := One / Max_A_Val;
Sum := Zero;
for Row in Starting_Row .. Final_Row loop
for Col in Starting_Col .. Final_Col loop
tmp := Scaling * A(Row, Col);
Sum := Sum + tmp * tmp;
end loop;
end loop;
return Sqrt (Sum) * Max_A_Val;
end Frobenius_Norm;
------------------------------------
-- Get_Error_in_QR_Decomposition --
------------------------------------
procedure Get_Error_in_QR_Decomposition
(A : in Matrix;
R : in Matrix;
Q : in Q_Matrix;
Scale : in Col_Vector;
Permute : in Permutation;
Max_Error : out Real;
Max_Error_F : out Real) is
Err : Real;
Min_Real : constant Real := 2.0 ** (Real'Machine_Emin + 2);
Product_Vector, Col_of_R : Col_Vector := (others => Zero);
Err_Matrix : Matrix;
begin
-- find error in A - Q*R
-- The Columns of R have been permuted; unpermute before comparison of A with Q*R
-- The Columns of R have been scaled. Before comparison of A with Q*R
-- Must unscale each col of R by multiplying them with 1/Scale(Permute(Col).
Max_Error := Zero;
for Col in Starting_Col .. Final_Col loop
Col_of_R := (others => Zero);
for Row in Starting_Row .. Final_Row loop
Col_of_R(Row) := R(Row, Col);
end loop;
Product_Vector := Q_x_Col_Vector (Q, Col_of_R);
for Row in Starting_Row .. Final_Row loop
Err := Abs (A(Row, Permute(Col)) -
--Product_Vector(Row) / (Scale(Permute(Col)) + Min_Real));
Product_Vector(Row) / (Scale(Row) + Min_Real));
if Err > Max_Error then
Max_Error := Err;
end if;
Err_Matrix(Row, Col) := Err;
end loop;
end loop;
-- Froebenius norm fractional error = ||Err_Matrix|| / ||M||
Max_Error_F := Frobenius_Norm (Err_Matrix) /
(Frobenius_Norm (A) + Min_Real);
end Get_Error_in_QR_Decomposition;
------------------------------------
-- Get_Err_in_Reassembled_Q_and_A --
------------------------------------
-- Get an explicit matrix version of the matrix Q. Call it V.
procedure Get_Err_in_Reassembled_Q_and_A
(A : in Matrix;
R : in Matrix;
Q : in Q_Matrix;
Scale : in Col_Vector;
Permute : in Permutation;
Final_Row : in Row_Index;
Final_Col : in Col_Index;
Starting_Row : in Row_Index;
Starting_Col : in Col_Index;
Frobenius_QQ_Err : out Real;
Frobenius_QR_Err : out Real;
Max_Error_QQ : out Real;
Max_Error_QR : out Real)
is
Err, S : Real;
Min_Real : constant Real := +2.0 **(Real'Machine_Emin + 4);
V, V_tr, Identity, Product_QQ : V_Matrix := (others => (others => Zero));
Sum : Real_Extended;
Product_A : Matrix;
subtype Row_Index_Subrange is Row_Index range Starting_Row .. Final_Row;
begin
for r in Row_Index_Subrange loop
Identity(r, r) := 1.0;
end loop;
-- Find error in I - V*V' etc.
-- Start V as identity matrix (V should be square. MxM == R_Index x R_Index)
-- Turn V into and explicit version of Q by calling Q_x_V_Matrix
-- (Q is an array of 2x2 rotation matrices.)
V := Identity;
Q_x_V_Matrix (Q, V);
-- Turn V_tr into and explicit version of Q_tr by calling Q_trans..x_V_Matrix
V_tr := Identity;
Q_transpose_x_V_Matrix (Q, V_tr);
-- Usually find that orthonormality of *Rows of V* and *Cols of V_tr* is best.
-- Notation: V' == V_tr == transpose of V.
for Col in Row_Index_Subrange loop
for Row in Row_Index_Subrange loop
Sum := 0.0;
for j in Row_Index_Subrange loop
--Sum := Sum + Real_Extended(V(j, Row)) * Real_Extended(V(j, Col)); --V'*V
Sum := Sum + Real_Extended(V(Row, j)) * Real_Extended(V(Col, j)); --V*V'
--Sum := Sum + V(Row, j) * V(Col, j); --V*V' has least err; rows of Q ortho
--Sum := Sum + V_tr(j, Row)*V_tr(j, Col); --V_tr'*V_tr also least err; cols V_tr
--Sum := Sum + V(Row, j) * V_tr(j, Col); --least err;
--Sum := Sum + V_tr(Row, j) * V(j, Col);
end loop;
Product_QQ(Row, Col) := Real (Sum);
end loop;
end loop;
-- get Product_QQ - Identity
Max_Error_QQ := Zero;
for Col in Row_Index_Subrange loop
for Row in Row_Index_Subrange loop
Err := Abs (Identity(Row, Col) - Product_QQ(Row, Col));
if Err > Max_Error_QQ then
Max_Error_QQ := Err;
end if;
end loop;
end loop;
-- Get Frobenius norm of: Product_QQ - I:
S := Zero;
for Col in Row_Index_Subrange loop
for Row in Row_Index_Subrange loop
Err := Identity(Row, Col) - Product_QQ(Row, Col);
S := S + Err * Err;
end loop;
end loop;
Frobenius_QQ_Err := Sqrt(S) / Sqrt (-Real(Starting_Row) + Real(Final_Row) + 1.0);
-- explicitly calculate Q*R by getting V*R == Q*R (V==Q).
for Col in Starting_Col .. Final_Col loop
for Row in Starting_Row .. Final_Row loop
Sum := 0.0;
for j in Starting_Row .. Final_Row loop
Sum := Sum + Real_Extended(V(Row, j)) * Real_Extended(R(j, Col)); --V*R
end loop;
Product_A(Row, Col) := Real (Sum);
end loop;
end loop;
-- recall that the actual decomposition is: A*Scale*Permute = Q*R
Max_Error_QR := Zero;
for Col in Starting_Col .. Final_Col loop
for Row in Starting_Row .. Final_Row loop
Err := Abs (A(Row, Permute(Col))
-- - Product_A(Row, Col) / (Scale(Permute(Col)) + Min_Real)); -- Scale > 0
- Product_A(Row, Col) / (Scale(Row) + Min_Real)); -- Scale > 0
if Err > Max_Error_QR then
Max_Error_QR := Err;
end if;
end loop;
end loop;
-- resuse array Product_A to get error matrix Error := Product_A - A:
for Col in Starting_Col .. Final_Col loop
for Row in Starting_Row .. Final_Row loop
Product_A(Row, Col) := A(Row, Permute(Col))
-- - Product_A(Row, Col) / (Scale(Permute(Col)) + Min_Real); -- Scale > 0
- Product_A(Row, Col) / (Scale(Row) + Min_Real); -- Scale > 0
end loop;
end loop;
Frobenius_QR_Err := Frobenius_Norm (Product_A) /
(Frobenius_Norm (A) + Min_Real);
end Get_Err_in_Reassembled_Q_and_A;
-----------
-- Pause --
-----------
procedure Pause (s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12 : string := "") is
Continue : Character := ' ';
begin
New_Line;
if S0 /= "" then put_line (S0); end if;
if S1 /= "" then put_line (S1); end if;
if S2 /= "" then put_line (S2); end if;
if S3 /= "" then put_line (S3); end if;
if S4 /= "" then put_line (S4); end if;
if S5 /= "" then put_line (S5); end if;
if S6 /= "" then put_line (S6); end if;
if S7 /= "" then put_line (S7); end if;
if S8 /= "" then put_line (S8); end if;
if S9 /= "" then put_line (S9); end if;
if S10 /= "" then put_line (S10); end if;
if S11 /= "" then put_line (S11); end if;
if S12 /= "" then put_line (S12); end if;
new_line;
begin
Put ("Enter a character to continue: ");
Get_Immediate (Continue);
exception
when others => null;
end;
end pause;
begin
Pause(
"Test 1: QR decomposition of matrix A. The QR decomposition of A is",
"successful if two identities are satisfied: Q'*Q = I and Q*R = A. If 15",
"digit Reals are used, then we expect the error in the calculation of A = Q*R to",
"be about 1 part in 10**15. In other words ||Q*R - A|| / ||A|| should be",
"around 10**(-15). Here ||*|| denotes the Frobenius Norm. Other matrix norms",
"give slightly different answers, so its an order of magnitude estimate. The",
"Q matrix is a list of 2x2 Givens rotations. Most operations (eg. equation",
"solving) use this representation of Q for best accuracy.",
" ",
"The tests are repeated using an explicit matrix for Q. The error in the",
"QR decomposition of A, i.e. ||Q*R - A|| / ||A|| is recalculated and printed",
"below so that you can see the increase in error."
);
for Chosen_Matrix in Matrix_Id loop
--for Chosen_Matrix in kahan .. kahan loop
--for Chosen_Matrix in kahan_col_scaled_2 .. kahan_col_scaled_2 loop
--for Chosen_Matrix in kahan .. kahan_col_scaled_2 loop
--for Chosen_Matrix in kahan .. kahan_row_scaled loop
Init_Matrix (A, Chosen_Matrix, Index'First, Index'Last);
R := A; -- A remains original A. Only R is input.
QR_Decompose
(A => R, -- A has now been tranformed into the R matrix
Q => Q,
Row_Scalings => Scale,
Col_Permutation => Permute,
Final_Row => Final_Row,
Final_Col => Final_Col,
Starting_Row => Starting_Row,
Starting_Col => Starting_Col);
--declare Row : Row_Index := Starting_Row; begin
--for Col in Starting_Col .. Final_Col loop
--put(R(Col, Col)); -- this is the R matrix but it has not been unscaled yet.
--if Row < Row_Index'Last then Row := Row + 1; end if;
--end loop;
--end;
if true then
new_line;
put("For matrix A of type "); put(Matrix_id'Image(Chosen_Matrix)); put(":");
new_line; put ("Min 3 diag elements:");
--for i in Starting_Col .. Final_Col loop
for i in Final_Col-2 .. Final_Col loop
put (r(i,i));
end loop;
new_line(1);
end if;
--goto endies;
Get_Err_in_Reassembled_Q_and_A
(A, R, Q, Scale, Permute,
Final_Row, Final_Col, Starting_Row, Starting_Col,
Frobenius_QQ_Err, Frobenius_QR_Err,
Max_Error_qq, Max_Error_qr);
Get_Error_in_QR_Decomposition
(A, R, Q, Scale, Permute,
Max_Error, Frobenius_QR_Err_0);
-- Froebenius norm fractional error:
-- Max_Error_F = ||Err_Matrix|| / ||A||
new_line;
put("For matrix A of type "); put(Matrix_id'Image(Chosen_Matrix)); put(":");
new_line;
put(" Err in I-Q'*Q (Q = explicit matrix) is ||I-Q'*Q|| / ||I|| =");
put(Frobenius_QQ_Err);
new_line;
put(" Err in A-Q*R (Q = explicit matrix) is ||A-Q*R || / ||A|| =");
put(Frobenius_QR_Err);
new_line;
put(" Err in A-Q*R (Q = Givens rotation) is ||A-Q*R || / ||A|| =");
put(Frobenius_QR_Err_0);
new_line;
<<endies>> null;
end loop;
end givens_qr_tst_1;
| 33.440964 | 89 | 0.56658 |
396aeaeae971e820570f92016d86b1c69bd8247a | 1,698 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/a-dinopr.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/a-dinopr.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/a-dinopr.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . D I S P A T C H I N G . N O N _ P R E E M P T I V E --
-- --
-- S p e c --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
-- This unit is not implemented in typical GNAT implementations that lie on
-- top of operating systems, because it is infeasible to implement in such
-- environments.
-- If a target environment provides appropriate support for this package,
-- then the Unimplemented_Unit pragma should be removed from this spec and
-- an appropriate body provided.
package Ada.Dispatching.Non_Preemptive is
pragma Preelaborate (Non_Preemptive);
pragma Unimplemented_Unit;
procedure Yield_To_Higher;
procedure Yield_To_Same_Or_Higher renames Yield;
end Ada.Dispatching.Non_Preemptive;
| 53.0625 | 78 | 0.448174 |
18343340fc4860aae69dd9af1d4146ebcd88b9d6 | 8,635 | adb | Ada | Src/display_p.adb | SMerrony/dashera | 74961f34a44cabae414e84537e8baae0ecb373c9 | [
"MIT"
] | 23 | 2021-12-12T15:20:22.000Z | 2022-03-19T19:55:06.000Z | Src/display_p.adb | SMerrony/dashera | 74961f34a44cabae414e84537e8baae0ecb373c9 | [
"MIT"
] | 1 | 2022-03-10T00:09:35.000Z | 2022-03-15T08:16:00.000Z | Src/display_p.adb | SMerrony/dashera | 74961f34a44cabae414e84537e8baae0ecb373c9 | [
"MIT"
] | 1 | 2022-03-11T19:42:02.000Z | 2022-03-11T19:42:02.000Z | -- Copyright ©2021,2022 Steve Merrony
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
package body Display_P is
protected body Display is
procedure Set_Dirty is begin Dirty := True; end Set_Dirty;
procedure Clear_Dirty is begin Dirty := False; end Clear_Dirty;
function Is_Dirty return Boolean is (Dirty);
function Get_Visible_Cols return Positive is (Disp.Visible_Cols);
function Get_Visible_Lines return Positive is (Disp.Visible_Lines);
procedure Set_Visible_Cols (Cols : in Positive) is begin Disp.Visible_Cols := Cols; end Set_Visible_Cols;
procedure Set_Visible_Lines (Lines : in Positive) is begin Disp.Visible_Lines := Lines; end Set_Visible_Lines;
function Is_Blink_Enabled return Boolean is (Disp.Blink_Enabled);
procedure Set_Blink_Enabled (Blink : in Boolean) is begin Disp.Blink_Enabled := Blink; end Set_Blink_Enabled;
function Get_Cursor_X return Natural is (Disp.Cursor_X);
function Get_Cursor_Y return Natural is (Disp.Cursor_Y);
procedure Init is
begin
Disp.Visible_Lines := Default_Lines;
Disp.Visible_Cols := Default_Cols;
for Line in 0 .. Total_Lines - 1 loop
for Col in 0 .. Total_Cols - 1 loop
Disp.Cells(Line, Col).Clear_To_Space;
end loop;
end loop;
Disp.Cells(12,39).Set (Value => 'O', Blnk => False, Dm => False, Rv => False, Under => False, Prot => False);
Disp.Cells(12,40).Set (Value => 'K', Blnk => False, Dm => False, Rv => False, Under => False, Prot => False);
Disp.Blink_Enabled := True;
History.First := 0;
History.Last := 0;
for C in Empty_History_Line'Range loop
Empty_History_Line(C).Clear_To_Space;
end loop;
for HL in History.Lines'Range loop
for Col in 0 .. Total_Cols - 1 loop
History.Lines(HL)(Col).Clear_To_Space;
end loop;
end loop;
Set_Scrolled_Back (False);
end Init;
procedure Copy (Src : in out Display_T; Dest : out Display_T) is
begin
for Line in 0 .. Src.Visible_Lines-1 loop
for Col in 0 .. Src.Visible_Cols-1 loop
Cell.Copy (Src => Src.Cells(Line,Col), Dest => Dest.Cells(Line,Col));
end loop;
end loop;
Dest.Blink_Enabled := Src.Blink_Enabled;
Dest.Cursor_X := Src.Cursor_X;
Dest.Cursor_Y := Src.Cursor_Y;
Dest.Visible_Cols := Src.Visible_Cols;
Dest.Visible_Lines := Src.Visible_Lines;
end Copy;
procedure Clear_Cell (Line, Col : in Natural) is
begin
Disp.Cells(Line, Col).Clear_To_Space;
end Clear_Cell;
procedure Clear_Unprotected_Cell (Line, Col : in Natural) is
begin
Disp.Cells(Line, Col).Clear_If_Unprotected;
end Clear_Unprotected_Cell;
procedure Get_Cell (Line, Col : in Natural; Value : out Character; Blnk, Dm, Rv, Under, Prot : out Boolean) is
begin
Disp.Cells(Line,Col).Get (Value => Value, Blnk => Blnk, Dm => Dm, Rv => Rv, Under => Under, Prot => Prot);
end Get_Cell;
procedure Set_Cell (Line, Col : in Natural; Char : in Character;
Blink, Dim, Rev, Under, Prot : in Boolean) is
begin
Disp.Cells(Line,Col).Set (Value => Char, Blnk => Blink, Dm => Dim,
Rv => Rev, Under => Under, Prot => Prot);
end Set_Cell;
procedure Set_Cursor (X, Y : in Natural) is
begin
Disp.Cursor_X := X;
Disp.Cursor_Y := Y;
end Set_Cursor;
procedure Clear_Line (Line : in Integer) is
begin
for Col in 0 .. Total_Cols - 1 loop
Disp.Cells(Line, Col).Clear_To_Space;
end loop;
end Clear_Line;
procedure Copy_Line (Src, Dest : in Integer) is
begin
for Col in 0 .. Total_Cols - 1 loop
Cell.Copy (Src => Disp.Cells(Src,Col), Dest => Disp.Cells(Dest,Col));
end loop;
end Copy_Line;
procedure Copy_Line_To_History (Src : in Integer) is
begin
History.Last := History.Last + 1;
if History.Last = History_Lines then
-- wrap-around
History.Last := 0;
end if;
-- has the tail hit the head?
if History.Last = History.First then
History.First := History.First + 1;
if History.First = History_Lines then
History.First := 0;
end if;
end if;
for C in History.Lines(History.Last)'Range loop
Cell.Copy (Src => Disp.Cells(Src,C), Dest => History.Lines(History.Last)(C));
end loop;
end Copy_Line_To_History;
procedure Copy_Line_From_History (Src, Dest : in Natural) is
HL : History_Line;
Ix : Integer;
begin
if History.First = History.Last then -- no history yet
for C in Empty_History_Line'Range loop
Cell.Copy (Src => Empty_History_Line(C), Dest => HL(C));
end loop;
else
Ix := History.Last - Src;
if Ix < 0 then
Ix := Ix + History_Lines;
end if;
for C in History.Lines(Ix)'Range loop
Cell.Copy (Src => History.Lines(Ix)(C), Dest => HL(C));
end loop;
end if;
for Col in 0 .. Total_Cols - 1 loop
Cell.Copy (Src => HL(Col), Dest => Disp.Cells(Dest,Col));
end loop;
end Copy_Line_From_History;
procedure Scroll_Up (Lines : in Natural) is
begin
for L in 1 .. Lines loop
Copy_Line_To_History (0);
for R in 1 .. Disp.Visible_Lines loop
Copy_Line (Src => R, Dest => R - 1);
Clear_Line (R);
end loop;
Clear_Line (Disp.Visible_Lines - 1);
end loop;
end Scroll_Up;
function Is_Scrolled_Back return Boolean is
(Scrolled_Back);
procedure Set_Scrolled_Back (Back : in Boolean) is
begin
Scrolled_Back := Back;
end Set_Scrolled_Back;
procedure Scroll_Back (Start_Line : in Natural) is
begin
if not Scrolled_Back then
Copy (Src => Disp, Dest => Saved_Disp);
Scrolled_Back := True;
end if;
-- there are two cases: we are already scrolled back beyond the 'live' screen,
-- or we are partially showing it
if Start_Line < Disp.Visible_Lines then
declare
On_Screen_Line, Live_Line : Natural := 0;
begin
for HL in reverse 0 .. Start_Line loop
Copy_Line_From_History (HL, On_Screen_Line);
On_Screen_Line := On_Screen_Line + 1;
end loop;
while On_Screen_Line < Disp.Visible_Lines loop
Copy_Line_From_History (Live_Line, On_Screen_Line);
Live_Line := Live_Line + 1;
On_Screen_Line := On_Screen_Line + 1;
end loop;
end;
else
-- all 'history' - easier
for L in 0 .. Disp.Visible_Lines loop
Copy_Line_From_History (Start_Line - L, L);
end loop;
end if;
Set_Dirty;
end Scroll_Back;
procedure Cancel_Scroll_Back is
begin
Copy (Src => Saved_Disp, Dest => Disp);
Scrolled_Back := False;
Set_Dirty;
end Cancel_Scroll_Back;
end Display;
end Display_P; | 39.25 | 118 | 0.595599 |
204a712f1d8ca92f223aea8dd6e0732f254b191d | 27,491 | ads | Ada | source/amf/mof/cmof/amf-internals-tables-cmof_metamodel-links.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/mof/cmof/amf-internals-tables-cmof_metamodel-links.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/mof/cmof/amf-internals-tables-cmof_metamodel-links.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package AMF.Internals.Tables.CMOF_Metamodel.Links is
procedure Initialize;
private
procedure Initialize_1;
procedure Initialize_2;
procedure Initialize_3;
procedure Initialize_4;
procedure Initialize_5;
procedure Initialize_6;
procedure Initialize_7;
procedure Initialize_8;
procedure Initialize_9;
procedure Initialize_10;
procedure Initialize_11;
procedure Initialize_12;
procedure Initialize_13;
procedure Initialize_14;
procedure Initialize_15;
procedure Initialize_16;
procedure Initialize_17;
procedure Initialize_18;
procedure Initialize_19;
procedure Initialize_20;
procedure Initialize_21;
procedure Initialize_22;
procedure Initialize_23;
procedure Initialize_24;
procedure Initialize_25;
procedure Initialize_26;
procedure Initialize_27;
procedure Initialize_28;
procedure Initialize_29;
procedure Initialize_30;
procedure Initialize_31;
procedure Initialize_32;
procedure Initialize_33;
procedure Initialize_34;
procedure Initialize_35;
procedure Initialize_36;
procedure Initialize_37;
procedure Initialize_38;
procedure Initialize_39;
procedure Initialize_40;
procedure Initialize_41;
procedure Initialize_42;
procedure Initialize_43;
procedure Initialize_44;
procedure Initialize_45;
procedure Initialize_46;
procedure Initialize_47;
procedure Initialize_48;
procedure Initialize_49;
procedure Initialize_50;
procedure Initialize_51;
procedure Initialize_52;
procedure Initialize_53;
procedure Initialize_54;
procedure Initialize_55;
procedure Initialize_56;
procedure Initialize_57;
procedure Initialize_58;
procedure Initialize_59;
procedure Initialize_60;
procedure Initialize_61;
procedure Initialize_62;
procedure Initialize_63;
procedure Initialize_64;
procedure Initialize_65;
procedure Initialize_66;
procedure Initialize_67;
procedure Initialize_68;
procedure Initialize_69;
procedure Initialize_70;
procedure Initialize_71;
procedure Initialize_72;
procedure Initialize_73;
procedure Initialize_74;
procedure Initialize_75;
procedure Initialize_76;
procedure Initialize_77;
procedure Initialize_78;
procedure Initialize_79;
procedure Initialize_80;
procedure Initialize_81;
procedure Initialize_82;
procedure Initialize_83;
procedure Initialize_84;
procedure Initialize_85;
procedure Initialize_86;
procedure Initialize_87;
procedure Initialize_88;
procedure Initialize_89;
procedure Initialize_90;
procedure Initialize_91;
procedure Initialize_92;
procedure Initialize_93;
procedure Initialize_94;
procedure Initialize_95;
procedure Initialize_96;
procedure Initialize_97;
procedure Initialize_98;
procedure Initialize_99;
procedure Initialize_100;
procedure Initialize_101;
procedure Initialize_102;
procedure Initialize_103;
procedure Initialize_104;
procedure Initialize_105;
procedure Initialize_106;
procedure Initialize_107;
procedure Initialize_108;
procedure Initialize_109;
procedure Initialize_110;
procedure Initialize_111;
procedure Initialize_112;
procedure Initialize_113;
procedure Initialize_114;
procedure Initialize_115;
procedure Initialize_116;
procedure Initialize_117;
procedure Initialize_118;
procedure Initialize_119;
procedure Initialize_120;
procedure Initialize_121;
procedure Initialize_122;
procedure Initialize_123;
procedure Initialize_124;
procedure Initialize_125;
procedure Initialize_126;
procedure Initialize_127;
procedure Initialize_128;
procedure Initialize_129;
procedure Initialize_130;
procedure Initialize_131;
procedure Initialize_132;
procedure Initialize_133;
procedure Initialize_134;
procedure Initialize_135;
procedure Initialize_136;
procedure Initialize_137;
procedure Initialize_138;
procedure Initialize_139;
procedure Initialize_140;
procedure Initialize_141;
procedure Initialize_142;
procedure Initialize_143;
procedure Initialize_144;
procedure Initialize_145;
procedure Initialize_146;
procedure Initialize_147;
procedure Initialize_148;
procedure Initialize_149;
procedure Initialize_150;
procedure Initialize_151;
procedure Initialize_152;
procedure Initialize_153;
procedure Initialize_154;
procedure Initialize_155;
procedure Initialize_156;
procedure Initialize_157;
procedure Initialize_158;
procedure Initialize_159;
procedure Initialize_160;
procedure Initialize_161;
procedure Initialize_162;
procedure Initialize_163;
procedure Initialize_164;
procedure Initialize_165;
procedure Initialize_166;
procedure Initialize_167;
procedure Initialize_168;
procedure Initialize_169;
procedure Initialize_170;
procedure Initialize_171;
procedure Initialize_172;
procedure Initialize_173;
procedure Initialize_174;
procedure Initialize_175;
procedure Initialize_176;
procedure Initialize_177;
procedure Initialize_178;
procedure Initialize_179;
procedure Initialize_180;
procedure Initialize_181;
procedure Initialize_182;
procedure Initialize_183;
procedure Initialize_184;
procedure Initialize_185;
procedure Initialize_186;
procedure Initialize_187;
procedure Initialize_188;
procedure Initialize_189;
procedure Initialize_190;
procedure Initialize_191;
procedure Initialize_192;
procedure Initialize_193;
procedure Initialize_194;
procedure Initialize_195;
procedure Initialize_196;
procedure Initialize_197;
procedure Initialize_198;
procedure Initialize_199;
procedure Initialize_200;
procedure Initialize_201;
procedure Initialize_202;
procedure Initialize_203;
procedure Initialize_204;
procedure Initialize_205;
procedure Initialize_206;
procedure Initialize_207;
procedure Initialize_208;
procedure Initialize_209;
procedure Initialize_210;
procedure Initialize_211;
procedure Initialize_212;
procedure Initialize_213;
procedure Initialize_214;
procedure Initialize_215;
procedure Initialize_216;
procedure Initialize_217;
procedure Initialize_218;
procedure Initialize_219;
procedure Initialize_220;
procedure Initialize_221;
procedure Initialize_222;
procedure Initialize_223;
procedure Initialize_224;
procedure Initialize_225;
procedure Initialize_226;
procedure Initialize_227;
procedure Initialize_228;
procedure Initialize_229;
procedure Initialize_230;
procedure Initialize_231;
procedure Initialize_232;
procedure Initialize_233;
procedure Initialize_234;
procedure Initialize_235;
procedure Initialize_236;
procedure Initialize_237;
procedure Initialize_238;
procedure Initialize_239;
procedure Initialize_240;
procedure Initialize_241;
procedure Initialize_242;
procedure Initialize_243;
procedure Initialize_244;
procedure Initialize_245;
procedure Initialize_246;
procedure Initialize_247;
procedure Initialize_248;
procedure Initialize_249;
procedure Initialize_250;
procedure Initialize_251;
procedure Initialize_252;
procedure Initialize_253;
procedure Initialize_254;
procedure Initialize_255;
procedure Initialize_256;
procedure Initialize_257;
procedure Initialize_258;
procedure Initialize_259;
procedure Initialize_260;
procedure Initialize_261;
procedure Initialize_262;
procedure Initialize_263;
procedure Initialize_264;
procedure Initialize_265;
procedure Initialize_266;
procedure Initialize_267;
procedure Initialize_268;
procedure Initialize_269;
procedure Initialize_270;
procedure Initialize_271;
procedure Initialize_272;
procedure Initialize_273;
procedure Initialize_274;
procedure Initialize_275;
procedure Initialize_276;
procedure Initialize_277;
procedure Initialize_278;
procedure Initialize_279;
procedure Initialize_280;
procedure Initialize_281;
procedure Initialize_282;
procedure Initialize_283;
procedure Initialize_284;
procedure Initialize_285;
procedure Initialize_286;
procedure Initialize_287;
procedure Initialize_288;
procedure Initialize_289;
procedure Initialize_290;
procedure Initialize_291;
procedure Initialize_292;
procedure Initialize_293;
procedure Initialize_294;
procedure Initialize_295;
procedure Initialize_296;
procedure Initialize_297;
procedure Initialize_298;
procedure Initialize_299;
procedure Initialize_300;
procedure Initialize_301;
procedure Initialize_302;
procedure Initialize_303;
procedure Initialize_304;
procedure Initialize_305;
procedure Initialize_306;
procedure Initialize_307;
procedure Initialize_308;
procedure Initialize_309;
procedure Initialize_310;
procedure Initialize_311;
procedure Initialize_312;
procedure Initialize_313;
procedure Initialize_314;
procedure Initialize_315;
procedure Initialize_316;
procedure Initialize_317;
procedure Initialize_318;
procedure Initialize_319;
procedure Initialize_320;
procedure Initialize_321;
procedure Initialize_322;
procedure Initialize_323;
procedure Initialize_324;
procedure Initialize_325;
procedure Initialize_326;
procedure Initialize_327;
procedure Initialize_328;
procedure Initialize_329;
procedure Initialize_330;
procedure Initialize_331;
procedure Initialize_332;
procedure Initialize_333;
procedure Initialize_334;
procedure Initialize_335;
procedure Initialize_336;
procedure Initialize_337;
procedure Initialize_338;
procedure Initialize_339;
procedure Initialize_340;
procedure Initialize_341;
procedure Initialize_342;
procedure Initialize_343;
procedure Initialize_344;
procedure Initialize_345;
procedure Initialize_346;
procedure Initialize_347;
procedure Initialize_348;
procedure Initialize_349;
procedure Initialize_350;
procedure Initialize_351;
procedure Initialize_352;
procedure Initialize_353;
procedure Initialize_354;
procedure Initialize_355;
procedure Initialize_356;
procedure Initialize_357;
procedure Initialize_358;
procedure Initialize_359;
procedure Initialize_360;
procedure Initialize_361;
procedure Initialize_362;
procedure Initialize_363;
procedure Initialize_364;
procedure Initialize_365;
procedure Initialize_366;
procedure Initialize_367;
procedure Initialize_368;
procedure Initialize_369;
procedure Initialize_370;
procedure Initialize_371;
procedure Initialize_372;
procedure Initialize_373;
procedure Initialize_374;
procedure Initialize_375;
procedure Initialize_376;
procedure Initialize_377;
procedure Initialize_378;
procedure Initialize_379;
procedure Initialize_380;
procedure Initialize_381;
procedure Initialize_382;
procedure Initialize_383;
procedure Initialize_384;
procedure Initialize_385;
procedure Initialize_386;
procedure Initialize_387;
procedure Initialize_388;
procedure Initialize_389;
procedure Initialize_390;
procedure Initialize_391;
procedure Initialize_392;
procedure Initialize_393;
procedure Initialize_394;
procedure Initialize_395;
procedure Initialize_396;
procedure Initialize_397;
procedure Initialize_398;
procedure Initialize_399;
procedure Initialize_400;
procedure Initialize_401;
procedure Initialize_402;
procedure Initialize_403;
procedure Initialize_404;
procedure Initialize_405;
procedure Initialize_406;
procedure Initialize_407;
procedure Initialize_408;
procedure Initialize_409;
procedure Initialize_410;
procedure Initialize_411;
procedure Initialize_412;
procedure Initialize_413;
procedure Initialize_414;
procedure Initialize_415;
procedure Initialize_416;
procedure Initialize_417;
procedure Initialize_418;
procedure Initialize_419;
procedure Initialize_420;
procedure Initialize_421;
procedure Initialize_422;
procedure Initialize_423;
procedure Initialize_424;
procedure Initialize_425;
procedure Initialize_426;
procedure Initialize_427;
procedure Initialize_428;
procedure Initialize_429;
procedure Initialize_430;
procedure Initialize_431;
procedure Initialize_432;
procedure Initialize_433;
procedure Initialize_434;
procedure Initialize_435;
procedure Initialize_436;
procedure Initialize_437;
procedure Initialize_438;
procedure Initialize_439;
procedure Initialize_440;
procedure Initialize_441;
procedure Initialize_442;
procedure Initialize_443;
procedure Initialize_444;
procedure Initialize_445;
procedure Initialize_446;
procedure Initialize_447;
procedure Initialize_448;
procedure Initialize_449;
procedure Initialize_450;
procedure Initialize_451;
procedure Initialize_452;
procedure Initialize_453;
procedure Initialize_454;
procedure Initialize_455;
procedure Initialize_456;
procedure Initialize_457;
procedure Initialize_458;
procedure Initialize_459;
procedure Initialize_460;
procedure Initialize_461;
procedure Initialize_462;
procedure Initialize_463;
procedure Initialize_464;
procedure Initialize_465;
procedure Initialize_466;
procedure Initialize_467;
procedure Initialize_468;
procedure Initialize_469;
procedure Initialize_470;
procedure Initialize_471;
procedure Initialize_472;
procedure Initialize_473;
procedure Initialize_474;
procedure Initialize_475;
procedure Initialize_476;
procedure Initialize_477;
procedure Initialize_478;
procedure Initialize_479;
procedure Initialize_480;
procedure Initialize_481;
procedure Initialize_482;
procedure Initialize_483;
procedure Initialize_484;
procedure Initialize_485;
procedure Initialize_486;
procedure Initialize_487;
procedure Initialize_488;
procedure Initialize_489;
procedure Initialize_490;
procedure Initialize_491;
procedure Initialize_492;
procedure Initialize_493;
procedure Initialize_494;
procedure Initialize_495;
procedure Initialize_496;
procedure Initialize_497;
procedure Initialize_498;
procedure Initialize_499;
procedure Initialize_500;
procedure Initialize_501;
procedure Initialize_502;
procedure Initialize_503;
procedure Initialize_504;
procedure Initialize_505;
procedure Initialize_506;
procedure Initialize_507;
procedure Initialize_508;
procedure Initialize_509;
procedure Initialize_510;
procedure Initialize_511;
procedure Initialize_512;
procedure Initialize_513;
procedure Initialize_514;
procedure Initialize_515;
procedure Initialize_516;
procedure Initialize_517;
procedure Initialize_518;
procedure Initialize_519;
procedure Initialize_520;
procedure Initialize_521;
procedure Initialize_522;
procedure Initialize_523;
procedure Initialize_524;
procedure Initialize_525;
procedure Initialize_526;
procedure Initialize_527;
procedure Initialize_528;
procedure Initialize_529;
procedure Initialize_530;
procedure Initialize_531;
procedure Initialize_532;
procedure Initialize_533;
procedure Initialize_534;
procedure Initialize_535;
procedure Initialize_536;
procedure Initialize_537;
procedure Initialize_538;
procedure Initialize_539;
procedure Initialize_540;
procedure Initialize_541;
procedure Initialize_542;
procedure Initialize_543;
procedure Initialize_544;
procedure Initialize_545;
procedure Initialize_546;
procedure Initialize_547;
procedure Initialize_548;
procedure Initialize_549;
procedure Initialize_550;
procedure Initialize_551;
procedure Initialize_552;
procedure Initialize_553;
procedure Initialize_554;
procedure Initialize_555;
procedure Initialize_556;
procedure Initialize_557;
procedure Initialize_558;
procedure Initialize_559;
procedure Initialize_560;
procedure Initialize_561;
procedure Initialize_562;
procedure Initialize_563;
procedure Initialize_564;
procedure Initialize_565;
procedure Initialize_566;
procedure Initialize_567;
procedure Initialize_568;
procedure Initialize_569;
procedure Initialize_570;
procedure Initialize_571;
procedure Initialize_572;
procedure Initialize_573;
procedure Initialize_574;
procedure Initialize_575;
procedure Initialize_576;
procedure Initialize_577;
procedure Initialize_578;
procedure Initialize_579;
procedure Initialize_580;
procedure Initialize_581;
procedure Initialize_582;
procedure Initialize_583;
procedure Initialize_584;
procedure Initialize_585;
procedure Initialize_586;
procedure Initialize_587;
procedure Initialize_588;
procedure Initialize_589;
procedure Initialize_590;
procedure Initialize_591;
procedure Initialize_592;
procedure Initialize_593;
procedure Initialize_594;
procedure Initialize_595;
procedure Initialize_596;
procedure Initialize_597;
procedure Initialize_598;
procedure Initialize_599;
procedure Initialize_600;
procedure Initialize_601;
procedure Initialize_602;
procedure Initialize_603;
procedure Initialize_604;
procedure Initialize_605;
procedure Initialize_606;
procedure Initialize_607;
procedure Initialize_608;
procedure Initialize_609;
procedure Initialize_610;
procedure Initialize_611;
procedure Initialize_612;
procedure Initialize_613;
procedure Initialize_614;
procedure Initialize_615;
procedure Initialize_616;
procedure Initialize_617;
procedure Initialize_618;
procedure Initialize_619;
procedure Initialize_620;
procedure Initialize_621;
procedure Initialize_622;
procedure Initialize_623;
procedure Initialize_624;
procedure Initialize_625;
procedure Initialize_626;
procedure Initialize_627;
procedure Initialize_628;
procedure Initialize_629;
procedure Initialize_630;
procedure Initialize_631;
procedure Initialize_632;
procedure Initialize_633;
procedure Initialize_634;
procedure Initialize_635;
procedure Initialize_636;
procedure Initialize_637;
procedure Initialize_638;
procedure Initialize_639;
procedure Initialize_640;
procedure Initialize_641;
procedure Initialize_642;
procedure Initialize_643;
procedure Initialize_644;
procedure Initialize_645;
procedure Initialize_646;
procedure Initialize_647;
procedure Initialize_648;
procedure Initialize_649;
procedure Initialize_650;
procedure Initialize_651;
procedure Initialize_652;
procedure Initialize_653;
procedure Initialize_654;
procedure Initialize_655;
procedure Initialize_656;
procedure Initialize_657;
procedure Initialize_658;
procedure Initialize_659;
procedure Initialize_660;
procedure Initialize_661;
procedure Initialize_662;
procedure Initialize_663;
procedure Initialize_664;
procedure Initialize_665;
procedure Initialize_666;
procedure Initialize_667;
procedure Initialize_668;
procedure Initialize_669;
procedure Initialize_670;
procedure Initialize_671;
procedure Initialize_672;
procedure Initialize_673;
procedure Initialize_674;
procedure Initialize_675;
procedure Initialize_676;
procedure Initialize_677;
procedure Initialize_678;
procedure Initialize_679;
procedure Initialize_680;
procedure Initialize_681;
procedure Initialize_682;
procedure Initialize_683;
procedure Initialize_684;
procedure Initialize_685;
procedure Initialize_686;
procedure Initialize_687;
procedure Initialize_688;
procedure Initialize_689;
procedure Initialize_690;
procedure Initialize_691;
procedure Initialize_692;
procedure Initialize_693;
procedure Initialize_694;
procedure Initialize_695;
procedure Initialize_696;
procedure Initialize_697;
procedure Initialize_698;
procedure Initialize_699;
procedure Initialize_700;
procedure Initialize_701;
procedure Initialize_702;
procedure Initialize_703;
procedure Initialize_704;
procedure Initialize_705;
procedure Initialize_706;
procedure Initialize_707;
procedure Initialize_708;
procedure Initialize_709;
procedure Initialize_710;
procedure Initialize_711;
procedure Initialize_712;
procedure Initialize_713;
procedure Initialize_714;
procedure Initialize_715;
procedure Initialize_716;
procedure Initialize_717;
procedure Initialize_718;
procedure Initialize_719;
procedure Initialize_720;
procedure Initialize_721;
procedure Initialize_722;
procedure Initialize_723;
procedure Initialize_724;
procedure Initialize_725;
procedure Initialize_726;
procedure Initialize_727;
procedure Initialize_728;
procedure Initialize_729;
procedure Initialize_730;
procedure Initialize_731;
procedure Initialize_732;
procedure Initialize_733;
procedure Initialize_734;
procedure Initialize_735;
procedure Initialize_736;
procedure Initialize_737;
procedure Initialize_738;
procedure Initialize_739;
procedure Initialize_740;
procedure Initialize_741;
procedure Initialize_742;
procedure Initialize_743;
procedure Initialize_744;
procedure Initialize_745;
procedure Initialize_746;
procedure Initialize_747;
procedure Initialize_748;
procedure Initialize_749;
procedure Initialize_750;
procedure Initialize_751;
procedure Initialize_752;
procedure Initialize_753;
procedure Initialize_754;
procedure Initialize_755;
procedure Initialize_756;
procedure Initialize_757;
procedure Initialize_758;
procedure Initialize_759;
procedure Initialize_760;
procedure Initialize_761;
procedure Initialize_762;
procedure Initialize_763;
procedure Initialize_764;
procedure Initialize_765;
procedure Initialize_766;
procedure Initialize_767;
procedure Initialize_768;
procedure Initialize_769;
procedure Initialize_770;
procedure Initialize_771;
procedure Initialize_772;
procedure Initialize_773;
procedure Initialize_774;
procedure Initialize_775;
procedure Initialize_776;
procedure Initialize_777;
procedure Initialize_778;
procedure Initialize_779;
procedure Initialize_780;
procedure Initialize_781;
procedure Initialize_782;
procedure Initialize_783;
procedure Initialize_784;
procedure Initialize_785;
procedure Initialize_786;
procedure Initialize_787;
procedure Initialize_788;
procedure Initialize_789;
procedure Initialize_790;
procedure Initialize_791;
procedure Initialize_792;
procedure Initialize_793;
procedure Initialize_794;
procedure Initialize_795;
procedure Initialize_796;
procedure Initialize_797;
procedure Initialize_798;
procedure Initialize_799;
procedure Initialize_800;
end AMF.Internals.Tables.CMOF_Metamodel.Links;
| 16.620919 | 78 | 0.717617 |
39ea0f6515ad2ad0d0d525b0db21d0cda381b622 | 865 | ads | Ada | contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/rdv_wait/pck.ads | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | 3 | 2021-05-04T17:09:06.000Z | 2021-10-04T07:19:26.000Z | contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/rdv_wait/pck.ads | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/rdv_wait/pck.ads | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | -- Copyright 2012-2020 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Pck is
procedure Break_Me;
-- A procedure doing nothing, but which is a convenient anchor
-- for inserting breakpoints.
end Pck;
| 37.608696 | 73 | 0.734104 |
20afccc46b83d6a0028975a1cc639cc854faa4a9 | 4,689 | adb | Ada | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-diflio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-diflio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-diflio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . F L O A T _ I O --
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package body System.Dim.Float_IO is
package Num_Dim_Float_IO is new Ada.Text_IO.Float_IO (Num_Dim_Float);
---------
-- Put --
---------
procedure Put
(File : File_Type;
Item : Num_Dim_Float;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp;
Symbol : String := "")
is
begin
Num_Dim_Float_IO.Put (File, Item, Fore, Aft, Exp);
Ada.Text_IO.Put (File, Symbol);
end Put;
procedure Put
(Item : Num_Dim_Float;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp;
Symbol : String := "")
is
begin
Num_Dim_Float_IO.Put (Item, Fore, Aft, Exp);
Ada.Text_IO.Put (Symbol);
end Put;
procedure Put
(To : out String;
Item : Num_Dim_Float;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp;
Symbol : String := "")
is
Ptr : constant Natural := Symbol'Length;
begin
Num_Dim_Float_IO.Put (To (To'First .. To'Last - Ptr), Item, Aft, Exp);
To (To'Last - Ptr + 1 .. To'Last) := Symbol;
end Put;
----------------
-- Put_Dim_Of --
----------------
pragma Warnings (Off);
-- kill warnings on unreferenced formals
procedure Put_Dim_Of
(File : File_Type;
Item : Num_Dim_Float;
Symbol : String := "")
is
begin
Ada.Text_IO.Put (File, Symbol);
end Put_Dim_Of;
procedure Put_Dim_Of
(Item : Num_Dim_Float;
Symbol : String := "")
is
begin
Ada.Text_IO.Put (Symbol);
end Put_Dim_Of;
procedure Put_Dim_Of
(To : out String;
Item : Num_Dim_Float;
Symbol : String := "")
is
begin
To (1 .. Symbol'Length) := Symbol;
end Put_Dim_Of;
-----------
-- Image --
-----------
function Image
(Item : Num_Dim_Float;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp;
Symbol : String := "") return String
is
Buffer : String (1 .. 50);
begin
Put (Buffer, Item, Aft, Exp);
for I in Buffer'Range loop
if Buffer (I) /= ' ' then
return Buffer (I .. Buffer'Last) & Symbol;
end if;
end loop;
end Image;
end System.Dim.Float_IO;
| 35.255639 | 78 | 0.44935 |
10fcc2eef210e124c61e3d6d564de950bbddb6c6 | 5,170 | adb | Ada | src/open_weather_map-api.adb | Jellix/open_weather_map_api | fa3484b361411b9362500a25e36d63d4bb6dbca3 | [
"WTFPL"
] | 1 | 2020-09-04T18:31:05.000Z | 2020-09-04T18:31:05.000Z | src/open_weather_map-api.adb | Jellix/open_weather_map_api | fa3484b361411b9362500a25e36d63d4bb6dbca3 | [
"WTFPL"
] | 2 | 2020-03-22T16:28:32.000Z | 2020-03-22T16:31:51.000Z | src/open_weather_map-api.adb | HeisenbugLtd/open_weather_map_api | fa3484b361411b9362500a25e36d63d4bb6dbca3 | [
"WTFPL"
] | null | null | null | --------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. ([email protected])
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
with Open_Weather_Map.API.Service.Group;
with Open_Weather_Map.API.Service.Location;
with Open_Weather_Map.API.Service.Weather;
package body Open_Weather_Map.API is
use type Client.T_Access;
My_Debug : constant not null GNATCOLL.Traces.Trace_Handle :=
GNATCOLL.Traces.Create (Unit_Name => "OWM.API");
-----------------------------------------------------------------------------
-- Create_Current_By_Coordinates
-----------------------------------------------------------------------------
function Create_Current_By_Coordinates
(Coordinates : in Geo_Coordinates;
Configuration : in GNATCOLL.JSON.JSON_Value;
Connection : in Client.T_Access := null;
Cache_Interval : in Ada.Real_Time.Time_Span := Default_Cache_Interval;
Rate_Limit : in Ada.Real_Time.Time_Span := Default_Rate_Limit)
return API.API_Class
is
My_Connection : Open_Weather_Map.Client.T_Access;
begin
My_Debug.all.Trace (Message => "Create_Current_By_Coordinates");
if Connection = null then
My_Debug.all.Trace
(Message =>
"Create_Current_By_Coordinates: " &
"No HTTP connection specified, creating new one...");
My_Connection := Client.Create (Configuration => Configuration,
Rate_Limit => Rate_Limit);
else
My_Connection := Connection;
end if;
return Result : Service.Location.T do
Result.Initialize (Configuration => Configuration,
Connection => My_Connection,
Max_Cache_Interval => Cache_Interval,
Coordinates => Coordinates);
end return;
end Create_Current_By_Coordinates;
-----------------------------------------------------------------------------
-- Create_Current_By_Group
-----------------------------------------------------------------------------
function Create_Current_By_Group
(Ids : in Group_List;
Configuration : in GNATCOLL.JSON.JSON_Value;
Connection : in Client.T_Access := null;
Cache_Interval : in Ada.Real_Time.Time_Span := Default_Cache_Interval;
Rate_Limit : in Ada.Real_Time.Time_Span := Default_Rate_Limit)
return API.API_Class
is
My_Connection : Open_Weather_Map.Client.T_Access;
begin
My_Debug.all.Trace (Message => "Create_Current_By_Group");
if Connection = null then
My_Debug.all.Trace
(Message =>
"Create_Current_By_Group: " &
"No HTTP connection specified, creating new one...");
My_Connection := Client.Create (Configuration => Configuration,
Rate_Limit => Rate_Limit);
else
My_Connection := Connection;
end if;
return Result : Service.Group.T do
Result.Initialize (Configuration => Configuration,
Connection => My_Connection,
Max_Cache_Interval => Cache_Interval,
Ids => Ids);
end return;
end Create_Current_By_Group;
-----------------------------------------------------------------------------
-- Create_Current_By_Id
-----------------------------------------------------------------------------
function Create_Current_By_Id
(Id : in City_Id;
Configuration : in GNATCOLL.JSON.JSON_Value;
Connection : in Client.T_Access := null;
Cache_Interval : in Ada.Real_Time.Time_Span := Default_Cache_Interval;
Rate_Limit : in Ada.Real_Time.Time_Span := Default_Rate_Limit)
return API.API_Class
is
My_Connection : Open_Weather_Map.Client.T_Access;
begin
My_Debug.all.Trace (Message => "Create_Current_By_Id");
if Connection = null then
My_Debug.all.Trace
(Message =>
"Create_Current_By_Id: " &
"No HTTP connection specified, creating new one...");
My_Connection := Client.Create (Configuration => Configuration,
Rate_Limit => Rate_Limit);
else
My_Connection := Connection;
end if;
return Result : Service.Weather.T do
Result.Initialize (Configuration => Configuration,
Connection => My_Connection,
Max_Cache_Interval => Cache_Interval,
Id => Id);
end return;
end Create_Current_By_Id;
end Open_Weather_Map.API;
| 40.708661 | 80 | 0.530368 |
0e39452a9d2bfee4e89e0e3b562be88bfaa14d7f | 4,019 | ads | Ada | tools/scitools/conf/understand/ada/ada05/s-traces.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/conf/understand/ada/ada05/s-traces.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | tools/scitools/conf/understand/ada/ada05/s-traces.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2005 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, 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. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
--
--
--
--
--
--
--
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements functions for traces when tasking is not involved
-- Warning : NO dependencies to tasking should be created here
-- This package, and all its children are used to implement debug
-- informations
-- A new primitive, Send_Trace_Info (Id : Trace_T; 'data') is introduced.
-- Trace_T is an event identifier, 'data' are the informations to pass
-- with the event. Thid procedure is used from within the Runtime to send
-- debug informations.
-- This primitive is overloaded in System.Traces.Tasking and this package.
-- Send_Trace_Info calls Send_Trace, in System.Traces.Send, which is trarget
-- dependent, to send the debug informations to a debugger, stream ..
-- To add a new event, just add them to the Trace_T type, and write the
-- corresponding Send_Trace_Info procedure. It may be required for some
-- target to modify Send_Trace (eg. VxWorks).
-- To add a new target, just adapt System.Traces.Send to your own purpose.
package System.Traces is
pragma Preelaborate;
type Trace_T is
(
-- Events handled.
-- Messages
--
M_Accept_Complete,
M_Select_Else,
M_RDV_Complete,
M_Call_Complete,
M_Delay,
-- Errors
--
E_Missed,
E_Timeout,
E_Kill,
-- Waiting events
--
W_Call,
W_Accept,
W_Select,
W_Completion,
W_Delay,
WU_Delay,
WT_Call,
WT_Select,
WT_Completion,
-- Protected objects events
--
PO_Call,
POT_Call,
PO_Run,
PO_Lock,
PO_Unlock,
PO_Done,
-- Task handling events
--
T_Create,
T_Activate,
T_Abort,
T_Terminate);
-- Send_Trace_Info procedures
-- They are overloaded, depending on the parameters passed with
-- the event, e.g. Time information, Task name, Accept name ...
procedure Send_Trace_Info (Id : Trace_T);
procedure Send_Trace_Info (Id : Trace_T; Timeout : Duration);
end System.Traces;
| 34.350427 | 78 | 0.512316 |
1059f786f763d2a39504c8eb372adf2753ec0bc3 | 2,577 | ads | Ada | tools/scitools/conf/understand/ada/ada05/s-wwdcha.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/conf/understand/ada/ada05/s-wwdcha.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | tools/scitools/conf/understand/ada/ada05/s-wwdcha.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . W W D _ C H A R --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, 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 2, 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 COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
--
--
--
--
--
--
--
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the routine used for Character'Wide_[Wide_]Width
package System.WWd_Char is
pragma Pure;
function Wide_Width_Character (Lo, Hi : Character) return Natural;
-- Compute Wide_Width attribute for non-static type derived from
-- Character. The arguments are the low and high bounds for the type.
function Wide_Wide_Width_Character (Lo, Hi : Character) return Natural;
-- Compute Wide_Wide_Width attribute for non-static type derived from
-- Character. The arguments are the low and high bounds for the type.
end System.WWd_Char;
| 53.6875 | 79 | 0.450912 |
3979bf3bdcdb13cf766417aef27403ed284a6c82 | 18,762 | ads | Ada | src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_rtp_gstrtpbuffer_h.ads | persan/A-gst | 7a39693d105617adea52680424c862a1a08f7368 | [
"Apache-2.0"
] | 1 | 2018-01-18T00:51:00.000Z | 2018-01-18T00:51:00.000Z | src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_rtp_gstrtpbuffer_h.ads | persan/A-gst | 7a39693d105617adea52680424c862a1a08f7368 | [
"Apache-2.0"
] | null | null | null | src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_rtp_gstrtpbuffer_h.ads | persan/A-gst | 7a39693d105617adea52680424c862a1a08f7368 | [
"Apache-2.0"
] | null | null | null | pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h;
with glib;
with glib.Values;
with System;
with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h;
with System;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstrtpbuffer_h is
GST_RTP_VERSION : constant := 2; -- gst/rtp/gstrtpbuffer.h:37
-- GStreamer
-- * Copyright (C) <2005> Philippe Khalaf <[email protected]>
-- * <2005> Wim Taymans <[email protected]>
-- *
-- * gstrtpbuffer.h: various helper functions to manipulate buffers
-- * with RTP payload.
-- *
-- * 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.
--
--*
-- * GST_RTP_VERSION:
-- *
-- * The supported RTP version 2.
--
-- creating buffers
procedure gst_rtp_buffer_allocate_data
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
payload_len : GLIB.guint;
pad_len : GLIB.guint8;
csrc_count : GLIB.guint8); -- gst/rtp/gstrtpbuffer.h:40
pragma Import (C, gst_rtp_buffer_allocate_data, "gst_rtp_buffer_allocate_data");
function gst_rtp_buffer_new_take_data (data : System.Address; len : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:43
pragma Import (C, gst_rtp_buffer_new_take_data, "gst_rtp_buffer_new_take_data");
function gst_rtp_buffer_new_copy_data (data : System.Address; len : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:44
pragma Import (C, gst_rtp_buffer_new_copy_data, "gst_rtp_buffer_new_copy_data");
function gst_rtp_buffer_new_allocate
(payload_len : GLIB.guint;
pad_len : GLIB.guint8;
csrc_count : GLIB.guint8) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:45
pragma Import (C, gst_rtp_buffer_new_allocate, "gst_rtp_buffer_new_allocate");
function gst_rtp_buffer_new_allocate_len
(packet_len : GLIB.guint;
pad_len : GLIB.guint8;
csrc_count : GLIB.guint8) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:46
pragma Import (C, gst_rtp_buffer_new_allocate_len, "gst_rtp_buffer_new_allocate_len");
function gst_rtp_buffer_list_from_buffer (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return System.Address; -- gst/rtp/gstrtpbuffer.h:48
pragma Import (C, gst_rtp_buffer_list_from_buffer, "gst_rtp_buffer_list_from_buffer");
function gst_rtp_buffer_calc_header_len (csrc_count : GLIB.guint8) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:51
pragma Import (C, gst_rtp_buffer_calc_header_len, "gst_rtp_buffer_calc_header_len");
function gst_rtp_buffer_calc_packet_len
(payload_len : GLIB.guint;
pad_len : GLIB.guint8;
csrc_count : GLIB.guint8) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:52
pragma Import (C, gst_rtp_buffer_calc_packet_len, "gst_rtp_buffer_calc_packet_len");
function gst_rtp_buffer_calc_payload_len
(packet_len : GLIB.guint;
pad_len : GLIB.guint8;
csrc_count : GLIB.guint8) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:53
pragma Import (C, gst_rtp_buffer_calc_payload_len, "gst_rtp_buffer_calc_payload_len");
function gst_rtp_buffer_validate_data (data : access GLIB.guint8; len : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:55
pragma Import (C, gst_rtp_buffer_validate_data, "gst_rtp_buffer_validate_data");
function gst_rtp_buffer_validate (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:56
pragma Import (C, gst_rtp_buffer_validate, "gst_rtp_buffer_validate");
function gst_rtp_buffer_list_validate (list : System.Address) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:57
pragma Import (C, gst_rtp_buffer_list_validate, "gst_rtp_buffer_list_validate");
procedure gst_rtp_buffer_set_packet_len (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; len : GLIB.guint); -- gst/rtp/gstrtpbuffer.h:59
pragma Import (C, gst_rtp_buffer_set_packet_len, "gst_rtp_buffer_set_packet_len");
function gst_rtp_buffer_get_packet_len (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:60
pragma Import (C, gst_rtp_buffer_get_packet_len, "gst_rtp_buffer_get_packet_len");
function gst_rtp_buffer_get_header_len (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:62
pragma Import (C, gst_rtp_buffer_get_header_len, "gst_rtp_buffer_get_header_len");
function gst_rtp_buffer_get_version (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint8; -- gst/rtp/gstrtpbuffer.h:64
pragma Import (C, gst_rtp_buffer_get_version, "gst_rtp_buffer_get_version");
procedure gst_rtp_buffer_set_version (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; version : GLIB.guint8); -- gst/rtp/gstrtpbuffer.h:65
pragma Import (C, gst_rtp_buffer_set_version, "gst_rtp_buffer_set_version");
function gst_rtp_buffer_get_padding (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:67
pragma Import (C, gst_rtp_buffer_get_padding, "gst_rtp_buffer_get_padding");
procedure gst_rtp_buffer_set_padding (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; padding : GLIB.gboolean); -- gst/rtp/gstrtpbuffer.h:68
pragma Import (C, gst_rtp_buffer_set_padding, "gst_rtp_buffer_set_padding");
procedure gst_rtp_buffer_pad_to (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; len : GLIB.guint); -- gst/rtp/gstrtpbuffer.h:69
pragma Import (C, gst_rtp_buffer_pad_to, "gst_rtp_buffer_pad_to");
function gst_rtp_buffer_get_extension (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:71
pragma Import (C, gst_rtp_buffer_get_extension, "gst_rtp_buffer_get_extension");
procedure gst_rtp_buffer_set_extension (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; extension : GLIB.gboolean); -- gst/rtp/gstrtpbuffer.h:72
pragma Import (C, gst_rtp_buffer_set_extension, "gst_rtp_buffer_set_extension");
function gst_rtp_buffer_get_extension_data
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
bits : access GLIB.guint16;
data : System.Address;
wordlen : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:73
pragma Import (C, gst_rtp_buffer_get_extension_data, "gst_rtp_buffer_get_extension_data");
function gst_rtp_buffer_set_extension_data
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
bits : GLIB.guint16;
length : GLIB.guint16) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:75
pragma Import (C, gst_rtp_buffer_set_extension_data, "gst_rtp_buffer_set_extension_data");
function gst_rtp_buffer_get_ssrc (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:77
pragma Import (C, gst_rtp_buffer_get_ssrc, "gst_rtp_buffer_get_ssrc");
function gst_rtp_buffer_list_get_ssrc (list : System.Address) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:78
pragma Import (C, gst_rtp_buffer_list_get_ssrc, "gst_rtp_buffer_list_get_ssrc");
procedure gst_rtp_buffer_set_ssrc (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; ssrc : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:79
pragma Import (C, gst_rtp_buffer_set_ssrc, "gst_rtp_buffer_set_ssrc");
procedure gst_rtp_buffer_list_set_ssrc (list : System.Address; ssrc : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:80
pragma Import (C, gst_rtp_buffer_list_set_ssrc, "gst_rtp_buffer_list_set_ssrc");
function gst_rtp_buffer_get_csrc_count (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint8; -- gst/rtp/gstrtpbuffer.h:82
pragma Import (C, gst_rtp_buffer_get_csrc_count, "gst_rtp_buffer_get_csrc_count");
function gst_rtp_buffer_get_csrc (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; idx : GLIB.guint8) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:83
pragma Import (C, gst_rtp_buffer_get_csrc, "gst_rtp_buffer_get_csrc");
procedure gst_rtp_buffer_set_csrc
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
idx : GLIB.guint8;
csrc : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:84
pragma Import (C, gst_rtp_buffer_set_csrc, "gst_rtp_buffer_set_csrc");
function gst_rtp_buffer_get_marker (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:86
pragma Import (C, gst_rtp_buffer_get_marker, "gst_rtp_buffer_get_marker");
procedure gst_rtp_buffer_set_marker (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; marker : GLIB.gboolean); -- gst/rtp/gstrtpbuffer.h:87
pragma Import (C, gst_rtp_buffer_set_marker, "gst_rtp_buffer_set_marker");
function gst_rtp_buffer_get_payload_type (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint8; -- gst/rtp/gstrtpbuffer.h:89
pragma Import (C, gst_rtp_buffer_get_payload_type, "gst_rtp_buffer_get_payload_type");
function gst_rtp_buffer_list_get_payload_type (list : System.Address) return GLIB.guint8; -- gst/rtp/gstrtpbuffer.h:90
pragma Import (C, gst_rtp_buffer_list_get_payload_type, "gst_rtp_buffer_list_get_payload_type");
procedure gst_rtp_buffer_set_payload_type (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; payload_type : GLIB.guint8); -- gst/rtp/gstrtpbuffer.h:91
pragma Import (C, gst_rtp_buffer_set_payload_type, "gst_rtp_buffer_set_payload_type");
procedure gst_rtp_buffer_list_set_payload_type (list : System.Address; payload_type : GLIB.guint8); -- gst/rtp/gstrtpbuffer.h:92
pragma Import (C, gst_rtp_buffer_list_set_payload_type, "gst_rtp_buffer_list_set_payload_type");
function gst_rtp_buffer_get_seq (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint16; -- gst/rtp/gstrtpbuffer.h:94
pragma Import (C, gst_rtp_buffer_get_seq, "gst_rtp_buffer_get_seq");
function gst_rtp_buffer_list_get_seq (list : System.Address) return GLIB.guint16; -- gst/rtp/gstrtpbuffer.h:95
pragma Import (C, gst_rtp_buffer_list_get_seq, "gst_rtp_buffer_list_get_seq");
procedure gst_rtp_buffer_set_seq (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; seq : GLIB.guint16); -- gst/rtp/gstrtpbuffer.h:96
pragma Import (C, gst_rtp_buffer_set_seq, "gst_rtp_buffer_set_seq");
function gst_rtp_buffer_list_set_seq (list : System.Address; seq : GLIB.guint16) return GLIB.guint16; -- gst/rtp/gstrtpbuffer.h:97
pragma Import (C, gst_rtp_buffer_list_set_seq, "gst_rtp_buffer_list_set_seq");
function gst_rtp_buffer_get_timestamp (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:99
pragma Import (C, gst_rtp_buffer_get_timestamp, "gst_rtp_buffer_get_timestamp");
function gst_rtp_buffer_list_get_timestamp (list : System.Address) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:100
pragma Import (C, gst_rtp_buffer_list_get_timestamp, "gst_rtp_buffer_list_get_timestamp");
procedure gst_rtp_buffer_set_timestamp (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; timestamp : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:101
pragma Import (C, gst_rtp_buffer_set_timestamp, "gst_rtp_buffer_set_timestamp");
procedure gst_rtp_buffer_list_set_timestamp (list : System.Address; timestamp : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:102
pragma Import (C, gst_rtp_buffer_list_set_timestamp, "gst_rtp_buffer_list_set_timestamp");
function gst_rtp_buffer_get_payload_buffer (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:104
pragma Import (C, gst_rtp_buffer_get_payload_buffer, "gst_rtp_buffer_get_payload_buffer");
function gst_rtp_buffer_get_payload_subbuffer
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
offset : GLIB.guint;
len : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:105
pragma Import (C, gst_rtp_buffer_get_payload_subbuffer, "gst_rtp_buffer_get_payload_subbuffer");
function gst_rtp_buffer_get_payload_len (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:107
pragma Import (C, gst_rtp_buffer_get_payload_len, "gst_rtp_buffer_get_payload_len");
function gst_rtp_buffer_list_get_payload_len (list : System.Address) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:108
pragma Import (C, gst_rtp_buffer_list_get_payload_len, "gst_rtp_buffer_list_get_payload_len");
function gst_rtp_buffer_get_payload (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return System.Address; -- gst/rtp/gstrtpbuffer.h:109
pragma Import (C, gst_rtp_buffer_get_payload, "gst_rtp_buffer_get_payload");
-- some helpers
function gst_rtp_buffer_default_clock_rate (payload_type : GLIB.guint8) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:112
pragma Import (C, gst_rtp_buffer_default_clock_rate, "gst_rtp_buffer_default_clock_rate");
function gst_rtp_buffer_compare_seqnum (seqnum1 : GLIB.guint16; seqnum2 : GLIB.guint16) return GLIB.gint; -- gst/rtp/gstrtpbuffer.h:113
pragma Import (C, gst_rtp_buffer_compare_seqnum, "gst_rtp_buffer_compare_seqnum");
function gst_rtp_buffer_ext_timestamp (exttimestamp : access GLIB.guint64; timestamp : GLIB.guint32) return GLIB.guint64; -- gst/rtp/gstrtpbuffer.h:114
pragma Import (C, gst_rtp_buffer_ext_timestamp, "gst_rtp_buffer_ext_timestamp");
function gst_rtp_buffer_get_extension_onebyte_header
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
id : GLIB.guint8;
nth : GLIB.guint;
data : System.Address;
size : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:116
pragma Import (C, gst_rtp_buffer_get_extension_onebyte_header, "gst_rtp_buffer_get_extension_onebyte_header");
function gst_rtp_buffer_get_extension_twobytes_header
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
appbits : access GLIB.guint8;
id : GLIB.guint8;
nth : GLIB.guint;
data : System.Address;
size : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:121
pragma Import (C, gst_rtp_buffer_get_extension_twobytes_header, "gst_rtp_buffer_get_extension_twobytes_header");
function gst_rtp_buffer_add_extension_onebyte_header
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
id : GLIB.guint8;
data : System.Address;
size : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:128
pragma Import (C, gst_rtp_buffer_add_extension_onebyte_header, "gst_rtp_buffer_add_extension_onebyte_header");
function gst_rtp_buffer_add_extension_twobytes_header
(buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
appbits : GLIB.guint8;
id : GLIB.guint8;
data : System.Address;
size : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:132
pragma Import (C, gst_rtp_buffer_add_extension_twobytes_header, "gst_rtp_buffer_add_extension_twobytes_header");
function gst_rtp_buffer_list_get_extension_onebyte_header
(bufferlist : System.Address;
group_idx : GLIB.guint;
id : GLIB.guint8;
nth : GLIB.guint;
data : System.Address;
size : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:138
pragma Import (C, gst_rtp_buffer_list_get_extension_onebyte_header, "gst_rtp_buffer_list_get_extension_onebyte_header");
function gst_rtp_buffer_list_get_extension_twobytes_header
(bufferlist : System.Address;
group_idx : GLIB.guint;
appbits : access GLIB.guint8;
id : GLIB.guint8;
nth : GLIB.guint;
data : System.Address;
size : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:144
pragma Import (C, gst_rtp_buffer_list_get_extension_twobytes_header, "gst_rtp_buffer_list_get_extension_twobytes_header");
function gst_rtp_buffer_list_add_extension_onebyte_header
(it : System.Address;
id : GLIB.guint8;
data : System.Address;
size : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:152
pragma Import (C, gst_rtp_buffer_list_add_extension_onebyte_header, "gst_rtp_buffer_list_add_extension_onebyte_header");
function gst_rtp_buffer_list_add_extension_twobytes_header
(it : System.Address;
appbits : GLIB.guint8;
id : GLIB.guint8;
data : System.Address;
size : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:156
pragma Import (C, gst_rtp_buffer_list_add_extension_twobytes_header, "gst_rtp_buffer_list_add_extension_twobytes_header");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstrtpbuffer_h;
| 61.920792 | 239 | 0.789735 |
187033773d05916835ee69adfe7560104923ba1e | 5,012 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c37405a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c37405a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c37405a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C37405A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT WHEN ASSIGNING TO A CONSTRAINED OR UNCONSTRAINED
-- OBJECT OR FORMAL PARAMETER OF A TYPE DECLARED WITH DEFAULT
-- DISCRIMINANTS, THE ASSIGNMENT DOES NOT CHANGE THE 'CONSTRAINED
-- ATTRIBUTE VALUE ASSOCIATED WITH THE OBJECT OR PARAMETER.
-- ASL 7/21/81
-- TBN 1/20/86 RENAMED FROM C37209A.ADA AND REVISED THE ASSIGNMENTS
-- OF CONSTRAINED AND UNCONSTRAINED OBJECTS TO ARRAY AND
-- RECORD COMPONENTS.
WITH REPORT; USE REPORT;
PROCEDURE C37405A IS
TYPE REC(DISC : INTEGER := 25) IS
RECORD
COMP : INTEGER;
END RECORD;
SUBTYPE CONSTR IS REC(10);
SUBTYPE UNCONSTR IS REC;
TYPE REC_C IS
RECORD
COMP: CONSTR;
END RECORD;
TYPE REC_U IS
RECORD
COMP: UNCONSTR;
END RECORD;
C1,C2 : CONSTR;
U1,U2 : UNCONSTR;
-- C2 AND U2 ARE NOT PASSED TO EITHER PROC1 OR PROC2.
ARR_C : ARRAY (1..5) OF CONSTR;
ARR_U : ARRAY (1..5) OF UNCONSTR;
REC_COMP_C : REC_C;
REC_COMP_U : REC_U;
PROCEDURE PROC11(PARM : IN OUT UNCONSTR; B : IN BOOLEAN) IS
BEGIN
PARM := C2;
IF IDENT_BOOL(B) /= PARM'CONSTRAINED THEN
FAILED ("'CONSTRAINED ATTRIBUTE CHANGED BY " &
"ASSIGNMENT - 1");
END IF;
END PROC11;
PROCEDURE PROC12(PARM : IN OUT UNCONSTR; B : IN BOOLEAN) IS
BEGIN
PARM := U2;
IF B /= PARM'CONSTRAINED THEN
FAILED ("'CONSTRAINED ATTRIBUTE CHANGED BY " &
"ASSIGNMENT - 2");
END IF;
END PROC12;
PROCEDURE PROC1(PARM : IN OUT UNCONSTR; B : IN BOOLEAN) IS
BEGIN
IF B /= PARM'CONSTRAINED THEN
FAILED ("'CONSTRAINED ATTRIBUTE CHANGED BY " &
"PASSING PARAMETER");
END IF;
PROC11(PARM, B);
PROC12(PARM, B);
END PROC1;
PROCEDURE PROC2(PARM : IN OUT CONSTR) IS
BEGIN
COMMENT ("CALLING PROC1 FROM PROC2"); -- IN CASE TEST FAILS.
PROC1(PARM,TRUE);
PARM := U2;
IF NOT PARM'CONSTRAINED THEN
FAILED ("'CONSTRAINED ATTRIBUTE CHANGED BY " &
"ASSIGNMENT - 3");
END IF;
END PROC2;
BEGIN
TEST("C37405A", "'CONSTRAINED ATTRIBUTE OF OBJECTS, FORMAL " &
"PARAMETERS CANNOT BE CHANGED BY ASSIGNMENT");
C2 := (DISC => IDENT_INT(10), COMP => 3);
U2 := (DISC => IDENT_INT(10), COMP => 4);
ARR_C := (1..5 => U2);
ARR_U := (1..5 => C2);
REC_COMP_C := (COMP => U2);
REC_COMP_U := (COMP => C2);
C1 := U2;
U1 := C2;
IF U1'CONSTRAINED OR NOT C1'CONSTRAINED THEN
FAILED ("'CONSTRAINED ATTRIBUTE CHANGED BY ASSIGNMENT - 4");
END IF;
IF ARR_U(3)'CONSTRAINED OR NOT ARR_C(4)'CONSTRAINED THEN
FAILED ("'CONSTRAINED ATTRIBUTE CHANGED BY ASSIGNMENT - 5");
END IF;
IF REC_COMP_U.COMP'CONSTRAINED
OR NOT REC_COMP_C.COMP'CONSTRAINED THEN
FAILED ("'CONSTRAINED ATTRIBUTE CHANGED BY ASSIGNMENT - 6");
END IF;
COMMENT("CALLING PROC1 DIRECTLY");
PROC1(C1,TRUE);
PROC2(C1);
COMMENT("CALLING PROC1 DIRECTLY");
PROC1(U1,FALSE);
PROC2(U1);
COMMENT("CALLING PROC1 DIRECTLY");
PROC1(ARR_C(4), TRUE);
PROC2(ARR_C(5));
COMMENT("CALLING PROC1 DIRECTLY");
PROC1(ARR_U(2), FALSE);
PROC2(ARR_U(3));
COMMENT("CALLING PROC1 DIRECTLY");
PROC1(REC_COMP_C.COMP, TRUE);
PROC2(REC_COMP_C.COMP);
COMMENT("CALLING PROC1 DIRECTLY");
PROC1(REC_COMP_U.COMP, FALSE);
PROC2(REC_COMP_U.COMP);
RESULT;
END C37405A;
| 30.938272 | 79 | 0.592378 |
3902df3250be3334c129e42eb06c19e238fe4c2f | 5,680 | adb | Ada | tools-src/gnu/gcc/gcc/ada/a-wtinio.adb | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | tools-src/gnu/gcc/gcc/ada/a-wtinio.adb | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | tools-src/gnu/gcc/gcc/ada/a-wtinio.adb | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ I O . I N T E G E R _ I O --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2000 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 2, 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 COPYING. If not, write --
-- to the Free Software Foundation, 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Wide_Text_IO.Integer_Aux;
with System.WCh_Con; use System.WCh_Con;
with System.WCh_WtS; use System.WCh_WtS;
package body Ada.Wide_Text_IO.Integer_IO is
Need_LLI : constant Boolean := Num'Base'Size > Integer'Size;
-- Throughout this generic body, we distinguish between the case
-- where type Integer is acceptable, and where a Long_Long_Integer
-- is needed. This constant Boolean is used to test for these cases
-- and since it is a constant, only the code for the relevant case
-- will be included in the instance.
subtype TFT is Ada.Wide_Text_IO.File_Type;
-- File type required for calls to routines in Aux
package Aux renames Ada.Wide_Text_IO.Integer_Aux;
---------
-- Get --
---------
procedure Get
(File : in File_Type;
Item : out Num;
Width : in Field := 0)
is
begin
if Need_LLI then
Aux.Get_LLI (TFT (File), Long_Long_Integer (Item), Width);
else
Aux.Get_Int (TFT (File), Integer (Item), Width);
end if;
exception
when Constraint_Error => raise Data_Error;
end Get;
procedure Get
(Item : out Num;
Width : in Field := 0)
is
begin
Get (Current_Input, Item, Width);
end Get;
procedure Get
(From : in Wide_String;
Item : out Num;
Last : out Positive)
is
S : constant String := Wide_String_To_String (From, WCEM_Upper);
-- String on which we do the actual conversion. Note that the method
-- used for wide character encoding is irrelevant, since if there is
-- a character outside the Standard.Character range then the call to
-- Aux.Gets will raise Data_Error in any case.
begin
if Need_LLI then
Aux.Gets_LLI (S, Long_Long_Integer (Item), Last);
else
Aux.Gets_Int (S, Integer (Item), Last);
end if;
exception
when Constraint_Error => raise Data_Error;
end Get;
---------
-- Put --
---------
procedure Put
(File : in File_Type;
Item : in Num;
Width : in Field := Default_Width;
Base : in Number_Base := Default_Base)
is
begin
if Need_LLI then
Aux.Put_LLI (TFT (File), Long_Long_Integer (Item), Width, Base);
else
Aux.Put_Int (TFT (File), Integer (Item), Width, Base);
end if;
end Put;
procedure Put
(Item : in Num;
Width : in Field := Default_Width;
Base : in Number_Base := Default_Base)
is
begin
Put (Current_Output, Item, Width, Base);
end Put;
procedure Put
(To : out Wide_String;
Item : in Num;
Base : in Number_Base := Default_Base)
is
S : String (To'First .. To'Last);
begin
if Need_LLI then
Aux.Puts_LLI (S, Long_Long_Integer (Item), Base);
else
Aux.Puts_Int (S, Integer (Item), Base);
end if;
for J in S'Range loop
To (J) := Wide_Character'Val (Character'Pos (S (J)));
end loop;
end Put;
end Ada.Wide_Text_IO.Integer_IO;
| 37.615894 | 78 | 0.511796 |
18652e294220380bb485132e80bbbd3416dcc757 | 2,341 | ads | Ada | dcf/src/dcf-lz77.ads | onox/dcf-ada | 47891e7789d3aa53d8f6632284cdf63dbd2ec7dd | [
"MIT"
] | 5 | 2019-05-31T00:00:15.000Z | 2022-02-11T23:11:54.000Z | dcf/src/dcf-lz77.ads | onox/dcf-ada | 47891e7789d3aa53d8f6632284cdf63dbd2ec7dd | [
"MIT"
] | null | null | null | dcf/src/dcf-lz77.ads | onox/dcf-ada | 47891e7789d3aa53d8f6632284cdf63dbd2ec7dd | [
"MIT"
] | null | null | null | -- SPDX-License-Identifier: MIT
--
-- Copyright (c) 2016 - 2018 Gautier de Montmollin (maintainer of the Ada version)
-- SWITZERLAND
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
-- Standalone LZ77 compression (encoding) package
-- ----------------------------------------------
--
-- This is a collection of various free LZ77 match finders and encoders.
-- The differences reside in the way matches are found, or skipped.
-- See body (lz77.adb) for details and credits.
--
-- Pure Ada 95+ code, 100% portable: OS-, CPU- and compiler- independent.
private package DCF.Lz77 is
pragma Preelaborate;
type Method_Type is
(Iz_4, Iz_5, Iz_6, Iz_7, Iz_8, Iz_9, Iz_10);
-- Use the Info-Zip algorithm, levels 4-10 (see body for details and credits)
subtype Byte is Unsigned_8;
generic
-- LZSS Parameters
String_Buffer_Size : Integer := 2**12;
Look_Ahead : Integer := 65;
Threshold : Integer := 2;
Method : Method_Type;
-- Input of data
with function Read_Byte return Byte;
with function More_Bytes return Boolean;
-- Output of LZ-compressed data
with procedure Write_Literal (B : Byte);
with procedure Write_Dl_Code (Distance, Length : Integer);
procedure Encode;
end DCF.Lz77;
| 39.016667 | 83 | 0.696711 |
1c0dd0c7c7693efa326b7b1b3e46c3a51cefb92a | 3,294 | adb | Ada | examples/simple_example.adb | AntonMeep/parse_args | 907bcb470a21b36b625b942bfeade06eed048ec6 | [
"0BSD"
] | 9 | 2015-12-08T17:06:54.000Z | 2022-03-28T09:44:20.000Z | examples/simple_example.adb | AntonMeep/parse_args | 907bcb470a21b36b625b942bfeade06eed048ec6 | [
"0BSD"
] | 1 | 2022-03-30T20:17:18.000Z | 2022-03-30T20:58:34.000Z | examples/simple_example.adb | AntonMeep/parse_args | 907bcb470a21b36b625b942bfeade06eed048ec6 | [
"0BSD"
] | 2 | 2017-01-07T17:31:48.000Z | 2022-03-28T09:36:42.000Z | -- simple_example
-- A simple example of the use of parse_args
-- Copyright (c) 2014, James Humphry
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
with Parse_Args;
use Parse_Args;
with Parse_Args.Integer_Array_Options;
with Ada.Text_IO;
use Ada.Text_IO;
procedure Simple_Example is
AP : Argument_Parser;
begin
AP.Add_Option(Make_Boolean_Option(False), "help", 'h', Usage => "Display this help text");
AP.Add_Option(Make_Boolean_Option(False), "foo", 'f', Usage => "The foo option");
AP.Add_Option(Make_Boolean_Option(True), "bar", 'b', Usage => "The bar option");
AP.Add_Option(Make_Repeated_Option(0), "baz", 'z',
Usage => "The baz option (can be repeated for more baz)");
AP.Add_Option(Make_Boolean_Option(False), "long-only",
Long_Option => "long-only",
Usage => "The --long-only option has no short version");
AP.Add_Option(Make_Boolean_Option(False), "short-only",
Short_Option => 'x', Long_Option => "-",
Usage => "The -x option has no long version");
AP.Add_Option(Make_Natural_Option(0), "natural", 'n', Usage => "Specify a natural number argument");
AP.Add_Option(Make_Integer_Option(-1), "integer", 'i', Usage => "Specify an integer argument");
AP.Add_Option(Make_String_Option(""), "string", 's', Usage => "Specify a string argument");
AP.Add_Option(Integer_Array_Options.Make_Option, "array", 'a',
Usage => "Specify a comma-separated integer array argument");
AP.Append_Positional(Make_String_Option("INFILE"), "INFILE");
AP.Allow_Tail_Arguments("TAIL-ARGUMENTS");
AP.Set_Prologue("A demonstration of the basic features of the Parse_Args library.");
AP.Parse_Command_Line;
if AP.Parse_Success and then AP.Boolean_Value("help") then
AP.Usage;
elsif AP.Parse_Success then
Put_Line("Command name is: " & AP.Command_Name);
New_Line;
for I in AP.Iterate loop
Put_Line("Option "& Option_Name(I) & " was " &
(if AP(I).Set then "" else "not ") &
"set on the command line. Value: " &
AP(I).Image);
end loop;
New_Line;
Put_Line("There were: " & Integer'Image(Integer(AP.Tail.Length)) & " tail arguments.");
declare
I : Integer := 1;
begin
for J of AP.Tail loop
Put_Line("Argument" & Integer'Image(I) & " is: " & J);
I := I + 1;
end loop;
end;
else
Put_Line("Error while parsing command-line arguments: " & AP.Parse_Message);
end if;
end Simple_Example;
| 41.175 | 103 | 0.660291 |
2377248b81395a212c549bb0d0b3febb1ebb9644 | 5,200 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52103m.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52103m.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52103m.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C52103M.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT LENGTHS MUST MATCH IN ARRAY AND SLICE ASSIGNMENTS.
-- MORE SPECIFICALLY, TEST THAT ARRAY ASSIGNMENTS WITH MATCHING
-- LENGTHS DO NOT CAUSE CONSTRAINT_ERROR TO BE RAISED AND
-- ARE PERFORMED CORRECTLY.
-- (OVERLAPS BETWEEN THE OPERANDS OF THE ASSIGNMENT STATEMENT
-- ARE TREATED ELSEWHERE.)
-- THIS IS THE THIRD FILE IN
-- DIVISION C : NON-NULL ARRAYS WHOSE LENGTHS ARE NOT DETERMINABLE
-- STATICALLY.
-- RM 07/20/81
-- SPS 3/22/83
WITH REPORT;
PROCEDURE C52103M IS
USE REPORT ;
BEGIN
TEST( "C52103M" , "CHECK THAT IN ARRAY ASSIGNMENTS AND IN SLICE" &
" ASSIGNMENTS THE LENGTHS MUST MATCH" );
-- ( EACH DIVISION COMPRISES 3 FILES,
-- COVERING RESPECTIVELY THE FIRST
-- 3 , NEXT 2 , AND LAST 3 OF THE 8
-- SELECTIONS FOR THE DIVISION.)
-------------------------------------------------------------------
-- (7) UNSLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' (BY
-- THEMSELVES).
DECLARE
ARR71 : STRING( IDENT_INT(1)..IDENT_INT(5) ) := "ABCDE" ;
ARR72 : STRING( IDENT_INT(5)..IDENT_INT(9) ) := "FGHIJ" ;
BEGIN
-- STRING ASSIGNMENT:
ARR72 := ARR71 ;
-- CHECKING THE VALUES AFTER THE STRING ASSIGNMENT:
IF ARR72 /= "ABCDE"
THEN
FAILED( "STRING ASSIGNMENT NOT CORRECT (7)" );
END IF;
EXCEPTION
WHEN OTHERS =>
FAILED( "EXCEPTION RAISED - SUBTEST 7" );
END ;
-------------------------------------------------------------------
-- (8) SLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' , WITH
-- STRING LITERALS.
--
DECLARE
ARR82 : STRING( IDENT_INT(5)..IDENT_INT(9) ) ;
BEGIN
-- INITIALIZATION OF UNUSED COMPONENT OF LHS ARRAY:
ARR82( IDENT_INT(5)..IDENT_INT(5) ) := "Q" ;
-- STRING LITERAL ASSIGNMENT:
ARR82( IDENT_INT(5)..IDENT_INT(9) )
( IDENT_INT(6)..IDENT_INT(9) ) := "BCDE" ;
-- CHECKING THE VALUES AFTER THE SLICE ASSIGNMENT:
IF ARR82 /= "QBCDE" OR
ARR82( IDENT_INT(5)..IDENT_INT(9) ) /= "QBCDE"
THEN
FAILED( "SLICE ASSIGNMENT NOT CORRECT (8)" );
END IF;
EXCEPTION
WHEN OTHERS =>
FAILED( "EXCEPTION RAISED - SUBTEST 8" );
END ;
-------------------------------------------------------------------
-- (9) SLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' (BY
-- THEMSELVES).
--
DECLARE
SUBTYPE TA92 IS STRING( IDENT_INT(5)..IDENT_INT(9) ) ;
ARR91 : STRING( IDENT_INT(1)..IDENT_INT(5) ) := "ABCDE" ;
ARR92 : TA92 ;
BEGIN
-- INITIALIZATION OF UNUSED COMPONENT OF LHS ARRAY:
ARR92( IDENT_INT(5)..IDENT_INT(5) ) := "Q" ;
-- STRING SLICE ASSIGNMENT:
ARR92( IDENT_INT(5)..IDENT_INT(9) )
( IDENT_INT(6)..IDENT_INT(9) ) :=
ARR91
( IDENT_INT(1)..IDENT_INT(5) )
( IDENT_INT(2)..IDENT_INT(5) )
( IDENT_INT(2)..IDENT_INT(5) ) ;
-- CHECKING THE VALUES AFTER THE SLICE ASSIGNMENT:
IF ARR92 /= "QBCDE" OR
ARR92( IDENT_INT(5)..IDENT_INT(9) ) /= "QBCDE"
THEN
FAILED( "SLICE ASSIGNMENT NOT CORRECT (9)" );
END IF;
EXCEPTION
WHEN OTHERS =>
FAILED( "EXCEPTION RAISED - SUBTEST 9" );
END ;
-------------------------------------------------------------------
RESULT ;
END C52103M ;
| 28.26087 | 79 | 0.513462 |
c54c6f24ec47fb716c3f1dff08b18543a603789e | 1,241 | ads | Ada | tools/scitools/conf/understand/ada/ada05/a-slcain.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | llvm-gcc-4.2-2.9/gcc/ada/a-slcain.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/a-slcain.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- ADA.STRINGS.LESS_CASE_INSENSITIVE --
-- --
-- S p e c --
-- --
-- This specification is adapted from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
function Ada.Strings.Less_Case_Insensitive
(Left, Right : String) return Boolean;
pragma Pure (Ada.Strings.Less_Case_Insensitive);
| 62.05 | 78 | 0.323932 |
d04e9409352f44f4a5802ec944276722ff4c1214 | 1,345 | ads | Ada | source/textio/a-tigbio.ads | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 33 | 2015-04-04T09:19:36.000Z | 2021-11-10T05:33:34.000Z | source/textio/a-tigbio.ads | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 8 | 2017-11-14T13:05:07.000Z | 2018-08-09T15:28:49.000Z | source/textio/a-tigbio.ads | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 9 | 2015-02-03T17:09:53.000Z | 2021-11-12T01:16:05.000Z | pragma License (Unrestricted);
-- generalized unit of Ada.Text_IO.Bounded_IO
with Ada.Strings.Generic_Bounded;
generic
with package Bounded_Strings is new Strings.Generic_Bounded (<>);
with package Bounded is new Bounded_Strings.Generic_Bounded_Length (<>);
with procedure Put (
File : File_Type;
Item : Bounded_Strings.String_Type) is <>;
with procedure Put_Line (
File : File_Type;
Item : Bounded_Strings.String_Type) is <>;
with procedure Get_Line (
File : File_Type;
Item : out Bounded_Strings.String_Type;
Last : out Natural) is <>;
package Ada.Text_IO.Generic_Bounded_IO is
procedure Put (
File : File_Type; -- Output_File_Type
Item : Bounded.Bounded_String);
procedure Put (
Item : Bounded.Bounded_String);
procedure Put_Line (
File : File_Type; -- Output_File_Type
Item : Bounded.Bounded_String);
procedure Put_Line (
Item : Bounded.Bounded_String);
function Get_Line (
File : File_Type) -- Input_File_Type
return Bounded.Bounded_String;
function Get_Line
return Bounded.Bounded_String;
procedure Get_Line (
File : File_Type; -- Input_File_Type
Item : out Bounded.Bounded_String);
procedure Get_Line (
Item : out Bounded.Bounded_String);
end Ada.Text_IO.Generic_Bounded_IO;
| 28.020833 | 75 | 0.696654 |
39b590dcf95c819a8edb024e342d3b29dc5757fa | 3,775 | adb | Ada | source/core/web-core-connectables-slots_0.adb | godunko/adawebui | ee524325fe701ef0a655cd0624e0ba701f0e8955 | [
"BSD-3-Clause"
] | 2 | 2020-01-31T07:00:09.000Z | 2021-06-25T15:50:00.000Z | source/core/web-core-connectables-slots_0.adb | godunko/adawebui | ee524325fe701ef0a655cd0624e0ba701f0e8955 | [
"BSD-3-Clause"
] | null | null | null | source/core/web-core-connectables-slots_0.adb | godunko/adawebui | ee524325fe701ef0a655cd0624e0ba701f0e8955 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016-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: 5703 $ $Date: 2017-01-20 22:17:20 +0300 (Fri, 20 Jan 2017) $
------------------------------------------------------------------------------
package body Web.Core.Connectables.Slots_0 is
---------------------
-- Create_Slot_End --
---------------------
not overriding function Create_Slot_End
(Self : Slot) return not null Slot_End_Access is
begin
raise Program_Error with "Slot.Create_Slot_End must be overrided";
return null;
end Create_Slot_End;
end Web.Core.Connectables.Slots_0;
| 63.983051 | 78 | 0.416159 |
df138139737621562314aa8a47826472d685f4d1 | 5,807 | adb | Ada | src/ncurses-5.5/Ada95/samples/sample-form_demo.adb | erwinchang/minicom | 3fe2ba7d8e8475c199b493a2b99cd3c690f6ea4f | [
"MIT"
] | null | null | null | src/ncurses-5.5/Ada95/samples/sample-form_demo.adb | erwinchang/minicom | 3fe2ba7d8e8475c199b493a2b99cd3c690f6ea4f | [
"MIT"
] | null | null | null | src/ncurses-5.5/Ada95/samples/sample-form_demo.adb | erwinchang/minicom | 3fe2ba7d8e8475c199b493a2b99cd3c690f6ea4f | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998,2004 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.13 $
-- $Date: 2004/08/21 21:37:00 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
with Terminal_Interface.Curses.Forms.Field_User_Data;
with Sample.My_Field_Type; use Sample.My_Field_Type;
with Sample.Explanation; use Sample.Explanation;
with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Form_Demo.Handler;
with Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
with Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
use Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
with Terminal_Interface.Curses.Forms.Field_Types.IntField;
use Terminal_Interface.Curses.Forms.Field_Types.IntField;
package body Sample.Form_Demo is
type User_Data is
record
Data : Integer;
end record;
type User_Access is access User_Data;
package Fld_U is new
Terminal_Interface.Curses.Forms.Field_User_Data (User_Data,
User_Access);
type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday,
Friday, Saturday);
package Weekday_Enum is new
Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada (Weekday);
Enum_Field : constant Enumeration_Field :=
Weekday_Enum.Create;
procedure Demo
is
Mft : My_Data := (Ch => 'X');
FA : Field_Array_Access := new Field_Array'
(Make (0, 14, "Sample Entry Form"),
Make (2, 0, "WeekdayEnumeration"),
Make (2, 20, "Numeric 1-10"),
Make (2, 34, "Only 'X'"),
Make (5, 0, "Multiple Lines offscreen(Scroll)"),
Make (Width => 18, Top => 3, Left => 0),
Make (Width => 12, Top => 3, Left => 20),
Make (Width => 12, Top => 3, Left => 34),
Make (Width => 46, Top => 6, Left => 0, Height => 4, Off_Screen => 2),
Null_Field
);
Frm : Terminal_Interface.Curses.Forms.Form := Create (FA);
I_F : constant Integer_Field := (Precision => 0,
Lower_Limit => 1,
Upper_Limit => 10);
F1, F2 : User_Access;
package Fh is new Sample.Form_Demo.Handler (Default_Driver);
begin
Push_Environment ("FORM00");
Notepad ("FORM-PAD00");
Default_Labels;
Set_Field_Type (FA (6), Enum_Field);
Set_Field_Type (FA (7), I_F);
Set_Field_Type (FA (8), Mft);
F1 := new User_Data'(Data => 4711);
Fld_U.Set_User_Data (FA (1), F1);
Fh.Drive_Me (Frm);
Fld_U.Get_User_Data (FA (1), F2);
pragma Assert (F1 = F2);
pragma Assert (F1.Data = F2.Data);
Pop_Environment;
Delete (Frm);
Free (FA, True);
end Demo;
end Sample.Form_Demo;
| 44.328244 | 79 | 0.514896 |
dc2a4fa0308d39b1b8f1470edb1508944486dcf1 | 311 | ads | Ada | a-wichun.ads | ytomino/gnat4drake | 945795d8705ba4024b07a41b7efe0a9513b441c1 | [
"MIT"
] | null | null | null | a-wichun.ads | ytomino/gnat4drake | 945795d8705ba4024b07a41b7efe0a9513b441c1 | [
"MIT"
] | null | null | null | a-wichun.ads | ytomino/gnat4drake | 945795d8705ba4024b07a41b7efe0a9513b441c1 | [
"MIT"
] | null | null | null | pragma License (Unrestricted);
with Ada.Wide_Characters.Handling;
package Ada.Wide_Characters.Unicode is
pragma Preelaborate; -- Ada.Wide_Characters.Handling is not Pure.
function To_Lower_Case (U : Wide_Character) return Wide_Character
renames Handling.To_Lower;
end Ada.Wide_Characters.Unicode;
| 31.1 | 68 | 0.800643 |
393e4ba9c40758851ea6b743ad7fefdc5c38c81e | 40 | ada | Ada | Task/Multiple-distinct-objects/Ada/multiple-distinct-objects-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Multiple-distinct-objects/Ada/multiple-distinct-objects-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Multiple-distinct-objects/Ada/multiple-distinct-objects-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | A : array (1..N) of T := (others => V);
| 20 | 39 | 0.45 |
39144a6b2fe9cbfc7bfbea4749d8ea95d835262b | 5,798 | ads | Ada | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-sttebu.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-sttebu.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-sttebu.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.STRINGS.TEXT_BUFFERS --
-- --
-- S p e c --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.UTF_Encoding;
package Ada.Strings.Text_Buffers with
Pure
is
type Text_Buffer_Count is range 0 .. Integer'Last;
New_Line_Count : constant Text_Buffer_Count := 1;
-- There is no support for two-character CR/LF line endings.
type Root_Buffer_Type is abstract tagged limited private with
Default_Initial_Condition => Current_Indent (Root_Buffer_Type) = 0;
procedure Put (Buffer : in out Root_Buffer_Type; Item : String) is abstract;
procedure Wide_Put
(Buffer : in out Root_Buffer_Type; Item : Wide_String) is abstract;
procedure Wide_Wide_Put
(Buffer : in out Root_Buffer_Type; Item : Wide_Wide_String) is abstract;
procedure Put_UTF_8
(Buffer : in out Root_Buffer_Type;
Item : UTF_Encoding.UTF_8_String) is abstract;
procedure Wide_Put_UTF_16
(Buffer : in out Root_Buffer_Type;
Item : UTF_Encoding.UTF_16_Wide_String) is abstract;
procedure New_Line (Buffer : in out Root_Buffer_Type) is abstract;
Standard_Indent : constant Text_Buffer_Count := 3;
function Current_Indent
(Buffer : Root_Buffer_Type) return Text_Buffer_Count;
procedure Increase_Indent
(Buffer : in out Root_Buffer_Type;
Amount : Text_Buffer_Count := Standard_Indent) with
Post'Class => Current_Indent (Buffer) =
Current_Indent (Buffer)'Old + Amount;
procedure Decrease_Indent
(Buffer : in out Root_Buffer_Type;
Amount : Text_Buffer_Count := Standard_Indent) with
Pre'Class => Current_Indent (Buffer) >= Amount
-- or else raise Constraint_Error,
or else Boolean'Val (Current_Indent (Buffer) - Amount),
Post'Class => Current_Indent (Buffer) =
Current_Indent (Buffer)'Old - Amount;
private
type Root_Buffer_Type is abstract tagged limited record
Indentation : Natural := 0;
-- Current indentation
Indent_Pending : Boolean := True;
-- Set by calls to New_Line, cleared when indentation emitted.
UTF_8_Length : Natural := 0;
-- Count of UTF_8 characters in the buffer
UTF_8_Column : Positive := 1;
-- Column in which next character will be written.
-- Calling New_Line resets to 1.
All_7_Bits : Boolean := True;
-- True if all characters seen so far fit in 7 bits
All_8_Bits : Boolean := True;
-- True if all characters seen so far fit in 8 bits
end record;
generic
-- This generic allows a client to extend Root_Buffer_Type without
-- having to implement any of the abstract subprograms other than
-- Put_UTF_8 (i.e., Put, Wide_Put, Wide_Wide_Put, Wide_Put_UTF_16,
-- and New_Line). Without this generic, each client would have to
-- duplicate the implementations of those 5 subprograms.
-- This generic also takes care of handling indentation, thereby
-- avoiding further code duplication. The name "Output_Mapping" isn't
-- wonderful, but it refers to the idea that this package knows how
-- to implement all the other output operations in terms of
-- just Put_UTF_8.
--
-- The classwide parameter type here is somewhat tricky;
-- there are no dispatching calls associated with this parameter.
-- It would be more accurate to say that the parameter is of type
-- Output_Mapping.Buffer_Type'Class, but that type hasn't been declared
-- yet. Instantiators will typically declare a non-abstract extension,
-- B2, of the buffer type, B1, declared in their instantiation. The
-- actual Put_UTF_8_Implementation parameter may then have a
-- precondition "Buffer in B2'Class" and that subprogram can safely
-- access components declared as part of the declaration of B2.
with procedure Put_UTF_8_Implementation
(Buffer : in out Root_Buffer_Type'Class;
Item : UTF_Encoding.UTF_8_String);
package Output_Mapping is
type Buffer_Type is abstract new Root_Buffer_Type with null record;
overriding procedure Put (Buffer : in out Buffer_Type; Item : String);
overriding procedure Wide_Put
(Buffer : in out Buffer_Type; Item : Wide_String);
overriding procedure Wide_Wide_Put
(Buffer : in out Buffer_Type; Item : Wide_Wide_String);
overriding procedure Put_UTF_8
(Buffer : in out Buffer_Type;
Item : UTF_Encoding.UTF_8_String);
overriding procedure Wide_Put_UTF_16
(Buffer : in out Buffer_Type; Item : UTF_Encoding.UTF_16_Wide_String);
overriding procedure New_Line (Buffer : in out Buffer_Type);
end Output_Mapping;
end Ada.Strings.Text_Buffers;
| 42.321168 | 79 | 0.611418 |
208a39df53194bfd0834201025e1f53a7a386543 | 6,699 | ads | Ada | src/vulkan-math/vulkan-math-bvec3.ads | zrmyers/VulkanAda | ed8c46d923bc8936db3a5d55d36afebb928a9ede | [
"MIT"
] | 1 | 2021-01-29T21:10:45.000Z | 2021-01-29T21:10:45.000Z | src/vulkan-math/vulkan-math-bvec3.ads | zrmyers/VulkanAda | ed8c46d923bc8936db3a5d55d36afebb928a9ede | [
"MIT"
] | 8 | 2020-04-22T14:55:20.000Z | 2021-11-22T03:58:08.000Z | src/vulkan-math/vulkan-math-bvec3.ads | zrmyers/VulkanAda | ed8c46d923bc8936db3a5d55d36afebb928a9ede | [
"MIT"
] | 1 | 2021-04-05T13:19:21.000Z | 2021-04-05T13:19:21.000Z | --------------------------------------------------------------------------------
-- MIT License
--
-- Copyright (c) 2020 Zane Myers
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
--------------------------------------------------------------------------------
with Vulkan.Math.GenBType;
with Vulkan.Math.Bvec2;
use Vulkan.Math.GenBType;
use Vulkan.Math.Bvec2;
--------------------------------------------------------------------------------
--< @group Vulkan Math Basic Types
--------------------------------------------------------------------------------
--< @summary
--< This package defines a boolean vector type with 3 components.
--------------------------------------------------------------------------------
package Vulkan.Math.Bvec3 is
pragma Preelaborate;
pragma Pure;
--< A 3 component vector of boolean values.
subtype Vkm_Bvec3 is Vkm_GenBType(Last_Index => 2);
----------------------------------------------------------------------------
-- Ada does not have the concept of constructors in the sense that they exist
-- in C++. For this reason, we will instead define multiple methods for
-- instantiating a dvec3 here.
----------------------------------------------------------------------------
-- The following are explicit constructors for Bvec3:
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Bvec3 type.
--<
--< @description
--< Produce a default vector with all components set to false
--<
--< @return
--< Returns a 3D boolean vector with all components set to false.
----------------------------------------------------------------------------
function Make_Bvec3 return Vkm_Bvec3 is
(GBT.Make_GenType(Last_Index => 2, value => false)) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Bvec3 type.
--<
--< @description
--< Produce a vector with all components set to the same value.
--<
--< @param scalar_value
--< The value to set all components to.
--<
--< @return
--< Returns a 3D boolean vector with all components set to scalar_value.
----------------------------------------------------------------------------
function Make_Bvec3 (scalar_value : in Vkm_Bool) return Vkm_Bvec3 is
(GBT.Make_GenType(Last_Index => 2, value => scalar_value)) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Bvec3 type.
--<
--< @description
--< Produce a vector by copying components from an existing vector.
--<
--< @param vec3_value
--< The Bvec3 to copy components from.
--<
--< @return
--< Returns a 3D boolean vector with all of its components set equal to the
--< corresponding components of vec3_value.
----------------------------------------------------------------------------
function Make_Bvec3 (vec3_value : in Vkm_Bvec3) return Vkm_Bvec3 is
(GBT.Make_GenType(vec3_value.data(0),vec3_value.data(1), vec3_value.data(2))) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Bvec3 type.
--<
--< @description
--< Produce a vector by specifying the values for each of its components.
--<
--< @param value1
--< Value for component 1.
--<
--< @param value2
--< Value for component 2.
--<
--< @param value3
--< Value for component 3.
--<
--< @return
--< A 3D boolean vector with all components set as specified.
----------------------------------------------------------------------------
function Make_Bvec3 (value1, value2, value3 : in Vkm_Bool) return Vkm_Bvec3
renames GBT.Make_GenType;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Bvec3 type.
--<
--< @description
--< Produce a vector by concatenating a scalar float with a vec2.
--<
--< Bvec3 = [scalar_value, vec2_value]
--<
--< @param scalar_value
--< The scalar value to concatenate with the 2D boolean vector.
--<
--< @param vec2_value
--< The 2D boolean vector to concatenate to the scalar value.
--<
--< @return
--< The new instance of 3D boolean vector.
----------------------------------------------------------------------------
function Make_Bvec3 (scalar_value : in Vkm_Bool;
vec2_value : in Vkm_Bvec2 ) return Vkm_Bvec3 is
(Make_Bvec3(scalar_value, vec2_value.x, vec2_value.y)) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Bvec3 type.
--<
--< @description
--< Produce a vector by concatenating a scalar float with a vec2.
--<
--< Bvec3 = [vec2_value, scalar_value]
--<
--< @param vec2_value
--< The vec2 to concatenate to the scalar value.
--<
--< @param scalar_value
--< The scalar value to concatenate with the Bvec3.
--<
--< @return
--< The instance of 3D boolean vector.
----------------------------------------------------------------------------
function Make_Bvec3 (vec2_value : in Vkm_Bvec2;
scalar_value : in Vkm_Bool ) return Vkm_Bvec3 is
(Make_Bvec3(vec2_value.x, vec2_value.y, scalar_value)) with Inline;
end Vulkan.Math.Bvec3;
| 39.639053 | 98 | 0.506195 |
1003ea406b92e090ab947994a5791e1310604c77 | 5,409 | adb | Ada | snapgear_linux/user/ncurses/ncurses-5.6/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb | impedimentToProgress/UCI-BlueChip | 53e5d48b79079eaf60d42f7cb65bb795743d19fc | [
"MIT"
] | null | null | null | snapgear_linux/user/ncurses/ncurses-5.6/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb | impedimentToProgress/UCI-BlueChip | 53e5d48b79079eaf60d42f7cb65bb795743d19fc | [
"MIT"
] | null | null | null | snapgear_linux/user/ncurses/ncurses-5.6/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb | impedimentToProgress/UCI-BlueChip | 53e5d48b79079eaf60d42f7cb65bb795743d19fc | [
"MIT"
] | 3 | 2016-06-13T13:20:56.000Z | 2019-12-05T02:31:23.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.User.Choice --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- $Date: 2006/06/25 14:24:40 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
with Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
use type Interfaces.C.int;
pragma Warnings (Off);
function To_Argument_Access is new Ada.Unchecked_Conversion
(System.Address, Argument_Access);
pragma Warnings (On);
function Generic_Next (Fld : Field;
Usr : System.Address) return C_Int
is
Result : Boolean;
Udf : constant User_Defined_Field_Type_With_Choice_Access :=
User_Defined_Field_Type_With_Choice_Access
(To_Argument_Access (Usr).Typ);
begin
Result := Next (Fld, Udf.all);
return C_Int (Boolean'Pos (Result));
end Generic_Next;
function Generic_Prev (Fld : Field;
Usr : System.Address) return C_Int
is
Result : Boolean;
Udf : constant User_Defined_Field_Type_With_Choice_Access :=
User_Defined_Field_Type_With_Choice_Access
(To_Argument_Access (Usr).Typ);
begin
Result := Previous (Fld, Udf.all);
return C_Int (Boolean'Pos (Result));
end Generic_Prev;
-- -----------------------------------------------------------------------
--
function C_Generic_Choice return C_Field_Type
is
Res : Eti_Error;
T : C_Field_Type;
begin
if M_Generic_Choice = Null_Field_Type then
T := New_Fieldtype (Generic_Field_Check'Access,
Generic_Char_Check'Access);
if T = Null_Field_Type then
raise Form_Exception;
else
Res := Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
Res := Set_Fieldtype_Choice (T,
Generic_Next'Access,
Generic_Prev'Access);
if Res /= E_Ok then
Eti_Exception (Res);
end if;
end if;
M_Generic_Choice := T;
end if;
pragma Assert (M_Generic_Choice /= Null_Field_Type);
return M_Generic_Choice;
end C_Generic_Choice;
end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
| 47.447368 | 78 | 0.485117 |
1c03246b1f8f0c8b656f58d297f65a5324d2cfd4 | 1,241 | ads | Ada | tools/scitools/conf/understand/ada/ada05/a-llfzti.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | llvm-gcc-4.2-2.9/gcc/ada/a-llfzti.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/a-llfzti.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
--A D A . L O N G _ L O N G _ F L O A T _ W I D E _ W I D E _ T E X T _ I O --
-- --
-- S p e c --
-- --
-- This specification is adapted from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
with Ada.Wide_Wide_Text_IO;
package Ada.Long_Long_Float_Wide_Wide_Text_IO is
new Ada.Wide_Wide_Text_IO.Float_IO (Long_Long_Float);
| 62.05 | 78 | 0.333602 |
3912e4a0f1f5f5b14784f9468002c86a57524a74 | 5,621 | ads | Ada | source/web/soap/web_services-soap-clients.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/web/soap/web_services-soap-clients.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/web/soap/web_services-soap-clients.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Stream_Element_Vectors;
with League.Strings;
with Web_Services.SOAP.Messages;
with Web_Services.SOAP.Payloads;
package Web_Services.SOAP.Clients is
type Abstract_Transport is abstract tagged limited null record;
not overriding procedure Post_Request
(Self : in out Abstract_Transport;
Content_Type : League.Stream_Element_Vectors.Stream_Element_Vector;
Request_Data : League.Stream_Element_Vectors.Stream_Element_Vector;
Response_Data : out League.Stream_Element_Vectors.Stream_Element_Vector)
is abstract;
-- Send given request and return reply.
not overriding function Is_Multipart_Content
(Self : in out Abstract_Transport) return Boolean is abstract;
-- If server return multipart replies
not overriding procedure Next_Response
(Self : in out Abstract_Transport;
Response_Data : out League.Stream_Element_Vectors.Stream_Element_Vector)
is abstract;
-- Get next responce. Only if server return multipart replies
not overriding procedure Finalyze (Self : in out Abstract_Transport)
is abstract;
-- Clean up internal data before transport deallocation
type SOAP_Client (Transport : access Abstract_Transport'Class) is
tagged limited private;
not overriding procedure Call
(Self : in out SOAP_Client;
Request : Web_Services.SOAP.Payloads.SOAP_Payload_Access;
Response : out Web_Services.SOAP.Payloads.SOAP_Payload_Access;
User : League.Strings.Universal_String :=
League.Strings.Empty_Universal_String;
Password : League.Strings.Universal_String :=
League.Strings.Empty_Universal_String;
Action : League.Strings.Universal_String :=
League.Strings.Empty_Universal_String);
-- Call server
not overriding procedure Next_Response
(Self : in out SOAP_Client;
Response : out Web_Services.SOAP.Payloads.SOAP_Payload_Access);
private
type SOAP_Client (Transport : access Abstract_Transport'Class) is
tagged limited null record;
procedure Call
(Self : in out SOAP_Client;
Input : Web_Services.SOAP.Messages.SOAP_Message_Access;
Response : out Web_Services.SOAP.Payloads.SOAP_Payload_Access);
end Web_Services.SOAP.Clients;
| 52.53271 | 78 | 0.5314 |
4aedbb562207ae7da4c6998415323186714c9166 | 2,916 | ads | Ada | STM32F4/ToyOBDH/ground_station/shared/src/ttc.ads | AntonioRamosNieto/TFG-STM32F429 | d241065e51451199e7066e6ff3cbd207b4c88837 | [
"BSD-3-Clause"
] | null | null | null | STM32F4/ToyOBDH/ground_station/shared/src/ttc.ads | AntonioRamosNieto/TFG-STM32F429 | d241065e51451199e7066e6ff3cbd207b4c88837 | [
"BSD-3-Clause"
] | null | null | null | STM32F4/ToyOBDH/ground_station/shared/src/ttc.ads | AntonioRamosNieto/TFG-STM32F429 | d241065e51451199e7066e6ff3cbd207b4c88837 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, Universidad Politécnica de Madrid --
-- --
-- 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. --
-- --
-------------------------------------------------------------------------------
-- Telemetry reception subsystem
with HK_Data; use HK_Data;
with TTC_Data; use TTC_Data;
with Ada.Real_Time; use Ada.Real_Time;
with System;
package TTC is
procedure Init;
-- Initialize TTC sybsystem
procedure Send (TC : TC_Type := HK);
-- Send a telecommand
private
task TM_Receiver
with Priority => System.Default_Priority;
-- replace with DMS priority when available
task TC_Sender
with Priority => System.Default_Priority;
-- replace with DMS priority when available
end TTC;
| 49.423729 | 79 | 0.545953 |
2395966d14a424f6e7f87f12ed16732a90ab593c | 79,710 | adb | Ada | Vivado_HLS_Tutorial/Design_Analysis/lab1/dct_prj/solution6/.autopilot/db/dct_write_data.bind.adb | williambong/Vivado | 68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb | [
"MIT"
] | null | null | null | Vivado_HLS_Tutorial/Design_Analysis/lab1/dct_prj/solution6/.autopilot/db/dct_write_data.bind.adb | williambong/Vivado | 68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb | [
"MIT"
] | null | null | null | Vivado_HLS_Tutorial/Design_Analysis/lab1/dct_prj/solution6/.autopilot/db/dct_write_data.bind.adb | williambong/Vivado | 68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb | [
"MIT"
] | null | null | null | <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="11">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>dct_write_data</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>buf_r</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>64</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>output_r</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>output</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>64</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>28</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_3">
<Value>
<Obj>
<type>0</type>
<id>3</id>
<name></name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>115</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second class_id="11" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="12" tracking_level="0" version="0">
<first class_id="13" tracking_level="0" version="0">
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>115</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_4">
<Value>
<Obj>
<type>0</type>
<id>5</id>
<name>indvar_flatten</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
</oprand_edges>
<opcode>phi</opcode>
</item>
<item class_id_reference="9" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>6</id>
<name>r</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>48</item>
<item>49</item>
<item>50</item>
<item>51</item>
</oprand_edges>
<opcode>phi</opcode>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>7</id>
<name>c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>c</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>52</item>
<item>53</item>
<item>54</item>
<item>55</item>
</oprand_edges>
<opcode>phi</opcode>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>exitcond_flatten</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>56</item>
<item>58</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>9</id>
<name>indvar_flatten_next</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>59</item>
<item>61</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>10</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>62</item>
<item>63</item>
<item>64</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name>exitcond4</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>65</item>
<item>67</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>c_mid2</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>68</item>
<item>69</item>
<item>70</item>
</oprand_edges>
<opcode>select</opcode>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>r_s</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>115</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>115</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>72</item>
<item>73</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>r_mid2</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>74</item>
<item>75</item>
<item>76</item>
</oprand_edges>
<opcode>select</opcode>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>tmp</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>77</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>tmp_s</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>79</item>
<item>80</item>
<item>82</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>c_cast6</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>83</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>tmp_4_trn_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>84</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>tmp_1</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>86</item>
<item>87</item>
<item>88</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>p_addr_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>89</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>p_addr1</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>90</item>
<item>91</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>tmp_2</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>92</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name>buf_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>93</item>
<item>95</item>
<item>96</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>buf_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>97</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>tmp_5</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>98</item>
<item>99</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>tmp_6</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>100</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>output_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>101</item>
<item>102</item>
<item>103</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name></name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>104</item>
<item>105</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>c_1</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>117</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>117</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>c</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>106</item>
<item>107</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>108</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name></name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>120</lineNumber>
<contextFuncName>write_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>write_data</second>
</first>
<second>120</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>8</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_31">
<Value>
<Obj>
<type>2</type>
<id>42</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_32">
<Value>
<Obj>
<type>2</type>
<id>47</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_33">
<Value>
<Obj>
<type>2</type>
<id>57</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<const_type>0</const_type>
<content>64</content>
</item>
<item class_id_reference="16" object_id="_34">
<Value>
<Obj>
<type>2</type>
<id>60</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_35">
<Value>
<Obj>
<type>2</type>
<id>66</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>8</content>
</item>
<item class_id_reference="16" object_id="_36">
<Value>
<Obj>
<type>2</type>
<id>71</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_37">
<Value>
<Obj>
<type>2</type>
<id>81</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_38">
<Value>
<Obj>
<type>2</type>
<id>94</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_39">
<Obj>
<type>3</type>
<id>4</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>3</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_40">
<Obj>
<type>3</type>
<id>11</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>6</count>
<item_version>0</item_version>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_41">
<Obj>
<type>3</type>
<id>38</id>
<name>.reset</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>20</count>
<item_version>0</item_version>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
<item>34</item>
<item>36</item>
<item>37</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_42">
<Obj>
<type>3</type>
<id>40</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>60</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_43">
<id>41</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>3</sink_obj>
</item>
<item class_id_reference="20" object_id="_44">
<id>43</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>5</sink_obj>
</item>
<item class_id_reference="20" object_id="_45">
<id>44</id>
<edge_type>2</edge_type>
<source_obj>4</source_obj>
<sink_obj>5</sink_obj>
</item>
<item class_id_reference="20" object_id="_46">
<id>45</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>5</sink_obj>
</item>
<item class_id_reference="20" object_id="_47">
<id>46</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>5</sink_obj>
</item>
<item class_id_reference="20" object_id="_48">
<id>48</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_49">
<id>49</id>
<edge_type>2</edge_type>
<source_obj>4</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_50">
<id>50</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_51">
<id>51</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_52">
<id>52</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_53">
<id>53</id>
<edge_type>2</edge_type>
<source_obj>4</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_54">
<id>54</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_55">
<id>55</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_56">
<id>56</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_57">
<id>58</id>
<edge_type>1</edge_type>
<source_obj>57</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_58">
<id>59</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_59">
<id>61</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_60">
<id>62</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_61">
<id>63</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_62">
<id>64</id>
<edge_type>2</edge_type>
<source_obj>40</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_63">
<id>65</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_64">
<id>67</id>
<edge_type>1</edge_type>
<source_obj>66</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_65">
<id>68</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_66">
<id>69</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_67">
<id>70</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_68">
<id>72</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_69">
<id>73</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_70">
<id>74</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_71">
<id>75</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_72">
<id>76</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_73">
<id>77</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_74">
<id>80</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_75">
<id>82</id>
<edge_type>1</edge_type>
<source_obj>81</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_76">
<id>83</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_77">
<id>84</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_78">
<id>87</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_79">
<id>88</id>
<edge_type>1</edge_type>
<source_obj>81</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_80">
<id>89</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_81">
<id>90</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_82">
<id>91</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_83">
<id>92</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_84">
<id>93</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_85">
<id>95</id>
<edge_type>1</edge_type>
<source_obj>94</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_86">
<id>96</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_87">
<id>97</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_88">
<id>98</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_89">
<id>99</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_90">
<id>100</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_91">
<id>101</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_92">
<id>102</id>
<edge_type>1</edge_type>
<source_obj>94</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_93">
<id>103</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_94">
<id>104</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_95">
<id>105</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_96">
<id>106</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_97">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_98">
<id>108</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_99">
<id>139</id>
<edge_type>2</edge_type>
<source_obj>4</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_100">
<id>140</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_101">
<id>141</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_102">
<id>142</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>11</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_103">
<mId>1</mId>
<mTag>dct_write_data</mTag>
<mType>0</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>4</item>
</sub_regions>
<basic_blocks>
<count>0</count>
<item_version>0</item_version>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>66</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_104">
<mId>2</mId>
<mTag>Entry</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>4</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_105">
<mId>3</mId>
<mTag>WR_Loop_Row_WR_Loop_Col</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>11</item>
<item>38</item>
</basic_blocks>
<mII>1</mII>
<mDepth>2</mDepth>
<mMinTripCount>64</mMinTripCount>
<mMaxTripCount>64</mMaxTripCount>
<mMinLatency>64</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_106">
<mId>4</mId>
<mTag>Return</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_107">
<states class_id="25" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_108">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_109">
<id>3</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_110">
<id>2</id>
<operations>
<count>22</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_111">
<id>5</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_112">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_113">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_114">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_115">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_116">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_117">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_118">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_119">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_120">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_121">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_122">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_123">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_124">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_125">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_126">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_127">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_128">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_129">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_130">
<id>30</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_131">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_132">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_133">
<id>3</id>
<operations>
<count>11</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_134">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_135">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_136">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_137">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_138">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_139">
<id>30</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_140">
<id>32</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_141">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_142">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_143">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_144">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_145">
<id>4</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_146">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_147">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>23</id>
<sop class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_148">
<inState>3</inState>
<outState>2</outState>
<condition>
<id>31</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_149">
<inState>2</inState>
<outState>4</outState>
<condition>
<id>30</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item class_id="34" tracking_level="0" version="0">
<first class_id="35" tracking_level="0" version="0">
<first>8</first>
<second>0</second>
</first>
<second>0</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_150">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>32</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>8</first>
<second>0</second>
</first>
<second>1</second>
</item>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="36" tracking_level="1" version="0" object_id="_151">
<dp_component_resource class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_resource>
<dp_expression_resource>
<count>0</count>
<item_version>0</item_version>
</dp_expression_resource>
<dp_fifo_resource>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_resource>
<dp_memory_resource>
<count>0</count>
<item_version>0</item_version>
</dp_memory_resource>
<dp_multiplexer_resource>
<count>0</count>
<item_version>0</item_version>
</dp_multiplexer_resource>
<dp_register_resource>
<count>0</count>
<item_version>0</item_version>
</dp_register_resource>
<dp_component_map class_id="38" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_map>
<dp_expression_map>
<count>0</count>
<item_version>0</item_version>
</dp_expression_map>
<dp_fifo_map>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_map>
<dp_memory_map>
<count>0</count>
<item_version>0</item_version>
</dp_memory_map>
</res>
<node_label_latency class_id="39" tracking_level="0" version="0">
<count>28</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="0" version="0">
<first>3</first>
<second class_id="41" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>5</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>6</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>7</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>8</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>9</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>10</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>16</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>17</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="42" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="43" tracking_level="0" version="0">
<first>4</first>
<second class_id="44" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>11</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>1</first>
<second>2</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="45" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="1" version="0" object_id="_152">
<region_name>WR_Loop_Row_WR_Loop_Col</region_name>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>11</item>
<item>38</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>2</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="47" tracking_level="0" version="0">
<count>24</count>
<item_version>0</item_version>
<item class_id="48" tracking_level="0" version="0">
<first>46</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>53</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>30</item>
<item>30</item>
</second>
</item>
<item>
<first>58</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>65</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>75</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>5</item>
</second>
</item>
<item>
<first>86</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>97</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>104</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>110</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>116</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>122</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>130</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>16</item>
</second>
</item>
<item>
<first>136</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>144</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>148</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>156</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
<item>
<first>160</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>164</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>172</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>176</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>182</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>187</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>193</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>199</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="50" tracking_level="0" version="0">
<count>22</count>
<item_version>0</item_version>
<item class_id="51" tracking_level="0" version="0">
<first>buf_addr_gep_fu_46</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>c_1_fu_193</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>c_cast6_fu_156</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
<item>
<first>c_mid2_fu_122</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>c_phi_fu_97</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>exitcond4_fu_116</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>exitcond_flatten_fu_104</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>indvar_flatten_next_fu_110</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>indvar_flatten_phi_fu_75</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>5</item>
</second>
</item>
<item>
<first>output_addr_gep_fu_58</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>p_addr1_fu_176</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>p_addr_cast_fu_172</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>r_mid2_fu_136</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>r_phi_fu_86</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>r_s_fu_130</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>16</item>
</second>
</item>
<item>
<first>tmp_1_fu_164</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>tmp_2_fu_182</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>tmp_4_trn_cast_fu_160</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>tmp_5_fu_187</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>tmp_6_fu_199</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>tmp_fu_144</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>tmp_s_fu_148</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="52" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="53" tracking_level="0" version="0">
<first class_id="54" tracking_level="0" version="0">
<first>buf_r</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>30</item>
<item>30</item>
</second>
</item>
<item>
<first>
<first>output_r</first>
<second>0</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>9</count>
<item_version>0</item_version>
<item>
<first>71</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>5</item>
</second>
</item>
<item>
<first>82</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>203</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>207</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>212</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>217</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>222</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>227</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>9</count>
<item_version>0</item_version>
<item>
<first>buf_addr_reg_217</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>c_1_reg_227</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>c_reg_93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>exitcond_flatten_reg_203</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>indvar_flatten_next_reg_207</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>indvar_flatten_reg_71</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>5</item>
</second>
</item>
<item>
<first>r_mid2_reg_212</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>r_reg_82</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>tmp_5_reg_222</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>3</count>
<item_version>0</item_version>
<item>
<first>71</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>5</item>
</second>
</item>
<item>
<first>82</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>3</count>
<item_version>0</item_version>
<item>
<first>c_reg_93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>indvar_flatten_reg_71</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>5</item>
</second>
</item>
<item>
<first>r_reg_82</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="55" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="56" tracking_level="0" version="0">
<first>buf_r(p0)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>load</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>30</item>
<item>30</item>
</second>
</item>
</second>
</item>
<item>
<first>output_r(p0)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>store</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="57" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="58" tracking_level="0" version="0">
<first>1</first>
<second>RAM</second>
</item>
<item>
<first>2</first>
<second>RAM</second>
</item>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
| 24.940551 | 98 | 0.587969 |
10033ddabdd0f7c3caf2825ff675545173d824e3 | 3,454 | adb | Ada | source/types/adam-a_type-enumeration_type.adb | charlie5/aIDE | fab406dbcd9b72a4cb215ffebb05166c788d6365 | [
"MIT"
] | 3 | 2017-04-29T14:25:22.000Z | 2017-09-29T10:15:28.000Z | source/types/adam-a_type-enumeration_type.adb | charlie5/aIDE | fab406dbcd9b72a4cb215ffebb05166c788d6365 | [
"MIT"
] | null | null | null | source/types/adam-a_type-enumeration_type.adb | charlie5/aIDE | fab406dbcd9b72a4cb215ffebb05166c788d6365 | [
"MIT"
] | null | null | null | with
AdaM.Factory;
package body AdaM.a_Type.enumeration_type
is
-- Storage Pool
--
record_Version : constant := 1;
pool_Size : constant := 5_000;
package Pool is new AdaM.Factory.Pools (storage_Folder => ".adam-store",
pool_Name => "enumeration_types",
max_Items => pool_Size,
record_Version => record_Version,
Item => enumeration_Type.item,
View => enumeration_Type.view);
-- Forge
--
procedure define (Self : in out Item; Name : in String)
is
begin
Self.Name := +Name;
end define;
function new_Type (Name : in String := "") return enumeration_Type.View
is
new_View : constant enumeration_Type.view := Pool.new_Item;
begin
define (enumeration_Type.item (new_View.all), Name);
return new_View;
end new_Type;
procedure free (Self : in out enumeration_Type.view)
is
begin
Pool.free (Self);
end free;
-- Attributes
--
overriding function Id (Self : access Item) return AdaM.Id
is
begin
return Pool.to_Id (Self);
end Id;
function Literals (Self : in Item) return enumeration_literal.Vector
is
begin
return Self.Literals;
end Literals;
procedure Literals_are (Self : in out Item; Now : in enumeration_literal.Vector)
is
begin
Self.Literals := Now;
end Literals_are;
procedure add_Literal (Self : in out Item; Value : in String)
is
use enumeration_literal;
the_Literal : constant enumeration_literal.view := new_Literal (Value);
begin
-- the_Literal.Parent_is (Self.Literals'Access);
Self.Literals.append (the_Literal);
end add_Literal;
procedure rid_Literal (Self : in out Item; Value : in String)
is
begin
for Each of Self.Literals
loop
if +Each.Name = Value
then
Self.Literals.delete (Self.Literals.find_Index (Each));
return;
end if;
end loop;
raise Constraint_Error with "Enumeration type does not contain '" & Value & "'";
end rid_Literal;
overriding
function to_Source (Self : in Item) return text_Vectors.Vector
is
use ada.Strings.unbounded;
use type enumeration_literal.view;
the_Source : text_Vectors.Vector;
procedure add (the_Line : in Text)
is
begin
the_Source.append (the_Line);
end add;
begin
add (+"");
add ( "type " & Self.Name & " is ");
add (+"(");
for Each of Self.Literals
loop
if Each /= Self.Literals.last_Element
then
add (+(+Each.Name) & ",");
else
add (+(+Each.Name));
end if;
end loop;
add (+");");
return the_Source;
end to_Source;
-- Streams
--
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View)
renames Pool.View_write;
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View)
renames Pool.View_read;
end AdaM.a_Type.enumeration_type;
| 22.575163 | 86 | 0.557325 |
1c5dcc1a024e879b50a25baa1cebd60c96103a03 | 35,272 | adb | Ada | gcc-gcc-7_3_0-release/gcc/ada/s-taprop-hpux-dce.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/s-taprop-hpux-dce.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/s-taprop-hpux-dce.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is a HP-UX DCE threads (HPUX 10) version of this package
-- This package contains all the GNULL primitives that interface directly with
-- the underlying OS.
pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during tasking
-- operations. It causes infinite loops and other problems.
with Ada.Unchecked_Conversion;
with Interfaces.C;
with System.Tasking.Debug;
with System.Interrupt_Management;
with System.OS_Constants;
with System.OS_Primitives;
with System.Task_Primitives.Interrupt_Operations;
pragma Warnings (Off);
with System.Interrupt_Management.Operations;
pragma Elaborate_All (System.Interrupt_Management.Operations);
pragma Warnings (On);
with System.Soft_Links;
-- We use System.Soft_Links instead of System.Tasking.Initialization
-- because the later is a higher level package that we shouldn't depend on.
-- For example when using the restricted run time, it is replaced by
-- System.Tasking.Restricted.Stages.
package body System.Task_Primitives.Operations is
package OSC renames System.OS_Constants;
package SSL renames System.Soft_Links;
use System.Tasking.Debug;
use System.Tasking;
use Interfaces.C;
use System.OS_Interface;
use System.Parameters;
use System.OS_Primitives;
package PIO renames System.Task_Primitives.Interrupt_Operations;
----------------
-- Local Data --
----------------
-- The followings are logically constants, but need to be initialized
-- at run time.
Single_RTS_Lock : aliased RTS_Lock;
-- This is a lock to allow only one thread of control in the RTS at
-- a time; it is used to execute in mutual exclusion from all other tasks.
-- Used mainly in Single_Lock mode, but also to protect All_Tasks_List
Environment_Task_Id : Task_Id;
-- A variable to hold Task_Id for the environment task
Unblocked_Signal_Mask : aliased sigset_t;
-- The set of signals that should unblocked in all tasks
Time_Slice_Val : Integer;
pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
Dispatching_Policy : Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
-- Note: the reason that Locking_Policy is not needed is that this
-- is not implemented for DCE threads. The HPUX 10 port is at this
-- stage considered dead, and no further work is planned on it.
Foreign_Task_Elaborated : aliased Boolean := True;
-- Used to identified fake tasks (i.e., non-Ada Threads)
--------------------
-- Local Packages --
--------------------
package Specific is
procedure Initialize (Environment_Task : Task_Id);
pragma Inline (Initialize);
-- Initialize various data needed by this package
function Is_Valid_Task return Boolean;
pragma Inline (Is_Valid_Task);
-- Does the executing thread have a TCB?
procedure Set (Self_Id : Task_Id);
pragma Inline (Set);
-- Set the self id for the current task
function Self return Task_Id;
pragma Inline (Self);
-- Return a pointer to the Ada Task Control Block of the calling task
end Specific;
package body Specific is separate;
-- The body of this package is target specific
----------------------------------
-- ATCB allocation/deallocation --
----------------------------------
package body ATCB_Allocation is separate;
-- The body of this package is shared across several targets
---------------------------------
-- Support for foreign threads --
---------------------------------
function Register_Foreign_Thread (Thread : Thread_Id) return Task_Id;
-- Allocate and Initialize a new ATCB for the current Thread
function Register_Foreign_Thread
(Thread : Thread_Id) return Task_Id is separate;
-----------------------
-- Local Subprograms --
-----------------------
procedure Abort_Handler (Sig : Signal);
function To_Address is
new Ada.Unchecked_Conversion (Task_Id, System.Address);
-------------------
-- Abort_Handler --
-------------------
procedure Abort_Handler (Sig : Signal) is
pragma Unreferenced (Sig);
Self_Id : constant Task_Id := Self;
Result : Interfaces.C.int;
Old_Set : aliased sigset_t;
begin
if Self_Id.Deferral_Level = 0
and then Self_Id.Pending_ATC_Level < Self_Id.ATC_Nesting_Level
and then not Self_Id.Aborting
then
Self_Id.Aborting := True;
-- Make sure signals used for RTS internal purpose are unmasked
Result :=
pthread_sigmask
(SIG_UNBLOCK,
Unblocked_Signal_Mask'Access,
Old_Set'Access);
pragma Assert (Result = 0);
raise Standard'Abort_Signal;
end if;
end Abort_Handler;
-----------------
-- Stack_Guard --
-----------------
-- The underlying thread system sets a guard page at the bottom of a thread
-- stack, so nothing is needed.
-- ??? Check the comment above
procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is
pragma Unreferenced (T, On);
begin
null;
end Stack_Guard;
-------------------
-- Get_Thread_Id --
-------------------
function Get_Thread_Id (T : ST.Task_Id) return OSI.Thread_Id is
begin
return T.Common.LL.Thread;
end Get_Thread_Id;
----------
-- Self --
----------
function Self return Task_Id renames Specific.Self;
---------------------
-- Initialize_Lock --
---------------------
-- Note: mutexes and cond_variables needed per-task basis are initialized
-- in Initialize_TCB and the Storage_Error is handled. Other mutexes (such
-- as RTS_Lock, Memory_Lock...) used in RTS is initialized before any
-- status change of RTS. Therefore raising Storage_Error in the following
-- routines should be able to be handled safely.
procedure Initialize_Lock
(Prio : System.Any_Priority;
L : not null access Lock)
is
Attributes : aliased pthread_mutexattr_t;
Result : Interfaces.C.int;
begin
Result := pthread_mutexattr_init (Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = ENOMEM then
raise Storage_Error;
end if;
L.Priority := Prio;
Result := pthread_mutex_init (L.L'Access, Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = ENOMEM then
raise Storage_Error;
end if;
Result := pthread_mutexattr_destroy (Attributes'Access);
pragma Assert (Result = 0);
end Initialize_Lock;
procedure Initialize_Lock
(L : not null access RTS_Lock;
Level : Lock_Level)
is
pragma Unreferenced (Level);
Attributes : aliased pthread_mutexattr_t;
Result : Interfaces.C.int;
begin
Result := pthread_mutexattr_init (Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = ENOMEM then
raise Storage_Error;
end if;
Result := pthread_mutex_init (L, Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = ENOMEM then
raise Storage_Error;
end if;
Result := pthread_mutexattr_destroy (Attributes'Access);
pragma Assert (Result = 0);
end Initialize_Lock;
-------------------
-- Finalize_Lock --
-------------------
procedure Finalize_Lock (L : not null access Lock) is
Result : Interfaces.C.int;
begin
Result := pthread_mutex_destroy (L.L'Access);
pragma Assert (Result = 0);
end Finalize_Lock;
procedure Finalize_Lock (L : not null access RTS_Lock) is
Result : Interfaces.C.int;
begin
Result := pthread_mutex_destroy (L);
pragma Assert (Result = 0);
end Finalize_Lock;
----------------
-- Write_Lock --
----------------
procedure Write_Lock
(L : not null access Lock;
Ceiling_Violation : out Boolean)
is
Result : Interfaces.C.int;
begin
L.Owner_Priority := Get_Priority (Self);
if L.Priority < L.Owner_Priority then
Ceiling_Violation := True;
return;
end if;
Result := pthread_mutex_lock (L.L'Access);
pragma Assert (Result = 0);
Ceiling_Violation := False;
end Write_Lock;
procedure Write_Lock
(L : not null access RTS_Lock;
Global_Lock : Boolean := False)
is
Result : Interfaces.C.int;
begin
if not Single_Lock or else Global_Lock then
Result := pthread_mutex_lock (L);
pragma Assert (Result = 0);
end if;
end Write_Lock;
procedure Write_Lock (T : Task_Id) is
Result : Interfaces.C.int;
begin
if not Single_Lock then
Result := pthread_mutex_lock (T.Common.LL.L'Access);
pragma Assert (Result = 0);
end if;
end Write_Lock;
---------------
-- Read_Lock --
---------------
procedure Read_Lock
(L : not null access Lock;
Ceiling_Violation : out Boolean)
is
begin
Write_Lock (L, Ceiling_Violation);
end Read_Lock;
------------
-- Unlock --
------------
procedure Unlock (L : not null access Lock) is
Result : Interfaces.C.int;
begin
Result := pthread_mutex_unlock (L.L'Access);
pragma Assert (Result = 0);
end Unlock;
procedure Unlock
(L : not null access RTS_Lock;
Global_Lock : Boolean := False)
is
Result : Interfaces.C.int;
begin
if not Single_Lock or else Global_Lock then
Result := pthread_mutex_unlock (L);
pragma Assert (Result = 0);
end if;
end Unlock;
procedure Unlock (T : Task_Id) is
Result : Interfaces.C.int;
begin
if not Single_Lock then
Result := pthread_mutex_unlock (T.Common.LL.L'Access);
pragma Assert (Result = 0);
end if;
end Unlock;
-----------------
-- Set_Ceiling --
-----------------
-- Dynamic priority ceilings are not supported by the underlying system
procedure Set_Ceiling
(L : not null access Lock;
Prio : System.Any_Priority)
is
pragma Unreferenced (L, Prio);
begin
null;
end Set_Ceiling;
-----------
-- Sleep --
-----------
procedure Sleep
(Self_ID : Task_Id;
Reason : System.Tasking.Task_States)
is
pragma Unreferenced (Reason);
Result : Interfaces.C.int;
begin
Result :=
pthread_cond_wait
(cond => Self_ID.Common.LL.CV'Access,
mutex => (if Single_Lock
then Single_RTS_Lock'Access
else Self_ID.Common.LL.L'Access));
-- EINTR is not considered a failure
pragma Assert (Result = 0 or else Result = EINTR);
end Sleep;
-----------------
-- Timed_Sleep --
-----------------
procedure Timed_Sleep
(Self_ID : Task_Id;
Time : Duration;
Mode : ST.Delay_Modes;
Reason : System.Tasking.Task_States;
Timedout : out Boolean;
Yielded : out Boolean)
is
pragma Unreferenced (Reason);
Check_Time : constant Duration := Monotonic_Clock;
Abs_Time : Duration;
Request : aliased timespec;
Result : Interfaces.C.int;
begin
Timedout := True;
Yielded := False;
Abs_Time :=
(if Mode = Relative
then Duration'Min (Time, Max_Sensible_Delay) + Check_Time
else Duration'Min (Check_Time + Max_Sensible_Delay, Time));
if Abs_Time > Check_Time then
Request := To_Timespec (Abs_Time);
loop
exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level;
Result :=
pthread_cond_timedwait
(cond => Self_ID.Common.LL.CV'Access,
mutex => (if Single_Lock
then Single_RTS_Lock'Access
else Self_ID.Common.LL.L'Access),
abstime => Request'Access);
exit when Abs_Time <= Monotonic_Clock;
if Result = 0 or Result = EINTR then
-- Somebody may have called Wakeup for us
Timedout := False;
exit;
end if;
pragma Assert (Result = ETIMEDOUT);
end loop;
end if;
end Timed_Sleep;
-----------------
-- Timed_Delay --
-----------------
procedure Timed_Delay
(Self_ID : Task_Id;
Time : Duration;
Mode : ST.Delay_Modes)
is
Check_Time : constant Duration := Monotonic_Clock;
Abs_Time : Duration;
Request : aliased timespec;
Result : Interfaces.C.int;
pragma Warnings (Off, Result);
begin
if Single_Lock then
Lock_RTS;
end if;
Write_Lock (Self_ID);
Abs_Time :=
(if Mode = Relative
then Time + Check_Time
else Duration'Min (Check_Time + Max_Sensible_Delay, Time));
if Abs_Time > Check_Time then
Request := To_Timespec (Abs_Time);
Self_ID.Common.State := Delay_Sleep;
loop
exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level;
Result :=
pthread_cond_timedwait
(cond => Self_ID.Common.LL.CV'Access,
mutex => (if Single_Lock
then Single_RTS_Lock'Access
else Self_ID.Common.LL.L'Access),
abstime => Request'Access);
exit when Abs_Time <= Monotonic_Clock;
pragma Assert (Result = 0 or else
Result = ETIMEDOUT or else
Result = EINTR);
end loop;
Self_ID.Common.State := Runnable;
end if;
Unlock (Self_ID);
if Single_Lock then
Unlock_RTS;
end if;
Result := sched_yield;
end Timed_Delay;
---------------------
-- Monotonic_Clock --
---------------------
function Monotonic_Clock return Duration is
TS : aliased timespec;
Result : Interfaces.C.int;
begin
Result := Clock_Gettime (OSC.CLOCK_RT_Ada, TS'Unchecked_Access);
pragma Assert (Result = 0);
return To_Duration (TS);
end Monotonic_Clock;
-------------------
-- RT_Resolution --
-------------------
function RT_Resolution return Duration is
begin
return 10#1.0#E-6;
end RT_Resolution;
------------
-- Wakeup --
------------
procedure Wakeup (T : Task_Id; Reason : System.Tasking.Task_States) is
pragma Unreferenced (Reason);
Result : Interfaces.C.int;
begin
Result := pthread_cond_signal (T.Common.LL.CV'Access);
pragma Assert (Result = 0);
end Wakeup;
-----------
-- Yield --
-----------
procedure Yield (Do_Yield : Boolean := True) is
Result : Interfaces.C.int;
pragma Unreferenced (Result);
begin
if Do_Yield then
Result := sched_yield;
end if;
end Yield;
------------------
-- Set_Priority --
------------------
type Prio_Array_Type is array (System.Any_Priority) of Integer;
pragma Atomic_Components (Prio_Array_Type);
Prio_Array : Prio_Array_Type;
-- Global array containing the id of the currently running task for
-- each priority.
--
-- Note: assume we are on single processor with run-til-blocked scheduling
procedure Set_Priority
(T : Task_Id;
Prio : System.Any_Priority;
Loss_Of_Inheritance : Boolean := False)
is
Result : Interfaces.C.int;
Array_Item : Integer;
Param : aliased struct_sched_param;
function Get_Policy (Prio : System.Any_Priority) return Character;
pragma Import (C, Get_Policy, "__gnat_get_specific_dispatching");
-- Get priority specific dispatching policy
Priority_Specific_Policy : constant Character := Get_Policy (Prio);
-- Upper case first character of the policy name corresponding to the
-- task as set by a Priority_Specific_Dispatching pragma.
begin
Param.sched_priority := Interfaces.C.int (Underlying_Priorities (Prio));
if Dispatching_Policy = 'R'
or else Priority_Specific_Policy = 'R'
or else Time_Slice_Val > 0
then
Result :=
pthread_setschedparam
(T.Common.LL.Thread, SCHED_RR, Param'Access);
elsif Dispatching_Policy = 'F'
or else Priority_Specific_Policy = 'F'
or else Time_Slice_Val = 0
then
Result :=
pthread_setschedparam
(T.Common.LL.Thread, SCHED_FIFO, Param'Access);
else
Result :=
pthread_setschedparam
(T.Common.LL.Thread, SCHED_OTHER, Param'Access);
end if;
pragma Assert (Result = 0);
if Dispatching_Policy = 'F' or else Priority_Specific_Policy = 'F' then
-- Annex D requirement [RM D.2.2 par. 9]:
-- If the task drops its priority due to the loss of inherited
-- priority, it is added at the head of the ready queue for its
-- new active priority.
if Loss_Of_Inheritance
and then Prio < T.Common.Current_Priority
then
Array_Item := Prio_Array (T.Common.Base_Priority) + 1;
Prio_Array (T.Common.Base_Priority) := Array_Item;
loop
-- Let some processes a chance to arrive
Yield;
-- Then wait for our turn to proceed
exit when Array_Item = Prio_Array (T.Common.Base_Priority)
or else Prio_Array (T.Common.Base_Priority) = 1;
end loop;
Prio_Array (T.Common.Base_Priority) :=
Prio_Array (T.Common.Base_Priority) - 1;
end if;
end if;
T.Common.Current_Priority := Prio;
end Set_Priority;
------------------
-- Get_Priority --
------------------
function Get_Priority (T : Task_Id) return System.Any_Priority is
begin
return T.Common.Current_Priority;
end Get_Priority;
----------------
-- Enter_Task --
----------------
procedure Enter_Task (Self_ID : Task_Id) is
begin
Self_ID.Common.LL.Thread := pthread_self;
Specific.Set (Self_ID);
end Enter_Task;
-------------------
-- Is_Valid_Task --
-------------------
function Is_Valid_Task return Boolean renames Specific.Is_Valid_Task;
-----------------------------
-- Register_Foreign_Thread --
-----------------------------
function Register_Foreign_Thread return Task_Id is
begin
if Is_Valid_Task then
return Self;
else
return Register_Foreign_Thread (pthread_self);
end if;
end Register_Foreign_Thread;
--------------------
-- Initialize_TCB --
--------------------
procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is
Mutex_Attr : aliased pthread_mutexattr_t;
Result : Interfaces.C.int;
Cond_Attr : aliased pthread_condattr_t;
begin
if not Single_Lock then
Result := pthread_mutexattr_init (Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = 0 then
Result :=
pthread_mutex_init
(Self_ID.Common.LL.L'Access, Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
end if;
if Result /= 0 then
Succeeded := False;
return;
end if;
Result := pthread_mutexattr_destroy (Mutex_Attr'Access);
pragma Assert (Result = 0);
end if;
Result := pthread_condattr_init (Cond_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = 0 then
Result :=
pthread_cond_init
(Self_ID.Common.LL.CV'Access,
Cond_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
end if;
if Result = 0 then
Succeeded := True;
else
if not Single_Lock then
Result := pthread_mutex_destroy (Self_ID.Common.LL.L'Access);
pragma Assert (Result = 0);
end if;
Succeeded := False;
end if;
Result := pthread_condattr_destroy (Cond_Attr'Access);
pragma Assert (Result = 0);
end Initialize_TCB;
-----------------
-- Create_Task --
-----------------
procedure Create_Task
(T : Task_Id;
Wrapper : System.Address;
Stack_Size : System.Parameters.Size_Type;
Priority : System.Any_Priority;
Succeeded : out Boolean)
is
Attributes : aliased pthread_attr_t;
Result : Interfaces.C.int;
function Thread_Body_Access is new
Ada.Unchecked_Conversion (System.Address, Thread_Body);
begin
Result := pthread_attr_init (Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result /= 0 then
Succeeded := False;
return;
end if;
Result := pthread_attr_setstacksize
(Attributes'Access, Interfaces.C.size_t (Stack_Size));
pragma Assert (Result = 0);
-- Since the initial signal mask of a thread is inherited from the
-- creator, and the Environment task has all its signals masked, we
-- do not need to manipulate caller's signal mask at this point.
-- All tasks in RTS will have All_Tasks_Mask initially.
Result := pthread_create
(T.Common.LL.Thread'Access,
Attributes'Access,
Thread_Body_Access (Wrapper),
To_Address (T));
pragma Assert (Result = 0 or else Result = EAGAIN);
Succeeded := Result = 0;
pthread_detach (T.Common.LL.Thread'Access);
-- Detach the thread using pthread_detach, since DCE threads do not have
-- pthread_attr_set_detachstate.
Result := pthread_attr_destroy (Attributes'Access);
pragma Assert (Result = 0);
Set_Priority (T, Priority);
end Create_Task;
------------------
-- Finalize_TCB --
------------------
procedure Finalize_TCB (T : Task_Id) is
Result : Interfaces.C.int;
begin
if not Single_Lock then
Result := pthread_mutex_destroy (T.Common.LL.L'Access);
pragma Assert (Result = 0);
end if;
Result := pthread_cond_destroy (T.Common.LL.CV'Access);
pragma Assert (Result = 0);
if T.Known_Tasks_Index /= -1 then
Known_Tasks (T.Known_Tasks_Index) := null;
end if;
ATCB_Allocation.Free_ATCB (T);
end Finalize_TCB;
---------------
-- Exit_Task --
---------------
procedure Exit_Task is
begin
Specific.Set (null);
end Exit_Task;
----------------
-- Abort_Task --
----------------
procedure Abort_Task (T : Task_Id) is
begin
-- Interrupt Server_Tasks may be waiting on an "event" flag (signal)
if T.Common.State = Interrupt_Server_Blocked_On_Event_Flag then
System.Interrupt_Management.Operations.Interrupt_Self_Process
(PIO.Get_Interrupt_ID (T));
end if;
end Abort_Task;
----------------
-- Initialize --
----------------
procedure Initialize (S : in out Suspension_Object) is
Mutex_Attr : aliased pthread_mutexattr_t;
Cond_Attr : aliased pthread_condattr_t;
Result : Interfaces.C.int;
begin
-- Initialize internal state (always to False (ARM D.10(6)))
S.State := False;
S.Waiting := False;
-- Initialize internal mutex
Result := pthread_mutex_init (S.L'Access, Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result = ENOMEM then
raise Storage_Error;
end if;
-- Initialize internal condition variable
Result := pthread_cond_init (S.CV'Access, Cond_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result /= 0 then
Result := pthread_mutex_destroy (S.L'Access);
pragma Assert (Result = 0);
if Result = ENOMEM then
raise Storage_Error;
end if;
end if;
end Initialize;
--------------
-- Finalize --
--------------
procedure Finalize (S : in out Suspension_Object) is
Result : Interfaces.C.int;
begin
-- Destroy internal mutex
Result := pthread_mutex_destroy (S.L'Access);
pragma Assert (Result = 0);
-- Destroy internal condition variable
Result := pthread_cond_destroy (S.CV'Access);
pragma Assert (Result = 0);
end Finalize;
-------------------
-- Current_State --
-------------------
function Current_State (S : Suspension_Object) return Boolean is
begin
-- We do not want to use lock on this read operation. State is marked
-- as Atomic so that we ensure that the value retrieved is correct.
return S.State;
end Current_State;
---------------
-- Set_False --
---------------
procedure Set_False (S : in out Suspension_Object) is
Result : Interfaces.C.int;
begin
SSL.Abort_Defer.all;
Result := pthread_mutex_lock (S.L'Access);
pragma Assert (Result = 0);
S.State := False;
Result := pthread_mutex_unlock (S.L'Access);
pragma Assert (Result = 0);
SSL.Abort_Undefer.all;
end Set_False;
--------------
-- Set_True --
--------------
procedure Set_True (S : in out Suspension_Object) is
Result : Interfaces.C.int;
begin
SSL.Abort_Defer.all;
Result := pthread_mutex_lock (S.L'Access);
pragma Assert (Result = 0);
-- If there is already a task waiting on this suspension object then
-- we resume it, leaving the state of the suspension object to False,
-- as it is specified in ARM D.10 par. 9. Otherwise, it just leaves
-- the state to True.
if S.Waiting then
S.Waiting := False;
S.State := False;
Result := pthread_cond_signal (S.CV'Access);
pragma Assert (Result = 0);
else
S.State := True;
end if;
Result := pthread_mutex_unlock (S.L'Access);
pragma Assert (Result = 0);
SSL.Abort_Undefer.all;
end Set_True;
------------------------
-- Suspend_Until_True --
------------------------
procedure Suspend_Until_True (S : in out Suspension_Object) is
Result : Interfaces.C.int;
begin
SSL.Abort_Defer.all;
Result := pthread_mutex_lock (S.L'Access);
pragma Assert (Result = 0);
if S.Waiting then
-- Program_Error must be raised upon calling Suspend_Until_True
-- if another task is already waiting on that suspension object
-- (ARM D.10 par. 10).
Result := pthread_mutex_unlock (S.L'Access);
pragma Assert (Result = 0);
SSL.Abort_Undefer.all;
raise Program_Error;
else
-- Suspend the task if the state is False. Otherwise, the task
-- continues its execution, and the state of the suspension object
-- is set to False (ARM D.10 par. 9).
if S.State then
S.State := False;
else
S.Waiting := True;
loop
-- Loop in case pthread_cond_wait returns earlier than expected
-- (e.g. in case of EINTR caused by a signal).
Result := pthread_cond_wait (S.CV'Access, S.L'Access);
pragma Assert (Result = 0 or else Result = EINTR);
exit when not S.Waiting;
end loop;
end if;
Result := pthread_mutex_unlock (S.L'Access);
pragma Assert (Result = 0);
SSL.Abort_Undefer.all;
end if;
end Suspend_Until_True;
----------------
-- Check_Exit --
----------------
-- Dummy version
function Check_Exit (Self_ID : ST.Task_Id) return Boolean is
pragma Unreferenced (Self_ID);
begin
return True;
end Check_Exit;
--------------------
-- Check_No_Locks --
--------------------
function Check_No_Locks (Self_ID : ST.Task_Id) return Boolean is
pragma Unreferenced (Self_ID);
begin
return True;
end Check_No_Locks;
----------------------
-- Environment_Task --
----------------------
function Environment_Task return Task_Id is
begin
return Environment_Task_Id;
end Environment_Task;
--------------
-- Lock_RTS --
--------------
procedure Lock_RTS is
begin
Write_Lock (Single_RTS_Lock'Access, Global_Lock => True);
end Lock_RTS;
----------------
-- Unlock_RTS --
----------------
procedure Unlock_RTS is
begin
Unlock (Single_RTS_Lock'Access, Global_Lock => True);
end Unlock_RTS;
------------------
-- Suspend_Task --
------------------
function Suspend_Task
(T : ST.Task_Id;
Thread_Self : Thread_Id) return Boolean
is
pragma Unreferenced (T);
pragma Unreferenced (Thread_Self);
begin
return False;
end Suspend_Task;
-----------------
-- Resume_Task --
-----------------
function Resume_Task
(T : ST.Task_Id;
Thread_Self : Thread_Id) return Boolean
is
pragma Unreferenced (T);
pragma Unreferenced (Thread_Self);
begin
return False;
end Resume_Task;
--------------------
-- Stop_All_Tasks --
--------------------
procedure Stop_All_Tasks is
begin
null;
end Stop_All_Tasks;
---------------
-- Stop_Task --
---------------
function Stop_Task (T : ST.Task_Id) return Boolean is
pragma Unreferenced (T);
begin
return False;
end Stop_Task;
-------------------
-- Continue_Task --
-------------------
function Continue_Task (T : ST.Task_Id) return Boolean is
pragma Unreferenced (T);
begin
return False;
end Continue_Task;
----------------
-- Initialize --
----------------
procedure Initialize (Environment_Task : Task_Id) is
act : aliased struct_sigaction;
old_act : aliased struct_sigaction;
Tmp_Set : aliased sigset_t;
Result : Interfaces.C.int;
function State
(Int : System.Interrupt_Management.Interrupt_ID) return Character;
pragma Import (C, State, "__gnat_get_interrupt_state");
-- Get interrupt state. Defined in a-init.c. The input argument is
-- the interrupt number, and the result is one of the following:
Default : constant Character := 's';
-- 'n' this interrupt not set by any Interrupt_State pragma
-- 'u' Interrupt_State pragma set state to User
-- 'r' Interrupt_State pragma set state to Runtime
-- 's' Interrupt_State pragma set state to System (use "default"
-- system handler)
begin
Environment_Task_Id := Environment_Task;
Interrupt_Management.Initialize;
-- Initialize the lock used to synchronize chain of all ATCBs
Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level);
Specific.Initialize (Environment_Task);
-- Make environment task known here because it doesn't go through
-- Activate_Tasks, which does it for all other tasks.
Known_Tasks (Known_Tasks'First) := Environment_Task;
Environment_Task.Known_Tasks_Index := Known_Tasks'First;
Enter_Task (Environment_Task);
-- Install the abort-signal handler
if State (System.Interrupt_Management.Abort_Task_Interrupt)
/= Default
then
act.sa_flags := 0;
act.sa_handler := Abort_Handler'Address;
Result := sigemptyset (Tmp_Set'Access);
pragma Assert (Result = 0);
act.sa_mask := Tmp_Set;
Result :=
sigaction (
Signal (System.Interrupt_Management.Abort_Task_Interrupt),
act'Unchecked_Access,
old_act'Unchecked_Access);
pragma Assert (Result = 0);
end if;
end Initialize;
-- NOTE: Unlike other pthread implementations, we do *not* mask all
-- signals here since we handle signals using the process-wide primitive
-- signal, rather than using sigthreadmask and sigwait. The reason of
-- this difference is that sigwait doesn't work when some critical
-- signals (SIGABRT, SIGPIPE) are masked.
-----------------------
-- Set_Task_Affinity --
-----------------------
procedure Set_Task_Affinity (T : ST.Task_Id) is
pragma Unreferenced (T);
begin
-- Setting task affinity is not supported by the underlying system
null;
end Set_Task_Affinity;
end System.Task_Primitives.Operations;
| 28.262821 | 79 | 0.573656 |
23e96f2b7b1c11e1d15b7cd183d81ebd36e6194a | 1,012 | ads | Ada | src/tools/Dependency_Graph_Extractor/src/extraction.ads | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T13:00:47.000Z | 2022-03-08T13:00:47.000Z | src/tools/Dependency_Graph_Extractor/src/extraction.ads | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | null | null | null | src/tools/Dependency_Graph_Extractor/src/extraction.ads | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | null | null | null | with Ada.Strings.Unbounded;
with GNATCOLL.Projects;
with GNATCOLL.VFS;
with Libadalang.Analysis;
with Libadalang.Common;
with GraphML_Writers;
package Extraction is
package GPR renames GNATCOLL.Projects;
package GW renames GraphML_Writers;
package LAL renames Libadalang.Analysis;
package LALCO renames Libadalang.Common;
package SU renames Ada.Strings.Unbounded;
package VFS renames GNATCOLL.VFS;
function Node_Attributes return GW.Attribute_Definition_Sets.Map;
function Edge_Attributes return GW.Attribute_Definition_Sets.Map;
procedure Extract_Dependency_Graph
(Project_Filename : String;
Recurse_Projects : Boolean;
Directory_Prefix : VFS.Virtual_File;
Graph_File : in out GW.GraphML_File);
private
function "="(L, R : LAL.Ada_Node'Class) return Boolean renames LAL."=";
function "+"(Str : String) return SU.Unbounded_String is
(SU.To_Unbounded_String(Str));
Internal_Extraction_Error : exception;
end Extraction;
| 27.351351 | 74 | 0.751976 |
20178cd5bb2d778eb8604473eb319d5f1cba2dbc | 3,102 | adb | Ada | orka/src/orka/implementation/orka-rendering-programs.adb | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 52 | 2016-07-30T23:00:28.000Z | 2022-02-05T11:54:55.000Z | orka/src/orka/implementation/orka-rendering-programs.adb | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 79 | 2016-08-01T18:36:48.000Z | 2022-02-27T12:14:20.000Z | orka/src/orka/implementation/orka-rendering-programs.adb | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 4 | 2018-04-28T22:36:26.000Z | 2020-11-14T23:00:29.000Z | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2015 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.Objects.Buffers;
with Orka.Rendering.Programs.Modules;
with Orka.Rendering.Programs.Uniforms;
package body Orka.Rendering.Programs is
function Create_Program (Modules : Programs.Modules.Module_Array;
Separable : Boolean := False) return Program is
use type GL.Types.Int;
begin
return Result : Program do
Result.GL_Program.Set_Separable (Separable);
-- Attach all shaders to the program before linking
Programs.Modules.Attach_Shaders (Modules, Result);
Result.GL_Program.Link;
Programs.Modules.Detach_Shaders (Modules, Result);
if not Result.GL_Program.Link_Status then
raise Program_Link_Error with Result.GL_Program.Info_Log;
end if;
end return;
end Create_Program;
function Create_Program (Module : Programs.Modules.Module;
Separable : Boolean := False) return Program is
begin
return Create_Program (Modules.Module_Array'(1 => Module), Separable);
end Create_Program;
procedure Use_Program (Object : in out Program) is
begin
Object.GL_Program.Use_Program;
end Use_Program;
function Compute_Work_Group_Size
(Object : Program) return GL.Types.Compute.Dimension_Size_Array
is (Object.GL_Program.Compute_Work_Group_Size);
function Uniform_Sampler (Object : Program; Name : String)
return Uniforms.Uniform_Sampler is
begin
return Uniforms.Create_Uniform_Sampler (Object, Name);
end Uniform_Sampler;
function Uniform_Image (Object : Program; Name : String)
return Uniforms.Uniform_Image is
begin
return Uniforms.Create_Uniform_Image (Object, Name);
end Uniform_Image;
function Uniform (Object : Program; Name : String)
return Uniforms.Uniform is
begin
return Uniforms.Create_Uniform_Variable (Object, Name);
end Uniform;
function Binding
(Object : Program;
Target : Buffers.Indexed_Buffer_Target;
Name : String) return Natural
is
use all type Buffers.Indexed_Buffer_Target;
begin
return Natural (Object.GL_Program.Buffer_Binding
((case Target is
when Uniform => GL.Objects.Buffers.Uniform,
when Shader_Storage => GL.Objects.Buffers.Shader_Storage,
when Atomic_Counter => GL.Objects.Buffers.Atomic_Counter),
Name));
end Binding;
end Orka.Rendering.Programs;
| 33.717391 | 76 | 0.698904 |
0e0f3a3b374fd4e6aad63bc88a78c427bfe577b7 | 2,914 | ads | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-sopco4.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-sopco4.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-sopco4.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . S T R I N G _ O P S _ C O N C A T _ 4 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the function for concatenating four strings
-- NOTE: This package is obsolescent. It is no longer used by the compiler
-- which now generates concatenation inline. It is retained only because
-- it may be used during bootstrapping using old versions of the compiler.
pragma Compiler_Unit_Warning;
package System.String_Ops_Concat_4 is
pragma Pure;
function Str_Concat_4 (S1, S2, S3, S4 : String) return String;
-- Concatenate four strings and return resulting string
end System.String_Ops_Concat_4;
| 62 | 78 | 0.445779 |
0e5e90dc77e3ce1ca92792bf5d7ce892c179ba45 | 1,274 | adb | Ada | src/007/dll.adb | xeenta/learning-ada | bd3edf0c9e8b8eff814ffd89b040f488b80a7d5b | [
"MIT"
] | null | null | null | src/007/dll.adb | xeenta/learning-ada | bd3edf0c9e8b8eff814ffd89b040f488b80a7d5b | [
"MIT"
] | null | null | null | src/007/dll.adb | xeenta/learning-ada | bd3edf0c9e8b8eff814ffd89b040f488b80a7d5b | [
"MIT"
] | null | null | null | with
Ada.Text_IO,
Ada.Containers.Doubly_Linked_Lists;
use Ada.Text_IO;
procedure dll is
Equal_Limit : constant := 10;
generic
Threshold : in Integer := 0;
function Special_Equal (Left, Right : Integer) return Boolean;
function Special_Equal (Left, Right : Integer) return Boolean is
begin
return abs (Left - Right) <= Threshold;
end Special_Equal;
function Int_Cmp_Fuzzy is new Special_Equal (Threshold => Equal_Limit);
package Integer_List is new Ada.Containers.Doubly_Linked_Lists
(Element_Type => Integer,
"=" => Int_Cmp_Fuzzy);
package Int_IO is new Ada.Text_IO.Integer_IO (Integer);
use Int_IO;
A_List : Integer_List.List;
begin
-- we can write it like this: Pkg.Subprogram (O, ...)
Integer_List.Append (A_List, 10);
Integer_List.Append (A_List, 200);
Integer_List.Append (A_List, 220);
for E of A_List loop
Put (E); New_Line;
end loop;
-- or like this: O.Subprogram (...)
if A_List.Contains (200) then
Put_Line ("Contains 200");
end if;
-- we haven't put a 210 into the list, but our fuzzy cmp
-- says we did.
if A_List.Contains (210) then
Put_Line ("it seems there's a 210 too");
end if;
end dll;
| 24.980392 | 74 | 0.648352 |
39d2e40e450fb661f8c39bcb89ee6a6e13e02d67 | 489 | ads | Ada | priorities.ads | fsivan58/str-distracciones | c8201b1394f8952ead590cf4bb102ac13a2a2943 | [
"MIT"
] | null | null | null | priorities.ads | fsivan58/str-distracciones | c8201b1394f8952ead590cf4bb102ac13a2a2943 | [
"MIT"
] | null | null | null | priorities.ads | fsivan58/str-distracciones | c8201b1394f8952ead590cf4bb102ac13a2a2943 | [
"MIT"
] | null | null | null | -- Gonzalo Martin Rodriguez
-- Ivan Fernandez Samaniego
package Priorities is
Head_Priority : constant integer := 20; -- d=100, t=400
Risk_Priority : constant integer := 19; -- d=150, t=150
Sporadic_Priority : constant integer := 18; -- d=200, t=200
Distance_Priority : constant integer := 17; -- d=300, t=300
Steering_Priority : constant integer := 16; -- d=350, t=350
Display_Priority : constant integer := 15; -- d=1000, t=1000
end Priorities;
| 34.928571 | 66 | 0.656442 |
fb0ee5618dcd5df2c30c163aabb8863c92bb3ff2 | 3,215 | ads | Ada | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-imgcha.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-imgcha.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-imgcha.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . I M G _ C H A R --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Character'Image
package System.Img_Char is
pragma Pure;
procedure Image_Character
(V : Character;
S : in out String;
P : out Natural);
-- Computes Character'Image (V) and stores the result in S (1 .. P)
-- setting the resulting value of P. The caller guarantees that S is
-- long enough to hold the result, and that S'First is 1.
procedure Image_Character_05
(V : Character;
S : in out String;
P : out Natural);
-- Computes Character'Image (V) and stores the result in S (1 .. P)
-- setting the resulting value of P. The caller guarantees that S is
-- long enough to hold the result, and that S'First is 1. This version
-- is for use in Ada 2005 and beyond, where soft hyphen is a non-graphic
-- and results in "SOFT_HYPHEN" as the output.
end System.Img_Char;
| 57.410714 | 78 | 0.391602 |
39f0382547bf0c6239fd9b2c66738660059e8110 | 4,239 | ads | Ada | source/league/league-character_sets-internals.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/league/league-character_sets-internals.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/league/league-character_sets-internals.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision: 2342 $ $Date: 2011-12-06 17:15:51 +0200 (Втр, 06 Дек 2011) $
------------------------------------------------------------------------------
with Matreshka.Internals.Code_Point_Sets;
with Matreshka.Internals.Regexps;
with Matreshka.Internals.Unicode.Ucd;
package League.Character_Sets.Internals is
pragma Preelaborate;
use Matreshka.Internals;
function To_Set
(Flags : Matreshka.Internals.Regexps.General_Category_Flags)
return Universal_Character_Set;
function To_Set
(Property : Matreshka.Internals.Unicode.Ucd.Boolean_Properties)
return Universal_Character_Set;
function Wrap
(Data : not null Code_Point_Sets.Shared_Code_Point_Set_Access)
return Universal_Character_Set;
-- Creates instance of Universal_Character_Set as wrapper for the specified
-- shared data. Reference counter is untouched, thus once instance will
-- be finalized it will be decremented and shared data freed.
end League.Character_Sets.Internals;
| 59.704225 | 79 | 0.477235 |
cbd9d78f0d3e5fd5fdf7a3db0eeea7f7dfdfd887 | 7,233 | adb | Ada | tests/src/usb_testing-udc_scenarios.adb | Fabien-Chouteau/usb_embedded | 1adf5e9d74d6408ae355dd7cf0311a3529f8a260 | [
"BSD-3-Clause"
] | 14 | 2021-04-22T14:56:07.000Z | 2022-03-07T15:32:09.000Z | tests/src/usb_testing-udc_scenarios.adb | Fabien-Chouteau/usb_embedded | 1adf5e9d74d6408ae355dd7cf0311a3529f8a260 | [
"BSD-3-Clause"
] | 2 | 2021-09-24T21:33:55.000Z | 2021-11-19T13:46:58.000Z | tests/src/usb_testing-udc_scenarios.adb | Fabien-Chouteau/usb_embedded | 1adf5e9d74d6408ae355dd7cf0311a3529f8a260 | [
"BSD-3-Clause"
] | 3 | 2021-09-24T20:53:31.000Z | 2022-03-04T17:37:01.000Z | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2018, 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 AUnit.Assertions;
with USB.Device; use USB.Device;
with USB_Testing.Class_Stub;
with USB_Testing.Output;
package body USB_Testing.UDC_Scenarios is
--------------------
-- Basic_UDC_Test --
--------------------
procedure Basic_UDC_Test (Scenario : aliased UDC_Stub.Stub_Scenario;
Expected : AAA.Strings.Vector;
RX_Data : aliased UInt8_Array;
Early_Address : Boolean := False)
is
Output : aliased USB_Testing.Output.Text_Output;
Class : aliased Class_Stub.Device_Class_Stub (Output'Unchecked_Access,
1);
UDC : aliased UDC_Stub.Controller (Output'Unchecked_Access,
Scenario'Unchecked_Access,
RX_Data'Unchecked_Access,
Has_Early_Address => Early_Address,
Max_Packet_Size => 64,
EP_Buffers_Size => 256,
Number_Of_EPs => 10);
Ctrl : USB.Device.USB_Device_Stack (Max_Classes => 1);
Result : USB.Device.Init_Result;
begin
AUnit.Assertions.Assert
(Ctrl.Register_Class (Class'Unchecked_Access),
"USB STACK register class failed");
Result := Ctrl.Initialize
(Controller => UDC'Unchecked_Access,
Manufacturer => To_USB_String ("Manufacturer"),
Product => To_USB_String ("Product"),
Serial_Number => To_USB_String ("Serial"),
Max_Packet_Size => 64);
AUnit.Assertions.Assert
(Result = Ok, "USB STACK Init failed: " & Result'Img);
Ctrl.Start;
loop
Ctrl.Poll;
pragma Warnings (Off, "possible infinite loop");
exit when UDC.End_Of_Scenario;
pragma Warnings (On, "possible infinite loop");
end loop;
declare
use USB_Testing.Output;
Actual : constant AAA.Strings.Vector := Output.Dump;
begin
AUnit.Assertions.Assert
(Equal (Expected, Actual),
"Diff in output: " & ASCII.LF &
Diff (Expected, Actual, "Expected", "Actual").Flatten (ASCII.LF));
end;
end Basic_UDC_Test;
--------------------------
-- Two_Classes_UDC_Test --
--------------------------
procedure Two_Classes_UDC_Test (Scenario : aliased UDC_Stub.Stub_Scenario;
Expected : AAA.Strings.Vector;
RX_Data : aliased UInt8_Array)
is
Output : aliased USB_Testing.Output.Text_Output;
Class1 : aliased Class_Stub.Device_Class_Stub (Output'Unchecked_Access,
1);
Class2 : aliased Class_Stub.Device_Class_Stub (Output'Unchecked_Access,
2);
UDC : aliased UDC_Stub.Controller (Output'Unchecked_Access,
Scenario'Unchecked_Access,
RX_Data'Unchecked_Access,
Has_Early_Address => False,
Max_Packet_Size => 64,
EP_Buffers_Size => 256,
Number_Of_EPs => 10);
Ctrl : USB.Device.USB_Device_Stack (Max_Classes => 2);
Result : USB.Device.Init_Result;
begin
AUnit.Assertions.Assert
(Ctrl.Register_Class (Class1'Unchecked_Access),
"USB STACK register class1 failed");
AUnit.Assertions.Assert
(Ctrl.Register_Class (Class2'Unchecked_Access),
"USB STACK register class2 failed");
Result := Ctrl.Initialize
(Controller => UDC'Unchecked_Access,
Manufacturer => To_USB_String ("Manufacturer"),
Product => To_USB_String ("Product"),
Serial_Number => To_USB_String ("Serial"),
Max_Packet_Size => 64);
AUnit.Assertions.Assert
(Result = Ok, "USB STACK Init failed: " & Result'Img);
Ctrl.Start;
loop
Ctrl.Poll;
pragma Warnings (Off, "possible infinite loop");
exit when UDC.End_Of_Scenario;
pragma Warnings (On, "possible infinite loop");
end loop;
declare
use USB_Testing.Output;
Actual : constant AAA.Strings.Vector := Output.Dump;
begin
AUnit.Assertions.Assert
(Equal (Expected, Actual),
"Diff in output: " & ASCII.LF &
Diff (Expected, Actual, "Expected", "Actual").Flatten (ASCII.LF));
end;
end Two_Classes_UDC_Test;
end USB_Testing.UDC_Scenarios;
| 42.547059 | 80 | 0.517766 |
cbaee025d5d81a7eaed25c2667f8e3594ed2b144 | 912 | adb | Ada | gdb/testsuite/gdb.ada/fixed_cmp/fixed.adb | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | 1 | 2020-10-14T03:24:35.000Z | 2020-10-14T03:24:35.000Z | gdb/testsuite/gdb.ada/fixed_cmp/fixed.adb | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | null | null | null | gdb/testsuite/gdb.ada/fixed_cmp/fixed.adb | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | null | null | null | -- Copyright 2007-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Fixed is
type Fixed_Point_Type is delta 0.001 range 0.0 .. 1000.0;
My_Var : Fixed_Point_Type := 14.0;
begin
Do_Nothing (My_Var'Address); -- STOP
end Fixed;
| 36.48 | 73 | 0.729167 |
1c6d595b37cc2d0f485dec2b740df241d699b4b3 | 404 | ads | Ada | 3-mid/opengl/source/lean/buffer/opengl-buffer-indices.ads | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 20 | 2015-11-04T09:23:59.000Z | 2022-01-14T10:21:42.000Z | 3-mid/opengl/source/lean/buffer/opengl-buffer-indices.ads | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | 2 | 2015-11-04T17:05:56.000Z | 2015-12-08T03:16:13.000Z | 3-mid/opengl/source/lean/buffer/opengl-buffer-indices.ads | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | 1 | 2015-12-07T12:53:52.000Z | 2015-12-07T12:53:52.000Z | with
openGL.Buffer.general;
package openGL.Buffer.indices is new openGL.Buffer.general (base_Object => Buffer.element_array_Object,
Index => long_Index_t,
Element => Index_t,
Element_Array => Indices);
| 50.5 | 105 | 0.398515 |
205f45b2b05d38af56c2821a4c69d5d045c9101c | 32,728 | ads | Ada | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stzbou.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stzbou.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stzbou.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . W I D E _ W I D E _ B O U N D E D --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Wide_Wide_Maps;
with Ada.Strings.Wide_Wide_Superbounded;
package Ada.Strings.Wide_Wide_Bounded is
pragma Preelaborate;
generic
Max : Positive;
-- Maximum length of a Bounded_Wide_Wide_String
package Generic_Bounded_Length is
Max_Length : constant Positive := Max;
type Bounded_Wide_Wide_String is private;
pragma Preelaborable_Initialization (Bounded_Wide_Wide_String);
Null_Bounded_Wide_Wide_String : constant Bounded_Wide_Wide_String;
subtype Length_Range is Natural range 0 .. Max_Length;
function Length (Source : Bounded_Wide_Wide_String) return Length_Range;
--------------------------------------------------------
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
function To_Bounded_Wide_Wide_String
(Source : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
function To_Wide_Wide_String
(Source : Bounded_Wide_Wide_String) return Wide_Wide_String;
procedure Set_Bounded_Wide_Wide_String
(Target : out Bounded_Wide_Wide_String;
Source : Wide_Wide_String;
Drop : Truncation := Error);
pragma Ada_05 (Set_Bounded_Wide_Wide_String);
function Append
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
function Append
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
function Append
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
function Append
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_Character;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
function Append
(Left : Wide_Wide_Character;
Right : Bounded_Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
procedure Append
(Source : in out Bounded_Wide_Wide_String;
New_Item : Bounded_Wide_Wide_String;
Drop : Truncation := Error);
procedure Append
(Source : in out Bounded_Wide_Wide_String;
New_Item : Wide_Wide_String;
Drop : Truncation := Error);
procedure Append
(Source : in out Bounded_Wide_Wide_String;
New_Item : Wide_Wide_Character;
Drop : Truncation := Error);
function "&"
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Bounded_Wide_Wide_String;
function "&"
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Bounded_Wide_Wide_String;
function "&"
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Bounded_Wide_Wide_String;
function "&"
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_Character) return Bounded_Wide_Wide_String;
function "&"
(Left : Wide_Wide_Character;
Right : Bounded_Wide_Wide_String) return Bounded_Wide_Wide_String;
function Element
(Source : Bounded_Wide_Wide_String;
Index : Positive) return Wide_Wide_Character;
procedure Replace_Element
(Source : in out Bounded_Wide_Wide_String;
Index : Positive;
By : Wide_Wide_Character);
function Slice
(Source : Bounded_Wide_Wide_String;
Low : Positive;
High : Natural) return Wide_Wide_String;
function Bounded_Slice
(Source : Bounded_Wide_Wide_String;
Low : Positive;
High : Natural) return Bounded_Wide_Wide_String;
pragma Ada_05 (Bounded_Slice);
procedure Bounded_Slice
(Source : Bounded_Wide_Wide_String;
Target : out Bounded_Wide_Wide_String;
Low : Positive;
High : Natural);
pragma Ada_05 (Bounded_Slice);
function "="
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function "="
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean;
function "="
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function "<"
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function "<"
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean;
function "<"
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function "<="
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function "<="
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean;
function "<="
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function ">"
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function ">"
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean;
function ">"
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function ">="
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
function ">="
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean;
function ">="
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean;
----------------------
-- Search Functions --
----------------------
function Index
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural;
function Index
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Index
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
function Index
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural;
pragma Ada_05 (Index);
function Index
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
pragma Ada_05 (Index);
function Index
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
pragma Ada_05 (Index);
function Index_Non_Blank
(Source : Bounded_Wide_Wide_String;
Going : Direction := Forward) return Natural;
function Index_Non_Blank
(Source : Bounded_Wide_Wide_String;
From : Positive;
Going : Direction := Forward) return Natural;
pragma Ada_05 (Index_Non_Blank);
function Count
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural;
function Count
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Count
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural;
procedure Find_Token
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
From : Positive;
Test : Membership;
First : out Positive;
Last : out Natural);
pragma Ada_2012 (Find_Token);
procedure Find_Token
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
------------------------------------
-- String Translation Subprograms --
------------------------------------
function Translate
(Source : Bounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping)
return Bounded_Wide_Wide_String;
procedure Translate
(Source : in out Bounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping);
function Translate
(Source : Bounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Bounded_Wide_Wide_String;
procedure Translate
(Source : in out Bounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
(Source : Bounded_Wide_Wide_String;
Low : Positive;
High : Natural;
By : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
procedure Replace_Slice
(Source : in out Bounded_Wide_Wide_String;
Low : Positive;
High : Natural;
By : Wide_Wide_String;
Drop : Truncation := Error);
function Insert
(Source : Bounded_Wide_Wide_String;
Before : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
procedure Insert
(Source : in out Bounded_Wide_Wide_String;
Before : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error);
function Overwrite
(Source : Bounded_Wide_Wide_String;
Position : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
procedure Overwrite
(Source : in out Bounded_Wide_Wide_String;
Position : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error);
function Delete
(Source : Bounded_Wide_Wide_String;
From : Positive;
Through : Natural) return Bounded_Wide_Wide_String;
procedure Delete
(Source : in out Bounded_Wide_Wide_String;
From : Positive;
Through : Natural);
---------------------------------
-- String Selector Subprograms --
---------------------------------
function Trim
(Source : Bounded_Wide_Wide_String;
Side : Trim_End) return Bounded_Wide_Wide_String;
procedure Trim
(Source : in out Bounded_Wide_Wide_String;
Side : Trim_End);
function Trim
(Source : Bounded_Wide_Wide_String;
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : Wide_Wide_Maps.Wide_Wide_Character_Set)
return Bounded_Wide_Wide_String;
procedure Trim
(Source : in out Bounded_Wide_Wide_String;
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : Wide_Wide_Maps.Wide_Wide_Character_Set);
function Head
(Source : Bounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
procedure Head
(Source : in out Bounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error);
function Tail
(Source : Bounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
procedure Tail
(Source : in out Bounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error);
------------------------------------
-- String Constructor Subprograms --
------------------------------------
function "*"
(Left : Natural;
Right : Wide_Wide_Character) return Bounded_Wide_Wide_String;
function "*"
(Left : Natural;
Right : Wide_Wide_String) return Bounded_Wide_Wide_String;
function "*"
(Left : Natural;
Right : Bounded_Wide_Wide_String) return Bounded_Wide_Wide_String;
function Replicate
(Count : Natural;
Item : Wide_Wide_Character;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
function Replicate
(Count : Natural;
Item : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
function Replicate
(Count : Natural;
Item : Bounded_Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String;
private
-- Most of the implementation is in the separate non generic package
-- Ada.Strings.Wide_Wide_Superbounded. Type Bounded_Wide_Wide_String is
-- derived from type Wide_Wide_Superbounded.Super_String with the
-- maximum length constraint. In almost all cases, the routines in
-- Wide_Wide_Superbounded can be called with no requirement to pass the
-- maximum length explicitly, since there is at least one
-- Bounded_Wide_Wide_String argument from which the maximum length can
-- be obtained. For all such routines, the implementation in this
-- private part is simply renaming of the corresponding routine in the
-- super bouded package.
-- The five exceptions are the * and Replicate routines operating on
-- character values. For these cases, we have a routine in the body
-- that calls the superbounded routine passing the maximum length
-- explicitly as an extra parameter.
type Bounded_Wide_Wide_String is
new Wide_Wide_Superbounded.Super_String (Max_Length);
-- Deriving Bounded_Wide_Wide_String from
-- Wide_Wide_Superbounded.Super_String is the real trick, it ensures
-- that the type Bounded_Wide_Wide_String declared in the generic
-- instantiation is compatible with the Super_String type declared in
-- the Wide_Wide_Superbounded package.
Null_Bounded_Wide_Wide_String : constant Bounded_Wide_Wide_String :=
(Max_Length => Max_Length,
Current_Length => 0,
Data =>
(1 .. Max_Length =>
Wide_Wide_Superbounded.Wide_Wide_NUL));
pragma Inline (To_Bounded_Wide_Wide_String);
procedure Set_Bounded_Wide_Wide_String
(Target : out Bounded_Wide_Wide_String;
Source : Wide_Wide_String;
Drop : Truncation := Error)
renames Set_Super_String;
function Length
(Source : Bounded_Wide_Wide_String) return Length_Range
renames Super_Length;
function To_Wide_Wide_String
(Source : Bounded_Wide_Wide_String) return Wide_Wide_String
renames Super_To_String;
function Append
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Append;
function Append
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Append;
function Append
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Append;
function Append
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_Character;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Append;
function Append
(Left : Wide_Wide_Character;
Right : Bounded_Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Append;
procedure Append
(Source : in out Bounded_Wide_Wide_String;
New_Item : Bounded_Wide_Wide_String;
Drop : Truncation := Error)
renames Super_Append;
procedure Append
(Source : in out Bounded_Wide_Wide_String;
New_Item : Wide_Wide_String;
Drop : Truncation := Error)
renames Super_Append;
procedure Append
(Source : in out Bounded_Wide_Wide_String;
New_Item : Wide_Wide_Character;
Drop : Truncation := Error)
renames Super_Append;
function "&"
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Bounded_Wide_Wide_String
renames Concat;
function "&"
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Bounded_Wide_Wide_String
renames Concat;
function "&"
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Bounded_Wide_Wide_String
renames Concat;
function "&"
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_Character) return Bounded_Wide_Wide_String
renames Concat;
function "&"
(Left : Wide_Wide_Character;
Right : Bounded_Wide_Wide_String) return Bounded_Wide_Wide_String
renames Concat;
function Element
(Source : Bounded_Wide_Wide_String;
Index : Positive) return Wide_Wide_Character
renames Super_Element;
procedure Replace_Element
(Source : in out Bounded_Wide_Wide_String;
Index : Positive;
By : Wide_Wide_Character)
renames Super_Replace_Element;
function Slice
(Source : Bounded_Wide_Wide_String;
Low : Positive;
High : Natural) return Wide_Wide_String
renames Super_Slice;
function Bounded_Slice
(Source : Bounded_Wide_Wide_String;
Low : Positive;
High : Natural) return Bounded_Wide_Wide_String
renames Super_Slice;
procedure Bounded_Slice
(Source : Bounded_Wide_Wide_String;
Target : out Bounded_Wide_Wide_String;
Low : Positive;
High : Natural)
renames Super_Slice;
overriding function "="
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Equal;
function "="
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
renames Equal;
function "="
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Equal;
function "<"
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Less;
function "<"
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
renames Less;
function "<"
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Less;
function "<="
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Less_Or_Equal;
function "<="
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
renames Less_Or_Equal;
function "<="
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Less_Or_Equal;
function ">"
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Greater;
function ">"
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
renames Greater;
function ">"
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Greater;
function ">="
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Greater_Or_Equal;
function ">="
(Left : Bounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
renames Greater_Or_Equal;
function ">="
(Left : Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Greater_Or_Equal;
function Index
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural
renames Super_Index;
function Index
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural
renames Super_Index;
function Index
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership := Inside;
Going : Direction := Forward) return Natural
renames Super_Index;
function Index
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural
renames Super_Index;
function Index
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural
renames Super_Index;
function Index
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural
renames Super_Index;
function Index_Non_Blank
(Source : Bounded_Wide_Wide_String;
Going : Direction := Forward) return Natural
renames Super_Index_Non_Blank;
function Index_Non_Blank
(Source : Bounded_Wide_Wide_String;
From : Positive;
Going : Direction := Forward) return Natural
renames Super_Index_Non_Blank;
function Count
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural
renames Super_Count;
function Count
(Source : Bounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural
renames Super_Count;
function Count
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural
renames Super_Count;
procedure Find_Token
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
From : Positive;
Test : Membership;
First : out Positive;
Last : out Natural)
renames Super_Find_Token;
procedure Find_Token
(Source : Bounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
renames Super_Find_Token;
function Translate
(Source : Bounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping)
return Bounded_Wide_Wide_String
renames Super_Translate;
procedure Translate
(Source : in out Bounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping)
renames Super_Translate;
function Translate
(Source : Bounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Bounded_Wide_Wide_String
renames Super_Translate;
procedure Translate
(Source : in out Bounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
renames Super_Translate;
function Replace_Slice
(Source : Bounded_Wide_Wide_String;
Low : Positive;
High : Natural;
By : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Replace_Slice;
procedure Replace_Slice
(Source : in out Bounded_Wide_Wide_String;
Low : Positive;
High : Natural;
By : Wide_Wide_String;
Drop : Truncation := Error)
renames Super_Replace_Slice;
function Insert
(Source : Bounded_Wide_Wide_String;
Before : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Insert;
procedure Insert
(Source : in out Bounded_Wide_Wide_String;
Before : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error)
renames Super_Insert;
function Overwrite
(Source : Bounded_Wide_Wide_String;
Position : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Overwrite;
procedure Overwrite
(Source : in out Bounded_Wide_Wide_String;
Position : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error)
renames Super_Overwrite;
function Delete
(Source : Bounded_Wide_Wide_String;
From : Positive;
Through : Natural) return Bounded_Wide_Wide_String
renames Super_Delete;
procedure Delete
(Source : in out Bounded_Wide_Wide_String;
From : Positive;
Through : Natural)
renames Super_Delete;
function Trim
(Source : Bounded_Wide_Wide_String;
Side : Trim_End) return Bounded_Wide_Wide_String
renames Super_Trim;
procedure Trim
(Source : in out Bounded_Wide_Wide_String;
Side : Trim_End)
renames Super_Trim;
function Trim
(Source : Bounded_Wide_Wide_String;
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : Wide_Wide_Maps.Wide_Wide_Character_Set)
return Bounded_Wide_Wide_String
renames Super_Trim;
procedure Trim
(Source : in out Bounded_Wide_Wide_String;
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : Wide_Wide_Maps.Wide_Wide_Character_Set)
renames Super_Trim;
function Head
(Source : Bounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Head;
procedure Head
(Source : in out Bounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error)
renames Super_Head;
function Tail
(Source : Bounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Tail;
procedure Tail
(Source : in out Bounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error)
renames Super_Tail;
function "*"
(Left : Natural;
Right : Bounded_Wide_Wide_String) return Bounded_Wide_Wide_String
renames Times;
function Replicate
(Count : Natural;
Item : Bounded_Wide_Wide_String;
Drop : Truncation := Error) return Bounded_Wide_Wide_String
renames Super_Replicate;
end Generic_Bounded_Length;
end Ada.Strings.Wide_Wide_Bounded;
| 34.891258 | 79 | 0.599853 |
397fc6d3b05e5f69f573ba04c14c6b578aa3ba14 | 1,741 | ads | Ada | boards/stm32f429_discovery/src/sfp/adl_config.ads | Kidev/Ada_Drivers_Library | da434883bc217ddecb8f61686d301d24cb1df17d | [
"BSD-3-Clause"
] | null | null | null | boards/stm32f429_discovery/src/sfp/adl_config.ads | Kidev/Ada_Drivers_Library | da434883bc217ddecb8f61686d301d24cb1df17d | [
"BSD-3-Clause"
] | null | null | null | boards/stm32f429_discovery/src/sfp/adl_config.ads | Kidev/Ada_Drivers_Library | da434883bc217ddecb8f61686d301d24cb1df17d | [
"BSD-3-Clause"
] | null | null | null | -- This package was generated by the Ada_Drivers_Library project wizard script
package ADL_Config is
Vendor : constant String := "STMicro"; -- From board definition
Max_Mount_Points : constant := 2; -- From default value
Max_Mount_Name_Length : constant := 128; -- From default value
Runtime_Profile : constant String := "ravenscar-sfp"; -- From command line
Device_Name : constant String := "STM32F429ZITx"; -- From board definition
Device_Family : constant String := "STM32F4"; -- From board definition
Runtime_Name : constant String := "ravenscar-sfp-stm32f429disco"; -- From default value
Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition
CPU_Core : constant String := "ARM Cortex-M4F"; -- From mcu definition
Board : constant String := "STM32F429_Discovery"; -- From command line
Has_ZFP_Runtime : constant String := "False"; -- From board definition
Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition
High_Speed_External_Clock : constant := 8000000; -- From board definition
Max_Path_Length : constant := 1024; -- From default value
Runtime_Name_Suffix : constant String := "stm32f429disco"; -- From board definition
Architecture : constant String := "ARM"; -- From board definition
end ADL_Config;
| 87.05 | 109 | 0.554279 |
187c099c8261fd2f436a24e9394425af9ba258a0 | 3,327 | adb | Ada | common/dist/zlib/contrib/ada/zlib-thin.adb | calmsacibis995/minix | dfba95598f553b6560131d35a76658f1f8c9cf38 | [
"Unlicense"
] | 3 | 2021-05-04T17:09:06.000Z | 2021-10-04T07:19:26.000Z | common/dist/zlib/contrib/ada/zlib-thin.adb | calmsacibis995/minix | dfba95598f553b6560131d35a76658f1f8c9cf38 | [
"Unlicense"
] | null | null | null | common/dist/zlib/contrib/ada/zlib-thin.adb | calmsacibis995/minix | dfba95598f553b6560131d35a76658f1f8c9cf38 | [
"Unlicense"
] | null | null | null | ----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
-- Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp
package body ZLib.Thin is
ZLIB_VERSION : constant Chars_Ptr := zlibVersion;
Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit;
--------------
-- Avail_In --
--------------
function Avail_In (Strm : in Z_Stream) return UInt is
begin
return Strm.Avail_In;
end Avail_In;
---------------
-- Avail_Out --
---------------
function Avail_Out (Strm : in Z_Stream) return UInt is
begin
return Strm.Avail_Out;
end Avail_Out;
------------------
-- Deflate_Init --
------------------
function Deflate_Init
(strm : Z_Streamp;
level : Int;
method : Int;
windowBits : Int;
memLevel : Int;
strategy : Int)
return Int is
begin
return deflateInit2
(strm,
level,
method,
windowBits,
memLevel,
strategy,
ZLIB_VERSION,
Z_Stream_Size);
end Deflate_Init;
------------------
-- Inflate_Init --
------------------
function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is
begin
return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size);
end Inflate_Init;
------------------------
-- Last_Error_Message --
------------------------
function Last_Error_Message (Strm : in Z_Stream) return String is
use Interfaces.C.Strings;
begin
if Strm.msg = Null_Ptr then
return "";
else
return Value (Strm.msg);
end if;
end Last_Error_Message;
------------
-- Set_In --
------------
procedure Set_In
(Strm : in out Z_Stream;
Buffer : in Voidp;
Size : in UInt) is
begin
Strm.Next_In := Buffer;
Strm.Avail_In := Size;
end Set_In;
------------------
-- Set_Mem_Func --
------------------
procedure Set_Mem_Func
(Strm : in out Z_Stream;
Opaque : in Voidp;
Alloc : in alloc_func;
Free : in free_func) is
begin
Strm.opaque := Opaque;
Strm.zalloc := Alloc;
Strm.zfree := Free;
end Set_Mem_Func;
-------------
-- Set_Out --
-------------
procedure Set_Out
(Strm : in out Z_Stream;
Buffer : in Voidp;
Size : in UInt) is
begin
Strm.Next_Out := Buffer;
Strm.Avail_Out := Size;
end Set_Out;
--------------
-- Total_In --
--------------
function Total_In (Strm : in Z_Stream) return ULong is
begin
return Strm.Total_In;
end Total_In;
---------------
-- Total_Out --
---------------
function Total_Out (Strm : in Z_Stream) return ULong is
begin
return Strm.Total_Out;
end Total_Out;
end ZLib.Thin;
| 23.429577 | 75 | 0.459573 |
3951ced3a85df720b154c25de4a323db25551e33 | 5,728 | ads | Ada | bb-runtimes/arm/stm32/stm32f0xx/stm32f0x8/svd/i-stm32.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/arm/stm32/stm32f0xx/stm32f0x8/svd/i-stm32.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/arm/stm32/stm32f0xx/stm32f0x8/svd/i-stm32.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | --
-- Copyright (C) 2020, AdaCore
--
-- This spec has been automatically generated from STM32F0x8.svd
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
-- STM32F0x8
package Interfaces.STM32 is
pragma Preelaborate;
pragma No_Elaboration_Code_All;
---------------
-- Base type --
---------------
type UInt32 is new Interfaces.Unsigned_32;
type UInt16 is new Interfaces.Unsigned_16;
type Byte is new Interfaces.Unsigned_8;
type Bit is mod 2**1
with Size => 1;
type UInt2 is mod 2**2
with Size => 2;
type UInt3 is mod 2**3
with Size => 3;
type UInt4 is mod 2**4
with Size => 4;
type UInt5 is mod 2**5
with Size => 5;
type UInt6 is mod 2**6
with Size => 6;
type UInt7 is mod 2**7
with Size => 7;
type UInt9 is mod 2**9
with Size => 9;
type UInt10 is mod 2**10
with Size => 10;
type UInt11 is mod 2**11
with Size => 11;
type UInt12 is mod 2**12
with Size => 12;
type UInt13 is mod 2**13
with Size => 13;
type UInt14 is mod 2**14
with Size => 14;
type UInt15 is mod 2**15
with Size => 15;
type UInt17 is mod 2**17
with Size => 17;
type UInt18 is mod 2**18
with Size => 18;
type UInt19 is mod 2**19
with Size => 19;
type UInt20 is mod 2**20
with Size => 20;
type UInt21 is mod 2**21
with Size => 21;
type UInt22 is mod 2**22
with Size => 22;
type UInt23 is mod 2**23
with Size => 23;
type UInt24 is mod 2**24
with Size => 24;
type UInt25 is mod 2**25
with Size => 25;
type UInt26 is mod 2**26
with Size => 26;
type UInt27 is mod 2**27
with Size => 27;
type UInt28 is mod 2**28
with Size => 28;
type UInt29 is mod 2**29
with Size => 29;
type UInt30 is mod 2**30
with Size => 30;
type UInt31 is mod 2**31
with Size => 31;
--------------------
-- Base addresses --
--------------------
CRC_Base : constant System.Address := System'To_Address (16#40023000#);
GPIOF_Base : constant System.Address := System'To_Address (16#48001400#);
GPIOD_Base : constant System.Address := System'To_Address (16#48000C00#);
GPIOC_Base : constant System.Address := System'To_Address (16#48000800#);
GPIOB_Base : constant System.Address := System'To_Address (16#48000400#);
GPIOE_Base : constant System.Address := System'To_Address (16#48001000#);
GPIOA_Base : constant System.Address := System'To_Address (16#48000000#);
SPI1_Base : constant System.Address := System'To_Address (16#40013000#);
SPI2_Base : constant System.Address := System'To_Address (16#40003800#);
PWR_Base : constant System.Address := System'To_Address (16#40007000#);
I2C1_Base : constant System.Address := System'To_Address (16#40005400#);
I2C2_Base : constant System.Address := System'To_Address (16#40005800#);
IWDG_Base : constant System.Address := System'To_Address (16#40003000#);
WWDG_Base : constant System.Address := System'To_Address (16#40002C00#);
TIM1_Base : constant System.Address := System'To_Address (16#40012C00#);
TIM2_Base : constant System.Address := System'To_Address (16#40000000#);
TIM3_Base : constant System.Address := System'To_Address (16#40000400#);
TIM14_Base : constant System.Address := System'To_Address (16#40002000#);
TIM6_Base : constant System.Address := System'To_Address (16#40001000#);
TIM7_Base : constant System.Address := System'To_Address (16#40001400#);
EXTI_Base : constant System.Address := System'To_Address (16#40010400#);
NVIC_Base : constant System.Address := System'To_Address (16#E000E100#);
DMA1_Base : constant System.Address := System'To_Address (16#40020000#);
DMA2_Base : constant System.Address := System'To_Address (16#40020400#);
RCC_Base : constant System.Address := System'To_Address (16#40021000#);
SYSCFG_COMP_Base : constant System.Address := System'To_Address (16#40010000#);
ADC_Base : constant System.Address := System'To_Address (16#40012400#);
USART1_Base : constant System.Address := System'To_Address (16#40013800#);
USART2_Base : constant System.Address := System'To_Address (16#40004400#);
USART3_Base : constant System.Address := System'To_Address (16#40004800#);
USART4_Base : constant System.Address := System'To_Address (16#40004C00#);
USART6_Base : constant System.Address := System'To_Address (16#40011400#);
USART7_Base : constant System.Address := System'To_Address (16#40011800#);
USART8_Base : constant System.Address := System'To_Address (16#40011C00#);
USART5_Base : constant System.Address := System'To_Address (16#40005000#);
RTC_Base : constant System.Address := System'To_Address (16#40002800#);
TIM15_Base : constant System.Address := System'To_Address (16#40014000#);
TIM16_Base : constant System.Address := System'To_Address (16#40014400#);
TIM17_Base : constant System.Address := System'To_Address (16#40014800#);
TSC_Base : constant System.Address := System'To_Address (16#40024000#);
CEC_Base : constant System.Address := System'To_Address (16#40007800#);
Flash_Base : constant System.Address := System'To_Address (16#40022000#);
DBGMCU_Base : constant System.Address := System'To_Address (16#40015800#);
USB_Base : constant System.Address := System'To_Address (16#40005C00#);
CRS_Base : constant System.Address := System'To_Address (16#40006C00#);
CAN_Base : constant System.Address := System'To_Address (16#40006400#);
DAC_Base : constant System.Address := System'To_Address (16#40007400#);
SCB_Base : constant System.Address := System'To_Address (16#E000ED00#);
STK_Base : constant System.Address := System'To_Address (16#E000E010#);
end Interfaces.STM32;
| 41.507246 | 82 | 0.680168 |
1c72477e161d2114f28bfb1c9316fdb85c7a0806 | 2,653 | ads | Ada | b2stest/spaiosta.ads | lkujaw/ada-blake2 | e661083c765000d5ed4e4d8e09c49b46db83641c | [
"MIT-0"
] | 1 | 2021-11-03T00:38:59.000Z | 2021-11-03T00:38:59.000Z | b2stest/spaiosta.ads | lkujaw/ada-blake2 | e661083c765000d5ed4e4d8e09c49b46db83641c | [
"MIT-0"
] | 1 | 2021-09-24T04:42:58.000Z | 2021-09-29T12:21:22.000Z | b2stest/spaiosta.ads | lkujaw/blake2s | e661083c765000d5ed4e4d8e09c49b46db83641c | [
"MIT-0"
] | null | null | null | -----------------------------------------------------------------------
-- Copyright 2021 Lev Kujawski --
-- --
-- This file is part of B2STEST. --
-- --
-- B2STEST 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. --
-- --
-- B2STEST 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 B2STEST. --
-- If not, see <https://www.gnu.org/licenses/>. --
-- --
-- SPDX-License-Identifier: GPL-3.0-or-later --
-- --
-- File: spaiosta.ads (Ada Package Specification) --
-- Language: SPARK83 [1] subset of Ada (1987) [2] --
-- Author: Lev Kujawski --
-- Description: Ada Text_IO binding for SPARK83 --
-- --
-- References: --
-- [1] SPARK Team, SPARK83 - The SPADE Ada83 Kernel, --
-- Altran Praxis, 17 Oct. 2011. --
-- [2] Programming languages - Ada, ISO/IEC 8652:1987, --
-- 15 Jun. 1987. --
-----------------------------------------------------------------------
with SPARK_IO;
pragma Elaborate_All (SPARK_IO);
--# inherit SPARK_IO;
package SPARK_IO_Standard
--# own Input,
--# Output;
--# initializes Input,
--# Output;
is
--# accept Warning_Message, 407, "Elaborate_Body given";
pragma Elaborate_Body;
Input : SPARK_IO.File_T;
Output : SPARK_IO.File_T;
end SPARK_IO_Standard;
| 51.019231 | 71 | 0.388994 |
2061af4bc5491b2a9f67461caae0bde305b73f5f | 10,303 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95087c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95087c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95087c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C95087C.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT ASSIGNMENTS TO ENTRY FORMAL PARAMETERS OF UNCONSTRAINED
-- RECORD, PRIVATE, AND LIMITED PRIVATE TYPES WITH DEFAULT
-- CONSTRAINTS RAISE CONSTRAINT_ERROR IF THE ACTUAL PARAMETER IS
-- CONSTRAINED AND THE CONSTRAINT VALUES OF THE OBJECT BEING
-- ASSIGNED TO DO NOT SATISFY THOSE OF THE ACTUAL PARAMETER.
-- SUBTESTS ARE:
-- (A) CONSTRAINED ACTUAL PARAMETERS OF RECORD TYPE.
-- (B) CONSTRAINED ACTUAL PARAMETERS OF PRIVATE TYPE.
-- (C) CONSTRAINED ACTUAL PARAMETERS OF LIMITED PRIVATE TYPE.
-- RJW 1/15/86
WITH REPORT; USE REPORT;
PROCEDURE C95087C IS
BEGIN
TEST ( "C95087C", "CHECK ASSIGNMENTS TO ENTRY FORMAL " &
"PARAMETERS OF UNCONSTRAINED TYPES " &
"(WITH DEFAULTS)" );
--------------------------------------------------
DECLARE -- (A)
PACKAGE PKG IS
SUBTYPE INTRANGE IS INTEGER RANGE 0..31;
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS
RECORD
INTFLD : INTRANGE;
STRFLD : STRING(1..CONSTRAINT);
END RECORD;
REC91,REC92,REC93 : RECTYPE(9);
REC_OOPS : RECTYPE(4);
TASK T IS
ENTRY E (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE);
END T;
END PKG;
PACKAGE BODY PKG IS
TASK BODY T IS
BEGIN
ACCEPT E (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE) DO
IF (NOT REC1'CONSTRAINED) OR
(REC1.CONSTRAINT /= IDENT_INT(9)) THEN
FAILED ( "CONSTRAINT ON RECORD TYPE " &
"IN PARAMETER NOT RECOGNIZED" );
END IF;
BEGIN -- ASSIGNMENT TO IN OUT PARAMETER.
REC2 := REC_OOPS;
FAILED ( "CONSTRAINT_ERROR NOT " &
"RAISED - A.1" );
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION " &
"RAISED - A.1" );
END;
BEGIN -- ASSIGNMENT TO OUT PARAMETER.
REC3 := REC_OOPS;
FAILED ( "CONSTRAINT_ERROR NOT " &
"RAISED - A.2" );
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION " &
"RAISED - A.2" );
END;
END E;
END T;
BEGIN
REC91 := (9, 9, "123456789");
REC92 := REC91;
REC93 := REC91;
REC_OOPS := (4, 4, "OOPS");
END PKG;
BEGIN -- (A)
PKG.T.E (PKG.REC91, PKG.REC92, PKG.REC93);
END; -- (A)
--------------------------------------------------
DECLARE -- (B)
PACKAGE PKG IS
SUBTYPE INTRANGE IS INTEGER RANGE 0..31;
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS PRIVATE;
TASK T IS
ENTRY E (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE);
END T;
PRIVATE
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS
RECORD
INTFLD : INTRANGE;
STRFLD : STRING(1..CONSTRAINT);
END RECORD;
END PKG;
REC91, REC92, REC93 : PKG.RECTYPE(9);
REC_OOPS : PKG.RECTYPE(4);
PACKAGE BODY PKG IS
TASK BODY T IS
BEGIN
ACCEPT E (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE) DO
IF (NOT REC1'CONSTRAINED) OR
(REC1.CONSTRAINT /= IDENT_INT(9)) THEN
FAILED ( "CONSTRAINT ON PRIVATE TYPE " &
"IN PARAMETER NOT RECOGNIZED" );
END IF;
BEGIN -- ASSIGNMENT TO IN OUT PARAMETER.
REC2 := REC_OOPS;
FAILED ( "CONSTRAINT_ERROR NOT " &
"RAISED - B.1" );
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION " &
"RAISED - B.1" );
END;
BEGIN -- ASSIGNMENT TO OUT PARAMETER.
REC3 := REC_OOPS;
FAILED ( "CONSTRAINT_ERROR NOT " &
"RAISED - B.2" );
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION " &
"RAISED - B.2" );
END;
END E;
END T;
BEGIN
REC91 := (9, 9, "123456789");
REC92 := REC91;
REC93 := REC91;
REC_OOPS := (4, 4, "OOPS");
END PKG;
BEGIN -- (B)
PKG.T.E (REC91, REC92, REC93);
END; -- (B)
--------------------------------------------------
DECLARE -- (C)
PACKAGE PKG IS
SUBTYPE INTRANGE IS INTEGER RANGE 0..31;
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS
LIMITED PRIVATE;
TASK T IS
ENTRY E (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE);
END T;
PRIVATE
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS
RECORD
INTFLD : INTRANGE;
STRFLD : STRING(1..CONSTRAINT);
END RECORD;
END PKG;
REC91,REC92,REC93 : PKG.RECTYPE(9);
REC_OOPS : PKG.RECTYPE(4);
PACKAGE BODY PKG IS
TASK BODY T IS
BEGIN
ACCEPT E (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE) DO
IF (NOT REC1'CONSTRAINED) OR
(REC1.CONSTRAINT /= 9) THEN
FAILED ( "CONSTRAINT ON LIMITED " &
"PRIVATE TYPE IN PARAMETER " &
"NOT RECOGNIZED" );
END IF;
BEGIN -- ASSIGNMENT TO IN OUT PARAMETER.
REC2 := REC_OOPS;
FAILED ( "CONSTRAINT_ERROR NOT " &
"RAISED - C.1" );
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION " &
"RAISED - C.1" );
END;
BEGIN -- ASSIGNMENT TO OUT PARAMETER.
REC3 := REC_OOPS;
FAILED ( "CONSTRAINT_ERROR NOT RAISED " &
"- C.2" );
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION " &
"RAISED - C.2" );
END;
END E;
END T;
BEGIN
REC91 := (9, 9, "123456789");
REC92 := REC91;
REC93 := REC91;
REC_OOPS := (4, 4, "OOPS");
END PKG;
BEGIN -- (C)
PKG.T.E (REC91, REC92, REC93);
END; -- (C)
--------------------------------------------------
RESULT;
END C95087C;
| 34.343333 | 79 | 0.388916 |
1c52fe650b6d907e3d4b1b683d7ad41f7e2fce9c | 457 | ads | Ada | rts/src/a-except.ads | Lucretia/tamp2 | c94c4ccb17d9e279099dcea72553b0abaa2a8403 | [
"BSD-2-Clause-FreeBSD"
] | 7 | 2015-07-12T14:32:52.000Z | 2020-09-23T11:25:43.000Z | rts/src/a-except.ads | AdaDoom3/bare_bones | e303b8ce4845010ccf2bbcd3323e2decd58e478a | [
"CC0-1.0"
] | null | null | null | rts/src/a-except.ads | AdaDoom3/bare_bones | e303b8ce4845010ccf2bbcd3323e2decd58e478a | [
"CC0-1.0"
] | 1 | 2021-07-13T11:52:03.000Z | 2021-07-13T11:52:03.000Z | with System;
package Ada.Exceptions is
pragma Preelaborate (Exceptions);
type Exception_Id is private;
pragma Preelaborable_Initialization (Exception_Id);
Null_Id : constant Exception_Id;
procedure Raise_Exception
(E : Exception_Id;
Message : String := "");
pragma No_Return (Raise_Exception);
private
type Exception_Id is new Natural;
Null_Id : constant Exception_Id := Exception_Id'First;
end Ada.Exceptions;
| 22.85 | 57 | 0.728665 |
3950caff005ff33795bb658757a2b69b4bd8de73 | 73,905 | adb | Ada | actions/hls_helloworld/hw/hlsUpperCase_xcvu9p-flgb2104-2l-e/helloworld/.autopilot/db/hls_action.bind.adb | zhichaoliaus/snap | 8cf38fe712414c7e09df908dda803f92d7791957 | [
"Apache-2.0"
] | null | null | null | actions/hls_helloworld/hw/hlsUpperCase_xcvu9p-flgb2104-2l-e/helloworld/.autopilot/db/hls_action.bind.adb | zhichaoliaus/snap | 8cf38fe712414c7e09df908dda803f92d7791957 | [
"Apache-2.0"
] | null | null | null | actions/hls_helloworld/hw/hlsUpperCase_xcvu9p-flgb2104-2l-e/helloworld/.autopilot/db/hls_action.bind.adb | zhichaoliaus/snap | 8cf38fe712414c7e09df908dda803f92d7791957 | [
"Apache-2.0"
] | null | null | null | <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="15">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>hls_action</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>host_mem</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>2</direction>
<if_type>4</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>din_gmem_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>din_gmem.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>dout_gmem_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>dout_gmem.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>act_reg</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>act_reg</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>992</bitwidth>
</Value>
<direction>2</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>Action_Config</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>Action_Config</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>1</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>22</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>6</id>
<name>dout_gmem_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>dout_gmem.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>43</item>
<item>44</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>7</id>
<name>din_gmem_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>din_gmem.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>45</item>
<item>46</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>dout_gmem_V3</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>58</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>48</item>
<item>49</item>
<item>51</item>
<item>53</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>9</id>
<name>din_gmem_V1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>58</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>54</item>
<item>55</item>
<item>56</item>
<item>57</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>act_reg_read</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second class_id="12" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="0" version="0">
<first class_id="14" tracking_level="0" version="0">
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>992</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>59</item>
<item>60</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>act_reg_Control_flag</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>62</item>
<item>63</item>
<item>65</item>
<item>67</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>cond</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>68</item>
<item>70</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name></name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>109</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>109</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>71</item>
<item>72</item>
<item>73</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>act_reg_Data_in_addr</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>81</item>
<item>82</item>
<item>84</item>
<item>86</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>act_reg_Data_in_size</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>88</item>
<item>89</item>
<item>91</item>
<item>93</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>act_reg_Data_out_add</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>94</item>
<item>95</item>
<item>97</item>
<item>99</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name></name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>118</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>118</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>101</item>
<item>102</item>
<item>103</item>
<item>104</item>
<item>105</item>
<item>106</item>
<item>107</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name></name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>119</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>119</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>108</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name></name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>112</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>112</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>75</item>
<item>76</item>
<item>78</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name></name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>114</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>114</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>storemerge</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>14</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>110</item>
<item>111</item>
<item>113</item>
<item>114</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>storemerge_cast1</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>115</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>storemerge_cast</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>116</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>act_reg_read_1</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>992</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>117</item>
<item>118</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name>act_reg11_part_set</name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>992</bitwidth>
</Value>
<oprand_edges>
<count>5</count>
<item_version>0</item_version>
<item>120</item>
<item>121</item>
<item>122</item>
<item>124</item>
<item>125</item>
</oprand_edges>
<opcode>partset</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name></name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>113</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>113</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>5</count>
<item_version>0</item_version>
<item>127</item>
<item>128</item>
<item>129</item>
<item>262</item>
<item>263</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name></name>
<fileName>action_uppercase.cpp</fileName>
<fileDirectory>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</fileDirectory>
<lineNumber>121</lineNumber>
<contextFuncName>hls_action</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/afs/apd.pok.ibm.com/func/vlsi/eclipz/c14/usr/zhichao/p9nd2/SNAP/snap/actions/hls_helloworld/hw</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>action_uppercase.cpp</first>
<second>hls_action</second>
</first>
<second>121</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>16</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_28">
<Value>
<Obj>
<type>2</type>
<id>50</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>6</content>
</item>
<item class_id_reference="16" object_id="_29">
<Value>
<Obj>
<type>2</type>
<id>52</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>63</content>
</item>
<item class_id_reference="16" object_id="_30">
<Value>
<Obj>
<type>2</type>
<id>64</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>8</content>
</item>
<item class_id_reference="16" object_id="_31">
<Value>
<Obj>
<type>2</type>
<id>66</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>15</content>
</item>
<item class_id_reference="16" object_id="_32">
<Value>
<Obj>
<type>2</type>
<id>69</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_33">
<Value>
<Obj>
<type>2</type>
<id>77</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>146298638344</content>
</item>
<item class_id_reference="16" object_id="_34">
<Value>
<Obj>
<type>2</type>
<id>83</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>128</content>
</item>
<item class_id_reference="16" object_id="_35">
<Value>
<Obj>
<type>2</type>
<id>85</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>191</content>
</item>
<item class_id_reference="16" object_id="_36">
<Value>
<Obj>
<type>2</type>
<id>90</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>192</content>
</item>
<item class_id_reference="16" object_id="_37">
<Value>
<Obj>
<type>2</type>
<id>92</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>223</content>
</item>
<item class_id_reference="16" object_id="_38">
<Value>
<Obj>
<type>2</type>
<id>96</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>256</content>
</item>
<item class_id_reference="16" object_id="_39">
<Value>
<Obj>
<type>2</type>
<id>98</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>319</content>
</item>
<item class_id_reference="16" object_id="_40">
<Value>
<Obj>
<type>2</type>
<id>100</id>
<name>process_action</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:process_action></content>
</item>
<item class_id_reference="16" object_id="_41">
<Value>
<Obj>
<type>2</type>
<id>109</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>14</bitwidth>
</Value>
<const_type>0</const_type>
<content>258</content>
</item>
<item class_id_reference="16" object_id="_42">
<Value>
<Obj>
<type>2</type>
<id>112</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>14</bitwidth>
</Value>
<const_type>0</const_type>
<content>8207</content>
</item>
<item class_id_reference="16" object_id="_43">
<Value>
<Obj>
<type>2</type>
<id>123</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>32</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_44">
<Obj>
<type>3</type>
<id>24</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>8</count>
<item_version>0</item_version>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_45">
<Obj>
<type>3</type>
<id>30</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>5</count>
<item_version>0</item_version>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_46">
<Obj>
<type>3</type>
<id>33</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>31</item>
<item>32</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_47">
<Obj>
<type>3</type>
<id>41</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>7</count>
<item_version>0</item_version>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
<item>39</item>
<item>40</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>56</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_48">
<id>44</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_49">
<id>46</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_50">
<id>49</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_51">
<id>51</id>
<edge_type>1</edge_type>
<source_obj>50</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_52">
<id>53</id>
<edge_type>1</edge_type>
<source_obj>52</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_53">
<id>55</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_54">
<id>56</id>
<edge_type>1</edge_type>
<source_obj>50</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_55">
<id>57</id>
<edge_type>1</edge_type>
<source_obj>52</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_56">
<id>60</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_57">
<id>63</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_58">
<id>65</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_59">
<id>67</id>
<edge_type>1</edge_type>
<source_obj>66</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_60">
<id>68</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_61">
<id>70</id>
<edge_type>1</edge_type>
<source_obj>69</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_62">
<id>71</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_63">
<id>72</id>
<edge_type>2</edge_type>
<source_obj>30</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_64">
<id>73</id>
<edge_type>2</edge_type>
<source_obj>33</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_65">
<id>76</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_66">
<id>78</id>
<edge_type>1</edge_type>
<source_obj>77</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_67">
<id>79</id>
<edge_type>2</edge_type>
<source_obj>41</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_68">
<id>82</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_69">
<id>84</id>
<edge_type>1</edge_type>
<source_obj>83</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_70">
<id>86</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_71">
<id>89</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_72">
<id>91</id>
<edge_type>1</edge_type>
<source_obj>90</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_73">
<id>93</id>
<edge_type>1</edge_type>
<source_obj>92</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_74">
<id>95</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_75">
<id>97</id>
<edge_type>1</edge_type>
<source_obj>96</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_76">
<id>99</id>
<edge_type>1</edge_type>
<source_obj>98</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_77">
<id>101</id>
<edge_type>1</edge_type>
<source_obj>100</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_78">
<id>102</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_79">
<id>103</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_80">
<id>104</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_81">
<id>105</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_82">
<id>106</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_83">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_84">
<id>108</id>
<edge_type>2</edge_type>
<source_obj>41</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_85">
<id>110</id>
<edge_type>1</edge_type>
<source_obj>109</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_86">
<id>111</id>
<edge_type>2</edge_type>
<source_obj>30</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_87">
<id>113</id>
<edge_type>1</edge_type>
<source_obj>112</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_88">
<id>114</id>
<edge_type>2</edge_type>
<source_obj>33</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_89">
<id>115</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_90">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_91">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_92">
<id>121</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_93">
<id>122</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_94">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>123</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_95">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>52</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_96">
<id>128</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_97">
<id>129</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_98">
<id>258</id>
<edge_type>2</edge_type>
<source_obj>24</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_99">
<id>259</id>
<edge_type>2</edge_type>
<source_obj>24</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_100">
<id>260</id>
<edge_type>2</edge_type>
<source_obj>30</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_101">
<id>261</id>
<edge_type>2</edge_type>
<source_obj>33</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_102">
<id>262</id>
<edge_type>4</edge_type>
<source_obj>37</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_103">
<id>263</id>
<edge_type>4</edge_type>
<source_obj>20</source_obj>
<sink_obj>39</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_104">
<mId>1</mId>
<mTag>hls_action</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>4</count>
<item_version>0</item_version>
<item>24</item>
<item>30</item>
<item>33</item>
<item>41</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>-1</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_105">
<states class_id="25" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_106">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>24</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_107">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_108">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_109">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_110">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_111">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_112">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_113">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_114">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_115">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_116">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_117">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_118">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_119">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_120">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_121">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_122">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_123">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_124">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_125">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_126">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_127">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_128">
<id>28</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_129">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_130">
<id>32</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_131">
<id>2</id>
<operations>
<count>9</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_132">
<id>28</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_133">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_134">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_135">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_136">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_137">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_138">
<id>38</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_139">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_140">
<id>40</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_141">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>9</id>
<sop class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="-1"></res>
<node_label_latency class_id="35" tracking_level="0" version="0">
<count>22</count>
<item_version>0</item_version>
<item class_id="36" tracking_level="0" version="0">
<first>6</first>
<second class_id="37" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>7</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>8</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>9</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="38" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="39" tracking_level="0" version="0">
<first>24</first>
<second class_id="40" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="41" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</regions>
<dp_fu_nodes class_id="42" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="43" tracking_level="0" version="0">
<first>96</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>102</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>108</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>20</item>
<item>37</item>
</second>
</item>
<item>
<first>114</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>122</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>133</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>141</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>28</item>
<item>28</item>
</second>
</item>
<item>
<first>152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>163</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>174</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>184</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>190</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>201</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>212</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>227</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>231</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="45" tracking_level="0" version="0">
<count>11</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="0" version="0">
<first>act_reg11_part_set_fu_231</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>act_reg_Control_flag_fu_174</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>act_reg_Data_in_addr_fu_190</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>act_reg_Data_in_size_fu_201</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>act_reg_Data_out_add_fu_212</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>cond_fu_184</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>din_gmem_V1_fu_163</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>dout_gmem_V3_fu_152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>storemerge_cast1_fu_223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>storemerge_cast_fu_227</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>storemerge_phi_fu_133</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>1</count>
<item_version>0</item_version>
<item>
<first>grp_process_action_fu_141</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>28</item>
<item>28</item>
</second>
</item>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>5</count>
<item_version>0</item_version>
<item>
<first>StgValue_25_write_fu_114</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>StgValue_34_write_fu_122</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>din_gmem_V_read_read_fu_102</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>dout_gmem_V_read_read_fu_96</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>grp_read_fu_108</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>20</item>
<item>37</item>
</second>
</item>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="47" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>7</count>
<item_version>0</item_version>
<item>
<first>129</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>244</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>249</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>254</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>258</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>263</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>268</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>7</count>
<item_version>0</item_version>
<item>
<first>act_reg_Data_in_addr_reg_258</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>act_reg_Data_in_size_reg_263</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>act_reg_Data_out_add_reg_268</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>cond_reg_254</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>din_gmem_V1_reg_249</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>dout_gmem_V3_reg_244</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>storemerge_reg_129</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>1</count>
<item_version>0</item_version>
<item>
<first>129</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>1</count>
<item_version>0</item_version>
<item>
<first>storemerge_reg_129</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="48" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="49" tracking_level="0" version="0">
<first>Action_Config</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
</second>
</item>
<item>
<first>act_reg</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>20</item>
<item>37</item>
</second>
</item>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
</second>
</item>
<item>
<first>din_gmem_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
</second>
</item>
<item>
<first>dout_gmem_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
</second>
</item>
<item>
<first>host_mem</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="50" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
| 25.904311 | 132 | 0.593979 |
4a4054a083881a0da94fafbc9468ab88046890e8 | 758 | adb | Ada | ada/gui/demo/myeventhandler.adb | charlesdaniels/libagar | 099ce716e2ca01a7904b23f22610bf589295f5b5 | [
"BSD-2-Clause"
] | 286 | 2017-07-31T20:05:16.000Z | 2022-03-26T20:26:24.000Z | ada/gui/demo/myeventhandler.adb | kalatestimine/libagar | f830265ad00a82d4cddd8b59943bd3887ebb1486 | [
"BSD-2-Clause"
] | 67 | 2017-08-30T18:56:21.000Z | 2021-09-08T03:38:20.000Z | ada/gui/demo/myeventhandler.adb | kalatestimine/libagar | f830265ad00a82d4cddd8b59943bd3887ebb1486 | [
"BSD-2-Clause"
] | 31 | 2017-08-14T13:34:12.000Z | 2022-03-14T15:33:49.000Z | with Ada.Text_IO;
package body myeventhandler is
procedure Ping (Event : EV.Event_Access) is begin
Ada.Text_IO.Put_Line ("Ping");
end;
procedure Some_Event (Event : EV.Event_Access) is
My_String : constant String := EV.Get_String (Event, 1); -- by index
My_Float : constant Float := EV.Get_Float (Event, 2);
Width : constant Natural := EV.Get_Natural(Event, "width"); -- by name
Height : constant Natural := EV.Get_Natural(Event, "height");
begin
Ada.Text_IO.Put_Line
("some-event: My_String=" & My_String & "; My_Float=" & Float'Image(My_Float));
Ada.Text_IO.Put_Line(
"some-event: Width=" & Natural'Image(Width) & "; Height=" & Natural'Image(Height));
end;
end myeventhandler;
| 34.454545 | 89 | 0.651715 |
1cf440006fbd4fcd9c726b381b5dba0aa47ec415 | 2,442 | ads | Ada | src/arch/socs/stm32f407/soc-pwr.ads | PThierry/ewok-kernel | e9c23cb3fd0afd8378bc27418778e1117d5e16cc | [
"Apache-2.0"
] | 65 | 2018-09-26T09:10:11.000Z | 2022-01-30T21:17:37.000Z | src/arch/socs/stm32f407/soc-pwr.ads | PThierry/ewok-kernel | e9c23cb3fd0afd8378bc27418778e1117d5e16cc | [
"Apache-2.0"
] | 22 | 2019-04-07T15:15:54.000Z | 2020-10-15T12:45:54.000Z | src/arch/socs/stm32f407/soc-pwr.ads | PThierry/ewok-kernel | e9c23cb3fd0afd8378bc27418778e1117d5e16cc | [
"Apache-2.0"
] | 10 | 2018-09-27T09:43:08.000Z | 2021-01-29T22:50:17.000Z | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with system;
package soc.pwr
with spark_mode => off
is
-------------------------------------------
-- PWR power control register (PWR_CR) --
-- STM32F405xx/07xx and STM32F415xx/17xx --
-------------------------------------------
type t_vos is (VOS_SCALE2, VOS_SCALE1) with size => 1;
for t_vos use
(VOS_SCALE2 => 0,
VOS_SCALE1 => 1);
type t_PWR_CR is record
LPDS : bit;
PDDS : bit;
CWUF : bit;
CSBF : bit;
PVDE : bit;
PLS : bits_3;
DBP : bit;
FPDS : bit;
reserved_10_13 : bits_4;
VOS : t_vos;
reserved_15_31 : bits_17;
end record
with volatile_full_access, size => 32;
for t_PWR_CR use record
LPDS at 0 range 0 .. 0;
PDDS at 0 range 1 .. 1;
CWUF at 0 range 2 .. 2;
CSBF at 0 range 3 .. 3;
PVDE at 0 range 4 .. 4;
PLS at 0 range 5 .. 7;
DBP at 0 range 8 .. 8;
FPDS at 0 range 9 .. 9;
reserved_10_13 at 0 range 10 .. 13;
VOS at 0 range 14 .. 14;
reserved_15_31 at 0 range 15 .. 31;
end record;
--------------------
-- PWR peripheral --
--------------------
type t_PWR_peripheral is record
CR : t_PWR_CR;
end record
with volatile;
for t_PWR_peripheral use record
CR at 16#00# range 0 .. 31;
end record;
PWR : t_PWR_peripheral
with
import,
volatile,
address => system'to_address(16#4000_7000#);
end soc.pwr;
| 28.068966 | 79 | 0.529075 |
2016590a1d895549c1b7fcb3a74c3b4f967dd578 | 21,881 | ads | Ada | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-cwila9.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-cwila9.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-cwila9.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . C H A R A C T E R S . W I D E _ L A T I N _ 9 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides definitions analogous to those in the GNAT
-- package Ada.Characters.Latin_9 except that the type of the constants
-- is Wide_Character instead of Character. The provision of this package
-- is in accordance with the implementation permission in RM (A.3.3(27)).
package Ada.Characters.Wide_Latin_9 is
pragma Pure;
------------------------
-- Control Characters --
------------------------
NUL : constant Wide_Character := Wide_Character'Val (0);
SOH : constant Wide_Character := Wide_Character'Val (1);
STX : constant Wide_Character := Wide_Character'Val (2);
ETX : constant Wide_Character := Wide_Character'Val (3);
EOT : constant Wide_Character := Wide_Character'Val (4);
ENQ : constant Wide_Character := Wide_Character'Val (5);
ACK : constant Wide_Character := Wide_Character'Val (6);
BEL : constant Wide_Character := Wide_Character'Val (7);
BS : constant Wide_Character := Wide_Character'Val (8);
HT : constant Wide_Character := Wide_Character'Val (9);
LF : constant Wide_Character := Wide_Character'Val (10);
VT : constant Wide_Character := Wide_Character'Val (11);
FF : constant Wide_Character := Wide_Character'Val (12);
CR : constant Wide_Character := Wide_Character'Val (13);
SO : constant Wide_Character := Wide_Character'Val (14);
SI : constant Wide_Character := Wide_Character'Val (15);
DLE : constant Wide_Character := Wide_Character'Val (16);
DC1 : constant Wide_Character := Wide_Character'Val (17);
DC2 : constant Wide_Character := Wide_Character'Val (18);
DC3 : constant Wide_Character := Wide_Character'Val (19);
DC4 : constant Wide_Character := Wide_Character'Val (20);
NAK : constant Wide_Character := Wide_Character'Val (21);
SYN : constant Wide_Character := Wide_Character'Val (22);
ETB : constant Wide_Character := Wide_Character'Val (23);
CAN : constant Wide_Character := Wide_Character'Val (24);
EM : constant Wide_Character := Wide_Character'Val (25);
SUB : constant Wide_Character := Wide_Character'Val (26);
ESC : constant Wide_Character := Wide_Character'Val (27);
FS : constant Wide_Character := Wide_Character'Val (28);
GS : constant Wide_Character := Wide_Character'Val (29);
RS : constant Wide_Character := Wide_Character'Val (30);
US : constant Wide_Character := Wide_Character'Val (31);
-------------------------------------
-- ISO 646 Graphic Wide_Characters --
-------------------------------------
Space : constant Wide_Character := ' '; -- WC'Val(32)
Exclamation : constant Wide_Character := '!'; -- WC'Val(33)
Quotation : constant Wide_Character := '"'; -- WC'Val(34)
Number_Sign : constant Wide_Character := '#'; -- WC'Val(35)
Dollar_Sign : constant Wide_Character := '$'; -- WC'Val(36)
Percent_Sign : constant Wide_Character := '%'; -- WC'Val(37)
Ampersand : constant Wide_Character := '&'; -- WC'Val(38)
Apostrophe : constant Wide_Character := '''; -- WC'Val(39)
Left_Parenthesis : constant Wide_Character := '('; -- WC'Val(40)
Right_Parenthesis : constant Wide_Character := ')'; -- WC'Val(41)
Asterisk : constant Wide_Character := '*'; -- WC'Val(42)
Plus_Sign : constant Wide_Character := '+'; -- WC'Val(43)
Comma : constant Wide_Character := ','; -- WC'Val(44)
Hyphen : constant Wide_Character := '-'; -- WC'Val(45)
Minus_Sign : Wide_Character renames Hyphen;
Full_Stop : constant Wide_Character := '.'; -- WC'Val(46)
Solidus : constant Wide_Character := '/'; -- WC'Val(47)
-- Decimal digits '0' though '9' are at positions 48 through 57
Colon : constant Wide_Character := ':'; -- WC'Val(58)
Semicolon : constant Wide_Character := ';'; -- WC'Val(59)
Less_Than_Sign : constant Wide_Character := '<'; -- WC'Val(60)
Equals_Sign : constant Wide_Character := '='; -- WC'Val(61)
Greater_Than_Sign : constant Wide_Character := '>'; -- WC'Val(62)
Question : constant Wide_Character := '?'; -- WC'Val(63)
Commercial_At : constant Wide_Character := '@'; -- WC'Val(64)
-- Letters 'A' through 'Z' are at positions 65 through 90
Left_Square_Bracket : constant Wide_Character := '['; -- WC'Val (91)
Reverse_Solidus : constant Wide_Character := '\'; -- WC'Val (92)
Right_Square_Bracket : constant Wide_Character := ']'; -- WC'Val (93)
Circumflex : constant Wide_Character := '^'; -- WC'Val (94)
Low_Line : constant Wide_Character := '_'; -- WC'Val (95)
Grave : constant Wide_Character := '`'; -- WC'Val (96)
LC_A : constant Wide_Character := 'a'; -- WC'Val (97)
LC_B : constant Wide_Character := 'b'; -- WC'Val (98)
LC_C : constant Wide_Character := 'c'; -- WC'Val (99)
LC_D : constant Wide_Character := 'd'; -- WC'Val (100)
LC_E : constant Wide_Character := 'e'; -- WC'Val (101)
LC_F : constant Wide_Character := 'f'; -- WC'Val (102)
LC_G : constant Wide_Character := 'g'; -- WC'Val (103)
LC_H : constant Wide_Character := 'h'; -- WC'Val (104)
LC_I : constant Wide_Character := 'i'; -- WC'Val (105)
LC_J : constant Wide_Character := 'j'; -- WC'Val (106)
LC_K : constant Wide_Character := 'k'; -- WC'Val (107)
LC_L : constant Wide_Character := 'l'; -- WC'Val (108)
LC_M : constant Wide_Character := 'm'; -- WC'Val (109)
LC_N : constant Wide_Character := 'n'; -- WC'Val (110)
LC_O : constant Wide_Character := 'o'; -- WC'Val (111)
LC_P : constant Wide_Character := 'p'; -- WC'Val (112)
LC_Q : constant Wide_Character := 'q'; -- WC'Val (113)
LC_R : constant Wide_Character := 'r'; -- WC'Val (114)
LC_S : constant Wide_Character := 's'; -- WC'Val (115)
LC_T : constant Wide_Character := 't'; -- WC'Val (116)
LC_U : constant Wide_Character := 'u'; -- WC'Val (117)
LC_V : constant Wide_Character := 'v'; -- WC'Val (118)
LC_W : constant Wide_Character := 'w'; -- WC'Val (119)
LC_X : constant Wide_Character := 'x'; -- WC'Val (120)
LC_Y : constant Wide_Character := 'y'; -- WC'Val (121)
LC_Z : constant Wide_Character := 'z'; -- WC'Val (122)
Left_Curly_Bracket : constant Wide_Character := '{'; -- WC'Val (123)
Vertical_Line : constant Wide_Character := '|'; -- WC'Val (124)
Right_Curly_Bracket : constant Wide_Character := '}'; -- WC'Val (125)
Tilde : constant Wide_Character := '~'; -- WC'Val (126)
DEL : constant Wide_Character := Wide_Character'Val (127);
--------------------------------------
-- ISO 6429 Control Wide_Characters --
--------------------------------------
IS4 : Wide_Character renames FS;
IS3 : Wide_Character renames GS;
IS2 : Wide_Character renames RS;
IS1 : Wide_Character renames US;
Reserved_128 : constant Wide_Character := Wide_Character'Val (128);
Reserved_129 : constant Wide_Character := Wide_Character'Val (129);
BPH : constant Wide_Character := Wide_Character'Val (130);
NBH : constant Wide_Character := Wide_Character'Val (131);
Reserved_132 : constant Wide_Character := Wide_Character'Val (132);
NEL : constant Wide_Character := Wide_Character'Val (133);
SSA : constant Wide_Character := Wide_Character'Val (134);
ESA : constant Wide_Character := Wide_Character'Val (135);
HTS : constant Wide_Character := Wide_Character'Val (136);
HTJ : constant Wide_Character := Wide_Character'Val (137);
VTS : constant Wide_Character := Wide_Character'Val (138);
PLD : constant Wide_Character := Wide_Character'Val (139);
PLU : constant Wide_Character := Wide_Character'Val (140);
RI : constant Wide_Character := Wide_Character'Val (141);
SS2 : constant Wide_Character := Wide_Character'Val (142);
SS3 : constant Wide_Character := Wide_Character'Val (143);
DCS : constant Wide_Character := Wide_Character'Val (144);
PU1 : constant Wide_Character := Wide_Character'Val (145);
PU2 : constant Wide_Character := Wide_Character'Val (146);
STS : constant Wide_Character := Wide_Character'Val (147);
CCH : constant Wide_Character := Wide_Character'Val (148);
MW : constant Wide_Character := Wide_Character'Val (149);
SPA : constant Wide_Character := Wide_Character'Val (150);
EPA : constant Wide_Character := Wide_Character'Val (151);
SOS : constant Wide_Character := Wide_Character'Val (152);
Reserved_153 : constant Wide_Character := Wide_Character'Val (153);
SCI : constant Wide_Character := Wide_Character'Val (154);
CSI : constant Wide_Character := Wide_Character'Val (155);
ST : constant Wide_Character := Wide_Character'Val (156);
OSC : constant Wide_Character := Wide_Character'Val (157);
PM : constant Wide_Character := Wide_Character'Val (158);
APC : constant Wide_Character := Wide_Character'Val (159);
-----------------------------------
-- Other Graphic Wide_Characters --
-----------------------------------
-- Wide_Character positions 160 (16#A0#) .. 175 (16#AF#)
No_Break_Space : constant Wide_Character := Wide_Character'Val (160);
NBSP : Wide_Character renames No_Break_Space;
Inverted_Exclamation : constant Wide_Character := Wide_Character'Val (161);
Cent_Sign : constant Wide_Character := Wide_Character'Val (162);
Pound_Sign : constant Wide_Character := Wide_Character'Val (163);
Euro_Sign : constant Wide_Character := Wide_Character'Val (164);
Yen_Sign : constant Wide_Character := Wide_Character'Val (165);
UC_S_Caron : constant Wide_Character := Wide_Character'Val (166);
Section_Sign : constant Wide_Character := Wide_Character'Val (167);
LC_S_Caron : constant Wide_Character := Wide_Character'Val (168);
Copyright_Sign : constant Wide_Character := Wide_Character'Val (169);
Feminine_Ordinal_Indicator
: constant Wide_Character := Wide_Character'Val (170);
Left_Angle_Quotation : constant Wide_Character := Wide_Character'Val (171);
Not_Sign : constant Wide_Character := Wide_Character'Val (172);
Soft_Hyphen : constant Wide_Character := Wide_Character'Val (173);
Registered_Trade_Mark_Sign
: constant Wide_Character := Wide_Character'Val (174);
Macron : constant Wide_Character := Wide_Character'Val (175);
-- Wide_Character positions 176 (16#B0#) .. 191 (16#BF#)
Degree_Sign : constant Wide_Character := Wide_Character'Val (176);
Ring_Above : Wide_Character renames Degree_Sign;
Plus_Minus_Sign : constant Wide_Character := Wide_Character'Val (177);
Superscript_Two : constant Wide_Character := Wide_Character'Val (178);
Superscript_Three : constant Wide_Character := Wide_Character'Val (179);
UC_Z_Caron : constant Wide_Character := Wide_Character'Val (180);
Micro_Sign : constant Wide_Character := Wide_Character'Val (181);
Pilcrow_Sign : constant Wide_Character := Wide_Character'Val (182);
Paragraph_Sign : Wide_Character renames Pilcrow_Sign;
Middle_Dot : constant Wide_Character := Wide_Character'Val (183);
LC_Z_Caron : constant Wide_Character := Wide_Character'Val (184);
Superscript_One : constant Wide_Character := Wide_Character'Val (185);
Masculine_Ordinal_Indicator
: constant Wide_Character := Wide_Character'Val (186);
Right_Angle_Quotation
: constant Wide_Character := Wide_Character'Val (187);
UC_Ligature_OE : constant Wide_Character := Wide_Character'Val (188);
LC_Ligature_OE : constant Wide_Character := Wide_Character'Val (189);
UC_Y_Diaeresis : constant Wide_Character := Wide_Character'Val (190);
Inverted_Question : constant Wide_Character := Wide_Character'Val (191);
-- Wide_Character positions 192 (16#C0#) .. 207 (16#CF#)
UC_A_Grave : constant Wide_Character := Wide_Character'Val (192);
UC_A_Acute : constant Wide_Character := Wide_Character'Val (193);
UC_A_Circumflex : constant Wide_Character := Wide_Character'Val (194);
UC_A_Tilde : constant Wide_Character := Wide_Character'Val (195);
UC_A_Diaeresis : constant Wide_Character := Wide_Character'Val (196);
UC_A_Ring : constant Wide_Character := Wide_Character'Val (197);
UC_AE_Diphthong : constant Wide_Character := Wide_Character'Val (198);
UC_C_Cedilla : constant Wide_Character := Wide_Character'Val (199);
UC_E_Grave : constant Wide_Character := Wide_Character'Val (200);
UC_E_Acute : constant Wide_Character := Wide_Character'Val (201);
UC_E_Circumflex : constant Wide_Character := Wide_Character'Val (202);
UC_E_Diaeresis : constant Wide_Character := Wide_Character'Val (203);
UC_I_Grave : constant Wide_Character := Wide_Character'Val (204);
UC_I_Acute : constant Wide_Character := Wide_Character'Val (205);
UC_I_Circumflex : constant Wide_Character := Wide_Character'Val (206);
UC_I_Diaeresis : constant Wide_Character := Wide_Character'Val (207);
-- Wide_Character positions 208 (16#D0#) .. 223 (16#DF#)
UC_Icelandic_Eth : constant Wide_Character := Wide_Character'Val (208);
UC_N_Tilde : constant Wide_Character := Wide_Character'Val (209);
UC_O_Grave : constant Wide_Character := Wide_Character'Val (210);
UC_O_Acute : constant Wide_Character := Wide_Character'Val (211);
UC_O_Circumflex : constant Wide_Character := Wide_Character'Val (212);
UC_O_Tilde : constant Wide_Character := Wide_Character'Val (213);
UC_O_Diaeresis : constant Wide_Character := Wide_Character'Val (214);
Multiplication_Sign : constant Wide_Character := Wide_Character'Val (215);
UC_O_Oblique_Stroke : constant Wide_Character := Wide_Character'Val (216);
UC_U_Grave : constant Wide_Character := Wide_Character'Val (217);
UC_U_Acute : constant Wide_Character := Wide_Character'Val (218);
UC_U_Circumflex : constant Wide_Character := Wide_Character'Val (219);
UC_U_Diaeresis : constant Wide_Character := Wide_Character'Val (220);
UC_Y_Acute : constant Wide_Character := Wide_Character'Val (221);
UC_Icelandic_Thorn : constant Wide_Character := Wide_Character'Val (222);
LC_German_Sharp_S : constant Wide_Character := Wide_Character'Val (223);
-- Wide_Character positions 224 (16#E0#) .. 239 (16#EF#)
LC_A_Grave : constant Wide_Character := Wide_Character'Val (224);
LC_A_Acute : constant Wide_Character := Wide_Character'Val (225);
LC_A_Circumflex : constant Wide_Character := Wide_Character'Val (226);
LC_A_Tilde : constant Wide_Character := Wide_Character'Val (227);
LC_A_Diaeresis : constant Wide_Character := Wide_Character'Val (228);
LC_A_Ring : constant Wide_Character := Wide_Character'Val (229);
LC_AE_Diphthong : constant Wide_Character := Wide_Character'Val (230);
LC_C_Cedilla : constant Wide_Character := Wide_Character'Val (231);
LC_E_Grave : constant Wide_Character := Wide_Character'Val (232);
LC_E_Acute : constant Wide_Character := Wide_Character'Val (233);
LC_E_Circumflex : constant Wide_Character := Wide_Character'Val (234);
LC_E_Diaeresis : constant Wide_Character := Wide_Character'Val (235);
LC_I_Grave : constant Wide_Character := Wide_Character'Val (236);
LC_I_Acute : constant Wide_Character := Wide_Character'Val (237);
LC_I_Circumflex : constant Wide_Character := Wide_Character'Val (238);
LC_I_Diaeresis : constant Wide_Character := Wide_Character'Val (239);
-- Wide_Character positions 240 (16#F0#) .. 255 (16#FF)
LC_Icelandic_Eth : constant Wide_Character := Wide_Character'Val (240);
LC_N_Tilde : constant Wide_Character := Wide_Character'Val (241);
LC_O_Grave : constant Wide_Character := Wide_Character'Val (242);
LC_O_Acute : constant Wide_Character := Wide_Character'Val (243);
LC_O_Circumflex : constant Wide_Character := Wide_Character'Val (244);
LC_O_Tilde : constant Wide_Character := Wide_Character'Val (245);
LC_O_Diaeresis : constant Wide_Character := Wide_Character'Val (246);
Division_Sign : constant Wide_Character := Wide_Character'Val (247);
LC_O_Oblique_Stroke : constant Wide_Character := Wide_Character'Val (248);
LC_U_Grave : constant Wide_Character := Wide_Character'Val (249);
LC_U_Acute : constant Wide_Character := Wide_Character'Val (250);
LC_U_Circumflex : constant Wide_Character := Wide_Character'Val (251);
LC_U_Diaeresis : constant Wide_Character := Wide_Character'Val (252);
LC_Y_Acute : constant Wide_Character := Wide_Character'Val (253);
LC_Icelandic_Thorn : constant Wide_Character := Wide_Character'Val (254);
LC_Y_Diaeresis : constant Wide_Character := Wide_Character'Val (255);
------------------------------------------------
-- Summary of Changes from Latin-1 => Latin-9 --
------------------------------------------------
-- 164 Currency => Euro_Sign
-- 166 Broken_Bar => UC_S_Caron
-- 168 Diaeresis => LC_S_Caron
-- 180 Acute => UC_Z_Caron
-- 184 Cedilla => LC_Z_Caron
-- 188 Fraction_One_Quarter => UC_Ligature_OE
-- 189 Fraction_One_Half => LC_Ligature_OE
-- 190 Fraction_Three_Quarters => UC_Y_Diaeresis
end Ada.Characters.Wide_Latin_9;
| 65.316418 | 78 | 0.572277 |
39961bfec151c9118cdf2b06d545fa15d38fefe1 | 3,159 | ads | Ada | source/oasis/program-elements-task_type_declarations.ads | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/oasis/program-elements-task_type_declarations.ads | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/oasis/program-elements-task_type_declarations.ads | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | 1 | 2019-10-16T09:05:27.000Z | 2019-10-16T09:05:27.000Z | -- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Declarations;
with Program.Lexical_Elements;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Known_Discriminant_Parts;
with Program.Elements.Aspect_Specifications;
with Program.Elements.Expressions;
with Program.Elements.Task_Definitions;
package Program.Elements.Task_Type_Declarations is
pragma Pure (Program.Elements.Task_Type_Declarations);
type Task_Type_Declaration is
limited interface and Program.Elements.Declarations.Declaration;
type Task_Type_Declaration_Access is access all Task_Type_Declaration'Class
with Storage_Size => 0;
not overriding function Name
(Self : Task_Type_Declaration)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access is abstract;
not overriding function Discriminant_Part
(Self : Task_Type_Declaration)
return Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access is abstract;
not overriding function Aspects
(Self : Task_Type_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is abstract;
not overriding function Progenitors
(Self : Task_Type_Declaration)
return Program.Elements.Expressions.Expression_Vector_Access is abstract;
not overriding function Definition
(Self : Task_Type_Declaration)
return not null Program.Elements.Task_Definitions.Task_Definition_Access
is abstract;
type Task_Type_Declaration_Text is limited interface;
type Task_Type_Declaration_Text_Access is
access all Task_Type_Declaration_Text'Class with Storage_Size => 0;
not overriding function To_Task_Type_Declaration_Text
(Self : in out Task_Type_Declaration)
return Task_Type_Declaration_Text_Access is abstract;
not overriding function Task_Token
(Self : Task_Type_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Type_Token
(Self : Task_Type_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function With_Token
(Self : Task_Type_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Is_Token
(Self : Task_Type_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function New_Token
(Self : Task_Type_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function With_Token_2
(Self : Task_Type_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Semicolon_Token
(Self : Task_Type_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Task_Type_Declarations;
| 35.1 | 79 | 0.777778 |
0e5a0dc83fac577e4df0483e6dabda773912a858 | 12,732 | ads | Ada | source/amf/ocl/amf-internals-ocl_if_exps.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/ocl/amf-internals-ocl_if_exps.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/ocl/amf-internals-ocl_if_exps.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Internals.OCL_Elements;
with AMF.OCL.If_Exps;
with AMF.OCL.Ocl_Expressions;
with AMF.UML.Comments.Collections;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Elements.Collections;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces.Collections;
with AMF.UML.Packages.Collections;
with AMF.UML.String_Expressions;
with AMF.UML.Types;
with AMF.Visitors;
package AMF.Internals.OCL_If_Exps is
type OCL_If_Exp_Proxy is
limited new AMF.Internals.OCL_Elements.OCL_Element_Proxy
and AMF.OCL.If_Exps.OCL_If_Exp with null record;
overriding function Get_Condition
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access;
-- Getter of IfExp::condition.
--
overriding procedure Set_Condition
(Self : not null access OCL_If_Exp_Proxy;
To : AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access);
-- Setter of IfExp::condition.
--
overriding function Get_Then_Expression
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access;
-- Getter of IfExp::thenExpression.
--
overriding procedure Set_Then_Expression
(Self : not null access OCL_If_Exp_Proxy;
To : AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access);
-- Setter of IfExp::thenExpression.
--
overriding function Get_Else_Expression
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access;
-- Getter of IfExp::elseExpression.
--
overriding procedure Set_Else_Expression
(Self : not null access OCL_If_Exp_Proxy;
To : AMF.OCL.Ocl_Expressions.OCL_Ocl_Expression_Access);
-- Setter of IfExp::elseExpression.
--
overriding function Get_Type
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Types.UML_Type_Access;
-- Getter of TypedElement::type.
--
-- The type of the TypedElement.
-- This information is derived from the return result for this Operation.
overriding procedure Set_Type
(Self : not null access OCL_If_Exp_Proxy;
To : AMF.UML.Types.UML_Type_Access);
-- Setter of TypedElement::type.
--
-- The type of the TypedElement.
-- This information is derived from the return result for this Operation.
overriding function Get_Client_Dependency
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::name.
--
-- The name of the NamedElement.
overriding procedure Set_Name
(Self : not null access OCL_If_Exp_Proxy;
To : AMF.Optional_String);
-- Setter of NamedElement::name.
--
-- The name of the NamedElement.
overriding function Get_Name_Expression
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access OCL_If_Exp_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
overriding function Get_Visibility
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Optional_UML_Visibility_Kind;
-- Getter of NamedElement::visibility.
--
-- Determines where the NamedElement appears within different Namespaces
-- within the overall model, and its accessibility.
overriding procedure Set_Visibility
(Self : not null access OCL_If_Exp_Proxy;
To : AMF.UML.Optional_UML_Visibility_Kind);
-- Setter of NamedElement::visibility.
--
-- Determines where the NamedElement appears within different Namespaces
-- within the overall model, and its accessibility.
overriding function Get_Owned_Comment
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Comments.Collections.Set_Of_UML_Comment;
-- Getter of Element::ownedComment.
--
-- The Comments owned by this element.
overriding function Get_Owned_Element
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Elements.Collections.Set_Of_UML_Element;
-- Getter of Element::ownedElement.
--
-- The Elements owned by this element.
overriding function Get_Owner
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Elements.UML_Element_Access;
-- Getter of Element::owner.
--
-- The Element that owns this element.
overriding function All_Namespaces
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Namespaces.Collections.Ordered_Set_Of_UML_Namespace;
-- Operation NamedElement::allNamespaces.
--
-- The query allNamespaces() gives the sequence of namespaces in which the
-- NamedElement is nested, working outwards.
overriding function All_Owning_Packages
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant OCL_If_Exp_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding function Qualified_Name
(Self : not null access constant OCL_If_Exp_Proxy)
return League.Strings.Universal_String;
-- 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.
overriding function Separator
(Self : not null access constant OCL_If_Exp_Proxy)
return League.Strings.Universal_String;
-- Operation NamedElement::separator.
--
-- The query separator() gives the string that is used to separate names
-- when constructing a qualified name.
overriding function All_Owned_Elements
(Self : not null access constant OCL_If_Exp_Proxy)
return AMF.UML.Elements.Collections.Set_Of_UML_Element;
-- Operation Element::allOwnedElements.
--
-- The query allOwnedElements() gives all of the direct and indirect owned
-- elements of an element.
overriding function Must_Be_Owned
(Self : not null access constant OCL_If_Exp_Proxy)
return Boolean;
-- Operation Element::mustBeOwned.
--
-- The query mustBeOwned() indicates whether elements of this type must
-- have an owner. Subclasses of Element that do not require an owner must
-- override this operation.
overriding procedure Enter_Element
(Self : not null access constant OCL_If_Exp_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Leave_Element
(Self : not null access constant OCL_If_Exp_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Visit_Element
(Self : not null access constant OCL_If_Exp_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
end AMF.Internals.OCL_If_Exps;
| 43.60274 | 79 | 0.638391 |
0ebf3d1bb9620e43ead5c47bdc839a87b9948535 | 4,501 | adb | Ada | gcc-gcc-7_3_0-release/gcc/ada/s-tataat.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/s-tataat.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/s-tataat.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G . T A S K _ A T T R I B U T E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2014-2015, 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/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
with System.Parameters; use System.Parameters;
with System.Tasking.Initialization; use System.Tasking.Initialization;
with System.Task_Primitives.Operations;
package body System.Tasking.Task_Attributes is
package STPO renames System.Task_Primitives.Operations;
type Index_Info is record
Used : Boolean;
-- Used is True if a given index is used by an instantiation of
-- Ada.Task_Attributes, False otherwise.
Require_Finalization : Boolean;
-- Require_Finalization is True if the attribute requires finalization
end record;
Index_Array : array (1 .. Max_Attribute_Count) of Index_Info :=
(others => (False, False));
-- Note that this package will use an efficient implementation with no
-- locks and no extra dynamic memory allocation if Attribute can fit in a
-- System.Address type and Initial_Value is 0 (or null for an access type).
function Next_Index (Require_Finalization : Boolean) return Integer is
Self_Id : constant Task_Id := STPO.Self;
begin
Task_Lock (Self_Id);
for J in Index_Array'Range loop
if not Index_Array (J).Used then
Index_Array (J).Used := True;
Index_Array (J).Require_Finalization := Require_Finalization;
Task_Unlock (Self_Id);
return J;
end if;
end loop;
Task_Unlock (Self_Id);
raise Storage_Error with "Out of task attributes";
end Next_Index;
--------------
-- Finalize --
--------------
procedure Finalize (Index : Integer) is
Self_Id : constant Task_Id := STPO.Self;
begin
pragma Assert (Index in Index_Array'Range);
Task_Lock (Self_Id);
Index_Array (Index).Used := False;
Task_Unlock (Self_Id);
end Finalize;
--------------------------
-- Require_Finalization --
--------------------------
function Require_Finalization (Index : Integer) return Boolean is
begin
pragma Assert (Index in Index_Array'Range);
return Index_Array (Index).Require_Finalization;
end Require_Finalization;
end System.Tasking.Task_Attributes;
| 45.464646 | 79 | 0.508998 |
39d583be7cbfeb682a680c9b04b009077c6a5c2f | 7,149 | ads | Ada | src/util/gnatcoll-json-conversions.ads | Jellix/open_weather_map_api | fa3484b361411b9362500a25e36d63d4bb6dbca3 | [
"WTFPL"
] | 1 | 2020-09-04T18:31:05.000Z | 2020-09-04T18:31:05.000Z | src/util/gnatcoll-json-conversions.ads | Jellix/open_weather_map_api | fa3484b361411b9362500a25e36d63d4bb6dbca3 | [
"WTFPL"
] | 2 | 2020-03-22T16:28:32.000Z | 2020-03-22T16:31:51.000Z | src/util/gnatcoll-json-conversions.ads | HeisenbugLtd/open_weather_map_api | fa3484b361411b9362500a25e36d63d4bb6dbca3 | [
"WTFPL"
] | null | null | null | --------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. ([email protected])
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
limited with Ada.Calendar.Time_Zones;
with Types;
package GNATCOLL.JSON.Conversions is
-----------------------------------------------------------------------------
-- To_Humidity
-----------------------------------------------------------------------------
function To_Humidity (Value : in JSON_Value;
Field : in UTF8_String) return Types.Humidity with
Inline => True,
Global => null,
Pre => (Value.Kind = JSON_Object_Type and then
Value.Get (Field).Kind in JSON_Int_Type | JSON_Float_Type);
--% Converts a numeric (either float or integer) JSON field value into a
--% Humidity.
--
--% @param Value
--% The JSON value containing the humidity data.
--
--% @param Field
--% The name of the field containing the humidity value.
--
--% @return
--% The humidity value extracted from the given JSON value.
-----------------------------------------------------------------------------
-- To_Latitude
-----------------------------------------------------------------------------
function To_Latitude (Value : in JSON_Value;
Field : in UTF8_String) return Types.Latitude with
Inline => True,
Global => null,
Pre => (Value.Kind = JSON_Object_Type and then
Value.Get (Field).Kind in JSON_Int_Type | JSON_Float_Type);
--% Converts a numeric (either float or integer) JSON field value into a
--% Latitude.
--
--% @param Value
--% The JSON value containing the latitude data.
--
--% @param Field
--% The name of the field containing the latitude value.
--
--% @return
--% The latitude value extracted from the given JSON value.
-----------------------------------------------------------------------------
-- To_Longitude
-----------------------------------------------------------------------------
function To_Longitude (Value : in JSON_Value;
Field : in UTF8_String) return Types.Longitude with
Inline => True,
Global => null,
Pre => (Value.Kind = JSON_Object_Type and then
Value.Get (Field).Kind in JSON_Int_Type | JSON_Float_Type);
--% Converts a numeric (either float or integer) JSON field value into a
--% Longitude.
--
--% @param Value
--% The JSON value containing the longitude data.
--
--% @param Field
--% The name of the field containing the longitude value.
--
--% @return
--% The longitude value extracted from the given JSON value.
-----------------------------------------------------------------------------
-- To_Pressure
-----------------------------------------------------------------------------
function To_Pressure (Value : in JSON_Value;
Field : in UTF8_String) return Types.Pressure with
Inline => True,
Global => null,
Pre => (Value.Kind = JSON_Object_Type and then
Value.Get (Field).Kind in JSON_Int_Type | JSON_Float_Type);
--% Converts a numeric (either float or integer) JSON field value into a
--% Pressure.
--
--% @param Value
--% The JSON value containing the pressure data.
--
--% @param Field
--% The name of the field containing the pressure value.
--
--% @return
--% The pressure value extracted from the given JSON value.
-----------------------------------------------------------------------------
-- To_Scalar
-----------------------------------------------------------------------------
function To_Scalar (Value : in JSON_Value;
Field : in UTF8_String) return Types.Scalar with
Global => null,
Pre => (Value.Kind = JSON_Object_Type and then
Value.Get (Field).Kind in JSON_Int_Type | JSON_Float_Type);
--% Converts a numeric (either float or integer) JSON field value into a
--% Scalar.
--
--% @param Value
--% The JSON value containing the numeric data.
--
--% @param Field
--% The name of the field containing the numeric value.
--
--% @return
--% The numeric value extracted from the given JSON value.
-----------------------------------------------------------------------------
-- To_Temperature
-----------------------------------------------------------------------------
function To_Temperature
(Value : in JSON_Value;
Field : in UTF8_String) return Types.Kelvin with
Global => null,
Pre => (Value.Kind = JSON_Object_Type and then
Value.Get (Field).Kind in JSON_Int_Type | JSON_Float_Type);
--% Converts a numeric (either float or integer) JSON field value, expected
--% to be a value given in Kelvin.
--
--% @param Value
--% The JSON value containing the temperature data.
--
--% @param Field
--% The name of the field containing the temperature value.
--
--% @return
--% The temperature value extracted from the given JSON value.
-----------------------------------------------------------------------------
-- To_Time
-----------------------------------------------------------------------------
function To_Time (Value : in JSON_Value;
Field : in UTF8_String) return Ada.Calendar.Time with
Global => null,
Pre => (Value.Kind = JSON_Object_Type and then
Value.Get (Field).Kind = JSON_Int_Type);
--% Converts an integer JSON field which is expected to contain a Unix time
--% (i.e. number of seconds since 1970-01-01) into a proper Ada Time.
--
--% @param Value
--% The JSON value containing the time data.
--
--% @param Field
--% The name of the field containing the time value.
--
--% @return
--% The time extracted from the given JSON value.
-----------------------------------------------------------------------------
-- To_Time_Offset
-----------------------------------------------------------------------------
function To_Time_Offset
(Value : in JSON_Value;
Field : in UTF8_String) return Ada.Calendar.Time_Zones.Time_Offset with
Global => null,
Pre => (Value.Kind = JSON_Object_Type and then
Value.Get (Field).Kind = JSON_Int_Type);
--% Converts an integer JSON field which is expected to contain a time zone
--% offset in seconds into Time_Offset.
--
--% @param Value
--% The JSON value containing the time zone data.
--
--% @param Field
--% The name of the field containing the time zone value.
--
--% @return
--% The time zone offset extracted from the given JSON value.
end GNATCOLL.JSON.Conversions;
| 39.28022 | 80 | 0.503007 |
3916e9ece94613fd4d7a1ce44cffada954f462f9 | 3,740 | ads | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_scil.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_scil.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_scil.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ S C I L --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains routines involved in the frontend addition and
-- verification of SCIL nodes.
with Atree; use Atree;
with Types; use Types;
package Sem_SCIL is
-- SCIL (Statically Checkable Intermediate Language) is produced by the
-- CodePeer back end (aka gnat2scil). For some constructs (tagged type
-- declarations, dispatching calls, classwide membership tests), the
-- CodePeer back end needs to locate certain nodes in the tree. To allow
-- CodePeer to do this without introducing unwanted dependencies on the
-- details of the FE's expansion strategies, SCIL_Nodes are generated.
-- For example, a dispatching call in the Ada source will, if CodePeer mode
-- is enabled, result in the FE's generation of an N_Scil_Dispatching_Call
-- node decorated with semantic attributes which identify the call itself,
-- the primitive operation being called, the tagged type to which the
-- operation belongs, and the controlling tag value of the call. If the FE
-- implements some new expansion strategy for dispatching calls but this
-- interface is preserved, the CodePeer back end should be unaffected.
function Check_SCIL_Node (N : Node_Id) return Traverse_Result;
-- Process a single node during the tree traversal. Done to verify that
-- SCIL nodes decoration fulfill the requirements of the SCIL backend.
procedure Check_SCIL_Nodes is new Traverse_Proc (Check_SCIL_Node);
-- The traversal procedure itself
function First_Non_SCIL_Node (L : List_Id) return Node_Id;
-- Returns the first non-SCIL node of list L
function Next_Non_SCIL_Node (N : Node_Id) return Node_Id;
-- N must be a member of a list. Returns the next non SCIL node in the list
-- containing N, or Empty if this is the last non SCIL node in the list.
end Sem_SCIL;
| 58.4375 | 79 | 0.552941 |
1c77c66dd7edda2e3e46a0c4716d507a097b64c5 | 8,669 | ads | Ada | source/amf/uml/amf-internals-uml_operation_template_parameters.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/uml/amf-internals-uml_operation_template_parameters.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/uml/amf-internals-uml_operation_template_parameters.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Elements;
with AMF.UML.Operation_Template_Parameters;
with AMF.UML.Operations;
with AMF.UML.Parameterable_Elements;
with AMF.UML.Template_Signatures;
with AMF.Visitors;
package AMF.Internals.UML_Operation_Template_Parameters is
type UML_Operation_Template_Parameter_Proxy is
limited new AMF.Internals.UML_Elements.UML_Element_Proxy
and AMF.UML.Operation_Template_Parameters.UML_Operation_Template_Parameter with null record;
overriding function Get_Parametered_Element
(Self : not null access constant UML_Operation_Template_Parameter_Proxy)
return AMF.UML.Operations.UML_Operation_Access;
-- Getter of OperationTemplateParameter::parameteredElement.
--
-- The operation for this template parameter.
overriding procedure Set_Parametered_Element
(Self : not null access UML_Operation_Template_Parameter_Proxy;
To : AMF.UML.Operations.UML_Operation_Access);
-- Setter of OperationTemplateParameter::parameteredElement.
--
-- The operation for this template parameter.
overriding function Get_Default
(Self : not null access constant UML_Operation_Template_Parameter_Proxy)
return AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access;
-- Getter of TemplateParameter::default.
--
-- The element that is the default for this formal template parameter.
overriding procedure Set_Default
(Self : not null access UML_Operation_Template_Parameter_Proxy;
To : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access);
-- Setter of TemplateParameter::default.
--
-- The element that is the default for this formal template parameter.
overriding function Get_Owned_Default
(Self : not null access constant UML_Operation_Template_Parameter_Proxy)
return AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access;
-- Getter of TemplateParameter::ownedDefault.
--
-- The element that is owned by this template parameter for the purpose of
-- providing a default.
overriding procedure Set_Owned_Default
(Self : not null access UML_Operation_Template_Parameter_Proxy;
To : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access);
-- Setter of TemplateParameter::ownedDefault.
--
-- The element that is owned by this template parameter for the purpose of
-- providing a default.
overriding function Get_Owned_Parametered_Element
(Self : not null access constant UML_Operation_Template_Parameter_Proxy)
return AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access;
-- Getter of TemplateParameter::ownedParameteredElement.
--
-- The element that is owned by this template parameter.
overriding procedure Set_Owned_Parametered_Element
(Self : not null access UML_Operation_Template_Parameter_Proxy;
To : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access);
-- Setter of TemplateParameter::ownedParameteredElement.
--
-- The element that is owned by this template parameter.
overriding function Get_Parametered_Element
(Self : not null access constant UML_Operation_Template_Parameter_Proxy)
return AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access;
-- Getter of TemplateParameter::parameteredElement.
--
-- The element exposed by this template parameter.
overriding procedure Set_Parametered_Element
(Self : not null access UML_Operation_Template_Parameter_Proxy;
To : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access);
-- Setter of TemplateParameter::parameteredElement.
--
-- The element exposed by this template parameter.
overriding function Get_Signature
(Self : not null access constant UML_Operation_Template_Parameter_Proxy)
return AMF.UML.Template_Signatures.UML_Template_Signature_Access;
-- Getter of TemplateParameter::signature.
--
-- The template signature that owns this template parameter.
overriding procedure Set_Signature
(Self : not null access UML_Operation_Template_Parameter_Proxy;
To : AMF.UML.Template_Signatures.UML_Template_Signature_Access);
-- Setter of TemplateParameter::signature.
--
-- The template signature that owns this template parameter.
overriding procedure Enter_Element
(Self : not null access constant UML_Operation_Template_Parameter_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Leave_Element
(Self : not null access constant UML_Operation_Template_Parameter_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Visit_Element
(Self : not null access constant UML_Operation_Template_Parameter_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of iterator interface.
end AMF.Internals.UML_Operation_Template_Parameters;
| 53.184049 | 99 | 0.629023 |
1c8d80ada38731739702a8b2fb7ea46872d8510f | 6,284 | ads | Ada | src/sdl-events-touches.ads | Fabien-Chouteau/sdlada | f08d72e3f5dcec228d68fb5b6681ea831f81ef47 | [
"Zlib"
] | 1 | 2021-10-30T14:41:56.000Z | 2021-10-30T14:41:56.000Z | src/sdl-events-touches.ads | Fabien-Chouteau/sdlada | f08d72e3f5dcec228d68fb5b6681ea831f81ef47 | [
"Zlib"
] | null | null | null | src/sdl-events-touches.ads | Fabien-Chouteau/sdlada | f08d72e3f5dcec228d68fb5b6681ea831f81ef47 | [
"Zlib"
] | null | null | null | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.Events.Touches
--
-- WARNING!! A lot of the data bindings in this specification is guess-work, especially the ranges for things. There
-- also an inconsistency in the usage of Fingers_Touching within SDL itself.
--
-- See:
-- https://bugzilla.libsdl.org/show_bug.cgi?id=3060
-- http://lists.libsdl.org/pipermail/sdl-libsdl.org/2015-July/098468.html
--------------------------------------------------------------------------------------------------------------------
with Interfaces.C;
package SDL.Events.Touches is
-- Touch events.
Finger_Down : constant Event_Types := 16#0000_0700#;
Finger_Up : constant Event_Types := Finger_Down + 1;
Finger_Motion : constant Event_Types := Finger_Down + 2;
-- Gesture events.
Dollar_Gesture : constant Event_Types := 16#0000_0800#;
Dollar_Record : constant Event_Types := Dollar_Gesture + 1;
Dollar_Multi_Gesture : constant Event_Types := Dollar_Gesture + 2;
-- TODO: Find out if these really should be signed or not, the C version uses Sint64 for both.
type Touch_IDs is range -1 .. 2 ** 63 - 1 with
Convention => C,
Size => 64;
type Finger_IDs is range 0 .. 2 ** 63 - 1 with
Convention => C,
Size => 64;
type Gesture_IDs is range 0 .. 2 ** 63 - 1 with
Convention => C,
Size => 64;
type Touch_Locations is digits 3 range 0.0 .. 1.0 with
Convention => C,
Size => 32;
type Touch_Distances is digits 3 range -1.0 .. 1.0 with
Convention => C,
Size => 32;
type Touch_Pressures is digits 3 range 0.0 .. 1.0 with
Convention => C,
Size => 32;
type Finger_Events is
record
Event_Type : Event_Types; -- Will be set to Finger_Down, Finger_Up or Finger_Motion.
Time_Stamp : Time_Stamps;
Touch_ID : Touch_IDs;
Finger_ID : Finger_IDs;
X : Touch_Locations;
Y : Touch_Locations;
Delta_X : Touch_Distances;
Delta_Y : Touch_Distances;
Pressure : Touch_Pressures;
end record with
Convention => C;
type Finger_Rotations is digits 3 range -360.0 .. 360.0 with
Convention => C,
Size => 32;
subtype Finger_Pinches is Interfaces.C.C_float;
type Fingers_Touching is range 0 .. 2 ** 16 - 1 with
Convention => C,
Size => 16;
type Multi_Gesture_Events is
record
Event_Type : Event_Types; -- Will be set to Dollar_Multi_Gesture.
Time_Stamp : Time_Stamps;
Touch_ID : Touch_IDs;
Theta : Finger_Rotations;
Distance : Finger_Pinches;
Centre_X : Touch_Locations;
Centre_Y : Touch_Locations;
Fingers : Fingers_Touching;
Padding : Padding_16;
end record with
Convention => C;
subtype Dollar_Errors is Interfaces.C.C_float;
type Dollar_Events is
record
Event_Type : Event_Types; -- Will be set to Dollar_Gesture or Dollar_Record.
Time_Stamp : Time_Stamps;
Touch_ID : Touch_IDs;
Gesture_ID : Gesture_IDs;
Fingers : Fingers_Touching;
Error : Dollar_Errors;
Centre_X : Touch_Locations;
Centre_Y : Touch_Locations;
end record with
Convention => C;
private
for Finger_Events use
record
Event_Type at 0 * SDL.Word range 0 .. 31;
Time_Stamp at 1 * SDL.Word range 0 .. 31;
Touch_ID at 2 * SDL.Word range 0 .. 63;
Finger_ID at 4 * SDL.Word range 0 .. 63;
X at 6 * SDL.Word range 0 .. 31;
Y at 7 * SDL.Word range 0 .. 31;
Delta_X at 8 * SDL.Word range 0 .. 31;
Delta_Y at 9 * SDL.Word range 0 .. 31;
Pressure at 10 * SDL.Word range 0 .. 31;
end record;
for Multi_Gesture_Events use
record
Event_Type at 0 * SDL.Word range 0 .. 31;
Time_Stamp at 1 * SDL.Word range 0 .. 31;
Touch_ID at 2 * SDL.Word range 0 .. 63;
Theta at 4 * SDL.Word range 0 .. 31;
Distance at 5 * SDL.Word range 0 .. 31;
Centre_X at 6 * SDL.Word range 0 .. 31;
Centre_Y at 7 * SDL.Word range 0 .. 31;
Fingers at 8 * SDL.Word range 0 .. 15;
Padding at 8 * SDL.Word range 16 .. 31;
end record;
for Dollar_Events use
record
Event_Type at 0 * SDL.Word range 0 .. 31;
Time_Stamp at 1 * SDL.Word range 0 .. 31;
Touch_ID at 2 * SDL.Word range 0 .. 63;
Gesture_ID at 4 * SDL.Word range 0 .. 63;
Fingers at 6 * SDL.Word range 0 .. 31; -- Inconsistent, type is 16 bits, but SDL uses 32 here.
Error at 7 * SDL.Word range 0 .. 31;
Centre_X at 8 * SDL.Word range 0 .. 31;
Centre_Y at 9 * SDL.Word range 0 .. 31;
end record;
end SDL.Events.Touches;
| 37.628743 | 117 | 0.558721 |
203c8d7a82802aaffb7ce4fa3079cd413cd8e2b9 | 14,998 | ads | Ada | src/stm32-dac.ads | damaki/EVB1000 | 1589a3f3bd79d7c9970f3b0758e133e3ec1ee6e2 | [
"MIT"
] | null | null | null | src/stm32-dac.ads | damaki/EVB1000 | 1589a3f3bd79d7c9970f3b0758e133e3ec1ee6e2 | [
"MIT"
] | null | null | null | src/stm32-dac.ads | damaki/EVB1000 | 1589a3f3bd79d7c9970f3b0758e133e3ec1ee6e2 | [
"MIT"
] | 1 | 2021-02-10T14:33:06.000Z | 2021-02-10T14:33:06.000Z | -- This spec has been automatically generated from STM32F105xx.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
with System;
package STM32.DAC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-----------------
-- CR_Register --
-----------------
subtype CR_EN1_Field is STM32.Bit;
subtype CR_BOFF1_Field is STM32.Bit;
subtype CR_TEN1_Field is STM32.Bit;
subtype CR_TSEL1_Field is STM32.UInt3;
subtype CR_WAVE1_Field is STM32.UInt2;
subtype CR_MAMP1_Field is STM32.UInt4;
subtype CR_DMAEN1_Field is STM32.Bit;
subtype CR_EN2_Field is STM32.Bit;
subtype CR_BOFF2_Field is STM32.Bit;
subtype CR_TEN2_Field is STM32.Bit;
subtype CR_TSEL2_Field is STM32.UInt3;
subtype CR_WAVE2_Field is STM32.UInt2;
subtype CR_MAMP2_Field is STM32.UInt4;
subtype CR_DMAEN2_Field is STM32.Bit;
-- Control register (DAC_CR)
type CR_Register is record
-- DAC channel1 enable
EN1 : CR_EN1_Field := 16#0#;
-- DAC channel1 output buffer disable
BOFF1 : CR_BOFF1_Field := 16#0#;
-- DAC channel1 trigger enable
TEN1 : CR_TEN1_Field := 16#0#;
-- DAC channel1 trigger selection
TSEL1 : CR_TSEL1_Field := 16#0#;
-- DAC channel1 noise/triangle wave generation enable
WAVE1 : CR_WAVE1_Field := 16#0#;
-- DAC channel1 mask/amplitude selector
MAMP1 : CR_MAMP1_Field := 16#0#;
-- DAC channel1 DMA enable
DMAEN1 : CR_DMAEN1_Field := 16#0#;
-- unspecified
Reserved_13_15 : STM32.UInt3 := 16#0#;
-- DAC channel2 enable
EN2 : CR_EN2_Field := 16#0#;
-- DAC channel2 output buffer disable
BOFF2 : CR_BOFF2_Field := 16#0#;
-- DAC channel2 trigger enable
TEN2 : CR_TEN2_Field := 16#0#;
-- DAC channel2 trigger selection
TSEL2 : CR_TSEL2_Field := 16#0#;
-- DAC channel2 noise/triangle wave generation enable
WAVE2 : CR_WAVE2_Field := 16#0#;
-- DAC channel2 mask/amplitude selector
MAMP2 : CR_MAMP2_Field := 16#0#;
-- DAC channel2 DMA enable
DMAEN2 : CR_DMAEN2_Field := 16#0#;
-- unspecified
Reserved_29_31 : STM32.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
EN1 at 0 range 0 .. 0;
BOFF1 at 0 range 1 .. 1;
TEN1 at 0 range 2 .. 2;
TSEL1 at 0 range 3 .. 5;
WAVE1 at 0 range 6 .. 7;
MAMP1 at 0 range 8 .. 11;
DMAEN1 at 0 range 12 .. 12;
Reserved_13_15 at 0 range 13 .. 15;
EN2 at 0 range 16 .. 16;
BOFF2 at 0 range 17 .. 17;
TEN2 at 0 range 18 .. 18;
TSEL2 at 0 range 19 .. 21;
WAVE2 at 0 range 22 .. 23;
MAMP2 at 0 range 24 .. 27;
DMAEN2 at 0 range 28 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
----------------------
-- SWTRIGR_Register --
----------------------
--------------------
-- SWTRIGR.SWTRIG --
--------------------
-- SWTRIGR_SWTRIG array element
subtype SWTRIGR_SWTRIG_Element is STM32.Bit;
-- SWTRIGR_SWTRIG array
type SWTRIGR_SWTRIG_Field_Array is array (1 .. 2)
of SWTRIGR_SWTRIG_Element
with Component_Size => 1, Size => 2;
-- Type definition for SWTRIGR_SWTRIG
type SWTRIGR_SWTRIG_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SWTRIG as a value
Val : STM32.UInt2;
when True =>
-- SWTRIG as an array
Arr : SWTRIGR_SWTRIG_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for SWTRIGR_SWTRIG_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- DAC software trigger register (DAC_SWTRIGR)
type SWTRIGR_Register is record
-- DAC channel1 software trigger
SWTRIG : SWTRIGR_SWTRIG_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_2_31 : STM32.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SWTRIGR_Register use record
SWTRIG at 0 range 0 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
----------------------
-- DHR12R1_Register --
----------------------
subtype DHR12R1_DACC1DHR_Field is STM32.UInt12;
-- DAC channel1 12-bit right-aligned data holding register(DAC_DHR12R1)
type DHR12R1_Register is record
-- DAC channel1 12-bit right-aligned data
DACC1DHR : DHR12R1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_12_31 : STM32.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12R1_Register use record
DACC1DHR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
----------------------
-- DHR12L1_Register --
----------------------
subtype DHR12L1_DACC1DHR_Field is STM32.UInt12;
-- DAC channel1 12-bit left aligned data holding register (DAC_DHR12L1)
type DHR12L1_Register is record
-- unspecified
Reserved_0_3 : STM32.UInt4 := 16#0#;
-- DAC channel1 12-bit left-aligned data
DACC1DHR : DHR12L1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12L1_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC1DHR at 0 range 4 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
---------------------
-- DHR8R1_Register --
---------------------
subtype DHR8R1_DACC1DHR_Field is STM32.Byte;
-- DAC channel1 8-bit right aligned data holding register (DAC_DHR8R1)
type DHR8R1_Register is record
-- DAC channel1 8-bit right-aligned data
DACC1DHR : DHR8R1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_8_31 : STM32.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8R1_Register use record
DACC1DHR at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
----------------------
-- DHR12R2_Register --
----------------------
subtype DHR12R2_DACC2DHR_Field is STM32.UInt12;
-- DAC channel2 12-bit right aligned data holding register (DAC_DHR12R2)
type DHR12R2_Register is record
-- DAC channel2 12-bit right-aligned data
DACC2DHR : DHR12R2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_12_31 : STM32.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12R2_Register use record
DACC2DHR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
----------------------
-- DHR12L2_Register --
----------------------
subtype DHR12L2_DACC2DHR_Field is STM32.UInt12;
-- DAC channel2 12-bit left aligned data holding register (DAC_DHR12L2)
type DHR12L2_Register is record
-- unspecified
Reserved_0_3 : STM32.UInt4 := 16#0#;
-- DAC channel2 12-bit left-aligned data
DACC2DHR : DHR12L2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12L2_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC2DHR at 0 range 4 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
---------------------
-- DHR8R2_Register --
---------------------
subtype DHR8R2_DACC2DHR_Field is STM32.Byte;
-- DAC channel2 8-bit right-aligned data holding register (DAC_DHR8R2)
type DHR8R2_Register is record
-- DAC channel2 8-bit right-aligned data
DACC2DHR : DHR8R2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_8_31 : STM32.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8R2_Register use record
DACC2DHR at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
----------------------
-- DHR12RD_Register --
----------------------
subtype DHR12RD_DACC1DHR_Field is STM32.UInt12;
subtype DHR12RD_DACC2DHR_Field is STM32.UInt12;
-- Dual DAC 12-bit right-aligned data holding register (DAC_DHR12RD), Bits
-- 31:28 Reserved, Bits 15:12 Reserved
type DHR12RD_Register is record
-- DAC channel1 12-bit right-aligned data
DACC1DHR : DHR12RD_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_12_15 : STM32.UInt4 := 16#0#;
-- DAC channel2 12-bit right-aligned data
DACC2DHR : DHR12RD_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_28_31 : STM32.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12RD_Register use record
DACC1DHR at 0 range 0 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
DACC2DHR at 0 range 16 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
----------------------
-- DHR12LD_Register --
----------------------
subtype DHR12LD_DACC1DHR_Field is STM32.UInt12;
subtype DHR12LD_DACC2DHR_Field is STM32.UInt12;
-- DUAL DAC 12-bit left aligned data holding register (DAC_DHR12LD), Bits
-- 19:16 Reserved, Bits 3:0 Reserved
type DHR12LD_Register is record
-- unspecified
Reserved_0_3 : STM32.UInt4 := 16#0#;
-- DAC channel1 12-bit left-aligned data
DACC1DHR : DHR12LD_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_16_19 : STM32.UInt4 := 16#0#;
-- DAC channel2 12-bit right-aligned data
DACC2DHR : DHR12LD_DACC2DHR_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12LD_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC1DHR at 0 range 4 .. 15;
Reserved_16_19 at 0 range 16 .. 19;
DACC2DHR at 0 range 20 .. 31;
end record;
---------------------
-- DHR8RD_Register --
---------------------
subtype DHR8RD_DACC1DHR_Field is STM32.Byte;
subtype DHR8RD_DACC2DHR_Field is STM32.Byte;
-- DUAL DAC 8-bit right aligned data holding register (DAC_DHR8RD), Bits
-- 31:16 Reserved
type DHR8RD_Register is record
-- DAC channel1 8-bit right-aligned data
DACC1DHR : DHR8RD_DACC1DHR_Field := 16#0#;
-- DAC channel2 8-bit right-aligned data
DACC2DHR : DHR8RD_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8RD_Register use record
DACC1DHR at 0 range 0 .. 7;
DACC2DHR at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- DOR1_Register --
-------------------
subtype DOR1_DACC1DOR_Field is STM32.UInt12;
-- DAC channel1 data output register (DAC_DOR1)
type DOR1_Register is record
-- Read-only. DAC channel1 data output
DACC1DOR : DOR1_DACC1DOR_Field;
-- unspecified
Reserved_12_31 : STM32.UInt20;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOR1_Register use record
DACC1DOR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-------------------
-- DOR2_Register --
-------------------
subtype DOR2_DACC2DOR_Field is STM32.UInt12;
-- DAC channel2 data output register (DAC_DOR2)
type DOR2_Register is record
-- Read-only. DAC channel2 data output
DACC2DOR : DOR2_DACC2DOR_Field;
-- unspecified
Reserved_12_31 : STM32.UInt20;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOR2_Register use record
DACC2DOR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Digital to analog converter
type DAC_Peripheral is record
-- Control register (DAC_CR)
CR : CR_Register;
-- DAC software trigger register (DAC_SWTRIGR)
SWTRIGR : SWTRIGR_Register;
-- DAC channel1 12-bit right-aligned data holding register(DAC_DHR12R1)
DHR12R1 : DHR12R1_Register;
-- DAC channel1 12-bit left aligned data holding register (DAC_DHR12L1)
DHR12L1 : DHR12L1_Register;
-- DAC channel1 8-bit right aligned data holding register (DAC_DHR8R1)
DHR8R1 : DHR8R1_Register;
-- DAC channel2 12-bit right aligned data holding register (DAC_DHR12R2)
DHR12R2 : DHR12R2_Register;
-- DAC channel2 12-bit left aligned data holding register (DAC_DHR12L2)
DHR12L2 : DHR12L2_Register;
-- DAC channel2 8-bit right-aligned data holding register (DAC_DHR8R2)
DHR8R2 : DHR8R2_Register;
-- Dual DAC 12-bit right-aligned data holding register (DAC_DHR12RD),
-- Bits 31:28 Reserved, Bits 15:12 Reserved
DHR12RD : DHR12RD_Register;
-- DUAL DAC 12-bit left aligned data holding register (DAC_DHR12LD),
-- Bits 19:16 Reserved, Bits 3:0 Reserved
DHR12LD : DHR12LD_Register;
-- DUAL DAC 8-bit right aligned data holding register (DAC_DHR8RD), Bits
-- 31:16 Reserved
DHR8RD : DHR8RD_Register;
-- DAC channel1 data output register (DAC_DOR1)
DOR1 : DOR1_Register;
-- DAC channel2 data output register (DAC_DOR2)
DOR2 : DOR2_Register;
end record
with Volatile;
for DAC_Peripheral use record
CR at 0 range 0 .. 31;
SWTRIGR at 4 range 0 .. 31;
DHR12R1 at 8 range 0 .. 31;
DHR12L1 at 12 range 0 .. 31;
DHR8R1 at 16 range 0 .. 31;
DHR12R2 at 20 range 0 .. 31;
DHR12L2 at 24 range 0 .. 31;
DHR8R2 at 28 range 0 .. 31;
DHR12RD at 32 range 0 .. 31;
DHR12LD at 36 range 0 .. 31;
DHR8RD at 40 range 0 .. 31;
DOR1 at 44 range 0 .. 31;
DOR2 at 48 range 0 .. 31;
end record;
-- Digital to analog converter
DAC_Periph : aliased DAC_Peripheral
with Import, Address => DAC_Base;
end STM32.DAC;
| 32.604348 | 79 | 0.597213 |
23caf78b795f4d19f388c8ee1caf6edf77ffda1b | 5,020 | adb | Ada | source/web/soap/web_services-soap-messages.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/web/soap/web_services-soap-messages.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/web/soap/web_services-soap-messages.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Strings.Hash;
with Ada.Tags;
with Ada.Unchecked_Deallocation;
package body Web_Services.SOAP.Messages is
--------------
-- Finalize --
--------------
procedure Finalize (Self : in out SOAP_Message) is
procedure Free is
new Ada.Unchecked_Deallocation
(Web_Services.SOAP.Headers.Abstract_SOAP_Header'Class,
Web_Services.SOAP.Headers.SOAP_Header_Access);
procedure Free is
new Ada.Unchecked_Deallocation
(Web_Services.SOAP.Payloads.Abstract_SOAP_Payload'Class,
Web_Services.SOAP.Payloads.SOAP_Payload_Access);
Position : Header_Sets.Cursor;
Header : Web_Services.SOAP.Headers.SOAP_Header_Access;
begin
while not Self.Headers.Is_Empty loop
Position := Self.Headers.First;
Header := Header_Sets.Element (Position);
Self.Headers.Delete (Position);
Free (Header);
end loop;
Free (Self.Payload);
end Finalize;
----------
-- Free --
----------
procedure Free (Message : in out SOAP_Message_Access) is
procedure Free is
new Ada.Unchecked_Deallocation
(Web_Services.SOAP.Messages.SOAP_Message,
Web_Services.SOAP.Messages.SOAP_Message_Access);
begin
if Message /= null then
Finalize (Message.all);
Free (Message);
end if;
end Free;
----------
-- Hash --
----------
function Hash
(Item : Web_Services.SOAP.Headers.SOAP_Header_Access)
return Ada.Containers.Hash_Type is
begin
return Ada.Strings.Hash (Ada.Tags.External_Tag (Item'Tag));
end Hash;
end Web_Services.SOAP.Messages;
| 45.636364 | 78 | 0.466335 |
108251caa7f9186efbaca0860b64048fb82a5612 | 6,045 | ads | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnarl/s-linux__android.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnarl/s-linux__android.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnarl/s-linux__android.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . L I N U X --
-- --
-- S p e c --
-- --
-- Copyright (C) 2014-2020, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- In particular, you can freely distribute your programs built with the --
-- GNAT Pro compiler, including any required library run-time units, using --
-- any licensing terms of your choosing. See the AdaCore Software License --
-- for full details. --
-- --
-- --
------------------------------------------------------------------------------
-- This is the Android version of this package
-- This package encapsulates cpu specific differences between implementations
-- of GNU/Linux, in order to share s-osinte-linux.ads.
-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
-- Preelaborate. This package is designed to be a bottom-level (leaf) package
with Interfaces.C;
package System.Linux is
pragma Preelaborate;
----------
-- Time --
----------
subtype long is Interfaces.C.long;
subtype suseconds_t is Interfaces.C.long;
subtype time_t is Interfaces.C.long;
subtype clockid_t is Interfaces.C.int;
type timespec is record
tv_sec : time_t;
tv_nsec : long;
end record;
pragma Convention (C, timespec);
type timeval is record
tv_sec : time_t;
tv_usec : suseconds_t;
end record;
pragma Convention (C, timeval);
-----------
-- Errno --
-----------
EAGAIN : constant := 11;
EINTR : constant := 4;
EINVAL : constant := 22;
ENOMEM : constant := 12;
EPERM : constant := 1;
ETIMEDOUT : constant := 110;
-------------
-- Signals --
-------------
SIGHUP : constant := 1; -- hangup
SIGINT : constant := 2; -- interrupt (rubout)
SIGQUIT : constant := 3; -- quit (ASCD FS)
SIGILL : constant := 4; -- illegal instruction (not reset)
SIGTRAP : constant := 5; -- trace trap (not reset)
SIGIOT : constant := 6; -- IOT instruction
SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
SIGBUS : constant := 7; -- bus error
SIGSEGV : constant := 11; -- segmentation violation
SIGPIPE : constant := 13; -- write on a pipe with no one to read it
SIGALRM : constant := 14; -- alarm clock
SIGTERM : constant := 15; -- software termination signal from kill
SIGUSR1 : constant := 10; -- user defined signal 1
SIGUSR2 : constant := 12; -- user defined signal 2
SIGCLD : constant := 17; -- alias for SIGCHLD
SIGCHLD : constant := 17; -- child status change
SIGPWR : constant := 30; -- power-fail restart
SIGWINCH : constant := 28; -- window size change
SIGURG : constant := 23; -- urgent condition on IO channel
SIGPOLL : constant := 29; -- pollable event occurred
SIGIO : constant := 29; -- I/O now possible (4.2 BSD)
SIGLOST : constant := 29; -- File lock lost
SIGSTOP : constant := 19; -- stop (cannot be caught or ignored)
SIGTSTP : constant := 20; -- user stop requested from tty
SIGCONT : constant := 18; -- stopped process has been continued
SIGTTIN : constant := 21; -- background tty read attempted
SIGTTOU : constant := 22; -- background tty write attempted
SIGVTALRM : constant := 26; -- virtual timer expired
SIGPROF : constant := 27; -- profiling timer expired
SIGXCPU : constant := 24; -- CPU time limit exceeded
SIGXFSZ : constant := 25; -- filesize limit exceeded
SIGUNUSED : constant := 31; -- unused signal (GNU/Linux)
SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux)
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
-- struct_sigaction offsets
sa_handler_pos : constant := 0;
sa_mask_pos : constant := Standard'Address_Size / 8;
sa_flags_pos : constant := 4 + sa_mask_pos;
SA_SIGINFO : constant := 16#00000004#;
SA_ONSTACK : constant := 16#08000000#;
SA_RESTART : constant := 16#10000000#;
SA_NODEFER : constant := 16#40000000#;
end System.Linux;
| 46.5 | 78 | 0.514144 |
39749de0391b44234bd8d3cf1fe111a87871ee03 | 5,971 | ads | Ada | bsp/wire.ads | yannickmoy/SPARKZumo | 29d4d5d4f00d43d2dafd8d8b8d21eea0769923f3 | [
"MIT"
] | 6 | 2018-04-05T21:05:17.000Z | 2021-06-04T15:24:09.000Z | bsp/wire.ads | yannickmoy/SPARKZumo | 29d4d5d4f00d43d2dafd8d8b8d21eea0769923f3 | [
"MIT"
] | null | null | null | bsp/wire.ads | yannickmoy/SPARKZumo | 29d4d5d4f00d43d2dafd8d8b8d21eea0769923f3 | [
"MIT"
] | 3 | 2021-01-18T16:07:40.000Z | 2021-05-03T15:52:13.000Z | pragma SPARK_Mode;
with Types; use Types;
with Interfaces; use Interfaces;
-- @summary
-- Interface to Arduino Wire library
--
-- @description
-- Provides an interface to the Arudino Wire library. This is used for
-- I2C busses.
--
package Wire is
-- Return result of a transmission
-- @value Success success
-- @value Data_Too_Long data too long to fit in transmit buffer
-- @value Rx_NACK_Addr received NACK on transmit of address
-- @value Rx_NACK_Data received NACK on transmit of data
-- @value Other_Err other error
type Transmission_Status_Index is
(Success, Data_Too_Long, Rx_NACK_Addr, Rx_NACK_Data, Other_Err);
Transmission_Status : array (Transmission_Status_Index) of Byte :=
(Success => 0,
Data_Too_Long => 1,
Rx_NACK_Addr => 2,
Rx_NACK_Data => 3,
Other_Err => 4);
-- Translates a Byte to Transmission_Status_Index
-- @param BB the byte to cast
-- @return the Transmission_Status_Index corresponding to the value in BB
function Byte2TSI (BB : Byte)
return Transmission_Status_Index;
-- Initiate the Wire library and join the I2C bus as a master.
procedure Init_Master
with Global => null;
pragma Import (C, Init_Master, "Wire_Begin_Master");
-- Initiate the Wire library and join the I2C bus as a slave
-- @param Addr the 7-bit slave address
procedure Init_Slave (Addr : Byte)
with Global => null;
pragma Import (C, Init_Slave, "Wire_Begin_Slave");
-- This function modifies the clock frequency for I2C communication.
-- @param Freq the value (in Hertz) of desired communication clock
procedure SetClock (Freq : Unsigned_32)
with Global => null;
pragma Import (C, SetClock, "Wire_SetClock");
-- Read a byte from the Reg register on the device at Addr
-- @param Addr the address of the device to access
-- @param Reg the register to access on the device
-- @return the Byte read from the device
function Read_Byte (Addr : Byte;
Reg : Byte)
return Byte;
-- Read multiple bytes from the device at Addr start at register Reg
-- @param Addr the address of the device to access
-- @param Reg the starting register to access on the device
-- @param Data an array of Bytes read from the registers
procedure Read_Bytes (Addr : Byte;
Reg : Byte;
Data : out Byte_Array)
with Global => Transmission_Status,
Pre => (Data'Length > 0);
pragma Annotate (GNATprove,
False_Positive,
"""Data"" might not be initialized",
String'("Data is properly initialized by this loop"));
-- Write a byte to the register Reg on the device at Addr
-- @param Addr the address of the device to write to
-- @param Reg the register to write to on the device
-- @param Data the data to write to the device
-- @return the status of the write transaction
function Write_Byte (Addr : Byte;
Reg : Byte;
Data : Byte)
return Transmission_Status_Index;
private
-- Used by the master to request bytes from a slave device.
-- Ada wrapper around imported RequestFrom_C
-- @param Addr the 7-bit address of the device to request bytes from
-- @param Quant the number of bytes to request
-- @param Stop true will send a stop message after the request, releasing
-- the bus. false will continually send a restart after the request,
-- keeping the connection active.
-- @return the number of bytes returned from the slave device
function RequestFrom (Addr : Byte;
Quant : Byte;
Stop : Boolean)
return Byte;
-- See documentation for RequestFrom
function RequestFrom_C (Addr : Byte;
Quant : Byte;
Stop : Byte)
return Byte
with Global => null;
pragma Import (C, RequestFrom_C, "Wire_RequestFrom");
-- Begin a transmission to the I2C slave device with the given address
-- @param Addr the 7-bit address of the device to transmit to
procedure BeginTransmission (Addr : Byte)
with Global => null;
pragma Import (C, BeginTransmission, "Wire_BeginTransmission");
-- Ends a transmission to a slave device that was begun by
-- BeginTransmission () and transmits the bytes that were queued
-- by write (). Ada wrapper around EndTransmission_C
-- @param Stop true will send a stop message, releasing the bus after
-- transmission. false will send a restart, keeping the connection active
-- @return byte, which indicates the status of the transmission
function EndTransmission (Stop : Boolean) return Byte;
-- See documentation for EndTransmission
function EndTransmission_C (Stop : Byte) return Byte
with Global => null;
pragma Import (C, EndTransmission_C, "Wire_EndTransmission");
-- Queues bytes for transmission from a master to slave device
-- @param Val a value to send as a single byte
-- @return will return the number of bytes written
function Write_Value (Val : Byte) return Byte
with Global => null;
pragma Import (C, Write_Value, "Wire_Write_Value");
-- Returns the number of bytes available for retrieval with read()
-- @return The number of bytes available for reading.
function Available return Integer
with Global => null;
pragma Import (C, Available, "Wire_Available");
-- Reads a byte that was transmitted from a slave device to a master
-- @return The next byte received
function Read return Byte
with Global => null;
pragma Import (C, Read, "Wire_Read");
end Wire;
| 39.806667 | 79 | 0.643443 |
1854623da34f25100fa52fa6b62ec6e66f50c10c | 57,786 | adb | Ada | llvm-gcc-4.2-2.9/gcc/ada/g-debpoo.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | 1 | 2016-04-09T02:58:13.000Z | 2016-04-09T02:58:13.000Z | llvm-gcc-4.2-2.9/gcc/ada/g-debpoo.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/g-debpoo.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . D E B U G _ P O O L S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2005, 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 2, 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 COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Exceptions.Traceback;
with GNAT.IO; use GNAT.IO;
with System.Address_Image;
with System.Memory; use System.Memory;
with System.Soft_Links; use System.Soft_Links;
with System.Traceback_Entries; use System.Traceback_Entries;
with GNAT.HTable;
with GNAT.Traceback; use GNAT.Traceback;
with Ada.Unchecked_Conversion;
package body GNAT.Debug_Pools is
Default_Alignment : constant := Standard'Maximum_Alignment;
-- Alignment used for the memory chunks returned by Allocate. Using this
-- value garantees that this alignment will be compatible with all types
-- and at the same time makes it easy to find the location of the extra
-- header allocated for each chunk.
Initial_Memory_Size : constant Storage_Offset := 2 ** 26; -- 64 Mb
-- Initial size of memory that the debug pool can handle. This is used to
-- compute the size of the htable used to monitor the blocks, but this is
-- dynamic and will grow as needed. Having a bigger size here means a
-- longer setup time, but less time spent later on to grow the array.
Max_Ignored_Levels : constant Natural := 10;
-- Maximum number of levels that will be ignored in backtraces. This is so
-- that we still have enough significant levels in the tracebacks returned
-- to the user.
--
-- The value 10 is chosen as being greater than the maximum callgraph
-- in this package. Its actual value is not really relevant, as long as it
-- is high enough to make sure we still have enough frames to return to
-- the user after we have hidden the frames internal to this package.
---------------------------
-- Back Trace Hash Table --
---------------------------
-- This package needs to store one set of tracebacks for each allocation
-- point (when was it allocated or deallocated). This would use too much
-- memory, so the tracebacks are actually stored in a hash table, and
-- we reference elements in this hash table instead.
-- This hash-table will remain empty if the discriminant Stack_Trace_Depth
-- for the pools is set to 0.
-- This table is a global table, that can be shared among all debug pools
-- with no problems.
type Header is range 1 .. 1023;
-- Number of elements in the hash-table
type Tracebacks_Array_Access
is access GNAT.Traceback.Tracebacks_Array;
type Traceback_Kind is (Alloc, Dealloc, Indirect_Alloc, Indirect_Dealloc);
type Traceback_Htable_Elem;
type Traceback_Htable_Elem_Ptr
is access Traceback_Htable_Elem;
type Traceback_Htable_Elem is record
Traceback : Tracebacks_Array_Access;
Kind : Traceback_Kind;
Count : Natural;
Total : Byte_Count;
Next : Traceback_Htable_Elem_Ptr;
end record;
-- Subprograms used for the Backtrace_Htable instantiation
procedure Set_Next
(E : Traceback_Htable_Elem_Ptr;
Next : Traceback_Htable_Elem_Ptr);
pragma Inline (Set_Next);
function Next
(E : Traceback_Htable_Elem_Ptr) return Traceback_Htable_Elem_Ptr;
pragma Inline (Next);
function Get_Key
(E : Traceback_Htable_Elem_Ptr) return Tracebacks_Array_Access;
pragma Inline (Get_Key);
function Hash (T : Tracebacks_Array_Access) return Header;
pragma Inline (Hash);
function Equal (K1, K2 : Tracebacks_Array_Access) return Boolean;
-- Why is this not inlined???
-- The hash table for back traces
package Backtrace_Htable is new GNAT.HTable.Static_HTable
(Header_Num => Header,
Element => Traceback_Htable_Elem,
Elmt_Ptr => Traceback_Htable_Elem_Ptr,
Null_Ptr => null,
Set_Next => Set_Next,
Next => Next,
Key => Tracebacks_Array_Access,
Get_Key => Get_Key,
Hash => Hash,
Equal => Equal);
-----------------------
-- Allocations table --
-----------------------
type Allocation_Header;
type Allocation_Header_Access is access Allocation_Header;
type Traceback_Ptr_Or_Address is new System.Address;
-- A type that acts as a C union, and is either a System.Address or a
-- Traceback_Htable_Elem_Ptr.
-- The following record stores extra information that needs to be
-- memorized for each block allocated with the special debug pool.
type Allocation_Header is record
Allocation_Address : System.Address;
-- Address of the block returned by malloc, possibly unaligned
Block_Size : Storage_Offset;
-- Needed only for advanced freeing algorithms (traverse all allocated
-- blocks for potential references). This value is negated when the
-- chunk of memory has been logically freed by the application. This
-- chunk has not been physically released yet.
Alloc_Traceback : Traceback_Htable_Elem_Ptr;
-- ??? comment required
Dealloc_Traceback : Traceback_Ptr_Or_Address;
-- Pointer to the traceback for the allocation (if the memory chunk is
-- still valid), or to the first deallocation otherwise. Make sure this
-- is a thin pointer to save space.
--
-- Dealloc_Traceback is also for blocks that are still allocated to
-- point to the previous block in the list. This saves space in this
-- header, and make manipulation of the lists of allocated pointers
-- faster.
Next : System.Address;
-- Point to the next block of the same type (either allocated or
-- logically freed) in memory. This points to the beginning of the user
-- data, and does not include the header of that block.
end record;
function Header_Of (Address : System.Address)
return Allocation_Header_Access;
pragma Inline (Header_Of);
-- Return the header corresponding to a previously allocated address
function To_Address is new Ada.Unchecked_Conversion
(Traceback_Ptr_Or_Address, System.Address);
function To_Address is new Ada.Unchecked_Conversion
(System.Address, Traceback_Ptr_Or_Address);
function To_Traceback is new Ada.Unchecked_Conversion
(Traceback_Ptr_Or_Address, Traceback_Htable_Elem_Ptr);
function To_Traceback is new Ada.Unchecked_Conversion
(Traceback_Htable_Elem_Ptr, Traceback_Ptr_Or_Address);
Header_Offset : constant Storage_Count :=
Default_Alignment *
((Allocation_Header'Size / System.Storage_Unit
+ Default_Alignment - 1) / Default_Alignment);
-- Offset of user data after allocation header
Minimum_Allocation : constant Storage_Count :=
Default_Alignment - 1 + Header_Offset;
-- Minimal allocation: size of allocation_header rounded up to next
-- multiple of default alignment + worst-case padding.
-----------------------
-- Allocations table --
-----------------------
-- This table is indexed on addresses modulo Default_Alignment, and for
-- each index it indicates whether that memory block is valid. Its behavior
-- is similar to GNAT.Table, except that we need to pack the table to save
-- space, so we cannot reuse GNAT.Table as is.
-- This table is the reason why all alignments have to be forced to common
-- value (Default_Alignment), so that this table can be kept to a
-- reasonnable size.
type Byte is mod 2 ** System.Storage_Unit;
Big_Table_Size : constant Storage_Offset :=
(Storage_Offset'Last - 1) / Default_Alignment;
type Big_Table is array (0 .. Big_Table_Size) of Byte;
-- A simple, flat-array type used to access memory bytes (see the comment
-- for Valid_Blocks below).
--
-- It would be cleaner to represent this as a packed array of Boolean.
-- However, we cannot specify pragma Pack for such an array, since the
-- total size on a 64 bit machine would be too big (> Integer'Last).
--
-- Given an address, we know if it is under control of the debug pool if
-- the byte at index:
-- ((Address - Edata'Address) / Default_Alignment)
-- / Storage_unit
-- has the bit
-- ((Address - Edata'Address) / Default_Alignment)
-- mod Storage_Unit
-- set to 1.
--
-- See the subprograms Is_Valid and Set_Valid for proper manipulation of
-- this array.
type Table_Ptr is access Big_Table;
function To_Pointer is new Ada.Unchecked_Conversion
(System.Address, Table_Ptr);
Valid_Blocks : Table_Ptr := null;
Valid_Blocks_Size : Storage_Offset := 0;
-- These two variables represents a mapping of the currently allocated
-- memory. Every time the pool works on an address, we first check that the
-- index Address / Default_Alignment is True. If not, this means that this
-- address is not under control of the debug pool and thus this is probably
-- an invalid memory access (it could also be a general access type).
--
-- Note that in fact we never allocate the full size of Big_Table, only a
-- slice big enough to manage the currently allocated memory.
Edata : System.Address := System.Null_Address;
-- Address in memory that matches the index 0 in Valid_Blocks. It is named
-- after the symbol _edata, which, on most systems, indicate the lowest
-- possible address returned by malloc. Unfortunately, this symbol doesn't
-- exist on windows, so we cannot use it instead of this variable.
-----------------------
-- Local subprograms --
-----------------------
function Find_Or_Create_Traceback
(Pool : Debug_Pool;
Kind : Traceback_Kind;
Size : Storage_Count;
Ignored_Frame_Start : System.Address;
Ignored_Frame_End : System.Address) return Traceback_Htable_Elem_Ptr;
-- Return an element matching the current traceback (omitting the frames
-- that are in the current package). If this traceback already existed in
-- the htable, a pointer to this is returned to spare memory. Null is
-- returned if the pool is set not to store tracebacks. If the traceback
-- already existed in the table, the count is incremented so that
-- Dump_Tracebacks returns useful results. All addresses up to, and
-- including, an address between Ignored_Frame_Start .. Ignored_Frame_End
-- are ignored.
procedure Put_Line
(Depth : Natural;
Traceback : Tracebacks_Array_Access;
Ignored_Frame_Start : System.Address := System.Null_Address;
Ignored_Frame_End : System.Address := System.Null_Address);
-- Print Traceback to Standard_Output. If Traceback is null, print the
-- call_chain at the current location, up to Depth levels, ignoring all
-- addresses up to the first one in the range
-- Ignored_Frame_Start .. Ignored_Frame_End
function Is_Valid (Storage : System.Address) return Boolean;
pragma Inline (Is_Valid);
-- Return True if Storage is an address that the debug pool has under its
-- control.
procedure Set_Valid (Storage : System.Address; Value : Boolean);
pragma Inline (Set_Valid);
-- Mark the address Storage as being under control of the memory pool (if
-- Value is True), or not (if Value is False). This procedure will
-- reallocate the table Valid_Blocks as needed.
procedure Set_Dead_Beef
(Storage_Address : System.Address;
Size_In_Storage_Elements : Storage_Count);
-- Set the contents of the memory block pointed to by Storage_Address to
-- the 16#DEADBEEF# pattern. If Size_In_Storage_Elements is not a multiple
-- of the length of this pattern, the last instance may be partial.
procedure Free_Physically (Pool : in out Debug_Pool);
-- Start to physically release some memory to the system, until the amount
-- of logically (but not physically) freed memory is lower than the
-- expected amount in Pool.
procedure Allocate_End;
procedure Deallocate_End;
procedure Dereference_End;
-- These procedures are used as markers when computing the stacktraces,
-- so that addresses in the debug pool itself are not reported to the user.
Code_Address_For_Allocate_End : System.Address;
Code_Address_For_Deallocate_End : System.Address;
Code_Address_For_Dereference_End : System.Address;
-- Taking the address of the above procedures will not work on some
-- architectures (HPUX and VMS for instance). Thus we do the same thing
-- that is done in a-except.adb, and get the address of labels instead
procedure Skip_Levels
(Depth : Natural;
Trace : Tracebacks_Array;
Start : out Natural;
Len : in out Natural;
Ignored_Frame_Start : System.Address;
Ignored_Frame_End : System.Address);
-- Set Start .. Len to the range of values from Trace that should be output
-- to the user. This range of values exludes any address prior to the first
-- one in Ignored_Frame_Start .. Ignored_Frame_End (basically addresses
-- internal to this package). Depth is the number of levels that the user
-- is interested in.
---------------
-- Header_Of --
---------------
function Header_Of (Address : System.Address)
return Allocation_Header_Access
is
function Convert is new Ada.Unchecked_Conversion
(System.Address, Allocation_Header_Access);
begin
return Convert (Address - Header_Offset);
end Header_Of;
--------------
-- Set_Next --
--------------
procedure Set_Next
(E : Traceback_Htable_Elem_Ptr;
Next : Traceback_Htable_Elem_Ptr)
is
begin
E.Next := Next;
end Set_Next;
----------
-- Next --
----------
function Next
(E : Traceback_Htable_Elem_Ptr) return Traceback_Htable_Elem_Ptr is
begin
return E.Next;
end Next;
-----------
-- Equal --
-----------
function Equal (K1, K2 : Tracebacks_Array_Access) return Boolean is
use Ada.Exceptions.Traceback;
begin
return K1.all = K2.all;
end Equal;
-------------
-- Get_Key --
-------------
function Get_Key
(E : Traceback_Htable_Elem_Ptr) return Tracebacks_Array_Access
is
begin
return E.Traceback;
end Get_Key;
----------
-- Hash --
----------
function Hash (T : Tracebacks_Array_Access) return Header is
Result : Integer_Address := 0;
begin
for X in T'Range loop
Result := Result + To_Integer (PC_For (T (X)));
end loop;
return Header (1 + Result mod Integer_Address (Header'Last));
end Hash;
--------------
-- Put_Line --
--------------
procedure Put_Line
(Depth : Natural;
Traceback : Tracebacks_Array_Access;
Ignored_Frame_Start : System.Address := System.Null_Address;
Ignored_Frame_End : System.Address := System.Null_Address)
is
procedure Print (Tr : Tracebacks_Array);
-- Print the traceback to standard_output
-----------
-- Print --
-----------
procedure Print (Tr : Tracebacks_Array) is
begin
for J in Tr'Range loop
Put ("0x" & Address_Image (PC_For (Tr (J))) & ' ');
end loop;
Put (ASCII.LF);
end Print;
-- Start of processing for Put_Line
begin
if Traceback = null then
declare
Tr : aliased Tracebacks_Array (1 .. Depth + Max_Ignored_Levels);
Start, Len : Natural;
begin
Call_Chain (Tr, Len);
Skip_Levels (Depth, Tr, Start, Len,
Ignored_Frame_Start, Ignored_Frame_End);
Print (Tr (Start .. Len));
end;
else
Print (Traceback.all);
end if;
end Put_Line;
-----------------
-- Skip_Levels --
-----------------
procedure Skip_Levels
(Depth : Natural;
Trace : Tracebacks_Array;
Start : out Natural;
Len : in out Natural;
Ignored_Frame_Start : System.Address;
Ignored_Frame_End : System.Address)
is
begin
Start := Trace'First;
while Start <= Len
and then (PC_For (Trace (Start)) < Ignored_Frame_Start
or else PC_For (Trace (Start)) > Ignored_Frame_End)
loop
Start := Start + 1;
end loop;
Start := Start + 1;
-- Just in case: make sure we have a traceback even if Ignore_Till
-- wasn't found.
if Start > Len then
Start := 1;
end if;
if Len - Start + 1 > Depth then
Len := Depth + Start - 1;
end if;
end Skip_Levels;
------------------------------
-- Find_Or_Create_Traceback --
------------------------------
function Find_Or_Create_Traceback
(Pool : Debug_Pool;
Kind : Traceback_Kind;
Size : Storage_Count;
Ignored_Frame_Start : System.Address;
Ignored_Frame_End : System.Address) return Traceback_Htable_Elem_Ptr
is
begin
if Pool.Stack_Trace_Depth = 0 then
return null;
end if;
declare
Trace : aliased Tracebacks_Array
(1 .. Integer (Pool.Stack_Trace_Depth) + Max_Ignored_Levels);
Len, Start : Natural;
Elem : Traceback_Htable_Elem_Ptr;
begin
Call_Chain (Trace, Len);
Skip_Levels (Pool.Stack_Trace_Depth, Trace, Start, Len,
Ignored_Frame_Start, Ignored_Frame_End);
-- Check if the traceback is already in the table
Elem :=
Backtrace_Htable.Get (Trace (Start .. Len)'Unrestricted_Access);
-- If not, insert it
if Elem = null then
Elem := new Traceback_Htable_Elem'
(Traceback => new Tracebacks_Array'(Trace (Start .. Len)),
Count => 1,
Kind => Kind,
Total => Byte_Count (Size),
Next => null);
Backtrace_Htable.Set (Elem);
else
Elem.Count := Elem.Count + 1;
Elem.Total := Elem.Total + Byte_Count (Size);
end if;
return Elem;
end;
end Find_Or_Create_Traceback;
--------------
-- Is_Valid --
--------------
function Is_Valid (Storage : System.Address) return Boolean is
Offset : constant Storage_Offset :=
(Storage - Edata) / Default_Alignment;
Bit : constant Byte := 2 ** Natural (Offset mod System.Storage_Unit);
begin
return (Storage mod Default_Alignment) = 0
and then Offset >= 0
and then Offset < Valid_Blocks_Size * Storage_Unit
and then (Valid_Blocks (Offset / Storage_Unit) and Bit) /= 0;
end Is_Valid;
---------------
-- Set_Valid --
---------------
procedure Set_Valid (Storage : System.Address; Value : Boolean) is
Offset : Storage_Offset;
Bit : Byte;
Bytes : Storage_Offset;
Tmp : constant Table_Ptr := Valid_Blocks;
Edata_Align : constant Storage_Offset :=
Default_Alignment * Storage_Unit;
procedure Memset (A : Address; C : Integer; N : size_t);
pragma Import (C, Memset, "memset");
procedure Memmove (Dest, Src : Address; N : size_t);
pragma Import (C, Memmove, "memmove");
begin
-- Allocate, or reallocate, the valid blocks table as needed. We start
-- with a size big enough to handle Initial_Memory_Size bytes of memory,
-- to avoid too many reallocations. The table will typically be around
-- 16Mb in that case, which is still small enough.
if Valid_Blocks_Size = 0 then
Valid_Blocks_Size := (Initial_Memory_Size / Default_Alignment)
/ Storage_Unit;
Valid_Blocks := To_Pointer (Alloc (size_t (Valid_Blocks_Size)));
Edata := Storage;
-- Reset the memory using memset, which is much faster than the
-- standard Ada code with "when others"
Memset (Valid_Blocks.all'Address, 0, size_t (Valid_Blocks_Size));
end if;
-- First case : the new address is outside of the current scope of
-- Valid_Blocks, before the current start address. We need to reallocate
-- the table accordingly. This should be a rare occurence, since in most
-- cases, the first allocation will also have the lowest address. But
-- there is no garantee...
if Storage < Edata then
-- The difference between the new Edata and the current one must be
-- a multiple of Default_Alignment * Storage_Unit, so that the bit
-- representing an address in Valid_Blocks are kept the same.
Offset := ((Edata - Storage) / Edata_Align + 1) * Edata_Align;
Offset := Offset / Default_Alignment;
Bytes := Offset / Storage_Unit;
Valid_Blocks :=
To_Pointer (Alloc (Size => size_t (Valid_Blocks_Size + Bytes)));
Memmove (Dest => Valid_Blocks.all'Address + Bytes,
Src => Tmp.all'Address,
N => size_t (Valid_Blocks_Size));
Memset (A => Valid_Blocks.all'Address,
C => 0,
N => size_t (Bytes));
Free (Tmp.all'Address);
Valid_Blocks_Size := Valid_Blocks_Size + Bytes;
-- Take into the account the new start address
Edata := Storage - Edata_Align + (Edata - Storage) mod Edata_Align;
end if;
-- Second case : the new address is outside of the current scope of
-- Valid_Blocks, so we have to grow the table as appropriate.
-- Note: it might seem more natural for the following statement to
-- be written:
-- Offset := (Storage - Edata) / Default_Alignment;
-- but that won't work since Storage_Offset is signed, and it is
-- possible to subtract a small address from a large address and
-- get a negative value. This may seem strange, but it is quite
-- specifically allowed in the RM, and is what most implementations
-- including GNAT actually do. Hence the conversion to Integer_Address
-- which is a full range modular type, not subject to this glitch.
Offset := Storage_Offset ((To_Integer (Storage) - To_Integer (Edata)) /
Default_Alignment);
if Offset >= Valid_Blocks_Size * System.Storage_Unit then
Bytes := Valid_Blocks_Size;
loop
Bytes := 2 * Bytes;
exit when Offset <= Bytes * System.Storage_Unit;
end loop;
Valid_Blocks := To_Pointer
(Realloc (Ptr => Valid_Blocks.all'Address,
Size => size_t (Bytes)));
Memset
(Valid_Blocks.all'Address + Valid_Blocks_Size,
0,
size_t (Bytes - Valid_Blocks_Size));
Valid_Blocks_Size := Bytes;
end if;
Bit := 2 ** Natural (Offset mod System.Storage_Unit);
Bytes := Offset / Storage_Unit;
-- Then set the value as valid
if Value then
Valid_Blocks (Bytes) := Valid_Blocks (Bytes) or Bit;
else
Valid_Blocks (Bytes) := Valid_Blocks (Bytes) and (not Bit);
end if;
end Set_Valid;
--------------
-- Allocate --
--------------
procedure Allocate
(Pool : in out Debug_Pool;
Storage_Address : out Address;
Size_In_Storage_Elements : Storage_Count;
Alignment : Storage_Count)
is
pragma Unreferenced (Alignment);
-- Ignored, we always force 'Default_Alignment
type Local_Storage_Array is new Storage_Array
(1 .. Size_In_Storage_Elements + Minimum_Allocation);
type Ptr is access Local_Storage_Array;
-- On some systems, we might want to physically protect pages
-- against writing when they have been freed (of course, this is
-- expensive in terms of wasted memory). To do that, all we should
-- have to do it to set the size of this array to the page size.
-- See mprotect().
P : Ptr;
Current : Byte_Count;
Trace : Traceback_Htable_Elem_Ptr;
begin
<<Allocate_Label>>
Lock_Task.all;
-- If necessary, start physically releasing memory. The reason this is
-- done here, although Pool.Logically_Deallocated has not changed above,
-- is so that we do this only after a series of deallocations (e.g a
-- loop that deallocates a big array). If we were doing that in
-- Deallocate, we might be physically freeing memory several times
-- during the loop, which is expensive.
if Pool.Logically_Deallocated >
Byte_Count (Pool.Maximum_Logically_Freed_Memory)
then
Free_Physically (Pool);
end if;
-- Use standard (ie through malloc) allocations. This automatically
-- raises Storage_Error if needed. We also try once more to physically
-- release memory, so that even marked blocks, in the advanced scanning,
-- are freed.
begin
P := new Local_Storage_Array;
exception
when Storage_Error =>
Free_Physically (Pool);
P := new Local_Storage_Array;
end;
Storage_Address :=
System.Null_Address + Default_Alignment
* (((P.all'Address + Default_Alignment - 1) - System.Null_Address)
/ Default_Alignment)
+ Header_Offset;
pragma Assert ((Storage_Address - System.Null_Address)
mod Default_Alignment = 0);
pragma Assert (Storage_Address + Size_In_Storage_Elements
<= P.all'Address + P'Length);
Trace := Find_Or_Create_Traceback
(Pool, Alloc, Size_In_Storage_Elements,
Allocate_Label'Address, Code_Address_For_Allocate_End);
pragma Warnings (Off);
-- Turn warning on alignment for convert call off. We know that in
-- fact this conversion is safe since P itself is always aligned on
-- Default_Alignment.
Header_Of (Storage_Address).all :=
(Allocation_Address => P.all'Address,
Alloc_Traceback => Trace,
Dealloc_Traceback => To_Traceback (null),
Next => Pool.First_Used_Block,
Block_Size => Size_In_Storage_Elements);
pragma Warnings (On);
-- Link this block in the list of used blocks. This will be used to list
-- memory leaks in Print_Info, and for the advanced schemes of
-- Physical_Free, where we want to traverse all allocated blocks and
-- search for possible references.
-- We insert in front, since most likely we'll be freeing the most
-- recently allocated blocks first (the older one might stay allocated
-- for the whole life of the application).
if Pool.First_Used_Block /= System.Null_Address then
Header_Of (Pool.First_Used_Block).Dealloc_Traceback :=
To_Address (Storage_Address);
end if;
Pool.First_Used_Block := Storage_Address;
-- Mark the new address as valid
Set_Valid (Storage_Address, True);
-- Update internal data
Pool.Allocated :=
Pool.Allocated + Byte_Count (Size_In_Storage_Elements);
Current := Pool.Allocated -
Pool.Logically_Deallocated -
Pool.Physically_Deallocated;
if Current > Pool.High_Water then
Pool.High_Water := Current;
end if;
Unlock_Task.all;
exception
when others =>
Unlock_Task.all;
raise;
end Allocate;
------------------
-- Allocate_End --
------------------
-- DO NOT MOVE, this must be right after Allocate. This is similar to
-- what is done in a-except, so that we can hide the traceback frames
-- internal to this package
procedure Allocate_End is
begin
<<Allocate_End_Label>>
Code_Address_For_Allocate_End := Allocate_End_Label'Address;
end Allocate_End;
-------------------
-- Set_Dead_Beef --
-------------------
procedure Set_Dead_Beef
(Storage_Address : System.Address;
Size_In_Storage_Elements : Storage_Count)
is
Dead_Bytes : constant := 4;
type Data is mod 2 ** (Dead_Bytes * 8);
for Data'Size use Dead_Bytes * 8;
Dead : constant Data := 16#DEAD_BEEF#;
type Dead_Memory is array
(1 .. Size_In_Storage_Elements / Dead_Bytes) of Data;
type Mem_Ptr is access Dead_Memory;
type Byte is mod 2 ** 8;
for Byte'Size use 8;
type Dead_Memory_Bytes is array (0 .. 2) of Byte;
type Dead_Memory_Bytes_Ptr is access Dead_Memory_Bytes;
function From_Ptr is new Ada.Unchecked_Conversion
(System.Address, Mem_Ptr);
function From_Ptr is new Ada.Unchecked_Conversion
(System.Address, Dead_Memory_Bytes_Ptr);
M : constant Mem_Ptr := From_Ptr (Storage_Address);
M2 : Dead_Memory_Bytes_Ptr;
Modulo : constant Storage_Count :=
Size_In_Storage_Elements mod Dead_Bytes;
begin
M.all := (others => Dead);
-- Any bytes left (up to three of them)
if Modulo /= 0 then
M2 := From_Ptr (Storage_Address + M'Length * Dead_Bytes);
M2 (0) := 16#DE#;
if Modulo >= 2 then
M2 (1) := 16#AD#;
if Modulo >= 3 then
M2 (2) := 16#BE#;
end if;
end if;
end if;
end Set_Dead_Beef;
---------------------
-- Free_Physically --
---------------------
procedure Free_Physically (Pool : in out Debug_Pool) is
type Byte is mod 256;
type Byte_Access is access Byte;
function To_Byte is new Ada.Unchecked_Conversion
(System.Address, Byte_Access);
type Address_Access is access System.Address;
function To_Address_Access is new Ada.Unchecked_Conversion
(System.Address, Address_Access);
In_Use_Mark : constant Byte := 16#D#;
Free_Mark : constant Byte := 16#F#;
Total_Freed : Storage_Count := 0;
procedure Reset_Marks;
-- Unmark all the logically freed blocks, so that they are considered
-- for physical deallocation
procedure Mark
(H : Allocation_Header_Access; A : System.Address; In_Use : Boolean);
-- Mark the user data block starting at A. For a block of size zero,
-- nothing is done. For a block with a different size, the first byte
-- is set to either "D" (in use) or "F" (free).
function Marked (A : System.Address) return Boolean;
-- Return true if the user data block starting at A might be in use
-- somewhere else
procedure Mark_Blocks;
-- Traverse all allocated blocks, and search for possible references
-- to logically freed blocks. Mark them appropriately
procedure Free_Blocks (Ignore_Marks : Boolean);
-- Physically release blocks. Only the blocks that haven't been marked
-- will be released, unless Ignore_Marks is true.
-----------------
-- Free_Blocks --
-----------------
procedure Free_Blocks (Ignore_Marks : Boolean) is
Header : Allocation_Header_Access;
Tmp : System.Address := Pool.First_Free_Block;
Next : System.Address;
Previous : System.Address := System.Null_Address;
begin
while Tmp /= System.Null_Address
and then Total_Freed < Pool.Minimum_To_Free
loop
Header := Header_Of (Tmp);
-- If we know, or at least assume, the block is no longer
-- reference anywhere, we can free it physically.
if Ignore_Marks or else not Marked (Tmp) then
declare
pragma Suppress (All_Checks);
-- Suppress the checks on this section. If they are overflow
-- errors, it isn't critical, and we'd rather avoid a
-- Constraint_Error in that case.
begin
-- Note that block_size < zero for freed blocks
Pool.Physically_Deallocated :=
Pool.Physically_Deallocated -
Byte_Count (Header.Block_Size);
Pool.Logically_Deallocated :=
Pool.Logically_Deallocated +
Byte_Count (Header.Block_Size);
Total_Freed := Total_Freed - Header.Block_Size;
end;
Next := Header.Next;
System.Memory.Free (Header.Allocation_Address);
Set_Valid (Tmp, False);
-- Remove this block from the list
if Previous = System.Null_Address then
Pool.First_Free_Block := Next;
else
Header_Of (Previous).Next := Next;
end if;
Tmp := Next;
else
Previous := Tmp;
Tmp := Header.Next;
end if;
end loop;
end Free_Blocks;
----------
-- Mark --
----------
procedure Mark
(H : Allocation_Header_Access;
A : System.Address;
In_Use : Boolean)
is
begin
if H.Block_Size /= 0 then
if In_Use then
To_Byte (A).all := In_Use_Mark;
else
To_Byte (A).all := Free_Mark;
end if;
end if;
end Mark;
-----------------
-- Mark_Blocks --
-----------------
procedure Mark_Blocks is
Tmp : System.Address := Pool.First_Used_Block;
Previous : System.Address;
Last : System.Address;
Pointed : System.Address;
Header : Allocation_Header_Access;
begin
-- For each allocated block, check its contents. Things that look
-- like a possible address are used to mark the blocks so that we try
-- and keep them, for better detection in case of invalid access.
-- This mechanism is far from being fool-proof: it doesn't check the
-- stacks of the threads, doesn't check possible memory allocated not
-- under control of this debug pool. But it should allow us to catch
-- more cases.
while Tmp /= System.Null_Address loop
Previous := Tmp;
Last := Tmp + Header_Of (Tmp).Block_Size;
while Previous < Last loop
-- ??? Should we move byte-per-byte, or consider that addresses
-- are always aligned on 4-bytes boundaries ? Let's use the
-- fastest for now.
Pointed := To_Address_Access (Previous).all;
if Is_Valid (Pointed) then
Header := Header_Of (Pointed);
-- Do not even attempt to mark blocks in use. That would
-- screw up the whole application, of course.
if Header.Block_Size < 0 then
Mark (Header, Pointed, In_Use => True);
end if;
end if;
Previous := Previous + System.Address'Size;
end loop;
Tmp := Header_Of (Tmp).Next;
end loop;
end Mark_Blocks;
------------
-- Marked --
------------
function Marked (A : System.Address) return Boolean is
begin
return To_Byte (A).all = In_Use_Mark;
end Marked;
-----------------
-- Reset_Marks --
-----------------
procedure Reset_Marks is
Current : System.Address := Pool.First_Free_Block;
Header : Allocation_Header_Access;
begin
while Current /= System.Null_Address loop
Header := Header_Of (Current);
Mark (Header, Current, False);
Current := Header.Next;
end loop;
end Reset_Marks;
-- Start of processing for Free_Physically
begin
Lock_Task.all;
if Pool.Advanced_Scanning then
Reset_Marks; -- Reset the mark for each freed block
Mark_Blocks;
end if;
Free_Blocks (Ignore_Marks => not Pool.Advanced_Scanning);
-- The contract is that we need to free at least Minimum_To_Free bytes,
-- even if this means freeing marked blocks in the advanced scheme
if Total_Freed < Pool.Minimum_To_Free
and then Pool.Advanced_Scanning
then
Pool.Marked_Blocks_Deallocated := True;
Free_Blocks (Ignore_Marks => True);
end if;
Unlock_Task.all;
exception
when others =>
Unlock_Task.all;
raise;
end Free_Physically;
----------------
-- Deallocate --
----------------
procedure Deallocate
(Pool : in out Debug_Pool;
Storage_Address : Address;
Size_In_Storage_Elements : Storage_Count;
Alignment : Storage_Count)
is
pragma Unreferenced (Alignment);
Header : constant Allocation_Header_Access :=
Header_Of (Storage_Address);
Valid : Boolean;
Previous : System.Address;
begin
<<Deallocate_Label>>
Lock_Task.all;
Valid := Is_Valid (Storage_Address);
if not Valid then
Unlock_Task.all;
if Pool.Raise_Exceptions then
raise Freeing_Not_Allocated_Storage;
else
Put ("error: Freeing not allocated storage, at ");
Put_Line (Pool.Stack_Trace_Depth, null,
Deallocate_Label'Address,
Code_Address_For_Deallocate_End);
end if;
elsif Header.Block_Size < 0 then
Unlock_Task.all;
if Pool.Raise_Exceptions then
raise Freeing_Deallocated_Storage;
else
Put ("error: Freeing already deallocated storage, at ");
Put_Line (Pool.Stack_Trace_Depth, null,
Deallocate_Label'Address,
Code_Address_For_Deallocate_End);
Put (" Memory already deallocated at ");
Put_Line (0, To_Traceback (Header.Dealloc_Traceback).Traceback);
Put (" Memory was allocated at ");
Put_Line (0, Header.Alloc_Traceback.Traceback);
end if;
else
-- Remove this block from the list of used blocks
Previous :=
To_Address (Header_Of (Storage_Address).Dealloc_Traceback);
if Previous = System.Null_Address then
Pool.First_Used_Block := Header_Of (Pool.First_Used_Block).Next;
if Pool.First_Used_Block /= System.Null_Address then
Header_Of (Pool.First_Used_Block).Dealloc_Traceback :=
To_Traceback (null);
end if;
else
Header_Of (Previous).Next := Header_Of (Storage_Address).Next;
if Header_Of (Storage_Address).Next /= System.Null_Address then
Header_Of
(Header_Of (Storage_Address).Next).Dealloc_Traceback :=
To_Address (Previous);
end if;
end if;
-- Update the header
Header.all :=
(Allocation_Address => Header.Allocation_Address,
Alloc_Traceback => Header.Alloc_Traceback,
Dealloc_Traceback => To_Traceback
(Find_Or_Create_Traceback
(Pool, Dealloc,
Size_In_Storage_Elements,
Deallocate_Label'Address,
Code_Address_For_Deallocate_End)),
Next => System.Null_Address,
Block_Size => -Size_In_Storage_Elements);
if Pool.Reset_Content_On_Free then
Set_Dead_Beef (Storage_Address, Size_In_Storage_Elements);
end if;
Pool.Logically_Deallocated :=
Pool.Logically_Deallocated +
Byte_Count (Size_In_Storage_Elements);
-- Link this free block with the others (at the end of the list, so
-- that we can start releasing the older blocks first later on).
if Pool.First_Free_Block = System.Null_Address then
Pool.First_Free_Block := Storage_Address;
Pool.Last_Free_Block := Storage_Address;
else
Header_Of (Pool.Last_Free_Block).Next := Storage_Address;
Pool.Last_Free_Block := Storage_Address;
end if;
-- Do not physically release the memory here, but in Alloc.
-- See comment there for details.
Unlock_Task.all;
end if;
exception
when others =>
Unlock_Task.all;
raise;
end Deallocate;
--------------------
-- Deallocate_End --
--------------------
-- DO NOT MOVE, this must be right after Deallocate
-- See Allocate_End
procedure Deallocate_End is
begin
<<Deallocate_End_Label>>
Code_Address_For_Deallocate_End := Deallocate_End_Label'Address;
end Deallocate_End;
-----------------
-- Dereference --
-----------------
procedure Dereference
(Pool : in out Debug_Pool;
Storage_Address : Address;
Size_In_Storage_Elements : Storage_Count;
Alignment : Storage_Count)
is
pragma Unreferenced (Alignment, Size_In_Storage_Elements);
Valid : constant Boolean := Is_Valid (Storage_Address);
Header : Allocation_Header_Access;
begin
-- Locking policy: we do not do any locking in this procedure. The
-- tables are only read, not written to, and although a problem might
-- appear if someone else is modifying the tables at the same time, this
-- race condition is not intended to be detected by this storage_pool (a
-- now invalid pointer would appear as valid). Instead, we prefer
-- optimum performance for dereferences.
<<Dereference_Label>>
if not Valid then
if Pool.Raise_Exceptions then
raise Accessing_Not_Allocated_Storage;
else
Put ("error: Accessing not allocated storage, at ");
Put_Line (Pool.Stack_Trace_Depth, null,
Dereference_Label'Address,
Code_Address_For_Dereference_End);
end if;
else
Header := Header_Of (Storage_Address);
if Header.Block_Size < 0 then
if Pool.Raise_Exceptions then
raise Accessing_Deallocated_Storage;
else
Put ("error: Accessing deallocated storage, at ");
Put_Line
(Pool.Stack_Trace_Depth, null,
Dereference_Label'Address,
Code_Address_For_Dereference_End);
Put (" First deallocation at ");
Put_Line (0, To_Traceback (Header.Dealloc_Traceback).Traceback);
Put (" Initial allocation at ");
Put_Line (0, Header.Alloc_Traceback.Traceback);
end if;
end if;
end if;
end Dereference;
---------------------
-- Dereference_End --
---------------------
-- DO NOT MOVE: this must be right after Dereference
-- See Allocate_End
procedure Dereference_End is
begin
<<Dereference_End_Label>>
Code_Address_For_Dereference_End := Dereference_End_Label'Address;
end Dereference_End;
----------------
-- Print_Info --
----------------
procedure Print_Info
(Pool : Debug_Pool;
Cumulate : Boolean := False;
Display_Slots : Boolean := False;
Display_Leaks : Boolean := False)
is
package Backtrace_Htable_Cumulate is new GNAT.HTable.Static_HTable
(Header_Num => Header,
Element => Traceback_Htable_Elem,
Elmt_Ptr => Traceback_Htable_Elem_Ptr,
Null_Ptr => null,
Set_Next => Set_Next,
Next => Next,
Key => Tracebacks_Array_Access,
Get_Key => Get_Key,
Hash => Hash,
Equal => Equal);
-- This needs a comment ??? probably some of the ones below do too???
Data : Traceback_Htable_Elem_Ptr;
Elem : Traceback_Htable_Elem_Ptr;
Current : System.Address;
Header : Allocation_Header_Access;
K : Traceback_Kind;
begin
Put_Line
("Total allocated bytes : " &
Byte_Count'Image (Pool.Allocated));
Put_Line
("Total logically deallocated bytes : " &
Byte_Count'Image (Pool.Logically_Deallocated));
Put_Line
("Total physically deallocated bytes : " &
Byte_Count'Image (Pool.Physically_Deallocated));
if Pool.Marked_Blocks_Deallocated then
Put_Line ("Marked blocks were physically deallocated. This is");
Put_Line ("potentially dangereous, and you might want to run");
Put_Line ("again with a lower value of Minimum_To_Free");
end if;
Put_Line
("Current Water Mark: " &
Byte_Count'Image
(Pool.Allocated - Pool.Logically_Deallocated
- Pool.Physically_Deallocated));
Put_Line
("High Water Mark: " &
Byte_Count'Image (Pool.High_Water));
Put_Line ("");
if Display_Slots then
Data := Backtrace_Htable.Get_First;
while Data /= null loop
if Data.Kind in Alloc .. Dealloc then
Elem :=
new Traceback_Htable_Elem'
(Traceback => new Tracebacks_Array'(Data.Traceback.all),
Count => Data.Count,
Kind => Data.Kind,
Total => Data.Total,
Next => null);
Backtrace_Htable_Cumulate.Set (Elem);
if Cumulate then
if Data.Kind = Alloc then
K := Indirect_Alloc;
else
K := Indirect_Dealloc;
end if;
-- Propagate the direct call to all its parents
for T in Data.Traceback'First + 1 .. Data.Traceback'Last loop
Elem := Backtrace_Htable_Cumulate.Get
(Data.Traceback
(T .. Data.Traceback'Last)'Unrestricted_Access);
-- If not, insert it
if Elem = null then
Elem := new Traceback_Htable_Elem'
(Traceback => new Tracebacks_Array'
(Data.Traceback (T .. Data.Traceback'Last)),
Count => Data.Count,
Kind => K,
Total => Data.Total,
Next => null);
Backtrace_Htable_Cumulate.Set (Elem);
-- Properly take into account that the subprograms
-- indirectly called might be doing either allocations
-- or deallocations. This needs to be reflected in the
-- counts.
else
Elem.Count := Elem.Count + Data.Count;
if K = Elem.Kind then
Elem.Total := Elem.Total + Data.Total;
elsif Elem.Total > Data.Total then
Elem.Total := Elem.Total - Data.Total;
else
Elem.Kind := K;
Elem.Total := Data.Total - Elem.Total;
end if;
end if;
end loop;
end if;
Data := Backtrace_Htable.Get_Next;
end if;
end loop;
Put_Line ("List of allocations/deallocations: ");
Data := Backtrace_Htable_Cumulate.Get_First;
while Data /= null loop
case Data.Kind is
when Alloc => Put ("alloc (count:");
when Indirect_Alloc => Put ("indirect alloc (count:");
when Dealloc => Put ("free (count:");
when Indirect_Dealloc => Put ("indirect free (count:");
end case;
Put (Natural'Image (Data.Count) & ", total:" &
Byte_Count'Image (Data.Total) & ") ");
for T in Data.Traceback'Range loop
Put ("0x" & Address_Image (PC_For (Data.Traceback (T))) & ' ');
end loop;
Put_Line ("");
Data := Backtrace_Htable_Cumulate.Get_Next;
end loop;
Backtrace_Htable_Cumulate.Reset;
end if;
if Display_Leaks then
Put_Line ("");
Put_Line ("List of not deallocated blocks:");
-- Do not try to group the blocks with the same stack traces
-- together. This is done by the gnatmem output.
Current := Pool.First_Used_Block;
while Current /= System.Null_Address loop
Header := Header_Of (Current);
Put ("Size: " & Storage_Count'Image (Header.Block_Size) & " at: ");
for T in Header.Alloc_Traceback.Traceback'Range loop
Put ("0x" & Address_Image
(PC_For (Header.Alloc_Traceback.Traceback (T))) & ' ');
end loop;
Put_Line ("");
Current := Header.Next;
end loop;
end if;
end Print_Info;
------------------
-- Storage_Size --
------------------
function Storage_Size (Pool : Debug_Pool) return Storage_Count is
pragma Unreferenced (Pool);
begin
return Storage_Count'Last;
end Storage_Size;
---------------
-- Configure --
---------------
procedure Configure
(Pool : in out Debug_Pool;
Stack_Trace_Depth : Natural := Default_Stack_Trace_Depth;
Maximum_Logically_Freed_Memory : SSC := Default_Max_Freed;
Minimum_To_Free : SSC := Default_Min_Freed;
Reset_Content_On_Free : Boolean := Default_Reset_Content;
Raise_Exceptions : Boolean := Default_Raise_Exceptions;
Advanced_Scanning : Boolean := Default_Advanced_Scanning)
is
begin
Pool.Stack_Trace_Depth := Stack_Trace_Depth;
Pool.Maximum_Logically_Freed_Memory := Maximum_Logically_Freed_Memory;
Pool.Reset_Content_On_Free := Reset_Content_On_Free;
Pool.Raise_Exceptions := Raise_Exceptions;
Pool.Minimum_To_Free := Minimum_To_Free;
Pool.Advanced_Scanning := Advanced_Scanning;
end Configure;
----------------
-- Print_Pool --
----------------
procedure Print_Pool (A : System.Address) is
Storage : constant Address := A;
Valid : constant Boolean := Is_Valid (Storage);
Header : Allocation_Header_Access;
begin
-- We might get Null_Address if the call from gdb was done
-- incorrectly. For instance, doing a "print_pool(my_var)" passes 0x0,
-- instead of passing the value of my_var
if A = System.Null_Address then
Put_Line ("Memory not under control of the storage pool");
return;
end if;
if not Valid then
Put_Line ("Memory not under control of the storage pool");
else
Header := Header_Of (Storage);
Put_Line ("0x" & Address_Image (A)
& " allocated at:");
Put_Line (0, Header.Alloc_Traceback.Traceback);
if To_Traceback (Header.Dealloc_Traceback) /= null then
Put_Line ("0x" & Address_Image (A)
& " logically freed memory, deallocated at:");
Put_Line (0, To_Traceback (Header.Dealloc_Traceback).Traceback);
end if;
end if;
end Print_Pool;
-----------------------
-- Print_Info_Stdout --
-----------------------
procedure Print_Info_Stdout
(Pool : Debug_Pool;
Cumulate : Boolean := False;
Display_Slots : Boolean := False;
Display_Leaks : Boolean := False)
is
procedure Internal is new Print_Info
(Put_Line => GNAT.IO.Put_Line,
Put => GNAT.IO.Put);
begin
Internal (Pool, Cumulate, Display_Slots, Display_Leaks);
end Print_Info_Stdout;
------------------
-- Dump_Gnatmem --
------------------
procedure Dump_Gnatmem (Pool : Debug_Pool; File_Name : String) is
type File_Ptr is new System.Address;
function fopen (Path : String; Mode : String) return File_Ptr;
pragma Import (C, fopen);
procedure fwrite
(Ptr : System.Address;
Size : size_t;
Nmemb : size_t;
Stream : File_Ptr);
procedure fwrite
(Str : String;
Size : size_t;
Nmemb : size_t;
Stream : File_Ptr);
pragma Import (C, fwrite);
procedure fputc (C : Integer; Stream : File_Ptr);
pragma Import (C, fputc);
procedure fclose (Stream : File_Ptr);
pragma Import (C, fclose);
Address_Size : constant size_t :=
System.Address'Max_Size_In_Storage_Elements;
-- Size in bytes of a pointer
File : File_Ptr;
Current : System.Address;
Header : Allocation_Header_Access;
Actual_Size : size_t;
Num_Calls : Integer;
Tracebk : Tracebacks_Array_Access;
begin
File := fopen (File_Name & ASCII.NUL, "wb" & ASCII.NUL);
fwrite ("GMEM DUMP" & ASCII.LF, 10, 1, File);
-- List of not deallocated blocks (see Print_Info)
Current := Pool.First_Used_Block;
while Current /= System.Null_Address loop
Header := Header_Of (Current);
Actual_Size := size_t (Header.Block_Size);
Tracebk := Header.Alloc_Traceback.Traceback;
Num_Calls := Tracebk'Length;
-- (Code taken from memtrack.adb in GNAT's sources)
-- Logs allocation call using the format:
-- 'A' <mem addr> <size chunk> <len backtrace> <addr1> ... <addrn>
fputc (Character'Pos ('A'), File);
fwrite (Current'Address, Address_Size, 1, File);
fwrite (Actual_Size'Address, size_t'Max_Size_In_Storage_Elements, 1,
File);
fwrite (Num_Calls'Address, Integer'Max_Size_In_Storage_Elements, 1,
File);
for J in Tracebk'First .. Tracebk'First + Num_Calls - 1 loop
declare
Ptr : System.Address := PC_For (Tracebk (J));
begin
fwrite (Ptr'Address, Address_Size, 1, File);
end;
end loop;
Current := Header.Next;
end loop;
fclose (File);
end Dump_Gnatmem;
begin
Allocate_End;
Deallocate_End;
Dereference_End;
end GNAT.Debug_Pools;
| 35.021818 | 79 | 0.582996 |
204a6e0f51186b55d0e4d9a070aba6dab841473b | 1,866 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/ad7104a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/ad7104a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/ad7104a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- AD7104A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT THE CONSTANT TICK IS DECLARED WITHIN THE PACKAGE
-- SYSTEM, THAT ITS TYPE IS <UNIVERSAL_REAL>, AND THAT ITS VALUE
-- IS STATIC.
-- HISTORY:
-- BCB 09/10/87 CREATED ORIGINAL TEST.
WITH SYSTEM;
WITH REPORT; USE REPORT;
PROCEDURE AD7104A IS
U_TICK: CONSTANT := SYSTEM.TICK;
F : FLOAT := SYSTEM.TICK;
BEGIN
TEST ("AD7104A", "CHECK THAT THE CONSTANT TICK IS DECLARED " &
"WITHIN THE PACKAGE SYSTEM, THAT ITS TYPE IS " &
"<UNIVERSAL_REAL>, AND THAT ITS VALUE IS STATIC");
RESULT;
END AD7104A;
| 36.588235 | 79 | 0.658092 |
dff874e04433501650efadea2bf017efff50897a | 4,883 | ads | Ada | demo/adainclude/s-tasinf.ads | e3l6/SSMDev | 2929757aab3842aefd84debb2d7c3e8b28c2b340 | [
"MIT"
] | null | null | null | demo/adainclude/s-tasinf.ads | e3l6/SSMDev | 2929757aab3842aefd84debb2d7c3e8b28c2b340 | [
"MIT"
] | null | null | null | demo/adainclude/s-tasinf.ads | e3l6/SSMDev | 2929757aab3842aefd84debb2d7c3e8b28c2b340 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . T A S K _ I N F O --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2014, 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. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the definitions and routines associated with the
-- implementation and use of the Task_Info pragma. It is specialized
-- appropriately for targets that make use of this pragma.
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
-- The functionality in this unit is now provided by the predefined package
-- System.Multiprocessors and the CPU aspect. This package is obsolescent.
package System.Task_Info is
pragma Obsolescent (Task_Info, "use System.Multiprocessors and CPU aspect");
pragma Preelaborate;
pragma Elaborate_Body;
-- To ensure that a body is allowed
-----------------------------------------
-- Implementation of Task_Info Feature --
-----------------------------------------
-- The Task_Info pragma:
-- pragma Task_Info (EXPRESSION);
-- allows the specification on a task by task basis of a value of type
-- System.Task_Info.Task_Info_Type to be passed to a task when it is
-- created. The specification of this type, and the effect on the task
-- that is created is target dependent.
-- The Task_Info pragma appears within a task definition (compare the
-- definition and implementation of pragma Priority). If no such pragma
-- appears, then the value Unspecified_Task_Info is passed. If a pragma
-- is present, then it supplies an alternative value. If the argument of
-- the pragma is a discriminant reference, then the value can be set on
-- a task by task basis by supplying the appropriate discriminant value.
-- Note that this means that the type used for Task_Info_Type must be
-- suitable for use as a discriminant (i.e. a scalar or access type).
------------------
-- Declarations --
------------------
type Scope_Type is
(Process_Scope,
-- Contend only with threads in same process
System_Scope,
-- Contend with all threads on same CPU
Default_Scope);
type Task_Info_Type is new Scope_Type;
-- Type used for passing information to task create call, using the
-- Task_Info pragma. This type may be specialized for individual
-- implementations, but it must be a type that can be used as a
-- discriminant (i.e. a scalar or access type).
Unspecified_Task_Info : constant Task_Info_Type := Default_Scope;
-- Value passed to task in the absence of a Task_Info pragma
end System.Task_Info;
| 51.946809 | 79 | 0.499283 |
fb13afe5af7edce57c29751b74d9e9196ced2fda | 2,110 | adb | Ada | 4-high/gel/applet/demo/sprite/drop_ball_on_box/launch_drop_ball_on_box.adb | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 20 | 2015-11-04T09:23:59.000Z | 2022-01-14T10:21:42.000Z | 4-high/gel/applet/demo/sprite/drop_ball_on_box/launch_drop_ball_on_box.adb | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | 2 | 2015-11-04T17:05:56.000Z | 2015-12-08T03:16:13.000Z | 4-high/gel/applet/demo/sprite/drop_ball_on_box/launch_drop_ball_on_box.adb | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | 1 | 2015-12-07T12:53:52.000Z | 2015-12-07T12:53:52.000Z | with
gel.Window.setup,
gel.Applet.gui_world,
gel.Forge,
gel.Sprite,
gel.World,
gel.Camera,
Physics,
ada.Text_IO,
ada.Exceptions;
pragma unreferenced (gel.Window.setup);
procedure launch_drop_Ball_on_Box
--
-- Drops a ball onto a box 'terrain'.
--
is
use gel.Applet,
gel.Applet.gui_world,
Ada.Text_IO;
the_Applet : gel.Applet.gui_world.view := gel.Forge.new_gui_Applet ("drop Ball on Box",
space_Kind => physics.Bullet);
function gui_World return gel.World.view
is
begin
return the_Applet.World (gui_world_Id);
end gui_World;
function gui_Camera return gel.Camera.view
is
begin
return the_Applet.Camera (gui_world_Id,
gui_camera_Id);
end gui_Camera;
the_Ball : constant gel.Sprite.view := gel.Forge.new_ball_Sprite (gui_World);
the_Box : constant gel.Sprite.view := gel.Forge.new_box_Sprite (gui_World,
Mass => 0.0,
Size => (20.0, 1.0, 20.0));
begin
new_Line;
put_Line ("Use arrow keys and PgUp/PgDn to move the camera.");
new_Line;
gui_Camera.Site_is ((0.0, 2.0, 20.0)); -- Position the camera.
the_Applet.enable_simple_Dolly (in_World => gui_world_Id); -- Enable user camera control via keyboards.
the_Ball.Site_is ((0.0, 10.0, 0.0));
gui_World.Gravity_is ((0.0, -9.8, 0.0));
gui_World.add (the_Ball); -- Add ball.
gui_World.add (the_Box); -- Add box.
while the_Applet.is_open
loop
the_Applet.freshen; -- Handle any new events and update the screen.
end loop;
free (the_Applet);
exception
when E : others =>
new_Line;
put_Line ("Unhandled exception in main task ...");
put_Line (ada.Exceptions.exception_Information (E));
new_Line;
end launch_drop_Ball_on_Box;
| 27.402597 | 110 | 0.56019 |
cbe9a7ac97d4881cff158a4697547d7c151037cc | 848 | ads | Ada | src/ada-pulse/src/pulse-rtclock.ads | mstewartgallus/linted | 4d4cf9390353ea045b95671474ab278456793a35 | [
"Apache-2.0"
] | null | null | null | src/ada-pulse/src/pulse-rtclock.ads | mstewartgallus/linted | 4d4cf9390353ea045b95671474ab278456793a35 | [
"Apache-2.0"
] | null | null | null | src/ada-pulse/src/pulse-rtclock.ads | mstewartgallus/linted | 4d4cf9390353ea045b95671474ab278456793a35 | [
"Apache-2.0"
] | null | null | null | -- Copyright 2016 Steven Stewart-Gallus
--
-- 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 Pulse.Sample;
package Pulse.Rtclock with
Spark_Mode => Off is
function pa_rtclock_now
return Pulse.Sample.pa_usec_t; -- /usr/include/pulse/rtclock.h:36
pragma Import (C, pa_rtclock_now, "pa_rtclock_now");
end Pulse.Rtclock;
| 35.333333 | 71 | 0.742925 |
1c24e516097fd4e1c44a91584b085ad98008367c | 3,340 | adb | Ada | src/servlet-routes-servlets.adb | jquorning/ada-servlet | 97db5fcdd59e01441c717b95a9e081aa7d6a7bbe | [
"Apache-2.0"
] | 6 | 2018-01-04T07:19:46.000Z | 2020-12-27T14:49:44.000Z | src/servlet-routes-servlets.adb | jquorning/ada-servlet | 97db5fcdd59e01441c717b95a9e081aa7d6a7bbe | [
"Apache-2.0"
] | 9 | 2020-12-20T15:29:18.000Z | 2022-02-04T20:13:58.000Z | src/servlet-routes-servlets.adb | jquorning/ada-servlet | 97db5fcdd59e01441c717b95a9e081aa7d6a7bbe | [
"Apache-2.0"
] | 2 | 2021-01-06T08:32:38.000Z | 2022-01-24T23:46:36.000Z | -----------------------------------------------------------------------
-- servlet-routes -- Request routing
-- Copyright (C) 2015, 2019 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
package body Servlet.Routes.Servlets is
use type Servlet.Filters.Filter_Access;
use type Servlet.Filters.Filter_List_Access;
procedure Free is
new Ada.Unchecked_Deallocation (Object => Servlet.Filters.Filter_List,
Name => Servlet.Filters.Filter_List_Access);
-- ------------------------------
-- Get the servlet to call for the route.
-- ------------------------------
function Get_Servlet (Route : in Servlet_Route_Type) return Servlet.Core.Servlet_Access is
begin
return Route.Servlet;
end Get_Servlet;
-- ------------------------------
-- Append the filter to the filter list defined by the mapping node.
-- ------------------------------
procedure Append_Filter (Route : in out Servlet_Route_Type;
Filter : in Servlet.Filters.Filter_Access) is
List : Servlet.Filters.Filter_List_Access;
begin
-- Filters are executed through the <b>Filter_Chain.Do_Filter</b> method
-- starting from the last position to the first. To append a filter,
-- it must be inserted as first position of the list.
if Route.Filters = null then
List := new Servlet.Filters.Filter_List (1 .. 1);
else
-- Check that the filter is not already executed.
for I in Route.Filters'Range loop
if Route.Filters (I) = Filter then
return;
end if;
end loop;
List := new Servlet.Filters.Filter_List (1 .. Route.Filters'Last + 1);
List (2 .. List'Last) := Route.Filters.all;
Free (Route.Filters);
end if;
List (List'First) := Filter;
Route.Filters := List;
end Append_Filter;
-- ------------------------------
-- Release the storage held by the route.
-- ------------------------------
overriding
procedure Finalize (Route : in out Servlet_Route_Type) is
begin
Free (Route.Filters);
end Finalize;
-- ------------------------------
-- Get the servlet to call for the route.
-- ------------------------------
overriding
function Get_Servlet (Route : in Proxy_Route_Type) return Servlet.Core.Servlet_Access is
begin
if not Route.Route.Is_Null then
return Servlet_Route_Type'Class (Route.Route.Value.Element.all).Get_Servlet;
else
return Route.Servlet;
end if;
end Get_Servlet;
end Servlet.Routes.Servlets;
| 38.390805 | 93 | 0.58503 |
23d31f7b9b5a54818634449e049301ec84099845 | 5,092 | adb | Ada | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-tiflio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-tiflio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-tiflio.adb | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T E X T _ I O . F L O A T _ I O --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, 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 Ada.Text_IO.Float_Aux;
package body Ada.Text_IO.Float_IO is
package Aux renames Ada.Text_IO.Float_Aux;
---------
-- Get --
---------
procedure Get
(File : File_Type;
Item : out Num;
Width : Field := 0)
is
pragma Unsuppress (Range_Check);
begin
Aux.Get (File, Long_Long_Float (Item), Width);
-- In the case where the type is unconstrained (e.g. Standard'Float),
-- the above conversion may result in an infinite value, which is
-- normally fine for a conversion, but in this case, we want to treat
-- that as a data error.
if not Item'Valid then
raise Data_Error;
end if;
exception
when Constraint_Error => raise Data_Error;
end Get;
procedure Get
(Item : out Num;
Width : Field := 0)
is
pragma Unsuppress (Range_Check);
begin
Aux.Get (Current_In, Long_Long_Float (Item), Width);
-- In the case where the type is unconstrained (e.g. Standard'Float),
-- the above conversion may result in an infinite value, which is
-- normally fine for a conversion, but in this case, we want to treat
-- that as a data error.
if not Item'Valid then
raise Data_Error;
end if;
exception
when Constraint_Error => raise Data_Error;
end Get;
procedure Get
(From : String;
Item : out Num;
Last : out Positive)
is
pragma Unsuppress (Range_Check);
begin
Aux.Gets (From, Long_Long_Float (Item), Last);
-- In the case where the type is unconstrained (e.g. Standard'Float),
-- the above conversion may result in an infinite value, which is
-- normally fine for a conversion, but in this case, we want to treat
-- that as a data error.
if not Item'Valid then
raise Data_Error;
end if;
exception
when Constraint_Error => raise Data_Error;
end Get;
---------
-- Put --
---------
procedure Put
(File : File_Type;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
Aux.Put (File, Long_Long_Float (Item), Fore, Aft, Exp);
end Put;
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
Aux.Put (Current_Out, Long_Long_Float (Item), Fore, Aft, Exp);
end Put;
procedure Put
(To : out String;
Item : Num;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
Aux.Puts (To, Long_Long_Float (Item), Aft, Exp);
end Put;
end Ada.Text_IO.Float_IO;
| 34.876712 | 78 | 0.489199 |
2321936440dfa8ff7edb3f4ce24324f8c3860b75 | 7,496 | adb | Ada | source/web-ui-widgets-combo_boxes.adb | godunko/adawebui | ee524325fe701ef0a655cd0624e0ba701f0e8955 | [
"BSD-3-Clause"
] | 2 | 2020-01-31T07:00:09.000Z | 2021-06-25T15:50:00.000Z | source/web-ui-widgets-combo_boxes.adb | godunko/adawebui | ee524325fe701ef0a655cd0624e0ba701f0e8955 | [
"BSD-3-Clause"
] | null | null | null | source/web-ui-widgets-combo_boxes.adb | godunko/adawebui | ee524325fe701ef0a655cd0624e0ba701f0e8955 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- 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: 5761 $ $Date: 2017-05-20 11:06:31 +0300 (Sat, 20 May 2017) $
------------------------------------------------------------------------------
package body Web.UI.Widgets.Combo_Boxes is
------------------
-- Constructors --
------------------
package body Constructors is
-- type Combo_Box_Internal_Access is access all Abstract_Combo_Box'Class;
-- ------------
-- -- Create --
-- ------------
--
-- function Create
-- (Element :
-- not null WebAPI.HTML.Select_Elements.HTML_Select_Element_Access)
-- return not null Combo_Box_Access
-- is
-- Result : constant not null Combo_Box_Internal_Access
-- := new Combo_Box;
--
-- begin
-- Initialize (Result.all, Element);
--
-- return Combo_Box_Access (Result);
-- end Create;
--
-- ------------
-- -- Create --
-- ------------
--
-- function Create
-- (Id : League.Strings.Universal_String)
-- return not null Combo_Box_Access is
-- begin
-- return
-- Create
-- (WebAPI.HTML.Select_Elements.HTML_Select_Element_Access
-- (WebAPI.HTML.Globals.Window.Get_Document.Get_Element_By_Id
-- (Id)));
-- end Create;
----------------
-- Initialize --
----------------
procedure Initialize
(Self : in out Abstract_Combo_Box'Class;
Element : Web.HTML.Selects.HTML_Select_Element'Class) is
begin
Web.UI.Widgets.Constructors.Initialize (Self, Element);
end Initialize;
end Constructors;
------------------
-- Change_Event --
------------------
overriding procedure Change_Event (Self : in out Abstract_Combo_Box) is
begin
Self.Current_Index_Changed.Emit
(Integer (Self.Element.As_HTML_Select.Get_Selected_Index + 1));
end Change_Event;
-- -------------------
-- -- Current_Index --
-- -------------------
--
-- function Current_Index
-- (Self : in out Combo_Box'Class)
-- return League.Strings.Universal_String
-- is
-- Input : constant WebAPI.HTML.Select_Elements.HTML_Select_Element_Access
-- := WebAPI.HTML.Select_Elements.HTML_Select_Element_Access
-- (Self.Element);
--
-- begin
-- return Input.Get_Value;
-- end Current_Index;
----------------------------------
-- Current_Index_Changed_Signal --
----------------------------------
not overriding function Current_Index_Changed_Signal
(Self : in out Abstract_Combo_Box)
return not null access Web.UI.Integer_Slots.Signal'Class is
begin
return Self.Current_Index_Changed'Unchecked_Access;
end Current_Index_Changed_Signal;
-- -----------------
-- -- Input_Event --
-- -----------------
--
-- overriding procedure Input_Event (Self : in out Combo_Box) is
-- Input : constant WebAPI.HTML.Select_Elements.HTML_Select_Element_Access
-- := WebAPI.HTML.Select_Elements.HTML_Select_Element_Access
-- (Self.Element);
--
-- begin
-- Self.Current_Index_Changed.Emit (Input.Get_Value);
-- end Input_Event;
--
-- -----------------------
-- -- Set_Current_Index --
-- -----------------------
--
-- not overriding procedure Set_Current_Index
-- (Self : in out Combo_Box;
-- To : League.Strings.Universal_String)
-- is
-- use type League.Strings.Universal_String;
--
-- Input : constant WebAPI.HTML.Select_Elements.HTML_Select_Element_Access
-- := WebAPI.HTML.Select_Elements.HTML_Select_Element_Access
-- (Self.Element);
--
-- begin
-- if Input.Get_Value /= To then
-- Input.Set_Value (To);
-- Self.Current_Index_Changed.Emit (Input.Get_Value);
-- -- 'input' event is not send when value is updated programmatically.
-- end if;
-- end Set_Current_Index;
------------------
-- Set_Disabled --
------------------
overriding procedure Set_Disabled
(Self : in out Abstract_Combo_Box;
Disabled : Boolean := True)
is
Element : Web.HTML.Selects.HTML_Select_Element
:= Self.Element.As_HTML_Select;
begin
Element.Set_Disabled (Disabled);
end Set_Disabled;
end Web.UI.Widgets.Combo_Boxes;
| 39.661376 | 80 | 0.491329 |
1cc2f9574627085f5bd4d9dc50c2b2b901506bd0 | 4,012 | ads | Ada | source/streams/a-snsisf.ads | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 33 | 2015-04-04T09:19:36.000Z | 2021-11-10T05:33:34.000Z | source/streams/a-snsisf.ads | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 8 | 2017-11-14T13:05:07.000Z | 2018-08-09T15:28:49.000Z | source/streams/a-snsisf.ads | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 9 | 2015-02-03T17:09:53.000Z | 2021-11-12T01:16:05.000Z | pragma License (Unrestricted);
-- implementation unit
package Ada.Streams.Naked_Stream_IO.Standard_Files is
pragma Elaborate_Body;
Standard_Input : aliased constant Non_Controlled_File_Type;
Standard_Output : aliased constant Non_Controlled_File_Type;
Standard_Error : aliased constant Non_Controlled_File_Type;
private
Standard_Input_Name : aliased System.Native_IO.Name_String (0 .. 6) := (
System.Native_IO.Name_Character'Val (Character'Pos ('*')),
System.Native_IO.Name_Character'Val (Character'Pos ('s')),
System.Native_IO.Name_Character'Val (Character'Pos ('t')),
System.Native_IO.Name_Character'Val (Character'Pos ('d')),
System.Native_IO.Name_Character'Val (Character'Pos ('i')),
System.Native_IO.Name_Character'Val (Character'Pos ('n')),
System.Native_IO.Name_Character'Val (0));
Standard_Input_Stream : aliased Stream_Type := (
Handle => System.Native_IO.Uninitialized_Standard_Input,
Mode => System.Native_IO.Read_Only_Mode,
Name => Standard_Input_Name (0)'Access,
Form => Default_Form,
Kind => Standard_Handle,
Has_Full_Name => False,
Buffer_Inline => 0,
Buffer => System.Null_Address,
Buffer_Length => Uninitialized_Buffer,
Buffer_Index => 0,
Reading_Index => 0,
Writing_Index => 0,
Closer => null,
Dispatcher => (Tags.No_Tag, null));
Standard_Output_Name : aliased System.Native_IO.Name_String (0 .. 7) := (
System.Native_IO.Name_Character'Val (Character'Pos ('*')),
System.Native_IO.Name_Character'Val (Character'Pos ('s')),
System.Native_IO.Name_Character'Val (Character'Pos ('t')),
System.Native_IO.Name_Character'Val (Character'Pos ('d')),
System.Native_IO.Name_Character'Val (Character'Pos ('o')),
System.Native_IO.Name_Character'Val (Character'Pos ('u')),
System.Native_IO.Name_Character'Val (Character'Pos ('t')),
System.Native_IO.Name_Character'Val (0));
Standard_Output_Stream : aliased Stream_Type := (
Handle => System.Native_IO.Uninitialized_Standard_Output,
Mode => System.Native_IO.Write_Only_Mode,
Name => Standard_Output_Name (0)'Access,
Form => Default_Form,
Kind => Standard_Handle,
Has_Full_Name => False,
Buffer_Inline => 0,
Buffer => System.Null_Address,
Buffer_Length => Uninitialized_Buffer,
Buffer_Index => 0,
Reading_Index => 0,
Writing_Index => 0,
Closer => null,
Dispatcher => (Tags.No_Tag, null));
Standard_Error_Name : aliased System.Native_IO.Name_String (0 .. 7) := (
System.Native_IO.Name_Character'Val (Character'Pos ('*')),
System.Native_IO.Name_Character'Val (Character'Pos ('s')),
System.Native_IO.Name_Character'Val (Character'Pos ('t')),
System.Native_IO.Name_Character'Val (Character'Pos ('d')),
System.Native_IO.Name_Character'Val (Character'Pos ('e')),
System.Native_IO.Name_Character'Val (Character'Pos ('r')),
System.Native_IO.Name_Character'Val (Character'Pos ('r')),
System.Native_IO.Name_Character'Val (0));
Standard_Error_Stream : aliased Stream_Type := (
Handle => System.Native_IO.Uninitialized_Standard_Error,
Mode => System.Native_IO.Write_Only_Mode,
Name => Standard_Error_Name (0)'Access,
Form => Default_Form,
Kind => Standard_Handle,
Has_Full_Name => False,
Buffer_Inline => 0,
Buffer => System.Null_Address,
Buffer_Length => Uninitialized_Buffer,
Buffer_Index => 0,
Reading_Index => 0,
Writing_Index => 0,
Closer => null,
Dispatcher => (Tags.No_Tag, null));
Standard_Input : aliased constant Non_Controlled_File_Type :=
Standard_Input_Stream'Access;
Standard_Output : aliased constant Non_Controlled_File_Type :=
Standard_Output_Stream'Access;
Standard_Error : aliased constant Non_Controlled_File_Type :=
Standard_Error_Stream'Access;
end Ada.Streams.Naked_Stream_IO.Standard_Files;
| 41.360825 | 76 | 0.691924 |
39d1f852fbd601a5ea9f83ba6346fe6fd6461980 | 221 | ads | Ada | generated/natools-static_hash_maps-s_expressions-command_maps-test.ads | faelys/natools | 947c004e6f69ca144942c6af40e102d089223cf8 | [
"0BSD"
] | null | null | null | generated/natools-static_hash_maps-s_expressions-command_maps-test.ads | faelys/natools | 947c004e6f69ca144942c6af40e102d089223cf8 | [
"0BSD"
] | null | null | null | generated/natools-static_hash_maps-s_expressions-command_maps-test.ads | faelys/natools | 947c004e6f69ca144942c6af40e102d089223cf8 | [
"0BSD"
] | null | null | null | -- Generated at 2014-11-09 20:46:38 +0000 by Natools.Static_Hash_Maps
-- from src/natools-static_hash_maps-s_expressions-hash_maps.sx
function Natools.Static_Hash_Maps.S_Expressions.Command_Maps.Test
return Boolean;
| 36.833333 | 70 | 0.819005 |
dcc16fc40494b92d3aa88dddaba09a40b7cfc3d7 | 1,378 | ads | Ada | tier-1/xcb/source/thin/xcb-xcb_glx_is_enabled_cookie_t.ads | charlie5/cBound | 741be08197a61ad9c72553e3302f3b669902216d | [
"0BSD"
] | 2 | 2015-11-12T11:16:20.000Z | 2021-08-24T22:32:04.000Z | tier-1/xcb/source/thin/xcb-xcb_glx_is_enabled_cookie_t.ads | charlie5/cBound | 741be08197a61ad9c72553e3302f3b669902216d | [
"0BSD"
] | 1 | 2018-06-05T05:19:35.000Z | 2021-11-20T01:13:23.000Z | tier-1/xcb/source/thin/xcb-xcb_glx_is_enabled_cookie_t.ads | charlie5/cBound | 741be08197a61ad9c72553e3302f3b669902216d | [
"0BSD"
] | null | null | null | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces.C;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_glx_is_enabled_cookie_t is
-- Item
--
type Item is record
sequence : aliased Interfaces.C.unsigned;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_is_enabled_cookie_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_is_enabled_cookie_t.Item,
Element_Array => xcb.xcb_glx_is_enabled_cookie_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_glx_is_enabled_cookie_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_is_enabled_cookie_t.Pointer,
Element_Array => xcb.xcb_glx_is_enabled_cookie_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_is_enabled_cookie_t;
| 26 | 74 | 0.664006 |
23ae6cf3466f03fc1a7914f43557bd56ca5f26dd | 914 | adb | Ada | src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/str_uninit/pck.adb | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 31 | 2018-08-01T21:25:24.000Z | 2022-02-14T07:52:34.000Z | src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/str_uninit/pck.adb | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 40 | 2018-12-03T19:48:52.000Z | 2021-03-10T06:34:26.000Z | src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/str_uninit/pck.adb | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 20 | 2018-11-16T21:19:22.000Z | 2021-10-18T23:08:24.000Z | -- Copyright 2011-2016 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pck is
procedure Do_Nothing (A : System.Address) is
begin
null;
end Do_Nothing;
function Foos return String is
begin
return "string";
end Foos;
end Pck;
| 31.517241 | 73 | 0.718818 |
cb7bf3bd9181a9b238f92e3d39ac805d3c0b8f73 | 6,922 | adb | Ada | tests/factions-test_data-tests.adb | thindil/steamsky | d5d7fea622f7994c91017c4cd7ba5e188153556c | [
"TCL",
"MIT"
] | 80 | 2017-04-08T23:14:07.000Z | 2022-02-10T22:30:51.000Z | tests/factions-test_data-tests.adb | thindil/steamsky | d5d7fea622f7994c91017c4cd7ba5e188153556c | [
"TCL",
"MIT"
] | 89 | 2017-06-24T08:18:26.000Z | 2021-11-12T04:37:36.000Z | tests/factions-test_data-tests.adb | thindil/steamsky | d5d7fea622f7994c91017c4cd7ba5e188153556c | [
"TCL",
"MIT"
] | 9 | 2018-04-14T16:37:25.000Z | 2020-03-21T14:33:49.000Z | -- This package has been generated automatically by GNATtest.
-- You are allowed to add your code to the bodies of test routines.
-- Such changes will be kept during further regeneration of this file.
-- All code placed outside of test routine bodies will be lost. The
-- code intended to set up and tear down the test environment should be
-- placed into Factions.Test_Data.
with AUnit.Assertions; use AUnit.Assertions;
with System.Assertions;
-- begin read only
-- id:2.2/00/
--
-- This section can be used to add with clauses if necessary.
--
-- end read only
-- begin read only
-- end read only
package body Factions.Test_Data.Tests is
-- begin read only
-- id:2.2/01/
--
-- This section can be used to add global variables and other elements.
--
-- end read only
-- begin read only
-- end read only
-- begin read only
function Wrap_Test_GetReputation_f138bb_ad6480
(SourceFaction, TargetFaction: Unbounded_String) return Integer is
begin
begin
pragma Assert
((Factions_List.Contains(SourceFaction) and
Factions_List.Contains(TargetFaction)));
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(factions.ads:0):Test_GetReputation test requirement violated");
end;
declare
Test_GetReputation_f138bb_ad6480_Result: constant Integer :=
GNATtest_Generated.GNATtest_Standard.Factions.GetReputation
(SourceFaction, TargetFaction);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(factions.ads:0:):Test_GetReputation test commitment violated");
end;
return Test_GetReputation_f138bb_ad6480_Result;
end;
end Wrap_Test_GetReputation_f138bb_ad6480;
-- end read only
-- begin read only
procedure Test_GetReputation_test_getreputation(Gnattest_T: in out Test);
procedure Test_GetReputation_f138bb_ad6480(Gnattest_T: in out Test) renames
Test_GetReputation_test_getreputation;
-- id:2.2/f138bbb5c8b2b971/GetReputation/1/0/test_getreputation/
procedure Test_GetReputation_test_getreputation(Gnattest_T: in out Test) is
function GetReputation
(SourceFaction, TargetFaction: Unbounded_String) return Integer renames
Wrap_Test_GetReputation_f138bb_ad6480;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Assert
(GetReputation
(To_Unbounded_String("POLEIS"), To_Unbounded_String("POLEIS")) =
0,
"Failed to get reputation for Poleis to Poleis.");
Assert
(GetReputation
(To_Unbounded_String("POLEIS"), To_Unbounded_String("PIRATES")) =
-10,
"Failed to get reputation for Poleis to Pirates.");
-- begin read only
end Test_GetReputation_test_getreputation;
-- end read only
-- begin read only
function Wrap_Test_IsFriendly_868bec_4ae8b6
(SourceFaction, TargetFaction: Unbounded_String) return Boolean is
begin
begin
pragma Assert
((Factions_List.Contains(SourceFaction) and
Factions_List.Contains(TargetFaction)));
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"req_sloc(factions.ads:0):Test_IsFriendly test requirement violated");
end;
declare
Test_IsFriendly_868bec_4ae8b6_Result: constant Boolean :=
GNATtest_Generated.GNATtest_Standard.Factions.IsFriendly
(SourceFaction, TargetFaction);
begin
begin
pragma Assert(True);
null;
exception
when System.Assertions.Assert_Failure =>
AUnit.Assertions.Assert
(False,
"ens_sloc(factions.ads:0:):Test_IsFriendly test commitment violated");
end;
return Test_IsFriendly_868bec_4ae8b6_Result;
end;
end Wrap_Test_IsFriendly_868bec_4ae8b6;
-- end read only
-- begin read only
procedure Test_IsFriendly_test_isfriendly(Gnattest_T: in out Test);
procedure Test_IsFriendly_868bec_4ae8b6(Gnattest_T: in out Test) renames
Test_IsFriendly_test_isfriendly;
-- id:2.2/868bec8bf6fd9c98/IsFriendly/1/0/test_isfriendly/
procedure Test_IsFriendly_test_isfriendly(Gnattest_T: in out Test) is
function IsFriendly
(SourceFaction, TargetFaction: Unbounded_String) return Boolean renames
Wrap_Test_IsFriendly_868bec_4ae8b6;
-- end read only
pragma Unreferenced(Gnattest_T);
begin
Assert
(IsFriendly
(To_Unbounded_String("POLEIS"),
To_Unbounded_String("INDEPENDENT")) =
True,
"Failed to check two friendly factions.");
Assert
(IsFriendly
(To_Unbounded_String("POLEIS"), To_Unbounded_String("PIRATES")) =
False,
"Failed to check two unfriendly factions.");
-- begin read only
end Test_IsFriendly_test_isfriendly;
-- end read only
-- begin read only
function Wrap_Test_GetRandomFaction_47dd81_103989 return Unbounded_String is
begin
declare
Test_GetRandomFaction_47dd81_103989_Result: constant Unbounded_String :=
GNATtest_Generated.GNATtest_Standard.Factions.GetRandomFaction;
begin
return Test_GetRandomFaction_47dd81_103989_Result;
end;
end Wrap_Test_GetRandomFaction_47dd81_103989;
-- end read only
-- begin read only
procedure Test_GetRandomFaction_test_getrandomfaction
(Gnattest_T: in out Test);
procedure Test_GetRandomFaction_47dd81_103989
(Gnattest_T: in out Test) renames
Test_GetRandomFaction_test_getrandomfaction;
-- id:2.2/47dd8179e978586a/GetRandomFaction/1/0/test_getrandomfaction/
procedure Test_GetRandomFaction_test_getrandomfaction
(Gnattest_T: in out Test) is
function GetRandomFaction return Unbounded_String renames
Wrap_Test_GetRandomFaction_47dd81_103989;
-- end read only
pragma Unreferenced(Gnattest_T);
FactionName: Unbounded_String := Null_Unbounded_String;
begin
FactionName := GetRandomFaction;
Assert
(FactionName /= Null_Unbounded_String,
"Failed to get random faction name. Empty name.");
Assert
(Factions_List.Contains(FactionName),
"Failed to get random faction name. Got not existing name.");
-- begin read only
end Test_GetRandomFaction_test_getrandomfaction;
-- end read only
-- begin read only
-- id:2.2/02/
--
-- This section can be used to add elaboration code for the global state.
--
begin
-- end read only
null;
-- begin read only
-- end read only
end Factions.Test_Data.Tests;
| 32.497653 | 91 | 0.689396 |
fb2dfa77ee3613cb9d55f616932fc0026b9186b1 | 919 | adb | Ada | src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/varsize_limit/pck.adb | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 31 | 2018-08-01T21:25:24.000Z | 2022-02-14T07:52:34.000Z | src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/varsize_limit/pck.adb | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 40 | 2018-12-03T19:48:52.000Z | 2021-03-10T06:34:26.000Z | src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/varsize_limit/pck.adb | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 20 | 2018-11-16T21:19:22.000Z | 2021-10-18T23:08:24.000Z | -- Copyright 2018-2019 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pck is
procedure Do_Nothing (A : System.Address) is
begin
null;
end Do_Nothing;
function Ident (S : String) return String is
begin
return S;
end Ident;
end Pck;
| 35.346154 | 73 | 0.71926 |
1ca6687e30688bcf50346e3fa60d3db2284649a3 | 42,942 | adb | Ada | source/amf/uml/amf-internals-uml_primitive_types.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/uml/amf-internals-uml_primitive_types.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/uml/amf-internals-uml_primitive_types.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Primitive_Types is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Primitive_Type_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Primitive_Type
(AMF.UML.Primitive_Types.UML_Primitive_Type_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Primitive_Type_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Primitive_Type
(AMF.UML.Primitive_Types.UML_Primitive_Type_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Primitive_Type_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Primitive_Type
(Visitor,
AMF.UML.Primitive_Types.UML_Primitive_Type_Access (Self),
Control);
end if;
end Visit_Element;
-------------------------
-- Get_Owned_Attribute --
-------------------------
overriding function Get_Owned_Attribute
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property is
begin
return
AMF.UML.Properties.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Attribute
(Self.Element)));
end Get_Owned_Attribute;
-------------------------
-- Get_Owned_Operation --
-------------------------
overriding function Get_Owned_Operation
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Operations.Collections.Ordered_Set_Of_UML_Operation is
begin
return
AMF.UML.Operations.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Operation
(Self.Element)));
end Get_Owned_Operation;
-------------------
-- Get_Attribute --
-------------------
overriding function Get_Attribute
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property is
begin
return
AMF.UML.Properties.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Attribute
(Self.Element)));
end Get_Attribute;
---------------------------
-- Get_Collaboration_Use --
---------------------------
overriding function Get_Collaboration_Use
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Collaboration_Uses.Collections.Set_Of_UML_Collaboration_Use is
begin
return
AMF.UML.Collaboration_Uses.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Collaboration_Use
(Self.Element)));
end Get_Collaboration_Use;
-----------------
-- Get_Feature --
-----------------
overriding function Get_Feature
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature is
begin
return
AMF.UML.Features.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Feature
(Self.Element)));
end Get_Feature;
-----------------
-- Get_General --
-----------------
overriding function Get_General
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_General
(Self.Element)));
end Get_General;
------------------------
-- Get_Generalization --
------------------------
overriding function Get_Generalization
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization is
begin
return
AMF.UML.Generalizations.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Generalization
(Self.Element)));
end Get_Generalization;
--------------------------
-- Get_Inherited_Member --
--------------------------
overriding function Get_Inherited_Member
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Inherited_Member
(Self.Element)));
end Get_Inherited_Member;
---------------------
-- Get_Is_Abstract --
---------------------
overriding function Get_Is_Abstract
(Self : not null access constant UML_Primitive_Type_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Abstract
(Self.Element);
end Get_Is_Abstract;
---------------------------------
-- Get_Is_Final_Specialization --
---------------------------------
overriding function Get_Is_Final_Specialization
(Self : not null access constant UML_Primitive_Type_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Final_Specialization
(Self.Element);
end Get_Is_Final_Specialization;
---------------------------------
-- Set_Is_Final_Specialization --
---------------------------------
overriding procedure Set_Is_Final_Specialization
(Self : not null access UML_Primitive_Type_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Final_Specialization
(Self.Element, To);
end Set_Is_Final_Specialization;
----------------------------------
-- Get_Owned_Template_Signature --
----------------------------------
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access is
begin
return
AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Template_Signature
(Self.Element)));
end Get_Owned_Template_Signature;
----------------------------------
-- Set_Owned_Template_Signature --
----------------------------------
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Primitive_Type_Proxy;
To : AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owned_Template_Signature
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owned_Template_Signature;
------------------------
-- Get_Owned_Use_Case --
------------------------
overriding function Get_Owned_Use_Case
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is
begin
return
AMF.UML.Use_Cases.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Use_Case
(Self.Element)));
end Get_Owned_Use_Case;
--------------------------
-- Get_Powertype_Extent --
--------------------------
overriding function Get_Powertype_Extent
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Generalization_Sets.Collections.Set_Of_UML_Generalization_Set is
begin
return
AMF.UML.Generalization_Sets.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Powertype_Extent
(Self.Element)));
end Get_Powertype_Extent;
------------------------------
-- Get_Redefined_Classifier --
------------------------------
overriding function Get_Redefined_Classifier
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Classifier
(Self.Element)));
end Get_Redefined_Classifier;
------------------------
-- Get_Representation --
------------------------
overriding function Get_Representation
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access is
begin
return
AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Representation
(Self.Element)));
end Get_Representation;
------------------------
-- Set_Representation --
------------------------
overriding procedure Set_Representation
(Self : not null access UML_Primitive_Type_Proxy;
To : AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Representation
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Representation;
----------------------
-- Get_Substitution --
----------------------
overriding function Get_Substitution
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Substitutions.Collections.Set_Of_UML_Substitution is
begin
return
AMF.UML.Substitutions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Substitution
(Self.Element)));
end Get_Substitution;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access is
begin
return
AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Primitive_Type_Proxy;
To : AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
------------------
-- Get_Use_Case --
------------------
overriding function Get_Use_Case
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is
begin
return
AMF.UML.Use_Cases.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Use_Case
(Self.Element)));
end Get_Use_Case;
------------------------
-- Get_Element_Import --
------------------------
overriding function Get_Element_Import
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import is
begin
return
AMF.UML.Element_Imports.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Element_Import
(Self.Element)));
end Get_Element_Import;
-------------------------
-- Get_Imported_Member --
-------------------------
overriding function Get_Imported_Member
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
return
AMF.UML.Packageable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Imported_Member
(Self.Element)));
end Get_Imported_Member;
----------------
-- Get_Member --
----------------
overriding function Get_Member
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Member
(Self.Element)));
end Get_Member;
----------------------
-- Get_Owned_Member --
----------------------
overriding function Get_Owned_Member
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Member
(Self.Element)));
end Get_Owned_Member;
--------------------
-- Get_Owned_Rule --
--------------------
overriding function Get_Owned_Rule
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Rule
(Self.Element)));
end Get_Owned_Rule;
------------------------
-- Get_Package_Import --
------------------------
overriding function Get_Package_Import
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import is
begin
return
AMF.UML.Package_Imports.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Package_Import
(Self.Element)));
end Get_Package_Import;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Primitive_Type_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------
-- Get_Package --
-----------------
overriding function Get_Package
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Packages.UML_Package_Access is
begin
return
AMF.UML.Packages.UML_Package_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Package
(Self.Element)));
end Get_Package;
-----------------
-- Set_Package --
-----------------
overriding procedure Set_Package
(Self : not null access UML_Primitive_Type_Proxy;
To : AMF.UML.Packages.UML_Package_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Package
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Package;
-----------------------------------
-- Get_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter
(Self.Element)));
end Get_Owning_Template_Parameter;
-----------------------------------
-- Set_Owning_Template_Parameter --
-----------------------------------
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Primitive_Type_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owning_Template_Parameter;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Primitive_Type_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
----------------------------------
-- Get_Owned_Template_Signature --
----------------------------------
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Template_Signatures.UML_Template_Signature_Access is
begin
return
AMF.UML.Template_Signatures.UML_Template_Signature_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Template_Signature
(Self.Element)));
end Get_Owned_Template_Signature;
----------------------------------
-- Set_Owned_Template_Signature --
----------------------------------
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Primitive_Type_Proxy;
To : AMF.UML.Template_Signatures.UML_Template_Signature_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owned_Template_Signature
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owned_Template_Signature;
--------------------------
-- Get_Template_Binding --
--------------------------
overriding function Get_Template_Binding
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding is
begin
return
AMF.UML.Template_Bindings.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Binding
(Self.Element)));
end Get_Template_Binding;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Primitive_Type_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
(Self.Element);
end Get_Is_Leaf;
-----------------
-- Set_Is_Leaf --
-----------------
overriding procedure Set_Is_Leaf
(Self : not null access UML_Primitive_Type_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
(Self.Element, To);
end Set_Is_Leaf;
---------------------------
-- Get_Redefined_Element --
---------------------------
overriding function Get_Redefined_Element
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
begin
return
AMF.UML.Redefinable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
(Self.Element)));
end Get_Redefined_Element;
------------------------------
-- Get_Redefinition_Context --
------------------------------
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
-------------
-- Inherit --
-------------
overriding function Inherit
(Self : not null access constant UML_Primitive_Type_Proxy;
Inhs : AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inherit unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Inherit";
return Inherit (Self, Inhs);
end Inherit;
------------------
-- All_Features --
------------------
overriding function All_Features
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Features unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.All_Features";
return All_Features (Self);
end All_Features;
-----------------
-- Conforms_To --
-----------------
overriding function Conforms_To
(Self : not null access constant UML_Primitive_Type_Proxy;
Other : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Conforms_To unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Conforms_To";
return Conforms_To (Self, Other);
end Conforms_To;
-------------
-- General --
-------------
overriding function General
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "General unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.General";
return General (Self);
end General;
-----------------------
-- Has_Visibility_Of --
-----------------------
overriding function Has_Visibility_Of
(Self : not null access constant UML_Primitive_Type_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Has_Visibility_Of unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Has_Visibility_Of";
return Has_Visibility_Of (Self, N);
end Has_Visibility_Of;
-------------------------
-- Inheritable_Members --
-------------------------
overriding function Inheritable_Members
(Self : not null access constant UML_Primitive_Type_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inheritable_Members unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Inheritable_Members";
return Inheritable_Members (Self, C);
end Inheritable_Members;
----------------------
-- Inherited_Member --
----------------------
overriding function Inherited_Member
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inherited_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Inherited_Member";
return Inherited_Member (Self);
end Inherited_Member;
-----------------
-- Is_Template --
-----------------
overriding function Is_Template
(Self : not null access constant UML_Primitive_Type_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Is_Template";
return Is_Template (Self);
end Is_Template;
-------------------------
-- May_Specialize_Type --
-------------------------
overriding function May_Specialize_Type
(Self : not null access constant UML_Primitive_Type_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "May_Specialize_Type unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.May_Specialize_Type";
return May_Specialize_Type (Self, C);
end May_Specialize_Type;
------------------------
-- Exclude_Collisions --
------------------------
overriding function Exclude_Collisions
(Self : not null access constant UML_Primitive_Type_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Exclude_Collisions unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Exclude_Collisions";
return Exclude_Collisions (Self, Imps);
end Exclude_Collisions;
-------------------------
-- Get_Names_Of_Member --
-------------------------
overriding function Get_Names_Of_Member
(Self : not null access constant UML_Primitive_Type_Proxy;
Element : AMF.UML.Named_Elements.UML_Named_Element_Access)
return AMF.String_Collections.Set_Of_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Get_Names_Of_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Get_Names_Of_Member";
return Get_Names_Of_Member (Self, Element);
end Get_Names_Of_Member;
--------------------
-- Import_Members --
--------------------
overriding function Import_Members
(Self : not null access constant UML_Primitive_Type_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Import_Members unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Import_Members";
return Import_Members (Self, Imps);
end Import_Members;
---------------------
-- Imported_Member --
---------------------
overriding function Imported_Member
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Imported_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Imported_Member";
return Imported_Member (Self);
end Imported_Member;
---------------------------------
-- Members_Are_Distinguishable --
---------------------------------
overriding function Members_Are_Distinguishable
(Self : not null access constant UML_Primitive_Type_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Members_Are_Distinguishable unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Members_Are_Distinguishable";
return Members_Are_Distinguishable (Self);
end Members_Are_Distinguishable;
------------------
-- Owned_Member --
------------------
overriding function Owned_Member
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Owned_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Owned_Member";
return Owned_Member (Self);
end Owned_Member;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Primitive_Type_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Namespace";
return Namespace (Self);
end Namespace;
-----------------
-- Conforms_To --
-----------------
overriding function Conforms_To
(Self : not null access constant UML_Primitive_Type_Proxy;
Other : AMF.UML.Types.UML_Type_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Conforms_To unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Conforms_To";
return Conforms_To (Self, Other);
end Conforms_To;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_Primitive_Type_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Is_Compatible_With";
return Is_Compatible_With (Self, P);
end Is_Compatible_With;
---------------------------
-- Is_Template_Parameter --
---------------------------
overriding function Is_Template_Parameter
(Self : not null access constant UML_Primitive_Type_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
----------------------------
-- Parameterable_Elements --
----------------------------
overriding function Parameterable_Elements
(Self : not null access constant UML_Primitive_Type_Proxy)
return AMF.UML.Parameterable_Elements.Collections.Set_Of_UML_Parameterable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Parameterable_Elements unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Parameterable_Elements";
return Parameterable_Elements (Self);
end Parameterable_Elements;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Primitive_Type_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Is_Consistent_With";
return Is_Consistent_With (Self, Redefinee);
end Is_Consistent_With;
-----------------------------------
-- Is_Redefinition_Context_Valid --
-----------------------------------
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Primitive_Type_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
raise Program_Error with "Unimplemented procedure UML_Primitive_Type_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
end AMF.Internals.UML_Primitive_Types;
| 37.734622 | 112 | 0.643589 |
0ebb60eb6b062d94ca05265169ad4931b1c92aa9 | 6,048 | adb | Ada | source/nodes/program-nodes-protected_body_stubs.adb | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | null | null | null | source/nodes/program-nodes-protected_body_stubs.adb | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | null | null | null | source/nodes/program-nodes-protected_body_stubs.adb | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | 2 | 2019-09-14T23:18:50.000Z | 2019-10-02T10:11:40.000Z | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Program.Nodes.Protected_Body_Stubs is
function Create
(Protected_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Body_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Separate_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Protected_Body_Stub is
begin
return Result : Protected_Body_Stub :=
(Protected_Token => Protected_Token, Body_Token => Body_Token,
Name => Name, Is_Token => Is_Token, Separate_Token => Separate_Token,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Protected_Body_Stub is
begin
return Result : Implicit_Protected_Body_Stub :=
(Name => Name, Aspects => Aspects,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Name
(Self : Base_Protected_Body_Stub)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access is
begin
return Self.Name;
end Name;
overriding function Aspects
(Self : Base_Protected_Body_Stub)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is
begin
return Self.Aspects;
end Aspects;
overriding function Protected_Token
(Self : Protected_Body_Stub)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Protected_Token;
end Protected_Token;
overriding function Body_Token
(Self : Protected_Body_Stub)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Body_Token;
end Body_Token;
overriding function Is_Token
(Self : Protected_Body_Stub)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Is_Token;
end Is_Token;
overriding function Separate_Token
(Self : Protected_Body_Stub)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Separate_Token;
end Separate_Token;
overriding function With_Token
(Self : Protected_Body_Stub)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.With_Token;
end With_Token;
overriding function Semicolon_Token
(Self : Protected_Body_Stub)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Semicolon_Token;
end Semicolon_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Protected_Body_Stub)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Protected_Body_Stub)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Protected_Body_Stub)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize
(Self : aliased in out Base_Protected_Body_Stub'Class) is
begin
Set_Enclosing_Element (Self.Name, Self'Unchecked_Access);
for Item in Self.Aspects.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
null;
end Initialize;
overriding function Is_Protected_Body_Stub_Element
(Self : Base_Protected_Body_Stub)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Protected_Body_Stub_Element;
overriding function Is_Declaration_Element
(Self : Base_Protected_Body_Stub)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Declaration_Element;
overriding procedure Visit
(Self : not null access Base_Protected_Body_Stub;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Protected_Body_Stub (Self);
end Visit;
overriding function To_Protected_Body_Stub_Text
(Self : aliased in out Protected_Body_Stub)
return Program.Elements.Protected_Body_Stubs
.Protected_Body_Stub_Text_Access is
begin
return Self'Unchecked_Access;
end To_Protected_Body_Stub_Text;
overriding function To_Protected_Body_Stub_Text
(Self : aliased in out Implicit_Protected_Body_Stub)
return Program.Elements.Protected_Body_Stubs
.Protected_Body_Stub_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Protected_Body_Stub_Text;
end Program.Nodes.Protected_Body_Stubs;
| 32.342246 | 79 | 0.716766 |
237200c0d45040b3d46b610284716bfd1872830b | 1,534 | ads | Ada | STM32F4/ToyOBDH/src/ttc.ads | AntonioRamosNieto/TFG-STM32F429 | d241065e51451199e7066e6ff3cbd207b4c88837 | [
"BSD-3-Clause"
] | null | null | null | STM32F4/ToyOBDH/src/ttc.ads | AntonioRamosNieto/TFG-STM32F429 | d241065e51451199e7066e6ff3cbd207b4c88837 | [
"BSD-3-Clause"
] | null | null | null | STM32F4/ToyOBDH/src/ttc.ads | AntonioRamosNieto/TFG-STM32F429 | d241065e51451199e7066e6ff3cbd207b4c88837 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2018, Universidad Politécnica de Madrid --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
-- License for more details. You should have received a copy of the GNU --
-- General Public License distributed with this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
-- --
------------------------------------------------------------------------------
-- TTC subsystem. -- This package provides communication facilities
-- for telemetry, tracking, and control of the satellite.
with TTC_Data; use TTC_Data;
package TTC is -- protected
procedure Send (TM : TM_Message);
-- Send a telemetry message
end TTC;
| 52.896552 | 79 | 0.491525 |
dc50f6cdab51d8e41f1c48e325849530161666b4 | 1,899 | adb | Ada | src/helios-monitor-sysfile.adb | stcarrez/helios | 770055d87eaaa70a29a8a39190ecc8aa4e31b5be | [
"Apache-2.0"
] | 1 | 2020-09-04T18:34:08.000Z | 2020-09-04T18:34:08.000Z | src/helios-monitor-sysfile.adb | stcarrez/helios | 770055d87eaaa70a29a8a39190ecc8aa4e31b5be | [
"Apache-2.0"
] | null | null | null | src/helios-monitor-sysfile.adb | stcarrez/helios | 770055d87eaaa70a29a8a39190ecc8aa4e31b5be | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- helios-monitor-sysfile -- Generic system file monitor
-- Copyright (C) 2017 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Helios.Tools.Files;
package body Helios.Monitor.Sysfile is
-- ------------------------------
-- Start the agent and build the definition tree.
-- ------------------------------
overriding
procedure Start (Agent : in out Agent_Type;
Config : in Util.Properties.Manager) is
Values : constant String := Config.Get ("values", "*");
begin
Agent.Path := Config.Get ("path");
Agent.Value := Agent.Create_Definition ("value", Values);
end Start;
-- ------------------------------
-- Collect the values in the snapshot.
-- ------------------------------
overriding
procedure Collect (Agent : in out Agent_Type;
Values : in out Datas.Snapshot_Type) is
Line : Helios.Tools.Files.File_Extractor;
Path : constant String := Ada.Strings.Unbounded.To_String (Agent.Path);
begin
Line.Open (Path);
Line.Read;
Values.Set_Value (Agent.Value, Line.Get_Value (1));
end Collect;
end Helios.Monitor.Sysfile;
| 39.5625 | 77 | 0.581359 |
1c268ead28f786c9e3d81664eeaa258a998aed3c | 4,042 | ads | Ada | source/league/ucd/matreshka-internals-unicode-ucd-core_0034.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/league/ucd/matreshka-internals-unicode-ucd-core_0034.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/league/ucd/matreshka-internals-unicode-ucd-core_0034.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_0034 is
pragma Preelaborate;
Group_0034 : aliased constant Core_Second_Stage
:= (others =>
(Other_Letter, Wide,
Other, Other, O_Letter, Ideographic,
(Ideographic
| Unified_Ideograph
| Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0034;
| 59.441176 | 78 | 0.433944 |
395ea025631e782553f12108d2a35782f8bb8a7e | 5,681 | ads | Ada | src/riscv32/agate-arch-riscv.ads | Fabien-Chouteau/AGATE | cd8dbc54c1c70379c833e7cd710e2326ad6e9a91 | [
"BSD-3-Clause"
] | 3 | 2017-12-23T10:25:07.000Z | 2021-06-09T13:47:19.000Z | src/riscv32/agate-arch-riscv.ads | Fabien-Chouteau/AGATE | cd8dbc54c1c70379c833e7cd710e2326ad6e9a91 | [
"BSD-3-Clause"
] | null | null | null | src/riscv32/agate-arch-riscv.ads | Fabien-Chouteau/AGATE | cd8dbc54c1c70379c833e7cd710e2326ad6e9a91 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2018, Fabien Chouteau --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
package AGATE.Arch.RISCV is
function CPU_Frequency return Word;
function Stvec return Word
with Inline_Always;
procedure Write_Stvec (Val : Word)
with Inline_Always;
function Mtvec return Word
with Inline_Always;
procedure Write_Mtvec (Val : Word)
with Inline_Always;
function Mscratch return Word
with Inline_Always;
procedure Write_Mcratch (Val : Word)
with Inline_Always;
function Mbadaddr return Word
with Inline_Always;
function Mcycle_Low return Word
with Inline_Always;
function Mcycle_Hi return Word
with Inline_Always;
type Mstatus_Reg is record
UIE : Boolean;
SIE : Boolean;
HIE : Boolean;
MIE : Boolean;
UPIE : Boolean;
SPIE : Boolean;
HPIE : Boolean;
MPIE : Boolean;
SPP : Bit;
HPP : UInt2;
MPP : UInt2;
FS : UInt2;
XS : UInt2;
MPRV : Boolean;
PUM : Boolean;
MXR : Boolean;
WPRI_1 : UInt4; -- Reserved Writes Preserve Values, Reads Ignore
VM : UInt5;
WPRI_2 : UInt2; -- Reserved Writes Preserve Values, Reads Ignore
SD : Boolean;
end record
with Size => 32;
for Mstatus_Reg use record
UIE at 0 range 0 .. 0;
SIE at 0 range 1 .. 1;
HIE at 0 range 2 .. 2;
MIE at 0 range 3 .. 3;
UPIE at 0 range 4 .. 4;
SPIE at 0 range 5 .. 5;
HPIE at 0 range 6 .. 6;
MPIE at 0 range 7 .. 7;
SPP at 0 range 8 .. 8;
HPP at 0 range 9 .. 10;
MPP at 0 range 11 .. 12;
FS at 0 range 13 .. 14;
XS at 0 range 15 .. 16;
MPRV at 0 range 17 .. 17;
PUM at 0 range 18 .. 18;
MXR at 0 range 19 .. 19;
WPRI_1 at 0 range 20 .. 23;
VM at 0 range 24 .. 28;
WPRI_2 at 0 range 29 .. 30;
SD at 0 range 31 .. 31;
end record;
function Mstatus return Mstatus_Reg
with Inline_Always;
procedure Write_Mstatus (Val : Mstatus_Reg)
with Inline_Always;
type Interrupt_Register is record
USI : Boolean;
SSI : Boolean;
HSI : Boolean;
MSI : Boolean;
UTI : Boolean;
STI : Boolean;
HTI : Boolean;
MTI : Boolean;
UEI : Boolean;
SEI : Boolean;
HEI : Boolean;
MEI : Boolean;
Reserved : UInt18;
end record
with Size => 32;
for Interrupt_Register use record
USI at 0 range 0 .. 0;
SSI at 0 range 1 .. 1;
HSI at 0 range 2 .. 2;
MSI at 0 range 3 .. 3;
UTI at 0 range 4 .. 4;
STI at 0 range 5 .. 5;
HTI at 0 range 6 .. 6;
MTI at 0 range 7 .. 7;
UEI at 0 range 8 .. 8;
SEI at 0 range 9 .. 9;
HEI at 0 range 10 .. 10;
MEI at 0 range 11 .. 11;
Reserved at 0 range 12 .. 31;
end record;
function Mip return Interrupt_Register
with Inline_Always;
procedure Write_Mip (Val : Interrupt_Register)
with Inline_Always;
function Mie return Interrupt_Register
with Inline_Always;
procedure Write_Mie (Val : Interrupt_Register)
with Inline_Always;
end AGATE.Arch.RISCV;
| 35.067901 | 78 | 0.529308 |
df68e213937baaeb9aa0a7f960514bd89f084bae | 22,973 | adb | Ada | src/gen-model-tables.adb | jquorning/dynamo | 10d68571476c270b8e45a9c5ef585fa9139b0d05 | [
"Apache-2.0"
] | 15 | 2015-01-18T23:04:19.000Z | 2022-03-01T20:27:08.000Z | src/gen-model-tables.adb | jquorning/dynamo | 10d68571476c270b8e45a9c5ef585fa9139b0d05 | [
"Apache-2.0"
] | 16 | 2018-06-10T07:09:30.000Z | 2022-03-26T18:28:40.000Z | src/gen-model-tables.adb | jquorning/dynamo | 10d68571476c270b8e45a9c5ef585fa9139b0d05 | [
"Apache-2.0"
] | 3 | 2015-11-11T18:00:14.000Z | 2022-01-30T23:08:45.000Z | -----------------------------------------------------------------------
-- gen-model-tables -- Database table model representation
-- Copyright (C) 2009 - 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 Ada.Strings;
with Util.Strings;
with Util.Log.Loggers;
with EL.Contexts.Default;
with EL.Utils;
with EL.Variables.Default;
with Gen.Model.Enums;
with Gen.Model.Stypes;
package body Gen.Model.Tables is
use Ada.Strings.Unbounded;
use type Gen.Model.Mappings.Basic_Type;
use type Gen.Model.Mappings.Mapping_Definition_Access;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Gen.Model.Tables");
-- ------------------------------
-- 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 : Column_Definition;
Name : String) return UBO.Object is
begin
if Name = "type" then
declare
T : constant Gen.Model.Mappings.Mapping_Definition_Access := From.Get_Type_Mapping;
begin
if T = null then
return UBO.Null_Object;
end if;
return UBO.To_Object (T.all'Access, UBO.STATIC);
end;
elsif Name = "index" then
return UBO.To_Object (From.Number);
elsif Name = "isUnique" then
return UBO.To_Object (From.Unique);
elsif Name = "isNull" then
return UBO.To_Object (not From.Not_Null);
elsif Name = "isInserted" then
return UBO.To_Object (From.Is_Inserted);
elsif Name = "isUpdated" then
return UBO.To_Object (From.Is_Updated);
elsif Name = "sqlType" then
if Length (From.Sql_Type) > 0 then
return UBO.To_Object (Mappings.Get_Type_Name (From.Sql_Type));
end if;
declare
T : constant Gen.Model.Mappings.Mapping_Definition_Access := From.Get_Type_Mapping;
begin
if T = null then
return UBO.Null_Object;
-- If this is an association to another table, use the primary key of that table.
elsif T.all in Table_Definition'Class
and then Table_Definition'Class (T.all).Id_Column /= null
then
return Table_Definition'Class (T.all).Id_Column.Get_Value (Name);
elsif T.all in Enums.Enum_Definition'Class then
return T.Get_Value ("sqlType");
elsif T.all in Stypes.Stype_Definition'Class then
return T.Get_Value ("sqlType");
else
declare
Ctx : EL.Contexts.Default.Default_Context;
Variables : aliased EL.Variables.Default.Default_Variable_Mapper;
begin
Variables.Bind ("column", From.Bean);
Ctx.Set_Variable_Mapper (Variables'Unchecked_Access);
return EL.Utils.Eval (To_String (T.Target), Ctx);
end;
end if;
end;
elsif Name = "sqlName" then
if Length (From.Sql_Name) > 0 then
return UBO.To_Object (From.Sql_Name);
end if;
declare
T : constant Gen.Model.Mappings.Mapping_Definition_Access := From.Get_Type_Mapping;
Table : Table_Definition_Access;
begin
if T /= null and then T.all in Table_Definition'Class then
Table := Table_Definition'Class (T.all)'Access;
end if;
if Table /= null and then Table.Id_Column /= null then
return UBO.To_Object (From.Name & "_" & Table.Id_Column.Name);
else
return UBO.To_Object (From.Name);
end if;
end;
elsif Name = "sqlLength" then
return UBO.To_Object (From.Sql_Length);
elsif Name = "isVersion" then
return UBO.To_Object (From.Is_Version);
elsif Name = "isReadable" then
return UBO.To_Object (From.Is_Readable);
elsif Name = "isPrimaryKey" then
return UBO.To_Object (From.Is_Key);
elsif Name = "isPrimitiveType" then
return UBO.To_Object (From.Is_Basic_Type);
elsif Name = "isAuditable" then
return UBO.To_Object (From.Is_Auditable);
elsif Name = "generator" then
return From.Generator;
else
return Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Returns true if the column type is a basic type.
-- ------------------------------
function Is_Basic_Type (From : in Column_Definition) return Boolean is
T : constant Gen.Model.Mappings.Mapping_Definition_Access := From.Get_Type_Mapping;
Name : constant String := To_String (From.Type_Name);
begin
if T /= null then
return T.Kind /= Gen.Model.Mappings.T_BLOB and T.Kind /= Gen.Model.Mappings.T_TABLE
and T.Kind /= Gen.Model.Mappings.T_BEAN;
end if;
return Name = "int" or Name = "String"
or Name = "ADO.Identifier" or Name = "Timestamp"
or Name = "Integer"
or Name = "long" or Name = "Long" or Name = "Date" or Name = "Time";
end Is_Basic_Type;
-- ------------------------------
-- Returns true if the column is using a variable length (ex: a string).
-- ------------------------------
function Is_Variable_Length (From : Column_Definition) return Boolean is
T : constant Gen.Model.Mappings.Mapping_Definition_Access := From.Get_Type_Mapping;
begin
if T /= null then
return T.Kind = Gen.Model.Mappings.T_STRING;
else
return False;
end if;
end Is_Variable_Length;
-- ------------------------------
-- Returns the column type.
-- ------------------------------
function Get_Type (From : in Column_Definition) return String is
T : constant Gen.Model.Mappings.Mapping_Definition_Access := From.Get_Type_Mapping;
begin
if T /= null then
return To_String (T.Target);
else
return To_String (From.Type_Name);
end if;
end Get_Type;
-- ------------------------------
-- Set the column type.
-- ------------------------------
procedure Set_Type (Into : in out Column_Definition;
Name : in String) is
begin
Into.Type_Name := To_UString (Name);
end Set_Type;
-- ------------------------------
-- Set the SQL length of the column.
-- ------------------------------
procedure Set_Sql_Length (Into : in out Column_Definition;
Value : in String;
Log : in out Util.Log.Logging'Class) is
begin
Into.Sql_Length := Positive'Value (Value);
exception
when others =>
Log.Error (Into.Get_Location & ": SQL length '" & Value
& "' for column '" & Into.Get_Name & "' must be a number");
end Set_Sql_Length;
-- ------------------------------
-- Returns the column type mapping.
-- ------------------------------
function Get_Type_Mapping (From : in Column_Definition)
return Gen.Model.Mappings.Mapping_Definition_Access is
use type Gen.Model.Packages.Package_Definition_Access;
Result : Gen.Model.Mappings.Mapping_Definition_Access := null;
begin
if From.Type_Mapping /= null then
return From.Type_Mapping;
end if;
if From.Table /= null and then From.Table.Package_Def /= null then
Result := From.Table.Package_Def.Find_Type (From.Type_Name);
end if;
if Result = null then
Result := Gen.Model.Mappings.Find_Type (From.Type_Name, not From.Not_Null);
end if;
if Result /= null and then From.Use_Foreign_Key_Type
and then Result.all in Table_Definition'Class
and then Table_Definition'Class (Result.all).Id_Column /= null
then
Result := Table_Definition'Class (Result.all).Id_Column.Get_Type_Mapping;
if Result /= null and then not From.Not_Null and then Result.Allow_Null /= null then
Result := Result.Allow_Null;
end if;
end if;
return Result;
end Get_Type_Mapping;
-- ------------------------------
-- Prepare the generation of the model.
-- ------------------------------
overriding
procedure Prepare (O : in out Column_Definition) is
begin
O.Bean := UBO.To_Object (O'Unchecked_Access,
UBO.STATIC);
end Prepare;
-- ------------------------------
-- Validate the definition by checking and reporting problems to the logger interface.
-- ------------------------------
overriding
procedure Validate (Def : in out Column_Definition;
Log : in out Util.Log.Logging'Class) is
T : constant Gen.Model.Mappings.Mapping_Definition_Access := Def.Get_Type_Mapping;
begin
Definition (Def).Validate (Log);
if not Def.Not_Null and then Def.Is_Basic_Type
and then T /= null and then not T.Nullable
then
Log.Error (Def.Get_Location &
": In table " & To_String (Def.Table.Name) &
", column '" & To_String (Def.Name) &
"' uses not nullable type '" & To_String (Def.Type_Name) & "'");
end if;
if T = null then
Log.Error (Def.Get_Location &
": In table " & To_String (Def.Table.Name) &
", column '" & To_String (Def.Name) &
"' uses unknown type '" & To_String (Def.Type_Name) & "'");
end if;
if T /= null and then T.Nullable and then Def.Not_Null then
Log.Error (Def.Get_Location &
": In table " & To_String (Def.Table.Name) &
", column '" & To_String (Def.Name) &
"' is using a nullable type without not-null");
end if;
end Validate;
-- ------------------------------
-- 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 : Association_Definition;
Name : String) return UBO.Object is
begin
return Column_Definition (From).Get_Value (Name);
end Get_Value;
-- ------------------------------
-- Prepare the generation of the model.
-- ------------------------------
overriding
procedure Prepare (O : in out Association_Definition) is
T : constant Gen.Model.Mappings.Mapping_Definition_Access := O.Get_Type_Mapping;
Table : Table_Definition_Access;
begin
Column_Definition (O).Prepare;
if T = null then
Table := Create_Table (O.Type_Name);
O.Type_Mapping := Table.all'Access;
end if;
end Prepare;
-- ------------------------------
-- Initialize the table definition instance.
-- ------------------------------
overriding
procedure Initialize (O : in out Table_Definition) is
begin
O.Members_Bean := UBO.To_Object (O.Members'Unchecked_Access,
UBO.STATIC);
O.Auditables_Bean := UBO.To_Object (O.Auditables'Unchecked_Access,
UBO.STATIC);
O.Operations_Bean := UBO.To_Object (O.Operations'Unchecked_Access,
UBO.STATIC);
end Initialize;
-- ------------------------------
-- Create a table with the given name.
-- ------------------------------
function Create_Table (Name : in UString) return Table_Definition_Access is
Table : constant Table_Definition_Access := new Table_Definition;
begin
Log.Debug ("Create table {0}", Name);
Table.Set_Name (Name);
Table.Kind := Gen.Model.Mappings.T_TABLE;
Table.Target := Name;
declare
Pos : constant Natural := Index (Table.Name, ".", Ada.Strings.Backward);
begin
if Pos > 0 then
Table.Pkg_Name := Unbounded_Slice (Table.Name, 1, Pos - 1);
Table.Type_Name := Unbounded_Slice (Table.Name, Pos + 1, Length (Table.Name));
else
Table.Pkg_Name := To_UString ("ADO");
Table.Type_Name := Table.Name;
end if;
Table.Table_Name := Table.Type_Name;
end;
return Table;
end Create_Table;
-- ------------------------------
-- Create a table column with the given name and add it to the table.
-- ------------------------------
procedure Add_Column (Table : in out Table_Definition;
Name : in UString;
Column : out Column_Definition_Access) is
begin
Column := new Column_Definition;
Column.Set_Name (Name);
Column.Sql_Name := Name;
Column.Number := Table.Members.Get_Count;
Column.Table := Table'Unchecked_Access;
Table.Members.Append (Column);
end Add_Column;
-- ------------------------------
-- Create a table association with the given name and add it to the table.
-- ------------------------------
procedure Add_Association (Table : in out Table_Definition;
Name : in UString;
Assoc : out Association_Definition_Access) is
begin
Assoc := new Association_Definition;
Assoc.Set_Name (Name);
Assoc.Number := Table.Members.Get_Count;
Assoc.Table := Table'Unchecked_Access;
Table.Members.Append (Assoc.all'Access);
Table.Has_Associations := True;
end Add_Association;
-- ------------------------------
-- Create an operation with the given name and add it to the table.
-- ------------------------------
procedure Add_Operation (Table : in out Table_Definition;
Name : in UString;
Operation : out Model.Operations.Operation_Definition_Access) is
begin
Operation := new Model.Operations.Operation_Definition;
Operation.Set_Name (Name);
Table.Operations.Append (Operation.all'Access);
end Add_Operation;
-- ------------------------------
-- Get the dependency between the two tables.
-- Returns NONE if both table don't depend on each other.
-- Returns FORWARD if the <tt>Left</tt> table depends on <tt>Right</tt>.
-- Returns BACKWARD if the <tt>Right</tt> table depends on <tt>Left</tt>.
-- ------------------------------
function Depends_On (Left, Right : in Table_Definition_Access) return Dependency_Type is
begin
if Left.Dependencies.Contains (Right) then
Log.Info ("Table {0} depends on {1}",
To_String (Left.Name), To_String (Right.Name));
return FORWARD;
elsif Right.Dependencies.Contains (Left) then
Log.Info ("Table {1} depends on {0}",
To_String (Left.Name), To_String (Right.Name));
return BACKWARD;
else
return NONE;
end if;
end Depends_On;
-- ------------------------------
-- 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 Table_Definition;
Name : in String) return UBO.Object is
begin
if Name = "members" or Name = "columns" then
return From.Members_Bean;
elsif Name = "operations" then
return From.Operations_Bean;
elsif Name = "auditables" then
return From.Auditables_Bean;
elsif Name = "id" and From.Id_Column /= null then
declare
Bean : constant Util.Beans.Basic.Readonly_Bean_Access := From.Id_Column.all'Access;
begin
return UBO.To_Object (Bean, UBO.STATIC);
end;
elsif Name = "version" and From.Version_Column /= null then
declare
Bean : constant Util.Beans.Basic.Readonly_Bean_Access
:= From.Version_Column.all'Unchecked_Access;
begin
return UBO.To_Object (Bean, UBO.STATIC);
end;
elsif Name = "hasAssociations" then
return UBO.To_Object (From.Has_Associations);
elsif Name = "hasList" then
return UBO.To_Object (From.Has_List);
elsif Name = "type" then
return UBO.To_Object (From.Type_Name);
elsif Name = "table" or Name = "sqlName" then
return UBO.To_Object (From.Table_Name);
elsif Name = "keyCount" then
return UBO.To_Object (From.Key_Count);
elsif Name = "parent" then
if From.Parent /= null then
declare
Bean : constant Util.Beans.Basic.Readonly_Bean_Access
:= From.Parent.all'Unchecked_Access;
begin
return UBO.To_Object (Bean, UBO.STATIC);
end;
else
return UBO.Null_Object;
end if;
elsif Name = "isVersion" or Name = "isPrimaryKey" or Name = "isBean"
or Name = "isPrimitiveType" or Name = "isEnum" or Name = "isIdentifier"
or Name = "isDiscrete" or Name = "isNewDiscrete"
or Name = "isBoolean" or Name = "isBlob" or Name = "isDate" or Name = "isString"
then
return UBO.To_Object (False);
elsif Name = "isReadable" or Name = "isObject" then
return UBO.To_Object (True);
elsif Name = "isLimited" then
return UBO.To_Object (From.Is_Limited);
elsif Name = "isSerializable" then
return UBO.To_Object (From.Is_Serializable);
elsif Name = "isAuditable" then
return UBO.To_Object (From.Is_Auditable);
else
return Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Prepare the generation of the model.
-- ------------------------------
overriding
procedure Prepare (O : in out Table_Definition) is
Iter : Column_List.Cursor := O.Members.First;
C : Column_Definition_Access;
T : Gen.Model.Mappings.Mapping_Definition_Access;
begin
Log.Info ("Prepare table {0}", O.Get_Name);
O.Key_Count := 0;
while Column_List.Has_Element (Iter) loop
C := Column_List.Element (Iter);
C.Prepare;
if C.Is_Key then
Log.Info ("Found key {0}", C.Get_Name);
O.Key_Count := O.Key_Count + 1;
O.Id_Column := C;
end if;
if C.Is_Version then
Log.Info ("Found version column {0}", C.Get_Name);
O.Version_Column := C;
-- For the <<Version>> columns, do not allow users to modify them.
C.Is_Updated := False;
C.Is_Inserted := False;
end if;
if C.Is_Auditable then
O.Is_Auditable := True;
O.Auditables.Append (C);
end if;
-- Collect in the dependencies vectors the tables that we are using.
if not C.Use_Foreign_Key_Type and then C.all in Association_Definition'Class then
T := C.Get_Type_Mapping;
if T /= null and then T.all in Table_Definition'Class then
O.Dependencies.Append (Table_Definition'Class (T.all)'Access);
end if;
end if;
Column_List.Next (Iter);
end loop;
if O.Id_Column = null and Length (O.Table_Name) > 0 then
Log.Error ("Table {0} does not have any primary key", To_String (O.Name));
end if;
if Length (O.Parent_Name) > 0 then
declare
Result : constant Mappings.Mapping_Definition_Access
:= O.Package_Def.Find_Type (O.Parent_Name);
begin
if Result /= null and then Result.all in Table_Definition'Class then
O.Parent := Table_Definition'Class (Result.all)'Access;
end if;
end;
end if;
end Prepare;
-- ------------------------------
-- Validate the definition by checking and reporting problems to the logger interface.
-- ------------------------------
overriding
procedure Validate (Def : in out Table_Definition;
Log : in out Util.Log.Logging'Class) is
begin
for Col of Def.Members loop
Col.Validate (Log);
end loop;
end Validate;
-- ------------------------------
-- Collect the dependencies to other tables.
-- ------------------------------
procedure Collect_Dependencies (O : in out Table_Definition) is
Iter : Table_Vectors.Cursor := O.Dependencies.First;
List : Table_Vectors.Vector;
D : Table_Definition_Access;
begin
Log.Info ("Collect dependencies of {0}", O.Name);
if O.Has_Mark then
return;
end if;
O.Has_Mark := True;
while Table_Vectors.Has_Element (Iter) loop
D := Table_Vectors.Element (Iter);
D.Collect_Dependencies;
List.Append (D.Dependencies);
Table_Vectors.Next (Iter);
end loop;
O.Has_Mark := False;
Iter := List.First;
while Table_Vectors.Has_Element (Iter) loop
D := Table_Vectors.Element (Iter);
if not O.Dependencies.Contains (D) then
Log.Info ("Adding dependency for {0} on {1}", To_String (O.Name), To_String (D.Name));
O.Dependencies.Append (D);
end if;
Table_Vectors.Next (Iter);
end loop;
end Collect_Dependencies;
-- ------------------------------
-- Set the table name and determines the package name.
-- ------------------------------
procedure Set_Table_Name (Table : in out Table_Definition;
Name : in String) is
Pos : constant Natural := Util.Strings.Rindex (Name, '.');
begin
Table.Set_Name (Name);
if Pos > 0 then
Table.Pkg_Name := To_UString (Name (Name'First .. Pos - 1));
Table.Type_Name := To_UString (Name (Pos + 1 .. Name'Last));
else
Table.Pkg_Name := To_UString ("ADO");
Table.Type_Name := Table.Name;
end if;
end Set_Table_Name;
end Gen.Model.Tables;
| 37.293831 | 99 | 0.559744 |
104221e1f6876f011bbb7fb20ba986b8f75aa865 | 51,610 | ads | Ada | src/stm32-tim.ads | damaki/EVB1000 | 1589a3f3bd79d7c9970f3b0758e133e3ec1ee6e2 | [
"MIT"
] | null | null | null | src/stm32-tim.ads | damaki/EVB1000 | 1589a3f3bd79d7c9970f3b0758e133e3ec1ee6e2 | [
"MIT"
] | null | null | null | src/stm32-tim.ads | damaki/EVB1000 | 1589a3f3bd79d7c9970f3b0758e133e3ec1ee6e2 | [
"MIT"
] | 1 | 2021-02-10T14:33:06.000Z | 2021-02-10T14:33:06.000Z | -- This spec has been automatically generated from STM32F105xx.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
with System;
package STM32.TIM is
pragma Preelaborate;
---------------
-- Registers --
---------------
------------------
-- CR1_Register --
------------------
subtype CR1_CEN_Field is STM32.Bit;
subtype CR1_UDIS_Field is STM32.Bit;
subtype CR1_URS_Field is STM32.Bit;
subtype CR1_OPM_Field is STM32.Bit;
subtype CR1_DIR_Field is STM32.Bit;
subtype CR1_CMS_Field is STM32.UInt2;
subtype CR1_ARPE_Field is STM32.Bit;
subtype CR1_CKD_Field is STM32.UInt2;
-- control register 1
type CR1_Register is record
-- Counter enable
CEN : CR1_CEN_Field := 16#0#;
-- Update disable
UDIS : CR1_UDIS_Field := 16#0#;
-- Update request source
URS : CR1_URS_Field := 16#0#;
-- One-pulse mode
OPM : CR1_OPM_Field := 16#0#;
-- Direction
DIR : CR1_DIR_Field := 16#0#;
-- Center-aligned mode selection
CMS : CR1_CMS_Field := 16#0#;
-- Auto-reload preload enable
ARPE : CR1_ARPE_Field := 16#0#;
-- Clock division
CKD : CR1_CKD_Field := 16#0#;
-- unspecified
Reserved_10_31 : STM32.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR1_Register use record
CEN at 0 range 0 .. 0;
UDIS at 0 range 1 .. 1;
URS at 0 range 2 .. 2;
OPM at 0 range 3 .. 3;
DIR at 0 range 4 .. 4;
CMS at 0 range 5 .. 6;
ARPE at 0 range 7 .. 7;
CKD at 0 range 8 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
------------------
-- CR2_Register --
------------------
subtype CR2_CCPC_Field is STM32.Bit;
subtype CR2_CCUS_Field is STM32.Bit;
subtype CR2_CCDS_Field is STM32.Bit;
subtype CR2_MMS_Field is STM32.UInt3;
subtype CR2_TI1S_Field is STM32.Bit;
subtype CR2_OIS1_Field is STM32.Bit;
subtype CR2_OIS1N_Field is STM32.Bit;
subtype CR2_OIS2_Field is STM32.Bit;
subtype CR2_OIS2N_Field is STM32.Bit;
subtype CR2_OIS3_Field is STM32.Bit;
subtype CR2_OIS3N_Field is STM32.Bit;
subtype CR2_OIS4_Field is STM32.Bit;
-- control register 2
type CR2_Register is record
-- Capture/compare preloaded control
CCPC : CR2_CCPC_Field := 16#0#;
-- unspecified
Reserved_1_1 : STM32.Bit := 16#0#;
-- Capture/compare control update selection
CCUS : CR2_CCUS_Field := 16#0#;
-- Capture/compare DMA selection
CCDS : CR2_CCDS_Field := 16#0#;
-- Master mode selection
MMS : CR2_MMS_Field := 16#0#;
-- TI1 selection
TI1S : CR2_TI1S_Field := 16#0#;
-- Output Idle state 1
OIS1 : CR2_OIS1_Field := 16#0#;
-- Output Idle state 1
OIS1N : CR2_OIS1N_Field := 16#0#;
-- Output Idle state 2
OIS2 : CR2_OIS2_Field := 16#0#;
-- Output Idle state 2
OIS2N : CR2_OIS2N_Field := 16#0#;
-- Output Idle state 3
OIS3 : CR2_OIS3_Field := 16#0#;
-- Output Idle state 3
OIS3N : CR2_OIS3N_Field := 16#0#;
-- Output Idle state 4
OIS4 : CR2_OIS4_Field := 16#0#;
-- unspecified
Reserved_15_31 : STM32.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR2_Register use record
CCPC at 0 range 0 .. 0;
Reserved_1_1 at 0 range 1 .. 1;
CCUS at 0 range 2 .. 2;
CCDS at 0 range 3 .. 3;
MMS at 0 range 4 .. 6;
TI1S at 0 range 7 .. 7;
OIS1 at 0 range 8 .. 8;
OIS1N at 0 range 9 .. 9;
OIS2 at 0 range 10 .. 10;
OIS2N at 0 range 11 .. 11;
OIS3 at 0 range 12 .. 12;
OIS3N at 0 range 13 .. 13;
OIS4 at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-------------------
-- SMCR_Register --
-------------------
subtype SMCR_SMS_Field is STM32.UInt3;
subtype SMCR_TS_Field is STM32.UInt3;
subtype SMCR_MSM_Field is STM32.Bit;
subtype SMCR_ETF_Field is STM32.UInt4;
subtype SMCR_ETPS_Field is STM32.UInt2;
subtype SMCR_ECE_Field is STM32.Bit;
subtype SMCR_ETP_Field is STM32.Bit;
-- slave mode control register
type SMCR_Register is record
-- Slave mode selection
SMS : SMCR_SMS_Field := 16#0#;
-- unspecified
Reserved_3_3 : STM32.Bit := 16#0#;
-- Trigger selection
TS : SMCR_TS_Field := 16#0#;
-- Master/Slave mode
MSM : SMCR_MSM_Field := 16#0#;
-- External trigger filter
ETF : SMCR_ETF_Field := 16#0#;
-- External trigger prescaler
ETPS : SMCR_ETPS_Field := 16#0#;
-- External clock enable
ECE : SMCR_ECE_Field := 16#0#;
-- External trigger polarity
ETP : SMCR_ETP_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SMCR_Register use record
SMS at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
TS at 0 range 4 .. 6;
MSM at 0 range 7 .. 7;
ETF at 0 range 8 .. 11;
ETPS at 0 range 12 .. 13;
ECE at 0 range 14 .. 14;
ETP at 0 range 15 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- DIER_Register --
-------------------
subtype DIER_UIE_Field is STM32.Bit;
subtype DIER_CC1IE_Field is STM32.Bit;
subtype DIER_CC2IE_Field is STM32.Bit;
subtype DIER_CC3IE_Field is STM32.Bit;
subtype DIER_CC4IE_Field is STM32.Bit;
subtype DIER_COMIE_Field is STM32.Bit;
subtype DIER_TIE_Field is STM32.Bit;
subtype DIER_BIE_Field is STM32.Bit;
subtype DIER_UDE_Field is STM32.Bit;
subtype DIER_CC1DE_Field is STM32.Bit;
subtype DIER_CC2DE_Field is STM32.Bit;
subtype DIER_CC3DE_Field is STM32.Bit;
subtype DIER_CC4DE_Field is STM32.Bit;
subtype DIER_COMDE_Field is STM32.Bit;
subtype DIER_TDE_Field is STM32.Bit;
-- DMA/Interrupt enable register
type DIER_Register is record
-- Update interrupt enable
UIE : DIER_UIE_Field := 16#0#;
-- Capture/Compare 1 interrupt enable
CC1IE : DIER_CC1IE_Field := 16#0#;
-- Capture/Compare 2 interrupt enable
CC2IE : DIER_CC2IE_Field := 16#0#;
-- Capture/Compare 3 interrupt enable
CC3IE : DIER_CC3IE_Field := 16#0#;
-- Capture/Compare 4 interrupt enable
CC4IE : DIER_CC4IE_Field := 16#0#;
-- COM interrupt enable
COMIE : DIER_COMIE_Field := 16#0#;
-- Trigger interrupt enable
TIE : DIER_TIE_Field := 16#0#;
-- Break interrupt enable
BIE : DIER_BIE_Field := 16#0#;
-- Update DMA request enable
UDE : DIER_UDE_Field := 16#0#;
-- Capture/Compare 1 DMA request enable
CC1DE : DIER_CC1DE_Field := 16#0#;
-- Capture/Compare 2 DMA request enable
CC2DE : DIER_CC2DE_Field := 16#0#;
-- Capture/Compare 3 DMA request enable
CC3DE : DIER_CC3DE_Field := 16#0#;
-- Capture/Compare 4 DMA request enable
CC4DE : DIER_CC4DE_Field := 16#0#;
-- Reserved
COMDE : DIER_COMDE_Field := 16#0#;
-- Trigger DMA request enable
TDE : DIER_TDE_Field := 16#0#;
-- unspecified
Reserved_15_31 : STM32.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIER_Register use record
UIE at 0 range 0 .. 0;
CC1IE at 0 range 1 .. 1;
CC2IE at 0 range 2 .. 2;
CC3IE at 0 range 3 .. 3;
CC4IE at 0 range 4 .. 4;
COMIE at 0 range 5 .. 5;
TIE at 0 range 6 .. 6;
BIE at 0 range 7 .. 7;
UDE at 0 range 8 .. 8;
CC1DE at 0 range 9 .. 9;
CC2DE at 0 range 10 .. 10;
CC3DE at 0 range 11 .. 11;
CC4DE at 0 range 12 .. 12;
COMDE at 0 range 13 .. 13;
TDE at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-----------------
-- SR_Register --
-----------------
subtype SR_UIF_Field is STM32.Bit;
subtype SR_CC1IF_Field is STM32.Bit;
subtype SR_CC2IF_Field is STM32.Bit;
subtype SR_CC3IF_Field is STM32.Bit;
subtype SR_CC4IF_Field is STM32.Bit;
subtype SR_COMIF_Field is STM32.Bit;
subtype SR_TIF_Field is STM32.Bit;
subtype SR_BIF_Field is STM32.Bit;
subtype SR_CC1OF_Field is STM32.Bit;
subtype SR_CC2OF_Field is STM32.Bit;
subtype SR_CC3OF_Field is STM32.Bit;
subtype SR_CC4OF_Field is STM32.Bit;
-- status register
type SR_Register is record
-- Update interrupt flag
UIF : SR_UIF_Field := 16#0#;
-- Capture/compare 1 interrupt flag
CC1IF : SR_CC1IF_Field := 16#0#;
-- Capture/Compare 2 interrupt flag
CC2IF : SR_CC2IF_Field := 16#0#;
-- Capture/Compare 3 interrupt flag
CC3IF : SR_CC3IF_Field := 16#0#;
-- Capture/Compare 4 interrupt flag
CC4IF : SR_CC4IF_Field := 16#0#;
-- COM interrupt flag
COMIF : SR_COMIF_Field := 16#0#;
-- Trigger interrupt flag
TIF : SR_TIF_Field := 16#0#;
-- Break interrupt flag
BIF : SR_BIF_Field := 16#0#;
-- unspecified
Reserved_8_8 : STM32.Bit := 16#0#;
-- Capture/Compare 1 overcapture flag
CC1OF : SR_CC1OF_Field := 16#0#;
-- Capture/compare 2 overcapture flag
CC2OF : SR_CC2OF_Field := 16#0#;
-- Capture/Compare 3 overcapture flag
CC3OF : SR_CC3OF_Field := 16#0#;
-- Capture/Compare 4 overcapture flag
CC4OF : SR_CC4OF_Field := 16#0#;
-- unspecified
Reserved_13_31 : STM32.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
UIF at 0 range 0 .. 0;
CC1IF at 0 range 1 .. 1;
CC2IF at 0 range 2 .. 2;
CC3IF at 0 range 3 .. 3;
CC4IF at 0 range 4 .. 4;
COMIF at 0 range 5 .. 5;
TIF at 0 range 6 .. 6;
BIF at 0 range 7 .. 7;
Reserved_8_8 at 0 range 8 .. 8;
CC1OF at 0 range 9 .. 9;
CC2OF at 0 range 10 .. 10;
CC3OF at 0 range 11 .. 11;
CC4OF at 0 range 12 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
------------------
-- EGR_Register --
------------------
subtype EGR_UG_Field is STM32.Bit;
subtype EGR_CC1G_Field is STM32.Bit;
subtype EGR_CC2G_Field is STM32.Bit;
subtype EGR_CC3G_Field is STM32.Bit;
subtype EGR_CC4G_Field is STM32.Bit;
subtype EGR_COMG_Field is STM32.Bit;
subtype EGR_TG_Field is STM32.Bit;
subtype EGR_BG_Field is STM32.Bit;
-- event generation register
type EGR_Register is record
-- Write-only. Update generation
UG : EGR_UG_Field := 16#0#;
-- Write-only. Capture/compare 1 generation
CC1G : EGR_CC1G_Field := 16#0#;
-- Write-only. Capture/compare 2 generation
CC2G : EGR_CC2G_Field := 16#0#;
-- Write-only. Capture/compare 3 generation
CC3G : EGR_CC3G_Field := 16#0#;
-- Write-only. Capture/compare 4 generation
CC4G : EGR_CC4G_Field := 16#0#;
-- Write-only. Capture/Compare control update generation
COMG : EGR_COMG_Field := 16#0#;
-- Write-only. Trigger generation
TG : EGR_TG_Field := 16#0#;
-- Write-only. Break generation
BG : EGR_BG_Field := 16#0#;
-- unspecified
Reserved_8_31 : STM32.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EGR_Register use record
UG at 0 range 0 .. 0;
CC1G at 0 range 1 .. 1;
CC2G at 0 range 2 .. 2;
CC3G at 0 range 3 .. 3;
CC4G at 0 range 4 .. 4;
COMG at 0 range 5 .. 5;
TG at 0 range 6 .. 6;
BG at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
---------------------------
-- CCMR1_Output_Register --
---------------------------
subtype CCMR1_Output_CC1S_Field is STM32.UInt2;
subtype CCMR1_Output_OC1FE_Field is STM32.Bit;
subtype CCMR1_Output_OC1PE_Field is STM32.Bit;
subtype CCMR1_Output_OC1M_Field is STM32.UInt3;
subtype CCMR1_Output_OC1CE_Field is STM32.Bit;
subtype CCMR1_Output_CC2S_Field is STM32.UInt2;
subtype CCMR1_Output_OC2FE_Field is STM32.Bit;
subtype CCMR1_Output_OC2PE_Field is STM32.Bit;
subtype CCMR1_Output_OC2M_Field is STM32.UInt3;
subtype CCMR1_Output_OC2CE_Field is STM32.Bit;
-- capture/compare mode register (output mode)
type CCMR1_Output_Register is record
-- Capture/Compare 1 selection
CC1S : CCMR1_Output_CC1S_Field := 16#0#;
-- Output Compare 1 fast enable
OC1FE : CCMR1_Output_OC1FE_Field := 16#0#;
-- Output Compare 1 preload enable
OC1PE : CCMR1_Output_OC1PE_Field := 16#0#;
-- Output Compare 1 mode
OC1M : CCMR1_Output_OC1M_Field := 16#0#;
-- Output Compare 1 clear enable
OC1CE : CCMR1_Output_OC1CE_Field := 16#0#;
-- Capture/Compare 2 selection
CC2S : CCMR1_Output_CC2S_Field := 16#0#;
-- Output Compare 2 fast enable
OC2FE : CCMR1_Output_OC2FE_Field := 16#0#;
-- Output Compare 2 preload enable
OC2PE : CCMR1_Output_OC2PE_Field := 16#0#;
-- Output Compare 2 mode
OC2M : CCMR1_Output_OC2M_Field := 16#0#;
-- Output Compare 2 clear enable
OC2CE : CCMR1_Output_OC2CE_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCMR1_Output_Register use record
CC1S at 0 range 0 .. 1;
OC1FE at 0 range 2 .. 2;
OC1PE at 0 range 3 .. 3;
OC1M at 0 range 4 .. 6;
OC1CE at 0 range 7 .. 7;
CC2S at 0 range 8 .. 9;
OC2FE at 0 range 10 .. 10;
OC2PE at 0 range 11 .. 11;
OC2M at 0 range 12 .. 14;
OC2CE at 0 range 15 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
--------------------------
-- CCMR1_Input_Register --
--------------------------
subtype CCMR1_Input_CC1S_Field is STM32.UInt2;
subtype CCMR1_Input_ICPCS_Field is STM32.UInt2;
subtype CCMR1_Input_IC1F_Field is STM32.UInt4;
subtype CCMR1_Input_CC2S_Field is STM32.UInt2;
subtype CCMR1_Input_IC2PCS_Field is STM32.UInt2;
subtype CCMR1_Input_IC2F_Field is STM32.UInt4;
-- capture/compare mode register 1 (input mode)
type CCMR1_Input_Register is record
-- Capture/Compare 1 selection
CC1S : CCMR1_Input_CC1S_Field := 16#0#;
-- Input capture 1 prescaler
ICPCS : CCMR1_Input_ICPCS_Field := 16#0#;
-- Input capture 1 filter
IC1F : CCMR1_Input_IC1F_Field := 16#0#;
-- Capture/Compare 2 selection
CC2S : CCMR1_Input_CC2S_Field := 16#0#;
-- Input capture 2 prescaler
IC2PCS : CCMR1_Input_IC2PCS_Field := 16#0#;
-- Input capture 2 filter
IC2F : CCMR1_Input_IC2F_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCMR1_Input_Register use record
CC1S at 0 range 0 .. 1;
ICPCS at 0 range 2 .. 3;
IC1F at 0 range 4 .. 7;
CC2S at 0 range 8 .. 9;
IC2PCS at 0 range 10 .. 11;
IC2F at 0 range 12 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
---------------------------
-- CCMR2_Output_Register --
---------------------------
subtype CCMR2_Output_CC3S_Field is STM32.UInt2;
subtype CCMR2_Output_OC3FE_Field is STM32.Bit;
subtype CCMR2_Output_OC3PE_Field is STM32.Bit;
subtype CCMR2_Output_OC3M_Field is STM32.UInt3;
subtype CCMR2_Output_OC3CE_Field is STM32.Bit;
subtype CCMR2_Output_CC4S_Field is STM32.UInt2;
subtype CCMR2_Output_OC4FE_Field is STM32.Bit;
subtype CCMR2_Output_OC4PE_Field is STM32.Bit;
subtype CCMR2_Output_OC4M_Field is STM32.UInt3;
subtype CCMR2_Output_OC4CE_Field is STM32.Bit;
-- capture/compare mode register (output mode)
type CCMR2_Output_Register is record
-- Capture/Compare 3 selection
CC3S : CCMR2_Output_CC3S_Field := 16#0#;
-- Output compare 3 fast enable
OC3FE : CCMR2_Output_OC3FE_Field := 16#0#;
-- Output compare 3 preload enable
OC3PE : CCMR2_Output_OC3PE_Field := 16#0#;
-- Output compare 3 mode
OC3M : CCMR2_Output_OC3M_Field := 16#0#;
-- Output compare 3 clear enable
OC3CE : CCMR2_Output_OC3CE_Field := 16#0#;
-- Capture/Compare 4 selection
CC4S : CCMR2_Output_CC4S_Field := 16#0#;
-- Output compare 4 fast enable
OC4FE : CCMR2_Output_OC4FE_Field := 16#0#;
-- Output compare 4 preload enable
OC4PE : CCMR2_Output_OC4PE_Field := 16#0#;
-- Output compare 4 mode
OC4M : CCMR2_Output_OC4M_Field := 16#0#;
-- Output compare 4 clear enable
OC4CE : CCMR2_Output_OC4CE_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCMR2_Output_Register use record
CC3S at 0 range 0 .. 1;
OC3FE at 0 range 2 .. 2;
OC3PE at 0 range 3 .. 3;
OC3M at 0 range 4 .. 6;
OC3CE at 0 range 7 .. 7;
CC4S at 0 range 8 .. 9;
OC4FE at 0 range 10 .. 10;
OC4PE at 0 range 11 .. 11;
OC4M at 0 range 12 .. 14;
OC4CE at 0 range 15 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
--------------------------
-- CCMR2_Input_Register --
--------------------------
subtype CCMR2_Input_CC3S_Field is STM32.UInt2;
subtype CCMR2_Input_IC3PSC_Field is STM32.UInt2;
subtype CCMR2_Input_IC3F_Field is STM32.UInt4;
subtype CCMR2_Input_CC4S_Field is STM32.UInt2;
subtype CCMR2_Input_IC4PSC_Field is STM32.UInt2;
subtype CCMR2_Input_IC4F_Field is STM32.UInt4;
-- capture/compare mode register 2 (input mode)
type CCMR2_Input_Register is record
-- Capture/compare 3 selection
CC3S : CCMR2_Input_CC3S_Field := 16#0#;
-- Input capture 3 prescaler
IC3PSC : CCMR2_Input_IC3PSC_Field := 16#0#;
-- Input capture 3 filter
IC3F : CCMR2_Input_IC3F_Field := 16#0#;
-- Capture/Compare 4 selection
CC4S : CCMR2_Input_CC4S_Field := 16#0#;
-- Input capture 4 prescaler
IC4PSC : CCMR2_Input_IC4PSC_Field := 16#0#;
-- Input capture 4 filter
IC4F : CCMR2_Input_IC4F_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCMR2_Input_Register use record
CC3S at 0 range 0 .. 1;
IC3PSC at 0 range 2 .. 3;
IC3F at 0 range 4 .. 7;
CC4S at 0 range 8 .. 9;
IC4PSC at 0 range 10 .. 11;
IC4F at 0 range 12 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- CCER_Register --
-------------------
subtype CCER_CC1E_Field is STM32.Bit;
subtype CCER_CC1P_Field is STM32.Bit;
subtype CCER_CC1NE_Field is STM32.Bit;
subtype CCER_CC1NP_Field is STM32.Bit;
subtype CCER_CC2E_Field is STM32.Bit;
subtype CCER_CC2P_Field is STM32.Bit;
subtype CCER_CC2NE_Field is STM32.Bit;
subtype CCER_CC2NP_Field is STM32.Bit;
subtype CCER_CC3E_Field is STM32.Bit;
subtype CCER_CC3P_Field is STM32.Bit;
subtype CCER_CC3NE_Field is STM32.Bit;
subtype CCER_CC3NP_Field is STM32.Bit;
subtype CCER_CC4E_Field is STM32.Bit;
subtype CCER_CC4P_Field is STM32.Bit;
-- capture/compare enable register
type CCER_Register is record
-- Capture/Compare 1 output enable
CC1E : CCER_CC1E_Field := 16#0#;
-- Capture/Compare 1 output Polarity
CC1P : CCER_CC1P_Field := 16#0#;
-- Capture/Compare 1 complementary output enable
CC1NE : CCER_CC1NE_Field := 16#0#;
-- Capture/Compare 1 output Polarity
CC1NP : CCER_CC1NP_Field := 16#0#;
-- Capture/Compare 2 output enable
CC2E : CCER_CC2E_Field := 16#0#;
-- Capture/Compare 2 output Polarity
CC2P : CCER_CC2P_Field := 16#0#;
-- Capture/Compare 2 complementary output enable
CC2NE : CCER_CC2NE_Field := 16#0#;
-- Capture/Compare 2 output Polarity
CC2NP : CCER_CC2NP_Field := 16#0#;
-- Capture/Compare 3 output enable
CC3E : CCER_CC3E_Field := 16#0#;
-- Capture/Compare 3 output Polarity
CC3P : CCER_CC3P_Field := 16#0#;
-- Capture/Compare 3 complementary output enable
CC3NE : CCER_CC3NE_Field := 16#0#;
-- Capture/Compare 3 output Polarity
CC3NP : CCER_CC3NP_Field := 16#0#;
-- Capture/Compare 4 output enable
CC4E : CCER_CC4E_Field := 16#0#;
-- Capture/Compare 3 output Polarity
CC4P : CCER_CC4P_Field := 16#0#;
-- unspecified
Reserved_14_31 : STM32.UInt18 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCER_Register use record
CC1E at 0 range 0 .. 0;
CC1P at 0 range 1 .. 1;
CC1NE at 0 range 2 .. 2;
CC1NP at 0 range 3 .. 3;
CC2E at 0 range 4 .. 4;
CC2P at 0 range 5 .. 5;
CC2NE at 0 range 6 .. 6;
CC2NP at 0 range 7 .. 7;
CC3E at 0 range 8 .. 8;
CC3P at 0 range 9 .. 9;
CC3NE at 0 range 10 .. 10;
CC3NP at 0 range 11 .. 11;
CC4E at 0 range 12 .. 12;
CC4P at 0 range 13 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
------------------
-- CNT_Register --
------------------
subtype CNT_CNT_Field is STM32.Short;
-- counter
type CNT_Register is record
-- counter value
CNT : CNT_CNT_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CNT_Register use record
CNT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
------------------
-- PSC_Register --
------------------
subtype PSC_PSC_Field is STM32.Short;
-- prescaler
type PSC_Register is record
-- Prescaler value
PSC : PSC_PSC_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PSC_Register use record
PSC at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
------------------
-- ARR_Register --
------------------
subtype ARR_ARR_Field is STM32.Short;
-- auto-reload register
type ARR_Register is record
-- Auto-reload value
ARR : ARR_ARR_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ARR_Register use record
ARR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
------------------
-- RCR_Register --
------------------
subtype RCR_REP_Field is STM32.Byte;
-- repetition counter register
type RCR_Register is record
-- Repetition counter value
REP : RCR_REP_Field := 16#0#;
-- unspecified
Reserved_8_31 : STM32.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RCR_Register use record
REP at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-------------------
-- CCR1_Register --
-------------------
subtype CCR1_CCR1_Field is STM32.Short;
-- capture/compare register 1
type CCR1_Register is record
-- Capture/Compare 1 value
CCR1 : CCR1_CCR1_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCR1_Register use record
CCR1 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- CCR2_Register --
-------------------
subtype CCR2_CCR2_Field is STM32.Short;
-- capture/compare register 2
type CCR2_Register is record
-- Capture/Compare 2 value
CCR2 : CCR2_CCR2_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCR2_Register use record
CCR2 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- CCR3_Register --
-------------------
subtype CCR3_CCR3_Field is STM32.Short;
-- capture/compare register 3
type CCR3_Register is record
-- Capture/Compare value
CCR3 : CCR3_CCR3_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCR3_Register use record
CCR3 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- CCR4_Register --
-------------------
subtype CCR4_CCR4_Field is STM32.Short;
-- capture/compare register 4
type CCR4_Register is record
-- Capture/Compare value
CCR4 : CCR4_CCR4_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCR4_Register use record
CCR4 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- BDTR_Register --
-------------------
subtype BDTR_DTG_Field is STM32.Byte;
subtype BDTR_LOCK_Field is STM32.UInt2;
subtype BDTR_OSSI_Field is STM32.Bit;
subtype BDTR_OSSR_Field is STM32.Bit;
subtype BDTR_BKE_Field is STM32.Bit;
subtype BDTR_BKP_Field is STM32.Bit;
subtype BDTR_AOE_Field is STM32.Bit;
subtype BDTR_MOE_Field is STM32.Bit;
-- break and dead-time register
type BDTR_Register is record
-- Dead-time generator setup
DTG : BDTR_DTG_Field := 16#0#;
-- Lock configuration
LOCK : BDTR_LOCK_Field := 16#0#;
-- Off-state selection for Idle mode
OSSI : BDTR_OSSI_Field := 16#0#;
-- Off-state selection for Run mode
OSSR : BDTR_OSSR_Field := 16#0#;
-- Break enable
BKE : BDTR_BKE_Field := 16#0#;
-- Break polarity
BKP : BDTR_BKP_Field := 16#0#;
-- Automatic output enable
AOE : BDTR_AOE_Field := 16#0#;
-- Main output enable
MOE : BDTR_MOE_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BDTR_Register use record
DTG at 0 range 0 .. 7;
LOCK at 0 range 8 .. 9;
OSSI at 0 range 10 .. 10;
OSSR at 0 range 11 .. 11;
BKE at 0 range 12 .. 12;
BKP at 0 range 13 .. 13;
AOE at 0 range 14 .. 14;
MOE at 0 range 15 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
------------------
-- DCR_Register --
------------------
subtype DCR_DBA_Field is STM32.UInt5;
subtype DCR_DBL_Field is STM32.UInt5;
-- DMA control register
type DCR_Register is record
-- DMA base address
DBA : DCR_DBA_Field := 16#0#;
-- unspecified
Reserved_5_7 : STM32.UInt3 := 16#0#;
-- DMA burst length
DBL : DCR_DBL_Field := 16#0#;
-- unspecified
Reserved_13_31 : STM32.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DCR_Register use record
DBA at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
DBL at 0 range 8 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
-------------------
-- DMAR_Register --
-------------------
subtype DMAR_DMAB_Field is STM32.Short;
-- DMA address for full transfer
type DMAR_Register is record
-- DMA register for burst accesses
DMAB : DMAR_DMAB_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DMAR_Register use record
DMAB at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
------------------
-- CR2_Register --
------------------
-- control register 2
type CR2_Register_1 is record
-- unspecified
Reserved_0_2 : STM32.UInt3 := 16#0#;
-- Capture/compare DMA selection
CCDS : CR2_CCDS_Field := 16#0#;
-- Master mode selection
MMS : CR2_MMS_Field := 16#0#;
-- TI1 selection
TI1S : CR2_TI1S_Field := 16#0#;
-- unspecified
Reserved_8_31 : STM32.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR2_Register_1 use record
Reserved_0_2 at 0 range 0 .. 2;
CCDS at 0 range 3 .. 3;
MMS at 0 range 4 .. 6;
TI1S at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-------------------
-- DIER_Register --
-------------------
-- DMA/Interrupt enable register
type DIER_Register_1 is record
-- Update interrupt enable
UIE : DIER_UIE_Field := 16#0#;
-- Capture/Compare 1 interrupt enable
CC1IE : DIER_CC1IE_Field := 16#0#;
-- Capture/Compare 2 interrupt enable
CC2IE : DIER_CC2IE_Field := 16#0#;
-- Capture/Compare 3 interrupt enable
CC3IE : DIER_CC3IE_Field := 16#0#;
-- Capture/Compare 4 interrupt enable
CC4IE : DIER_CC4IE_Field := 16#0#;
-- unspecified
Reserved_5_5 : STM32.Bit := 16#0#;
-- Trigger interrupt enable
TIE : DIER_TIE_Field := 16#0#;
-- unspecified
Reserved_7_7 : STM32.Bit := 16#0#;
-- Update DMA request enable
UDE : DIER_UDE_Field := 16#0#;
-- Capture/Compare 1 DMA request enable
CC1DE : DIER_CC1DE_Field := 16#0#;
-- Capture/Compare 2 DMA request enable
CC2DE : DIER_CC2DE_Field := 16#0#;
-- Capture/Compare 3 DMA request enable
CC3DE : DIER_CC3DE_Field := 16#0#;
-- Capture/Compare 4 DMA request enable
CC4DE : DIER_CC4DE_Field := 16#0#;
-- Reserved
COMDE : DIER_COMDE_Field := 16#0#;
-- Trigger DMA request enable
TDE : DIER_TDE_Field := 16#0#;
-- unspecified
Reserved_15_31 : STM32.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIER_Register_1 use record
UIE at 0 range 0 .. 0;
CC1IE at 0 range 1 .. 1;
CC2IE at 0 range 2 .. 2;
CC3IE at 0 range 3 .. 3;
CC4IE at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
TIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
UDE at 0 range 8 .. 8;
CC1DE at 0 range 9 .. 9;
CC2DE at 0 range 10 .. 10;
CC3DE at 0 range 11 .. 11;
CC4DE at 0 range 12 .. 12;
COMDE at 0 range 13 .. 13;
TDE at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-----------------
-- SR_Register --
-----------------
-- status register
type SR_Register_1 is record
-- Update interrupt flag
UIF : SR_UIF_Field := 16#0#;
-- Capture/compare 1 interrupt flag
CC1IF : SR_CC1IF_Field := 16#0#;
-- Capture/Compare 2 interrupt flag
CC2IF : SR_CC2IF_Field := 16#0#;
-- Capture/Compare 3 interrupt flag
CC3IF : SR_CC3IF_Field := 16#0#;
-- Capture/Compare 4 interrupt flag
CC4IF : SR_CC4IF_Field := 16#0#;
-- unspecified
Reserved_5_5 : STM32.Bit := 16#0#;
-- Trigger interrupt flag
TIF : SR_TIF_Field := 16#0#;
-- unspecified
Reserved_7_8 : STM32.UInt2 := 16#0#;
-- Capture/Compare 1 overcapture flag
CC1OF : SR_CC1OF_Field := 16#0#;
-- Capture/compare 2 overcapture flag
CC2OF : SR_CC2OF_Field := 16#0#;
-- Capture/Compare 3 overcapture flag
CC3OF : SR_CC3OF_Field := 16#0#;
-- Capture/Compare 4 overcapture flag
CC4OF : SR_CC4OF_Field := 16#0#;
-- unspecified
Reserved_13_31 : STM32.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register_1 use record
UIF at 0 range 0 .. 0;
CC1IF at 0 range 1 .. 1;
CC2IF at 0 range 2 .. 2;
CC3IF at 0 range 3 .. 3;
CC4IF at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
TIF at 0 range 6 .. 6;
Reserved_7_8 at 0 range 7 .. 8;
CC1OF at 0 range 9 .. 9;
CC2OF at 0 range 10 .. 10;
CC3OF at 0 range 11 .. 11;
CC4OF at 0 range 12 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
------------------
-- EGR_Register --
------------------
-- event generation register
type EGR_Register_1 is record
-- Write-only. Update generation
UG : EGR_UG_Field := 16#0#;
-- Write-only. Capture/compare 1 generation
CC1G : EGR_CC1G_Field := 16#0#;
-- Write-only. Capture/compare 2 generation
CC2G : EGR_CC2G_Field := 16#0#;
-- Write-only. Capture/compare 3 generation
CC3G : EGR_CC3G_Field := 16#0#;
-- Write-only. Capture/compare 4 generation
CC4G : EGR_CC4G_Field := 16#0#;
-- unspecified
Reserved_5_5 : STM32.Bit := 16#0#;
-- Write-only. Trigger generation
TG : EGR_TG_Field := 16#0#;
-- unspecified
Reserved_7_31 : STM32.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EGR_Register_1 use record
UG at 0 range 0 .. 0;
CC1G at 0 range 1 .. 1;
CC2G at 0 range 2 .. 2;
CC3G at 0 range 3 .. 3;
CC4G at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
TG at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
--------------------------
-- CCMR1_Input_Register --
--------------------------
subtype CCMR1_Input_IC1PSC_Field is STM32.UInt2;
subtype CCMR1_Input_IC2PSC_Field is STM32.UInt2;
-- capture/compare mode register 1 (input mode)
type CCMR1_Input_Register_1 is record
-- Capture/Compare 1 selection
CC1S : CCMR1_Input_CC1S_Field := 16#0#;
-- Input capture 1 prescaler
IC1PSC : CCMR1_Input_IC1PSC_Field := 16#0#;
-- Input capture 1 filter
IC1F : CCMR1_Input_IC1F_Field := 16#0#;
-- Capture/compare 2 selection
CC2S : CCMR1_Input_CC2S_Field := 16#0#;
-- Input capture 2 prescaler
IC2PSC : CCMR1_Input_IC2PSC_Field := 16#0#;
-- Input capture 2 filter
IC2F : CCMR1_Input_IC2F_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32.Short := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCMR1_Input_Register_1 use record
CC1S at 0 range 0 .. 1;
IC1PSC at 0 range 2 .. 3;
IC1F at 0 range 4 .. 7;
CC2S at 0 range 8 .. 9;
IC2PSC at 0 range 10 .. 11;
IC2F at 0 range 12 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-------------------
-- CCER_Register --
-------------------
-- capture/compare enable register
type CCER_Register_1 is record
-- Capture/Compare 1 output enable
CC1E : CCER_CC1E_Field := 16#0#;
-- Capture/Compare 1 output Polarity
CC1P : CCER_CC1P_Field := 16#0#;
-- unspecified
Reserved_2_3 : STM32.UInt2 := 16#0#;
-- Capture/Compare 2 output enable
CC2E : CCER_CC2E_Field := 16#0#;
-- Capture/Compare 2 output Polarity
CC2P : CCER_CC2P_Field := 16#0#;
-- unspecified
Reserved_6_7 : STM32.UInt2 := 16#0#;
-- Capture/Compare 3 output enable
CC3E : CCER_CC3E_Field := 16#0#;
-- Capture/Compare 3 output Polarity
CC3P : CCER_CC3P_Field := 16#0#;
-- unspecified
Reserved_10_11 : STM32.UInt2 := 16#0#;
-- Capture/Compare 4 output enable
CC4E : CCER_CC4E_Field := 16#0#;
-- Capture/Compare 3 output Polarity
CC4P : CCER_CC4P_Field := 16#0#;
-- unspecified
Reserved_14_31 : STM32.UInt18 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCER_Register_1 use record
CC1E at 0 range 0 .. 0;
CC1P at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
CC2E at 0 range 4 .. 4;
CC2P at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
CC3E at 0 range 8 .. 8;
CC3P at 0 range 9 .. 9;
Reserved_10_11 at 0 range 10 .. 11;
CC4E at 0 range 12 .. 12;
CC4P at 0 range 13 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
------------------
-- CR1_Register --
------------------
-- control register 1
type CR1_Register_1 is record
-- Counter enable
CEN : CR1_CEN_Field := 16#0#;
-- Update disable
UDIS : CR1_UDIS_Field := 16#0#;
-- Update request source
URS : CR1_URS_Field := 16#0#;
-- One-pulse mode
OPM : CR1_OPM_Field := 16#0#;
-- unspecified
Reserved_4_6 : STM32.UInt3 := 16#0#;
-- Auto-reload preload enable
ARPE : CR1_ARPE_Field := 16#0#;
-- unspecified
Reserved_8_31 : STM32.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR1_Register_1 use record
CEN at 0 range 0 .. 0;
UDIS at 0 range 1 .. 1;
URS at 0 range 2 .. 2;
OPM at 0 range 3 .. 3;
Reserved_4_6 at 0 range 4 .. 6;
ARPE at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
------------------
-- CR2_Register --
------------------
-- control register 2
type CR2_Register_2 is record
-- unspecified
Reserved_0_3 : STM32.UInt4 := 16#0#;
-- Master mode selection
MMS : CR2_MMS_Field := 16#0#;
-- unspecified
Reserved_7_31 : STM32.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR2_Register_2 use record
Reserved_0_3 at 0 range 0 .. 3;
MMS at 0 range 4 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
-------------------
-- DIER_Register --
-------------------
-- DMA/Interrupt enable register
type DIER_Register_2 is record
-- Update interrupt enable
UIE : DIER_UIE_Field := 16#0#;
-- unspecified
Reserved_1_7 : STM32.UInt7 := 16#0#;
-- Update DMA request enable
UDE : DIER_UDE_Field := 16#0#;
-- unspecified
Reserved_9_31 : STM32.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIER_Register_2 use record
UIE at 0 range 0 .. 0;
Reserved_1_7 at 0 range 1 .. 7;
UDE at 0 range 8 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
-----------------
-- SR_Register --
-----------------
-- status register
type SR_Register_2 is record
-- Update interrupt flag
UIF : SR_UIF_Field := 16#0#;
-- unspecified
Reserved_1_31 : STM32.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register_2 use record
UIF at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
------------------
-- EGR_Register --
------------------
-- event generation register
type EGR_Register_2 is record
-- Write-only. Update generation
UG : EGR_UG_Field := 16#0#;
-- unspecified
Reserved_1_31 : STM32.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EGR_Register_2 use record
UG at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
type TIM2_Disc is
(
Output,
Input);
-- General purpose timer
type TIM2_Peripheral
(Discriminent : TIM2_Disc := Output)
is record
-- control register 1
CR1 : CR1_Register;
-- control register 2
CR2 : CR2_Register_1;
-- slave mode control register
SMCR : SMCR_Register;
-- DMA/Interrupt enable register
DIER : DIER_Register_1;
-- status register
SR : SR_Register_1;
-- event generation register
EGR : EGR_Register_1;
-- capture/compare enable register
CCER : CCER_Register_1;
-- counter
CNT : CNT_Register;
-- prescaler
PSC : PSC_Register;
-- auto-reload register
ARR : ARR_Register;
-- capture/compare register 1
CCR1 : CCR1_Register;
-- capture/compare register 2
CCR2 : CCR2_Register;
-- capture/compare register 3
CCR3 : CCR3_Register;
-- capture/compare register 4
CCR4 : CCR4_Register;
-- DMA control register
DCR : DCR_Register;
-- DMA address for full transfer
DMAR : DMAR_Register;
case Discriminent is
when Output =>
-- capture/compare mode register 1 (output mode)
CCMR1_Output : CCMR1_Output_Register;
-- capture/compare mode register 2 (output mode)
CCMR2_Output : CCMR2_Output_Register;
when Input =>
-- capture/compare mode register 1 (input mode)
CCMR1_Input : CCMR1_Input_Register_1;
-- capture/compare mode register 2 (input mode)
CCMR2_Input : CCMR2_Input_Register;
end case;
end record
with Unchecked_Union, Volatile;
for TIM2_Peripheral use record
CR1 at 0 range 0 .. 31;
CR2 at 4 range 0 .. 31;
SMCR at 8 range 0 .. 31;
DIER at 12 range 0 .. 31;
SR at 16 range 0 .. 31;
EGR at 20 range 0 .. 31;
CCER at 32 range 0 .. 31;
CNT at 36 range 0 .. 31;
PSC at 40 range 0 .. 31;
ARR at 44 range 0 .. 31;
CCR1 at 52 range 0 .. 31;
CCR2 at 56 range 0 .. 31;
CCR3 at 60 range 0 .. 31;
CCR4 at 64 range 0 .. 31;
DCR at 72 range 0 .. 31;
DMAR at 76 range 0 .. 31;
CCMR1_Output at 24 range 0 .. 31;
CCMR2_Output at 28 range 0 .. 31;
CCMR1_Input at 24 range 0 .. 31;
CCMR2_Input at 28 range 0 .. 31;
end record;
-- General purpose timer
TIM2_Periph : aliased TIM2_Peripheral
with Import, Address => TIM2_Base;
-- General purpose timer
TIM3_Periph : aliased TIM2_Peripheral
with Import, Address => TIM3_Base;
-- General purpose timer
TIM4_Periph : aliased TIM2_Peripheral
with Import, Address => TIM4_Base;
-- General purpose timer
TIM5_Periph : aliased TIM2_Peripheral
with Import, Address => TIM5_Base;
-- Basic timer
type TIM6_Peripheral is record
-- control register 1
CR1 : CR1_Register_1;
-- control register 2
CR2 : CR2_Register_2;
-- DMA/Interrupt enable register
DIER : DIER_Register_2;
-- status register
SR : SR_Register_2;
-- event generation register
EGR : EGR_Register_2;
-- counter
CNT : CNT_Register;
-- prescaler
PSC : PSC_Register;
-- auto-reload register
ARR : ARR_Register;
end record
with Volatile;
for TIM6_Peripheral use record
CR1 at 0 range 0 .. 31;
CR2 at 4 range 0 .. 31;
DIER at 12 range 0 .. 31;
SR at 16 range 0 .. 31;
EGR at 20 range 0 .. 31;
CNT at 36 range 0 .. 31;
PSC at 40 range 0 .. 31;
ARR at 44 range 0 .. 31;
end record;
-- Basic timer
TIM6_Periph : aliased TIM6_Peripheral
with Import, Address => TIM6_Base;
-- Basic timer
TIM7_Periph : aliased TIM6_Peripheral
with Import, Address => TIM7_Base;
type TIM1_Disc is
(
Output,
Input);
-- Advanced timer
type TIM1_Peripheral
(Discriminent : TIM1_Disc := Output)
is record
-- control register 1
CR1 : CR1_Register;
-- control register 2
CR2 : CR2_Register;
-- slave mode control register
SMCR : SMCR_Register;
-- DMA/Interrupt enable register
DIER : DIER_Register;
-- status register
SR : SR_Register;
-- event generation register
EGR : EGR_Register;
-- capture/compare enable register
CCER : CCER_Register;
-- counter
CNT : CNT_Register;
-- prescaler
PSC : PSC_Register;
-- auto-reload register
ARR : ARR_Register;
-- repetition counter register
RCR : RCR_Register;
-- capture/compare register 1
CCR1 : CCR1_Register;
-- capture/compare register 2
CCR2 : CCR2_Register;
-- capture/compare register 3
CCR3 : CCR3_Register;
-- capture/compare register 4
CCR4 : CCR4_Register;
-- break and dead-time register
BDTR : BDTR_Register;
-- DMA control register
DCR : DCR_Register;
-- DMA address for full transfer
DMAR : DMAR_Register;
case Discriminent is
when Output =>
-- capture/compare mode register (output mode)
CCMR1_Output : CCMR1_Output_Register;
-- capture/compare mode register (output mode)
CCMR2_Output : CCMR2_Output_Register;
when Input =>
-- capture/compare mode register 1 (input mode)
CCMR1_Input : CCMR1_Input_Register;
-- capture/compare mode register 2 (input mode)
CCMR2_Input : CCMR2_Input_Register;
end case;
end record
with Unchecked_Union, Volatile;
for TIM1_Peripheral use record
CR1 at 0 range 0 .. 31;
CR2 at 4 range 0 .. 31;
SMCR at 8 range 0 .. 31;
DIER at 12 range 0 .. 31;
SR at 16 range 0 .. 31;
EGR at 20 range 0 .. 31;
CCER at 32 range 0 .. 31;
CNT at 36 range 0 .. 31;
PSC at 40 range 0 .. 31;
ARR at 44 range 0 .. 31;
RCR at 48 range 0 .. 31;
CCR1 at 52 range 0 .. 31;
CCR2 at 56 range 0 .. 31;
CCR3 at 60 range 0 .. 31;
CCR4 at 64 range 0 .. 31;
BDTR at 68 range 0 .. 31;
DCR at 72 range 0 .. 31;
DMAR at 76 range 0 .. 31;
CCMR1_Output at 24 range 0 .. 31;
CCMR2_Output at 28 range 0 .. 31;
CCMR1_Input at 24 range 0 .. 31;
CCMR2_Input at 28 range 0 .. 31;
end record;
-- Advanced timer
TIM1_Periph : aliased TIM1_Peripheral
with Import, Address => TIM1_Base;
end STM32.TIM;
| 33.931624 | 67 | 0.548169 |
20b9e8665ac8142bf1ec55b20d4775249b5f0257 | 4,033 | adb | Ada | Ada95/src/terminal_interface-curses-menus-menu_user_data.adb | mvaisakh/android_external_libncurses | d44c8a16d7f1ed276d0de0b3f6f1a5596c5f556f | [
"DOC",
"Unlicense"
] | 35 | 2015-03-07T13:26:22.000Z | 2021-11-06T16:18:59.000Z | Ada95/src/terminal_interface-curses-menus-menu_user_data.adb | mvaisakh/android_external_libncurses | d44c8a16d7f1ed276d0de0b3f6f1a5596c5f556f | [
"DOC",
"Unlicense"
] | 3 | 2017-04-07T21:02:48.000Z | 2017-04-08T17:59:35.000Z | Ada95/src/terminal_interface-curses-menus-menu_user_data.adb | mvaisakh/android_external_libncurses | d44c8a16d7f1ed276d0de0b3f6f1a5596c5f556f | [
"DOC",
"Unlicense"
] | 19 | 2015-06-16T06:13:44.000Z | 2021-07-24T02:37:45.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Menus.Menu_User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Menus.Menu_User_Data is
use type Interfaces.C.int;
procedure Set_User_Data (Men : in Menu;
Data : in User_Access)
is
function Set_Menu_Userptr (Men : Menu;
Data : User_Access) return C_Int;
pragma Import (C, Set_Menu_Userptr, "set_menu_userptr");
Res : constant Eti_Error := Set_Menu_Userptr (Men, Data);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
end Set_User_Data;
function Get_User_Data (Men : in Menu) return User_Access
is
function Menu_Userptr (Men : Menu) return User_Access;
pragma Import (C, Menu_Userptr, "menu_userptr");
begin
return Menu_Userptr (Men);
end Get_User_Data;
procedure Get_User_Data (Men : in Menu;
Data : out User_Access)
is
begin
Data := Get_User_Data (Men);
end Get_User_Data;
end Terminal_Interface.Curses.Menus.Menu_User_Data;
| 52.376623 | 78 | 0.470865 |
df3edc6725bd7e2a8f39ba922deb4a6ce7905eb1 | 3,040 | adb | Ada | src/core/irc.adb | Okasu/Byron | 85b4b69fce59adecc8b5285f4a3bd6a561a038f4 | [
"BSD-2-Clause"
] | 1 | 2017-10-07T05:51:13.000Z | 2017-10-07T05:51:13.000Z | src/core/irc.adb | gsmnv/Byron | 85b4b69fce59adecc8b5285f4a3bd6a561a038f4 | [
"BSD-2-Clause"
] | null | null | null | src/core/irc.adb | gsmnv/Byron | 85b4b69fce59adecc8b5285f4a3bd6a561a038f4 | [
"BSD-2-Clause"
] | null | null | null | package body IRC
is
Client : Socket_Type;
Channel : Stream_Access;
Current_Line : Unbounded_String;
procedure Connect_To (Server : Sock_Addr_Type)
is
begin
Create_Socket (Client);
Connect_Socket (Client, Server);
Channel := Stream (Client);
end Connect_To;
function Get_Line return Unbounded_String
is
Line : Unbounded_String;
Char : Character;
begin
loop
Char := Character'Input (Channel);
if Char = ASCII.LF then
Current_Line := Line;
return Line;
elsif Char /= ASCII.CR then
Append (Line, Char);
end if;
end loop;
end Get_Line;
procedure Put_Line (Line : String)
is
CRLF : constant String := ASCII.CR & ASCII.LF;
begin
String'Write (Channel, Line & CRLF);
end Put_Line;
procedure Set_Nick (Nick : String)
is
begin
Put_Line ("NICK " & Nick);
Put_Line ("USER " & Nick & " 0 * :Byron IRC bot, https://github.com/gsmnv/Byron");
end Set_Nick;
procedure Join_Channel (Chan : String)
is
begin
Put_Line ("JOIN " & Chan);
end Join_Channel;
function Get_Message return Message
is
Msg : Message;
Count : Integer := 1;
begin
for I in 1 .. Length (Current_Line) loop
if Count > 3 then
Append (Msg.Content, Element (Current_Line, I));
elsif Element (Current_Line, I) /= ' ' then
if Count = 1 then
Append (Msg.Sender, Element (Current_Line, I));
elsif Count = 2 then
Append (Msg.Mode, Element (Current_Line, I));
elsif Count = 3 then
Append (Msg.Channel, Element (Current_Line, I));
end if;
else
Count := Count + 1;
end if;
end loop;
if Element (Current_Line, 1) = ':' then
-- Remove ':' from Message
Replace_Slice (Msg.Sender, 1, 1, "");
Replace_Slice (Msg.Content, 1, 1, "");
-- Check if private message
if Element (Msg.Channel, 1) /= '#' then
Msg.Channel := Get_Nick (Msg);
end if;
end if;
return Msg;
end Get_Message;
procedure Put_Message (Msg : Message)
is
begin
Put_Line (To_String (Msg.Mode & " " & Msg.Channel & " :" & Msg.Content));
end Put_Message;
procedure Pong
is
Line : constant String := To_String (Current_Line);
begin
if Line (1 .. 4) = "PING" then
Put_Line ("PONG " & Line (6 .. Line'Length));
else
null;
end if;
end Pong;
function Get_Nick (Msg : Message) return Unbounded_String
is
Nick : Unbounded_String := Msg.Sender;
begin
Replace_Slice (Nick, Index (Nick, "!"), Length (Nick), "");
return Nick;
exception
when Constraint_Error =>
return Nick;
end Get_Nick;
procedure Identify (Password : String)
is
begin
Put_Line ("NICKSERV IDENTIFY " & Password);
end Identify;
end IRC;
| 24.715447 | 88 | 0.564803 |
1c05975923d79d87deec32dd24106dd31bb246e4 | 3,244 | adb | Ada | PIM/TD3_Sous_Programmes/base_valide.adb | Hathoute/ENSEEIHT | d42f0b0dedb269e6df3b1c006d4d45e52fc518b8 | [
"MIT"
] | 1 | 2021-06-26T21:51:11.000Z | 2021-06-26T21:51:11.000Z | PIM/TD3_Sous_Programmes/base_valide.adb | Hathoute/ENSEEIHT | d42f0b0dedb269e6df3b1c006d4d45e52fc518b8 | [
"MIT"
] | null | null | null | PIM/TD3_Sous_Programmes/base_valide.adb | Hathoute/ENSEEIHT | d42f0b0dedb269e6df3b1c006d4d45e52fc518b8 | [
"MIT"
] | null | null | null | with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Lire_Entier is
Base_MAX : constant Integer := 10 + 26; -- 10 chiffres ('0'..'9') + 26 lettres ('A'..'Z')
-- Est-ce que la base est valide ?
function Est_Base_Valide(Base : in Integer) return Boolean is
begin
return 2 <= Base and Base <= Base_MAX;
--return True;
end Est_Base_Valide;
-- Transformer indice en nombre entierdans base10
function Indice_En_Base10(Indice: Character) return Integer is
begin
if Indice >= '0' and Indice <= '9' then
return Character'Pos(Indice) - Character'Pos('0');
else
return 10 + Character'Pos(Indice) - Character'Pos('A');
end if;
end Indice_En_Base10;
function Nombre_En_Indice(Nombre: Integer) return Character is
begin
if Nombre < 10 then
return Character'Val(Nombre + Character'Pos('0'));
else
return Character'Val(Nombre - 10 + Character'Pos('A'));
end if;
end Nombre_En_Indice;
-- Lire un entier au clavier dans la base considérée.
procedure Lire (
Nombre: out Integer ; -- l'entier lu au clavier
Base: in Integer := 10 -- la base à utiliser
) with
Pre => Est_Base_Valide (Base)
is
NbrEnBase: String(1 .. 10);
Iteration: Integer;
begin
Get_Line(NbrEnBase, Iteration);
Nombre := 0;
for char of NbrEnBase loop
Iteration := Iteration - 1;
Nombre := Nombre + Indice_En_Base10(char) * Base**Iteration;
exit when Iteration = 0;
end loop;
end Lire;
-- Écrire un entier dans une base donnée.
procedure Ecrire (
Nombre: in Integer ; -- l'entier à écrire
Base : in Integer -- la base à utliser
) with
Pre => Est_Base_Valide (Base)
and Nombre >= 0
is
begin
if Nombre < Base then
Put(Nombre_En_Indice(Nombre));
return;
end if;
Ecrire(Nombre/Base, Base);
Put(Nombre_En_Indice(Nombre mod Base));
end Ecrire;
Base_Lecture: Integer; -- la base de l'entier lu
Base_Ecriture: Integer; -- la base de l'entier écrit
Un_Entier: Integer; -- un entier lu au clavier
begin
-- Demander la base de lecture
Put ("Base de l'entier lu : ");
Get (Base_Lecture);
Skip_Line;
-- Demander un entier
Put ("Un entier (base ");
Put (Base_Lecture, 1);
Put (") : ");
if Est_Base_Valide(Base_Lecture) then
Lire (Un_Entier, Base_Lecture);
else
Skip_Line;
Un_Entier := 0;
end if;
-- Afficher l'entier lu en base 10
Put ("L'entier lu est (base 10) : ");
Put (Un_Entier, 1);
New_Line;
-- Demander la base d'écriture
Put ("Base pour écrire l'entier : ");
Get (Base_Ecriture);
Skip_Line;
-- Afficher l'entier lu dans la base d'écriture
if Est_Base_Valide(Base_Lecture) then
Put ("L'entier en base ");
Put (Base_Ecriture, 1);
Put (" est ");
Ecrire (Un_Entier, Base_Ecriture);
New_Line;
end if;
-- Remarque : on aurait pu utiliser les sous-programme Lire pour lire
-- les bases et Ecrire pour les écrire en base 10. Nous utilisons les
-- Get et Put d'Ada pour faciliter le test du programme.
end Lire_Entier; | 27.726496 | 90 | 0.629162 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.