repo_name
stringlengths 9
74
| language
stringclasses 1
value | length_bytes
int64 11
9.34M
| extension
stringclasses 2
values | content
stringlengths 11
9.34M
|
---|---|---|---|---|
reznikmm/matreshka | Ada | 19,773 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Multiplicity_Elements;
with AMF.Internals.UML_Named_Elements;
with AMF.UML.Activities;
with AMF.UML.Activity_Edges.Collections;
with AMF.UML.Activity_Groups.Collections;
with AMF.UML.Activity_Nodes.Collections;
with AMF.UML.Activity_Partitions.Collections;
with AMF.UML.Behaviors;
with AMF.UML.Classifiers.Collections;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Interruptible_Activity_Regions.Collections;
with AMF.UML.Multiplicity_Elements;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces;
with AMF.UML.Output_Pins;
with AMF.UML.Packages.Collections;
with AMF.UML.Redefinable_Elements.Collections;
with AMF.UML.States.Collections;
with AMF.UML.String_Expressions;
with AMF.UML.Structured_Activity_Nodes;
with AMF.UML.Types;
with AMF.UML.Value_Specifications;
with AMF.Visitors;
package AMF.Internals.UML_Output_Pins is
package UML_Multiplicity_Elements is
new AMF.Internals.UML_Multiplicity_Elements
(AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy);
type UML_Output_Pin_Proxy is
limited new UML_Multiplicity_Elements.UML_Multiplicity_Element_Proxy
and AMF.UML.Output_Pins.UML_Output_Pin with null record;
overriding function Get_Is_Control
(Self : not null access constant UML_Output_Pin_Proxy)
return Boolean;
-- Getter of Pin::isControl.
--
-- Tells whether the pins provide data to the actions, or just controls
-- when it executes it.
overriding procedure Set_Is_Control
(Self : not null access UML_Output_Pin_Proxy;
To : Boolean);
-- Setter of Pin::isControl.
--
-- Tells whether the pins provide data to the actions, or just controls
-- when it executes it.
overriding function Get_In_State
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.States.Collections.Set_Of_UML_State;
-- Getter of ObjectNode::inState.
--
-- The required states of the object available at this point in the
-- activity.
overriding function Get_Is_Control_Type
(Self : not null access constant UML_Output_Pin_Proxy)
return Boolean;
-- Getter of ObjectNode::isControlType.
--
-- Tells whether the type of the object node is to be treated as control.
overriding procedure Set_Is_Control_Type
(Self : not null access UML_Output_Pin_Proxy;
To : Boolean);
-- Setter of ObjectNode::isControlType.
--
-- Tells whether the type of the object node is to be treated as control.
overriding function Get_Ordering
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.UML_Object_Node_Ordering_Kind;
-- Getter of ObjectNode::ordering.
--
-- Tells whether and how the tokens in the object node are ordered for
-- selection to traverse edges outgoing from the object node.
overriding procedure Set_Ordering
(Self : not null access UML_Output_Pin_Proxy;
To : AMF.UML.UML_Object_Node_Ordering_Kind);
-- Setter of ObjectNode::ordering.
--
-- Tells whether and how the tokens in the object node are ordered for
-- selection to traverse edges outgoing from the object node.
overriding function Get_Selection
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Behaviors.UML_Behavior_Access;
-- Getter of ObjectNode::selection.
--
-- Selects tokens for outgoing edges.
overriding procedure Set_Selection
(Self : not null access UML_Output_Pin_Proxy;
To : AMF.UML.Behaviors.UML_Behavior_Access);
-- Setter of ObjectNode::selection.
--
-- Selects tokens for outgoing edges.
overriding function Get_Upper_Bound
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Value_Specifications.UML_Value_Specification_Access;
-- Getter of ObjectNode::upperBound.
--
-- The maximum number of tokens allowed in the node. Objects cannot flow
-- into the node if the upper bound is reached.
overriding procedure Set_Upper_Bound
(Self : not null access UML_Output_Pin_Proxy;
To : AMF.UML.Value_Specifications.UML_Value_Specification_Access);
-- Setter of ObjectNode::upperBound.
--
-- The maximum number of tokens allowed in the node. Objects cannot flow
-- into the node if the upper bound is reached.
overriding function Get_Activity
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Activities.UML_Activity_Access;
-- Getter of ActivityNode::activity.
--
-- Activity containing the node.
overriding procedure Set_Activity
(Self : not null access UML_Output_Pin_Proxy;
To : AMF.UML.Activities.UML_Activity_Access);
-- Setter of ActivityNode::activity.
--
-- Activity containing the node.
overriding function Get_In_Group
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group;
-- Getter of ActivityNode::inGroup.
--
-- Groups containing the node.
overriding function Get_In_Interruptible_Region
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region;
-- Getter of ActivityNode::inInterruptibleRegion.
--
-- Interruptible regions containing the node.
overriding function Get_In_Partition
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition;
-- Getter of ActivityNode::inPartition.
--
-- Partitions containing the node.
overriding function Get_In_Structured_Node
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access;
-- Getter of ActivityNode::inStructuredNode.
--
-- Structured activity node containing the node.
overriding procedure Set_In_Structured_Node
(Self : not null access UML_Output_Pin_Proxy;
To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access);
-- Setter of ActivityNode::inStructuredNode.
--
-- Structured activity node containing the node.
overriding function Get_Incoming
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of ActivityNode::incoming.
--
-- Edges that have the node as target.
overriding function Get_Outgoing
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of ActivityNode::outgoing.
--
-- Edges that have the node as source.
overriding function Get_Redefined_Node
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node;
-- Getter of ActivityNode::redefinedNode.
--
-- Inherited nodes replaced by this node in a specialization of the
-- activity.
overriding function Get_Is_Leaf
(Self : not null access constant UML_Output_Pin_Proxy)
return Boolean;
-- Getter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding procedure Set_Is_Leaf
(Self : not null access UML_Output_Pin_Proxy;
To : Boolean);
-- Setter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding function Get_Redefined_Element
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
-- Getter of RedefinableElement::redefinedElement.
--
-- The redefinable element that is being redefined by this element.
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of RedefinableElement::redefinitionContext.
--
-- References the contexts that this element may be redefined from.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name_Expression
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UML_Output_Pin_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UML_Output_Pin_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_Type
(Self : not null access constant UML_Output_Pin_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 UML_Output_Pin_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 Is_Consistent_With
(Self : not null access constant UML_Output_Pin_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isConsistentWith.
--
-- The query isConsistentWith() specifies, for any two RedefinableElements
-- in a context in which redefinition is possible, whether redefinition
-- would be logically consistent. By default, this is false; this
-- operation must be overridden for subclasses of RedefinableElement to
-- define the consistency conditions.
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Output_Pin_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isRedefinitionContextValid.
--
-- The query isRedefinitionContextValid() specifies whether the
-- redefinition contexts of this RedefinableElement are properly related
-- to the redefinition contexts of the specified RedefinableElement to
-- allow this element to redefine the other. By default at least one of
-- the redefinition contexts of this element must be a specialization of
-- at least one of the redefinition contexts of the specified element.
overriding function All_Owning_Packages
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Output_Pin_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UML_Output_Pin_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding function Compatible_With
(Self : not null access constant UML_Output_Pin_Proxy;
Other : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
return Boolean;
-- Operation MultiplicityElement::compatibleWith.
--
-- The operation compatibleWith takes another multiplicity as input. It
-- checks if one multiplicity is compatible with another.
overriding function Includes_Cardinality
(Self : not null access constant UML_Output_Pin_Proxy;
C : Integer)
return Boolean;
-- Operation MultiplicityElement::includesCardinality.
--
-- The query includesCardinality() checks whether the specified
-- cardinality is valid for this multiplicity.
overriding function Includes_Multiplicity
(Self : not null access constant UML_Output_Pin_Proxy;
M : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
return Boolean;
-- Operation MultiplicityElement::includesMultiplicity.
--
-- The query includesMultiplicity() checks whether this multiplicity
-- includes all the cardinalities allowed by the specified multiplicity.
overriding function Iss
(Self : not null access constant UML_Output_Pin_Proxy;
Lowerbound : Integer;
Upperbound : Integer)
return Boolean;
-- Operation MultiplicityElement::is.
--
-- The operation is determines if the upper and lower bound of the ranges
-- are the ones given.
overriding procedure Enter_Element
(Self : not null access constant UML_Output_Pin_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_Output_Pin_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_Output_Pin_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_Output_Pins;
|
RREE/ada-util | Ada | 3,433 | ads | -----------------------------------------------------------------------
-- util-http-clients-mockups -- HTTP Clients mockups
-- Copyright (C) 2011, 2012, 2017, 2020 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Http.Clients;
with Ada.Strings.Unbounded;
package Util.Http.Clients.Mockups is
-- Register the Http manager.
procedure Register;
-- Set the path of the file that contains the response for the next
-- <b>Do_Get</b> and <b>Do_Post</b> calls.
procedure Set_File (Path : in String);
private
type File_Http_Manager is new Http_Manager with record
File : Ada.Strings.Unbounded.Unbounded_String;
end record;
type File_Http_Manager_Access is access all File_Http_Manager'Class;
procedure Create (Manager : in File_Http_Manager;
Http : in out Client'Class);
overriding
procedure Do_Get (Manager : in File_Http_Manager;
Http : in Client'Class;
URI : in String;
Reply : out Response'Class);
overriding
procedure Do_Head (Manager : in File_Http_Manager;
Http : in Client'Class;
URI : in String;
Reply : out Response'Class);
overriding
procedure Do_Post (Manager : in File_Http_Manager;
Http : in Client'Class;
URI : in String;
Data : in String;
Reply : out Response'Class);
overriding
procedure Do_Put (Manager : in File_Http_Manager;
Http : in Client'Class;
URI : in String;
Data : in String;
Reply : out Response'Class);
overriding
procedure Do_Patch (Manager : in File_Http_Manager;
Http : in Client'Class;
URI : in String;
Data : in String;
Reply : out Response'Class);
overriding
procedure Do_Delete (Manager : in File_Http_Manager;
Http : in Client'Class;
URI : in String;
Reply : out Response'Class);
overriding
procedure Do_Options (Manager : in File_Http_Manager;
Http : in Client'Class;
URI : in String;
Reply : out Response'Class);
-- Set the timeout for the connection.
overriding
procedure Set_Timeout (Manager : in File_Http_Manager;
Http : in Client'Class;
Timeout : in Duration);
end Util.Http.Clients.Mockups;
|
rogermc2/GA_Ada | Ada | 5,853 | adb |
with Ada.Numerics;
with Ada.Text_IO; use Ada.Text_IO;
with Blade;
with Blade_Types;
with E3GA;
with GA_Utilities;
package body E3GA_Utilities is
-- -------------------------------------------------------------------------
function exp (BV : Multivectors.Bivector) return Multivectors.Rotor is
V : constant Multivectors.M_Vector :=
Inner_Product (BV, BV, Blade.Left_Contraction);
X2 : float := E3GA.e1_e2 (V);
Half_Angle : float;
Cos_HA : float;
Sin_HA : float;
Result : Rotor;
begin
if X2 > 0.0 then
X2 := 0.0;
end if;
Half_Angle := GA_Maths.Float_Functions.Sqrt (-X2);
if Half_Angle = 0.0 then
Update_Scalar_Part (Result, 1.0);
else
Cos_HA := GA_Maths.Float_Functions.Cos (Half_Angle);
Sin_HA := GA_Maths.Float_Functions.Sin (Half_Angle) / Half_Angle;
Result := New_Rotor (0.0, Cos_HA + Sin_HA * BV);
end if;
return Result;
end exp;
-- ----------------------------------------------------------------------------
-- special log() for 3D rotors
function log (R : Multivectors.Rotor) return Multivectors.Bivector is
use E3GA;
R2 : float;
R1 : float;
BV : Bivector;
Result : Bivector;
begin
-- get the bivector 2-blade part of R
BV := New_Bivector (e1_e2 (R), e2_e3 (R), e3_e1 (R));
-- compute the 'reverse norm' of the bivector part of R
R2 := Norm_E (BV);
-- R2 := Norm_R (BV);
if R2 > 0.0 then
-- return _bivector(B * ((float)atan2(R2, _Float(R)) / R2));
R1 := GA_Maths.Float_Functions.Arctan (R2, Scalar_Part (R)) / R2;
Result := R1 * BV;
-- otherwise, avoid divide-by-zero (and below zero due to FP roundoff)
elsif Scalar_Part (R) < 0.0 then
-- Return a 360 degree rotation in an arbitrary plane
Result := Ada.Numerics.Pi * Outer_Product (e1, e2);
else
BV := New_Bivector (0.0, 0.0, 0.0);
end if;
return Result;
end log;
-- ------------------------------------------------------------------------
procedure Print_Rotor (Name : String; R : Multivectors.Rotor) is
begin
GA_Utilities.Print_Multivector (Name, R);
end Print_Rotor;
-- ------------------------------------------------------------------------
procedure Rotor_To_Matrix (R : Multivectors.Rotor;
M : out GA_Maths.GA_Matrix3) is
Rot : constant GA_Maths.Float_4D := E3GA.Get_Coords (R);
begin
M (1, 1) := 1.0 - 2.0 * (Rot (3) * Rot (3) + Rot (4) * Rot (4));
M (2, 1) := 2.0 * (Rot (2) * Rot (3) + Rot (4) * Rot (1));
M (3, 1) := 2.0 * (Rot (2) * Rot (4) - Rot (3) * Rot (1));
M (1, 2) := 2.0 * (Rot (2) * Rot (3) - Rot (4) * Rot (1));
M (2, 2) := 1.0 - 2.0 * (Rot (2) * Rot (2) + Rot (4) * Rot (4));
M (3, 2) := 2.0 * (Rot (3) * Rot (4) + Rot (2) * Rot (1));
M (1, 3) := 2.0 * (Rot (2) * Rot (4) + Rot (3) * Rot (1));
M (2, 3) := 2.0 * (Rot (3) * Rot (4) - Rot (2) * Rot (1));
M (3, 3) := 1.0 - 2.0 * (Rot (2) * Rot (2) + Rot (3) * Rot (3));
end Rotor_To_Matrix;
-- ------------------------------------------------------------------------
-- Based on e3ga.util.rotorFromVectorToVector
function Rotor_Vector_To_Vector (From_V1, To_V2 : Multivectors.M_Vector)
return Multivectors.Rotor is
use GA_Maths.Float_Functions;
S : float;
w0 : M_Vector;
w1 : M_Vector;
w2 : M_Vector;
Nsq : Float;
R : Rotor;
Result : Rotor;
begin
if Scalar_Product (From_V1, To_V2) < -0.9 then
-- "near" 180 degree rotation :
-- v1 factor in returning blade regardless of any loss of precision
-- v1 << (v1^v2) means c3ga::lcont(v1, (v1^v2)),
-- lcont Left_Contraction
w0 := Left_Contraction (From_V1, Outer_Product (From_V1, To_V2));
Nsq := Norm_Esq (w0);
if Nsq = 0.0 then
w1 := Left_Contraction
(From_V1, Outer_Product (From_V1, Basis_Vector (Blade_Types.E3_e1)));
w2 := Left_Contraction
(From_V1, Outer_Product (From_V1, Basis_Vector (Blade_Types.E3_e2)));
if Norm_Esq (w1) > Norm_Esq (w2) then
Result := Outer_Product (From_V1, Unit_e (w1));
else
Result := Outer_Product (From_V1, Unit_e (w2));
end if;
else -- Nsq /= 0.0
-- Replace V1 with -V1 and an additional 180 degree rotation.
S := Sqrt (2.0 * (1.0 - Scalar_Part (Left_Contraction (To_V2, From_V1))));
R := (1.0 - Geometric_Product (To_V2, From_V1)) / S;
Result := Geometric_Product (R, Outer_Product (From_V1, Unit_e (w0)));
end if;
else -- normal case, not "near" 180 degree rotation.
-- (1 + ba)(1 + ab) = 1 + ab + ba + baab
-- = 1 + a.b + a^b + b.a + b^a + 1
-- = 2 + 2a.b + a^b - a^b
-- = 2(1 + a.b)
-- Geometric Algebra for Computer Science, Equation (10.13)
-- S := Sqrt (2.0 * (1.0 + Scalar_Part (Dot (To_V2, From_V1))));
S := Sqrt (2.0 * (1.0 + Scalar_Part (Left_Contraction (To_V2, From_V1))));
Result := To_Rotor ((1.0 + Geometric_Product (To_V2, From_V1)) / S);
end if;
Simplify (Result);
return Result;
exception
when others =>
Put_Line ("An exception occurred in E3GA_Utilities.Rotor_Vector_To_Vector.");
raise;
end Rotor_Vector_To_Vector;
-- ----------------------------------------------------------------------------
end E3GA_Utilities;
|
zhmu/ananas | Ada | 6,275 | ads | ------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . L I N U X --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2022, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
-- This is the MIPS 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;
with System.Parameters;
package System.Linux is
pragma Preelaborate;
----------
-- Time --
----------
subtype int is Interfaces.C.int;
subtype long is Interfaces.C.long;
subtype suseconds_t is Interfaces.C.long;
type time_t is range -2 ** (System.Parameters.time_t_bits - 1)
.. 2 ** (System.Parameters.time_t_bits - 1) - 1;
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 := 145;
-------------
-- 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
SIGEMT : constant := 7; -- EMT
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
SIGBUS : constant := 10; -- bus error
SIGSEGV : constant := 11; -- segmentation violation
SIGSYS : constant := 12; -- bad system call
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 := 16; -- user defined signal 1
SIGUSR2 : constant := 17; -- user defined signal 2
SIGCLD : constant := 18; -- alias for SIGCHLD
SIGCHLD : constant := 18; -- child status change
SIGPWR : constant := 19; -- power-fail restart
SIGWINCH : constant := 20; -- window size change
SIGURG : constant := 21; -- urgent condition on IO channel
SIGPOLL : constant := 22; -- pollable event occurred
SIGIO : constant := 22; -- I/O now possible (4.2 BSD)
SIGSTOP : constant := 23; -- stop (cannot be caught or ignored)
SIGTSTP : constant := 24; -- user stop requested from tty
SIGCONT : constant := 25; -- stopped process has been continued
SIGTTIN : constant := 26; -- background tty read attempted
SIGTTOU : constant := 27; -- background tty write attempted
SIGVTALRM : constant := 28; -- virtual timer expired
SIGPROF : constant := 29; -- profiling timer expired
SIGXCPU : constant := 30; -- CPU time limit exceeded
SIGXFSZ : constant := 31; -- filesize limit exceeded
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
-- These don't exist for Linux/MIPS. The constants are present
-- so that we can continue to use a-intnam-linux.ads.
SIGLOST : constant := 0; -- File lock lost
SIGSTKFLT : constant := 0; -- coprocessor stack fault (Linux)
SIGUNUSED : constant := 0; -- unused signal (GNU/Linux)
-- struct_sigaction offsets
sa_handler_pos : constant := int'Size / 8;
sa_mask_pos : constant := int'Size / 8 +
Standard'Address_Size / 8;
sa_flags_pos : constant := 0;
SA_SIGINFO : constant := 16#08#;
SA_ONSTACK : constant := 16#08000000#;
end System.Linux;
|
reznikmm/gela | Ada | 3,919 | ads | ------------------------------------------------------------------------------
-- G E L A X A S I S --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision$ $Date$
-- Purpose:
-- Multyprecission integer arithmetic
with Ada.Containers;
with League.Stream_Element_Vectors;
package Gela.Arithmetic.Integers is
pragma Preelaborate;
type Value is private;
function Literal (Text : String) return Value;
function "and" (Left, Right : Value) return Value;
function "or" (Left, Right : Value) return Value;
function "xor" (Left, Right : Value) return Value;
function "=" (Left, Right : Value) return Boolean;
function ">" (Left, Right : Value) return Boolean;
function "<" (Left, Right : Value) return Boolean;
function ">=" (Left, Right : Value) return Boolean;
function "<=" (Left, Right : Value) return Boolean;
function "-" (Left : Value) return Value;
function "+" (Left, Right : Value) return Value;
function "-" (Left, Right : Value) return Value;
function "*" (Left, Right : Value) return Value;
function "/" (Left, Right : Value) return Value;
function "mod" (Left, Right : Value) return Value;
function "rem" (Left, Right : Value) return Value;
function "**" (Left, Right : Value) return Value;
function "abs" (Left : Value) return Value;
function "not" (Left : Value) return Value;
function Image (Left : Value) return String;
function Hash (Left : Value) return Ada.Containers.Hash_Type;
function Zero return Value;
function One return Value;
function Two return Value;
function Ten return Value;
private
type Value is new League.Stream_Element_Vectors.Stream_Element_Vector
with null record;
end Gela.Arithmetic.Integers;
------------------------------------------------------------------------------
-- 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.
------------------------------------------------------------------------------
|
reznikmm/matreshka | Ada | 30,703 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-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.Wide_Wide_Text_IO;
with League.IRIs;
with League.String_Vectors;
with XML.SAX.Parse_Exceptions.Internals;
with AMF.CMOF.Associations;
with AMF.CMOF.Classes.Collections;
with AMF.CMOF.Data_Types;
with AMF.CMOF.Packageable_Elements.Collections;
with AMF.CMOF.Packages.Collections;
with AMF.CMOF.Properties.Collections;
with AMF.CMOF.Types;
with AMF.Facility;
with AMF.Holders.Reflective_Collections;
with AMF.Internals.XMI_URI_Rewriter;
package body AMF.Internals.XMI_Handlers is
use type AMF.CMOF.Properties.CMOF_Property_Access;
use type League.Strings.Universal_String;
XMI_2_1_Namespace : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String
("http://schema.omg.org/spec/XMI/2.1");
XMI_2_4_Namespace : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String
("http://www.omg.org/spec/XMI/20100901");
XMI_2_4_1_Namespace : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String
("http://www.omg.org/spec/XMI/20110701");
XMI_Name : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("XMI");
Id_Name : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("id");
Idref_Name : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("idref");
Type_Name : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("type");
Href_Name : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("href");
function Resolve_Owned_Attribute
(Class : AMF.CMOF.Classes.CMOF_Class_Access;
Name : League.Strings.Universal_String)
return AMF.CMOF.Properties.CMOF_Property_Access;
-- Resolves class's owned attribute by its name.
function Resolve_Owned_Class
(Root : not null AMF.CMOF.Packages.CMOF_Package_Access;
Name : League.Strings.Universal_String)
return AMF.CMOF.Classes.CMOF_Class_Access;
-- Resolves owned class by name.
procedure Analyze_Object_Element
(Self : in out XMI_Handler;
Meta_Class : AMF.CMOF.Classes.CMOF_Class_Access;
Attribute : AMF.CMOF.Properties.CMOF_Property_Access;
Attributes : XML.SAX.Attributes.SAX_Attributes;
Success : out Boolean);
-- Analyze current XML element which represents AMF.Element: resolves
-- XLink reference or creates new element. For created elements analyze
-- XML attributes and set element's attributes or creates links. Creates
-- ownership link when current element is nested into another element.
----------------------------
-- Analyze_Object_Element --
----------------------------
procedure Analyze_Object_Element
(Self : in out XMI_Handler;
Meta_Class : AMF.CMOF.Classes.CMOF_Class_Access;
Attribute : AMF.CMOF.Properties.CMOF_Property_Access;
Attributes : XML.SAX.Attributes.SAX_Attributes;
Success : out Boolean)
is
use type AMF.Elements.Element_Access;
procedure Set_Attribute
(Property : AMF.CMOF.Properties.CMOF_Property_Access;
Value : League.Strings.Universal_String);
-------------------
-- Set_Attribute --
-------------------
procedure Set_Attribute
(Property : AMF.CMOF.Properties.CMOF_Property_Access;
Value : League.Strings.Universal_String)
is
use type AMF.CMOF.Types.CMOF_Type_Access;
Attribute_Type : AMF.CMOF.Types.CMOF_Type_Access;
begin
if Property = null then
raise Program_Error with "Unknown attribute";
end if;
Attribute_Type := Property.Get_Type;
if Attribute_Type = null then
raise Program_Error with "Type not specified";
end if;
if Attribute_Type.all in AMF.CMOF.Data_Types.CMOF_Data_Type'Class then
Self.Current.Set
(Property,
Self.Extent.Create_From_String
(AMF.CMOF.Data_Types.CMOF_Data_Type_Access (Attribute_Type),
Value));
else
if Property.Is_Multivalued then
declare
Ids : constant League.String_Vectors.Universal_String_Vector
:= Value.Split (' ');
begin
for J in 1 .. Ids.Length loop
if Self.Mapping.Contains (Ids.Element (J)) then
AMF.Internals.XMI_Readers.Establish_Link
(Self.Extent,
Property,
Self.Current,
Self.Mapping.Element (Ids.Element (J)));
else
Self.Postponed.Append
((Self.Current, Property, Ids.Element (J)));
end if;
end loop;
end;
else
if Self.Mapping.Contains (Value) then
AMF.Internals.XMI_Readers.Establish_Link
(Self.Extent,
Property,
Self.Current,
Self.Mapping.Element (Value));
else
Self.Postponed.Append ((Self.Current, Property, Value));
end if;
end if;
end if;
end Set_Attribute;
Id : constant League.Strings.Universal_String
:= Attributes.Value (Self.XMI_Namespace, Id_Name);
Has_Id : constant Boolean
:= Attributes.Is_Specified (Self.XMI_Namespace, Id_Name);
Href_Index : constant Natural := Attributes.Index (Href_Name);
Idref_Index : constant Natural
:= Attributes.Index (Self.XMI_Namespace, Idref_Name);
begin
-- Set Success flag.
Success := True;
-- Push current element into the stack.
if Self.Current /= null then
Self.Stack.Append (Self.Current);
end if;
if Href_Index /= 0 then
-- Process XLink 'href' attribute if present.
declare
URI : constant League.Strings.Universal_String
:= Attributes.Value (Href_Index);
Separator : constant Positive := URI.Index ('#');
File_Name : constant League.Strings.Universal_String
:= URI.Slice (1, Separator - 1);
Name : constant League.Strings.Universal_String
:= URI.Slice (Separator + 1, URI.Length);
Resolved_URI : constant League.Strings.Universal_String
:= Self.Locator.Base_URI.Resolve
(League.IRIs.From_Universal_String
(File_Name)).To_Universal_String;
begin
-- Check whether referenced document is already loaded.
if AMF.Internals.XMI_Readers.Documents.Contains (Resolved_URI) then
-- When document is loaded resolve referenced element.
Self.Current :=
AMF.Internals.XMI_Readers.Documents.Element
(Resolved_URI).Element (Name);
if Self.Current = null then
raise Program_Error;
end if;
else
-- Register postponed cross-document link when document is not
-- loaded.
Self.Context.Postpone_Cross_Document_Link
(Element => Self.Stack.Last_Element,
Attribute => Attribute,
Extent => Self.Extent,
Document_URI => Resolved_URI,
Element_Id => Name,
Public_Id => Self.Locator.Public_Id,
System_Id => Self.Locator.System_Id,
Line => Self.Locator.Line,
Column => Self.Locator.Column);
Self.Current := null;
return;
end if;
end;
elsif Idref_Index /= 0 then
-- Process XMI 'idref' attribute if present.
Set_Attribute (Attribute, Attributes.Value (Idref_Index));
Self.Current := null;
return;
elsif Has_Id then
-- Create new element, assign identifier and register it.
Self.Current := Self.Extent.Create (Meta_Class);
Self.Extent.Set_Id (Self.Current, Id);
Self.Mapping.Insert (Id, Self.Current);
else
-- Create new element without identifier.
Self.Current := Self.Extent.Create (Meta_Class);
end if;
-- Establish ownership link.
if Attribute /= null then
AMF.Internals.XMI_Readers.Establish_Link
(Self.Extent, Attribute, Self.Stack.Last_Element, Self.Current);
end if;
-- Process attributes.
for J in 1 .. Attributes.Length loop
if Attributes.Namespace_URI (J).Is_Empty then
if Attributes.Qualified_Name (J) /= Href_Name then
-- XLink 'href' handled outside of this subprogram.
declare
Property : constant AMF.CMOF.Properties.CMOF_Property_Access
:= Resolve_Owned_Attribute
(Meta_Class, Attributes.Qualified_Name (J));
begin
if Property = null then
Self.Diagnosis :=
"Unknown property '"
& Meta_Class.Get_Name.Value
& ":"
& Attributes.Qualified_Name (J)
& ''';
-- Success := False;
-- return;
else
Set_Attribute (Property, Attributes.Value (J));
end if;
end;
end if;
elsif Attributes.Namespace_URI (J) = Self.XMI_Namespace then
-- XMI namespace is handled outside of this subprogram.
null;
else
-- XXX Is this format violation?
Ada.Wide_Wide_Text_IO.Put_Line
(Ada.Wide_Wide_Text_IO.Standard_Error,
" "
& Attributes.Namespace_URI (J).To_Wide_Wide_String
& " "
& Attributes.Local_Name (J).To_Wide_Wide_String
& " "
& Attributes.Value (J).To_Wide_Wide_String);
end if;
end loop;
end Analyze_Object_Element;
----------------
-- Characters --
----------------
overriding procedure Characters
(Self : in out XMI_Handler;
Text : League.Strings.Universal_String;
Success : in out Boolean)
is
pragma Unreferenced (Success);
begin
if Self.Collect_Text then
Self.Text.Append (Text);
end if;
end Characters;
------------------
-- End_Document --
------------------
overriding procedure End_Document
(Self : in out XMI_Handler;
Success : in out Boolean)
is
procedure Establish_Link (Position : Postponed_Link_Vectors.Cursor);
--------------------
-- Establish_Link --
--------------------
procedure Establish_Link (Position : Postponed_Link_Vectors.Cursor) is
L : constant Postponed_Link
:= Postponed_Link_Vectors.Element (Position);
begin
if not Self.Mapping.Contains (L.Id) then
Self.Context.Error_Handler.Error
(XML.SAX.Parse_Exceptions.Internals.Create
(Public_Id => Self.Locator.Public_Id,
System_Id => Self.Locator.System_Id,
Line => Self.Locator.Line,
Column => Self.Locator.Column,
Message => "Unknown element '" & L.Id & "'"),
Success);
if not Success then
raise Program_Error;
end if;
else
AMF.Internals.XMI_Readers.Establish_Link
(Self.Extent, L.Attribute, L.Element, Self.Mapping.Element (L.Id));
end if;
end Establish_Link;
begin
-- Resolve postponed local links.
Self.Postponed.Iterate (Establish_Link'Access);
end End_Document;
-----------------
-- End_Element --
-----------------
overriding procedure End_Element
(Self : in out XMI_Handler;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
Qualified_Name : League.Strings.Universal_String;
Success : in out Boolean)
is
pragma Unreferenced (Namespace_URI);
pragma Unreferenced (Local_Name);
pragma Unreferenced (Qualified_Name);
Attribute_Type : AMF.CMOF.Types.CMOF_Type_Access;
begin
if Self.Skip_Element /= 0 then
Self.Skip_Element := Self.Skip_Element - 1;
elsif not Self.Stack.Is_Empty then
if Self.Collect_Text then
Self.Collect_Text := False;
Attribute_Type := Self.Attribute.Get_Type;
if Attribute_Type.all
in AMF.CMOF.Data_Types.CMOF_Data_Type'Class
then
if not Self.Attribute.Is_Multivalued then
Self.Current.Set
(Self.Attribute,
Self.Extent.Create_From_String
(AMF.CMOF.Data_Types.CMOF_Data_Type_Access
(Attribute_Type),
Self.Text));
else
AMF.Holders.Reflective_Collections.Element
(Self.Current.Get (Self.Attribute)).Add
(Self.Extent.Create_From_String
(AMF.CMOF.Data_Types.CMOF_Data_Type_Access
(Attribute_Type),
Self.Text));
end if;
else
Self.Context.Error_Handler.Error
(XML.SAX.Parse_Exceptions.Internals.Create
(Public_Id => Self.Locator.Public_Id,
System_Id => Self.Locator.System_Id,
Line => Self.Locator.Line,
Column => Self.Locator.Column,
Message =>
"Character data for '"
& Self.Attribute.Get_Name.Value
& "' is ignored"),
Success);
if not Success then
raise Program_Error;
end if;
end if;
else
Self.Current := Self.Stack.Last_Element;
Self.Stack.Delete_Last;
end if;
end if;
end End_Element;
------------------
-- Error_String --
------------------
overriding function Error_String
(Self : XMI_Handler) return League.Strings.Universal_String is
begin
return Self.Diagnosis;
end Error_String;
------------
-- Extent --
------------
function Extent (Self : XMI_Handler) return AMF.URI_Stores.URI_Store_Access is
begin
return Self.Extent;
end Extent;
------------
-- Extent --
------------
function Extent
(URI : League.Strings.Universal_String)
return AMF.URI_Stores.URI_Store_Access is
begin
if AMF.Internals.XMI_Readers.Documents.Contains (URI) then
return AMF.Internals.XMI_Readers.Documents.Element (URI);
else
return null;
end if;
end Extent;
-----------------
-- Fatal_Error --
-----------------
overriding procedure Fatal_Error
(Self : in out XMI_Handler;
Occurrence : XML.SAX.Parse_Exceptions.SAX_Parse_Exception) is
begin
if Self.Diagnosis.Is_Empty then
Self.Diagnosis := "XML fatal error: " & Occurrence.Message;
end if;
end Fatal_Error;
-----------------------------
-- Resolve_Owned_Attribute --
-----------------------------
function Resolve_Owned_Attribute
(Class : AMF.CMOF.Classes.CMOF_Class_Access;
Name : League.Strings.Universal_String)
return AMF.CMOF.Properties.CMOF_Property_Access
is
use type AMF.Optional_String;
Attributes : constant
AMF.CMOF.Properties.Collections.Ordered_Set_Of_CMOF_Property
:= Class.Get_Owned_Attribute;
Super_Classes : constant
AMF.CMOF.Classes.Collections.Set_Of_CMOF_Class
:= Class.Get_Super_Class;
Aux : AMF.CMOF.Properties.CMOF_Property_Access;
begin
-- Lookup in ownedAttribute set.
for J in 1 .. Attributes.Length loop
Aux := Attributes.Element (J);
if Aux.Get_Name = Name then
return Aux;
end if;
end loop;
-- Lookup in superclasses.
for J in 1 .. Super_Classes.Length loop
Aux := Resolve_Owned_Attribute (Super_Classes.Element (J), Name);
if Aux /= null then
return Aux;
end if;
end loop;
-- Lookup failed.
return null;
end Resolve_Owned_Attribute;
-------------------------
-- Resolve_Owned_Class --
-------------------------
function Resolve_Owned_Class
(Root : not null AMF.CMOF.Packages.CMOF_Package_Access;
Name : League.Strings.Universal_String)
return AMF.CMOF.Classes.CMOF_Class_Access
is
use type AMF.Optional_String;
Packaged_Elements : constant
AMF.CMOF.Packageable_Elements.Collections.Set_Of_CMOF_Packageable_Element
:= Root.Get_Packaged_Element;
Element :
AMF.CMOF.Packageable_Elements.CMOF_Packageable_Element_Access;
begin
-- Looking in the set of packagedElement.
--
-- XXX Minor performance improvement can be achived by looking inside
-- set of ownedType. Unfortunately, it is derived property and it is not
-- implemented now.
for J in 1 .. Packaged_Elements.Length loop
Element := Packaged_Elements.Element (J);
if Element.all in AMF.CMOF.Classes.CMOF_Class'Class
and then Element.Get_Name = Name
then
return AMF.CMOF.Classes.CMOF_Class_Access (Element);
end if;
end loop;
-- Lookup failed.
return null;
end Resolve_Owned_Class;
--------------------------
-- Set_Document_Locator --
--------------------------
overriding procedure Set_Document_Locator
(Self : in out XMI_Handler;
Locator : XML.SAX.Locators.SAX_Locator) is
begin
Self.Locator := Locator;
end Set_Document_Locator;
--------------------
-- Start_Document --
--------------------
overriding procedure Start_Document
(Self : in out XMI_Handler;
Success : in out Boolean)
is
pragma Unreferenced (Success);
begin
Self.Extent := AMF.Facility.Create_URI_Store (Self.Locator.System_Id);
end Start_Document;
-------------------
-- Start_Element --
-------------------
overriding procedure Start_Element
(Self : in out XMI_Handler;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
Qualified_Name : League.Strings.Universal_String;
Attributes : XML.SAX.Attributes.SAX_Attributes;
Success : in out Boolean)
is
use type AMF.CMOF.Associations.CMOF_Association_Access;
use type AMF.CMOF.Classes.CMOF_Class_Access;
use type AMF.CMOF.Packages.CMOF_Package_Access;
Association : AMF.CMOF.Associations.CMOF_Association_Access;
Name : League.Strings.Universal_String;
Meta : AMF.CMOF.Classes.CMOF_Class_Access;
Property : AMF.CMOF.Properties.CMOF_Property_Access;
Property_Type : AMF.CMOF.Types.CMOF_Type_Access;
begin
-- Skip nested elements for unknown element.
if Self.Skip_Element /= 0 then
Self.Skip_Element := Self.Skip_Element + 1;
-- Namespace is missing, XML element represents value of property. This
-- is most useful case, so it is checked first to achive some
-- performance improvement.
elsif Namespace_URI.Is_Empty then
-- Property of the element, resolve it.
Property :=
Resolve_Owned_Attribute
(Self.Current.Get_Meta_Class, Qualified_Name);
if Property = null then
Self.Diagnosis :=
"Unknown property '"
& Self.Current.Get_Meta_Class.Get_Name.Value
& ":"
& Qualified_Name
& ''';
Success := False;
return;
end if;
Association := Property.Get_Association;
if Association /= null then
if Attributes.Index (Self.XMI_Namespace, Type_Name) /= 0 then
-- Metaclass of the element is specified explicitly, resolve
-- it.
Name := Attributes.Value (Self.XMI_Namespace, Type_Name);
Meta :=
Resolve_Owned_Class
(Self.Prefix_Package_Map.Element
(Name.Slice (1, Name.Index (':') - 1)),
Name.Slice (Name.Index (':') + 1, Name.Length));
if Meta = null then
-- Metaclass is not defined in metamodel, report warning and
-- skip all nested elements.
Self.Context.Error_Handler.Error
(XML.SAX.Parse_Exceptions.Internals.Create
(Public_Id => Self.Locator.Public_Id,
System_Id => Self.Locator.System_Id,
Line => Self.Locator.Line,
Column => Self.Locator.Column,
Message =>
"Class '"
& Name.Slice (Name.Index (':') + 1, Name.Length)
& "' is not defined in '"
& Self.Prefix_Package_Map.Element
(Name.Slice
(1, Name.Index (':') - 1)).Get_URI.Value
& "'"),
Success);
if not Success then
raise Program_Error;
end if;
Self.Skip_Element := 1;
return;
end if;
else
-- Fallback to default metaclass - type of the property.
Property_Type := Property.Get_Type;
Meta := AMF.CMOF.Classes.CMOF_Class_Access (Property_Type);
end if;
Analyze_Object_Element (Self, Meta, Property, Attributes, Success);
else
Self.Attribute := Property;
Self.Collect_Text := True;
Self.Text.Clear;
end if;
-- Process element from XMI namespace before all others, because they
-- have special meaning.
elsif Namespace_URI = XMI_2_1_Namespace
or Namespace_URI = XMI_2_4_Namespace
or Namespace_URI = XMI_2_4_1_Namespace
then
if Local_Name = XMI_Name then
Self.XMI_Namespace := Namespace_URI;
else
Self.Skip_Element := 1;
end if;
-- Process element from other namespace, it is one of root elements of
-- the loaded document.
else
declare
Position : constant String_Package_Maps.Cursor
:= Self.URI_Package_Map.Find (Namespace_URI);
begin
-- Looking for package associated with namespace URI.
if not String_Package_Maps.Has_Element (Position) then
-- Corresponding metamodel was not found, report warning.
Self.Skip_Element := 1;
else
-- Resolve specified class name in the package.
Meta :=
Resolve_Owned_Class
(String_Package_Maps.Element (Position), Local_Name);
if Meta = null then
-- Null metaclass means that specified class is not resolved
-- in the package, treat it as fatal error.
Self.Context.Error_Handler.Error
(XML.SAX.Parse_Exceptions.Internals.Create
(Public_Id => Self.Locator.Public_Id,
System_Id => Self.Locator.System_Id,
Line => Self.Locator.Line,
Column => Self.Locator.Column,
Message =>
"Class '"
& Local_Name
& "' is not defined in '"
& Namespace_URI
& "'"),
Success);
if not Success then
raise Program_Error;
end if;
Self.Skip_Element := 1;
else
Analyze_Object_Element
(Self, Meta, null, Attributes, Success);
end if;
end if;
end;
end if;
end Start_Element;
--------------------------
-- Start_Prefix_Mapping --
--------------------------
overriding procedure Start_Prefix_Mapping
(Self : in out XMI_Handler;
Prefix : League.Strings.Universal_String;
Namespace_URI : League.Strings.Universal_String;
Success : in out Boolean)
is
use type AMF.CMOF.Packages.CMOF_Package_Access;
The_Package : AMF.CMOF.Packages.CMOF_Package_Access;
Metamodel_URI : League.Strings.Universal_String;
Packages : AMF.CMOF.Packages.Collections.Set_Of_CMOF_Package;
begin
if Namespace_URI = XMI_2_1_Namespace
or Namespace_URI = XMI_2_4_Namespace
or Namespace_URI = XMI_2_4_1_Namespace
then
-- Ignore all XMI namespaces.
null;
else
-- Rewrite metamodel's URI to supported one.
Metamodel_URI :=
AMF.Internals.XMI_URI_Rewriter.Rewrite_Namespace_URI
(Namespace_URI);
-- Resolve metamodel's package.
Packages := Self.Extent.Get_Package;
for J in 1 .. Packages.Length loop
if Packages.Element (J).Get_URI = Metamodel_URI then
The_Package := Packages.Element (J);
exit;
end if;
end loop;
if The_Package /= null then
-- Associate metamodel's package with namespace URI and prefix.
-- Both are mapped to null when factory is not found; but only
-- prefix mapping is important because it allows to detect errors
-- in XMI.
Self.Prefix_Package_Map.Insert (Prefix, The_Package);
Self.URI_Package_Map.Insert (Namespace_URI, The_Package);
else
Self.Context.Error_Handler.Error
(XML.SAX.Parse_Exceptions.Internals.Create
(Public_Id => Self.Locator.Public_Id,
System_Id => Self.Locator.System_Id,
Line => Self.Locator.Line,
Column => Self.Locator.Column,
Message =>
"Unknown namespace '" & Namespace_URI & "'"),
Success);
if not Success then
raise Program_Error;
end if;
end if;
end if;
end Start_Prefix_Mapping;
end AMF.Internals.XMI_Handlers;
|
reznikmm/matreshka | Ada | 4,567 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Draw.Green_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Draw_Green_Attribute_Node is
begin
return Self : Draw_Green_Attribute_Node do
Matreshka.ODF_Draw.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Draw_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Draw_Green_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Green_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Draw_URI,
Matreshka.ODF_String_Constants.Green_Attribute,
Draw_Green_Attribute_Node'Tag);
end Matreshka.ODF_Draw.Green_Attributes;
|
emilybache/Parrot-Refactoring-Kata | Ada | 331 | ads | package Parrot is
type ParrotType is (EUROPEAN, AFRICAN, NORWEGIAN_BLUE);
type ParrotData is record
ofType : ParrotType;
numberOfCoconuts : Integer;
voltage : Float;
isNailed : Boolean;
end record;
function GetSpeed (parrot : ParrotData) return Float;
end Parrot;
|
stcarrez/ada-asf | Ada | 13,175 | adb | -----------------------------------------------------------------------
-- facebook - Use Facebook Graph API
-- Copyright (C) 2012, 2013, 2014, 2015, 2022 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Log.Loggers;
with Util.Http.Rest.Rest_Get_Vector;
with Util.Serialize.Mappers.Record_Mapper;
with Util.Serialize.Mappers.Vector_Mapper;
with ASF.Sessions;
with ASF.Contexts.Faces;
with ASF.Events.Faces.Actions;
package body Facebook is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Facebook");
type Friend_Field_Type is (FIELD_NAME, FIELD_ID);
type Feed_Field_Type is (FIELD_ID, FIELD_NAME, FIELD_FROM, FIELD_MESSAGE,
FIELD_PICTURE, FIELD_LINK, FIELD_DESCRIPTION, FIELD_ICON);
procedure Set_Member (Into : in out Friend_Info;
Field : in Friend_Field_Type;
Value : in Util.Beans.Objects.Object);
procedure Set_Member (Into : in out Feed_Info;
Field : in Feed_Field_Type;
Value : in Util.Beans.Objects.Object);
procedure Set_Member (Into : in out Friend_Info;
Field : in Friend_Field_Type;
Value : in Util.Beans.Objects.Object) is
begin
case Field is
when FIELD_ID =>
Into.Id := Value;
when FIELD_NAME =>
Into.Name := Value;
end case;
end Set_Member;
procedure Set_Member (Into : in out Feed_Info;
Field : in Feed_Field_Type;
Value : in Util.Beans.Objects.Object) is
begin
Log.Info ("Set field {0} to {1}", Feed_Field_Type'Image (Field),
Util.Beans.Objects.To_String (Value));
case Field is
when FIELD_ID =>
Into.Id := Value;
when FIELD_NAME =>
Into.Name := Value;
when FIELD_FROM =>
Into.From := Value;
when FIELD_MESSAGE =>
Into.Message := Value;
when FIELD_LINK =>
Into.Link := Value;
when FIELD_PICTURE =>
Into.Picture := Value;
when FIELD_ICON =>
Into.Icon := Value;
when FIELD_DESCRIPTION =>
Into.Description := Value;
end case;
end Set_Member;
package Friend_Mapper is
new Util.Serialize.Mappers.Record_Mapper (Element_Type => Friend_Info,
Element_Type_Access => Friend_Info_Access,
Fields => Friend_Field_Type,
Set_Member => Set_Member);
package Friend_Vector_Mapper is
new Util.Serialize.Mappers.Vector_Mapper (Vectors => Friend_List.Vectors,
Element_Mapper => Friend_Mapper);
package Feed_Mapper is
new Util.Serialize.Mappers.Record_Mapper (Element_Type => Feed_Info,
Element_Type_Access => Feed_Info_Access,
Fields => Feed_Field_Type,
Set_Member => Set_Member);
package Feed_Vector_Mapper is
new Util.Serialize.Mappers.Vector_Mapper (Vectors => Feed_List.Vectors,
Element_Mapper => Feed_Mapper);
Friend_Map : aliased Friend_Mapper.Mapper;
Friend_Vector_Map : aliased Friend_Vector_Mapper.Mapper;
Feed_Map : aliased Feed_Mapper.Mapper;
Feed_Vector_Map : aliased Feed_Vector_Mapper.Mapper;
procedure Get_Friends is
new Util.Http.Rest.Rest_Get_Vector (Vector_Mapper => Friend_Vector_Mapper);
procedure Get_Feeds is
new Util.Http.Rest.Rest_Get_Vector (Vector_Mapper => Feed_Vector_Mapper);
-- ------------------------------
-- Get the access token from the user session.
-- ------------------------------
function Get_Access_Token return String is
use type ASF.Contexts.Faces.Faces_Context_Access;
Context : constant ASF.Contexts.Faces.Faces_Context_Access := ASF.Contexts.Faces.Current;
begin
if Context = null then
return "";
end if;
declare
S : constant ASF.Sessions.Session := Context.Get_Session;
begin
if not S.Is_Valid then
return "";
end if;
declare
Token : constant Util.Beans.Objects.Object := S.Get_Attribute ("access_token");
begin
if Util.Beans.Objects.Is_Null (Token) then
return "";
else
return Util.Beans.Objects.To_String (Token);
end if;
end;
end;
end Get_Access_Token;
-- ------------------------------
-- 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 Friend_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "name" then
return From.Name;
elsif Name = "id" then
return From.Id;
else
return Util.Beans.Objects.Null_Object;
end if;
end Get_Value;
-- ------------------------------
-- 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 Feed_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return From.Id;
elsif Name = "name" then
return From.Name;
elsif Name = "from" then
return From.From;
elsif Name = "message" then
return From.Message;
elsif Name = "picture" then
return From.Picture;
elsif Name = "link" then
return From.Link;
elsif Name = "description" then
return From.Description;
elsif Name = "icon" then
return From.Icon;
else
return Util.Beans.Objects.Null_Object;
end if;
end Get_Value;
-- ------------------------------
-- 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 Friend_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "hasAccessToken" then
return Util.Beans.Objects.To_Object (False);
end if;
return Friend_List.List_Bean (From).Get_Value (Name);
end Get_Value;
-- ------------------------------
-- Create a Friend_List bean instance.
-- ------------------------------
function Create_Friends_Bean return Util.Beans.Basic.Readonly_Bean_Access is
List : Friend_List_Bean_Access := new Friend_List_Bean;
Token : constant String := Get_Access_Token;
begin
if Token'Length > 0 then
Log.Info ("Getting the Facebook friends");
Get_Friends ("https://graph.facebook.com/me/friends?access_token="
& Token,
Friend_Vector_Map'Access,
"/data",
List.List'Access);
end if;
return List.all'Access;
end Create_Friends_Bean;
-- ------------------------------
-- Build and return a Facebook feed list.
-- ------------------------------
function Create_Feed_List_Bean return Util.Beans.Basic.Readonly_Bean_Access is
List : Feed_List.List_Bean_Access := new Feed_List.List_Bean;
Token : constant String := Get_Access_Token;
begin
if Token'Length > 0 then
Log.Info ("Getting the Facebook feeds");
Get_Feeds ("https://graph.facebook.com/me/home?access_token="
& Token,
Feed_Vector_Map'Access,
"/data",
List.List'Access);
end if;
return List.all'Access;
end Create_Feed_List_Bean;
-- ------------------------------
-- Get the user information identified by the given name.
-- ------------------------------
overriding
function Get_Value (From : in Facebook_Auth;
Name : in String) return Util.Beans.Objects.Object is
use type ASF.Contexts.Faces.Faces_Context_Access;
F : constant ASF.Contexts.Faces.Faces_Context_Access := ASF.Contexts.Faces.Current;
begin
if F /= null and then Name = "authenticate_url" then
declare
S : constant ASF.Sessions.Session := F.Get_Session (True);
Id : constant String := S.Get_Id;
State : constant String := From.Get_State (Id);
Params : constant String := From.Get_Auth_Params (State, "user_posts");
begin
Log.Info ("OAuth params: {0}", Params);
return Util.Beans.Objects.To_Object ("https://www.facebook.com/dialog/oauth?"
& Params);
end;
elsif F /= null and then Name = "isAuthenticated" then
declare
S : constant ASF.Sessions.Session := F.Get_Session (False);
begin
if S.Is_Valid and
then not Util.Beans.Objects.Is_Null (S.Get_Attribute ("access_token"))
then
return Util.Beans.Objects.To_Object (True);
else
return Util.Beans.Objects.To_Object (False);
end if;
end;
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Authenticate result from Facebook.
-- ------------------------------
procedure Authenticate (From : in out Facebook_Auth;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
pragma Unreferenced (Outcome);
use type Security.OAuth.Clients.Access_Token_Access;
F : constant ASF.Contexts.Faces.Faces_Context_Access := ASF.Contexts.Faces.Current;
Session : ASF.Sessions.Session := F.Get_Session;
State : constant String := F.Get_Parameter (Security.OAuth.STATE);
Code : constant String := F.Get_Parameter (Security.OAuth.CODE);
begin
Log.Info ("Auth code {0} for state {1}", Code, State);
if Session.Is_Valid then
if From.Is_Valid_State (Session.Get_Id, State) then
declare
Acc : constant Security.OAuth.Clients.Access_Token_Access
:= From.Request_Access_Token (Code);
begin
if Acc /= null then
Log.Info ("Access token is {0}", Acc.Get_Name);
Session.Set_Attribute ("access_token",
Util.Beans.Objects.To_Object (Acc.Get_Name));
end if;
end;
end if;
end if;
end Authenticate;
package Authenticate_Binding is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Facebook_Auth,
Method => Authenticate,
Name => "authenticate");
Binding_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Authenticate_Binding.Proxy'Unchecked_Access);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Facebook_Auth)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Array'Access;
end Get_Method_Bindings;
begin
Friend_Map.Add_Default_Mapping;
Friend_Vector_Map.Set_Mapping (Friend_Map'Access);
Feed_Map.Add_Mapping ("id", FIELD_ID);
Feed_Map.Add_Mapping ("name", FIELD_NAME);
Feed_Map.Add_Mapping ("message", FIELD_MESSAGE);
Feed_Map.Add_Mapping ("description", FIELD_DESCRIPTION);
Feed_Map.Add_Mapping ("from/name", FIELD_FROM);
Feed_Map.Add_Mapping ("picture", FIELD_PICTURE);
Feed_Map.Add_Mapping ("link", FIELD_LINK);
Feed_Map.Add_Mapping ("icon", FIELD_ICON);
Feed_Vector_Map.Set_Mapping (Feed_Map'Access);
end Facebook;
|
stcarrez/dynamo | Ada | 5,501 | ads | ------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . C O N T T . S D --
-- --
-- S p e c --
-- --
-- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
-- --
-- ASIS-for-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 --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY 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 ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adacore.com). --
-- --
------------------------------------------------------------------------------
-- This package defines the procedures which scans the tree search paths for
-- a given Context and analyses the availible tree files
with Namet; use Namet;
package A4G.Contt.SD is
First_Tree_File : Name_Id := First_Name_Id;
Last_Tree_File : Name_Id := First_Name_Id - 1;
-- Indexes of the first and the last tree file candidates, which were
-- found during the last scanning of the tree search path of some
-- directory. Are set by Scan_Tree_Files below. These variables are
-- undefinite
-- SHOULD WE MOVE THESE VARIABLES IN THE BODY
-- AND EVEN MORE - DO WE REALLY NEED THEM AT ALL??!!
procedure Scan_Tree_Files_New (C : Context_Id);
-- Stores the names of the tree files making up the Context C in the Tree
-- table for C. Every tree file name is stored only once.
-- In All_Trees Context mode it scans the tree search path, using the same
-- approach for the tree files with the same name as GNAT does for source
-- files in the source search path. In N_Trees mode it scans the Parametes
-- string set when C was associated. In this case, if the name of the same
-- tree file is given more than once, but in diffrent forms (for example
-- ../my_dir/foo.ats and ../../my_home_dir/my_dir/foo.ats), all these
-- different names of the same tree file will be stored in the tree table
procedure Investigate_Trees_New (C : Context_Id);
-- This procedure implements the second step of opening a Context. It uses
-- the names of the tree files in the Context Tree Table. For every tree
-- file, it reads it in and extracts some information about compilation
-- units presented by this file. It also makes the consistency check.
-- Checks which are made by this procedure depend on the context options
-- which were set when C was associated.
--
-- Is this package the right location for this procedure???
procedure Scan_Units_New;
-- Scans the currently accessed tree which was readed in by the
-- immediately preceding call to Read_and_Check_New. If a unit is "new"
-- (that is, if it has not already been encountered during opening a
-- Context), all the black-box information is computed and stored in the
-- Context table. Otherwise (that is, if the unit is already "known")
-- the consistency check is made.
--
-- When this procedure raises ASIS_Failed, it forms the Diagnosis string
-- on befalf on Asis.Ada_Environments.Open
end A4G.Contt.SD;
|
zhmu/ananas | Ada | 3,227 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 2 9 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 29
package System.Pack_29 is
pragma Preelaborate;
Bits : constant := 29;
type Bits_29 is mod 2 ** Bits;
for Bits_29'Size use Bits;
-- In all subprograms below, Rev_SSO is set True if the array has the
-- non-default scalar storage order.
function Get_29
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_29 with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_29
(Arr : System.Address;
N : Natural;
E : Bits_29;
Rev_SSO : Boolean) with Inline;
-- 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_29;
|
reznikmm/matreshka | Ada | 5,486 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
package body Matreshka.DOM_Document_Fragments is
----------------
-- Enter_Node --
----------------
overriding procedure Enter_Node
(Self : not null access Document_Fragment_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
Visitor.Enter_Document_Fragment
(XML.DOM.Document_Fragments.DOM_Document_Fragment_Access (Self),
Control);
end Enter_Node;
-------------------
-- Get_Node_Name --
-------------------
overriding function Get_Node_Name
(Self : not null access constant Document_Fragment_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return League.Strings.To_Universal_String ("#document-fragment");
end Get_Node_Name;
-------------------
-- Get_Node_Type --
-------------------
overriding function Get_Node_Type
(Self : not null access constant Document_Fragment_Node)
return XML.DOM.Node_Type
is
pragma Unreferenced (Self);
begin
return XML.DOM.Document_Fragment_Node;
end Get_Node_Type;
----------------
-- Leave_Node --
----------------
overriding procedure Leave_Node
(Self : not null access Document_Fragment_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
Visitor.Leave_Document_Fragment
(XML.DOM.Document_Fragments.DOM_Document_Fragment_Access (Self),
Control);
end Leave_Node;
----------------
-- Visit_Node --
----------------
overriding procedure Visit_Node
(Self : not null access Document_Fragment_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
Iterator.Visit_Document_Fragment
(Visitor,
XML.DOM.Document_Fragments.DOM_Document_Fragment_Access (Self),
Control);
end Visit_Node;
end Matreshka.DOM_Document_Fragments;
|
reznikmm/matreshka | Ada | 8,481 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with WSDL.AST.Endpoints;
with WSDL.AST.Services;
with WSDL.AST.Types;
with WSDL.Iterators;
package WSDL.Visitors is
pragma Preelaborate;
type WSDL_Visitor is limited interface;
not overriding procedure Enter_Binding
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Binding_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Binding
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Binding_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Binding_Fault
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Binding_Fault_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Binding_Fault
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Binding_Fault_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Binding_Operation
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Binding_Operation_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Binding_Operation
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Binding_Operation_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Description
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Description_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Description
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Description_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Endpoint
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Endpoints.Endpoint_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Endpoint
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Endpoints.Endpoint_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Interface
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Interface
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Interface_Fault
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Fault_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Interface_Fault
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Fault_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Interface_Fault_Reference
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Fault_Reference_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Interface_Fault_Reference
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Fault_Reference_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Interface_Message
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Message_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Interface_Message
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Message_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Interface_Operation
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Operation_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Interface_Operation
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Interface_Operation_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Service
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Services.Service_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Service
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Services.Service_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Enter_Types
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Types.Types_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
not overriding procedure Leave_Types
(Self : in out WSDL_Visitor;
Node : not null WSDL.AST.Types.Types_Access;
Control : in out WSDL.Iterators.Traverse_Control) is null;
end WSDL.Visitors;
|
twdroeger/ada-awa | Ada | 5,797 | adb | -----------------------------------------------------------------------
-- awa-counters-beans -- Counter bean definition
-- Copyright (C) 2015, 2016, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Calendar;
with Util.Dates.ISO8601;
with ADO.Queries.Loaders;
with ADO.Sessions.Entities;
with AWA.Services.Contexts;
package body AWA.Counters.Beans is
package ASC renames AWA.Services.Contexts;
function Parse_Date (Date : in String;
Now : in Ada.Calendar.Time) return Ada.Calendar.Time;
-- ------------------------------
-- Get the value identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Counter_Bean;
Name : in String) return Util.Beans.Objects.Object is
pragma Unreferenced (Name);
begin
return Util.Beans.Objects.To_Object (From.Value);
end Get_Value;
overriding
function Get_Value (List : in Counter_Stat_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "stats" then
return Util.Beans.Objects.To_Object (Value => List.Stats_Bean,
Storage => Util.Beans.Objects.STATIC);
else
return AWA.Counters.Models.Stat_List_Bean (List).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- ------------------------------
overriding
procedure Set_Value (From : in out Counter_Stat_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if not Util.Beans.Objects.Is_Empty (Value) then
AWA.Counters.Models.Stat_List_Bean (From).Set_Value (Name, Value);
end if;
end Set_Value;
-- ------------------------------
-- Get the query definition to collect the counter statistics.
-- ------------------------------
function Get_Query (From : in Counter_Stat_Bean) return ADO.Queries.Query_Definition_Access is
Name : constant String := Ada.Strings.Unbounded.To_String (From.Query_Name);
begin
return ADO.Queries.Loaders.Find_Query (Name);
end Get_Query;
function Parse_Date (Date : in String;
Now : in Ada.Calendar.Time) return Ada.Calendar.Time is
use type Ada.Calendar.Time;
Day : Natural;
begin
if Date'Length = 0 or Date = "now" then
return Now;
elsif Date'Length > 5 and then Date (Date'First .. Date'First + 3) = "now-" then
Day := Natural'Value (Date (Date'First + 4 .. Date'Last));
return Now - Duration (Day * 86400);
else
return Util.Dates.ISO8601.Value (Date);
end if;
end Parse_Date;
-- ------------------------------
-- Load the statistics information.
-- ------------------------------
overriding
procedure Load (List : in out Counter_Stat_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
pragma Unreferenced (Outcome);
use type ADO.Identifier;
use type ADO.Queries.Query_Definition_Access;
Ctx : constant ASC.Service_Context_Access := ASC.Current;
User : constant ADO.Identifier := Ctx.Get_User_Identifier;
Now : constant Ada.Calendar.Time := Ada.Calendar.Clock;
Def : constant ADO.Queries.Query_Definition_Access := List.Get_Query;
Entity_Type : constant String := Ada.Strings.Unbounded.To_String (List.Entity_Type);
Session : ADO.Sessions.Session := ASC.Get_Session (Ctx);
Kind : ADO.Entity_Type;
First_Date : Ada.Calendar.Time;
Last_Date : Ada.Calendar.Time;
Query : ADO.Queries.Context;
begin
Kind := ADO.Sessions.Entities.Find_Entity_Type (Session, Entity_Type);
First_Date := Parse_Date (Ada.Strings.Unbounded.To_String (List.First_Date), Now);
Last_Date := Parse_Date (Ada.Strings.Unbounded.To_String (List.Last_Date), Now);
if List.Entity_Id /= ADO.NO_IDENTIFIER and Def /= null then
Query.Set_Query (Def);
Query.Bind_Param ("entity_type", Kind);
Query.Bind_Param ("entity_id", List.Entity_Id);
Query.Bind_Param ("user_id", User);
Query.Bind_Param ("first_date", First_Date);
Query.Bind_Param ("last_date", Last_Date);
Query.Bind_Param ("counter_name", List.Counter_Name);
AWA.Counters.Models.List (List.Stats, Session, Query);
end if;
end Load;
-- ------------------------------
-- Create the Blog_Stat_Bean bean instance.
-- ------------------------------
function Create_Counter_Stat_Bean (Module : in AWA.Counters.Modules.Counter_Module_Access)
return Util.Beans.Basic.Readonly_Bean_Access is
Object : constant Counter_Stat_Bean_Access := new Counter_Stat_Bean;
begin
Object.Module := Module;
Object.Stats_Bean := Object.Stats'Access;
return Object.all'Access;
end Create_Counter_Stat_Bean;
end AWA.Counters.Beans;
|
zhmu/ananas | Ada | 2,803 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . V X W O R K S . E X T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2009-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
-- This is the VxWorks 5 and VxWorks MILS version of this package
package body System.VxWorks.Ext is
IERR : constant := -1;
------------------------
-- taskCpuAffinitySet --
------------------------
function taskCpuAffinitySet (tid : t_id; CPU : int) return int is
pragma Unreferenced (tid, CPU);
begin
return IERR;
end taskCpuAffinitySet;
-------------------------
-- taskMaskAffinitySet --
-------------------------
function taskMaskAffinitySet (tid : t_id; CPU_Set : unsigned) return int is
pragma Unreferenced (tid, CPU_Set);
begin
return IERR;
end taskMaskAffinitySet;
end System.VxWorks.Ext;
|
docandrew/troodon | Ada | 224,288 | ads | pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings;
with X11;
with System;
package Xlib is
XlibSpecificationRelease : constant := 6; -- /usr/include/X11/Xlib.h:36
X_HAVE_UTF8_STRING : constant := 1; -- /usr/include/X11/Xlib.h:70
-- unsupported macro: Bool int
-- unsupported macro: Status int
-- Troodon: remove these
--True : constant := 1; -- /usr/include/X11/Xlib.h:84
--False : constant := 0; -- /usr/include/X11/Xlib.h:85
QueuedAlready : constant := 0; -- /usr/include/X11/Xlib.h:87
QueuedAfterReading : constant := 1; -- /usr/include/X11/Xlib.h:88
QueuedAfterFlush : constant := 2; -- /usr/include/X11/Xlib.h:89
-- arg-macro: function ConnectionNumber (dpy)
-- return ((_XPrivDisplay)(dpy)).fd;
-- arg-macro: function RootWindow (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).root;
-- arg-macro: function DefaultScreen (dpy)
-- return ((_XPrivDisplay)(dpy)).default_screen;
-- arg-macro: function DefaultRootWindow (dpy)
-- return ScreenOfDisplay(dpy,DefaultScreen(dpy)).root;
-- arg-macro: function DefaultVisual (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).root_visual;
-- arg-macro: function DefaultGC (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).default_gc;
-- arg-macro: function BlackPixel (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).black_pixel;
-- arg-macro: function WhitePixel (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).white_pixel;
-- unsupported macro: AllPlanes ((unsigned long)~0L)
-- arg-macro: function QLength (dpy)
-- return ((_XPrivDisplay)(dpy)).qlen;
-- arg-macro: function DisplayWidth (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).width;
-- arg-macro: function DisplayHeight (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).height;
-- arg-macro: function DisplayWidthMM (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).mwidth;
-- arg-macro: function DisplayHeightMM (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).mheight;
-- arg-macro: function DisplayPlanes (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).root_depth;
-- arg-macro: function DisplayCells (dpy, scr)
-- return DefaultVisual(dpy,scr).map_entries;
-- arg-macro: function ScreenCount (dpy)
-- return ((_XPrivDisplay)(dpy)).nscreens;
-- arg-macro: function ServerVendor (dpy)
-- return ((_XPrivDisplay)(dpy)).vendor;
-- arg-macro: function ProtocolVersion (dpy)
-- return ((_XPrivDisplay)(dpy)).proto_major_version;
-- arg-macro: function ProtocolRevision (dpy)
-- return ((_XPrivDisplay)(dpy)).proto_minor_version;
-- arg-macro: function VendorRelease (dpy)
-- return ((_XPrivDisplay)(dpy)).release;
-- arg-macro: function DisplayString (dpy)
-- return ((_XPrivDisplay)(dpy)).display_name;
-- arg-macro: function DefaultDepth (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).root_depth;
-- arg-macro: function DefaultColormap (dpy, scr)
-- return ScreenOfDisplay(dpy,scr).cmap;
-- arg-macro: function BitmapUnit (dpy)
-- return ((_XPrivDisplay)(dpy)).bitmap_unit;
-- arg-macro: function BitmapBitOrder (dpy)
-- return ((_XPrivDisplay)(dpy)).bitmap_bit_order;
-- arg-macro: function BitmapPad (dpy)
-- return ((_XPrivDisplay)(dpy)).bitmap_pad;
-- arg-macro: function ImageByteOrder (dpy)
-- return ((_XPrivDisplay)(dpy)).byte_order;
-- arg-macro: function NextRequest (dpy)
-- return ((_XPrivDisplay)(dpy)).request + 1;
-- arg-macro: function LastKnownRequestProcessed (dpy)
-- return ((_XPrivDisplay)(dpy)).last_request_read;
-- arg-macro: function ScreenOfDisplay (dpy, scr)
-- return and((_XPrivDisplay)(dpy)).screens(scr);
-- arg-macro: procedure DefaultScreenOfDisplay (dpy)
-- ScreenOfDisplay(dpy,DefaultScreen(dpy))
-- arg-macro: function DisplayOfScreen (s)
-- return (s).display;
-- arg-macro: function RootWindowOfScreen (s)
-- return (s).root;
-- arg-macro: function BlackPixelOfScreen (s)
-- return (s).black_pixel;
-- arg-macro: function WhitePixelOfScreen (s)
-- return (s).white_pixel;
-- arg-macro: function DefaultColormapOfScreen (s)
-- return (s).cmap;
-- arg-macro: function DefaultDepthOfScreen (s)
-- return (s).root_depth;
-- arg-macro: function DefaultGCOfScreen (s)
-- return (s).default_gc;
-- arg-macro: function DefaultVisualOfScreen (s)
-- return (s).root_visual;
-- arg-macro: function WidthOfScreen (s)
-- return (s).width;
-- arg-macro: function HeightOfScreen (s)
-- return (s).height;
-- arg-macro: function WidthMMOfScreen (s)
-- return (s).mwidth;
-- arg-macro: function HeightMMOfScreen (s)
-- return (s).mheight;
-- arg-macro: function PlanesOfScreen (s)
-- return (s).root_depth;
-- arg-macro: function CellsOfScreen (s)
-- return DefaultVisualOfScreen((s)).map_entries;
-- arg-macro: function MinCmapsOfScreen (s)
-- return (s).min_maps;
-- arg-macro: function MaxCmapsOfScreen (s)
-- return (s).max_maps;
-- arg-macro: function DoesSaveUnders (s)
-- return (s).save_unders;
-- arg-macro: function DoesBackingStore (s)
-- return (s).backing_store;
-- arg-macro: function EventMaskOfScreen (s)
-- return (s).root_input_mask;
-- arg-macro: function XAllocID (dpy)
-- return (*((_XPrivDisplay)(dpy)).resource_alloc)((dpy));
XNRequiredCharSet : aliased constant String := "requiredCharSet" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1110
XNQueryOrientation : aliased constant String := "queryOrientation" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1111
XNBaseFontName : aliased constant String := "baseFontName" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1112
XNOMAutomatic : aliased constant String := "omAutomatic" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1113
XNMissingCharSet : aliased constant String := "missingCharSet" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1114
XNDefaultString : aliased constant String := "defaultString" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1115
XNOrientation : aliased constant String := "orientation" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1116
XNDirectionalDependentDrawing : aliased constant String := "directionalDependentDrawing" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1117
XNContextualDrawing : aliased constant String := "contextualDrawing" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1118
XNFontInfo : aliased constant String := "fontInfo" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1119
XIMPreeditArea : constant := 16#0001#; -- /usr/include/X11/Xlib.h:1173
XIMPreeditCallbacks : constant := 16#0002#; -- /usr/include/X11/Xlib.h:1174
XIMPreeditPosition : constant := 16#0004#; -- /usr/include/X11/Xlib.h:1175
XIMPreeditNothing : constant := 16#0008#; -- /usr/include/X11/Xlib.h:1176
XIMPreeditNone : constant := 16#0010#; -- /usr/include/X11/Xlib.h:1177
XIMStatusArea : constant := 16#0100#; -- /usr/include/X11/Xlib.h:1178
XIMStatusCallbacks : constant := 16#0200#; -- /usr/include/X11/Xlib.h:1179
XIMStatusNothing : constant := 16#0400#; -- /usr/include/X11/Xlib.h:1180
XIMStatusNone : constant := 16#0800#; -- /usr/include/X11/Xlib.h:1181
XNVaNestedList : aliased constant String := "XNVaNestedList" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1183
XNQueryInputStyle : aliased constant String := "queryInputStyle" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1184
XNClientWindow : aliased constant String := "clientWindow" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1185
XNInputStyle : aliased constant String := "inputStyle" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1186
XNFocusWindow : aliased constant String := "focusWindow" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1187
XNResourceName : aliased constant String := "resourceName" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1188
XNResourceClass : aliased constant String := "resourceClass" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1189
XNGeometryCallback : aliased constant String := "geometryCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1190
XNDestroyCallback : aliased constant String := "destroyCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1191
XNFilterEvents : aliased constant String := "filterEvents" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1192
XNPreeditStartCallback : aliased constant String := "preeditStartCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1193
XNPreeditDoneCallback : aliased constant String := "preeditDoneCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1194
XNPreeditDrawCallback : aliased constant String := "preeditDrawCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1195
XNPreeditCaretCallback : aliased constant String := "preeditCaretCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1196
XNPreeditStateNotifyCallback : aliased constant String := "preeditStateNotifyCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1197
XNPreeditAttributes : aliased constant String := "preeditAttributes" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1198
XNStatusStartCallback : aliased constant String := "statusStartCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1199
XNStatusDoneCallback : aliased constant String := "statusDoneCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1200
XNStatusDrawCallback : aliased constant String := "statusDrawCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1201
XNStatusAttributes : aliased constant String := "statusAttributes" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1202
XNArea : aliased constant String := "area" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1203
XNAreaNeeded : aliased constant String := "areaNeeded" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1204
XNSpotLocation : aliased constant String := "spotLocation" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1205
XNColormap : aliased constant String := "colorMap" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1206
XNStdColormap : aliased constant String := "stdColorMap" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1207
XNForeground : aliased constant String := "foreground" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1208
XNBackground : aliased constant String := "background" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1209
XNBackgroundPixmap : aliased constant String := "backgroundPixmap" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1210
XNFontSet : aliased constant String := "fontSet" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1211
XNLineSpace : aliased constant String := "lineSpace" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1212
XNCursor : aliased constant String := "cursor" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1213
XNQueryIMValuesList : aliased constant String := "queryIMValuesList" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1215
XNQueryICValuesList : aliased constant String := "queryICValuesList" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1216
XNVisiblePosition : aliased constant String := "visiblePosition" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1217
XNR6PreeditCallback : aliased constant String := "r6PreeditCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1218
XNStringConversionCallback : aliased constant String := "stringConversionCallback" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1219
XNStringConversion : aliased constant String := "stringConversion" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1220
XNResetState : aliased constant String := "resetState" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1221
XNHotKey : aliased constant String := "hotKey" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1222
XNHotKeyState : aliased constant String := "hotKeyState" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1223
XNPreeditState : aliased constant String := "preeditState" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1224
XNSeparatorofNestedList : aliased constant String := "separatorofNestedList" & ASCII.NUL; -- /usr/include/X11/Xlib.h:1225
XBufferOverflow : constant := -1; -- /usr/include/X11/Xlib.h:1227
XLookupNone : constant := 1; -- /usr/include/X11/Xlib.h:1228
XLookupChars : constant := 2; -- /usr/include/X11/Xlib.h:1229
XLookupKeySym : constant := 3; -- /usr/include/X11/Xlib.h:1230
XLookupBoth : constant := 4; -- /usr/include/X11/Xlib.h:1231
XIMReverse : constant := 1; -- /usr/include/X11/Xlib.h:1247
XIMUnderline : constant := (2**1); -- /usr/include/X11/Xlib.h:1248
XIMHighlight : constant := (2**2); -- /usr/include/X11/Xlib.h:1249
XIMPrimary : constant := (2**5); -- /usr/include/X11/Xlib.h:1250
XIMSecondary : constant := (2**6); -- /usr/include/X11/Xlib.h:1251
XIMTertiary : constant := (2**7); -- /usr/include/X11/Xlib.h:1252
XIMVisibleToForward : constant := (2**8); -- /usr/include/X11/Xlib.h:1253
XIMVisibleToBackword : constant := (2**9); -- /usr/include/X11/Xlib.h:1254
XIMVisibleToCenter : constant := (2**10); -- /usr/include/X11/Xlib.h:1255
XIMPreeditUnKnown : constant := 0; -- /usr/include/X11/Xlib.h:1269
XIMPreeditEnable : constant := 1; -- /usr/include/X11/Xlib.h:1270
XIMPreeditDisable : constant := (2**1); -- /usr/include/X11/Xlib.h:1271
XIMInitialState : constant := 1; -- /usr/include/X11/Xlib.h:1279
XIMPreserveState : constant := (2**1); -- /usr/include/X11/Xlib.h:1280
XIMStringConversionLeftEdge : constant := (16#00000001#); -- /usr/include/X11/Xlib.h:1284
XIMStringConversionRightEdge : constant := (16#00000002#); -- /usr/include/X11/Xlib.h:1285
XIMStringConversionTopEdge : constant := (16#00000004#); -- /usr/include/X11/Xlib.h:1286
XIMStringConversionBottomEdge : constant := (16#00000008#); -- /usr/include/X11/Xlib.h:1287
XIMStringConversionConcealed : constant := (16#00000010#); -- /usr/include/X11/Xlib.h:1288
XIMStringConversionWrapped : constant := (16#00000020#); -- /usr/include/X11/Xlib.h:1289
XIMStringConversionBuffer : constant := (16#0001#); -- /usr/include/X11/Xlib.h:1305
XIMStringConversionLine : constant := (16#0002#); -- /usr/include/X11/Xlib.h:1306
XIMStringConversionWord : constant := (16#0003#); -- /usr/include/X11/Xlib.h:1307
XIMStringConversionChar : constant := (16#0004#); -- /usr/include/X11/Xlib.h:1308
XIMStringConversionSubstitution : constant := (16#0001#); -- /usr/include/X11/Xlib.h:1312
XIMStringConversionRetrieval : constant := (16#0002#); -- /usr/include/X11/Xlib.h:1313
XIMHotKeyStateON : constant := (16#0001#); -- /usr/include/X11/Xlib.h:1378
XIMHotKeyStateOFF : constant := (16#0002#); -- /usr/include/X11/Xlib.h:1379
--Copyright 1985, 1986, 1987, 1991, 1998 The Open Group
--Permission to use, copy, modify, distribute, and sell this software and its
--documentation for any purpose is hereby granted without fee, provided that
--the above copyright notice appear in all copies and that both that
--copyright notice and this permission notice appear in supporting
--documentation.
--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
--OPEN GROUP 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 of The Open Group shall not be
--used in advertising or otherwise to promote the sale, use or other dealings
--in this Software without prior written authorization from The Open Group.
--
-- * Xlib.h - Header definition and support file for the C subroutine
-- * interface library (Xlib) to the X Window System Protocol (V11).
-- * Structures and symbols starting with "_" are private to the library.
--
-- applications should not depend on these two headers being included!
-- replace this with #include or typedef appropriate for your system
-- skipped func _Xmblen
-- API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
-- November 2000. Its presence is indicated through the following macro.
-- The Xlib structs are full of implicit padding to properly align members.
-- We can't clean that up without breaking ABI, so tell clang not to bother
-- complaining about it.
type XPointer is new Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:80
-- macros for screen oriented applications (toolkit)
-- * Extensions need a way to hang private data on some structures.
--
-- number returned by XRegisterExtension
type u_XExtData;
type u_XExtData is record
number : aliased int; -- /usr/include/X11/Xlib.h:149
next : access u_XExtData; -- /usr/include/X11/Xlib.h:150
free_private : access function (arg1 : access u_XExtData) return int; -- /usr/include/X11/Xlib.h:151
private_data : XPointer; -- /usr/include/X11/Xlib.h:154
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:148
-- next item on list of data for structure
-- called to free private storage
-- data private to this extension.
subtype XExtData is u_XExtData; -- /usr/include/X11/Xlib.h:155
-- * This file contains structures used by the extension mechanism.
--
-- public to extension, cannot be changed
-- extension number
-- skipped anonymous struct anon_36
type XExtCodes is record
extension : aliased int; -- /usr/include/X11/Xlib.h:161
major_opcode : aliased int; -- /usr/include/X11/Xlib.h:162
first_event : aliased int; -- /usr/include/X11/Xlib.h:163
first_error : aliased int; -- /usr/include/X11/Xlib.h:164
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:165
-- major op-code assigned by server
-- first event number for the extension
-- first error number for the extension
-- * Data structure for retrieving info about pixmap formats.
--
-- skipped anonymous struct anon_37
type XPixmapFormatValues is record
depth : aliased int; -- /usr/include/X11/Xlib.h:172
bits_per_pixel : aliased int; -- /usr/include/X11/Xlib.h:173
scanline_pad : aliased int; -- /usr/include/X11/Xlib.h:174
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:175
-- * Data structure for setting graphics context.
--
-- logical operation
-- skipped anonymous struct anon_38
type XGCValues is record
c_function : aliased int; -- /usr/include/X11/Xlib.h:182
plane_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:183
foreground : aliased unsigned_long; -- /usr/include/X11/Xlib.h:184
background : aliased unsigned_long; -- /usr/include/X11/Xlib.h:185
line_width : aliased int; -- /usr/include/X11/Xlib.h:186
line_style : aliased int; -- /usr/include/X11/Xlib.h:187
cap_style : aliased int; -- /usr/include/X11/Xlib.h:188
join_style : aliased int; -- /usr/include/X11/Xlib.h:190
fill_style : aliased int; -- /usr/include/X11/Xlib.h:191
fill_rule : aliased int; -- /usr/include/X11/Xlib.h:193
arc_mode : aliased int; -- /usr/include/X11/Xlib.h:194
tile : aliased X11.Pixmap; -- /usr/include/X11/Xlib.h:195
stipple : aliased X11.Pixmap; -- /usr/include/X11/Xlib.h:196
ts_x_origin : aliased int; -- /usr/include/X11/Xlib.h:197
ts_y_origin : aliased int; -- /usr/include/X11/Xlib.h:198
the_font : aliased X11.Font; -- /usr/include/X11/Xlib.h:199
subwindow_mode : aliased int; -- /usr/include/X11/Xlib.h:200
graphics_exposures : aliased int; -- /usr/include/X11/Xlib.h:201
clip_x_origin : aliased int; -- /usr/include/X11/Xlib.h:202
clip_y_origin : aliased int; -- /usr/include/X11/Xlib.h:203
clip_mask : aliased X11.Pixmap; -- /usr/include/X11/Xlib.h:204
dash_offset : aliased int; -- /usr/include/X11/Xlib.h:205
dashes : aliased char; -- /usr/include/X11/Xlib.h:206
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:207
-- plane mask
-- foreground pixel
-- background pixel
-- line width
-- LineSolid, LineOnOffDash, LineDoubleDash
-- CapNotLast, CapButt,
-- CapRound, CapProjecting
-- JoinMiter, JoinRound, JoinBevel
-- FillSolid, FillTiled,
-- FillStippled, FillOpaeueStippled
-- EvenOddRule, WindingRule
-- ArcChord, ArcPieSlice
-- tile pixmap for tiling operations
-- stipple 1 plane pixmap for stipping
-- offset for tile or stipple operations
-- default text font for text operations
-- ClipByChildren, IncludeInferiors
-- boolean, should exposures be generated
-- origin for clipping
-- bitmap clipping; other calls for rects
-- patterned/dashed line information
-- * Graphics context. The contents of this structure are implementation
-- * dependent. A GC should be treated as opaque by application code.
--
type u_XGC is null record; -- incomplete struct
-- hook for extension to hang data
-- protocol ID for graphics context
-- there is more to this structure, but it is private to Xlib
type GC is access all u_XGC; -- /usr/include/X11/Xlib.h:222
-- * Visual structure; contains information about colormapping possible.
--
-- hook for extension to hang data
-- skipped anonymous struct anon_39
type Visual is record
ext_data : access XExtData; -- /usr/include/X11/Xlib.h:228
the_visualid : aliased X11.VisualID; -- /usr/include/X11/Xlib.h:229
c_class : aliased int; -- /usr/include/X11/Xlib.h:231
red_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:235
green_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:235
blue_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:235
bits_per_rgb : aliased int; -- /usr/include/X11/Xlib.h:236
map_entries : aliased int; -- /usr/include/X11/Xlib.h:237
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:238
-- visual id of this visual
-- C++ class of screen (monochrome, etc.)
-- class of screen (monochrome, etc.)
-- mask values
-- log base 2 of distinct color values
-- color map entries
-- * Depth structure; contains information for each possible depth.
--
-- this depth (Z) of the depth
-- skipped anonymous struct anon_40
type Depth is record
depth : aliased int; -- /usr/include/X11/Xlib.h:244
nvisuals : aliased int; -- /usr/include/X11/Xlib.h:245
visuals : access Visual; -- /usr/include/X11/Xlib.h:246
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:247
-- number of Visual types at this depth
-- list of visuals possible at this depth
-- * Information about the screen. The contents of this structure are
-- * implementation dependent. A Screen should be treated as opaque
-- * by application code.
--
-- Forward declare before use for C++
-- (Troodon - edit)
--type u_XDisplay is null record; -- incomplete struct
--type XDisplay is null record;
-- An 8 by max_keypermod array of modifiers
-- * Display datatype maintaining display specific data.
-- * The contents of this structure are implementation dependent.
-- * A Display should be treated as opaque by application code.
--
--(Troodon: edit)
type Display is null record; -- /usr/include/X11/Xlib.h:487
-- hook for extension to hang data
-- skipped anonymous struct anon_41
type Screen is record
ext_data : access XExtData; -- /usr/include/X11/Xlib.h:258
u_display : access Display; -- /usr/include/X11/Xlib.h:259
root : aliased X11.Window; -- /usr/include/X11/Xlib.h:260
width : aliased int; -- /usr/include/X11/Xlib.h:261
height : aliased int; -- /usr/include/X11/Xlib.h:261
mwidth : aliased int; -- /usr/include/X11/Xlib.h:262
mheight : aliased int; -- /usr/include/X11/Xlib.h:262
ndepths : aliased int; -- /usr/include/X11/Xlib.h:263
depths : access Depth; -- /usr/include/X11/Xlib.h:264
root_depth : aliased int; -- /usr/include/X11/Xlib.h:265
root_visual : access Visual; -- /usr/include/X11/Xlib.h:266
default_gc : GC; -- /usr/include/X11/Xlib.h:267
cmap : aliased X11.Colormap; -- /usr/include/X11/Xlib.h:268
white_pixel : aliased unsigned_long; -- /usr/include/X11/Xlib.h:269
black_pixel : aliased unsigned_long; -- /usr/include/X11/Xlib.h:270
max_maps : aliased int; -- /usr/include/X11/Xlib.h:271
min_maps : aliased int; -- /usr/include/X11/Xlib.h:271
backing_store : aliased int; -- /usr/include/X11/Xlib.h:272
save_unders : aliased int; -- /usr/include/X11/Xlib.h:273
root_input_mask : aliased long; -- /usr/include/X11/Xlib.h:274
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:275
-- back pointer to display structure
-- Root window id.
-- width and height of screen
-- width and height of in millimeters
-- number of depths possible
-- list of allowable depths on the screen
-- bits per pixel
-- root visual
-- GC for the root root visual
-- default color map
-- White and Black pixel values
-- max and min color maps
-- Never, WhenMapped, Always
-- initial root input mask
-- * Format structure; describes ZFormat data the screen will understand.
--
-- hook for extension to hang data
-- skipped anonymous struct anon_42
type ScreenFormat is record
ext_data : access XExtData; -- /usr/include/X11/Xlib.h:281
depth : aliased int; -- /usr/include/X11/Xlib.h:282
bits_per_pixel : aliased int; -- /usr/include/X11/Xlib.h:283
scanline_pad : aliased int; -- /usr/include/X11/Xlib.h:284
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:285
-- depth of this image format
-- bits/pixel at this depth
-- scanline must padded to this multiple
-- * Data structure for setting window attributes.
--
-- background or None or ParentRelative
-- skipped anonymous struct anon_43
type XSetWindowAttributes is record
background_pixmap : aliased X11.Pixmap; -- /usr/include/X11/Xlib.h:291
background_pixel : aliased unsigned_long; -- /usr/include/X11/Xlib.h:292
border_pixmap : aliased X11.Pixmap; -- /usr/include/X11/Xlib.h:293
border_pixel : aliased unsigned_long; -- /usr/include/X11/Xlib.h:294
bit_gravity : aliased int; -- /usr/include/X11/Xlib.h:295
win_gravity : aliased int; -- /usr/include/X11/Xlib.h:296
backing_store : aliased int; -- /usr/include/X11/Xlib.h:297
backing_planes : aliased unsigned_long; -- /usr/include/X11/Xlib.h:298
backing_pixel : aliased unsigned_long; -- /usr/include/X11/Xlib.h:299
save_under : aliased int; -- /usr/include/X11/Xlib.h:300
event_mask : aliased long; -- /usr/include/X11/Xlib.h:301
do_not_propagate_mask : aliased long; -- /usr/include/X11/Xlib.h:302
override_redirect : aliased int; -- /usr/include/X11/Xlib.h:303
the_colormap : aliased X11.Colormap; -- /usr/include/X11/Xlib.h:304
the_cursor : aliased X11.Cursor; -- /usr/include/X11/Xlib.h:305
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:306
-- background pixel
-- border of the window
-- border pixel value
-- one of bit gravity values
-- one of the window gravity values
-- NotUseful, WhenMapped, Always
-- planes to be preserved if possible
-- value to use in restoring planes
-- should bits under be saved? (popups)
-- set of events that should be saved
-- set of events that should not propagate
-- boolean value for override-redirect
-- color map to be associated with window
-- cursor to be displayed (or None)
-- location of window
-- skipped anonymous struct anon_44
type XWindowAttributes is record
x : aliased int; -- /usr/include/X11/Xlib.h:309
y : aliased int; -- /usr/include/X11/Xlib.h:309
width : aliased int; -- /usr/include/X11/Xlib.h:310
height : aliased int; -- /usr/include/X11/Xlib.h:310
border_width : aliased int; -- /usr/include/X11/Xlib.h:311
depth : aliased int; -- /usr/include/X11/Xlib.h:312
the_visual : access Visual; -- /usr/include/X11/Xlib.h:313
root : aliased X11.Window; -- /usr/include/X11/Xlib.h:314
c_class : aliased int; -- /usr/include/X11/Xlib.h:316
bit_gravity : aliased int; -- /usr/include/X11/Xlib.h:320
win_gravity : aliased int; -- /usr/include/X11/Xlib.h:321
backing_store : aliased int; -- /usr/include/X11/Xlib.h:322
backing_planes : aliased unsigned_long; -- /usr/include/X11/Xlib.h:323
backing_pixel : aliased unsigned_long; -- /usr/include/X11/Xlib.h:324
save_under : aliased int; -- /usr/include/X11/Xlib.h:325
the_colormap : aliased X11.Colormap; -- /usr/include/X11/Xlib.h:326
map_installed : aliased int; -- /usr/include/X11/Xlib.h:327
map_state : aliased int; -- /usr/include/X11/Xlib.h:328
all_event_masks : aliased long; -- /usr/include/X11/Xlib.h:329
your_event_mask : aliased long; -- /usr/include/X11/Xlib.h:330
do_not_propagate_mask : aliased long; -- /usr/include/X11/Xlib.h:331
override_redirect : aliased int; -- /usr/include/X11/Xlib.h:332
the_screen : access Screen; -- /usr/include/X11/Xlib.h:333
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:334
-- width and height of window
-- border width of window
-- depth of window
-- the associated visual structure
-- root of screen containing window
-- C++ InputOutput, InputOnly
-- InputOutput, InputOnly
-- one of bit gravity values
-- one of the window gravity values
-- NotUseful, WhenMapped, Always
-- planes to be preserved if possible
-- value to be used when restoring planes
-- boolean, should bits under be saved?
-- color map to be associated with window
-- boolean, is color map currently installed
-- IsUnmapped, IsUnviewable, IsViewable
-- set of events all people have interest in
-- my event mask
-- set of events that should not propagate
-- boolean value for override-redirect
-- back pointer to correct screen
-- * Data structure for host setting; getting routines.
-- *
--
-- for example FamilyInternet
-- skipped anonymous struct anon_45
type XHostAddress is record
family : aliased int; -- /usr/include/X11/Xlib.h:342
length : aliased int; -- /usr/include/X11/Xlib.h:343
address : Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:344
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:345
-- length of address, in bytes
-- pointer to where to find the bytes
-- * Data structure for ServerFamilyInterpreted addresses in host routines
--
-- length of type string, in bytes
-- skipped anonymous struct anon_46
type XServerInterpretedAddress is record
typelength : aliased int; -- /usr/include/X11/Xlib.h:351
valuelength : aliased int; -- /usr/include/X11/Xlib.h:352
c_type : Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:353
value : Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:354
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:355
-- length of value string, in bytes
-- pointer to where to find the type string
-- pointer to where to find the address
-- * Data structure for "image" data, used by image manipulation routines.
--
-- size of image
type u_XImage;
type funcs is record
create_image : access function
(arg1 : access Display;
arg2 : access Visual;
arg3 : unsigned;
arg4 : int;
arg5 : int;
arg6 : Interfaces.C.Strings.chars_ptr;
arg7 : unsigned;
arg8 : unsigned;
arg9 : int;
arg10 : int) return access u_XImage; -- /usr/include/X11/Xlib.h:377
destroy_image : access function (arg1 : access u_XImage) return int; -- /usr/include/X11/Xlib.h:388
get_pixel : access function
(arg1 : access u_XImage;
arg2 : int;
arg3 : int) return unsigned_long; -- /usr/include/X11/Xlib.h:389
put_pixel : access function
(arg1 : access u_XImage;
arg2 : int;
arg3 : int;
arg4 : unsigned_long) return int; -- /usr/include/X11/Xlib.h:390
sub_image : access function
(arg1 : access u_XImage;
arg2 : int;
arg3 : int;
arg4 : unsigned;
arg5 : unsigned) return access u_XImage; -- /usr/include/X11/Xlib.h:391
add_pixel : access function (arg1 : access u_XImage; arg2 : long) return int; -- /usr/include/X11/Xlib.h:392
end record
with Convention => C_Pass_By_Copy;
type u_XImage is record
width : aliased int; -- /usr/include/X11/Xlib.h:361
height : aliased int; -- /usr/include/X11/Xlib.h:361
xoffset : aliased int; -- /usr/include/X11/Xlib.h:362
format : aliased int; -- /usr/include/X11/Xlib.h:363
data : Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:364
byte_order : aliased int; -- /usr/include/X11/Xlib.h:365
bitmap_unit : aliased int; -- /usr/include/X11/Xlib.h:366
bitmap_bit_order : aliased int; -- /usr/include/X11/Xlib.h:367
bitmap_pad : aliased int; -- /usr/include/X11/Xlib.h:368
depth : aliased int; -- /usr/include/X11/Xlib.h:369
bytes_per_line : aliased int; -- /usr/include/X11/Xlib.h:370
bits_per_pixel : aliased int; -- /usr/include/X11/Xlib.h:371
red_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:372
green_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:373
blue_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:374
obdata : XPointer; -- /usr/include/X11/Xlib.h:375
f : aliased funcs; -- /usr/include/X11/Xlib.h:393
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:360
-- number of pixels offset in X direction
-- XYBitmap, XYPixmap, ZPixmap
-- pointer to image data
-- data byte order, LSBFirst, MSBFirst
-- quant. of scanline 8, 16, 32
-- LSBFirst, MSBFirst
-- 8, 16, 32 either XY or ZPixmap
-- depth of image
-- accelarator to next line
-- bits per pixel (ZPixmap)
-- bits in z arrangement
-- hook for the object routines to hang on
-- image manipulation routines
-- display
-- visual
-- depth
-- format
-- offset
-- data
-- width
-- height
-- bitmap_pad
-- bytes_per_line
subtype XImage is u_XImage; -- /usr/include/X11/Xlib.h:394
-- * Data structure for XReconfigureWindow
--
-- skipped anonymous struct anon_47
type XWindowChanges is record
x : aliased int; -- /usr/include/X11/Xlib.h:400
y : aliased int; -- /usr/include/X11/Xlib.h:400
width : aliased int; -- /usr/include/X11/Xlib.h:401
height : aliased int; -- /usr/include/X11/Xlib.h:401
border_width : aliased int; -- /usr/include/X11/Xlib.h:402
sibling : aliased X11.Window; -- /usr/include/X11/Xlib.h:403
stack_mode : aliased int; -- /usr/include/X11/Xlib.h:404
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:405
-- * Data structure used by color operations
--
-- skipped anonymous struct anon_48
type XColor is record
pixel : aliased unsigned_long; -- /usr/include/X11/Xlib.h:411
red : aliased unsigned_short; -- /usr/include/X11/Xlib.h:412
green : aliased unsigned_short; -- /usr/include/X11/Xlib.h:412
blue : aliased unsigned_short; -- /usr/include/X11/Xlib.h:412
flags : aliased char; -- /usr/include/X11/Xlib.h:413
pad : aliased char; -- /usr/include/X11/Xlib.h:414
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:415
-- do_red, do_green, do_blue
-- * Data structures for graphics operations. On most machines, these are
-- * congruent with the wire protocol structures, so reformatting the data
-- * can be avoided on these architectures.
--
-- skipped anonymous struct anon_49
type XSegment is record
x1 : aliased short; -- /usr/include/X11/Xlib.h:423
y1 : aliased short; -- /usr/include/X11/Xlib.h:423
x2 : aliased short; -- /usr/include/X11/Xlib.h:423
y2 : aliased short; -- /usr/include/X11/Xlib.h:423
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:424
-- skipped anonymous struct anon_50
type XPoint is record
x : aliased short; -- /usr/include/X11/Xlib.h:427
y : aliased short; -- /usr/include/X11/Xlib.h:427
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:428
-- skipped anonymous struct anon_51
type XRectangle is record
x : aliased short; -- /usr/include/X11/Xlib.h:431
y : aliased short; -- /usr/include/X11/Xlib.h:431
width : aliased unsigned_short; -- /usr/include/X11/Xlib.h:432
height : aliased unsigned_short; -- /usr/include/X11/Xlib.h:432
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:433
-- skipped anonymous struct anon_52
type XArc is record
x : aliased short; -- /usr/include/X11/Xlib.h:436
y : aliased short; -- /usr/include/X11/Xlib.h:436
width : aliased unsigned_short; -- /usr/include/X11/Xlib.h:437
height : aliased unsigned_short; -- /usr/include/X11/Xlib.h:437
angle1 : aliased short; -- /usr/include/X11/Xlib.h:438
angle2 : aliased short; -- /usr/include/X11/Xlib.h:438
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:439
-- Data structure for XChangeKeyboardControl
-- skipped anonymous struct anon_53
type XKeyboardControl is record
key_click_percent : aliased int; -- /usr/include/X11/Xlib.h:445
bell_percent : aliased int; -- /usr/include/X11/Xlib.h:446
bell_pitch : aliased int; -- /usr/include/X11/Xlib.h:447
bell_duration : aliased int; -- /usr/include/X11/Xlib.h:448
led : aliased int; -- /usr/include/X11/Xlib.h:449
led_mode : aliased int; -- /usr/include/X11/Xlib.h:450
key : aliased int; -- /usr/include/X11/Xlib.h:451
auto_repeat_mode : aliased int; -- /usr/include/X11/Xlib.h:452
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:453
-- On, Off, Default
-- Data structure for XGetKeyboardControl
-- skipped anonymous struct anon_54
subtype XKeyboardState_array1030 is Interfaces.C.char_array (0 .. 31);
type XKeyboardState is record
key_click_percent : aliased int; -- /usr/include/X11/Xlib.h:458
bell_percent : aliased int; -- /usr/include/X11/Xlib.h:459
bell_pitch : aliased unsigned; -- /usr/include/X11/Xlib.h:460
bell_duration : aliased unsigned; -- /usr/include/X11/Xlib.h:460
led_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:461
global_auto_repeat : aliased int; -- /usr/include/X11/Xlib.h:462
auto_repeats : aliased XKeyboardState_array1030; -- /usr/include/X11/Xlib.h:463
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:464
-- Data structure for XGetMotionEvents.
-- skipped anonymous struct anon_55
type XTimeCoord is record
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:469
x : aliased short; -- /usr/include/X11/Xlib.h:470
y : aliased short; -- /usr/include/X11/Xlib.h:470
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:471
-- Data structure for X{Set,Get}ModifierMapping
-- The server's max # of keys per modifier
-- skipped anonymous struct anon_56
type XModifierKeymap is record
max_keypermod : aliased int; -- /usr/include/X11/Xlib.h:476
modifiermap : access X11.KeyCode; -- /usr/include/X11/Xlib.h:477
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:478
-- Forward declare before use for C++
type u_XPrivate is null record; -- incomplete struct
type u_XrmHashBucketRec is null record; -- incomplete struct
-- hook for extension to hang data
-- skipped anonymous struct anon_57
-- Network socket.
-- major version of server's X protocol
-- minor version of servers X protocol
-- vendor of the server hardware
-- allocator function
-- screen byte order, LSBFirst, MSBFirst
-- padding and data requirements
-- padding requirements on bitmaps
-- LeastSignificant or MostSignificant
-- number of pixmap formats in list
-- pixmap format list
-- release of the server
-- Length of input event queue
-- seq number of last event read
-- sequence number of last request.
-- maximum number 32 bit words in request
-- "host:display" string used on this connect
-- default screen for operations
-- number of screens on this server
-- pointer to list of screens
-- size of motion buffer
-- minimum defined keycode
-- maximum defined keycode
-- contents of defaults from server
-- there is more to this structure, but it is private to Xlib
--(Troodon: edit)
--type u_XPrivDisplay is access all anon_57; -- /usr/include/X11/Xlib.h:550
-- * Definitions of specific events.
--
-- of event
-- skipped anonymous struct anon_58
type XKeyEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:558
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:559
send_event : aliased int; -- /usr/include/X11/Xlib.h:560
the_display : access Display; -- /usr/include/X11/Xlib.h:561
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:562
root : aliased X11.Window; -- /usr/include/X11/Xlib.h:563
subwindow : aliased X11.Window; -- /usr/include/X11/Xlib.h:564
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:565
x : aliased int; -- /usr/include/X11/Xlib.h:566
y : aliased int; -- /usr/include/X11/Xlib.h:566
x_root : aliased int; -- /usr/include/X11/Xlib.h:567
y_root : aliased int; -- /usr/include/X11/Xlib.h:567
state : aliased unsigned; -- /usr/include/X11/Xlib.h:568
keycode : aliased unsigned; -- /usr/include/X11/Xlib.h:569
same_screen : aliased int; -- /usr/include/X11/Xlib.h:570
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:571
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- "event" window it is reported relative to
-- root window that the event occurred on
-- child window
-- milliseconds
-- pointer x, y coordinates in event window
-- coordinates relative to root
-- key or button mask
-- detail
-- same screen flag
subtype XKeyPressedEvent is XKeyEvent; -- /usr/include/X11/Xlib.h:572
subtype XKeyReleasedEvent is XKeyEvent; -- /usr/include/X11/Xlib.h:573
-- of event
-- skipped anonymous struct anon_59
type XButtonEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:576
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:577
send_event : aliased int; -- /usr/include/X11/Xlib.h:578
the_display : access Display; -- /usr/include/X11/Xlib.h:579
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:580
root : aliased X11.Window; -- /usr/include/X11/Xlib.h:581
subwindow : aliased X11.Window; -- /usr/include/X11/Xlib.h:582
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:583
x : aliased int; -- /usr/include/X11/Xlib.h:584
y : aliased int; -- /usr/include/X11/Xlib.h:584
x_root : aliased int; -- /usr/include/X11/Xlib.h:585
y_root : aliased int; -- /usr/include/X11/Xlib.h:585
state : aliased unsigned; -- /usr/include/X11/Xlib.h:586
button : aliased unsigned; -- /usr/include/X11/Xlib.h:587
same_screen : aliased int; -- /usr/include/X11/Xlib.h:588
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:589
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- "event" window it is reported relative to
-- root window that the event occurred on
-- child window
-- milliseconds
-- pointer x, y coordinates in event window
-- coordinates relative to root
-- key or button mask
-- detail
-- same screen flag
subtype XButtonPressedEvent is XButtonEvent; -- /usr/include/X11/Xlib.h:590
subtype XButtonReleasedEvent is XButtonEvent; -- /usr/include/X11/Xlib.h:591
-- of event
-- skipped anonymous struct anon_60
type XMotionEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:594
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:595
send_event : aliased int; -- /usr/include/X11/Xlib.h:596
the_display : access Display; -- /usr/include/X11/Xlib.h:597
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:598
root : aliased X11.Window; -- /usr/include/X11/Xlib.h:599
subwindow : aliased X11.Window; -- /usr/include/X11/Xlib.h:600
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:601
x : aliased int; -- /usr/include/X11/Xlib.h:602
y : aliased int; -- /usr/include/X11/Xlib.h:602
x_root : aliased int; -- /usr/include/X11/Xlib.h:603
y_root : aliased int; -- /usr/include/X11/Xlib.h:603
state : aliased unsigned; -- /usr/include/X11/Xlib.h:604
is_hint : aliased char; -- /usr/include/X11/Xlib.h:605
same_screen : aliased int; -- /usr/include/X11/Xlib.h:606
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:607
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- "event" window reported relative to
-- root window that the event occurred on
-- child window
-- milliseconds
-- pointer x, y coordinates in event window
-- coordinates relative to root
-- key or button mask
-- detail
-- same screen flag
subtype XPointerMovedEvent is XMotionEvent; -- /usr/include/X11/Xlib.h:608
-- of event
-- skipped anonymous struct anon_61
type XCrossingEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:611
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:612
send_event : aliased int; -- /usr/include/X11/Xlib.h:613
the_display : access Display; -- /usr/include/X11/Xlib.h:614
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:615
root : aliased X11.Window; -- /usr/include/X11/Xlib.h:616
subwindow : aliased X11.Window; -- /usr/include/X11/Xlib.h:617
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:618
x : aliased int; -- /usr/include/X11/Xlib.h:619
y : aliased int; -- /usr/include/X11/Xlib.h:619
x_root : aliased int; -- /usr/include/X11/Xlib.h:620
y_root : aliased int; -- /usr/include/X11/Xlib.h:620
mode : aliased int; -- /usr/include/X11/Xlib.h:621
detail : aliased int; -- /usr/include/X11/Xlib.h:622
same_screen : aliased int; -- /usr/include/X11/Xlib.h:627
focus : aliased int; -- /usr/include/X11/Xlib.h:628
state : aliased unsigned; -- /usr/include/X11/Xlib.h:629
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:630
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- "event" window reported relative to
-- root window that the event occurred on
-- child window
-- milliseconds
-- pointer x, y coordinates in event window
-- coordinates relative to root
-- NotifyNormal, NotifyGrab, NotifyUngrab
-- * NotifyAncestor, NotifyVirtual, NotifyInferior,
-- * NotifyNonlinear,NotifyNonlinearVirtual
--
-- same screen flag
-- boolean focus
-- key or button mask
subtype XEnterWindowEvent is XCrossingEvent; -- /usr/include/X11/Xlib.h:631
subtype XLeaveWindowEvent is XCrossingEvent; -- /usr/include/X11/Xlib.h:632
-- FocusIn or FocusOut
-- skipped anonymous struct anon_62
type XFocusChangeEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:635
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:636
send_event : aliased int; -- /usr/include/X11/Xlib.h:637
the_display : access Display; -- /usr/include/X11/Xlib.h:638
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:639
mode : aliased int; -- /usr/include/X11/Xlib.h:640
detail : aliased int; -- /usr/include/X11/Xlib.h:642
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:648
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- window of event
-- NotifyNormal, NotifyWhileGrabbed,
-- NotifyGrab, NotifyUngrab
-- * NotifyAncestor, NotifyVirtual, NotifyInferior,
-- * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
-- * NotifyPointerRoot, NotifyDetailNone
--
subtype XFocusInEvent is XFocusChangeEvent; -- /usr/include/X11/Xlib.h:649
subtype XFocusOutEvent is XFocusChangeEvent; -- /usr/include/X11/Xlib.h:650
-- generated on EnterWindow and FocusIn when KeyMapState selected
-- skipped anonymous struct anon_63
subtype XKeymapEvent_array1030 is Interfaces.C.char_array (0 .. 31);
type XKeymapEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:654
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:655
send_event : aliased int; -- /usr/include/X11/Xlib.h:656
the_display : access Display; -- /usr/include/X11/Xlib.h:657
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:658
key_vector : aliased XKeymapEvent_array1030; -- /usr/include/X11/Xlib.h:659
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:660
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_64
type XExposeEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:663
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:664
send_event : aliased int; -- /usr/include/X11/Xlib.h:665
the_display : access Display; -- /usr/include/X11/Xlib.h:666
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:667
x : aliased int; -- /usr/include/X11/Xlib.h:668
y : aliased int; -- /usr/include/X11/Xlib.h:668
width : aliased int; -- /usr/include/X11/Xlib.h:669
height : aliased int; -- /usr/include/X11/Xlib.h:669
count : aliased int; -- /usr/include/X11/Xlib.h:670
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:671
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- if non-zero, at least this many more
-- skipped anonymous struct anon_65
type XGraphicsExposeEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:674
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:675
send_event : aliased int; -- /usr/include/X11/Xlib.h:676
the_display : access Display; -- /usr/include/X11/Xlib.h:677
the_drawable : aliased X11.Drawable; -- /usr/include/X11/Xlib.h:678
x : aliased int; -- /usr/include/X11/Xlib.h:679
y : aliased int; -- /usr/include/X11/Xlib.h:679
width : aliased int; -- /usr/include/X11/Xlib.h:680
height : aliased int; -- /usr/include/X11/Xlib.h:680
count : aliased int; -- /usr/include/X11/Xlib.h:681
major_code : aliased int; -- /usr/include/X11/Xlib.h:682
minor_code : aliased int; -- /usr/include/X11/Xlib.h:683
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:684
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- if non-zero, at least this many more
-- core is CopyArea or CopyPlane
-- not defined in the core
-- skipped anonymous struct anon_66
type XNoExposeEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:687
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:688
send_event : aliased int; -- /usr/include/X11/Xlib.h:689
the_display : access Display; -- /usr/include/X11/Xlib.h:690
the_drawable : aliased X11.Drawable; -- /usr/include/X11/Xlib.h:691
major_code : aliased int; -- /usr/include/X11/Xlib.h:692
minor_code : aliased int; -- /usr/include/X11/Xlib.h:693
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:694
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- core is CopyArea or CopyPlane
-- not defined in the core
-- skipped anonymous struct anon_67
type XVisibilityEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:697
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:698
send_event : aliased int; -- /usr/include/X11/Xlib.h:699
the_display : access Display; -- /usr/include/X11/Xlib.h:700
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:701
state : aliased int; -- /usr/include/X11/Xlib.h:702
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:703
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- Visibility state
-- skipped anonymous struct anon_68
type XCreateWindowEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:706
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:707
send_event : aliased int; -- /usr/include/X11/Xlib.h:708
the_display : access Display; -- /usr/include/X11/Xlib.h:709
parent : aliased X11.Window; -- /usr/include/X11/Xlib.h:710
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:711
x : aliased int; -- /usr/include/X11/Xlib.h:712
y : aliased int; -- /usr/include/X11/Xlib.h:712
width : aliased int; -- /usr/include/X11/Xlib.h:713
height : aliased int; -- /usr/include/X11/Xlib.h:713
border_width : aliased int; -- /usr/include/X11/Xlib.h:714
override_redirect : aliased int; -- /usr/include/X11/Xlib.h:715
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:716
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- parent of the window
-- window id of window created
-- window location
-- size of window
-- border width
-- creation should be overridden
-- skipped anonymous struct anon_69
type XDestroyWindowEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:719
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:720
send_event : aliased int; -- /usr/include/X11/Xlib.h:721
the_display : access Display; -- /usr/include/X11/Xlib.h:722
event : aliased X11.Window; -- /usr/include/X11/Xlib.h:723
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:724
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:725
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_70
type XUnmapEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:728
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:729
send_event : aliased int; -- /usr/include/X11/Xlib.h:730
the_display : access Display; -- /usr/include/X11/Xlib.h:731
event : aliased X11.Window; -- /usr/include/X11/Xlib.h:732
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:733
from_configure : aliased int; -- /usr/include/X11/Xlib.h:734
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:735
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_71
type XMapEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:738
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:739
send_event : aliased int; -- /usr/include/X11/Xlib.h:740
the_display : access Display; -- /usr/include/X11/Xlib.h:741
event : aliased X11.Window; -- /usr/include/X11/Xlib.h:742
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:743
override_redirect : aliased int; -- /usr/include/X11/Xlib.h:744
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:745
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- boolean, is override set...
-- skipped anonymous struct anon_72
type XMapRequestEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:748
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:749
send_event : aliased int; -- /usr/include/X11/Xlib.h:750
the_display : access Display; -- /usr/include/X11/Xlib.h:751
parent : aliased X11.Window; -- /usr/include/X11/Xlib.h:752
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:753
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:754
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_73
type XReparentEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:757
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:758
send_event : aliased int; -- /usr/include/X11/Xlib.h:759
the_display : access Display; -- /usr/include/X11/Xlib.h:760
event : aliased X11.Window; -- /usr/include/X11/Xlib.h:761
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:762
parent : aliased X11.Window; -- /usr/include/X11/Xlib.h:763
x : aliased int; -- /usr/include/X11/Xlib.h:764
y : aliased int; -- /usr/include/X11/Xlib.h:764
override_redirect : aliased int; -- /usr/include/X11/Xlib.h:765
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:766
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_74
type XConfigureEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:769
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:770
send_event : aliased int; -- /usr/include/X11/Xlib.h:771
the_display : access Display; -- /usr/include/X11/Xlib.h:772
event : aliased X11.Window; -- /usr/include/X11/Xlib.h:773
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:774
x : aliased int; -- /usr/include/X11/Xlib.h:775
y : aliased int; -- /usr/include/X11/Xlib.h:775
width : aliased int; -- /usr/include/X11/Xlib.h:776
height : aliased int; -- /usr/include/X11/Xlib.h:776
border_width : aliased int; -- /usr/include/X11/Xlib.h:777
above : aliased X11.Window; -- /usr/include/X11/Xlib.h:778
override_redirect : aliased int; -- /usr/include/X11/Xlib.h:779
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:780
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_75
type XGravityEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:783
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:784
send_event : aliased int; -- /usr/include/X11/Xlib.h:785
the_display : access Display; -- /usr/include/X11/Xlib.h:786
event : aliased X11.Window; -- /usr/include/X11/Xlib.h:787
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:788
x : aliased int; -- /usr/include/X11/Xlib.h:789
y : aliased int; -- /usr/include/X11/Xlib.h:789
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:790
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_76
type XResizeRequestEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:793
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:794
send_event : aliased int; -- /usr/include/X11/Xlib.h:795
the_display : access Display; -- /usr/include/X11/Xlib.h:796
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:797
width : aliased int; -- /usr/include/X11/Xlib.h:798
height : aliased int; -- /usr/include/X11/Xlib.h:798
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:799
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_77
type XConfigureRequestEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:802
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:803
send_event : aliased int; -- /usr/include/X11/Xlib.h:804
the_display : access Display; -- /usr/include/X11/Xlib.h:805
parent : aliased X11.Window; -- /usr/include/X11/Xlib.h:806
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:807
x : aliased int; -- /usr/include/X11/Xlib.h:808
y : aliased int; -- /usr/include/X11/Xlib.h:808
width : aliased int; -- /usr/include/X11/Xlib.h:809
height : aliased int; -- /usr/include/X11/Xlib.h:809
border_width : aliased int; -- /usr/include/X11/Xlib.h:810
above : aliased X11.Window; -- /usr/include/X11/Xlib.h:811
detail : aliased int; -- /usr/include/X11/Xlib.h:812
value_mask : aliased unsigned_long; -- /usr/include/X11/Xlib.h:813
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:814
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- Above, Below, TopIf, BottomIf, Opposite
-- skipped anonymous struct anon_78
type XCirculateEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:817
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:818
send_event : aliased int; -- /usr/include/X11/Xlib.h:819
the_display : access Display; -- /usr/include/X11/Xlib.h:820
event : aliased X11.Window; -- /usr/include/X11/Xlib.h:821
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:822
place : aliased int; -- /usr/include/X11/Xlib.h:823
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:824
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- PlaceOnTop, PlaceOnBottom
-- skipped anonymous struct anon_79
type XCirculateRequestEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:827
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:828
send_event : aliased int; -- /usr/include/X11/Xlib.h:829
the_display : access Display; -- /usr/include/X11/Xlib.h:830
parent : aliased X11.Window; -- /usr/include/X11/Xlib.h:831
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:832
place : aliased int; -- /usr/include/X11/Xlib.h:833
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:834
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- PlaceOnTop, PlaceOnBottom
-- skipped anonymous struct anon_80
type XPropertyEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:837
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:838
send_event : aliased int; -- /usr/include/X11/Xlib.h:839
the_display : access Display; -- /usr/include/X11/Xlib.h:840
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:841
the_atom : aliased X11.Atom; -- /usr/include/X11/Xlib.h:842
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:843
state : aliased int; -- /usr/include/X11/Xlib.h:844
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:845
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- NewValue, Deleted
-- skipped anonymous struct anon_81
type XSelectionClearEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:848
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:849
send_event : aliased int; -- /usr/include/X11/Xlib.h:850
the_display : access Display; -- /usr/include/X11/Xlib.h:851
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:852
selection : aliased X11.Atom; -- /usr/include/X11/Xlib.h:853
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:854
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:855
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_82
type XSelectionRequestEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:858
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:859
send_event : aliased int; -- /usr/include/X11/Xlib.h:860
the_display : access Display; -- /usr/include/X11/Xlib.h:861
owner : aliased X11.Window; -- /usr/include/X11/Xlib.h:862
requestor : aliased X11.Window; -- /usr/include/X11/Xlib.h:863
selection : aliased X11.Atom; -- /usr/include/X11/Xlib.h:864
target : aliased X11.Atom; -- /usr/include/X11/Xlib.h:865
property : aliased X11.Atom; -- /usr/include/X11/Xlib.h:866
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:867
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:868
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_83
type XSelectionEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:871
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:872
send_event : aliased int; -- /usr/include/X11/Xlib.h:873
the_display : access Display; -- /usr/include/X11/Xlib.h:874
requestor : aliased X11.Window; -- /usr/include/X11/Xlib.h:875
selection : aliased X11.Atom; -- /usr/include/X11/Xlib.h:876
target : aliased X11.Atom; -- /usr/include/X11/Xlib.h:877
property : aliased X11.Atom; -- /usr/include/X11/Xlib.h:878
the_time : aliased X11.Time; -- /usr/include/X11/Xlib.h:879
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:880
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- ATOM or None
-- skipped anonymous struct anon_84
type XColormapEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:883
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:884
send_event : aliased int; -- /usr/include/X11/Xlib.h:885
the_display : access Display; -- /usr/include/X11/Xlib.h:886
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:887
the_colormap : aliased X11.Colormap; -- /usr/include/X11/Xlib.h:888
c_new : aliased int; -- /usr/include/X11/Xlib.h:890
state : aliased int; -- /usr/include/X11/Xlib.h:894
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:895
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- COLORMAP or None
-- C++
-- ColormapInstalled, ColormapUninstalled
-- skipped anonymous struct anon_85
subtype XClientMessageEvent_array4364 is Interfaces.C.char_array (0 .. 19);
type XClientMessageEvent_array4365 is array (0 .. 9) of aliased short;
type XClientMessageEvent_array4366 is array (0 .. 4) of aliased long;
type anon_86 (discr : unsigned := 0) is record
case discr is
when 0 =>
b : aliased XClientMessageEvent_array4364; -- /usr/include/X11/Xlib.h:906
when 1 =>
s : aliased XClientMessageEvent_array4365; -- /usr/include/X11/Xlib.h:907
when others =>
l : aliased XClientMessageEvent_array4366; -- /usr/include/X11/Xlib.h:908
end case;
end record
with Convention => C_Pass_By_Copy,
Unchecked_Union => True;
type XClientMessageEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:898
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:899
send_event : aliased int; -- /usr/include/X11/Xlib.h:900
the_display : access Display; -- /usr/include/X11/Xlib.h:901
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:902
message_type : aliased X11.Atom; -- /usr/include/X11/Xlib.h:903
format : aliased int; -- /usr/include/X11/Xlib.h:904
data : aliased anon_86; -- /usr/include/X11/Xlib.h:909
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:910
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- skipped anonymous struct anon_87
type XMappingEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:913
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:914
send_event : aliased int; -- /usr/include/X11/Xlib.h:915
the_display : access Display; -- /usr/include/X11/Xlib.h:916
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:917
request : aliased int; -- /usr/include/X11/Xlib.h:918
first_keycode : aliased int; -- /usr/include/X11/Xlib.h:920
count : aliased int; -- /usr/include/X11/Xlib.h:921
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:922
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- unused
-- one of MappingModifier, MappingKeyboard,
-- MappingPointer
-- first keycode
-- defines range of change w. first_keycode
-- skipped anonymous struct anon_88
type XErrorEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:925
the_display : access Display; -- /usr/include/X11/Xlib.h:926
resourceid : aliased X11.XID; -- /usr/include/X11/Xlib.h:927
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:928
error_code : aliased unsigned_char; -- /usr/include/X11/Xlib.h:929
request_code : aliased unsigned_char; -- /usr/include/X11/Xlib.h:930
minor_code : aliased unsigned_char; -- /usr/include/X11/Xlib.h:931
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:932
-- Display the event was read from
-- resource id
-- serial number of failed request
-- error code of failed request
-- Major op-code of failed request
-- Minor op-code of failed request
-- skipped anonymous struct anon_89
type XAnyEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:935
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:936
send_event : aliased int; -- /usr/include/X11/Xlib.h:937
the_display : access Display; -- /usr/include/X11/Xlib.h:938
the_window : aliased X11.Window; -- /usr/include/X11/Xlib.h:939
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:940
-- # of last request processed by server
-- true if this came from a SendEvent request
-- Display the event was read from
-- window on which event was requested in event mask
--**************************************************************
-- *
-- * GenericEvent. This event is the standard event for all newer extensions.
--
-- of event. Always GenericEvent
-- skipped anonymous struct anon_90
type XGenericEvent is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:950
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:951
send_event : aliased int; -- /usr/include/X11/Xlib.h:952
the_display : access Display; -- /usr/include/X11/Xlib.h:953
extension : aliased int; -- /usr/include/X11/Xlib.h:954
evtype : aliased int; -- /usr/include/X11/Xlib.h:955
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:956
-- # of last request processed
-- true if from SendEvent request
-- Display the event was read from
-- major opcode of extension that caused the event
-- actual event type.
-- of event. Always GenericEvent
-- skipped anonymous struct anon_91
type XGenericEventCookie is record
c_type : aliased int; -- /usr/include/X11/Xlib.h:959
serial : aliased unsigned_long; -- /usr/include/X11/Xlib.h:960
send_event : aliased int; -- /usr/include/X11/Xlib.h:961
the_display : access Display; -- /usr/include/X11/Xlib.h:962
extension : aliased int; -- /usr/include/X11/Xlib.h:963
evtype : aliased int; -- /usr/include/X11/Xlib.h:964
cookie : aliased unsigned; -- /usr/include/X11/Xlib.h:965
data : System.Address; -- /usr/include/X11/Xlib.h:966
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:967
-- # of last request processed
-- true if from SendEvent request
-- Display the event was read from
-- major opcode of extension that caused the event
-- actual event type.
-- * this union is defined so Xlib can always use the same sized
-- * event structure internally, to avoid memory fragmentation.
--
-- must not be changed; first element
type u_XEvent_array4379 is array (0 .. 23) of aliased long;
type u_XEvent (discr : unsigned := 0) is record
case discr is
when 0 =>
c_type : aliased int; -- /usr/include/X11/Xlib.h:974
when 1 =>
xany : aliased XAnyEvent; -- /usr/include/X11/Xlib.h:975
when 2 =>
xkey : aliased XKeyEvent; -- /usr/include/X11/Xlib.h:976
when 3 =>
xbutton : aliased XButtonEvent; -- /usr/include/X11/Xlib.h:977
when 4 =>
xmotion : aliased XMotionEvent; -- /usr/include/X11/Xlib.h:978
when 5 =>
xcrossing : aliased XCrossingEvent; -- /usr/include/X11/Xlib.h:979
when 6 =>
xfocus : aliased XFocusChangeEvent; -- /usr/include/X11/Xlib.h:980
when 7 =>
xexpose : aliased XExposeEvent; -- /usr/include/X11/Xlib.h:981
when 8 =>
xgraphicsexpose : aliased XGraphicsExposeEvent; -- /usr/include/X11/Xlib.h:982
when 9 =>
xnoexpose : aliased XNoExposeEvent; -- /usr/include/X11/Xlib.h:983
when 10 =>
xvisibility : aliased XVisibilityEvent; -- /usr/include/X11/Xlib.h:984
when 11 =>
xcreatewindow : aliased XCreateWindowEvent; -- /usr/include/X11/Xlib.h:985
when 12 =>
xdestroywindow : aliased XDestroyWindowEvent; -- /usr/include/X11/Xlib.h:986
when 13 =>
xunmap : aliased XUnmapEvent; -- /usr/include/X11/Xlib.h:987
when 14 =>
xmap : aliased XMapEvent; -- /usr/include/X11/Xlib.h:988
when 15 =>
xmaprequest : aliased XMapRequestEvent; -- /usr/include/X11/Xlib.h:989
when 16 =>
xreparent : aliased XReparentEvent; -- /usr/include/X11/Xlib.h:990
when 17 =>
xconfigure : aliased XConfigureEvent; -- /usr/include/X11/Xlib.h:991
when 18 =>
xgravity : aliased XGravityEvent; -- /usr/include/X11/Xlib.h:992
when 19 =>
xresizerequest : aliased XResizeRequestEvent; -- /usr/include/X11/Xlib.h:993
when 20 =>
xconfigurerequest : aliased XConfigureRequestEvent; -- /usr/include/X11/Xlib.h:994
when 21 =>
xcirculate : aliased XCirculateEvent; -- /usr/include/X11/Xlib.h:995
when 22 =>
xcirculaterequest : aliased XCirculateRequestEvent; -- /usr/include/X11/Xlib.h:996
when 23 =>
xproperty : aliased XPropertyEvent; -- /usr/include/X11/Xlib.h:997
when 24 =>
xselectionclear : aliased XSelectionClearEvent; -- /usr/include/X11/Xlib.h:998
when 25 =>
xselectionrequest : aliased XSelectionRequestEvent; -- /usr/include/X11/Xlib.h:999
when 26 =>
xselection : aliased XSelectionEvent; -- /usr/include/X11/Xlib.h:1000
when 27 =>
xcolormap : aliased XColormapEvent; -- /usr/include/X11/Xlib.h:1001
when 28 =>
xclient : aliased XClientMessageEvent; -- /usr/include/X11/Xlib.h:1002
when 29 =>
xmapping : aliased XMappingEvent; -- /usr/include/X11/Xlib.h:1003
when 30 =>
xerror : aliased XErrorEvent; -- /usr/include/X11/Xlib.h:1004
when 31 =>
xkeymap : aliased XKeymapEvent; -- /usr/include/X11/Xlib.h:1005
when 32 =>
xgeneric : aliased XGenericEvent; -- /usr/include/X11/Xlib.h:1006
when 33 =>
xcookie : aliased XGenericEventCookie; -- /usr/include/X11/Xlib.h:1007
when others =>
pad : aliased u_XEvent_array4379; -- /usr/include/X11/Xlib.h:1008
end case;
end record
with Convention => C_Pass_By_Copy,
Unchecked_Union => True; -- /usr/include/X11/Xlib.h:973
subtype XEvent is u_XEvent; -- /usr/include/X11/Xlib.h:1009
-- * per character font metric information.
--
-- origin to left edge of raster
-- skipped anonymous struct anon_92
type XCharStruct is record
lbearing : aliased short; -- /usr/include/X11/Xlib.h:1018
rbearing : aliased short; -- /usr/include/X11/Xlib.h:1019
width : aliased short; -- /usr/include/X11/Xlib.h:1020
ascent : aliased short; -- /usr/include/X11/Xlib.h:1021
descent : aliased short; -- /usr/include/X11/Xlib.h:1022
attributes : aliased unsigned_short; -- /usr/include/X11/Xlib.h:1023
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1024
-- origin to right edge of raster
-- advance to next char's origin
-- baseline to top edge of raster
-- baseline to bottom edge of raster
-- per char flags (not predefined)
-- * To allow arbitrary information with fonts, there are additional properties
-- * returned.
--
-- skipped anonymous struct anon_93
type XFontProp is record
name : aliased X11.Atom; -- /usr/include/X11/Xlib.h:1031
card32 : aliased unsigned_long; -- /usr/include/X11/Xlib.h:1032
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1033
-- hook for extension to hang data
-- skipped anonymous struct anon_94
type XFontStruct is record
ext_data : access XExtData; -- /usr/include/X11/Xlib.h:1036
fid : aliased X11.Font; -- /usr/include/X11/Xlib.h:1037
direction : aliased unsigned; -- /usr/include/X11/Xlib.h:1038
min_char_or_byte2 : aliased unsigned; -- /usr/include/X11/Xlib.h:1039
max_char_or_byte2 : aliased unsigned; -- /usr/include/X11/Xlib.h:1040
min_byte1 : aliased unsigned; -- /usr/include/X11/Xlib.h:1041
max_byte1 : aliased unsigned; -- /usr/include/X11/Xlib.h:1042
all_chars_exist : aliased int; -- /usr/include/X11/Xlib.h:1043
default_char : aliased unsigned; -- /usr/include/X11/Xlib.h:1044
n_properties : aliased int; -- /usr/include/X11/Xlib.h:1045
properties : access XFontProp; -- /usr/include/X11/Xlib.h:1046
min_bounds : aliased XCharStruct; -- /usr/include/X11/Xlib.h:1047
max_bounds : aliased XCharStruct; -- /usr/include/X11/Xlib.h:1048
per_char : access XCharStruct; -- /usr/include/X11/Xlib.h:1049
ascent : aliased int; -- /usr/include/X11/Xlib.h:1050
descent : aliased int; -- /usr/include/X11/Xlib.h:1051
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1052
-- Font id for this font
-- hint about direction the font is painted
-- first character
-- last character
-- first row that exists
-- last row that exists
-- flag if all characters have non-zero size
-- char to print for undefined character
-- how many properties there are
-- pointer to array of additional properties
-- minimum bounds over all existing char
-- maximum bounds over all existing char
-- first_char to last_char information
-- log. extent above baseline for spacing
-- log. descent below baseline for spacing
-- * PolyText routines take these as arguments.
--
-- pointer to string
-- skipped anonymous struct anon_95
type XTextItem is record
chars : Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:1058
nchars : aliased int; -- /usr/include/X11/Xlib.h:1059
c_delta : aliased int; -- /usr/include/X11/Xlib.h:1060
the_font : aliased X11.Font; -- /usr/include/X11/Xlib.h:1061
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1062
-- number of characters
-- delta between strings
-- font to print it in, None don't change
-- normal 16 bit characters are two bytes
-- skipped anonymous struct anon_96
type XChar2b is record
byte1 : aliased unsigned_char; -- /usr/include/X11/Xlib.h:1065
byte2 : aliased unsigned_char; -- /usr/include/X11/Xlib.h:1066
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1067
-- two byte characters
-- skipped anonymous struct anon_97
type XTextItem16 is record
chars : access XChar2b; -- /usr/include/X11/Xlib.h:1070
nchars : aliased int; -- /usr/include/X11/Xlib.h:1071
c_delta : aliased int; -- /usr/include/X11/Xlib.h:1072
the_font : aliased X11.Font; -- /usr/include/X11/Xlib.h:1073
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1074
-- number of characters
-- delta between strings
-- font to print it in, None don't change
-- skipped anonymous struct anon_98
type XEDataObject (discr : unsigned := 0) is record
case discr is
when 0 =>
the_display : access Display; -- /usr/include/X11/Xlib.h:1077
when 1 =>
the_gc : GC; -- /usr/include/X11/Xlib.h:1078
when 2 =>
the_visual : access Visual; -- /usr/include/X11/Xlib.h:1079
when 3 =>
the_screen : access Screen; -- /usr/include/X11/Xlib.h:1080
when 4 =>
pixmap_format : access ScreenFormat; -- /usr/include/X11/Xlib.h:1081
when others =>
font : access XFontStruct; -- /usr/include/X11/Xlib.h:1082
end case;
end record
with Convention => C_Pass_By_Copy,
Unchecked_Union => True; -- /usr/include/X11/Xlib.h:1082
-- skipped anonymous struct anon_99
type XFontSetExtents is record
max_ink_extent : aliased XRectangle; -- /usr/include/X11/Xlib.h:1085
max_logical_extent : aliased XRectangle; -- /usr/include/X11/Xlib.h:1086
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1087
-- unused:
--typedef void (*XOMProc)();
--
type u_XOM is null record; -- incomplete struct
type XOM is access all u_XOM; -- /usr/include/X11/Xlib.h:1093
type u_XOC is null record; -- incomplete struct
type XOC is access all u_XOC; -- /usr/include/X11/Xlib.h:1094
type XFontSet is access all u_XOC; -- /usr/include/X11/Xlib.h:1094
-- skipped anonymous struct anon_100
type XmbTextItem is record
chars : Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:1097
nchars : aliased int; -- /usr/include/X11/Xlib.h:1098
c_delta : aliased int; -- /usr/include/X11/Xlib.h:1099
font_set : XFontSet; -- /usr/include/X11/Xlib.h:1100
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1101
-- skipped anonymous struct anon_101
type XwcTextItem is record
chars : access wchar_t; -- /usr/include/X11/Xlib.h:1104
nchars : aliased int; -- /usr/include/X11/Xlib.h:1105
c_delta : aliased int; -- /usr/include/X11/Xlib.h:1106
font_set : XFontSet; -- /usr/include/X11/Xlib.h:1107
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1108
-- skipped anonymous struct anon_102
type XOMCharSetList is record
charset_count : aliased int; -- /usr/include/X11/Xlib.h:1122
charset_list : System.Address; -- /usr/include/X11/Xlib.h:1123
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1124
type XOrientation is
(XOMOrientation_LTR_TTB,
XOMOrientation_RTL_TTB,
XOMOrientation_TTB_LTR,
XOMOrientation_TTB_RTL,
XOMOrientation_Context)
with Convention => C; -- /usr/include/X11/Xlib.h:1132
-- skipped anonymous struct anon_104
type XOMOrientation is record
num_orientation : aliased int; -- /usr/include/X11/Xlib.h:1135
orientation : access XOrientation; -- /usr/include/X11/Xlib.h:1136
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1137
-- Input Text description
-- skipped anonymous struct anon_105
type XOMFontInfo is record
num_font : aliased int; -- /usr/include/X11/Xlib.h:1140
font_struct_list : System.Address; -- /usr/include/X11/Xlib.h:1141
font_name_list : System.Address; -- /usr/include/X11/Xlib.h:1142
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1143
type u_XIM is null record; -- incomplete struct
type XIM is access all u_XIM; -- /usr/include/X11/Xlib.h:1145
type u_XIC is null record; -- incomplete struct
type XIC is access all u_XIC; -- /usr/include/X11/Xlib.h:1146
type XIMProc is access procedure
(arg1 : XIM;
arg2 : XPointer;
arg3 : XPointer)
with Convention => C; -- /usr/include/X11/Xlib.h:1148
type XICProc is access function
(arg1 : XIC;
arg2 : XPointer;
arg3 : XPointer) return int
with Convention => C; -- /usr/include/X11/Xlib.h:1154
type XIDProc is access procedure
(arg1 : access Display;
arg2 : XPointer;
arg3 : XPointer)
with Convention => C; -- /usr/include/X11/Xlib.h:1160
subtype XIMStyle is unsigned_long; -- /usr/include/X11/Xlib.h:1166
-- skipped anonymous struct anon_106
type XIMStyles is record
count_styles : aliased unsigned_short; -- /usr/include/X11/Xlib.h:1169
supported_styles : access XIMStyle; -- /usr/include/X11/Xlib.h:1170
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1171
type XVaNestedList is new System.Address; -- /usr/include/X11/Xlib.h:1233
-- skipped anonymous struct anon_107
type XIMCallback is record
client_data : XPointer; -- /usr/include/X11/Xlib.h:1236
callback : XIMProc; -- /usr/include/X11/Xlib.h:1237
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1238
-- skipped anonymous struct anon_108
type XICCallback is record
client_data : XPointer; -- /usr/include/X11/Xlib.h:1241
callback : XICProc; -- /usr/include/X11/Xlib.h:1242
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1243
subtype XIMFeedback is unsigned_long; -- /usr/include/X11/Xlib.h:1245
type anon_109 (discr : unsigned := 0) is record
case discr is
when 0 =>
multi_byte : Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:1262
when others =>
wide_char : access wchar_t; -- /usr/include/X11/Xlib.h:1263
end case;
end record
with Convention => C_Pass_By_Copy,
Unchecked_Union => True;
type u_XIMText is record
length : aliased unsigned_short; -- /usr/include/X11/Xlib.h:1258
feedback : access XIMFeedback; -- /usr/include/X11/Xlib.h:1259
encoding_is_wchar : aliased int; -- /usr/include/X11/Xlib.h:1260
string : aliased anon_109; -- /usr/include/X11/Xlib.h:1264
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1257
subtype XIMText is u_XIMText; -- /usr/include/X11/Xlib.h:1265
subtype XIMPreeditState is unsigned_long; -- /usr/include/X11/Xlib.h:1267
type u_XIMPreeditStateNotifyCallbackStruct is record
state : aliased XIMPreeditState; -- /usr/include/X11/Xlib.h:1274
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1273
subtype XIMPreeditStateNotifyCallbackStruct is u_XIMPreeditStateNotifyCallbackStruct; -- /usr/include/X11/Xlib.h:1275
subtype XIMResetState is unsigned_long; -- /usr/include/X11/Xlib.h:1277
subtype XIMStringConversionFeedback is unsigned_long; -- /usr/include/X11/Xlib.h:1282
type anon_110 (discr : unsigned := 0) is record
case discr is
when 0 =>
mbs : Interfaces.C.Strings.chars_ptr; -- /usr/include/X11/Xlib.h:1296
when others =>
wcs : access wchar_t; -- /usr/include/X11/Xlib.h:1297
end case;
end record
with Convention => C_Pass_By_Copy,
Unchecked_Union => True;
type u_XIMStringConversionText is record
length : aliased unsigned_short; -- /usr/include/X11/Xlib.h:1292
feedback : access XIMStringConversionFeedback; -- /usr/include/X11/Xlib.h:1293
encoding_is_wchar : aliased int; -- /usr/include/X11/Xlib.h:1294
string : aliased anon_110; -- /usr/include/X11/Xlib.h:1298
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1291
subtype XIMStringConversionText is u_XIMStringConversionText; -- /usr/include/X11/Xlib.h:1299
subtype XIMStringConversionPosition is unsigned_short; -- /usr/include/X11/Xlib.h:1301
subtype XIMStringConversionType is unsigned_short; -- /usr/include/X11/Xlib.h:1303
subtype XIMStringConversionOperation is unsigned_short; -- /usr/include/X11/Xlib.h:1310
type XIMCaretDirection is
(XIMForwardChar,
XIMBackwardChar,
XIMForwardWord,
XIMBackwardWord,
XIMCaretUp,
XIMCaretDown,
XIMNextLine,
XIMPreviousLine,
XIMLineStart,
XIMLineEnd,
XIMAbsolutePosition,
XIMDontChange)
with Convention => C; -- /usr/include/X11/Xlib.h:1323
type u_XIMStringConversionCallbackStruct is record
position : aliased XIMStringConversionPosition; -- /usr/include/X11/Xlib.h:1326
direction : aliased XIMCaretDirection; -- /usr/include/X11/Xlib.h:1327
operation : aliased XIMStringConversionOperation; -- /usr/include/X11/Xlib.h:1328
factor : aliased unsigned_short; -- /usr/include/X11/Xlib.h:1329
text : access XIMStringConversionText; -- /usr/include/X11/Xlib.h:1330
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1325
subtype XIMStringConversionCallbackStruct is u_XIMStringConversionCallbackStruct; -- /usr/include/X11/Xlib.h:1331
-- Cursor offset within pre-edit string
type u_XIMPreeditDrawCallbackStruct is record
caret : aliased int; -- /usr/include/X11/Xlib.h:1334
chg_first : aliased int; -- /usr/include/X11/Xlib.h:1335
chg_length : aliased int; -- /usr/include/X11/Xlib.h:1336
text : access XIMText; -- /usr/include/X11/Xlib.h:1337
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1333
-- Starting change position
-- Length of the change in character count
subtype XIMPreeditDrawCallbackStruct is u_XIMPreeditDrawCallbackStruct; -- /usr/include/X11/Xlib.h:1338
-- Disable caret feedback
-- UI defined caret feedback
-- UI defined caret feedback
type XIMCaretStyle is
(XIMIsInvisible,
XIMIsPrimary,
XIMIsSecondary)
with Convention => C; -- /usr/include/X11/Xlib.h:1344
-- Caret offset within pre-edit string
type u_XIMPreeditCaretCallbackStruct is record
position : aliased int; -- /usr/include/X11/Xlib.h:1347
direction : aliased XIMCaretDirection; -- /usr/include/X11/Xlib.h:1348
style : aliased XIMCaretStyle; -- /usr/include/X11/Xlib.h:1349
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1346
-- Caret moves direction
-- Feedback of the caret
subtype XIMPreeditCaretCallbackStruct is u_XIMPreeditCaretCallbackStruct; -- /usr/include/X11/Xlib.h:1350
type XIMStatusDataType is
(XIMTextType,
XIMBitmapType)
with Convention => C; -- /usr/include/X11/Xlib.h:1355
type anon_114 (discr : unsigned := 0) is record
case discr is
when 0 =>
text : access XIMText; -- /usr/include/X11/Xlib.h:1360
when others =>
bitmap : aliased X11.Pixmap; -- /usr/include/X11/Xlib.h:1361
end case;
end record
with Convention => C_Pass_By_Copy,
Unchecked_Union => True;
type u_XIMStatusDrawCallbackStruct is record
c_type : aliased XIMStatusDataType; -- /usr/include/X11/Xlib.h:1358
data : aliased anon_114; -- /usr/include/X11/Xlib.h:1362
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1357
subtype XIMStatusDrawCallbackStruct is u_XIMStatusDrawCallbackStruct; -- /usr/include/X11/Xlib.h:1363
type u_XIMHotKeyTrigger is record
the_keysym : aliased X11.KeySym; -- /usr/include/X11/Xlib.h:1366
modifier : aliased int; -- /usr/include/X11/Xlib.h:1367
modifier_mask : aliased int; -- /usr/include/X11/Xlib.h:1368
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1365
subtype XIMHotKeyTrigger is u_XIMHotKeyTrigger; -- /usr/include/X11/Xlib.h:1369
type u_XIMHotKeyTriggers is record
num_hot_key : aliased int; -- /usr/include/X11/Xlib.h:1372
key : access XIMHotKeyTrigger; -- /usr/include/X11/Xlib.h:1373
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1371
subtype XIMHotKeyTriggers is u_XIMHotKeyTriggers; -- /usr/include/X11/Xlib.h:1374
subtype XIMHotKeyState is unsigned_long; -- /usr/include/X11/Xlib.h:1376
-- skipped anonymous struct anon_115
type XIMValuesList is record
count_values : aliased unsigned_short; -- /usr/include/X11/Xlib.h:1382
supported_values : System.Address; -- /usr/include/X11/Xlib.h:1383
end record
with Convention => C_Pass_By_Copy; -- /usr/include/X11/Xlib.h:1384
function XLoadQueryFont (arg1 : access Display; arg2 : Interfaces.C.Strings.chars_ptr) return access XFontStruct -- /usr/include/X11/Xlib.h:1394
with Import => True,
Convention => C,
External_Name => "XLoadQueryFont";
-- display
-- name
function XQueryFont (arg1 : access Display; arg2 : X11.XID) return access XFontStruct -- /usr/include/X11/Xlib.h:1399
with Import => True,
Convention => C,
External_Name => "XQueryFont";
-- display
-- font_ID
function XGetMotionEvents
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Time;
arg4 : X11.Time;
arg5 : access int) return access XTimeCoord -- /usr/include/X11/Xlib.h:1405
with Import => True,
Convention => C,
External_Name => "XGetMotionEvents";
-- display
-- w
-- start
-- stop
-- nevents_return
function XDeleteModifiermapEntry
(arg1 : access XModifierKeymap;
arg2 : X11.KeyCode;
arg3 : int) return access XModifierKeymap -- /usr/include/X11/Xlib.h:1413
with Import => True,
Convention => C,
External_Name => "XDeleteModifiermapEntry";
-- modmap
-- keycode_entry
-- keycode_entry
-- modifier
function XGetModifierMapping (arg1 : access Display) return access XModifierKeymap -- /usr/include/X11/Xlib.h:1423
with Import => True,
Convention => C,
External_Name => "XGetModifierMapping";
-- display
function XInsertModifiermapEntry
(arg1 : access XModifierKeymap;
arg2 : X11.KeyCode;
arg3 : int) return access XModifierKeymap -- /usr/include/X11/Xlib.h:1427
with Import => True,
Convention => C,
External_Name => "XInsertModifiermapEntry";
-- modmap
-- keycode_entry
-- keycode_entry
-- modifier
function XNewModifiermap (arg1 : int) return access XModifierKeymap -- /usr/include/X11/Xlib.h:1437
with Import => True,
Convention => C,
External_Name => "XNewModifiermap";
-- max_keys_per_mod
function XCreateImage
(arg1 : access Display;
arg2 : access Visual;
arg3 : unsigned;
arg4 : int;
arg5 : int;
arg6 : Interfaces.C.Strings.chars_ptr;
arg7 : unsigned;
arg8 : unsigned;
arg9 : int;
arg10 : int) return access XImage -- /usr/include/X11/Xlib.h:1441
with Import => True,
Convention => C,
External_Name => "XCreateImage";
-- display
-- visual
-- depth
-- format
-- offset
-- data
-- width
-- height
-- bitmap_pad
-- bytes_per_line
function XInitImage (arg1 : access XImage) return int -- /usr/include/X11/Xlib.h:1453
with Import => True,
Convention => C,
External_Name => "XInitImage";
-- image
function XGetImage
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : int;
arg4 : int;
arg5 : unsigned;
arg6 : unsigned;
arg7 : unsigned_long;
arg8 : int) return access XImage -- /usr/include/X11/Xlib.h:1456
with Import => True,
Convention => C,
External_Name => "XGetImage";
-- display
-- d
-- x
-- y
-- width
-- height
-- plane_mask
-- format
function XGetSubImage
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : int;
arg4 : int;
arg5 : unsigned;
arg6 : unsigned;
arg7 : unsigned_long;
arg8 : int;
arg9 : access XImage;
arg10 : int;
arg11 : int) return access XImage -- /usr/include/X11/Xlib.h:1466
with Import => True,
Convention => C,
External_Name => "XGetSubImage";
-- display
-- d
-- x
-- y
-- width
-- height
-- plane_mask
-- format
-- dest_image
-- dest_x
-- dest_y
-- * X function declarations.
--
function XOpenDisplay (arg1 : Interfaces.C.Strings.chars_ptr) return access Display -- /usr/include/X11/Xlib.h:1483
with Import => True,
Convention => C,
External_Name => "XOpenDisplay";
-- display_name
procedure XrmInitialize -- /usr/include/X11/Xlib.h:1487
with Import => True,
Convention => C,
External_Name => "XrmInitialize";
function XFetchBytes (arg1 : access Display; arg2 : access int) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1491
with Import => True,
Convention => C,
External_Name => "XFetchBytes";
-- display
-- nbytes_return
function XFetchBuffer
(arg1 : access Display;
arg2 : access int;
arg3 : int) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1495
with Import => True,
Convention => C,
External_Name => "XFetchBuffer";
-- display
-- nbytes_return
-- buffer
function XGetAtomName (arg1 : access Display; arg2 : X11.Atom) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1500
with Import => True,
Convention => C,
External_Name => "XGetAtomName";
-- display
-- atom
function XGetAtomNames
(arg1 : access Display;
arg2 : access X11.Atom;
arg3 : int;
arg4 : System.Address) return int -- /usr/include/X11/Xlib.h:1504
with Import => True,
Convention => C,
External_Name => "XGetAtomNames";
-- dpy
-- atoms
-- count
-- names_return
function XGetDefault
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1510
with Import => True,
Convention => C,
External_Name => "XGetDefault";
-- display
-- program
-- option
function XDisplayName (arg1 : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1515
with Import => True,
Convention => C,
External_Name => "XDisplayName";
-- string
function XKeysymToString (arg1 : X11.KeySym) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1518
with Import => True,
Convention => C,
External_Name => "XKeysymToString";
-- keysym
function XSynchronize (arg1 : access Display; arg2 : int) return access function (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:1522
with Import => True,
Convention => C,
External_Name => "XSynchronize";
-- display
-- onoff
-- display
function XSetAfterFunction (arg1 : access Display; arg2 : access function (arg1 : access Display) return int) return access function (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:1528
with Import => True,
Convention => C,
External_Name => "XSetAfterFunction";
-- display
-- display
-- procedure
-- display
function XInternAtom
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int) return X11.Atom -- /usr/include/X11/Xlib.h:1536
with Import => True,
Convention => C,
External_Name => "XInternAtom";
-- display
-- atom_name
-- only_if_exists
function XInternAtoms
(arg1 : access Display;
arg2 : System.Address;
arg3 : int;
arg4 : int;
arg5 : access X11.Atom) return int -- /usr/include/X11/Xlib.h:1541
with Import => True,
Convention => C,
External_Name => "XInternAtoms";
-- dpy
-- names
-- count
-- onlyIfExists
-- atoms_return
function XCopyColormapAndFree (arg1 : access Display; arg2 : X11.Colormap) return X11.Colormap -- /usr/include/X11/Xlib.h:1548
with Import => True,
Convention => C,
External_Name => "XCopyColormapAndFree";
-- display
-- colormap
function XCreateColormap
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access Visual;
arg4 : int) return X11.Colormap -- /usr/include/X11/Xlib.h:1552
with Import => True,
Convention => C,
External_Name => "XCreateColormap";
-- display
-- w
-- visual
-- alloc
function XCreatePixmapCursor
(arg1 : access Display;
arg2 : X11.Pixmap;
arg3 : X11.Pixmap;
arg4 : access XColor;
arg5 : access XColor;
arg6 : unsigned;
arg7 : unsigned) return X11.Cursor -- /usr/include/X11/Xlib.h:1558
with Import => True,
Convention => C,
External_Name => "XCreatePixmapCursor";
-- display
-- source
-- mask
-- foreground_color
-- background_color
-- x
-- y
function XCreateGlyphCursor
(arg1 : access Display;
arg2 : X11.Font;
arg3 : X11.Font;
arg4 : unsigned;
arg5 : unsigned;
arg6 : access constant XColor;
arg7 : access constant XColor) return X11.Cursor -- /usr/include/X11/Xlib.h:1567
with Import => True,
Convention => C,
External_Name => "XCreateGlyphCursor";
-- display
-- source_font
-- mask_font
-- source_char
-- mask_char
-- foreground_color
-- background_color
function XCreateFontCursor (arg1 : access Display; arg2 : unsigned) return X11.Cursor -- /usr/include/X11/Xlib.h:1576
with Import => True,
Convention => C,
External_Name => "XCreateFontCursor";
-- display
-- shape
function XLoadFont (arg1 : access Display; arg2 : Interfaces.C.Strings.chars_ptr) return X11.Font -- /usr/include/X11/Xlib.h:1580
with Import => True,
Convention => C,
External_Name => "XLoadFont";
-- display
-- name
function XCreateGC
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : unsigned_long;
arg4 : access XGCValues) return GC -- /usr/include/X11/Xlib.h:1584
with Import => True,
Convention => C,
External_Name => "XCreateGC";
-- display
-- d
-- valuemask
-- values
function XGContextFromGC (arg1 : GC) return X11.GContext -- /usr/include/X11/Xlib.h:1590
with Import => True,
Convention => C,
External_Name => "XGContextFromGC";
-- gc
procedure XFlushGC (arg1 : access Display; arg2 : GC) -- /usr/include/X11/Xlib.h:1593
with Import => True,
Convention => C,
External_Name => "XFlushGC";
-- display
-- gc
function XCreatePixmap
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : unsigned;
arg4 : unsigned;
arg5 : unsigned) return X11.Pixmap -- /usr/include/X11/Xlib.h:1597
with Import => True,
Convention => C,
External_Name => "XCreatePixmap";
-- display
-- d
-- width
-- height
-- depth
function XCreateBitmapFromData
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : unsigned;
arg5 : unsigned) return X11.Pixmap -- /usr/include/X11/Xlib.h:1604
with Import => True,
Convention => C,
External_Name => "XCreateBitmapFromData";
-- display
-- d
-- data
-- width
-- height
function XCreatePixmapFromBitmapData
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : unsigned;
arg5 : unsigned;
arg6 : unsigned_long;
arg7 : unsigned_long;
arg8 : unsigned) return X11.Pixmap -- /usr/include/X11/Xlib.h:1611
with Import => True,
Convention => C,
External_Name => "XCreatePixmapFromBitmapData";
-- display
-- d
-- data
-- width
-- height
-- fg
-- bg
-- depth
function XCreateSimpleWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : int;
arg5 : unsigned;
arg6 : unsigned;
arg7 : unsigned;
arg8 : unsigned_long;
arg9 : unsigned_long) return X11.Window -- /usr/include/X11/Xlib.h:1621
with Import => True,
Convention => C,
External_Name => "XCreateSimpleWindow";
-- display
-- parent
-- x
-- y
-- width
-- height
-- border_width
-- border
-- background
function XGetSelectionOwner (arg1 : access Display; arg2 : X11.Atom) return X11.Window -- /usr/include/X11/Xlib.h:1632
with Import => True,
Convention => C,
External_Name => "XGetSelectionOwner";
-- display
-- selection
function XCreateWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : int;
arg5 : unsigned;
arg6 : unsigned;
arg7 : unsigned;
arg8 : int;
arg9 : unsigned;
arg10 : access Visual;
arg11 : unsigned_long;
arg12 : access XSetWindowAttributes) return X11.Window -- /usr/include/X11/Xlib.h:1636
with Import => True,
Convention => C,
External_Name => "XCreateWindow";
-- display
-- parent
-- x
-- y
-- width
-- height
-- border_width
-- depth
-- class
-- visual
-- valuemask
-- attributes
function XListInstalledColormaps
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access int) return access X11.Colormap -- /usr/include/X11/Xlib.h:1650
with Import => True,
Convention => C,
External_Name => "XListInstalledColormaps";
-- display
-- w
-- num_return
function XListFonts
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int;
arg4 : access int) return System.Address -- /usr/include/X11/Xlib.h:1655
with Import => True,
Convention => C,
External_Name => "XListFonts";
-- display
-- pattern
-- maxnames
-- actual_count_return
function XListFontsWithInfo
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int;
arg4 : access int;
arg5 : System.Address) return System.Address -- /usr/include/X11/Xlib.h:1661
with Import => True,
Convention => C,
External_Name => "XListFontsWithInfo";
-- display
-- pattern
-- maxnames
-- count_return
-- info_return
function XGetFontPath (arg1 : access Display; arg2 : access int) return System.Address -- /usr/include/X11/Xlib.h:1668
with Import => True,
Convention => C,
External_Name => "XGetFontPath";
-- display
-- npaths_return
function XListExtensions (arg1 : access Display; arg2 : access int) return System.Address -- /usr/include/X11/Xlib.h:1672
with Import => True,
Convention => C,
External_Name => "XListExtensions";
-- display
-- nextensions_return
function XListProperties
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access int) return access X11.Atom -- /usr/include/X11/Xlib.h:1676
with Import => True,
Convention => C,
External_Name => "XListProperties";
-- display
-- w
-- num_prop_return
function XListHosts
(arg1 : access Display;
arg2 : access int;
arg3 : access int) return access XHostAddress -- /usr/include/X11/Xlib.h:1681
with Import => True,
Convention => C,
External_Name => "XListHosts";
-- display
-- nhosts_return
-- state_return
function XKeycodeToKeysym
(arg1 : access Display;
arg2 : X11.KeyCode;
arg3 : int) return X11.KeySym -- /usr/include/X11/Xlib.h:1687
with Import => True,
Convention => C,
External_Name => "XKeycodeToKeysym";
-- display
-- keycode
-- keycode
-- index
function c_XLookupKeysym (arg1 : access XKeyEvent; arg2 : int) return X11.KeySym -- /usr/include/X11/Xlib.h:1696
with Import => True,
Convention => C,
External_Name => "XLookupKeysym";
-- key_event
-- index
function XGetKeyboardMapping
(arg1 : access Display;
arg2 : X11.KeyCode;
arg3 : int;
arg4 : access int) return access X11.KeySym -- /usr/include/X11/Xlib.h:1700
with Import => True,
Convention => C,
External_Name => "XGetKeyboardMapping";
-- display
-- first_keycode
-- first_keycode
-- keycode_count
-- keysyms_per_keycode_return
function XStringToKeysym (arg1 : Interfaces.C.Strings.chars_ptr) return X11.KeySym -- /usr/include/X11/Xlib.h:1710
with Import => True,
Convention => C,
External_Name => "XStringToKeysym";
-- string
function XMaxRequestSize (arg1 : access Display) return long -- /usr/include/X11/Xlib.h:1713
with Import => True,
Convention => C,
External_Name => "XMaxRequestSize";
-- display
function XExtendedMaxRequestSize (arg1 : access Display) return long -- /usr/include/X11/Xlib.h:1716
with Import => True,
Convention => C,
External_Name => "XExtendedMaxRequestSize";
-- display
function XResourceManagerString (arg1 : access Display) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1719
with Import => True,
Convention => C,
External_Name => "XResourceManagerString";
-- display
function XScreenResourceString (arg1 : access Screen) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1722
with Import => True,
Convention => C,
External_Name => "XScreenResourceString";
-- screen
function XDisplayMotionBufferSize (arg1 : access Display) return unsigned_long -- /usr/include/X11/Xlib.h:1725
with Import => True,
Convention => C,
External_Name => "XDisplayMotionBufferSize";
-- display
function XVisualIDFromVisual (arg1 : access Visual) return X11.VisualID -- /usr/include/X11/Xlib.h:1728
with Import => True,
Convention => C,
External_Name => "XVisualIDFromVisual";
-- visual
-- multithread routines
function XInitThreads return int -- /usr/include/X11/Xlib.h:1734
with Import => True,
Convention => C,
External_Name => "XInitThreads";
procedure XLockDisplay (arg1 : access Display) -- /usr/include/X11/Xlib.h:1738
with Import => True,
Convention => C,
External_Name => "XLockDisplay";
-- display
procedure XUnlockDisplay (arg1 : access Display) -- /usr/include/X11/Xlib.h:1742
with Import => True,
Convention => C,
External_Name => "XUnlockDisplay";
-- display
-- routines for dealing with extensions
function XInitExtension (arg1 : access Display; arg2 : Interfaces.C.Strings.chars_ptr) return access XExtCodes -- /usr/include/X11/Xlib.h:1748
with Import => True,
Convention => C,
External_Name => "XInitExtension";
-- display
-- name
function XAddExtension (arg1 : access Display) return access XExtCodes -- /usr/include/X11/Xlib.h:1753
with Import => True,
Convention => C,
External_Name => "XAddExtension";
-- display
function XFindOnExtensionList (arg1 : System.Address; arg2 : int) return access XExtData -- /usr/include/X11/Xlib.h:1756
with Import => True,
Convention => C,
External_Name => "XFindOnExtensionList";
-- structure
-- number
function XEHeadOfExtensionList (arg1 : XEDataObject) return System.Address -- /usr/include/X11/Xlib.h:1760
with Import => True,
Convention => C,
External_Name => "XEHeadOfExtensionList";
-- object
-- these are routines for which there are also macros
function XRootWindow (arg1 : access Display; arg2 : int) return X11.Window -- /usr/include/X11/Xlib.h:1765
with Import => True,
Convention => C,
External_Name => "XRootWindow";
-- display
-- screen_number
function XDefaultRootWindow (arg1 : access Display) return X11.Window -- /usr/include/X11/Xlib.h:1769
with Import => True,
Convention => C,
External_Name => "XDefaultRootWindow";
-- display
function XRootWindowOfScreen (arg1 : access Screen) return X11.Window -- /usr/include/X11/Xlib.h:1772
with Import => True,
Convention => C,
External_Name => "XRootWindowOfScreen";
-- screen
function XDefaultVisual (arg1 : access Display; arg2 : int) return access Visual -- /usr/include/X11/Xlib.h:1775
with Import => True,
Convention => C,
External_Name => "XDefaultVisual";
-- display
-- screen_number
function XDefaultVisualOfScreen (arg1 : access Screen) return access Visual -- /usr/include/X11/Xlib.h:1779
with Import => True,
Convention => C,
External_Name => "XDefaultVisualOfScreen";
-- screen
function XDefaultGC (arg1 : access Display; arg2 : int) return GC -- /usr/include/X11/Xlib.h:1782
with Import => True,
Convention => C,
External_Name => "XDefaultGC";
-- display
-- screen_number
function XDefaultGCOfScreen (arg1 : access Screen) return GC -- /usr/include/X11/Xlib.h:1786
with Import => True,
Convention => C,
External_Name => "XDefaultGCOfScreen";
-- screen
function XBlackPixel (arg1 : access Display; arg2 : int) return unsigned_long -- /usr/include/X11/Xlib.h:1789
with Import => True,
Convention => C,
External_Name => "XBlackPixel";
-- display
-- screen_number
function XWhitePixel (arg1 : access Display; arg2 : int) return unsigned_long -- /usr/include/X11/Xlib.h:1793
with Import => True,
Convention => C,
External_Name => "XWhitePixel";
-- display
-- screen_number
function XAllPlanes return unsigned_long -- /usr/include/X11/Xlib.h:1797
with Import => True,
Convention => C,
External_Name => "XAllPlanes";
function XBlackPixelOfScreen (arg1 : access Screen) return unsigned_long -- /usr/include/X11/Xlib.h:1800
with Import => True,
Convention => C,
External_Name => "XBlackPixelOfScreen";
-- screen
function XWhitePixelOfScreen (arg1 : access Screen) return unsigned_long -- /usr/include/X11/Xlib.h:1803
with Import => True,
Convention => C,
External_Name => "XWhitePixelOfScreen";
-- screen
function XNextRequest (arg1 : access Display) return unsigned_long -- /usr/include/X11/Xlib.h:1806
with Import => True,
Convention => C,
External_Name => "XNextRequest";
-- display
function XLastKnownRequestProcessed (arg1 : access Display) return unsigned_long -- /usr/include/X11/Xlib.h:1809
with Import => True,
Convention => C,
External_Name => "XLastKnownRequestProcessed";
-- display
function XServerVendor (arg1 : access Display) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1812
with Import => True,
Convention => C,
External_Name => "XServerVendor";
-- display
function XDisplayString (arg1 : access Display) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:1815
with Import => True,
Convention => C,
External_Name => "XDisplayString";
-- display
function XDefaultColormap (arg1 : access Display; arg2 : int) return X11.Colormap -- /usr/include/X11/Xlib.h:1818
with Import => True,
Convention => C,
External_Name => "XDefaultColormap";
-- display
-- screen_number
function XDefaultColormapOfScreen (arg1 : access Screen) return X11.Colormap -- /usr/include/X11/Xlib.h:1822
with Import => True,
Convention => C,
External_Name => "XDefaultColormapOfScreen";
-- screen
function XDisplayOfScreen (arg1 : access Screen) return access Display -- /usr/include/X11/Xlib.h:1825
with Import => True,
Convention => C,
External_Name => "XDisplayOfScreen";
-- screen
function XScreenOfDisplay (arg1 : access Display; arg2 : int) return access Screen -- /usr/include/X11/Xlib.h:1828
with Import => True,
Convention => C,
External_Name => "XScreenOfDisplay";
-- display
-- screen_number
function XDefaultScreenOfDisplay (arg1 : access Display) return access Screen -- /usr/include/X11/Xlib.h:1832
with Import => True,
Convention => C,
External_Name => "XDefaultScreenOfDisplay";
-- display
function XEventMaskOfScreen (arg1 : access Screen) return long -- /usr/include/X11/Xlib.h:1835
with Import => True,
Convention => C,
External_Name => "XEventMaskOfScreen";
-- screen
function XScreenNumberOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:1839
with Import => True,
Convention => C,
External_Name => "XScreenNumberOfScreen";
-- screen
-- WARNING, this type not in Xlib spec
type XErrorHandler is access function (arg1 : access Display; arg2 : access XErrorEvent) return int
with Convention => C; -- /usr/include/X11/Xlib.h:1843
-- display
-- error_event
function XSetErrorHandler (arg1 : XErrorHandler) return XErrorHandler -- /usr/include/X11/Xlib.h:1848
with Import => True,
Convention => C,
External_Name => "XSetErrorHandler";
-- handler
-- WARNING, this type not in Xlib spec
type XIOErrorHandler is access function (arg1 : access Display) return int
with Convention => C; -- /usr/include/X11/Xlib.h:1853
-- display
function XSetIOErrorHandler (arg1 : XIOErrorHandler) return XIOErrorHandler -- /usr/include/X11/Xlib.h:1857
with Import => True,
Convention => C,
External_Name => "XSetIOErrorHandler";
-- handler
-- WARNING, this type not in Xlib spec
type XIOErrorExitHandler is access procedure (arg1 : access Display; arg2 : System.Address)
with Convention => C; -- /usr/include/X11/Xlib.h:1861
-- display
-- user_data
procedure XSetIOErrorExitHandler
(arg1 : access Display;
arg2 : XIOErrorExitHandler;
arg3 : System.Address) -- /usr/include/X11/Xlib.h:1866
with Import => True,
Convention => C,
External_Name => "XSetIOErrorExitHandler";
-- display
-- handler
-- user_data
function XListPixmapFormats (arg1 : access Display; arg2 : access int) return access XPixmapFormatValues -- /usr/include/X11/Xlib.h:1872
with Import => True,
Convention => C,
External_Name => "XListPixmapFormats";
-- display
-- count_return
function XListDepths
(arg1 : access Display;
arg2 : int;
arg3 : access int) return access int -- /usr/include/X11/Xlib.h:1876
with Import => True,
Convention => C,
External_Name => "XListDepths";
-- display
-- screen_number
-- count_return
-- ICCCM routines for things that don't require special include files;
-- other declarations are given in Xutil.h
function XReconfigureWMWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : unsigned;
arg5 : access XWindowChanges) return int -- /usr/include/X11/Xlib.h:1884
with Import => True,
Convention => C,
External_Name => "XReconfigureWMWindow";
-- display
-- w
-- screen_number
-- mask
-- changes
function XGetWMProtocols
(arg1 : access Display;
arg2 : X11.Window;
arg3 : System.Address;
arg4 : access int) return int -- /usr/include/X11/Xlib.h:1892
with Import => True,
Convention => C,
External_Name => "XGetWMProtocols";
-- display
-- w
-- protocols_return
-- count_return
function XSetWMProtocols
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access X11.Atom;
arg4 : int) return int -- /usr/include/X11/Xlib.h:1898
with Import => True,
Convention => C,
External_Name => "XSetWMProtocols";
-- display
-- w
-- protocols
-- count
function XIconifyWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int) return int -- /usr/include/X11/Xlib.h:1904
with Import => True,
Convention => C,
External_Name => "XIconifyWindow";
-- display
-- w
-- screen_number
function XWithdrawWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int) return int -- /usr/include/X11/Xlib.h:1909
with Import => True,
Convention => C,
External_Name => "XWithdrawWindow";
-- display
-- w
-- screen_number
function XGetCommand
(arg1 : access Display;
arg2 : X11.Window;
arg3 : System.Address;
arg4 : access int) return int -- /usr/include/X11/Xlib.h:1914
with Import => True,
Convention => C,
External_Name => "XGetCommand";
-- display
-- w
-- argv_return
-- argc_return
function XGetWMColormapWindows
(arg1 : access Display;
arg2 : X11.Window;
arg3 : System.Address;
arg4 : access int) return int -- /usr/include/X11/Xlib.h:1920
with Import => True,
Convention => C,
External_Name => "XGetWMColormapWindows";
-- display
-- w
-- windows_return
-- count_return
function XSetWMColormapWindows
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access X11.Window;
arg4 : int) return int -- /usr/include/X11/Xlib.h:1926
with Import => True,
Convention => C,
External_Name => "XSetWMColormapWindows";
-- display
-- w
-- colormap_windows
-- count
procedure XFreeStringList (arg1 : System.Address) -- /usr/include/X11/Xlib.h:1932
with Import => True,
Convention => C,
External_Name => "XFreeStringList";
-- list
function XSetTransientForHint
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Window) return int -- /usr/include/X11/Xlib.h:1935
with Import => True,
Convention => C,
External_Name => "XSetTransientForHint";
-- display
-- w
-- prop_window
-- The following are given in alphabetical order
function XActivateScreenSaver (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:1943
with Import => True,
Convention => C,
External_Name => "XActivateScreenSaver";
-- display
function XAddHost (arg1 : access Display; arg2 : access XHostAddress) return int -- /usr/include/X11/Xlib.h:1947
with Import => True,
Convention => C,
External_Name => "XAddHost";
-- display
-- host
function XAddHosts
(arg1 : access Display;
arg2 : access XHostAddress;
arg3 : int) return int -- /usr/include/X11/Xlib.h:1952
with Import => True,
Convention => C,
External_Name => "XAddHosts";
-- display
-- hosts
-- num_hosts
function XAddToExtensionList (arg1 : System.Address; arg2 : access XExtData) return int -- /usr/include/X11/Xlib.h:1958
with Import => True,
Convention => C,
External_Name => "XAddToExtensionList";
-- structure
-- ext_data
function XAddToSaveSet (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:1963
with Import => True,
Convention => C,
External_Name => "XAddToSaveSet";
-- display
-- w
function XAllocColor
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : access XColor) return int -- /usr/include/X11/Xlib.h:1968
with Import => True,
Convention => C,
External_Name => "XAllocColor";
-- display
-- colormap
-- screen_in_out
function XAllocColorCells
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : int;
arg4 : access unsigned_long;
arg5 : unsigned;
arg6 : access unsigned_long;
arg7 : unsigned) return int -- /usr/include/X11/Xlib.h:1974
with Import => True,
Convention => C,
External_Name => "XAllocColorCells";
-- display
-- colormap
-- contig
-- plane_masks_return
-- nplanes
-- pixels_return
-- npixels
function XAllocColorPlanes
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : int;
arg4 : access unsigned_long;
arg5 : int;
arg6 : int;
arg7 : int;
arg8 : int;
arg9 : access unsigned_long;
arg10 : access unsigned_long;
arg11 : access unsigned_long) return int -- /usr/include/X11/Xlib.h:1984
with Import => True,
Convention => C,
External_Name => "XAllocColorPlanes";
-- display
-- colormap
-- contig
-- pixels_return
-- ncolors
-- nreds
-- ngreens
-- nblues
-- rmask_return
-- gmask_return
-- bmask_return
function XAllocNamedColor
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : access XColor;
arg5 : access XColor) return int -- /usr/include/X11/Xlib.h:1998
with Import => True,
Convention => C,
External_Name => "XAllocNamedColor";
-- display
-- colormap
-- color_name
-- screen_def_return
-- exact_def_return
function XAllowEvents
(arg1 : access Display;
arg2 : int;
arg3 : X11.Time) return int -- /usr/include/X11/Xlib.h:2006
with Import => True,
Convention => C,
External_Name => "XAllowEvents";
-- display
-- event_mode
-- time
function XAutoRepeatOff (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2012
with Import => True,
Convention => C,
External_Name => "XAutoRepeatOff";
-- display
function XAutoRepeatOn (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2016
with Import => True,
Convention => C,
External_Name => "XAutoRepeatOn";
-- display
function XBell (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2020
with Import => True,
Convention => C,
External_Name => "XBell";
-- display
-- percent
function XBitmapBitOrder (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2025
with Import => True,
Convention => C,
External_Name => "XBitmapBitOrder";
-- display
function XBitmapPad (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2029
with Import => True,
Convention => C,
External_Name => "XBitmapPad";
-- display
function XBitmapUnit (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2033
with Import => True,
Convention => C,
External_Name => "XBitmapUnit";
-- display
function XCellsOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2037
with Import => True,
Convention => C,
External_Name => "XCellsOfScreen";
-- screen
function XChangeActivePointerGrab
(arg1 : access Display;
arg2 : unsigned;
arg3 : X11.Cursor;
arg4 : X11.Time) return int -- /usr/include/X11/Xlib.h:2041
with Import => True,
Convention => C,
External_Name => "XChangeActivePointerGrab";
-- display
-- event_mask
-- cursor
-- time
function XChangeGC
(arg1 : access Display;
arg2 : GC;
arg3 : unsigned_long;
arg4 : access XGCValues) return int -- /usr/include/X11/Xlib.h:2048
with Import => True,
Convention => C,
External_Name => "XChangeGC";
-- display
-- gc
-- valuemask
-- values
function XChangeKeyboardControl
(arg1 : access Display;
arg2 : unsigned_long;
arg3 : access XKeyboardControl) return int -- /usr/include/X11/Xlib.h:2055
with Import => True,
Convention => C,
External_Name => "XChangeKeyboardControl";
-- display
-- value_mask
-- values
function XChangeKeyboardMapping
(arg1 : access Display;
arg2 : int;
arg3 : int;
arg4 : access X11.KeySym;
arg5 : int) return int -- /usr/include/X11/Xlib.h:2061
with Import => True,
Convention => C,
External_Name => "XChangeKeyboardMapping";
-- display
-- first_keycode
-- keysyms_per_keycode
-- keysyms
-- num_codes
function XChangePointerControl
(arg1 : access Display;
arg2 : int;
arg3 : int;
arg4 : int;
arg5 : int;
arg6 : int) return int -- /usr/include/X11/Xlib.h:2069
with Import => True,
Convention => C,
External_Name => "XChangePointerControl";
-- display
-- do_accel
-- do_threshold
-- accel_numerator
-- accel_denominator
-- threshold
function XChangeProperty
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Atom;
arg4 : X11.Atom;
arg5 : int;
arg6 : int;
arg7 : access unsigned_char;
arg8 : int) return int -- /usr/include/X11/Xlib.h:2078
with Import => True,
Convention => C,
External_Name => "XChangeProperty";
-- display
-- w
-- property
-- type
-- format
-- mode
-- data
-- nelements
function XChangeSaveSet
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int) return int -- /usr/include/X11/Xlib.h:2089
with Import => True,
Convention => C,
External_Name => "XChangeSaveSet";
-- display
-- w
-- change_mode
function XChangeWindowAttributes
(arg1 : access Display;
arg2 : X11.Window;
arg3 : unsigned_long;
arg4 : access XSetWindowAttributes) return int -- /usr/include/X11/Xlib.h:2095
with Import => True,
Convention => C,
External_Name => "XChangeWindowAttributes";
-- display
-- w
-- valuemask
-- attributes
function XCheckIfEvent
(arg1 : access Display;
arg2 : access XEvent;
arg3 : access function
(arg1 : access Display;
arg2 : access XEvent;
arg3 : XPointer) return int;
arg4 : XPointer) return int -- /usr/include/X11/Xlib.h:2102
with Import => True,
Convention => C,
External_Name => "XCheckIfEvent";
-- display
-- event_return
-- display
-- event
-- arg
-- predicate
-- arg
function XCheckMaskEvent
(arg1 : access Display;
arg2 : long;
arg3 : access XEvent) return int -- /usr/include/X11/Xlib.h:2113
with Import => True,
Convention => C,
External_Name => "XCheckMaskEvent";
-- display
-- event_mask
-- event_return
function XCheckTypedEvent
(arg1 : access Display;
arg2 : int;
arg3 : access XEvent) return int -- /usr/include/X11/Xlib.h:2119
with Import => True,
Convention => C,
External_Name => "XCheckTypedEvent";
-- display
-- event_type
-- event_return
function XCheckTypedWindowEvent
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : access XEvent) return int -- /usr/include/X11/Xlib.h:2125
with Import => True,
Convention => C,
External_Name => "XCheckTypedWindowEvent";
-- display
-- w
-- event_type
-- event_return
function XCheckWindowEvent
(arg1 : access Display;
arg2 : X11.Window;
arg3 : long;
arg4 : access XEvent) return int -- /usr/include/X11/Xlib.h:2132
with Import => True,
Convention => C,
External_Name => "XCheckWindowEvent";
-- display
-- w
-- event_mask
-- event_return
function XCirculateSubwindows
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int) return int -- /usr/include/X11/Xlib.h:2139
with Import => True,
Convention => C,
External_Name => "XCirculateSubwindows";
-- display
-- w
-- direction
function XCirculateSubwindowsDown (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2145
with Import => True,
Convention => C,
External_Name => "XCirculateSubwindowsDown";
-- display
-- w
function XCirculateSubwindowsUp (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2150
with Import => True,
Convention => C,
External_Name => "XCirculateSubwindowsUp";
-- display
-- w
function XClearArea
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : int;
arg5 : unsigned;
arg6 : unsigned;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2155
with Import => True,
Convention => C,
External_Name => "XClearArea";
-- display
-- w
-- x
-- y
-- width
-- height
-- exposures
function XClearWindow (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2165
with Import => True,
Convention => C,
External_Name => "XClearWindow";
-- display
-- w
function XCloseDisplay (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2170
with Import => True,
Convention => C,
External_Name => "XCloseDisplay";
-- display
function XConfigureWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : unsigned;
arg4 : access XWindowChanges) return int -- /usr/include/X11/Xlib.h:2174
with Import => True,
Convention => C,
External_Name => "XConfigureWindow";
-- display
-- w
-- value_mask
-- values
function XConnectionNumber (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2181
with Import => True,
Convention => C,
External_Name => "XConnectionNumber";
-- display
function XConvertSelection
(arg1 : access Display;
arg2 : X11.Atom;
arg3 : X11.Atom;
arg4 : X11.Atom;
arg5 : X11.Window;
arg6 : X11.Time) return int -- /usr/include/X11/Xlib.h:2185
with Import => True,
Convention => C,
External_Name => "XConvertSelection";
-- display
-- selection
-- target
-- property
-- requestor
-- time
function XCopyArea
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : X11.Drawable;
arg4 : GC;
arg5 : int;
arg6 : int;
arg7 : unsigned;
arg8 : unsigned;
arg9 : int;
arg10 : int) return int -- /usr/include/X11/Xlib.h:2194
with Import => True,
Convention => C,
External_Name => "XCopyArea";
-- display
-- src
-- dest
-- gc
-- src_x
-- src_y
-- width
-- height
-- dest_x
-- dest_y
function XCopyGC
(arg1 : access Display;
arg2 : GC;
arg3 : unsigned_long;
arg4 : GC) return int -- /usr/include/X11/Xlib.h:2207
with Import => True,
Convention => C,
External_Name => "XCopyGC";
-- display
-- src
-- valuemask
-- dest
function XCopyPlane
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : X11.Drawable;
arg4 : GC;
arg5 : int;
arg6 : int;
arg7 : unsigned;
arg8 : unsigned;
arg9 : int;
arg10 : int;
arg11 : unsigned_long) return int -- /usr/include/X11/Xlib.h:2214
with Import => True,
Convention => C,
External_Name => "XCopyPlane";
-- display
-- src
-- dest
-- gc
-- src_x
-- src_y
-- width
-- height
-- dest_x
-- dest_y
-- plane
function XDefaultDepth (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2228
with Import => True,
Convention => C,
External_Name => "XDefaultDepth";
-- display
-- screen_number
function XDefaultDepthOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2233
with Import => True,
Convention => C,
External_Name => "XDefaultDepthOfScreen";
-- screen
function XDefaultScreen (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2237
with Import => True,
Convention => C,
External_Name => "XDefaultScreen";
-- display
function XDefineCursor
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Cursor) return int -- /usr/include/X11/Xlib.h:2241
with Import => True,
Convention => C,
External_Name => "XDefineCursor";
-- display
-- w
-- cursor
function XDeleteProperty
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Atom) return int -- /usr/include/X11/Xlib.h:2247
with Import => True,
Convention => C,
External_Name => "XDeleteProperty";
-- display
-- w
-- property
function XDestroyWindow (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2253
with Import => True,
Convention => C,
External_Name => "XDestroyWindow";
-- display
-- w
function XDestroySubwindows (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2258
with Import => True,
Convention => C,
External_Name => "XDestroySubwindows";
-- display
-- w
function XDoesBackingStore (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2263
with Import => True,
Convention => C,
External_Name => "XDoesBackingStore";
-- screen
function XDoesSaveUnders (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2267
with Import => True,
Convention => C,
External_Name => "XDoesSaveUnders";
-- screen
function XDisableAccessControl (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2271
with Import => True,
Convention => C,
External_Name => "XDisableAccessControl";
-- display
function XDisplayCells (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2276
with Import => True,
Convention => C,
External_Name => "XDisplayCells";
-- display
-- screen_number
function XDisplayHeight (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2281
with Import => True,
Convention => C,
External_Name => "XDisplayHeight";
-- display
-- screen_number
function XDisplayHeightMM (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2286
with Import => True,
Convention => C,
External_Name => "XDisplayHeightMM";
-- display
-- screen_number
function XDisplayKeycodes
(arg1 : access Display;
arg2 : access int;
arg3 : access int) return int -- /usr/include/X11/Xlib.h:2291
with Import => True,
Convention => C,
External_Name => "XDisplayKeycodes";
-- display
-- min_keycodes_return
-- max_keycodes_return
function XDisplayPlanes (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2297
with Import => True,
Convention => C,
External_Name => "XDisplayPlanes";
-- display
-- screen_number
function XDisplayWidth (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2302
with Import => True,
Convention => C,
External_Name => "XDisplayWidth";
-- display
-- screen_number
function XDisplayWidthMM (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2307
with Import => True,
Convention => C,
External_Name => "XDisplayWidthMM";
-- display
-- screen_number
function XDrawArc
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : unsigned;
arg7 : unsigned;
arg8 : int;
arg9 : int) return int -- /usr/include/X11/Xlib.h:2312
with Import => True,
Convention => C,
External_Name => "XDrawArc";
-- display
-- d
-- gc
-- x
-- y
-- width
-- height
-- angle1
-- angle2
function XDrawArcs
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XArc;
arg5 : int) return int -- /usr/include/X11/Xlib.h:2324
with Import => True,
Convention => C,
External_Name => "XDrawArcs";
-- display
-- d
-- gc
-- arcs
-- narcs
function XDrawImageString
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : Interfaces.C.Strings.chars_ptr;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2332
with Import => True,
Convention => C,
External_Name => "XDrawImageString";
-- display
-- d
-- gc
-- x
-- y
-- string
-- length
function XDrawImageString16
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : access constant XChar2b;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2342
with Import => True,
Convention => C,
External_Name => "XDrawImageString16";
-- display
-- d
-- gc
-- x
-- y
-- string
-- length
function XDrawLine
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : int;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2352
with Import => True,
Convention => C,
External_Name => "XDrawLine";
-- display
-- d
-- gc
-- x1
-- y1
-- x2
-- y2
function XDrawLines
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XPoint;
arg5 : int;
arg6 : int) return int -- /usr/include/X11/Xlib.h:2362
with Import => True,
Convention => C,
External_Name => "XDrawLines";
-- display
-- d
-- gc
-- points
-- npoints
-- mode
function XDrawPoint
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int) return int -- /usr/include/X11/Xlib.h:2371
with Import => True,
Convention => C,
External_Name => "XDrawPoint";
-- display
-- d
-- gc
-- x
-- y
function XDrawPoints
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XPoint;
arg5 : int;
arg6 : int) return int -- /usr/include/X11/Xlib.h:2379
with Import => True,
Convention => C,
External_Name => "XDrawPoints";
-- display
-- d
-- gc
-- points
-- npoints
-- mode
function XDrawRectangle
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : unsigned;
arg7 : unsigned) return int -- /usr/include/X11/Xlib.h:2388
with Import => True,
Convention => C,
External_Name => "XDrawRectangle";
-- display
-- d
-- gc
-- x
-- y
-- width
-- height
function XDrawRectangles
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XRectangle;
arg5 : int) return int -- /usr/include/X11/Xlib.h:2398
with Import => True,
Convention => C,
External_Name => "XDrawRectangles";
-- display
-- d
-- gc
-- rectangles
-- nrectangles
function XDrawSegments
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XSegment;
arg5 : int) return int -- /usr/include/X11/Xlib.h:2406
with Import => True,
Convention => C,
External_Name => "XDrawSegments";
-- display
-- d
-- gc
-- segments
-- nsegments
function XDrawString
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : Interfaces.C.Strings.chars_ptr;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2414
with Import => True,
Convention => C,
External_Name => "XDrawString";
-- display
-- d
-- gc
-- x
-- y
-- string
-- length
function XDrawString16
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : access constant XChar2b;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2424
with Import => True,
Convention => C,
External_Name => "XDrawString16";
-- display
-- d
-- gc
-- x
-- y
-- string
-- length
function XDrawText
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : access XTextItem;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2434
with Import => True,
Convention => C,
External_Name => "XDrawText";
-- display
-- d
-- gc
-- x
-- y
-- items
-- nitems
function XDrawText16
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : access XTextItem16;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2444
with Import => True,
Convention => C,
External_Name => "XDrawText16";
-- display
-- d
-- gc
-- x
-- y
-- items
-- nitems
function XEnableAccessControl (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2454
with Import => True,
Convention => C,
External_Name => "XEnableAccessControl";
-- display
function XEventsQueued (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2458
with Import => True,
Convention => C,
External_Name => "XEventsQueued";
-- display
-- mode
function XFetchName
(arg1 : access Display;
arg2 : X11.Window;
arg3 : System.Address) return int -- /usr/include/X11/Xlib.h:2463
with Import => True,
Convention => C,
External_Name => "XFetchName";
-- display
-- w
-- window_name_return
function XFillArc
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : unsigned;
arg7 : unsigned;
arg8 : int;
arg9 : int) return int -- /usr/include/X11/Xlib.h:2469
with Import => True,
Convention => C,
External_Name => "XFillArc";
-- display
-- d
-- gc
-- x
-- y
-- width
-- height
-- angle1
-- angle2
function XFillArcs
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XArc;
arg5 : int) return int -- /usr/include/X11/Xlib.h:2481
with Import => True,
Convention => C,
External_Name => "XFillArcs";
-- display
-- d
-- gc
-- arcs
-- narcs
function XFillPolygon
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XPoint;
arg5 : int;
arg6 : int;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2489
with Import => True,
Convention => C,
External_Name => "XFillPolygon";
-- display
-- d
-- gc
-- points
-- npoints
-- shape
-- mode
function XFillRectangle
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : unsigned;
arg7 : unsigned) return int -- /usr/include/X11/Xlib.h:2499
with Import => True,
Convention => C,
External_Name => "XFillRectangle";
-- display
-- d
-- gc
-- x
-- y
-- width
-- height
function XFillRectangles
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XRectangle;
arg5 : int) return int -- /usr/include/X11/Xlib.h:2509
with Import => True,
Convention => C,
External_Name => "XFillRectangles";
-- display
-- d
-- gc
-- rectangles
-- nrectangles
function XFlush (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2517
with Import => True,
Convention => C,
External_Name => "XFlush";
-- display
function XForceScreenSaver (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:2521
with Import => True,
Convention => C,
External_Name => "XForceScreenSaver";
-- display
-- mode
function XFree (arg1 : System.Address) return int -- /usr/include/X11/Xlib.h:2526
with Import => True,
Convention => C,
External_Name => "XFree";
-- data
function XFreeColormap (arg1 : access Display; arg2 : X11.Colormap) return int -- /usr/include/X11/Xlib.h:2530
with Import => True,
Convention => C,
External_Name => "XFreeColormap";
-- display
-- colormap
function XFreeColors
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : access unsigned_long;
arg4 : int;
arg5 : unsigned_long) return int -- /usr/include/X11/Xlib.h:2535
with Import => True,
Convention => C,
External_Name => "XFreeColors";
-- display
-- colormap
-- pixels
-- npixels
-- planes
function XFreeCursor (arg1 : access Display; arg2 : X11.Cursor) return int -- /usr/include/X11/Xlib.h:2543
with Import => True,
Convention => C,
External_Name => "XFreeCursor";
-- display
-- cursor
function XFreeExtensionList (arg1 : System.Address) return int -- /usr/include/X11/Xlib.h:2548
with Import => True,
Convention => C,
External_Name => "XFreeExtensionList";
-- list
function XFreeFont (arg1 : access Display; arg2 : access XFontStruct) return int -- /usr/include/X11/Xlib.h:2552
with Import => True,
Convention => C,
External_Name => "XFreeFont";
-- display
-- font_struct
function XFreeFontInfo
(arg1 : System.Address;
arg2 : access XFontStruct;
arg3 : int) return int -- /usr/include/X11/Xlib.h:2557
with Import => True,
Convention => C,
External_Name => "XFreeFontInfo";
-- names
-- free_info
-- actual_count
function XFreeFontNames (arg1 : System.Address) return int -- /usr/include/X11/Xlib.h:2563
with Import => True,
Convention => C,
External_Name => "XFreeFontNames";
-- list
function XFreeFontPath (arg1 : System.Address) return int -- /usr/include/X11/Xlib.h:2567
with Import => True,
Convention => C,
External_Name => "XFreeFontPath";
-- list
function XFreeGC (arg1 : access Display; arg2 : GC) return int -- /usr/include/X11/Xlib.h:2571
with Import => True,
Convention => C,
External_Name => "XFreeGC";
-- display
-- gc
function XFreeModifiermap (arg1 : access XModifierKeymap) return int -- /usr/include/X11/Xlib.h:2576
with Import => True,
Convention => C,
External_Name => "XFreeModifiermap";
-- modmap
function XFreePixmap (arg1 : access Display; arg2 : X11.Pixmap) return int -- /usr/include/X11/Xlib.h:2580
with Import => True,
Convention => C,
External_Name => "XFreePixmap";
-- display
-- pixmap
function XGeometry
(arg1 : access Display;
arg2 : int;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : Interfaces.C.Strings.chars_ptr;
arg5 : unsigned;
arg6 : unsigned;
arg7 : unsigned;
arg8 : int;
arg9 : int;
arg10 : access int;
arg11 : access int;
arg12 : access int;
arg13 : access int) return int -- /usr/include/X11/Xlib.h:2585
with Import => True,
Convention => C,
External_Name => "XGeometry";
-- display
-- screen
-- position
-- default_position
-- bwidth
-- fwidth
-- fheight
-- xadder
-- yadder
-- x_return
-- y_return
-- width_return
-- height_return
function XGetErrorDatabaseText
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : Interfaces.C.Strings.chars_ptr;
arg5 : Interfaces.C.Strings.chars_ptr;
arg6 : int) return int -- /usr/include/X11/Xlib.h:2601
with Import => True,
Convention => C,
External_Name => "XGetErrorDatabaseText";
-- display
-- name
-- message
-- default_string
-- buffer_return
-- length
function XGetErrorText
(arg1 : access Display;
arg2 : int;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : int) return int -- /usr/include/X11/Xlib.h:2610
with Import => True,
Convention => C,
External_Name => "XGetErrorText";
-- display
-- code
-- buffer_return
-- length
function XGetFontProperty
(arg1 : access XFontStruct;
arg2 : X11.Atom;
arg3 : access unsigned_long) return int -- /usr/include/X11/Xlib.h:2617
with Import => True,
Convention => C,
External_Name => "XGetFontProperty";
-- font_struct
-- atom
-- value_return
function XGetGCValues
(arg1 : access Display;
arg2 : GC;
arg3 : unsigned_long;
arg4 : access XGCValues) return int -- /usr/include/X11/Xlib.h:2623
with Import => True,
Convention => C,
External_Name => "XGetGCValues";
-- display
-- gc
-- valuemask
-- values_return
function XGetGeometry
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : access X11.Window;
arg4 : access int;
arg5 : access int;
arg6 : access unsigned;
arg7 : access unsigned;
arg8 : access unsigned;
arg9 : access unsigned) return int -- /usr/include/X11/Xlib.h:2630
with Import => True,
Convention => C,
External_Name => "XGetGeometry";
-- display
-- d
-- root_return
-- x_return
-- y_return
-- width_return
-- height_return
-- border_width_return
-- depth_return
function XGetIconName
(arg1 : access Display;
arg2 : X11.Window;
arg3 : System.Address) return int -- /usr/include/X11/Xlib.h:2642
with Import => True,
Convention => C,
External_Name => "XGetIconName";
-- display
-- w
-- icon_name_return
function XGetInputFocus
(arg1 : access Display;
arg2 : access X11.Window;
arg3 : access int) return int -- /usr/include/X11/Xlib.h:2648
with Import => True,
Convention => C,
External_Name => "XGetInputFocus";
-- display
-- focus_return
-- revert_to_return
function XGetKeyboardControl (arg1 : access Display; arg2 : access XKeyboardState) return int -- /usr/include/X11/Xlib.h:2654
with Import => True,
Convention => C,
External_Name => "XGetKeyboardControl";
-- display
-- values_return
function XGetPointerControl
(arg1 : access Display;
arg2 : access int;
arg3 : access int;
arg4 : access int) return int -- /usr/include/X11/Xlib.h:2659
with Import => True,
Convention => C,
External_Name => "XGetPointerControl";
-- display
-- accel_numerator_return
-- accel_denominator_return
-- threshold_return
function XGetPointerMapping
(arg1 : access Display;
arg2 : access unsigned_char;
arg3 : int) return int -- /usr/include/X11/Xlib.h:2666
with Import => True,
Convention => C,
External_Name => "XGetPointerMapping";
-- display
-- map_return
-- nmap
function XGetScreenSaver
(arg1 : access Display;
arg2 : access int;
arg3 : access int;
arg4 : access int;
arg5 : access int) return int -- /usr/include/X11/Xlib.h:2672
with Import => True,
Convention => C,
External_Name => "XGetScreenSaver";
-- display
-- timeout_return
-- interval_return
-- prefer_blanking_return
-- allow_exposures_return
function XGetTransientForHint
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access X11.Window) return int -- /usr/include/X11/Xlib.h:2680
with Import => True,
Convention => C,
External_Name => "XGetTransientForHint";
-- display
-- w
-- prop_window_return
function XGetWindowProperty
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Atom;
arg4 : long;
arg5 : long;
arg6 : int;
arg7 : X11.Atom;
arg8 : access X11.Atom;
arg9 : access int;
arg10 : access unsigned_long;
arg11 : access unsigned_long;
arg12 : System.Address) return int -- /usr/include/X11/Xlib.h:2686
with Import => True,
Convention => C,
External_Name => "XGetWindowProperty";
-- display
-- w
-- property
-- long_offset
-- long_length
-- delete
-- req_type
-- actual_type_return
-- actual_format_return
-- nitems_return
-- bytes_after_return
-- prop_return
function XGetWindowAttributes
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access XWindowAttributes) return int -- /usr/include/X11/Xlib.h:2701
with Import => True,
Convention => C,
External_Name => "XGetWindowAttributes";
-- display
-- w
-- window_attributes_return
function XGrabButton
(arg1 : access Display;
arg2 : unsigned;
arg3 : unsigned;
arg4 : X11.Window;
arg5 : int;
arg6 : unsigned;
arg7 : int;
arg8 : int;
arg9 : X11.Window;
arg10 : X11.Cursor) return int -- /usr/include/X11/Xlib.h:2707
with Import => True,
Convention => C,
External_Name => "XGrabButton";
-- display
-- button
-- modifiers
-- grab_window
-- owner_events
-- event_mask
-- pointer_mode
-- keyboard_mode
-- confine_to
-- cursor
function XGrabKey
(arg1 : access Display;
arg2 : int;
arg3 : unsigned;
arg4 : X11.Window;
arg5 : int;
arg6 : int;
arg7 : int) return int -- /usr/include/X11/Xlib.h:2720
with Import => True,
Convention => C,
External_Name => "XGrabKey";
-- display
-- keycode
-- modifiers
-- grab_window
-- owner_events
-- pointer_mode
-- keyboard_mode
function XGrabKeyboard
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : int;
arg5 : int;
arg6 : X11.Time) return int -- /usr/include/X11/Xlib.h:2730
with Import => True,
Convention => C,
External_Name => "XGrabKeyboard";
-- display
-- grab_window
-- owner_events
-- pointer_mode
-- keyboard_mode
-- time
function XGrabPointer
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : unsigned;
arg5 : int;
arg6 : int;
arg7 : X11.Window;
arg8 : X11.Cursor;
arg9 : X11.Time) return int -- /usr/include/X11/Xlib.h:2739
with Import => True,
Convention => C,
External_Name => "XGrabPointer";
-- display
-- grab_window
-- owner_events
-- event_mask
-- pointer_mode
-- keyboard_mode
-- confine_to
-- cursor
-- time
function XGrabServer (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2751
with Import => True,
Convention => C,
External_Name => "XGrabServer";
-- display
function XHeightMMOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2755
with Import => True,
Convention => C,
External_Name => "XHeightMMOfScreen";
-- screen
function XHeightOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2759
with Import => True,
Convention => C,
External_Name => "XHeightOfScreen";
-- screen
function XIfEvent
(arg1 : access Display;
arg2 : access XEvent;
arg3 : access function
(arg1 : access Display;
arg2 : access XEvent;
arg3 : XPointer) return int;
arg4 : XPointer) return int -- /usr/include/X11/Xlib.h:2763
with Import => True,
Convention => C,
External_Name => "XIfEvent";
-- display
-- event_return
-- display
-- event
-- arg
-- predicate
-- arg
function XImageByteOrder (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2774
with Import => True,
Convention => C,
External_Name => "XImageByteOrder";
-- display
function XInstallColormap (arg1 : access Display; arg2 : X11.Colormap) return int -- /usr/include/X11/Xlib.h:2778
with Import => True,
Convention => C,
External_Name => "XInstallColormap";
-- display
-- colormap
function XKeysymToKeycode (arg1 : access Display; arg2 : X11.KeySym) return X11.KeyCode -- /usr/include/X11/Xlib.h:2783
with Import => True,
Convention => C,
External_Name => "XKeysymToKeycode";
-- display
-- keysym
function XKillClient (arg1 : access Display; arg2 : X11.XID) return int -- /usr/include/X11/Xlib.h:2788
with Import => True,
Convention => C,
External_Name => "XKillClient";
-- display
-- resource
function XLookupColor
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : access XColor;
arg5 : access XColor) return int -- /usr/include/X11/Xlib.h:2793
with Import => True,
Convention => C,
External_Name => "XLookupColor";
-- display
-- colormap
-- color_name
-- exact_def_return
-- screen_def_return
function XLowerWindow (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2801
with Import => True,
Convention => C,
External_Name => "XLowerWindow";
-- display
-- w
function XMapRaised (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2806
with Import => True,
Convention => C,
External_Name => "XMapRaised";
-- display
-- w
function XMapSubwindows (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2811
with Import => True,
Convention => C,
External_Name => "XMapSubwindows";
-- display
-- w
function XMapWindow (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:2816
with Import => True,
Convention => C,
External_Name => "XMapWindow";
-- display
-- w
function XMaskEvent
(arg1 : access Display;
arg2 : long;
arg3 : access XEvent) return int -- /usr/include/X11/Xlib.h:2821
with Import => True,
Convention => C,
External_Name => "XMaskEvent";
-- display
-- event_mask
-- event_return
function XMaxCmapsOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2827
with Import => True,
Convention => C,
External_Name => "XMaxCmapsOfScreen";
-- screen
function XMinCmapsOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2831
with Import => True,
Convention => C,
External_Name => "XMinCmapsOfScreen";
-- screen
function XMoveResizeWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : int;
arg5 : unsigned;
arg6 : unsigned) return int -- /usr/include/X11/Xlib.h:2835
with Import => True,
Convention => C,
External_Name => "XMoveResizeWindow";
-- display
-- w
-- x
-- y
-- width
-- height
function XMoveWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : int) return int -- /usr/include/X11/Xlib.h:2844
with Import => True,
Convention => C,
External_Name => "XMoveWindow";
-- display
-- w
-- x
-- y
function XNextEvent (arg1 : access Display; arg2 : access XEvent) return int -- /usr/include/X11/Xlib.h:2851
with Import => True,
Convention => C,
External_Name => "XNextEvent";
-- display
-- event_return
function XNoOp (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2856
with Import => True,
Convention => C,
External_Name => "XNoOp";
-- display
function XParseColor
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : access XColor) return int -- /usr/include/X11/Xlib.h:2860
with Import => True,
Convention => C,
External_Name => "XParseColor";
-- display
-- colormap
-- spec
-- exact_def_return
function XParseGeometry
(arg1 : Interfaces.C.Strings.chars_ptr;
arg2 : access int;
arg3 : access int;
arg4 : access unsigned;
arg5 : access unsigned) return int -- /usr/include/X11/Xlib.h:2867
with Import => True,
Convention => C,
External_Name => "XParseGeometry";
-- parsestring
-- x_return
-- y_return
-- width_return
-- height_return
function XPeekEvent (arg1 : access Display; arg2 : access XEvent) return int -- /usr/include/X11/Xlib.h:2875
with Import => True,
Convention => C,
External_Name => "XPeekEvent";
-- display
-- event_return
function XPeekIfEvent
(arg1 : access Display;
arg2 : access XEvent;
arg3 : access function
(arg1 : access Display;
arg2 : access XEvent;
arg3 : XPointer) return int;
arg4 : XPointer) return int -- /usr/include/X11/Xlib.h:2880
with Import => True,
Convention => C,
External_Name => "XPeekIfEvent";
-- display
-- event_return
-- display
-- event
-- arg
-- predicate
-- arg
function XPending (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2891
with Import => True,
Convention => C,
External_Name => "XPending";
-- display
function XPlanesOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:2895
with Import => True,
Convention => C,
External_Name => "XPlanesOfScreen";
-- screen
function XProtocolRevision (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2899
with Import => True,
Convention => C,
External_Name => "XProtocolRevision";
-- display
function XProtocolVersion (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2903
with Import => True,
Convention => C,
External_Name => "XProtocolVersion";
-- display
function XPutBackEvent (arg1 : access Display; arg2 : access XEvent) return int -- /usr/include/X11/Xlib.h:2908
with Import => True,
Convention => C,
External_Name => "XPutBackEvent";
-- display
-- event
function XPutImage
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : access XImage;
arg5 : int;
arg6 : int;
arg7 : int;
arg8 : int;
arg9 : unsigned;
arg10 : unsigned) return int -- /usr/include/X11/Xlib.h:2913
with Import => True,
Convention => C,
External_Name => "XPutImage";
-- display
-- d
-- gc
-- image
-- src_x
-- src_y
-- dest_x
-- dest_y
-- width
-- height
function XQLength (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:2926
with Import => True,
Convention => C,
External_Name => "XQLength";
-- display
function XQueryBestCursor
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : unsigned;
arg4 : unsigned;
arg5 : access unsigned;
arg6 : access unsigned) return int -- /usr/include/X11/Xlib.h:2930
with Import => True,
Convention => C,
External_Name => "XQueryBestCursor";
-- display
-- d
-- width
-- height
-- width_return
-- height_return
function XQueryBestSize
(arg1 : access Display;
arg2 : int;
arg3 : X11.Drawable;
arg4 : unsigned;
arg5 : unsigned;
arg6 : access unsigned;
arg7 : access unsigned) return int -- /usr/include/X11/Xlib.h:2939
with Import => True,
Convention => C,
External_Name => "XQueryBestSize";
-- display
-- class
-- which_screen
-- width
-- height
-- width_return
-- height_return
function XQueryBestStipple
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : unsigned;
arg4 : unsigned;
arg5 : access unsigned;
arg6 : access unsigned) return int -- /usr/include/X11/Xlib.h:2949
with Import => True,
Convention => C,
External_Name => "XQueryBestStipple";
-- display
-- which_screen
-- width
-- height
-- width_return
-- height_return
function XQueryBestTile
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : unsigned;
arg4 : unsigned;
arg5 : access unsigned;
arg6 : access unsigned) return int -- /usr/include/X11/Xlib.h:2958
with Import => True,
Convention => C,
External_Name => "XQueryBestTile";
-- display
-- which_screen
-- width
-- height
-- width_return
-- height_return
function XQueryColor
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : access XColor) return int -- /usr/include/X11/Xlib.h:2967
with Import => True,
Convention => C,
External_Name => "XQueryColor";
-- display
-- colormap
-- def_in_out
function XQueryColors
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : access XColor;
arg4 : int) return int -- /usr/include/X11/Xlib.h:2973
with Import => True,
Convention => C,
External_Name => "XQueryColors";
-- display
-- colormap
-- defs_in_out
-- ncolors
function XQueryExtension
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : access int;
arg4 : access int;
arg5 : access int) return int -- /usr/include/X11/Xlib.h:2980
with Import => True,
Convention => C,
External_Name => "XQueryExtension";
-- display
-- name
-- major_opcode_return
-- first_event_return
-- first_error_return
function XQueryKeymap (arg1 : access Display; arg2 : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/X11/Xlib.h:2988
with Import => True,
Convention => C,
External_Name => "XQueryKeymap";
-- display
-- keys_return
function XQueryPointer
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access X11.Window;
arg4 : access X11.Window;
arg5 : access int;
arg6 : access int;
arg7 : access int;
arg8 : access int;
arg9 : access unsigned) return int -- /usr/include/X11/Xlib.h:2993
with Import => True,
Convention => C,
External_Name => "XQueryPointer";
-- display
-- w
-- root_return
-- child_return
-- root_x_return
-- root_y_return
-- win_x_return
-- win_y_return
-- mask_return
function XQueryTextExtents
(arg1 : access Display;
arg2 : X11.XID;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : int;
arg5 : access int;
arg6 : access int;
arg7 : access int;
arg8 : access XCharStruct) return int -- /usr/include/X11/Xlib.h:3005
with Import => True,
Convention => C,
External_Name => "XQueryTextExtents";
-- display
-- font_ID
-- string
-- nchars
-- direction_return
-- font_ascent_return
-- font_descent_return
-- overall_return
function XQueryTextExtents16
(arg1 : access Display;
arg2 : X11.XID;
arg3 : access constant XChar2b;
arg4 : int;
arg5 : access int;
arg6 : access int;
arg7 : access int;
arg8 : access XCharStruct) return int -- /usr/include/X11/Xlib.h:3016
with Import => True,
Convention => C,
External_Name => "XQueryTextExtents16";
-- display
-- font_ID
-- string
-- nchars
-- direction_return
-- font_ascent_return
-- font_descent_return
-- overall_return
function XQueryTree
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access X11.Window;
arg4 : access X11.Window;
arg5 : System.Address;
arg6 : access unsigned) return int -- /usr/include/X11/Xlib.h:3027
with Import => True,
Convention => C,
External_Name => "XQueryTree";
-- display
-- w
-- root_return
-- parent_return
-- children_return
-- nchildren_return
function XRaiseWindow (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:3036
with Import => True,
Convention => C,
External_Name => "XRaiseWindow";
-- display
-- w
function XReadBitmapFile
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : access unsigned;
arg5 : access unsigned;
arg6 : access X11.Pixmap;
arg7 : access int;
arg8 : access int) return int -- /usr/include/X11/Xlib.h:3041
with Import => True,
Convention => C,
External_Name => "XReadBitmapFile";
-- display
-- d
-- filename
-- width_return
-- height_return
-- bitmap_return
-- x_hot_return
-- y_hot_return
function XReadBitmapFileData
(arg1 : Interfaces.C.Strings.chars_ptr;
arg2 : access unsigned;
arg3 : access unsigned;
arg4 : System.Address;
arg5 : access int;
arg6 : access int) return int -- /usr/include/X11/Xlib.h:3052
with Import => True,
Convention => C,
External_Name => "XReadBitmapFileData";
-- filename
-- width_return
-- height_return
-- data_return
-- x_hot_return
-- y_hot_return
function XRebindKeysym
(arg1 : access Display;
arg2 : X11.KeySym;
arg3 : access X11.KeySym;
arg4 : int;
arg5 : access unsigned_char;
arg6 : int) return int -- /usr/include/X11/Xlib.h:3061
with Import => True,
Convention => C,
External_Name => "XRebindKeysym";
-- display
-- keysym
-- list
-- mod_count
-- string
-- bytes_string
function XRecolorCursor
(arg1 : access Display;
arg2 : X11.Cursor;
arg3 : access XColor;
arg4 : access XColor) return int -- /usr/include/X11/Xlib.h:3070
with Import => True,
Convention => C,
External_Name => "XRecolorCursor";
-- display
-- cursor
-- foreground_color
-- background_color
function XRefreshKeyboardMapping (arg1 : access XMappingEvent) return int -- /usr/include/X11/Xlib.h:3077
with Import => True,
Convention => C,
External_Name => "XRefreshKeyboardMapping";
-- event_map
function XRemoveFromSaveSet (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:3081
with Import => True,
Convention => C,
External_Name => "XRemoveFromSaveSet";
-- display
-- w
function XRemoveHost (arg1 : access Display; arg2 : access XHostAddress) return int -- /usr/include/X11/Xlib.h:3086
with Import => True,
Convention => C,
External_Name => "XRemoveHost";
-- display
-- host
function XRemoveHosts
(arg1 : access Display;
arg2 : access XHostAddress;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3091
with Import => True,
Convention => C,
External_Name => "XRemoveHosts";
-- display
-- hosts
-- num_hosts
function XReparentWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Window;
arg4 : int;
arg5 : int) return int -- /usr/include/X11/Xlib.h:3097
with Import => True,
Convention => C,
External_Name => "XReparentWindow";
-- display
-- w
-- parent
-- x
-- y
function XResetScreenSaver (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:3105
with Import => True,
Convention => C,
External_Name => "XResetScreenSaver";
-- display
function XResizeWindow
(arg1 : access Display;
arg2 : X11.Window;
arg3 : unsigned;
arg4 : unsigned) return int -- /usr/include/X11/Xlib.h:3109
with Import => True,
Convention => C,
External_Name => "XResizeWindow";
-- display
-- w
-- width
-- height
function XRestackWindows
(arg1 : access Display;
arg2 : access X11.Window;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3116
with Import => True,
Convention => C,
External_Name => "XRestackWindows";
-- display
-- windows
-- nwindows
function XRotateBuffers (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:3122
with Import => True,
Convention => C,
External_Name => "XRotateBuffers";
-- display
-- rotate
function XRotateWindowProperties
(arg1 : access Display;
arg2 : X11.Window;
arg3 : access X11.Atom;
arg4 : int;
arg5 : int) return int -- /usr/include/X11/Xlib.h:3127
with Import => True,
Convention => C,
External_Name => "XRotateWindowProperties";
-- display
-- w
-- properties
-- num_prop
-- npositions
function XScreenCount (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:3135
with Import => True,
Convention => C,
External_Name => "XScreenCount";
-- display
function XSelectInput
(arg1 : access Display;
arg2 : X11.Window;
arg3 : long) return int -- /usr/include/X11/Xlib.h:3139
with Import => True,
Convention => C,
External_Name => "XSelectInput";
-- display
-- w
-- event_mask
function XSendEvent
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : long;
arg5 : access XEvent) return int -- /usr/include/X11/Xlib.h:3145
with Import => True,
Convention => C,
External_Name => "XSendEvent";
-- display
-- w
-- propagate
-- event_mask
-- event_send
function XSetAccessControl (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:3153
with Import => True,
Convention => C,
External_Name => "XSetAccessControl";
-- display
-- mode
function XSetArcMode
(arg1 : access Display;
arg2 : GC;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3158
with Import => True,
Convention => C,
External_Name => "XSetArcMode";
-- display
-- gc
-- arc_mode
function XSetBackground
(arg1 : access Display;
arg2 : GC;
arg3 : unsigned_long) return int -- /usr/include/X11/Xlib.h:3164
with Import => True,
Convention => C,
External_Name => "XSetBackground";
-- display
-- gc
-- background
function XSetClipMask
(arg1 : access Display;
arg2 : GC;
arg3 : X11.Pixmap) return int -- /usr/include/X11/Xlib.h:3170
with Import => True,
Convention => C,
External_Name => "XSetClipMask";
-- display
-- gc
-- pixmap
function XSetClipOrigin
(arg1 : access Display;
arg2 : GC;
arg3 : int;
arg4 : int) return int -- /usr/include/X11/Xlib.h:3176
with Import => True,
Convention => C,
External_Name => "XSetClipOrigin";
-- display
-- gc
-- clip_x_origin
-- clip_y_origin
function XSetClipRectangles
(arg1 : access Display;
arg2 : GC;
arg3 : int;
arg4 : int;
arg5 : access XRectangle;
arg6 : int;
arg7 : int) return int -- /usr/include/X11/Xlib.h:3183
with Import => True,
Convention => C,
External_Name => "XSetClipRectangles";
-- display
-- gc
-- clip_x_origin
-- clip_y_origin
-- rectangles
-- n
-- ordering
function XSetCloseDownMode (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:3193
with Import => True,
Convention => C,
External_Name => "XSetCloseDownMode";
-- display
-- close_mode
function XSetCommand
(arg1 : access Display;
arg2 : X11.Window;
arg3 : System.Address;
arg4 : int) return int -- /usr/include/X11/Xlib.h:3198
with Import => True,
Convention => C,
External_Name => "XSetCommand";
-- display
-- w
-- argv
-- argc
function XSetDashes
(arg1 : access Display;
arg2 : GC;
arg3 : int;
arg4 : Interfaces.C.Strings.chars_ptr;
arg5 : int) return int -- /usr/include/X11/Xlib.h:3205
with Import => True,
Convention => C,
External_Name => "XSetDashes";
-- display
-- gc
-- dash_offset
-- dash_list
-- n
function XSetFillRule
(arg1 : access Display;
arg2 : GC;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3213
with Import => True,
Convention => C,
External_Name => "XSetFillRule";
-- display
-- gc
-- fill_rule
function XSetFillStyle
(arg1 : access Display;
arg2 : GC;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3219
with Import => True,
Convention => C,
External_Name => "XSetFillStyle";
-- display
-- gc
-- fill_style
function XSetFont
(arg1 : access Display;
arg2 : GC;
arg3 : X11.Font) return int -- /usr/include/X11/Xlib.h:3225
with Import => True,
Convention => C,
External_Name => "XSetFont";
-- display
-- gc
-- font
function XSetFontPath
(arg1 : access Display;
arg2 : System.Address;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3231
with Import => True,
Convention => C,
External_Name => "XSetFontPath";
-- display
-- directories
-- ndirs
function XSetForeground
(arg1 : access Display;
arg2 : GC;
arg3 : unsigned_long) return int -- /usr/include/X11/Xlib.h:3237
with Import => True,
Convention => C,
External_Name => "XSetForeground";
-- display
-- gc
-- foreground
function XSetFunction
(arg1 : access Display;
arg2 : GC;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3243
with Import => True,
Convention => C,
External_Name => "XSetFunction";
-- display
-- gc
-- function
function XSetGraphicsExposures
(arg1 : access Display;
arg2 : GC;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3249
with Import => True,
Convention => C,
External_Name => "XSetGraphicsExposures";
-- display
-- gc
-- graphics_exposures
function XSetIconName
(arg1 : access Display;
arg2 : X11.Window;
arg3 : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/X11/Xlib.h:3255
with Import => True,
Convention => C,
External_Name => "XSetIconName";
-- display
-- w
-- icon_name
function XSetInputFocus
(arg1 : access Display;
arg2 : X11.Window;
arg3 : int;
arg4 : X11.Time) return int -- /usr/include/X11/Xlib.h:3261
with Import => True,
Convention => C,
External_Name => "XSetInputFocus";
-- display
-- focus
-- revert_to
-- time
function XSetLineAttributes
(arg1 : access Display;
arg2 : GC;
arg3 : unsigned;
arg4 : int;
arg5 : int;
arg6 : int) return int -- /usr/include/X11/Xlib.h:3268
with Import => True,
Convention => C,
External_Name => "XSetLineAttributes";
-- display
-- gc
-- line_width
-- line_style
-- cap_style
-- join_style
function XSetModifierMapping (arg1 : access Display; arg2 : access XModifierKeymap) return int -- /usr/include/X11/Xlib.h:3277
with Import => True,
Convention => C,
External_Name => "XSetModifierMapping";
-- display
-- modmap
function XSetPlaneMask
(arg1 : access Display;
arg2 : GC;
arg3 : unsigned_long) return int -- /usr/include/X11/Xlib.h:3282
with Import => True,
Convention => C,
External_Name => "XSetPlaneMask";
-- display
-- gc
-- plane_mask
function XSetPointerMapping
(arg1 : access Display;
arg2 : access unsigned_char;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3288
with Import => True,
Convention => C,
External_Name => "XSetPointerMapping";
-- display
-- map
-- nmap
function XSetScreenSaver
(arg1 : access Display;
arg2 : int;
arg3 : int;
arg4 : int;
arg5 : int) return int -- /usr/include/X11/Xlib.h:3294
with Import => True,
Convention => C,
External_Name => "XSetScreenSaver";
-- display
-- timeout
-- interval
-- prefer_blanking
-- allow_exposures
function XSetSelectionOwner
(arg1 : access Display;
arg2 : X11.Atom;
arg3 : X11.Window;
arg4 : X11.Time) return int -- /usr/include/X11/Xlib.h:3302
with Import => True,
Convention => C,
External_Name => "XSetSelectionOwner";
-- display
-- selection
-- owner
-- time
function XSetState
(arg1 : access Display;
arg2 : GC;
arg3 : unsigned_long;
arg4 : unsigned_long;
arg5 : int;
arg6 : unsigned_long) return int -- /usr/include/X11/Xlib.h:3309
with Import => True,
Convention => C,
External_Name => "XSetState";
-- display
-- gc
-- foreground
-- background
-- function
-- plane_mask
function XSetStipple
(arg1 : access Display;
arg2 : GC;
arg3 : X11.Pixmap) return int -- /usr/include/X11/Xlib.h:3318
with Import => True,
Convention => C,
External_Name => "XSetStipple";
-- display
-- gc
-- stipple
function XSetSubwindowMode
(arg1 : access Display;
arg2 : GC;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3324
with Import => True,
Convention => C,
External_Name => "XSetSubwindowMode";
-- display
-- gc
-- subwindow_mode
function XSetTSOrigin
(arg1 : access Display;
arg2 : GC;
arg3 : int;
arg4 : int) return int -- /usr/include/X11/Xlib.h:3330
with Import => True,
Convention => C,
External_Name => "XSetTSOrigin";
-- display
-- gc
-- ts_x_origin
-- ts_y_origin
function XSetTile
(arg1 : access Display;
arg2 : GC;
arg3 : X11.Pixmap) return int -- /usr/include/X11/Xlib.h:3337
with Import => True,
Convention => C,
External_Name => "XSetTile";
-- display
-- gc
-- tile
function XSetWindowBackground
(arg1 : access Display;
arg2 : X11.Window;
arg3 : unsigned_long) return int -- /usr/include/X11/Xlib.h:3343
with Import => True,
Convention => C,
External_Name => "XSetWindowBackground";
-- display
-- w
-- background_pixel
function XSetWindowBackgroundPixmap
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Pixmap) return int -- /usr/include/X11/Xlib.h:3349
with Import => True,
Convention => C,
External_Name => "XSetWindowBackgroundPixmap";
-- display
-- w
-- background_pixmap
function XSetWindowBorder
(arg1 : access Display;
arg2 : X11.Window;
arg3 : unsigned_long) return int -- /usr/include/X11/Xlib.h:3355
with Import => True,
Convention => C,
External_Name => "XSetWindowBorder";
-- display
-- w
-- border_pixel
function XSetWindowBorderPixmap
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Pixmap) return int -- /usr/include/X11/Xlib.h:3361
with Import => True,
Convention => C,
External_Name => "XSetWindowBorderPixmap";
-- display
-- w
-- border_pixmap
function XSetWindowBorderWidth
(arg1 : access Display;
arg2 : X11.Window;
arg3 : unsigned) return int -- /usr/include/X11/Xlib.h:3367
with Import => True,
Convention => C,
External_Name => "XSetWindowBorderWidth";
-- display
-- w
-- width
function XSetWindowColormap
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Colormap) return int -- /usr/include/X11/Xlib.h:3373
with Import => True,
Convention => C,
External_Name => "XSetWindowColormap";
-- display
-- w
-- colormap
function XStoreBuffer
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int;
arg4 : int) return int -- /usr/include/X11/Xlib.h:3379
with Import => True,
Convention => C,
External_Name => "XStoreBuffer";
-- display
-- bytes
-- nbytes
-- buffer
function XStoreBytes
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3386
with Import => True,
Convention => C,
External_Name => "XStoreBytes";
-- display
-- bytes
-- nbytes
function XStoreColor
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : access XColor) return int -- /usr/include/X11/Xlib.h:3392
with Import => True,
Convention => C,
External_Name => "XStoreColor";
-- display
-- colormap
-- color
function XStoreColors
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : access XColor;
arg4 : int) return int -- /usr/include/X11/Xlib.h:3398
with Import => True,
Convention => C,
External_Name => "XStoreColors";
-- display
-- colormap
-- color
-- ncolors
function XStoreName
(arg1 : access Display;
arg2 : X11.Window;
arg3 : Interfaces.C.Strings.chars_ptr) return int -- /usr/include/X11/Xlib.h:3405
with Import => True,
Convention => C,
External_Name => "XStoreName";
-- display
-- w
-- window_name
function XStoreNamedColor
(arg1 : access Display;
arg2 : X11.Colormap;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : unsigned_long;
arg5 : int) return int -- /usr/include/X11/Xlib.h:3411
with Import => True,
Convention => C,
External_Name => "XStoreNamedColor";
-- display
-- colormap
-- color
-- pixel
-- flags
function XSync (arg1 : access Display; arg2 : int) return int -- /usr/include/X11/Xlib.h:3419
with Import => True,
Convention => C,
External_Name => "XSync";
-- display
-- discard
function XTextExtents
(arg1 : access XFontStruct;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int;
arg4 : access int;
arg5 : access int;
arg6 : access int;
arg7 : access XCharStruct) return int -- /usr/include/X11/Xlib.h:3424
with Import => True,
Convention => C,
External_Name => "XTextExtents";
-- font_struct
-- string
-- nchars
-- direction_return
-- font_ascent_return
-- font_descent_return
-- overall_return
function XTextExtents16
(arg1 : access XFontStruct;
arg2 : access constant XChar2b;
arg3 : int;
arg4 : access int;
arg5 : access int;
arg6 : access int;
arg7 : access XCharStruct) return int -- /usr/include/X11/Xlib.h:3434
with Import => True,
Convention => C,
External_Name => "XTextExtents16";
-- font_struct
-- string
-- nchars
-- direction_return
-- font_ascent_return
-- font_descent_return
-- overall_return
function XTextWidth
(arg1 : access XFontStruct;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3444
with Import => True,
Convention => C,
External_Name => "XTextWidth";
-- font_struct
-- string
-- count
function XTextWidth16
(arg1 : access XFontStruct;
arg2 : access constant XChar2b;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3450
with Import => True,
Convention => C,
External_Name => "XTextWidth16";
-- font_struct
-- string
-- count
function XTranslateCoordinates
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Window;
arg4 : int;
arg5 : int;
arg6 : access int;
arg7 : access int;
arg8 : access X11.Window) return int -- /usr/include/X11/Xlib.h:3456
with Import => True,
Convention => C,
External_Name => "XTranslateCoordinates";
-- display
-- src_w
-- dest_w
-- src_x
-- src_y
-- dest_x_return
-- dest_y_return
-- child_return
function XUndefineCursor (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:3467
with Import => True,
Convention => C,
External_Name => "XUndefineCursor";
-- display
-- w
function XUngrabButton
(arg1 : access Display;
arg2 : unsigned;
arg3 : unsigned;
arg4 : X11.Window) return int -- /usr/include/X11/Xlib.h:3472
with Import => True,
Convention => C,
External_Name => "XUngrabButton";
-- display
-- button
-- modifiers
-- grab_window
function XUngrabKey
(arg1 : access Display;
arg2 : int;
arg3 : unsigned;
arg4 : X11.Window) return int -- /usr/include/X11/Xlib.h:3479
with Import => True,
Convention => C,
External_Name => "XUngrabKey";
-- display
-- keycode
-- modifiers
-- grab_window
function XUngrabKeyboard (arg1 : access Display; arg2 : X11.Time) return int -- /usr/include/X11/Xlib.h:3486
with Import => True,
Convention => C,
External_Name => "XUngrabKeyboard";
-- display
-- time
function XUngrabPointer (arg1 : access Display; arg2 : X11.Time) return int -- /usr/include/X11/Xlib.h:3491
with Import => True,
Convention => C,
External_Name => "XUngrabPointer";
-- display
-- time
function XUngrabServer (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:3496
with Import => True,
Convention => C,
External_Name => "XUngrabServer";
-- display
function XUninstallColormap (arg1 : access Display; arg2 : X11.Colormap) return int -- /usr/include/X11/Xlib.h:3500
with Import => True,
Convention => C,
External_Name => "XUninstallColormap";
-- display
-- colormap
function XUnloadFont (arg1 : access Display; arg2 : X11.Font) return int -- /usr/include/X11/Xlib.h:3505
with Import => True,
Convention => C,
External_Name => "XUnloadFont";
-- display
-- font
function XUnmapSubwindows (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:3510
with Import => True,
Convention => C,
External_Name => "XUnmapSubwindows";
-- display
-- w
function XUnmapWindow (arg1 : access Display; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:3515
with Import => True,
Convention => C,
External_Name => "XUnmapWindow";
-- display
-- w
function XVendorRelease (arg1 : access Display) return int -- /usr/include/X11/Xlib.h:3520
with Import => True,
Convention => C,
External_Name => "XVendorRelease";
-- display
function XWarpPointer
(arg1 : access Display;
arg2 : X11.Window;
arg3 : X11.Window;
arg4 : int;
arg5 : int;
arg6 : unsigned;
arg7 : unsigned;
arg8 : int;
arg9 : int) return int -- /usr/include/X11/Xlib.h:3524
with Import => True,
Convention => C,
External_Name => "XWarpPointer";
-- display
-- src_w
-- dest_w
-- src_x
-- src_y
-- src_width
-- src_height
-- dest_x
-- dest_y
function XWidthMMOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:3536
with Import => True,
Convention => C,
External_Name => "XWidthMMOfScreen";
-- screen
function XWidthOfScreen (arg1 : access Screen) return int -- /usr/include/X11/Xlib.h:3540
with Import => True,
Convention => C,
External_Name => "XWidthOfScreen";
-- screen
function XWindowEvent
(arg1 : access Display;
arg2 : X11.Window;
arg3 : long;
arg4 : access XEvent) return int -- /usr/include/X11/Xlib.h:3544
with Import => True,
Convention => C,
External_Name => "XWindowEvent";
-- display
-- w
-- event_mask
-- event_return
function XWriteBitmapFile
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : X11.Pixmap;
arg4 : unsigned;
arg5 : unsigned;
arg6 : int;
arg7 : int) return int -- /usr/include/X11/Xlib.h:3551
with Import => True,
Convention => C,
External_Name => "XWriteBitmapFile";
-- display
-- filename
-- bitmap
-- width
-- height
-- x_hot
-- y_hot
function XSupportsLocale return int -- /usr/include/X11/Xlib.h:3561
with Import => True,
Convention => C,
External_Name => "XSupportsLocale";
function XSetLocaleModifiers (arg1 : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3563
with Import => True,
Convention => C,
External_Name => "XSetLocaleModifiers";
-- modifier_list
function XOpenOM
(arg1 : access Display;
arg2 : access u_XrmHashBucketRec;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : Interfaces.C.Strings.chars_ptr) return XOM -- /usr/include/X11/Xlib.h:3567
with Import => True,
Convention => C,
External_Name => "XOpenOM";
-- display
-- rdb
-- res_name
-- res_class
function XCloseOM (arg1 : XOM) return int -- /usr/include/X11/Xlib.h:3574
with Import => True,
Convention => C,
External_Name => "XCloseOM";
-- om
function XSetOMValues (arg1 : XOM -- , ...
) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3578
with Import => True,
Convention => C,
External_Name => "XSetOMValues";
-- om
function XGetOMValues (arg1 : XOM -- , ...
) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3583
with Import => True,
Convention => C,
External_Name => "XGetOMValues";
-- om
function XDisplayOfOM (arg1 : XOM) return access Display -- /usr/include/X11/Xlib.h:3588
with Import => True,
Convention => C,
External_Name => "XDisplayOfOM";
-- om
function XLocaleOfOM (arg1 : XOM) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3592
with Import => True,
Convention => C,
External_Name => "XLocaleOfOM";
-- om
function XCreateOC (arg1 : XOM -- , ...
) return XOC -- /usr/include/X11/Xlib.h:3596
with Import => True,
Convention => C,
External_Name => "XCreateOC";
-- om
procedure XDestroyOC (arg1 : XOC) -- /usr/include/X11/Xlib.h:3601
with Import => True,
Convention => C,
External_Name => "XDestroyOC";
-- oc
function XOMOfOC (arg1 : XOC) return XOM -- /usr/include/X11/Xlib.h:3605
with Import => True,
Convention => C,
External_Name => "XOMOfOC";
-- oc
function XSetOCValues (arg1 : XOC -- , ...
) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3609
with Import => True,
Convention => C,
External_Name => "XSetOCValues";
-- oc
function XGetOCValues (arg1 : XOC -- , ...
) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3614
with Import => True,
Convention => C,
External_Name => "XGetOCValues";
-- oc
function XCreateFontSet
(arg1 : access Display;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : System.Address;
arg4 : access int;
arg5 : System.Address) return XFontSet -- /usr/include/X11/Xlib.h:3619
with Import => True,
Convention => C,
External_Name => "XCreateFontSet";
-- display
-- base_font_name_list
-- missing_charset_list
-- missing_charset_count
-- def_string
procedure XFreeFontSet (arg1 : access Display; arg2 : XFontSet) -- /usr/include/X11/Xlib.h:3627
with Import => True,
Convention => C,
External_Name => "XFreeFontSet";
-- display
-- font_set
function XFontsOfFontSet
(arg1 : XFontSet;
arg2 : System.Address;
arg3 : System.Address) return int -- /usr/include/X11/Xlib.h:3632
with Import => True,
Convention => C,
External_Name => "XFontsOfFontSet";
-- font_set
-- font_struct_list
-- font_name_list
function XBaseFontNameListOfFontSet (arg1 : XFontSet) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3638
with Import => True,
Convention => C,
External_Name => "XBaseFontNameListOfFontSet";
-- font_set
function XLocaleOfFontSet (arg1 : XFontSet) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3642
with Import => True,
Convention => C,
External_Name => "XLocaleOfFontSet";
-- font_set
function XContextDependentDrawing (arg1 : XFontSet) return int -- /usr/include/X11/Xlib.h:3646
with Import => True,
Convention => C,
External_Name => "XContextDependentDrawing";
-- font_set
function XDirectionalDependentDrawing (arg1 : XFontSet) return int -- /usr/include/X11/Xlib.h:3650
with Import => True,
Convention => C,
External_Name => "XDirectionalDependentDrawing";
-- font_set
function XContextualDrawing (arg1 : XFontSet) return int -- /usr/include/X11/Xlib.h:3654
with Import => True,
Convention => C,
External_Name => "XContextualDrawing";
-- font_set
function XExtentsOfFontSet (arg1 : XFontSet) return access XFontSetExtents -- /usr/include/X11/Xlib.h:3658
with Import => True,
Convention => C,
External_Name => "XExtentsOfFontSet";
-- font_set
function XmbTextEscapement
(arg1 : XFontSet;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3662
with Import => True,
Convention => C,
External_Name => "XmbTextEscapement";
-- font_set
-- text
-- bytes_text
function XwcTextEscapement
(arg1 : XFontSet;
arg2 : access wchar_t;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3668
with Import => True,
Convention => C,
External_Name => "XwcTextEscapement";
-- font_set
-- text
-- num_wchars
function Xutf8TextEscapement
(arg1 : XFontSet;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int) return int -- /usr/include/X11/Xlib.h:3674
with Import => True,
Convention => C,
External_Name => "Xutf8TextEscapement";
-- font_set
-- text
-- bytes_text
function XmbTextExtents
(arg1 : XFontSet;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int;
arg4 : access XRectangle;
arg5 : access XRectangle) return int -- /usr/include/X11/Xlib.h:3680
with Import => True,
Convention => C,
External_Name => "XmbTextExtents";
-- font_set
-- text
-- bytes_text
-- overall_ink_return
-- overall_logical_return
function XwcTextExtents
(arg1 : XFontSet;
arg2 : access wchar_t;
arg3 : int;
arg4 : access XRectangle;
arg5 : access XRectangle) return int -- /usr/include/X11/Xlib.h:3688
with Import => True,
Convention => C,
External_Name => "XwcTextExtents";
-- font_set
-- text
-- num_wchars
-- overall_ink_return
-- overall_logical_return
function Xutf8TextExtents
(arg1 : XFontSet;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int;
arg4 : access XRectangle;
arg5 : access XRectangle) return int -- /usr/include/X11/Xlib.h:3696
with Import => True,
Convention => C,
External_Name => "Xutf8TextExtents";
-- font_set
-- text
-- bytes_text
-- overall_ink_return
-- overall_logical_return
function XmbTextPerCharExtents
(arg1 : XFontSet;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int;
arg4 : access XRectangle;
arg5 : access XRectangle;
arg6 : int;
arg7 : access int;
arg8 : access XRectangle;
arg9 : access XRectangle) return int -- /usr/include/X11/Xlib.h:3704
with Import => True,
Convention => C,
External_Name => "XmbTextPerCharExtents";
-- font_set
-- text
-- bytes_text
-- ink_extents_buffer
-- logical_extents_buffer
-- buffer_size
-- num_chars
-- overall_ink_return
-- overall_logical_return
function XwcTextPerCharExtents
(arg1 : XFontSet;
arg2 : access wchar_t;
arg3 : int;
arg4 : access XRectangle;
arg5 : access XRectangle;
arg6 : int;
arg7 : access int;
arg8 : access XRectangle;
arg9 : access XRectangle) return int -- /usr/include/X11/Xlib.h:3716
with Import => True,
Convention => C,
External_Name => "XwcTextPerCharExtents";
-- font_set
-- text
-- num_wchars
-- ink_extents_buffer
-- logical_extents_buffer
-- buffer_size
-- num_chars
-- overall_ink_return
-- overall_logical_return
function Xutf8TextPerCharExtents
(arg1 : XFontSet;
arg2 : Interfaces.C.Strings.chars_ptr;
arg3 : int;
arg4 : access XRectangle;
arg5 : access XRectangle;
arg6 : int;
arg7 : access int;
arg8 : access XRectangle;
arg9 : access XRectangle) return int -- /usr/include/X11/Xlib.h:3728
with Import => True,
Convention => C,
External_Name => "Xutf8TextPerCharExtents";
-- font_set
-- text
-- bytes_text
-- ink_extents_buffer
-- logical_extents_buffer
-- buffer_size
-- num_chars
-- overall_ink_return
-- overall_logical_return
procedure XmbDrawText
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : access XmbTextItem;
arg7 : int) -- /usr/include/X11/Xlib.h:3740
with Import => True,
Convention => C,
External_Name => "XmbDrawText";
-- display
-- d
-- gc
-- x
-- y
-- text_items
-- nitems
procedure XwcDrawText
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : access XwcTextItem;
arg7 : int) -- /usr/include/X11/Xlib.h:3750
with Import => True,
Convention => C,
External_Name => "XwcDrawText";
-- display
-- d
-- gc
-- x
-- y
-- text_items
-- nitems
procedure Xutf8DrawText
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : GC;
arg4 : int;
arg5 : int;
arg6 : access XmbTextItem;
arg7 : int) -- /usr/include/X11/Xlib.h:3760
with Import => True,
Convention => C,
External_Name => "Xutf8DrawText";
-- display
-- d
-- gc
-- x
-- y
-- text_items
-- nitems
procedure XmbDrawString
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : XFontSet;
arg4 : GC;
arg5 : int;
arg6 : int;
arg7 : Interfaces.C.Strings.chars_ptr;
arg8 : int) -- /usr/include/X11/Xlib.h:3770
with Import => True,
Convention => C,
External_Name => "XmbDrawString";
-- display
-- d
-- font_set
-- gc
-- x
-- y
-- text
-- bytes_text
procedure XwcDrawString
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : XFontSet;
arg4 : GC;
arg5 : int;
arg6 : int;
arg7 : access wchar_t;
arg8 : int) -- /usr/include/X11/Xlib.h:3781
with Import => True,
Convention => C,
External_Name => "XwcDrawString";
-- display
-- d
-- font_set
-- gc
-- x
-- y
-- text
-- num_wchars
procedure Xutf8DrawString
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : XFontSet;
arg4 : GC;
arg5 : int;
arg6 : int;
arg7 : Interfaces.C.Strings.chars_ptr;
arg8 : int) -- /usr/include/X11/Xlib.h:3792
with Import => True,
Convention => C,
External_Name => "Xutf8DrawString";
-- display
-- d
-- font_set
-- gc
-- x
-- y
-- text
-- bytes_text
procedure XmbDrawImageString
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : XFontSet;
arg4 : GC;
arg5 : int;
arg6 : int;
arg7 : Interfaces.C.Strings.chars_ptr;
arg8 : int) -- /usr/include/X11/Xlib.h:3803
with Import => True,
Convention => C,
External_Name => "XmbDrawImageString";
-- display
-- d
-- font_set
-- gc
-- x
-- y
-- text
-- bytes_text
procedure XwcDrawImageString
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : XFontSet;
arg4 : GC;
arg5 : int;
arg6 : int;
arg7 : access wchar_t;
arg8 : int) -- /usr/include/X11/Xlib.h:3814
with Import => True,
Convention => C,
External_Name => "XwcDrawImageString";
-- display
-- d
-- font_set
-- gc
-- x
-- y
-- text
-- num_wchars
procedure Xutf8DrawImageString
(arg1 : access Display;
arg2 : X11.Drawable;
arg3 : XFontSet;
arg4 : GC;
arg5 : int;
arg6 : int;
arg7 : Interfaces.C.Strings.chars_ptr;
arg8 : int) -- /usr/include/X11/Xlib.h:3825
with Import => True,
Convention => C,
External_Name => "Xutf8DrawImageString";
-- display
-- d
-- font_set
-- gc
-- x
-- y
-- text
-- bytes_text
function XOpenIM
(arg1 : access Display;
arg2 : access u_XrmHashBucketRec;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : Interfaces.C.Strings.chars_ptr) return XIM -- /usr/include/X11/Xlib.h:3836
with Import => True,
Convention => C,
External_Name => "XOpenIM";
-- dpy
-- rdb
-- res_name
-- res_class
function XCloseIM (arg1 : XIM) return int -- /usr/include/X11/Xlib.h:3843
with Import => True,
Convention => C,
External_Name => "XCloseIM";
-- im
function XGetIMValues (arg1 : XIM -- , ...
) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3847
with Import => True,
Convention => C,
External_Name => "XGetIMValues";
-- im
function XSetIMValues (arg1 : XIM -- , ...
) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3851
with Import => True,
Convention => C,
External_Name => "XSetIMValues";
-- im
function XDisplayOfIM (arg1 : XIM) return access Display -- /usr/include/X11/Xlib.h:3855
with Import => True,
Convention => C,
External_Name => "XDisplayOfIM";
-- im
function XLocaleOfIM (arg1 : XIM) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3859
with Import => True,
Convention => C,
External_Name => "XLocaleOfIM";
-- im
function XCreateIC (arg1 : XIM -- , ...
) return XIC -- /usr/include/X11/Xlib.h:3863
with Import => True,
Convention => C,
External_Name => "XCreateIC";
-- im
procedure XDestroyIC (arg1 : XIC) -- /usr/include/X11/Xlib.h:3867
with Import => True,
Convention => C,
External_Name => "XDestroyIC";
-- ic
procedure XSetICFocus (arg1 : XIC) -- /usr/include/X11/Xlib.h:3871
with Import => True,
Convention => C,
External_Name => "XSetICFocus";
-- ic
procedure XUnsetICFocus (arg1 : XIC) -- /usr/include/X11/Xlib.h:3875
with Import => True,
Convention => C,
External_Name => "XUnsetICFocus";
-- ic
function XwcResetIC (arg1 : XIC) return access wchar_t -- /usr/include/X11/Xlib.h:3879
with Import => True,
Convention => C,
External_Name => "XwcResetIC";
-- ic
function XmbResetIC (arg1 : XIC) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3883
with Import => True,
Convention => C,
External_Name => "XmbResetIC";
-- ic
function Xutf8ResetIC (arg1 : XIC) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3887
with Import => True,
Convention => C,
External_Name => "Xutf8ResetIC";
-- ic
function XSetICValues (arg1 : XIC -- , ...
) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3891
with Import => True,
Convention => C,
External_Name => "XSetICValues";
-- ic
function XGetICValues (arg1 : XIC -- , ...
) return Interfaces.C.Strings.chars_ptr -- /usr/include/X11/Xlib.h:3895
with Import => True,
Convention => C,
External_Name => "XGetICValues";
-- ic
function XIMOfIC (arg1 : XIC) return XIM -- /usr/include/X11/Xlib.h:3899
with Import => True,
Convention => C,
External_Name => "XIMOfIC";
-- ic
function XFilterEvent (arg1 : access XEvent; arg2 : X11.Window) return int -- /usr/include/X11/Xlib.h:3903
with Import => True,
Convention => C,
External_Name => "XFilterEvent";
-- event
-- window
function XmbLookupString
(arg1 : XIC;
arg2 : access XKeyPressedEvent;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : int;
arg5 : access X11.KeySym;
arg6 : access int) return int -- /usr/include/X11/Xlib.h:3908
with Import => True,
Convention => C,
External_Name => "XmbLookupString";
-- ic
-- event
-- buffer_return
-- bytes_buffer
-- keysym_return
-- status_return
function XwcLookupString
(arg1 : XIC;
arg2 : access XKeyPressedEvent;
arg3 : access wchar_t;
arg4 : int;
arg5 : access X11.KeySym;
arg6 : access int) return int -- /usr/include/X11/Xlib.h:3917
with Import => True,
Convention => C,
External_Name => "XwcLookupString";
-- ic
-- event
-- buffer_return
-- wchars_buffer
-- keysym_return
-- status_return
function Xutf8LookupString
(arg1 : XIC;
arg2 : access XKeyPressedEvent;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : int;
arg5 : access X11.KeySym;
arg6 : access int) return int -- /usr/include/X11/Xlib.h:3926
with Import => True,
Convention => C,
External_Name => "Xutf8LookupString";
-- ic
-- event
-- buffer_return
-- bytes_buffer
-- keysym_return
-- status_return
function XVaCreateNestedList (arg1 : int -- , ...
) return XVaNestedList -- /usr/include/X11/Xlib.h:3935
with Import => True,
Convention => C,
External_Name => "XVaCreateNestedList";
--unused
-- internal connections for IMs
function XRegisterIMInstantiateCallback
(arg1 : access Display;
arg2 : access u_XrmHashBucketRec;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : Interfaces.C.Strings.chars_ptr;
arg5 : XIDProc;
arg6 : XPointer) return int -- /usr/include/X11/Xlib.h:3941
with Import => True,
Convention => C,
External_Name => "XRegisterIMInstantiateCallback";
-- dpy
-- rdb
-- res_name
-- res_class
-- callback
-- client_data
function XUnregisterIMInstantiateCallback
(arg1 : access Display;
arg2 : access u_XrmHashBucketRec;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : Interfaces.C.Strings.chars_ptr;
arg5 : XIDProc;
arg6 : XPointer) return int -- /usr/include/X11/Xlib.h:3950
with Import => True,
Convention => C,
External_Name => "XUnregisterIMInstantiateCallback";
-- dpy
-- rdb
-- res_name
-- res_class
-- callback
-- client_data
type XConnectionWatchProc is access procedure
(arg1 : access Display;
arg2 : XPointer;
arg3 : int;
arg4 : int;
arg5 : System.Address)
with Convention => C; -- /usr/include/X11/Xlib.h:3959
-- dpy
-- client_data
-- fd
-- opening
-- open or close flag
-- watch_data
-- open sets, close uses
function XInternalConnectionNumbers
(arg1 : access Display;
arg2 : System.Address;
arg3 : access int) return int -- /usr/include/X11/Xlib.h:3968
with Import => True,
Convention => C,
External_Name => "XInternalConnectionNumbers";
-- dpy
-- fd_return
-- count_return
procedure XProcessInternalConnection (arg1 : access Display; arg2 : int) -- /usr/include/X11/Xlib.h:3974
with Import => True,
Convention => C,
External_Name => "XProcessInternalConnection";
-- dpy
-- fd
function XAddConnectionWatch
(arg1 : access Display;
arg2 : XConnectionWatchProc;
arg3 : XPointer) return int -- /usr/include/X11/Xlib.h:3979
with Import => True,
Convention => C,
External_Name => "XAddConnectionWatch";
-- dpy
-- callback
-- client_data
procedure XRemoveConnectionWatch
(arg1 : access Display;
arg2 : XConnectionWatchProc;
arg3 : XPointer) -- /usr/include/X11/Xlib.h:3985
with Import => True,
Convention => C,
External_Name => "XRemoveConnectionWatch";
-- dpy
-- callback
-- client_data
procedure XSetAuthorization
(arg1 : Interfaces.C.Strings.chars_ptr;
arg2 : int;
arg3 : Interfaces.C.Strings.chars_ptr;
arg4 : int) -- /usr/include/X11/Xlib.h:3991
with Import => True,
Convention => C,
External_Name => "XSetAuthorization";
-- name
-- namelen
-- data
-- datalen
-- skipped func _Xmbtowc
-- wstr
-- str
-- len
-- skipped func _Xwctomb
-- str
-- wc
function XGetEventData (arg1 : access Display; arg2 : access XGenericEventCookie) return int -- /usr/include/X11/Xlib.h:4009
with Import => True,
Convention => C,
External_Name => "XGetEventData";
-- dpy
-- cookie
procedure XFreeEventData (arg1 : access Display; arg2 : access XGenericEventCookie) -- /usr/include/X11/Xlib.h:4014
with Import => True,
Convention => C,
External_Name => "XFreeEventData";
-- dpy
-- cookie
end Xlib;
|
godunko/adawebpack | Ada | 4,133 | adb | ------------------------------------------------------------------------------
-- --
-- AdaWebPack --
-- --
------------------------------------------------------------------------------
-- Copyright © 2022, Vadim Godunko --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
------------------------------------------------------------------------------
with System;
with Web.Strings.WASM_Helpers;
package body WASM.Objects.Constructors is
----------------
-- New_Object --
----------------
function New_Object
(Class : WASM.Classes.Class_Index)
return WASM.Objects.Object_Identifier
is
function Imported
(Class : WASM.Classes.Class_Index)
return WASM.Objects.Object_Identifier
with Import => True,
Convention => C,
Link_Name => "__adawebpack___new_object";
begin
return Imported (Class);
end New_Object;
-----------------------
-- New_Object_String --
-----------------------
function New_Object_String
(Class : WASM.Classes.Class_Index;
Parameter : Web.Strings.Web_String)
return WASM.Objects.Object_Identifier
is
function Imported
(Class : WASM.Classes.Class_Index;
Address : System.Address;
Size : Interfaces.Unsigned_32)
return WASM.Objects.Object_Identifier
with Import => True,
Convention => C,
Link_Name => "__adawebpack___new_object_string";
A : System.Address;
S : Interfaces.Unsigned_32;
begin
Web.Strings.WASM_Helpers.To_JS (Parameter, A, S);
return Imported (Class, A, S);
end New_Object_String;
end WASM.Objects.Constructors;
|
AdaCore/libadalang | Ada | 280 | ads | package Test_Pre_Class is
type T is abstract tagged;
function Foo
(Self : T) return Boolean is abstract
with Pre => Self.Why;
pragma Test_Block;
type T is abstract tagged null record;
function Why (Self : T) return Boolean is (True);
end Test_Pre_Class;
|
stcarrez/ada-util | Ada | 1,258 | ads | -----------------------------------------------------------------------
-- util-http-cookies-tests - Unit tests for Cookies
-- Copyright (C) 2011 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Tests;
package Util.Http.Cookies.Tests is
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);
type Test is new Util.Tests.Test with null record;
-- Test creation of cookie
procedure Test_Create_Cookie (T : in out Test);
procedure Test_To_Http_Header (T : in out Test);
procedure Test_Parse_Http_Header (T : in out Test);
end Util.Http.Cookies.Tests;
|
sparre/Command-Line-Parser-Generator | Ada | 212 | ads | -- Copyright: JSA Research & Innovation <[email protected]>
-- License: Beer Ware
pragma License (Unrestricted);
with Asis;
procedure Command_Line_Parser_Generator.Setup (Context : out Asis.Context);
|
burratoo/Acton | Ada | 7,278 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . H T A B L E --
-- --
-- B o d y --
-- --
-- Copyright (C) 1995-2012, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit;
with System.String_Hash;
package body System.HTable is
-------------------
-- Static_HTable --
-------------------
package body Static_HTable is
Table : array (Header_Num) of Elmt_Ptr;
Iterator_Index : Header_Num;
Iterator_Ptr : Elmt_Ptr;
Iterator_Started : Boolean := False;
function Get_Non_Null return Elmt_Ptr;
-- Returns Null_Ptr if Iterator_Started is false or the Table is empty.
-- Returns Iterator_Ptr if non null, or the next non null element in
-- table if any.
---------
-- Get --
---------
function Get (K : Key) return Elmt_Ptr is
Elmt : Elmt_Ptr;
begin
Elmt := Table (Hash (K));
loop
if Elmt = Null_Ptr then
return Null_Ptr;
elsif Equal (Get_Key (Elmt), K) then
return Elmt;
else
Elmt := Next (Elmt);
end if;
end loop;
end Get;
---------------
-- Get_First --
---------------
function Get_First return Elmt_Ptr is
begin
Iterator_Started := True;
Iterator_Index := Table'First;
Iterator_Ptr := Table (Iterator_Index);
return Get_Non_Null;
end Get_First;
--------------
-- Get_Next --
--------------
function Get_Next return Elmt_Ptr is
begin
if not Iterator_Started then
return Null_Ptr;
else
Iterator_Ptr := Next (Iterator_Ptr);
return Get_Non_Null;
end if;
end Get_Next;
------------------
-- Get_Non_Null --
------------------
function Get_Non_Null return Elmt_Ptr is
begin
while Iterator_Ptr = Null_Ptr loop
if Iterator_Index = Table'Last then
Iterator_Started := False;
return Null_Ptr;
end if;
Iterator_Index := Iterator_Index + 1;
Iterator_Ptr := Table (Iterator_Index);
end loop;
return Iterator_Ptr;
end Get_Non_Null;
-------------
-- Present --
-------------
function Present (K : Key) return Boolean is
begin
return Get (K) /= Null_Ptr;
end Present;
------------
-- Remove --
------------
procedure Remove (K : Key) is
Index : constant Header_Num := Hash (K);
Elmt : Elmt_Ptr;
Next_Elmt : Elmt_Ptr;
begin
Elmt := Table (Index);
if Elmt = Null_Ptr then
return;
elsif Equal (Get_Key (Elmt), K) then
Table (Index) := Next (Elmt);
else
loop
Next_Elmt := Next (Elmt);
if Next_Elmt = Null_Ptr then
return;
elsif Equal (Get_Key (Next_Elmt), K) then
Set_Next (Elmt, Next (Next_Elmt));
return;
else
Elmt := Next_Elmt;
end if;
end loop;
end if;
end Remove;
-----------
-- Reset --
-----------
procedure Reset is
begin
for J in Table'Range loop
Table (J) := Null_Ptr;
end loop;
end Reset;
---------
-- Set --
---------
procedure Set (E : Elmt_Ptr) is
Index : Header_Num;
begin
Index := Hash (Get_Key (E));
Set_Next (E, Table (Index));
Table (Index) := E;
end Set;
------------------------
-- Set_If_Not_Present --
------------------------
function Set_If_Not_Present (E : Elmt_Ptr) return Boolean is
K : Key renames Get_Key (E);
-- Note that it is important to use a renaming here rather than
-- define a constant initialized by the call, because the latter
-- construct runs into bootstrap problems with earlier versions
-- of the GNAT compiler.
Index : constant Header_Num := Hash (K);
Elmt : Elmt_Ptr;
begin
Elmt := Table (Index);
loop
if Elmt = Null_Ptr then
Set_Next (E, Table (Index));
Table (Index) := E;
return True;
elsif Equal (Get_Key (Elmt), K) then
return False;
else
Elmt := Next (Elmt);
end if;
end loop;
end Set_If_Not_Present;
end Static_HTable;
----------
-- Hash --
----------
function Hash (Key : String) return Header_Num is
type Uns is mod 2 ** 32;
function Hash_Fun is
new System.String_Hash.Hash (Character, String, Uns);
begin
return Header_Num'First +
Header_Num'Base (Hash_Fun (Key) mod Header_Num'Range_Length);
end Hash;
end System.HTable;
|
burratoo/Acton | Ada | 3,784 | adb | ------------------------------------------------------------------------------------------
-- --
-- OAK PROCESSOR SUPPORT PACKAGE --
-- ST STM32F4 --
-- --
-- OAK.PROCESSOR_SUPPORT_PACKAGE.INTERRUPTS --
-- --
-- Copyright (C) 2014-2021, Patrick Bernardi --
-- --
------------------------------------------------------------------------------------------
with Oak.Brokers.Protected_Objects; use Oak.Brokers.Protected_Objects;
with ISA.ARM; use ISA.ARM;
with ISA.ARM.Cortex_M4.NVIC; use ISA.ARM.Cortex_M4.NVIC;
package body Oak.Processor_Support_Package.Interrupts is
procedure External_Interrupt_Handler (Interrupt_Id : External_Interrupt_Id)
is
begin
Interrupt_Vector_Table (Interrupt_Id).all;
-- Need to manually clear the interrupt because although it was
-- cleared once when the system interrupt handler was taken to enter the
-- kernel to dispatch this handler, since the original source was not
-- cleared this causes the interrupt to be pending again.
Interrupt_Clear_Pending_Register (Interrupt_Id) := Clear;
end External_Interrupt_Handler;
function Get_External_Interrupt_Id return External_Interrupt_Id is
begin
return
External_Interrupt_Id
(Oak.Core_Support_Package.Interrupts.Current_IRQ);
end Get_External_Interrupt_Id;
procedure Initialise_Interrupts is null;
procedure Complete_Interrupt_Initialisation is null;
procedure Attach_Handler (Interrupt : External_Interrupt_Id;
Handler : Parameterless_Handler;
Priority : Interrupt_Priority)
is
begin
Interrupt_Priority_Register (Interrupt) := To_Cortex_Priority (Priority);
Interrupt_Vector_Table (Interrupt) := Handler;
Interrupt_Enable_Register (Interrupt) := Enable;
end Attach_Handler;
function Current_Interrupt_Priority return Any_Priority is
begin
-- Figure this out!!!!!!!
return
To_Ada_Priority
(Interrupt_Priority_Register (Get_External_Interrupt_Id));
end Current_Interrupt_Priority;
procedure Set_Hardware_Priority (P : Any_Priority) is null;
procedure Clear_Hardware_Priority is null;
function Handler_Protected_Object
(Interrupt : External_Interrupt_Id) return Protected_Id_With_No is
begin
return Protected_Object_From_Access
(Parameterless_Access (Interrupt_Vector_Table (Interrupt)));
end Handler_Protected_Object;
function Has_Outstanding_Interrupts (Above_Priority : Any_Priority)
return Boolean is
E : constant Exception_Id := Current_Exception;
Interrupt_Priority : Any_Priority;
begin
if E >= IRQ0 then
Interrupt_Priority := To_Ada_Priority
(Interrupt_Priority_Register (To_IRQ (E)));
if Interrupt_Priority > Above_Priority then
Oak.Core_Support_Package.Interrupts.Current_IRQ := To_IRQ (E);
return True;
end if;
end if;
return False;
end Has_Outstanding_Interrupts;
procedure Trap_Handler is
begin
loop
null;
end loop;
end Trap_Handler;
end Oak.Processor_Support_Package.Interrupts;
|
charlie5/cBound | Ada | 1,464 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_free_gc_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
gc : aliased xcb.xcb_gcontext_t;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C.size_t range <>) of aliased xcb.xcb_free_gc_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_free_gc_request_t.Item,
Element_Array => xcb.xcb_free_gc_request_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_free_gc_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_free_gc_request_t.Pointer,
Element_Array => xcb.xcb_free_gc_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_free_gc_request_t;
|
reznikmm/matreshka | Ada | 3,694 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Table_Table_Columns_Elements is
pragma Preelaborate;
type ODF_Table_Table_Columns is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Table_Table_Columns_Access is
access all ODF_Table_Table_Columns'Class
with Storage_Size => 0;
end ODF.DOM.Table_Table_Columns_Elements;
|
tum-ei-rcs/StratoX | Ada | 8,545 | ads | -- This spec has been automatically generated from STM32F429x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
with HAL;
with System;
package STM32_SVD.EXTI is
pragma Preelaborate;
---------------
-- Registers --
---------------
------------------
-- IMR_Register --
------------------
------------
-- IMR.MR --
------------
-- IMR_MR array
type IMR_MR_Field_Array is array (0 .. 22) of Boolean
with Component_Size => 1, Size => 23;
-- Type definition for IMR_MR
type IMR_MR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt23;
when True =>
-- MR as an array
Arr : IMR_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 23;
for IMR_MR_Field use record
Val at 0 range 0 .. 22;
Arr at 0 range 0 .. 22;
end record;
-- Interrupt mask register (EXTI_IMR)
type IMR_Register is record
-- Interrupt Mask on line 0
MR : IMR_MR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IMR_Register use record
MR at 0 range 0 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
------------------
-- EMR_Register --
------------------
------------
-- EMR.MR --
------------
-- EMR_MR array
type EMR_MR_Field_Array is array (0 .. 22) of Boolean
with Component_Size => 1, Size => 23;
-- Type definition for EMR_MR
type EMR_MR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MR as a value
Val : HAL.UInt23;
when True =>
-- MR as an array
Arr : EMR_MR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 23;
for EMR_MR_Field use record
Val at 0 range 0 .. 22;
Arr at 0 range 0 .. 22;
end record;
-- Event mask register (EXTI_EMR)
type EMR_Register is record
-- Event Mask on line 0
MR : EMR_MR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EMR_Register use record
MR at 0 range 0 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-------------------
-- RTSR_Register --
-------------------
-------------
-- RTSR.TR --
-------------
-- RTSR_TR array
type RTSR_TR_Field_Array is array (0 .. 22) of Boolean
with Component_Size => 1, Size => 23;
-- Type definition for RTSR_TR
type RTSR_TR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TR as a value
Val : HAL.UInt23;
when True =>
-- TR as an array
Arr : RTSR_TR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 23;
for RTSR_TR_Field use record
Val at 0 range 0 .. 22;
Arr at 0 range 0 .. 22;
end record;
-- Rising Trigger selection register (EXTI_RTSR)
type RTSR_Register is record
-- Rising trigger event configuration of line 0
TR : RTSR_TR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RTSR_Register use record
TR at 0 range 0 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-------------------
-- FTSR_Register --
-------------------
-------------
-- FTSR.TR --
-------------
-- FTSR_TR array
type FTSR_TR_Field_Array is array (0 .. 22) of Boolean
with Component_Size => 1, Size => 23;
-- Type definition for FTSR_TR
type FTSR_TR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TR as a value
Val : HAL.UInt23;
when True =>
-- TR as an array
Arr : FTSR_TR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 23;
for FTSR_TR_Field use record
Val at 0 range 0 .. 22;
Arr at 0 range 0 .. 22;
end record;
-- Falling Trigger selection register (EXTI_FTSR)
type FTSR_Register is record
-- Falling trigger event configuration of line 0
TR : FTSR_TR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FTSR_Register use record
TR at 0 range 0 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
--------------------
-- SWIER_Register --
--------------------
-----------------
-- SWIER.SWIER --
-----------------
-- SWIER array
type SWIER_Field_Array is array (0 .. 22) of Boolean
with Component_Size => 1, Size => 23;
-- Type definition for SWIER
type SWIER_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SWIER as a value
Val : HAL.UInt23;
when True =>
-- SWIER as an array
Arr : SWIER_Field_Array;
end case;
end record
with Unchecked_Union, Size => 23;
for SWIER_Field use record
Val at 0 range 0 .. 22;
Arr at 0 range 0 .. 22;
end record;
-- Software interrupt event register (EXTI_SWIER)
type SWIER_Register is record
-- Software Interrupt on line 0
SWIER : SWIER_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SWIER_Register use record
SWIER at 0 range 0 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-----------------
-- PR_Register --
-----------------
-----------
-- PR.PR --
-----------
-- PR array
type PR_Field_Array is array (0 .. 22) of Boolean
with Component_Size => 1, Size => 23;
-- Type definition for PR
type PR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PR as a value
Val : HAL.UInt23;
when True =>
-- PR as an array
Arr : PR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 23;
for PR_Field use record
Val at 0 range 0 .. 22;
Arr at 0 range 0 .. 22;
end record;
-- Pending register (EXTI_PR)
type PR_Register is record
-- Pending bit 0
PR : PR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PR_Register use record
PR at 0 range 0 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- External interrupt/event controller
type EXTI_Peripheral is record
-- Interrupt mask register (EXTI_IMR)
IMR : IMR_Register;
-- Event mask register (EXTI_EMR)
EMR : EMR_Register;
-- Rising Trigger selection register (EXTI_RTSR)
RTSR : RTSR_Register;
-- Falling Trigger selection register (EXTI_FTSR)
FTSR : FTSR_Register;
-- Software interrupt event register (EXTI_SWIER)
SWIER : SWIER_Register;
-- Pending register (EXTI_PR)
PR : PR_Register;
end record
with Volatile;
for EXTI_Peripheral use record
IMR at 0 range 0 .. 31;
EMR at 4 range 0 .. 31;
RTSR at 8 range 0 .. 31;
FTSR at 12 range 0 .. 31;
SWIER at 16 range 0 .. 31;
PR at 20 range 0 .. 31;
end record;
-- External interrupt/event controller
EXTI_Periph : aliased EXTI_Peripheral
with Import, Address => EXTI_Base;
end STM32_SVD.EXTI;
|
sf17k/sdlada | Ada | 1,885 | ads | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2014-2015 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.Video.Windows.Makers
--
-- Constructor subprograms which don't dispatch for Window types.
--------------------------------------------------------------------------------------------------------------------
package SDL.Video.Windows.Makers is
procedure Create
(Win : in out Window;
Title : in Ada.Strings.UTF_Encoding.UTF_8_String;
X : in Integer;
Y : in Integer;
Width : in Integer;
Height : in Integer;
Flags : in Window_Flags := OpenGL);
-- Create a window from an existing window created in some other way.
procedure Create (Win : in out Window; Native : in Native_Window) with
Inline => True;
end SDL.Video.Windows.Makers;
|
AdaCore/libadalang | Ada | 175 | adb | function Foo (B : Boolean) return Integer is
R : Integer;
begin
if B then
R := 1;
else
R := 0;
end if;
return R;
pragma Test_Statement;
end Foo;
|
reznikmm/matreshka | Ada | 7,122 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Config.Config_Item_Map_Entry_Elements is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Config_Config_Item_Map_Entry_Element_Node is
begin
return Self : Config_Config_Item_Map_Entry_Element_Node do
Matreshka.ODF_Config.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Config_Prefix);
end return;
end Create;
----------------
-- Enter_Node --
----------------
overriding procedure Enter_Node
(Self : not null access Config_Config_Item_Map_Entry_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then
ODF.DOM.Visitors.Abstract_ODF_Visitor'Class
(Visitor).Enter_Config_Config_Item_Map_Entry
(ODF.DOM.Config_Config_Item_Map_Entry_Elements.ODF_Config_Config_Item_Map_Entry_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Enter_Node (Visitor, Control);
end if;
end Enter_Node;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Config_Config_Item_Map_Entry_Element_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Config_Item_Map_Entry_Element;
end Get_Local_Name;
----------------
-- Leave_Node --
----------------
overriding procedure Leave_Node
(Self : not null access Config_Config_Item_Map_Entry_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then
ODF.DOM.Visitors.Abstract_ODF_Visitor'Class
(Visitor).Leave_Config_Config_Item_Map_Entry
(ODF.DOM.Config_Config_Item_Map_Entry_Elements.ODF_Config_Config_Item_Map_Entry_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Leave_Node (Visitor, Control);
end if;
end Leave_Node;
----------------
-- Visit_Node --
----------------
overriding procedure Visit_Node
(Self : not null access Config_Config_Item_Map_Entry_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then
ODF.DOM.Iterators.Abstract_ODF_Iterator'Class
(Iterator).Visit_Config_Config_Item_Map_Entry
(Visitor,
ODF.DOM.Config_Config_Item_Map_Entry_Elements.ODF_Config_Config_Item_Map_Entry_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Visit_Node (Iterator, Visitor, Control);
end if;
end Visit_Node;
begin
Matreshka.DOM_Documents.Register_Element
(Matreshka.ODF_String_Constants.Config_URI,
Matreshka.ODF_String_Constants.Config_Item_Map_Entry_Element,
Config_Config_Item_Map_Entry_Element_Node'Tag);
end Matreshka.ODF_Config.Config_Item_Map_Entry_Elements;
|
charlie5/cBound | Ada | 1,787 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_glx_get_convolution_parameteriv_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
minor_opcode : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
context_tag : aliased xcb.xcb_glx_context_tag_t;
target : aliased Interfaces.Unsigned_32;
pname : aliased Interfaces.Unsigned_32;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb
.xcb_glx_get_convolution_parameteriv_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_convolution_parameteriv_request_t.Item,
Element_Array =>
xcb.xcb_glx_get_convolution_parameteriv_request_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_get_convolution_parameteriv_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_convolution_parameteriv_request_t.Pointer,
Element_Array =>
xcb.xcb_glx_get_convolution_parameteriv_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_get_convolution_parameteriv_request_t;
|
AdaCore/training_material | Ada | 417 | ads | --Database
with Ada.Strings.Unbounded;
package Database is
type Database_T is private;
function "="
(L, R : Database_T)
return Boolean;
function To_Database
(Value : String)
return Database_T;
function From_Database
(Value : Database_T)
return String;
function "<"
(L, R : Database_T)
return Boolean;
private
type Database_T is null record;
end Database;
|
burratoo/Acton | Ada | 2,024 | ads | ------------------------------------------------------------------------------------------
-- --
-- OAK COMPONENTS --
-- --
-- OAK.MEMORY.CALL_STACK --
-- --
-- Copyright (C) 2010-2021, Patrick Bernardi --
-- --
------------------------------------------------------------------------------------------
-- This package defines the types and platform independent constants
-- associated with Oak's call stacks.
with Oak.Core_Support_Package;
with Oak.Core_Support_Package.Call_Stack;
with Oak.Project_Support_Package;
with System; use System;
with System.Storage_Elements; use System.Storage_Elements;
package Oak.Memory.Call_Stack with Pure is
package CSP_Stack renames Oak.Core_Support_Package.Call_Stack;
-- type Call_Stack is
-- array (Storage_Offset range <>)
-- of aliased Storage_Elements.Storage_Element;
-- for Call_Stack'Component_Size use Storage_Unit;
type Call_Stack_Handler is record
Top, Bottom, Pointer : Address;
Secondary_Stack_Pointer : Address;
Secondary_Stack_Limit : Address;
end record;
Default_Stack_Size : constant :=
Oak.Project_Support_Package.Default_Call_Stack_Size;
-- Value used to indicate tha no size has been set
Unspecified_Call_Stack_Size : constant Storage_Count := Default_Stack_Size;
subtype Call_Stack_Size is Storage_Elements.Storage_Count range
CSP_Stack.Minimum_Call_Stack_Size ..
Storage_Elements.Storage_Count'Last;
end Oak.Memory.Call_Stack;
|
francesco-bongiovanni/ewok-kernel | Ada | 64 | ads | /opt/adacore-arm-eabi/arm-eabi/lib/gnat/zfp-stm32f4/gnat/ada.ads |
charlie5/cBound | Ada | 1,461 | ads | -- 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_fbconfig_iterator_t is
-- Item
--
type Item is record
data : access xcb.xcb_glx_fbconfig_t;
the_rem : aliased Interfaces.C.int;
index : aliased Interfaces.C.int;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_fbconfig_iterator_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_fbconfig_iterator_t.Item,
Element_Array => xcb.xcb_glx_fbconfig_iterator_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_fbconfig_iterator_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_fbconfig_iterator_t.Pointer,
Element_Array => xcb.xcb_glx_fbconfig_iterator_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_fbconfig_iterator_t;
|
riccardo-bernardini/eugen | Ada | 4,392 | ads | with Symbolic_Expressions;
package EU_Projects.Times.Time_Expressions is
type Symbolic_Duration is private;
type Symbolic_Instant is private;
type Symbolic_Instant_Array is array (Positive range <>) of Symbolic_Instant;
function Min (L, R : Symbolic_Instant) return Symbolic_Instant;
function Max (L, R : Symbolic_Instant) return Symbolic_Instant;
function Min (X : Symbolic_Instant_Array) return Symbolic_Instant;
function Max (X : Symbolic_Instant_Array) return Symbolic_Instant;
function Min (L, R : Symbolic_Duration) return Symbolic_Duration;
function Max (L, R : Symbolic_Duration) return Symbolic_Duration;
function "-" (L, R : Symbolic_Instant) return Symbolic_Duration;
function "+" (L : Symbolic_Instant; R : Symbolic_Duration) return Symbolic_Instant;
function "-" (L : Symbolic_Instant; R : Symbolic_Duration) return Symbolic_Instant;
function "+" (L : Symbolic_Duration; R : Symbolic_Instant) return Symbolic_Instant;
function Variable (Name : Dotted_Identifier) return Symbolic_Instant;
function Variable (Name : Dotted_Identifier) return Symbolic_Duration;
function Is_Constant (Item : Symbolic_Instant) return Boolean;
function Is_Constant (Item : Symbolic_Duration) return Boolean;
function To_Scalar (Item : Symbolic_Instant) return Instant;
function To_Scalar (Item : Symbolic_Duration) return Duration;
function Symbolic (Item : Instant) return Symbolic_Instant;
function Symbolic (Item : Duration) return Symbolic_Duration;
function Dump(X : Symbolic_Instant) return String;
private
function Call (Name : Dotted_Identifier; Param : Scalar_Array)
return Scalar_Type;
package Time_Expr is
new Symbolic_Expressions (Scalar_Type => Scalar_Type,
Scalar_Array => Scalar_Array,
Identifier => Dotted_Identifier,
Image => Image,
ID_Image => Image);
use type Time_Expr.Symbolic_Expression;
type Symbolic_Instant is
record
T : Time_Expr.Symbolic_Expression;
end record;
type Symbolic_Duration is
record
D : Time_Expr.Symbolic_Expression;
end record;
function Dump (X : Symbolic_Instant) return String
is (Time_Expr.Dump(X.T));
Min_Function : constant Dotted_Identifier := To_ID ("min");
Max_Function : constant Dotted_Identifier := To_ID ("max");
function Variable (Name : Dotted_Identifier) return Symbolic_Instant
is (Symbolic_Instant'(T => Time_Expr.Variable (Name)));
function Variable (Name : Dotted_Identifier) return Symbolic_Duration
is (Symbolic_Duration'(D => Time_Expr.Variable (Name)));
function Min (L, R : Symbolic_Instant) return Symbolic_Instant
is (T => Time_Expr.Function_Call (Min_Function, (L.T, R.T)));
function Max (L, R : Symbolic_Instant) return Symbolic_Instant
is (T => Time_Expr.Function_Call (Max_Function, (L.T, R.T)));
function Min (L, R : Symbolic_Duration) return Symbolic_Duration
is (D => Time_Expr.Function_Call (Min_Function, (L.D, R.D)));
function Max (L, R : Symbolic_Duration) return Symbolic_Duration
is (D => Time_Expr.Function_Call (Max_Function, (L.D, R.D)));
function "-" (L, R : Symbolic_Instant) return Symbolic_Duration
is (D => L.T - R.T);
function "+" (L : Symbolic_Instant; R : Symbolic_Duration) return Symbolic_Instant
is (T => L.T + R.D);
function "-" (L : Symbolic_Instant; R : Symbolic_Duration) return Symbolic_Instant
is (T => L.T - R.D);
function "+" (L : Symbolic_Duration; R : Symbolic_Instant) return Symbolic_Instant
is (T => L.D + R.T);
function Is_Constant (Item : Symbolic_Instant) return Boolean
is (Item.T.Is_Constant);
function Is_Constant (Item : Symbolic_Duration) return Boolean
is (Item.D.Is_Constant);
function To_Scalar (Item : Symbolic_Instant) return Instant
is (Instant (Time_Expr.Eval(Item.T)));
function To_Scalar (Item : Symbolic_Duration) return Duration
is (Duration (Time_Expr.Eval(Item.D)));
function Symbolic (Item : Instant) return Symbolic_Instant
is (T => Time_Expr.To_Expr (Scalar_Type (Item)));
function Symbolic (Item : Duration) return Symbolic_Duration
is (D => Time_Expr.To_Expr (Scalar_Type (Item)));
end EU_Projects.Times.Time_Expressions;
|
reznikmm/matreshka | Ada | 48,666 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Classifiers;
with AMF.String_Collections;
with AMF.UML.Activities;
with AMF.UML.Activity_Edges.Collections;
with AMF.UML.Activity_Groups.Collections;
with AMF.UML.Activity_Nodes.Collections;
with AMF.UML.Activity_Partitions.Collections;
with AMF.UML.Behavioral_Features;
with AMF.UML.Behaviored_Classifiers;
with AMF.UML.Behaviors.Collections;
with AMF.UML.Classes.Collections;
with AMF.UML.Classifier_Template_Parameters;
with AMF.UML.Classifiers.Collections;
with AMF.UML.Collaboration_Uses.Collections;
with AMF.UML.Connectable_Elements.Collections;
with AMF.UML.Connectors.Collections;
with AMF.UML.Constraints.Collections;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Element_Imports.Collections;
with AMF.UML.Extensions.Collections;
with AMF.UML.Features.Collections;
with AMF.UML.Generalization_Sets.Collections;
with AMF.UML.Generalizations.Collections;
with AMF.UML.Interface_Realizations.Collections;
with AMF.UML.Named_Elements.Collections;
with AMF.UML.Namespaces;
with AMF.UML.Operations.Collections;
with AMF.UML.Package_Imports.Collections;
with AMF.UML.Packageable_Elements.Collections;
with AMF.UML.Packages.Collections;
with AMF.UML.Parameter_Sets.Collections;
with AMF.UML.Parameterable_Elements.Collections;
with AMF.UML.Parameters.Collections;
with AMF.UML.Ports.Collections;
with AMF.UML.Properties.Collections;
with AMF.UML.Receptions.Collections;
with AMF.UML.Redefinable_Elements.Collections;
with AMF.UML.Redefinable_Template_Signatures;
with AMF.UML.String_Expressions;
with AMF.UML.Structured_Activity_Nodes.Collections;
with AMF.UML.Substitutions.Collections;
with AMF.UML.Template_Bindings.Collections;
with AMF.UML.Template_Parameters;
with AMF.UML.Template_Signatures;
with AMF.UML.Types;
with AMF.UML.Use_Cases.Collections;
with AMF.UML.Variables.Collections;
with AMF.Visitors;
package AMF.Internals.UML_Activities is
type UML_Activity_Proxy is
limited new AMF.Internals.UML_Classifiers.UML_Classifier_Proxy
and AMF.UML.Activities.UML_Activity with null record;
overriding function Get_Edge
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of Activity::edge.
--
-- Edges expressing flow between nodes of the activity.
overriding function Get_Group
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group;
-- Getter of Activity::group.
--
-- Top-level groups in the activity.
overriding function Get_Is_Read_Only
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Getter of Activity::isReadOnly.
--
-- If true, this activity must not make any changes to variables outside
-- the activity or to objects. (This is an assertion, not an executable
-- property. It may be used by an execution engine to optimize model
-- execution. If the assertion is violated by the action, then the model
-- is ill-formed.) The default is false (an activity may make nonlocal
-- changes).
overriding procedure Set_Is_Read_Only
(Self : not null access UML_Activity_Proxy;
To : Boolean);
-- Setter of Activity::isReadOnly.
--
-- If true, this activity must not make any changes to variables outside
-- the activity or to objects. (This is an assertion, not an executable
-- property. It may be used by an execution engine to optimize model
-- execution. If the assertion is violated by the action, then the model
-- is ill-formed.) The default is false (an activity may make nonlocal
-- changes).
overriding function Get_Is_Single_Execution
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Getter of Activity::isSingleExecution.
--
-- If true, all invocations of the activity are handled by the same
-- execution.
overriding procedure Set_Is_Single_Execution
(Self : not null access UML_Activity_Proxy;
To : Boolean);
-- Setter of Activity::isSingleExecution.
--
-- If true, all invocations of the activity are handled by the same
-- execution.
overriding function Get_Node
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node;
-- Getter of Activity::node.
--
-- Nodes coordinated by the activity.
overriding function Get_Partition
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition;
-- Getter of Activity::partition.
--
-- Top-level partitions in the activity.
overriding function Get_Structured_Node
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Structured_Activity_Nodes.Collections.Set_Of_UML_Structured_Activity_Node;
-- Getter of Activity::structuredNode.
--
-- Top-level structured nodes in the activity.
overriding function Get_Variable
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Variables.Collections.Set_Of_UML_Variable;
-- Getter of Activity::variable.
--
-- Top-level variables in the activity.
overriding function Get_Context
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access;
-- Getter of Behavior::context.
--
-- The classifier that is the context for the execution of the behavior.
-- If the behavior is owned by a BehavioredClassifier, that classifier is
-- the context. Otherwise, the context is the first BehavioredClassifier
-- reached by following the chain of owner relationships. For example,
-- following this algorithm, the context of an entry action in a state
-- machine is the classifier that owns the state machine. The features of
-- the context classifier as well as the elements visible to the context
-- classifier are visible to the behavior.
overriding function Get_Is_Reentrant
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Getter of Behavior::isReentrant.
--
-- Tells whether the behavior can be invoked while it is still executing
-- from a previous invocation.
overriding procedure Set_Is_Reentrant
(Self : not null access UML_Activity_Proxy;
To : Boolean);
-- Setter of Behavior::isReentrant.
--
-- Tells whether the behavior can be invoked while it is still executing
-- from a previous invocation.
overriding function Get_Owned_Parameter
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Parameters.Collections.Ordered_Set_Of_UML_Parameter;
-- Getter of Behavior::ownedParameter.
--
-- References a list of parameters to the behavior which describes the
-- order and type of arguments that can be given when the behavior is
-- invoked and of the values which will be returned when the behavior
-- completes its execution.
overriding function Get_Owned_Parameter_Set
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Parameter_Sets.Collections.Set_Of_UML_Parameter_Set;
-- Getter of Behavior::ownedParameterSet.
--
-- The ParameterSets owned by this Behavior.
overriding function Get_Postcondition
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
-- Getter of Behavior::postcondition.
--
-- An optional set of Constraints specifying what is fulfilled after the
-- execution of the behavior is completed, if its precondition was
-- fulfilled before its invocation.
overriding function Get_Precondition
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
-- Getter of Behavior::precondition.
--
-- An optional set of Constraints specifying what must be fulfilled when
-- the behavior is invoked.
overriding function Get_Redefined_Behavior
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior;
-- Getter of Behavior::redefinedBehavior.
--
-- References a behavior that this behavior redefines. A subtype of
-- Behavior may redefine any other subtype of Behavior. If the behavior
-- implements a behavioral feature, it replaces the redefined behavior. If
-- the behavior is a classifier behavior, it extends the redefined
-- behavior.
overriding function Get_Specification
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Behavioral_Features.UML_Behavioral_Feature_Access;
-- Getter of Behavior::specification.
--
-- Designates a behavioral feature that the behavior implements. The
-- behavioral feature must be owned by the classifier that owns the
-- behavior or be inherited by it. The parameters of the behavioral
-- feature and the implementing behavior must match. A behavior does not
-- need to have a specification, in which case it either is the classifer
-- behavior of a BehavioredClassifier or it can only be invoked by another
-- behavior of the classifier.
overriding procedure Set_Specification
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Behavioral_Features.UML_Behavioral_Feature_Access);
-- Setter of Behavior::specification.
--
-- Designates a behavioral feature that the behavior implements. The
-- behavioral feature must be owned by the classifier that owns the
-- behavior or be inherited by it. The parameters of the behavioral
-- feature and the implementing behavior must match. A behavior does not
-- need to have a specification, in which case it either is the classifer
-- behavior of a BehavioredClassifier or it can only be invoked by another
-- behavior of the classifier.
overriding function Get_Extension
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Extensions.Collections.Set_Of_UML_Extension;
-- Getter of Class::extension.
--
-- References the Extensions that specify additional properties of the
-- metaclass. The property is derived from the extensions whose memberEnds
-- are typed by the Class.
overriding function Get_Is_Abstract
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Getter of Class::isAbstract.
--
-- True when a class is abstract.
-- If true, the Classifier does not provide a complete declaration and can
-- typically not be instantiated. An abstract classifier is intended to be
-- used by other classifiers e.g. as the target of general
-- metarelationships or generalization relationships.
overriding function Get_Is_Active
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Getter of Class::isActive.
--
-- Determines whether an object specified by this class is active or not.
-- If true, then the owning class is referred to as an active class. If
-- false, then such a class is referred to as a passive class.
overriding procedure Set_Is_Active
(Self : not null access UML_Activity_Proxy;
To : Boolean);
-- Setter of Class::isActive.
--
-- Determines whether an object specified by this class is active or not.
-- If true, then the owning class is referred to as an active class. If
-- false, then such a class is referred to as a passive class.
overriding function Get_Nested_Classifier
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Classifiers.Collections.Ordered_Set_Of_UML_Classifier;
-- Getter of Class::nestedClassifier.
--
-- References all the Classifiers that are defined (nested) within the
-- Class.
overriding function Get_Owned_Attribute
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property;
-- Getter of Class::ownedAttribute.
--
-- The attributes (i.e. the properties) owned by the class.
overriding function Get_Owned_Operation
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Operations.Collections.Ordered_Set_Of_UML_Operation;
-- Getter of Class::ownedOperation.
--
-- The operations owned by the class.
overriding function Get_Owned_Reception
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Receptions.Collections.Set_Of_UML_Reception;
-- Getter of Class::ownedReception.
--
-- Receptions that objects of this class are willing to accept.
overriding function Get_Super_Class
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Classes.Collections.Set_Of_UML_Class;
-- Getter of Class::superClass.
--
-- This gives the superclasses of a class.
overriding function Get_Classifier_Behavior
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Behaviors.UML_Behavior_Access;
-- Getter of BehavioredClassifier::classifierBehavior.
--
-- A behavior specification that specifies the behavior of the classifier
-- itself.
overriding procedure Set_Classifier_Behavior
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Behaviors.UML_Behavior_Access);
-- Setter of BehavioredClassifier::classifierBehavior.
--
-- A behavior specification that specifies the behavior of the classifier
-- itself.
overriding function Get_Interface_Realization
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Interface_Realizations.Collections.Set_Of_UML_Interface_Realization;
-- Getter of BehavioredClassifier::interfaceRealization.
--
-- The set of InterfaceRealizations owned by the BehavioredClassifier.
-- Interface realizations reference the Interfaces of which the
-- BehavioredClassifier is an implementation.
overriding function Get_Owned_Behavior
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior;
-- Getter of BehavioredClassifier::ownedBehavior.
--
-- References behavior specifications owned by a classifier.
overriding function Get_Attribute
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property;
-- Getter of Classifier::attribute.
--
-- Refers to all of the Properties that are direct (i.e. not inherited or
-- imported) attributes of the classifier.
overriding function Get_Collaboration_Use
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Collaboration_Uses.Collections.Set_Of_UML_Collaboration_Use;
-- Getter of Classifier::collaborationUse.
--
-- References the collaboration uses owned by the classifier.
overriding function Get_Feature
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature;
-- Getter of Classifier::feature.
--
-- Specifies each feature defined in the classifier.
-- Note that there may be members of the Classifier that are of the type
-- Feature but are not included in this association, e.g. inherited
-- features.
overriding function Get_General
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of Classifier::general.
--
-- Specifies the general Classifiers for this Classifier.
-- References the general classifier in the Generalization relationship.
overriding function Get_Generalization
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization;
-- Getter of Classifier::generalization.
--
-- Specifies the Generalization relationships for this Classifier. These
-- Generalizations navigaten to more general classifiers in the
-- generalization hierarchy.
overriding function Get_Inherited_Member
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Getter of Classifier::inheritedMember.
--
-- Specifies all elements inherited by this classifier from the general
-- classifiers.
overriding function Get_Is_Final_Specialization
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Getter of Classifier::isFinalSpecialization.
--
-- If true, the Classifier cannot be specialized by generalization. Note
-- that this property is preserved through package merge operations; that
-- is, the capability to specialize a Classifier (i.e.,
-- isFinalSpecialization =false) must be preserved in the resulting
-- Classifier of a package merge operation where a Classifier with
-- isFinalSpecialization =false is merged with a matching Classifier with
-- isFinalSpecialization =true: the resulting Classifier will have
-- isFinalSpecialization =false.
overriding procedure Set_Is_Final_Specialization
(Self : not null access UML_Activity_Proxy;
To : Boolean);
-- Setter of Classifier::isFinalSpecialization.
--
-- If true, the Classifier cannot be specialized by generalization. Note
-- that this property is preserved through package merge operations; that
-- is, the capability to specialize a Classifier (i.e.,
-- isFinalSpecialization =false) must be preserved in the resulting
-- Classifier of a package merge operation where a Classifier with
-- isFinalSpecialization =false is merged with a matching Classifier with
-- isFinalSpecialization =true: the resulting Classifier will have
-- isFinalSpecialization =false.
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access;
-- Getter of Classifier::ownedTemplateSignature.
--
-- The optional template signature specifying the formal template
-- parameters.
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access);
-- Setter of Classifier::ownedTemplateSignature.
--
-- The optional template signature specifying the formal template
-- parameters.
overriding function Get_Owned_Use_Case
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case;
-- Getter of Classifier::ownedUseCase.
--
-- References the use cases owned by this classifier.
overriding function Get_Powertype_Extent
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Generalization_Sets.Collections.Set_Of_UML_Generalization_Set;
-- Getter of Classifier::powertypeExtent.
--
-- Designates the GeneralizationSet of which the associated Classifier is
-- a power type.
overriding function Get_Redefined_Classifier
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of Classifier::redefinedClassifier.
--
-- References the Classifiers that are redefined by this Classifier.
overriding function Get_Representation
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access;
-- Getter of Classifier::representation.
--
-- References a collaboration use which indicates the collaboration that
-- represents this classifier.
overriding procedure Set_Representation
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access);
-- Setter of Classifier::representation.
--
-- References a collaboration use which indicates the collaboration that
-- represents this classifier.
overriding function Get_Substitution
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Substitutions.Collections.Set_Of_UML_Substitution;
-- Getter of Classifier::substitution.
--
-- References the substitutions that are owned by this Classifier.
overriding function Get_Template_Parameter
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access;
-- Getter of Classifier::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding procedure Set_Template_Parameter
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access);
-- Setter of Classifier::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding function Get_Use_Case
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case;
-- Getter of Classifier::useCase.
--
-- The set of use cases for which this Classifier is the subject.
overriding function Get_Element_Import
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import;
-- Getter of Namespace::elementImport.
--
-- References the ElementImports owned by the Namespace.
overriding function Get_Imported_Member
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
-- Getter of Namespace::importedMember.
--
-- References the PackageableElements that are members of this Namespace
-- as a result of either PackageImports or ElementImports.
overriding function Get_Member
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Getter of Namespace::member.
--
-- A collection of NamedElements identifiable within the Namespace, either
-- by being owned or by being introduced by importing or inheritance.
overriding function Get_Owned_Member
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Getter of Namespace::ownedMember.
--
-- A collection of NamedElements owned by the Namespace.
overriding function Get_Owned_Rule
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
-- Getter of Namespace::ownedRule.
--
-- Specifies a set of Constraints owned by this Namespace.
overriding function Get_Package_Import
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import;
-- Getter of Namespace::packageImport.
--
-- References the PackageImports owned by the Namespace.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name_Expression
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UML_Activity_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_Package
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Packages.UML_Package_Access;
-- Getter of Type::package.
--
-- Specifies the owning package of this classifier, if any.
overriding procedure Set_Package
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Packages.UML_Package_Access);
-- Setter of Type::package.
--
-- Specifies the owning package of this classifier, if any.
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding function Get_Template_Parameter
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding procedure Set_Template_Parameter
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Template_Signatures.UML_Template_Signature_Access;
-- Getter of TemplateableElement::ownedTemplateSignature.
--
-- The optional template signature specifying the formal template
-- parameters.
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Activity_Proxy;
To : AMF.UML.Template_Signatures.UML_Template_Signature_Access);
-- Setter of TemplateableElement::ownedTemplateSignature.
--
-- The optional template signature specifying the formal template
-- parameters.
overriding function Get_Template_Binding
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding;
-- Getter of TemplateableElement::templateBinding.
--
-- The optional bindings from this element to templates.
overriding function Get_Is_Leaf
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Getter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding procedure Set_Is_Leaf
(Self : not null access UML_Activity_Proxy;
To : Boolean);
-- Setter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding function Get_Redefined_Element
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
-- Getter of RedefinableElement::redefinedElement.
--
-- The redefinable element that is being redefined by this element.
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of RedefinableElement::redefinitionContext.
--
-- References the contexts that this element may be redefined from.
overriding function Get_Owned_Port
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Ports.Collections.Set_Of_UML_Port;
-- Getter of EncapsulatedClassifier::ownedPort.
--
-- References a set of ports that an encapsulated classifier owns.
overriding function Get_Owned_Connector
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Connectors.Collections.Set_Of_UML_Connector;
-- Getter of StructuredClassifier::ownedConnector.
--
-- References the connectors owned by the classifier.
overriding function Get_Part
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property;
-- Getter of StructuredClassifier::part.
--
-- References the properties specifying instances that the classifier owns
-- by composition. This association is derived, selecting those owned
-- properties where isComposite is true.
overriding function Get_Role
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Connectable_Elements.Collections.Set_Of_UML_Connectable_Element;
-- Getter of StructuredClassifier::role.
--
-- References the roles that instances may play in this classifier.
overriding function Structured_Node
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Structured_Activity_Nodes.Collections.Set_Of_UML_Structured_Activity_Node;
-- Operation Activity::structuredNode.
--
-- Missing derivation for Activity::/structuredNode :
-- StructuredActivityNode
overriding function Context
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access;
-- Operation Behavior::context.
--
-- Missing derivation for Behavior::/context : BehavioredClassifier
overriding function Extension
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Extensions.Collections.Set_Of_UML_Extension;
-- Operation Class::extension.
--
-- Missing derivation for Class::/extension : Extension
overriding function Inherit
(Self : not null access constant UML_Activity_Proxy;
Inhs : AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Operation Class::inherit.
--
-- The inherit operation is overridden to exclude redefined properties.
overriding function Super_Class
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Classes.Collections.Set_Of_UML_Class;
-- Operation Class::superClass.
--
-- Missing derivation for Class::/superClass : Class
overriding function All_Features
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature;
-- Operation Classifier::allFeatures.
--
-- The query allFeatures() gives all of the features in the namespace of
-- the classifier. In general, through mechanisms such as inheritance,
-- this will be a larger set than feature.
overriding function Conforms_To
(Self : not null access constant UML_Activity_Proxy;
Other : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean;
-- Operation Classifier::conformsTo.
--
-- The query conformsTo() gives true for a classifier that defines a type
-- that conforms to another. This is used, for example, in the
-- specification of signature conformance for operations.
overriding function General
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Operation Classifier::general.
--
-- The general classifiers are the classifiers referenced by the
-- generalization relationships.
overriding function Has_Visibility_Of
(Self : not null access constant UML_Activity_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access)
return Boolean;
-- Operation Classifier::hasVisibilityOf.
--
-- The query hasVisibilityOf() determines whether a named element is
-- visible in the classifier. By default all are visible. It is only
-- called when the argument is something owned by a parent.
overriding function Inheritable_Members
(Self : not null access constant UML_Activity_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Operation Classifier::inheritableMembers.
--
-- The query inheritableMembers() gives all of the members of a classifier
-- that may be inherited in one of its descendants, subject to whatever
-- visibility restrictions apply.
overriding function Inherited_Member
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Operation Classifier::inheritedMember.
--
-- The inheritedMember association is derived by inheriting the
-- inheritable members of the parents.
-- The inheritedMember association is derived by inheriting the
-- inheritable members of the parents.
overriding function Is_Template
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Operation Classifier::isTemplate.
--
-- The query isTemplate() returns whether this templateable element is
-- actually a template.
overriding function May_Specialize_Type
(Self : not null access constant UML_Activity_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean;
-- Operation Classifier::maySpecializeType.
--
-- The query maySpecializeType() determines whether this classifier may
-- have a generalization relationship to classifiers of the specified
-- type. By default a classifier may specialize classifiers of the same or
-- a more general type. It is intended to be redefined by classifiers that
-- have different specialization constraints.
overriding function Exclude_Collisions
(Self : not null access constant UML_Activity_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
-- Operation Namespace::excludeCollisions.
--
-- The query excludeCollisions() excludes from a set of
-- PackageableElements any that would not be distinguishable from each
-- other in this namespace.
overriding function Get_Names_Of_Member
(Self : not null access constant UML_Activity_Proxy;
Element : AMF.UML.Named_Elements.UML_Named_Element_Access)
return AMF.String_Collections.Set_Of_String;
-- Operation Namespace::getNamesOfMember.
--
-- The query getNamesOfMember() takes importing into account. It gives
-- back the set of names that an element would have in an importing
-- namespace, either because it is owned, or if not owned then imported
-- individually, or if not individually then from a package.
-- The query getNamesOfMember() gives a set of all of the names that a
-- member would have in a Namespace. In general a member can have multiple
-- names in a Namespace if it is imported more than once with different
-- aliases. The query takes account of importing. It gives back the set of
-- names that an element would have in an importing namespace, either
-- because it is owned, or if not owned then imported individually, or if
-- not individually then from a package.
overriding function Import_Members
(Self : not null access constant UML_Activity_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
-- Operation Namespace::importMembers.
--
-- The query importMembers() defines which of a set of PackageableElements
-- are actually imported into the namespace. This excludes hidden ones,
-- i.e., those which have names that conflict with names of owned members,
-- and also excludes elements which would have the same name when imported.
overriding function Imported_Member
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
-- Operation Namespace::importedMember.
--
-- The importedMember property is derived from the ElementImports and the
-- PackageImports. References the PackageableElements that are members of
-- this Namespace as a result of either PackageImports or ElementImports.
overriding function Members_Are_Distinguishable
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Operation Namespace::membersAreDistinguishable.
--
-- The Boolean query membersAreDistinguishable() determines whether all of
-- the namespace's members are distinguishable within it.
overriding function Owned_Member
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
-- Operation Namespace::ownedMember.
--
-- Missing derivation for Namespace::/ownedMember : NamedElement
overriding function All_Owning_Packages
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Activity_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding function Conforms_To
(Self : not null access constant UML_Activity_Proxy;
Other : AMF.UML.Types.UML_Type_Access)
return Boolean;
-- Operation Type::conformsTo.
--
-- The query conformsTo() gives true for a type that conforms to another.
-- By default, two types do not conform to each other. This query is
-- intended to be redefined for specific conformance situations.
overriding function Is_Compatible_With
(Self : not null access constant UML_Activity_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean;
-- Operation ParameterableElement::isCompatibleWith.
--
-- The query isCompatibleWith() determines if this parameterable element
-- is compatible with the specified parameterable element. By default
-- parameterable element P is compatible with parameterable element Q if
-- the kind of P is the same or a subtype as the kind of Q. Subclasses
-- should override this operation to specify different compatibility
-- constraints.
overriding function Is_Template_Parameter
(Self : not null access constant UML_Activity_Proxy)
return Boolean;
-- Operation ParameterableElement::isTemplateParameter.
--
-- The query isTemplateParameter() determines if this parameterable
-- element is exposed as a formal template parameter.
overriding function Parameterable_Elements
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Parameterable_Elements.Collections.Set_Of_UML_Parameterable_Element;
-- Operation TemplateableElement::parameterableElements.
--
-- The query parameterableElements() returns the set of elements that may
-- be used as the parametered elements for a template parameter of this
-- templateable element. By default, this set includes all the owned
-- elements. Subclasses may override this operation if they choose to
-- restrict the set of parameterable elements.
overriding function Is_Consistent_With
(Self : not null access constant UML_Activity_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isConsistentWith.
--
-- The query isConsistentWith() specifies, for any two RedefinableElements
-- in a context in which redefinition is possible, whether redefinition
-- would be logically consistent. By default, this is false; this
-- operation must be overridden for subclasses of RedefinableElement to
-- define the consistency conditions.
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Activity_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isRedefinitionContextValid.
--
-- The query isRedefinitionContextValid() specifies whether the
-- redefinition contexts of this RedefinableElement are properly related
-- to the redefinition contexts of the specified RedefinableElement to
-- allow this element to redefine the other. By default at least one of
-- the redefinition contexts of this element must be a specialization of
-- at least one of the redefinition contexts of the specified element.
overriding function Owned_Port
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Ports.Collections.Set_Of_UML_Port;
-- Operation EncapsulatedClassifier::ownedPort.
--
-- Missing derivation for EncapsulatedClassifier::/ownedPort : Port
overriding function Part
(Self : not null access constant UML_Activity_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property;
-- Operation StructuredClassifier::part.
--
-- Missing derivation for StructuredClassifier::/part : Property
overriding procedure Enter_Element
(Self : not null access constant UML_Activity_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_Activity_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_Activity_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_Activities;
|
andreas-kupries/critcl | Ada | 5,999 | adb | ----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
-- $Id: zlib-streams.adb 66 2005-08-17 18:20:58Z andreas_kupries $
with Ada.Unchecked_Deallocation;
package body ZLib.Streams is
-----------
-- Close --
-----------
procedure Close (Stream : in out Stream_Type) is
procedure Free is new Ada.Unchecked_Deallocation
(Stream_Element_Array, Buffer_Access);
begin
if Stream.Mode = Out_Stream or Stream.Mode = Duplex then
-- We should flush the data written by the writer.
Flush (Stream, Finish);
Close (Stream.Writer);
end if;
if Stream.Mode = In_Stream or Stream.Mode = Duplex then
Close (Stream.Reader);
Free (Stream.Buffer);
end if;
end Close;
------------
-- Create --
------------
procedure Create
(Stream : out Stream_Type;
Mode : in Stream_Mode;
Back : in Stream_Access;
Back_Compressed : in Boolean;
Level : in Compression_Level := Default_Compression;
Strategy : in Strategy_Type := Default_Strategy;
Header : in Header_Type := Default;
Read_Buffer_Size : in Ada.Streams.Stream_Element_Offset
:= Default_Buffer_Size;
Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset
:= Default_Buffer_Size)
is
subtype Buffer_Subtype is Stream_Element_Array (1 .. Read_Buffer_Size);
procedure Init_Filter
(Filter : in out Filter_Type;
Compress : in Boolean);
-----------------
-- Init_Filter --
-----------------
procedure Init_Filter
(Filter : in out Filter_Type;
Compress : in Boolean) is
begin
if Compress then
Deflate_Init
(Filter, Level, Strategy, Header => Header);
else
Inflate_Init (Filter, Header => Header);
end if;
end Init_Filter;
begin
Stream.Back := Back;
Stream.Mode := Mode;
if Mode = Out_Stream or Mode = Duplex then
Init_Filter (Stream.Writer, Back_Compressed);
Stream.Buffer_Size := Write_Buffer_Size;
else
Stream.Buffer_Size := 0;
end if;
if Mode = In_Stream or Mode = Duplex then
Init_Filter (Stream.Reader, not Back_Compressed);
Stream.Buffer := new Buffer_Subtype;
Stream.Rest_First := Stream.Buffer'Last + 1;
Stream.Rest_Last := Stream.Buffer'Last;
end if;
end Create;
-----------
-- Flush --
-----------
procedure Flush
(Stream : in out Stream_Type;
Mode : in Flush_Mode := Sync_Flush)
is
Buffer : Stream_Element_Array (1 .. Stream.Buffer_Size);
Last : Stream_Element_Offset;
begin
loop
Flush (Stream.Writer, Buffer, Last, Mode);
Ada.Streams.Write (Stream.Back.all, Buffer (1 .. Last));
exit when Last < Buffer'Last;
end loop;
end Flush;
-------------
-- Is_Open --
-------------
function Is_Open (Stream : Stream_Type) return Boolean is
begin
return Is_Open (Stream.Reader) or else Is_Open (Stream.Writer);
end Is_Open;
----------
-- Read --
----------
procedure Read
(Stream : in out Stream_Type;
Item : out Stream_Element_Array;
Last : out Stream_Element_Offset)
is
procedure Read
(Item : out Stream_Element_Array;
Last : out Stream_Element_Offset);
----------
-- Read --
----------
procedure Read
(Item : out Stream_Element_Array;
Last : out Stream_Element_Offset) is
begin
Ada.Streams.Read (Stream.Back.all, Item, Last);
end Read;
procedure Read is new ZLib.Read
(Read => Read,
Buffer => Stream.Buffer.all,
Rest_First => Stream.Rest_First,
Rest_Last => Stream.Rest_Last);
begin
Read (Stream.Reader, Item, Last);
end Read;
-------------------
-- Read_Total_In --
-------------------
function Read_Total_In (Stream : in Stream_Type) return Count is
begin
return Total_In (Stream.Reader);
end Read_Total_In;
--------------------
-- Read_Total_Out --
--------------------
function Read_Total_Out (Stream : in Stream_Type) return Count is
begin
return Total_Out (Stream.Reader);
end Read_Total_Out;
-----------
-- Write --
-----------
procedure Write
(Stream : in out Stream_Type;
Item : in Stream_Element_Array)
is
procedure Write (Item : in Stream_Element_Array);
-----------
-- Write --
-----------
procedure Write (Item : in Stream_Element_Array) is
begin
Ada.Streams.Write (Stream.Back.all, Item);
end Write;
procedure Write is new ZLib.Write
(Write => Write,
Buffer_Size => Stream.Buffer_Size);
begin
Write (Stream.Writer, Item, No_Flush);
end Write;
--------------------
-- Write_Total_In --
--------------------
function Write_Total_In (Stream : in Stream_Type) return Count is
begin
return Total_In (Stream.Writer);
end Write_Total_In;
---------------------
-- Write_Total_Out --
---------------------
function Write_Total_Out (Stream : in Stream_Type) return Count is
begin
return Total_Out (Stream.Writer);
end Write_Total_Out;
end ZLib.Streams;
|
alkhimey/Ada_Curve | Ada | 4,368 | ads | -- The MIT License (MIT)
--
-- Copyright (c) 2016-2017 [email protected]
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
--
--
with Ada.Numerics.Generic_Elementary_Functions;
generic
type Base_Real_Type is digits <>; -- Floating point only (can be manually changed to fixed point)
Dimension : Positive;
package Curve is
package Base_Type_Math is new Ada.Numerics.Generic_Elementary_Functions(Base_Real_Type);
-- Type Definitions
-------------------
type Dimension_Type is new Positive range 1 .. Dimension;
type Point_Type is array( Dimension_Type ) of Base_Real_Type;
subtype Parametrization_Type is Base_Real_Type range 0.0 .. 1.0;
type Control_Points_Array is array(Positive range <>) of Point_Type;
type Interpolation_Nodes_Array is array(Positive range <>) of Parametrization_Type;
type Knot_Values_Array is array(Positive range <>) of Parametrization_Type;
-- Constants
------------
ORIGIN_POINT : constant Point_Type := (others => Base_Real_Type(0.0));
X : constant := 1;
Y : constant := 2;
Z : constant := 3;
W : constant := 4;
-- Operator definitions
-----------------------
function "+" (Left, Right : Point_Type) return Point_Type;
function "-" (Left, Right : Point_Type) return Point_Type;
function "-" (Right : Point_Type) return Point_Type;
function "*" (Left : Point_Type;
Right : Base_Real_Type ) return Point_Type;
function "*" (Left : Base_Real_Type;
Right : Point_Type ) return Point_Type;
-- Curve functions and procedures
---------------------------------
function Eval_De_Castelijau( Control_Points : in Control_Points_Array;
T : in Parametrization_Type) return Point_Type;
function Eval_De_Boor ( Control_Points : in Control_Points_Array;
Knot_Values : in Knot_Values_Array;
T : in Parametrization_Type;
Is_Outside_The_Domain : out Boolean) return Point_Type with
Pre => Control_Points'First = Knot_Values'First and then -- Implementation depends on this
Knot_Values'Length - Control_Points'Length - 1 > 0; -- At least 0 degree
function Eval_Catmull_Rom ( Control_Points : in Control_Points_Array;
Segment : in Positive;
T : in Parametrization_Type) return Point_Type;
-- Evaluate f(t) of a function interpolating {t,f(t)}, where t vlaues are the interpolation nodes.
-- and f(t) values are control points. The interpolation is done with Lagrange method.
function Eval_Lagrange( Control_Points : in Control_Points_Array;
Interpolation_Nodes : in Interpolation_Nodes_Array;
T : in Parametrization_Type) return Point_Type with
Pre => Control_Points'Length = Interpolation_Nodes'Length;
function Make_Equidistant_Nodes( N : Positive ) return Interpolation_Nodes_Array;
function Make_Chebyshev_Nodes( N : Positive ) return Interpolation_Nodes_Array;
end Curve;
|
Letractively/ada-el | Ada | 1,229 | ads | -----------------------------------------------------------------------
-- EL testsuite - EL Testsuite
-- Copyright (C) 2009, 2010 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Tests;
package EL.Testsuite is
function Suite return Util.Tests.Access_Test_Suite;
type Test is new Util.Tests.Test with record
I1 : Integer;
I2 : Integer;
end record;
-- Test object integer
procedure Test_To_Object_Integer (T : in out Test);
-- Test object integer
procedure Test_Expression (T : in out Test);
end EL.Testsuite;
|
persan/A-gst | Ada | 3,405 | ads | pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h;
with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h;
with glib;
with glib.Values;
with System;
-- with GStreamer.GST_Low_Level.bits_socket_h;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_net_gstnettimepacket_h is
GST_NET_TIME_PACKET_SIZE : constant := 16; -- gst/net/gstnettimepacket.h:50
-- GStreamer
-- * Copyright (C) 2005 Andy Wingo <[email protected]>
-- *
-- * 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_NET_TIME_PACKET_SIZE:
-- *
-- * The size of the packets sent between network clocks.
--
type GstNetTimePacket;
--subtype GstNetTimePacket is u_GstNetTimePacket; -- gst/net/gstnettimepacket.h:52
--*
-- * GstNetTimePacket:
-- * @local_time: the local time when this packet was sent
-- * @remote_time: the remote time observation
-- *
-- * Content of a #GstNetTimePacket.
--
type GstNetTimePacket is record
local_time : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime; -- gst/net/gstnettimepacket.h:62
remote_time : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime; -- gst/net/gstnettimepacket.h:63
end record;
pragma Convention (C_Pass_By_Copy, GstNetTimePacket); -- gst/net/gstnettimepacket.h:61
function gst_net_time_packet_new (buffer : access GLIB.guint8) return access GstNetTimePacket; -- gst/net/gstnettimepacket.h:66
pragma Import (C, gst_net_time_packet_new, "gst_net_time_packet_new");
function gst_net_time_packet_serialize (packet : access constant GstNetTimePacket) return access GLIB.guint8; -- gst/net/gstnettimepacket.h:67
pragma Import (C, gst_net_time_packet_serialize, "gst_net_time_packet_serialize");
function gst_net_time_packet_receive
(fd : GLIB.gint;
addr : access GStreamer.GST_Low_Level.bits_socket_h.sockaddr;
len : access GStreamer.GST_Low_Level.bits_socket_h.socklen_t) return access GstNetTimePacket; -- gst/net/gstnettimepacket.h:69
pragma Import (C, gst_net_time_packet_receive, "gst_net_time_packet_receive");
function gst_net_time_packet_send
(packet : access constant GstNetTimePacket;
fd : GLIB.gint;
addr : access GStreamer.GST_Low_Level.bits_socket_h.sockaddr;
len : GStreamer.GST_Low_Level.bits_socket_h.socklen_t) return GLIB.gint; -- gst/net/gstnettimepacket.h:71
pragma Import (C, gst_net_time_packet_send, "gst_net_time_packet_send");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_net_gstnettimepacket_h;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 31,557 | ads | pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32L0x3.svd
pragma Restrictions (No_Elaboration_Code);
with System;
package STM32_SVD.RTC is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype TR_SU_Field is STM32_SVD.UInt4;
subtype TR_ST_Field is STM32_SVD.UInt3;
subtype TR_MNU_Field is STM32_SVD.UInt4;
subtype TR_MNT_Field is STM32_SVD.UInt3;
subtype TR_HU_Field is STM32_SVD.UInt4;
subtype TR_HT_Field is STM32_SVD.UInt2;
subtype TR_PM_Field is STM32_SVD.Bit;
-- RTC time register
type TR_Register is record
-- Second units in BCD format
SU : TR_SU_Field := 16#0#;
-- Second tens in BCD format
ST : TR_ST_Field := 16#0#;
-- unspecified
Reserved_7_7 : STM32_SVD.Bit := 16#0#;
-- Minute units in BCD format
MNU : TR_MNU_Field := 16#0#;
-- Minute tens in BCD format
MNT : TR_MNT_Field := 16#0#;
-- unspecified
Reserved_15_15 : STM32_SVD.Bit := 16#0#;
-- Hour units in BCD format
HU : TR_HU_Field := 16#0#;
-- Hour tens in BCD format
HT : TR_HT_Field := 16#0#;
-- AM/PM notation
PM : TR_PM_Field := 16#0#;
-- unspecified
Reserved_23_31 : STM32_SVD.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TR_Register use record
SU at 0 range 0 .. 3;
ST at 0 range 4 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
MNU at 0 range 8 .. 11;
MNT at 0 range 12 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
HU at 0 range 16 .. 19;
HT at 0 range 20 .. 21;
PM at 0 range 22 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
subtype DR_DU_Field is STM32_SVD.UInt4;
subtype DR_DT_Field is STM32_SVD.UInt2;
subtype DR_MU_Field is STM32_SVD.UInt4;
subtype DR_MT_Field is STM32_SVD.Bit;
subtype DR_WDU_Field is STM32_SVD.UInt3;
subtype DR_YU_Field is STM32_SVD.UInt4;
subtype DR_YT_Field is STM32_SVD.UInt4;
-- RTC date register
type DR_Register is record
-- Date units in BCD format
DU : DR_DU_Field := 16#0#;
-- Date tens in BCD format
DT : DR_DT_Field := 16#0#;
-- unspecified
Reserved_6_7 : STM32_SVD.UInt2 := 16#0#;
-- Month units in BCD format
MU : DR_MU_Field := 16#0#;
-- Month tens in BCD format
MT : DR_MT_Field := 16#0#;
-- Week day units
WDU : DR_WDU_Field := 16#0#;
-- Year units in BCD format
YU : DR_YU_Field := 16#0#;
-- Year tens in BCD format
YT : DR_YT_Field := 16#0#;
-- unspecified
Reserved_24_31 : STM32_SVD.Byte := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DR_Register use record
DU at 0 range 0 .. 3;
DT at 0 range 4 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
MU at 0 range 8 .. 11;
MT at 0 range 12 .. 12;
WDU at 0 range 13 .. 15;
YU at 0 range 16 .. 19;
YT at 0 range 20 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CR_WUCKSEL_Field is STM32_SVD.UInt3;
subtype CR_TSEDGE_Field is STM32_SVD.Bit;
subtype CR_REFCKON_Field is STM32_SVD.Bit;
subtype CR_BYPSHAD_Field is STM32_SVD.Bit;
subtype CR_FMT_Field is STM32_SVD.Bit;
subtype CR_ALRAE_Field is STM32_SVD.Bit;
subtype CR_ALRBE_Field is STM32_SVD.Bit;
subtype CR_WUTE_Field is STM32_SVD.Bit;
subtype CR_TSE_Field is STM32_SVD.Bit;
subtype CR_ALRAIE_Field is STM32_SVD.Bit;
subtype CR_ALRBIE_Field is STM32_SVD.Bit;
subtype CR_WUTIE_Field is STM32_SVD.Bit;
subtype CR_TSIE_Field is STM32_SVD.Bit;
subtype CR_ADD1H_Field is STM32_SVD.Bit;
subtype CR_SUB1H_Field is STM32_SVD.Bit;
subtype CR_BKP_Field is STM32_SVD.Bit;
subtype CR_COSEL_Field is STM32_SVD.Bit;
subtype CR_POL_Field is STM32_SVD.Bit;
subtype CR_OSEL_Field is STM32_SVD.UInt2;
subtype CR_COE_Field is STM32_SVD.Bit;
-- RTC control register
type CR_Register is record
-- Wakeup clock selection
WUCKSEL : CR_WUCKSEL_Field := 16#0#;
-- Time-stamp event active edge
TSEDGE : CR_TSEDGE_Field := 16#0#;
-- RTC_REFIN reference clock detection enable (50 or 60 Hz)
REFCKON : CR_REFCKON_Field := 16#0#;
-- Bypass the shadow registers
BYPSHAD : CR_BYPSHAD_Field := 16#0#;
-- Hour format
FMT : CR_FMT_Field := 16#0#;
-- unspecified
Reserved_7_7 : STM32_SVD.Bit := 16#0#;
-- Alarm A enable
ALRAE : CR_ALRAE_Field := 16#0#;
-- Alarm B enable
ALRBE : CR_ALRBE_Field := 16#0#;
-- Wakeup timer enable
WUTE : CR_WUTE_Field := 16#0#;
-- timestamp enable
TSE : CR_TSE_Field := 16#0#;
-- Alarm A interrupt enable
ALRAIE : CR_ALRAIE_Field := 16#0#;
-- Alarm B interrupt enable
ALRBIE : CR_ALRBIE_Field := 16#0#;
-- Wakeup timer interrupt enable
WUTIE : CR_WUTIE_Field := 16#0#;
-- Time-stamp interrupt enable
TSIE : CR_TSIE_Field := 16#0#;
-- Write-only. Add 1 hour (summer time change)
ADD1H : CR_ADD1H_Field := 16#0#;
-- Write-only. Subtract 1 hour (winter time change)
SUB1H : CR_SUB1H_Field := 16#0#;
-- Backup
BKP : CR_BKP_Field := 16#0#;
-- Calibration output selection
COSEL : CR_COSEL_Field := 16#0#;
-- Output polarity
POL : CR_POL_Field := 16#0#;
-- Output selection
OSEL : CR_OSEL_Field := 16#0#;
-- Calibration output enable
COE : CR_COE_Field := 16#0#;
-- unspecified
Reserved_24_31 : STM32_SVD.Byte := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
WUCKSEL at 0 range 0 .. 2;
TSEDGE at 0 range 3 .. 3;
REFCKON at 0 range 4 .. 4;
BYPSHAD at 0 range 5 .. 5;
FMT at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
ALRAE at 0 range 8 .. 8;
ALRBE at 0 range 9 .. 9;
WUTE at 0 range 10 .. 10;
TSE at 0 range 11 .. 11;
ALRAIE at 0 range 12 .. 12;
ALRBIE at 0 range 13 .. 13;
WUTIE at 0 range 14 .. 14;
TSIE at 0 range 15 .. 15;
ADD1H at 0 range 16 .. 16;
SUB1H at 0 range 17 .. 17;
BKP at 0 range 18 .. 18;
COSEL at 0 range 19 .. 19;
POL at 0 range 20 .. 20;
OSEL at 0 range 21 .. 22;
COE at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype ISR_ALRAWF_Field is STM32_SVD.Bit;
subtype ISR_ALRBWF_Field is STM32_SVD.Bit;
subtype ISR_WUTWF_Field is STM32_SVD.Bit;
subtype ISR_SHPF_Field is STM32_SVD.Bit;
subtype ISR_INITS_Field is STM32_SVD.Bit;
subtype ISR_RSF_Field is STM32_SVD.Bit;
subtype ISR_INITF_Field is STM32_SVD.Bit;
subtype ISR_INIT_Field is STM32_SVD.Bit;
subtype ISR_ALRAF_Field is STM32_SVD.Bit;
subtype ISR_ALRBF_Field is STM32_SVD.Bit;
subtype ISR_WUTF_Field is STM32_SVD.Bit;
subtype ISR_TSF_Field is STM32_SVD.Bit;
subtype ISR_TSOVF_Field is STM32_SVD.Bit;
subtype ISR_TAMP1F_Field is STM32_SVD.Bit;
subtype ISR_TAMP2F_Field is STM32_SVD.Bit;
-- RTC initialization and status register
type ISR_Register is record
-- Read-only. Alarm A write flag
ALRAWF : ISR_ALRAWF_Field := 16#0#;
-- Read-only. Alarm B write flag
ALRBWF : ISR_ALRBWF_Field := 16#0#;
-- Read-only. Wakeup timer write flag
WUTWF : ISR_WUTWF_Field := 16#0#;
-- Read-only. Shift operation pending
SHPF : ISR_SHPF_Field := 16#0#;
-- Read-only. Initialization status flag
INITS : ISR_INITS_Field := 16#0#;
-- Registers synchronization flag
RSF : ISR_RSF_Field := 16#0#;
-- Read-only. Initialization flag
INITF : ISR_INITF_Field := 16#0#;
-- Initialization mode
INIT : ISR_INIT_Field := 16#0#;
-- Alarm A flag
ALRAF : ISR_ALRAF_Field := 16#0#;
-- Alarm B flag
ALRBF : ISR_ALRBF_Field := 16#0#;
-- Wakeup timer flag
WUTF : ISR_WUTF_Field := 16#0#;
-- Time-stamp flag
TSF : ISR_TSF_Field := 16#0#;
-- Time-stamp overflow flag
TSOVF : ISR_TSOVF_Field := 16#0#;
-- RTC_TAMP1 detection flag
TAMP1F : ISR_TAMP1F_Field := 16#0#;
-- RTC_TAMP2 detection flag
TAMP2F : ISR_TAMP2F_Field := 16#0#;
-- unspecified
Reserved_15_31 : STM32_SVD.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
ALRAWF at 0 range 0 .. 0;
ALRBWF at 0 range 1 .. 1;
WUTWF at 0 range 2 .. 2;
SHPF at 0 range 3 .. 3;
INITS at 0 range 4 .. 4;
RSF at 0 range 5 .. 5;
INITF at 0 range 6 .. 6;
INIT at 0 range 7 .. 7;
ALRAF at 0 range 8 .. 8;
ALRBF at 0 range 9 .. 9;
WUTF at 0 range 10 .. 10;
TSF at 0 range 11 .. 11;
TSOVF at 0 range 12 .. 12;
TAMP1F at 0 range 13 .. 13;
TAMP2F at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
subtype PRER_PREDIV_S_Field is STM32_SVD.UInt16;
subtype PRER_PREDIV_A_Field is STM32_SVD.UInt7;
-- RTC prescaler register
type PRER_Register is record
-- Synchronous prescaler factor
PREDIV_S : PRER_PREDIV_S_Field := 16#0#;
-- Asynchronous prescaler factor
PREDIV_A : PRER_PREDIV_A_Field := 16#0#;
-- unspecified
Reserved_23_31 : STM32_SVD.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PRER_Register use record
PREDIV_S at 0 range 0 .. 15;
PREDIV_A at 0 range 16 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
subtype WUTR_WUT_Field is STM32_SVD.UInt16;
-- RTC wakeup timer register
type WUTR_Register is record
-- Wakeup auto-reload value bits
WUT : WUTR_WUT_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32_SVD.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for WUTR_Register use record
WUT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype ALRMAR_SU_Field is STM32_SVD.UInt4;
subtype ALRMAR_ST_Field is STM32_SVD.UInt3;
subtype ALRMAR_MSK1_Field is STM32_SVD.Bit;
subtype ALRMAR_MNU_Field is STM32_SVD.UInt4;
subtype ALRMAR_MNT_Field is STM32_SVD.UInt3;
subtype ALRMAR_MSK2_Field is STM32_SVD.Bit;
subtype ALRMAR_HU_Field is STM32_SVD.UInt4;
subtype ALRMAR_HT_Field is STM32_SVD.UInt2;
subtype ALRMAR_PM_Field is STM32_SVD.Bit;
subtype ALRMAR_MSK3_Field is STM32_SVD.Bit;
subtype ALRMAR_DU_Field is STM32_SVD.UInt4;
subtype ALRMAR_DT_Field is STM32_SVD.UInt2;
subtype ALRMAR_WDSEL_Field is STM32_SVD.Bit;
subtype ALRMAR_MSK4_Field is STM32_SVD.Bit;
-- RTC alarm A register
type ALRMAR_Register is record
-- Second units in BCD format.
SU : ALRMAR_SU_Field := 16#0#;
-- Second tens in BCD format.
ST : ALRMAR_ST_Field := 16#0#;
-- Alarm A seconds mask
MSK1 : ALRMAR_MSK1_Field := 16#0#;
-- Minute units in BCD format.
MNU : ALRMAR_MNU_Field := 16#0#;
-- Minute tens in BCD format.
MNT : ALRMAR_MNT_Field := 16#0#;
-- Alarm A minutes mask
MSK2 : ALRMAR_MSK2_Field := 16#0#;
-- Hour units in BCD format.
HU : ALRMAR_HU_Field := 16#0#;
-- Hour tens in BCD format.
HT : ALRMAR_HT_Field := 16#0#;
-- AM/PM notation
PM : ALRMAR_PM_Field := 16#0#;
-- Alarm A hours mask
MSK3 : ALRMAR_MSK3_Field := 16#0#;
-- Date units or day in BCD format.
DU : ALRMAR_DU_Field := 16#0#;
-- Date tens in BCD format.
DT : ALRMAR_DT_Field := 16#0#;
-- Week day selection
WDSEL : ALRMAR_WDSEL_Field := 16#0#;
-- Alarm A date mask
MSK4 : ALRMAR_MSK4_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ALRMAR_Register use record
SU at 0 range 0 .. 3;
ST at 0 range 4 .. 6;
MSK1 at 0 range 7 .. 7;
MNU at 0 range 8 .. 11;
MNT at 0 range 12 .. 14;
MSK2 at 0 range 15 .. 15;
HU at 0 range 16 .. 19;
HT at 0 range 20 .. 21;
PM at 0 range 22 .. 22;
MSK3 at 0 range 23 .. 23;
DU at 0 range 24 .. 27;
DT at 0 range 28 .. 29;
WDSEL at 0 range 30 .. 30;
MSK4 at 0 range 31 .. 31;
end record;
subtype ALRMBR_SU_Field is STM32_SVD.UInt4;
subtype ALRMBR_ST_Field is STM32_SVD.UInt3;
subtype ALRMBR_MSK1_Field is STM32_SVD.Bit;
subtype ALRMBR_MNU_Field is STM32_SVD.UInt4;
subtype ALRMBR_MNT_Field is STM32_SVD.UInt3;
subtype ALRMBR_MSK2_Field is STM32_SVD.Bit;
subtype ALRMBR_HU_Field is STM32_SVD.UInt4;
subtype ALRMBR_HT_Field is STM32_SVD.UInt2;
subtype ALRMBR_PM_Field is STM32_SVD.Bit;
subtype ALRMBR_MSK3_Field is STM32_SVD.Bit;
subtype ALRMBR_DU_Field is STM32_SVD.UInt4;
subtype ALRMBR_DT_Field is STM32_SVD.UInt2;
subtype ALRMBR_WDSEL_Field is STM32_SVD.Bit;
subtype ALRMBR_MSK4_Field is STM32_SVD.Bit;
-- RTC alarm B register
type ALRMBR_Register is record
-- Second units in BCD format
SU : ALRMBR_SU_Field := 16#0#;
-- Second tens in BCD format
ST : ALRMBR_ST_Field := 16#0#;
-- Alarm B seconds mask
MSK1 : ALRMBR_MSK1_Field := 16#0#;
-- Minute units in BCD format
MNU : ALRMBR_MNU_Field := 16#0#;
-- Minute tens in BCD format
MNT : ALRMBR_MNT_Field := 16#0#;
-- Alarm B minutes mask
MSK2 : ALRMBR_MSK2_Field := 16#0#;
-- Hour units in BCD format
HU : ALRMBR_HU_Field := 16#0#;
-- Hour tens in BCD format
HT : ALRMBR_HT_Field := 16#0#;
-- AM/PM notation
PM : ALRMBR_PM_Field := 16#0#;
-- Alarm B hours mask
MSK3 : ALRMBR_MSK3_Field := 16#0#;
-- Date units or day in BCD format
DU : ALRMBR_DU_Field := 16#0#;
-- Date tens in BCD format
DT : ALRMBR_DT_Field := 16#0#;
-- Week day selection
WDSEL : ALRMBR_WDSEL_Field := 16#0#;
-- Alarm B date mask
MSK4 : ALRMBR_MSK4_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ALRMBR_Register use record
SU at 0 range 0 .. 3;
ST at 0 range 4 .. 6;
MSK1 at 0 range 7 .. 7;
MNU at 0 range 8 .. 11;
MNT at 0 range 12 .. 14;
MSK2 at 0 range 15 .. 15;
HU at 0 range 16 .. 19;
HT at 0 range 20 .. 21;
PM at 0 range 22 .. 22;
MSK3 at 0 range 23 .. 23;
DU at 0 range 24 .. 27;
DT at 0 range 28 .. 29;
WDSEL at 0 range 30 .. 30;
MSK4 at 0 range 31 .. 31;
end record;
subtype WPR_KEY_Field is STM32_SVD.Byte;
-- write protection register
type WPR_Register is record
-- Write-only. Write protection key
KEY : WPR_KEY_Field := 16#0#;
-- unspecified
Reserved_8_31 : STM32_SVD.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for WPR_Register use record
KEY at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype SSR_SS_Field is STM32_SVD.UInt16;
-- RTC sub second register
type SSR_Register is record
-- Read-only. Sub second value
SS : SSR_SS_Field;
-- unspecified
Reserved_16_31 : STM32_SVD.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SSR_Register use record
SS at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype SHIFTR_SUBFS_Field is STM32_SVD.UInt15;
subtype SHIFTR_ADD1S_Field is STM32_SVD.Bit;
-- RTC shift control register
type SHIFTR_Register is record
-- Write-only. Subtract a fraction of a second
SUBFS : SHIFTR_SUBFS_Field := 16#0#;
-- unspecified
Reserved_15_30 : STM32_SVD.UInt16 := 16#0#;
-- Write-only. Add one second
ADD1S : SHIFTR_ADD1S_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SHIFTR_Register use record
SUBFS at 0 range 0 .. 14;
Reserved_15_30 at 0 range 15 .. 30;
ADD1S at 0 range 31 .. 31;
end record;
subtype TSTR_SU_Field is STM32_SVD.UInt4;
subtype TSTR_ST_Field is STM32_SVD.UInt3;
subtype TSTR_MNU_Field is STM32_SVD.UInt4;
subtype TSTR_MNT_Field is STM32_SVD.UInt3;
subtype TSTR_HU_Field is STM32_SVD.UInt4;
subtype TSTR_HT_Field is STM32_SVD.UInt2;
subtype TSTR_PM_Field is STM32_SVD.Bit;
-- RTC timestamp time register
type TSTR_Register is record
-- Read-only. Second units in BCD format.
SU : TSTR_SU_Field;
-- Read-only. Second tens in BCD format.
ST : TSTR_ST_Field;
-- unspecified
Reserved_7_7 : STM32_SVD.Bit;
-- Read-only. Minute units in BCD format.
MNU : TSTR_MNU_Field;
-- Read-only. Minute tens in BCD format.
MNT : TSTR_MNT_Field;
-- unspecified
Reserved_15_15 : STM32_SVD.Bit;
-- Read-only. Hour units in BCD format.
HU : TSTR_HU_Field;
-- Read-only. Hour tens in BCD format.
HT : TSTR_HT_Field;
-- Read-only. AM/PM notation
PM : TSTR_PM_Field;
-- unspecified
Reserved_23_31 : STM32_SVD.UInt9;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TSTR_Register use record
SU at 0 range 0 .. 3;
ST at 0 range 4 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
MNU at 0 range 8 .. 11;
MNT at 0 range 12 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
HU at 0 range 16 .. 19;
HT at 0 range 20 .. 21;
PM at 0 range 22 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
subtype TSDR_DU_Field is STM32_SVD.UInt4;
subtype TSDR_DT_Field is STM32_SVD.UInt2;
subtype TSDR_MU_Field is STM32_SVD.UInt4;
subtype TSDR_MT_Field is STM32_SVD.Bit;
subtype TSDR_WDU_Field is STM32_SVD.UInt3;
-- RTC timestamp date register
type TSDR_Register is record
-- Read-only. Date units in BCD format
DU : TSDR_DU_Field;
-- Read-only. Date tens in BCD format
DT : TSDR_DT_Field;
-- unspecified
Reserved_6_7 : STM32_SVD.UInt2;
-- Read-only. Month units in BCD format
MU : TSDR_MU_Field;
-- Read-only. Month tens in BCD format
MT : TSDR_MT_Field;
-- Read-only. Week day units
WDU : TSDR_WDU_Field;
-- unspecified
Reserved_16_31 : STM32_SVD.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TSDR_Register use record
DU at 0 range 0 .. 3;
DT at 0 range 4 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
MU at 0 range 8 .. 11;
MT at 0 range 12 .. 12;
WDU at 0 range 13 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype TSSSR_SS_Field is STM32_SVD.UInt16;
-- RTC time-stamp sub second register
type TSSSR_Register is record
-- Read-only. Sub second value
SS : TSSSR_SS_Field;
-- unspecified
Reserved_16_31 : STM32_SVD.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TSSSR_Register use record
SS at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CALR_CALM_Field is STM32_SVD.UInt9;
subtype CALR_CALW16_Field is STM32_SVD.Bit;
subtype CALR_CALW8_Field is STM32_SVD.Bit;
subtype CALR_CALP_Field is STM32_SVD.Bit;
-- RTC calibration register
type CALR_Register is record
-- Calibration minus
CALM : CALR_CALM_Field := 16#0#;
-- unspecified
Reserved_9_12 : STM32_SVD.UInt4 := 16#0#;
-- Use a 16-second calibration cycle period
CALW16 : CALR_CALW16_Field := 16#0#;
-- Use a 8-second calibration cycle period
CALW8 : CALR_CALW8_Field := 16#0#;
-- Increase frequency of RTC by 488.5 ppm
CALP : CALR_CALP_Field := 16#0#;
-- unspecified
Reserved_16_31 : STM32_SVD.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CALR_Register use record
CALM at 0 range 0 .. 8;
Reserved_9_12 at 0 range 9 .. 12;
CALW16 at 0 range 13 .. 13;
CALW8 at 0 range 14 .. 14;
CALP at 0 range 15 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype TAMPCR_TAMP1E_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP1TRG_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMPIE_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP2E_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP2_TRG_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMPTS_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMPFREQ_Field is STM32_SVD.UInt3;
subtype TAMPCR_TAMPFLT_Field is STM32_SVD.UInt2;
subtype TAMPCR_TAMPPRCH_Field is STM32_SVD.UInt2;
subtype TAMPCR_TAMPPUDIS_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP1IE_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP1NOERASE_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP1MF_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP2IE_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP2NOERASE_Field is STM32_SVD.Bit;
subtype TAMPCR_TAMP2MF_Field is STM32_SVD.Bit;
-- RTC tamper configuration register
type TAMPCR_Register is record
-- RTC_TAMP1 input detection enable
TAMP1E : TAMPCR_TAMP1E_Field := 16#0#;
-- Active level for RTC_TAMP1 input
TAMP1TRG : TAMPCR_TAMP1TRG_Field := 16#0#;
-- Tamper interrupt enable
TAMPIE : TAMPCR_TAMPIE_Field := 16#0#;
-- RTC_TAMP2 input detection enable
TAMP2E : TAMPCR_TAMP2E_Field := 16#0#;
-- Active level for RTC_TAMP2 input
TAMP2_TRG : TAMPCR_TAMP2_TRG_Field := 16#0#;
-- unspecified
Reserved_5_6 : STM32_SVD.UInt2 := 16#0#;
-- Activate timestamp on tamper detection event
TAMPTS : TAMPCR_TAMPTS_Field := 16#0#;
-- Tamper sampling frequency
TAMPFREQ : TAMPCR_TAMPFREQ_Field := 16#0#;
-- RTC_TAMPx filter count
TAMPFLT : TAMPCR_TAMPFLT_Field := 16#0#;
-- RTC_TAMPx precharge duration
TAMPPRCH : TAMPCR_TAMPPRCH_Field := 16#0#;
-- RTC_TAMPx pull-up disable
TAMPPUDIS : TAMPCR_TAMPPUDIS_Field := 16#0#;
-- Tamper 1 interrupt enable
TAMP1IE : TAMPCR_TAMP1IE_Field := 16#0#;
-- Tamper 1 no erase
TAMP1NOERASE : TAMPCR_TAMP1NOERASE_Field := 16#0#;
-- Tamper 1 mask flag
TAMP1MF : TAMPCR_TAMP1MF_Field := 16#0#;
-- Tamper 2 interrupt enable
TAMP2IE : TAMPCR_TAMP2IE_Field := 16#0#;
-- Tamper 2 no erase
TAMP2NOERASE : TAMPCR_TAMP2NOERASE_Field := 16#0#;
-- Tamper 2 mask flag
TAMP2MF : TAMPCR_TAMP2MF_Field := 16#0#;
-- unspecified
Reserved_22_31 : STM32_SVD.UInt10 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TAMPCR_Register use record
TAMP1E at 0 range 0 .. 0;
TAMP1TRG at 0 range 1 .. 1;
TAMPIE at 0 range 2 .. 2;
TAMP2E at 0 range 3 .. 3;
TAMP2_TRG at 0 range 4 .. 4;
Reserved_5_6 at 0 range 5 .. 6;
TAMPTS at 0 range 7 .. 7;
TAMPFREQ at 0 range 8 .. 10;
TAMPFLT at 0 range 11 .. 12;
TAMPPRCH at 0 range 13 .. 14;
TAMPPUDIS at 0 range 15 .. 15;
TAMP1IE at 0 range 16 .. 16;
TAMP1NOERASE at 0 range 17 .. 17;
TAMP1MF at 0 range 18 .. 18;
TAMP2IE at 0 range 19 .. 19;
TAMP2NOERASE at 0 range 20 .. 20;
TAMP2MF at 0 range 21 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
subtype ALRMASSR_SS_Field is STM32_SVD.UInt15;
subtype ALRMASSR_MASKSS_Field is STM32_SVD.UInt4;
-- RTC alarm A sub second register
type ALRMASSR_Register is record
-- Sub seconds value
SS : ALRMASSR_SS_Field := 16#0#;
-- unspecified
Reserved_15_23 : STM32_SVD.UInt9 := 16#0#;
-- Mask the most-significant bits starting at this bit
MASKSS : ALRMASSR_MASKSS_Field := 16#0#;
-- unspecified
Reserved_28_31 : STM32_SVD.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ALRMASSR_Register use record
SS at 0 range 0 .. 14;
Reserved_15_23 at 0 range 15 .. 23;
MASKSS at 0 range 24 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype ALRMBSSR_SS_Field is STM32_SVD.UInt15;
subtype ALRMBSSR_MASKSS_Field is STM32_SVD.UInt4;
-- RTC alarm B sub second register
type ALRMBSSR_Register is record
-- Sub seconds value
SS : ALRMBSSR_SS_Field := 16#0#;
-- unspecified
Reserved_15_23 : STM32_SVD.UInt9 := 16#0#;
-- Mask the most-significant bits starting at this bit
MASKSS : ALRMBSSR_MASKSS_Field := 16#0#;
-- unspecified
Reserved_28_31 : STM32_SVD.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ALRMBSSR_Register use record
SS at 0 range 0 .. 14;
Reserved_15_23 at 0 range 15 .. 23;
MASKSS at 0 range 24 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype OR_RTC_ALARM_TYPE_Field is STM32_SVD.Bit;
subtype OR_RTC_OUT_RMP_Field is STM32_SVD.Bit;
-- option register
type OR_Register is record
-- RTC_ALARM on PC13 output type
RTC_ALARM_TYPE : OR_RTC_ALARM_TYPE_Field := 16#0#;
-- RTC_ALARM on PC13 output type
RTC_OUT_RMP : OR_RTC_OUT_RMP_Field := 16#0#;
-- unspecified
Reserved_2_31 : STM32_SVD.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OR_Register use record
RTC_ALARM_TYPE at 0 range 0 .. 0;
RTC_OUT_RMP at 0 range 1 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Real-time clock
type RTC_Peripheral is record
-- RTC time register
TR : aliased TR_Register;
-- RTC date register
DR : aliased DR_Register;
-- RTC control register
CR : aliased CR_Register;
-- RTC initialization and status register
ISR : aliased ISR_Register;
-- RTC prescaler register
PRER : aliased PRER_Register;
-- RTC wakeup timer register
WUTR : aliased WUTR_Register;
-- RTC alarm A register
ALRMAR : aliased ALRMAR_Register;
-- RTC alarm B register
ALRMBR : aliased ALRMBR_Register;
-- write protection register
WPR : aliased WPR_Register;
-- RTC sub second register
SSR : aliased SSR_Register;
-- RTC shift control register
SHIFTR : aliased SHIFTR_Register;
-- RTC timestamp time register
TSTR : aliased TSTR_Register;
-- RTC timestamp date register
TSDR : aliased TSDR_Register;
-- RTC time-stamp sub second register
TSSSR : aliased TSSSR_Register;
-- RTC calibration register
CALR : aliased CALR_Register;
-- RTC tamper configuration register
TAMPCR : aliased TAMPCR_Register;
-- RTC alarm A sub second register
ALRMASSR : aliased ALRMASSR_Register;
-- RTC alarm B sub second register
ALRMBSSR : aliased ALRMBSSR_Register;
-- option register
OR_k : aliased OR_Register;
-- RTC backup registers
BKP0R : aliased STM32_SVD.UInt32;
-- RTC backup registers
BKP1R : aliased STM32_SVD.UInt32;
-- RTC backup registers
BKP2R : aliased STM32_SVD.UInt32;
-- RTC backup registers
BKP3R : aliased STM32_SVD.UInt32;
-- RTC backup registers
BKP4R : aliased STM32_SVD.UInt32;
end record
with Volatile;
for RTC_Peripheral use record
TR at 16#0# range 0 .. 31;
DR at 16#4# range 0 .. 31;
CR at 16#8# range 0 .. 31;
ISR at 16#C# range 0 .. 31;
PRER at 16#10# range 0 .. 31;
WUTR at 16#14# range 0 .. 31;
ALRMAR at 16#1C# range 0 .. 31;
ALRMBR at 16#20# range 0 .. 31;
WPR at 16#24# range 0 .. 31;
SSR at 16#28# range 0 .. 31;
SHIFTR at 16#2C# range 0 .. 31;
TSTR at 16#30# range 0 .. 31;
TSDR at 16#34# range 0 .. 31;
TSSSR at 16#38# range 0 .. 31;
CALR at 16#3C# range 0 .. 31;
TAMPCR at 16#40# range 0 .. 31;
ALRMASSR at 16#44# range 0 .. 31;
ALRMBSSR at 16#48# range 0 .. 31;
OR_k at 16#4C# range 0 .. 31;
BKP0R at 16#50# range 0 .. 31;
BKP1R at 16#54# range 0 .. 31;
BKP2R at 16#58# range 0 .. 31;
BKP3R at 16#5C# range 0 .. 31;
BKP4R at 16#60# range 0 .. 31;
end record;
-- Real-time clock
RTC_Periph : aliased RTC_Peripheral
with Import, Address => RTC_Base;
end STM32_SVD.RTC;
|
reznikmm/matreshka | Ada | 4,083 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Style_Text_Overline_Color_Attributes;
package Matreshka.ODF_Style.Text_Overline_Color_Attributes is
type Style_Text_Overline_Color_Attribute_Node is
new Matreshka.ODF_Style.Abstract_Style_Attribute_Node
and ODF.DOM.Style_Text_Overline_Color_Attributes.ODF_Style_Text_Overline_Color_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Style_Text_Overline_Color_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Style_Text_Overline_Color_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Style.Text_Overline_Color_Attributes;
|
LionelDraghi/smk | Ada | 18,523 | adb | -- -----------------------------------------------------------------------------
-- smk, the smart make (http://lionel.draghi.free.fr/smk/)
-- © 2018, 2019 Lionel Draghi <[email protected]>
-- SPDX-License-Identifier: APSL-2.0
-- -----------------------------------------------------------------------------
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
-- http://www.apache.org/licenses/LICENSE-2.0
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- -----------------------------------------------------------------------------
with Ada.Directories;
with Ada.Streams.Stream_IO;
with Ada.Strings.Fixed;
with Smk.IO;
with Smk.Settings;
package body Smk.Runfiles is
-- --------------------------------------------------------------------------
Run_Fl : Ada.Streams.Stream_IO.File_Type;
-- --------------------------------------------------------------------------
function Section_Image (Section : Section_Names) return String is
("[" & (+Section) & "]");
function Command_Image (Command : Command_Lines) return String is
("""" & (+Command) & """");
function Time_Image (Time : Ada.Calendar.Time) return String is
("[" & IO.Image (Time) & "]");
-- --------------------------------------------------------------------------
function Command_Image (Command : Command_Lines;
Run : Runfiles.Run) return String is
begin
if +Run.Section = "" then
return ("Command " & Command_Image (Command)
& ", last run " & Time_Image (Run.Run_Time));
else
return ("Command " & Command_Image (Command)
& " in section " & Section_Image (Run.Section)
& ", last run " & Time_Image (Run.Run_Time));
end if;
end Command_Image;
-- --------------------------------------------------------------------------
procedure Put_File (C : Condition;
Print_Sources : Boolean := False;
Print_Targets : Boolean := False;
Print_Unused : Boolean := False;
Prefix : String := "") is
begin
if not (Settings.Filter_Sytem_Files and Files.Is_System (C.File))
then
if (Print_Sources and then Files.Is_Source (C.File))
or else (Print_Targets and then Files.Is_Target (C.File))
or else (Print_Unused and then Files.Is_Unused (C.File))
then
IO.Put_Line (Prefix & Image (C) & File_Image (C.Name, C.File));
end if;
end if;
end Put_File;
-- --------------------------------------------------------------------------
procedure Put_Files (A : Condition_Lists.List;
Print_Sources : Boolean := False;
Print_Targets : Boolean := False;
Print_Unused : Boolean := False;
Prefix : String := "") is
begin
for C of A loop
Put_File (C,
Print_Sources,
Print_Targets,
Print_Unused,
Prefix);
end loop;
end Put_Files;
-- --------------------------------------------------------------------------
procedure Put_Files (The_Runfile : Runfile;
Print_Sources : Boolean := False;
Print_Targets : Boolean := False;
Print_Unused : Boolean := False) is
use Run_Lists;
begin
for R in The_Runfile.Run_List.Iterate loop
declare
Prefix : constant String
:= (if Settings.Long_Listing_Format
then Command_Image (Key (R)) & " " &
Section_Image (Element (R).Section) & " "
else "");
begin
Put_Files (Element (R).Assertions,
Print_Sources,
Print_Targets,
Print_Unused,
Prefix);
end;
end loop;
end Put_Files;
-- --------------------------------------------------------------------------
procedure Put_Updated (Cond_List : in Assertions.Condition_Lists.List) is
Something_Updated : Boolean := False;
begin
for C of Cond_List loop
declare
Name : File_Name renames C.Name;
File : File_Type renames C.File;
begin
if Role (File) /= Unused and Status (File) /= Identical then
-- unused files are ignored
if Settings.Long_Listing_Format then
-- normal behavior
IO.Put_Line (File_Image (Name, File));
Something_Updated := True;
else
-- Even if in short form, we want to print the Status field
IO.Put_Line
(File_Image (Name, File,
Prefix => "[" & Status_Image (Status (File)) & "] "
& "[" & Role_Image (Role (File)) & "] "));
Something_Updated := True;
end if;
end if;
end;
end loop;
if not Something_Updated then
IO.Put_Line ("Nothing new");
end if;
end Put_Updated;
-- --------------------------------------------------------------------------
procedure Put_Run (Run_List : in Run_Lists.Map) is
use type Ada.Containers.Count_Type;
begin
if Run_List.Length = 0 then
IO.Put_Line ("No recorded run");
return;
end if;
for L in Run_List.Iterate loop
declare
Run : constant Runfiles.Run := Run_Lists.Element (L);
SC : constant File_Count := Count
(Run.Assertions,
Count_Sources => True,
With_System_Files => (not Settings.Filter_Sytem_Files));
TC : constant File_Count := Count
(Run.Assertions,
Count_Targets => True,
With_System_Files => (not Settings.Filter_Sytem_Files));
SC_Image : constant String := Count_Image (SC);
TC_Image : constant String := Count_Image (TC);
begin
IO.Put_Line (Command_Image (Run_Lists.Key (L), Run));
IO.Put_Line (" Sources: (" & SC_Image & ")");
Put_Files (Run.Assertions,
Print_Sources => True,
Prefix => " - ");
IO.Put_Line (" Targets: (" & TC_Image & ")");
Put_Files (Run.Assertions,
Print_Targets => True,
Prefix => " - ");
IO.New_Line;
end;
end loop;
end Put_Run;
-- --------------------------------------------------------------------------
procedure Dump (The_Runfile : Runfile) is
begin
-- Force long format, show all and don't shorten
Settings.Long_Listing_Format := True;
Settings.Shorten_File_Names := False;
Settings.Filter_Sytem_Files := False;
for R in The_Runfile.Run_List.Iterate loop
declare
use Run_Lists;
Run : constant Runfiles.Run := Element (R);
begin
IO.Put_Line (Command_Image (Key (R), Run));
for A of Run.Assertions loop
IO.Put_Line (Image (A) & File_Image (A.Name, A.File));
end loop;
end;
end loop;
end Dump;
-- --------------------------------------------------------------------------
function Get_File_List (The_Runfile : Runfile) return File_Lists.Map is
List : File_Lists.Map;
begin
for R of The_Runfile.Run_List loop
for A of R.Assertions loop
if not List.Contains (A.Name) then
List.Insert (Key => A.Name,
New_Item => Create (File => A.Name,
Role => Unused));
-- IO.Put_Line ("Inserting " & File_Image (A.Name, A.File));
end if;
end loop;
end loop;
return List;
end Get_File_List;
-- --------------------------------------------------------------------------
function Get_Dir_List (From : File_Lists.Map) return File_Lists.Map is
List : File_Lists.Map;
use File_Lists;
begin
for F in From.Iterate loop
declare
Name : File_Name renames Key (F);
File : File_Type renames Element (F);
begin
-- IO.Put_Line ("Get_Dir_List (" & (+Name) & ")");
if not List.Contains (Name) and then Is_Dir (File) then
List.Insert (Key => Name,
New_Item => File);
-- IO.Put_Line ("Extracting dir " & File_Image (Name, File));
end if;
end;
end loop;
return List;
end Get_Dir_List;
-- --------------------------------------------------------------------------
procedure Update_Files_Status (Assertions : in out Condition_Lists.List;
Updated_List : in out Condition_Lists.List) is
use Smk.Assertions.Condition_Lists;
begin
-- -----------------------------------------------------------------------
for A of Assertions loop
declare
Previous_Status : File_Status;
Current_Status : File_Status;
Name : File_Name renames A.Name;
File : File_Type renames A.File;
begin
Files.Update_File_Status (Name, File,
Previous_Status, Current_Status);
if Current_Status /= Identical
and then not Updated_List.Contains (A)
then
Updated_List.Append (A);
if Previous_Status /= Current_Status then
IO.Put_Line
(+Name & " status changed from "
& Files.Status_Image (Previous_Status) & " to "
& Files.Status_Image (Current_Status),
Level => IO.Debug);
end if;
end if;
end;
end loop;
Name_Sorting.Sort (Updated_List);
end Update_Files_Status;
-- --------------------------------------------------------------------------
procedure Update_Files_Status (In_Run_List : in out Run_Lists.Map;
Updated_List : in out Condition_Lists.List) is
begin
for R of In_Run_List loop
Update_Files_Status (R.Assertions, Updated_List);
end loop;
end Update_Files_Status;
-- --------------------------------------------------------------------------
procedure Delete_Targets (The_Runfile : in Runfile) is
use Ada.Directories;
-- -----------------------------------------------------------------------
procedure Delete (P : Condition;
Delete_Dir : Boolean := False;
Delete_File : Boolean := False) is
Name : constant String := +P.Name;
begin
if Is_Target (P.File) then
if Exists (Name) then
if Is_Dir (Name) then
if Delete_Dir then
IO.Put_Line ("Deleting dir " & Shorten (P.Name));
if not Settings.Dry_Run then
begin
Delete_Directory (Name);
exception
when Use_Error => null; -- the dir is not empty
end;
end if;
end if;
else -- not a dir
if Delete_File then
IO.Put_Line ("Deleting file " & Shorten (P.Name));
if not Settings.Dry_Run then
Ada.Directories.Delete_File (Name);
end if;
end if;
end if;
end if;
else
IO.Put_Line ("Target to delete not found : " & (+P.Name),
Level => Settings.Verbose);
end if;
end Delete;
begin
-- -----------------------------------------------------------------------
for R of The_Runfile.Run_List loop
for P of R.Assertions loop
Delete (P, Delete_File => True);
end loop;
end loop;
-- Fixme: directories are erased after files to avoid a rmdir fail
-- because of a file present in the dir, that will be erased after.
-- But this is still wrong as we dont erase dir in a smart order,
-- and we may try to delete dir1 before dir1/dir2.
for R of The_Runfile.Run_List loop
for P of R.Assertions loop
Delete (P, Delete_Dir => True);
end loop;
end loop;
end Delete_Targets;
-- --------------------------------------------------------------------------
function Has_Target (The_Run_List : Run_Lists.Map;
Target : String) return Boolean is
begin
-- -----------------------------------------------------------------------
if Target = "" then return False; end if;
for R of The_Run_List loop
for P of R.Assertions loop
if Is_Target (P.File) and then Has_Target (P.Name, Target) then
return True;
end if;
end loop;
end loop;
return False;
end Has_Target;
-- --------------------------------------------------------------------------
procedure Insert_Or_Update (The_Command : in Command_Lines;
The_Run : in Run;
In_Run_List : in out Run_Lists.Map) is
begin
if In_Run_List.Contains (The_Command) then
In_Run_List.Replace (Key => The_Command,
New_Item => The_Run);
else
In_Run_List.Insert (Key => The_Command,
New_Item => The_Run);
end if;
end Insert_Or_Update;
-- --------------------------------------------------------------------------
function Runfiles_Found return Boolean is
begin
return Ada.Directories.Exists (Settings.Runfile_Name);
end Runfiles_Found;
-- --------------------------------------------------------------------------
function Get_Saved_Run (Runfile_Name : in File_Name) return Runfile is
use Ada.Streams.Stream_IO;
The_Runfile : Runfile;
S : Stream_Access;
begin
Open (Name => +Runfile_Name,
File => Run_Fl,
Mode => In_File);
S := Stream (Run_Fl);
The_Runfile := Runfile'Input (S);
Close (Run_Fl);
return The_Runfile;
end Get_Saved_Run;
-- --------------------------------------------------------------------------
function Load_Runfile return Runfile is
The_Runfile : Runfile;
use Settings;
begin
if Runfiles_Found then
The_Runfile := Get_Saved_Run (+To_Runfile_Name (Smkfile_Name));
else
The_Runfile := (Smkfile_Name => +Smkfile_Name,
Run_List => Run_Lists.Empty_Map);
end if;
return The_Runfile;
end Load_Runfile;
-- --------------------------------------------------------------------------
procedure Save_Run (The_Run : in Runfile) is
use Ada.Streams.Stream_IO;
S : Stream_Access;
use Settings;
begin
Create (Name => To_Runfile_Name (+The_Run.Smkfile_Name),
File => Run_Fl,
Mode => Out_File);
S := Stream (Run_Fl);
Runfile'Output (S, The_Run);
Close (Run_Fl);
end Save_Run;
-- --------------------------------------------------------------------------
procedure Clean_Run_Files is
use Ada.Directories;
Search : Search_Type;
File : Directory_Entry_Type;
begin
Start_Search (Search,
Directory => ".",
Pattern => Settings.Smk_File_Prefix & "*",
Filter => (Ordinary_File => True,
others => False));
while More_Entries (Search) loop
Get_Next_Entry (Search, File);
IO.Put_Line ("Deleting " & Simple_Name (File));
Delete_File (Simple_Name (File));
end loop;
end Clean_Run_Files;
-- --------------------------------------------------------------------------
function Get_Run_List return File_Lists.Map is
use Ada.Directories;
Search : Search_Type;
File : Directory_Entry_Type;
The_List : File_Lists.Map;
begin
Start_Search (Search,
Directory => ".",
Pattern => Settings.Smk_File_Prefix & "*",
Filter => (Ordinary_File => True,
others => False));
while More_Entries (Search) loop
Get_Next_Entry (Search, File);
declare
Prefix_Length : constant Natural := Settings.Smk_File_Prefix'Length;
Run_Fl_Name : constant String := Simple_Name (File);
Smkfile_Name : constant String := Ada.Strings.Fixed.Delete
(Source => Run_Fl_Name,
From => Run_Fl_Name'First,
Through => Run_Fl_Name'First + Prefix_Length - 1);
-- removing File_Prefix
begin
The_List.Insert (Key => +Smkfile_Name,
New_Item => Create (+Smkfile_Name, Unused));
end;
end loop;
return The_List;
end Get_Run_List;
-- --------------------------------------------------------------------------
procedure Put_Run_List is
use File_Lists;
Run_List : constant File_Lists.Map := Runfiles.Get_Run_List;
use type Ada.Containers.Count_Type;
begin
if Run_List.Length = 0 then
IO.Put_Line ("No run file");
else
for F in Run_List.Iterate loop
IO.Put_Line (+Key (F));
end loop;
end if;
end Put_Run_List;
end Smk.Runfiles;
|
zhmu/ananas | Ada | 10,303 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- G N A T . S E C U R E _ H A S H E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides common supporting code for a family of secure
-- hash functions (including MD5 and the FIPS PUB 180-3 functions SHA-1,
-- SHA-224, SHA-256, SHA-384 and SHA-512).
-- This is an internal unit and should be not used directly in applications.
-- Use GNAT.MD5 and GNAT.SHA* instead.
with Ada.Streams; use Ada.Streams;
with Interfaces;
with System;
package GNAT.Secure_Hashes is
type Buffer_Type is new Stream_Element_Array;
for Buffer_Type'Alignment use 8;
-- Secure hash functions use a string buffer that is also accessed as an
-- array of words, which may require up to 64 bit alignment.
-- The function-independent part of processing state: A buffer of data
-- being accumulated until a complete block is ready for hashing.
type Message_State (Block_Length : Stream_Element_Count) is record
Last : Stream_Element_Offset := 0;
-- Index of last used element in Buffer
Length : Interfaces.Unsigned_64 := 0;
-- Total length of processed data
Buffer : Buffer_Type (1 .. Block_Length);
-- Data buffer
end record;
-- The function-specific part of processing state:
-- Each hash function maintains an internal state as an array of words,
-- which is ultimately converted to a stream representation with the
-- appropriate bit order.
generic
type Word is mod <>;
-- Either 32 or 64 bits
with procedure Swap (X : System.Address);
-- Byte swapping function for a Word at X
Hash_Bit_Order : System.Bit_Order;
-- Bit order of the produced hash
package Hash_Function_State is
type State is array (Stream_Element_Offset range <>) of Word;
-- Used to store a hash function's internal state
procedure To_Hash
(H : State;
H_Bits : out Stream_Element_Array);
-- Convert H to stream representation with the given bit order. If
-- H_Bits is smaller than the internal hash state, then the state
-- is truncated.
end Hash_Function_State;
-- Generic hashing framework: The user interface for each implemented
-- secure hash function is an instance of this generic package.
generic
Block_Words : Stream_Element_Count;
-- Number of words in each block
State_Words : Stream_Element_Count;
-- Number of words in internal state
Hash_Words : Stream_Element_Count;
-- Number of words in the final hash (must be no greater than
-- State_Words).
Hash_Bit_Order : System.Bit_Order;
-- Bit order used for conversion between bit representation and word
-- representation.
with package Hash_State is new Hash_Function_State (<>);
-- Hash function state package
Initial_State : Hash_State.State;
-- Initial value of the hash function state
with procedure Transform
(H : in out Hash_State.State;
M : in out Message_State);
-- Transformation function updating H by processing a complete data
-- block from M.
package H is
-- The visible part of H is the interface to secure hashing functions
-- that is exposed to user applications, and is intended to remain
-- a stable interface.
pragma Assert (Hash_Words <= State_Words);
type Context is private;
-- The internal processing state of the hashing function
function "=" (L, R : Context) return Boolean is abstract;
-- Context is the internal, implementation defined intermediate state
-- in a hash computation, and no specific semantics can be expected on
-- equality of context values. Only equality of final hash values (as
-- returned by the [Wide_]Digest functions below) is meaningful.
Initial_Context : constant Context;
-- Initial value of a Context object. May be used to reinitialize
-- a Context value by simple assignment of this value to the object.
function HMAC_Initial_Context (Key : String) return Context;
-- Initial Context for HMAC computation with the given Key
procedure Update (C : in out Context; Input : String);
procedure Wide_Update (C : in out Context; Input : Wide_String);
procedure Update
(C : in out Context;
Input : Stream_Element_Array);
-- Update C to process the given input. Successive calls to Update are
-- equivalent to a single call with the concatenation of the inputs. For
-- the Wide_String version, each Wide_Character is processed low order
-- byte first.
Word_Length : constant Stream_Element_Offset := Hash_State.Word'Size / 8;
Hash_Length : constant Stream_Element_Offset := Hash_Words * Word_Length;
subtype Binary_Message_Digest is Stream_Element_Array (1 .. Hash_Length);
-- The fixed-length byte array returned by Digest, providing
-- the hash in binary representation.
function Digest (C : Context) return Binary_Message_Digest;
-- Return hash or HMAC for the data accumulated with C
function Digest (S : String) return Binary_Message_Digest;
function Wide_Digest (W : Wide_String) return Binary_Message_Digest;
function Digest
(A : Stream_Element_Array) return Binary_Message_Digest;
-- These functions are equivalent to the corresponding Update (or
-- Wide_Update) on a default initialized Context, followed by Digest
-- on the resulting Context.
subtype Message_Digest is String (1 .. 2 * Integer (Hash_Length));
-- The fixed-length string returned by Digest, providing the hash in
-- hexadecimal representation.
function Digest (C : Context) return Message_Digest;
-- Return hash or HMAC for the data accumulated with C in hexadecimal
-- representation.
function Digest (S : String) return Message_Digest;
function Wide_Digest (W : Wide_String) return Message_Digest;
function Digest (A : Stream_Element_Array) return Message_Digest;
-- These functions are equivalent to the corresponding Update (or
-- Wide_Update) on a default initialized Context, followed by Digest
-- on the resulting Context.
type Hash_Stream (C : access Context) is
new Root_Stream_Type with private;
-- Stream wrapper converting Write calls to Update calls on C.
-- Arbitrary data structures can thus be conveniently hashed using
-- their stream attributes.
private
Block_Length : constant Stream_Element_Count :=
Block_Words * Word_Length;
-- Length in bytes of a data block
subtype Key_Length is
Stream_Element_Offset range 0 .. Block_Length;
-- KL is 0 for a normal hash context, > 0 for HMAC
type Context (KL : Key_Length := 0) is record
H_State : Hash_State.State (0 .. State_Words - 1) := Initial_State;
-- Function-specific state
M_State : Message_State (Block_Length);
-- Function-independent state (block buffer)
Key : Stream_Element_Array (1 .. KL);
-- HMAC key
end record;
pragma Warnings (Off, "aggregate not fully initialized");
Initial_Context : constant Context (KL => 0) := (others => <>);
pragma Warnings (On, "aggregate not fully initialized");
-- Initial values are provided by default initialization of Context
type Hash_Stream (C : access Context) is
new Root_Stream_Type with null record;
procedure Read
(Stream : in out Hash_Stream;
Item : out Stream_Element_Array;
Last : out Stream_Element_Offset);
-- Raise Program_Error: hash streams are write-only
procedure Write
(Stream : in out Hash_Stream;
Item : Stream_Element_Array);
-- Call Update
end H;
end GNAT.Secure_Hashes;
|
OneWingedShark/Byron | Ada | 222 | ads | Pragma Ada_2012;
Pragma Assertion_Policy( Check );
With
Lexington.Token_Vector_Pkg;
-- Generates the Comment_Info/Comment_Section/Comment_Block tokens.
Procedure Lexington.Aux.P17(Data : in out Token_Vector_Pkg.Vector);
|
reznikmm/matreshka | Ada | 3,981 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Fo_Border_Top_Attributes;
package Matreshka.ODF_Fo.Border_Top_Attributes is
type Fo_Border_Top_Attribute_Node is
new Matreshka.ODF_Fo.Abstract_Fo_Attribute_Node
and ODF.DOM.Fo_Border_Top_Attributes.ODF_Fo_Border_Top_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Fo_Border_Top_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Fo_Border_Top_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Fo.Border_Top_Attributes;
|
peterfrankjohnson/assembler | Ada | 33 | ads | package Register is
end Register; |
charlie5/cBound | Ada | 1,558 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_install_colormap_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
cmap : aliased xcb.xcb_colormap_t;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_install_colormap_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_install_colormap_request_t.Item,
Element_Array => xcb.xcb_install_colormap_request_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_install_colormap_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_install_colormap_request_t.Pointer,
Element_Array => xcb.xcb_install_colormap_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_install_colormap_request_t;
|
zhmu/ananas | Ada | 3,124 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- SYSTEM.MULTIPROCESSORS.DISPATCHING_DOMAINS --
-- --
-- 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.Real_Time;
with Ada.Task_Identification;
private with System.Tasking;
package System.Multiprocessors.Dispatching_Domains is
-- pragma Preelaborate (Dispatching_Domains);
-- ??? According to AI 167 this unit should be preelaborate, but it cannot
-- be preelaborate because it depends on Ada.Real_Time which is not
-- preelaborate.
Dispatching_Domain_Error : exception;
type Dispatching_Domain (<>) is limited private;
System_Dispatching_Domain : constant Dispatching_Domain;
function Create (First : CPU; Last : CPU_Range) return Dispatching_Domain;
function Get_First_CPU (Domain : Dispatching_Domain) return CPU;
function Get_Last_CPU (Domain : Dispatching_Domain) return CPU_Range;
type CPU_Set is array (CPU range <>) of Boolean;
function Create (Set : CPU_Set) return Dispatching_Domain;
function Get_CPU_Set (Domain : Dispatching_Domain) return CPU_Set;
function Get_Dispatching_Domain
(T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) return Dispatching_Domain;
procedure Assign_Task
(Domain : in out Dispatching_Domain;
CPU : CPU_Range := Not_A_Specific_CPU;
T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task);
procedure Set_CPU
(CPU : CPU_Range;
T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task);
function Get_CPU
(T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) return CPU_Range;
procedure Delay_Until_And_Set_CPU
(Delay_Until_Time : Ada.Real_Time.Time;
CPU : CPU_Range);
private
type Dispatching_Domain is new System.Tasking.Dispatching_Domain_Access;
System_Dispatching_Domain : constant Dispatching_Domain :=
Dispatching_Domain
(System.Tasking.System_Domain);
end System.Multiprocessors.Dispatching_Domains;
|
stcarrez/ada-asf | Ada | 988 | ads | -----------------------------------------------------------------------
-- asf -- Ada Server Faces
-- Copyright (C) 2009, 2010 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
-- Ada Server Faces is an adapted implementation of JSR 252,
-- the Java Server Faces for Ada 2005.
package ASF is
pragma Pure;
end ASF;
|
charlie5/lace | Ada | 1,222 | ads | with
openGL.Program.lit.colored_skinned;
package openGL.Geometry.lit_colored_skinned
--
-- Supports per-vertex site color, texture, lighting and skinning.
--
is
type Item is new openGL.Geometry.item with private;
type View is access all Item'Class;
function new_Geometry return View;
procedure define_Program;
----------
-- Vertex
--
type Vertex is
record
Site : Vector_3;
Normal : Vector_3;
Color : rgba_Color;
Shine : Real;
bone_Ids : Vector_4;
bone_Weights : Vector_4;
end record;
pragma Convention (C, Vertex);
type Vertex_array is array (long_Index_t range <>) of aliased Vertex;
--------------
-- Attributes
--
procedure Vertices_are (Self : in out Item; Now : in Vertex_array);
overriding
procedure Indices_are (Self : in out Item; Now : in Indices;
for_Facia : in Positive);
function Program return openGL.Program.lit.colored_skinned.view;
private
type Item is new Geometry.item with null record;
overriding
procedure enable_Texture (Self : in Item);
end openGL.Geometry.lit_colored_skinned;
|
pmderodat/sdlada | Ada | 8,234 | ads | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2018 Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.Video.Windows
--
-- Operating system window access and control.
--------------------------------------------------------------------------------------------------------------------
with Ada.Finalization;
with Ada.Strings.UTF_Encoding;
private with SDL.C_Pointers;
with SDL.Video.Displays;
with SDL.Video.Pixel_Formats;
with SDL.Video.Rectangles;
with SDL.Video.Surfaces;
with System;
package SDL.Video.Windows is
Window_Error : exception;
-- Return a special coordinate value to indicate that you don't care what
-- the window position is. Note that you can still specify a target
-- display.
function Undefined_Window_Position
(Display : Natural := 0) return SDL.Natural_Coordinate;
-- Return a special coordinate value to indicate that the window position
-- should be centered.
function Centered_Window_Position
(Display : Natural := 0) return SDL.Natural_Coordinate;
type Window_Flags is mod 2 ** 32 with
Convention => C;
Windowed : constant Window_Flags := 16#0000_0000#;
Full_Screen : constant Window_Flags := 16#0000_0001#;
OpenGL : constant Window_Flags := 16#0000_0002#;
Shown : constant Window_Flags := 16#0000_0004#;
Hidden : constant Window_Flags := 16#0000_0008#;
Borderless : constant Window_Flags := 16#0000_0010#;
Resizable : constant Window_Flags := 16#0000_0020#;
Minimised : constant Window_Flags := 16#0000_0040#;
Maximised : constant Window_Flags := 16#0000_0080#;
Input_Grabbed : constant Window_Flags := 16#0000_0100#;
Input_Focus : constant Window_Flags := 16#0000_0200#;
Mouse_Focus : constant Window_Flags := 16#0000_0400#;
Full_Screen_Desktop : constant Window_Flags := Full_Screen or 16#0000_1000#;
Foreign : constant Window_Flags := 16#0000_0800#; -- TODO: Not implemented yet.
-- TODO: This isn't raising any exception when I pass a different value for some reason.
subtype Full_Screen_Flags is Window_Flags with
Static_Predicate => Full_Screen_Flags in Windowed | Full_Screen | Full_Screen_Desktop;
type ID is mod 2 ** 32 with
Convention => C;
type Native_Window is private;
-- Allow users to derive new types from this.
type User_Data is tagged private;
type User_Data_Access is access all User_Data'Class;
-- TODO: Check this type!
type Brightness is digits 3 range 0.0 .. 1.0;
-- type Window is tagged limited Private;
type Window is new Ada.Finalization.Limited_Controlled with private;
Null_Window : constant Window;
-- TODO: Normalise the API by adding a destroy sub program and making this one call destroy,
-- see textures for more info.
overriding
procedure Finalize (Self : in out Window);
function Get_Brightness (Self : in Window) return Brightness with
Inline => True;
procedure Set_Brightness (Self : in out Window; How_Bright : in Brightness);
function Get_Data (Self : in Window; Name : in String) return User_Data_Access;
function Set_Data (Self : in out Window; Name : in String; Item : in User_Data_Access) return User_Data_Access;
function Display_Index (Self : in Window) return Positive;
procedure Get_Display_Mode (Self : in Window; Mode : out SDL.Video.Displays.Mode);
procedure Set_Display_Mode (Self : in out Window; Mode : in SDL.Video.Displays.Mode);
function Get_Flags (Self : in Window) return Window_Flags;
function From_ID (Window_ID : in ID) return Window;
procedure Get_Gamma_Ramp (Self : in Window; Red, Green, Blue : out SDL.Video.Pixel_Formats.Gamma_Ramp);
procedure Set_Gamma_Ramp (Self : in out Window; Red, Green, Blue : in SDL.Video.Pixel_Formats.Gamma_Ramp);
function Is_Grabbed (Self : in Window) return Boolean with
Inline => True;
procedure Set_Grabbed (Self : in out Window; Grabbed : in Boolean := True) with
Inline => True;
function Get_ID (Self : in Window) return ID with
Inline => True;
function Get_Maximum_Size (Self : in Window) return SDL.Sizes;
procedure Set_Maximum_Size (Self : in out Window; Size : in SDL.Sizes) with
Inline => True;
function Get_Minimum_Size (Self : in Window) return SDL.Sizes;
procedure Set_Minimum_Size (Self : in out Window; Size : in SDL.Sizes) with
Inline => True;
function Pixel_Format (Self : in Window) return SDL.Video.Pixel_Formats.Pixel_Format with
Inline => True;
function Get_Position (Self : in Window) return SDL.Natural_Coordinates;
procedure Set_Position (Self : in out Window; Position : SDL.Natural_Coordinates) with
Inline => True;
function Get_Size (Self : in Window) return SDL.Sizes;
procedure Set_Size (Self : in out Window; Size : in SDL.Sizes) with
Inline => True;
function Get_Surface (Self : in Window) return SDL.Video.Surfaces.Surface;
function Get_Title (Self : in Window) return Ada.Strings.UTF_Encoding.UTF_8_String;
procedure Set_Title (Self : in Window; Title : in Ada.Strings.UTF_Encoding.UTF_8_String);
-- SDL_GetWindowWMInfo
procedure Hide (Self : in Window) with
Inline => True;
procedure Show (Self : in Window) with
Inline => True;
procedure Maximise (Self : in Window) with
Inline => True;
procedure Minimise (Self : in Window) with
Inline => True;
procedure Raise_And_Focus (Self : in Window) with
Inline => True;
procedure Restore (Self : in Window) with
Inline => True;
procedure Set_Mode (Self : in out Window; Flags : in Full_Screen_Flags);
procedure Set_Icon (Self : in out Window; Icon : in SDL.Video.Surfaces.Surface) with
Inline => True;
procedure Update_Surface (Self : in Window);
procedure Update_Surface_Rectangle (Self : in Window; Rectangle : in SDL.Video.Rectangles.Rectangle);
procedure Update_Surface_Rectangles (Self : in Window; Rectangles : in SDL.Video.Rectangles.Rectangle_Arrays);
-- Determine whether any windows have been created.
function Exist return Boolean;
private
-- TODO: Make this a proper type.
type Native_Window is new System.Address;
type User_Data is new Ada.Finalization.Controlled with null record;
type Window is new Ada.Finalization.Limited_Controlled with
record
Internal : SDL.C_Pointers.Windows_Pointer := null; -- System.Address := System.Null_Address;
Owns : Boolean := True; -- Does this Window type own the Internal data?
end record;
function Get_Internal_Window (Self : in Window) return SDL.C_Pointers.Windows_Pointer with
Export => True,
Convention => Ada;
Null_Window : constant Window := (Ada.Finalization.Limited_Controlled with
Internal => null, -- System.Null_Address,
Owns => True);
Total_Windows_Created : Natural := Natural'First;
procedure Increment_Windows;
procedure Decrement_Windows;
end SDL.Video.Windows;
|
reznikmm/matreshka | Ada | 4,735 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-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.DD_Constructors is
function Create_DG_Canvas return AMF.Internals.AMF_Element;
function Create_DG_Circle return AMF.Internals.AMF_Element;
function Create_DG_Clip_Path return AMF.Internals.AMF_Element;
function Create_DG_Ellipse return AMF.Internals.AMF_Element;
function Create_DG_Group return AMF.Internals.AMF_Element;
function Create_DG_Image return AMF.Internals.AMF_Element;
function Create_DG_Line return AMF.Internals.AMF_Element;
function Create_DG_Linear_Gradient return AMF.Internals.AMF_Element;
function Create_DG_Marked_Element return AMF.Internals.AMF_Element;
function Create_DG_Marker return AMF.Internals.AMF_Element;
function Create_DG_Path return AMF.Internals.AMF_Element;
function Create_DG_Pattern return AMF.Internals.AMF_Element;
function Create_DG_Polygon return AMF.Internals.AMF_Element;
function Create_DG_Polyline return AMF.Internals.AMF_Element;
function Create_DG_Radial_Gradient return AMF.Internals.AMF_Element;
function Create_DG_Rectangle return AMF.Internals.AMF_Element;
function Create_DG_Style return AMF.Internals.AMF_Element;
function Create_DG_Text return AMF.Internals.AMF_Element;
end AMF.Internals.Tables.DD_Constructors;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 3,998 | adb | with STM32_SVD.GPIO; use STM32_SVD.GPIO;
with STM32_SVD.SCB; use STM32_SVD.SCB;
with STM32_SVD.RCC; use STM32_SVD.RCC;
with STM32_SVD.EXTI; use STM32_SVD.EXTI;
with STM32_SVD.NVIC; use STM32_SVD.NVIC;
with STM32_SVD.SYSCFG; use STM32_SVD.SYSCFG;
with STM32GD.EXTI;
with System; use System;
package body STM32GD.GPIO is
function Port_Index return UInt4 is
(if Port'Address = GPIOA_Periph'Address then 0
elsif Port'Address = GPIOB_Periph'Address then 1
elsif Port'Address = GPIOC_Periph'Address then 2
elsif Port'Address = GPIOD_Periph'Address then 3
else 5);
procedure Set_Output is
begin
Port.MODER.Arr (Integer (Pin)) := 2#01#;
end Set_Output;
procedure Set_Input is
begin
Port.MODER.Arr (Integer (Pin)) := 2#00#;
end Set_Input;
procedure Set_Alternate is
begin
Port.MODER.Arr (Integer (Pin)) := 2#10#;
end Set_Alternate;
procedure Set_Analog_Input is
begin
Port.MODER.Arr (Integer (Pin)) := 2#11#;
end Set_Analog_Input;
procedure Set_Pull_Up is
begin
Port.PUPDR.Arr (Integer (Pin)) := 2#01#;
end Set_Pull_Up;
procedure Set_Pull_Down is
begin
Port.PUPDR.Arr (Integer (Pin)) := 2#10#;
end Set_Pull_Down;
procedure Set_No_Pull is
begin
Port.PUPDR.Arr (Integer (Pin)) := 2#00#;
end Set_No_Pull;
procedure Set_Open_Drain is
begin
Port.OTYPER.OT.Arr (Integer (Pin)) := 1;
end Set_Open_Drain;
procedure Set_Push_Pull is
begin
Port.OTYPER.OT.Arr (Integer (Pin)) := 0;
end Set_Push_Pull;
procedure Init is
begin
if Output then
Set_Output;
if Medium_Speed then
Port.OSPEEDR.Arr (Integer (Pin)) := 2#01#;
elsif High_Speed then
Port.OSPEEDR.Arr (Integer (Pin)) := 2#10#;
end if;
elsif Alternate then
Set_Alternate;
if Alternate_Function /= 0 then
Configure_Alternate_Function (Alternate_Function);
end if;
elsif Analog_Input then
Set_Analog_Input;
else
Set_Input;
end if;
if Pull_Up then
Set_Pull_Up;
elsif Pull_Down then
Set_Pull_Down;
else
Set_No_Pull;
end if;
if Open_Drain_Output then
Set_Open_Drain;
else
Set_Push_Pull;
end if;
end Init;
function Is_Set return Boolean is
begin
return (Port.IDR.IDR.Val and Pin_Mask) = Pin_Mask;
end Is_Set;
procedure Set is
begin
Port.BSRR.BS.Val := Pin_Mask;
end Set;
procedure Clear is
begin
Port.BRR.BR.Val := Pin_Mask;
end Clear;
procedure Toggle is
begin
Port.ODR.ODR.Val := Port.ODR.ODR.Val xor Pin_Mask;
end Toggle;
procedure Configure_Alternate_Function (AF : UInt4) is
begin
if Pin < 8 then
Port.AFRL.Arr (Integer (Pin)) := AF;
else
Port.AFRH.Arr (Integer (Pin)) := AF;
end if;
end Configure_Alternate_Function;
procedure Connect_External_Interrupt is
begin
EXTI.Connect_External_Interrupt (Pin, Port_Index);
end Connect_External_Interrupt;
procedure Wait_For_Trigger is
begin
loop
STM32GD.Wait_For_Event;
exit when Triggered;
end loop;
Clear_Trigger;
end Wait_For_Trigger;
procedure Clear_Trigger is
begin
EXTI_Periph.PR.PR.Arr (Integer (Pin)) := 1;
NVIC_Periph.ICPR := 2 ** 5;
end Clear_Trigger;
function Triggered return Boolean is
begin
return EXTI_Periph.PR.PR.Arr (Integer (Pin)) = 1;
end Triggered;
procedure Configure_Trigger (Rising : Boolean := False; Falling : Boolean := False) is
begin
Connect_External_Interrupt;
if Rising then
EXTI_Periph.RTSR.TR.Arr (Integer (Pin)) := 1;
end if;
if Falling then
EXTI_Periph.FTSR.TR.Arr (Integer (Pin)) := 1;
end if;
EXTI_Periph.EMR.MR.Arr (Integer(Integer (Pin))) := 1;
end Configure_Trigger;
end STM32GD.GPIO;
|
AdaCore/gpr | Ada | 1,774 | adb | --
-- Copyright (C) 2019-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0
--
with Ada.Strings.Fixed;
with Ada.Text_IO;
with GPR2.Context;
with GPR2.Path_Name;
with GPR2.Project.Source.Set;
with GPR2.Project.View;
with GPR2.Project.Tree;
with GPR2.Source;
with GPR2.Project.View.Set;
procedure Main is
use Ada;
use GPR2;
use GPR2.Project;
procedure Check (Project_Name : Filename_Type);
-- Do check the given project's sources
function Filter_Filename (Filename : Path_Name.Object) return String;
-- Remove the leading tmp directory
-----------
-- Check --
-----------
procedure Check (Project_Name : Filename_Type) is
Prj : Project.Tree.Object;
Ctx : Context.Object;
View : Project.View.Object;
begin
Project.Tree.Load (Prj, Create (Project_Name), Ctx);
View := Prj.Root_Project;
Text_IO.Put_Line ("Project: " & String (View.Name));
Text_IO.Put_Line (" imports:");
for I of View.Imports loop
Text_IO.Put_Line (" > " & Filter_Filename (I.Path_Name));
end loop;
Text_IO.Put_Line (" imports recursively:");
for I of View.Imports (Recursive => True) loop
Text_IO.Put_Line (" > " & Filter_Filename (I.Path_Name));
end loop;
end Check;
---------------------
-- Output_Filename --
---------------------
function Filter_Filename (Filename : Path_Name.Object) return String is
F : constant Path_Name.Full_Name := Filename.Value;
D : constant String := "imported-views";
I : constant Positive := Strings.Fixed.Index (F, D);
begin
return F (I + D'Length .. F'Last);
end Filter_Filename;
begin
Check ("demo1.gpr");
Check ("demo2.gpr");
Check ("demo4.gpr");
end Main;
|
reznikmm/matreshka | Ada | 4,041 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Draw_Auto_Grow_Width_Attributes;
package Matreshka.ODF_Draw.Auto_Grow_Width_Attributes is
type Draw_Auto_Grow_Width_Attribute_Node is
new Matreshka.ODF_Draw.Abstract_Draw_Attribute_Node
and ODF.DOM.Draw_Auto_Grow_Width_Attributes.ODF_Draw_Auto_Grow_Width_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Draw_Auto_Grow_Width_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Draw_Auto_Grow_Width_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Draw.Auto_Grow_Width_Attributes;
|
zhmu/ananas | Ada | 131 | adb | package body Inline18_Gen1 is
function Complete return T is
Dummy : T;
begin
return Dummy;
end;
end Inline18_Gen1;
|
pdaxrom/Kino2 | Ada | 3,550 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Enumeration_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en
-- Version Control:
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type Enum is (<>);
package Terminal_Interface.Curses.Text_IO.Enumeration_IO is
Default_Width : Field := 0;
Default_Setting : Type_Set := Mixed_Case;
procedure Put
(Win : in Window;
Item : in Enum;
Width : in Field := Default_Width;
Set : in Type_Set := Default_Setting);
procedure Put
(Item : in Enum;
Width : in Field := Default_Width;
Set : in Type_Set := Default_Setting);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
|
fractal-mind/Amass | Ada | 1,242 | ads | -- Copyright 2017-2022 Jeff Foley. All rights reserved.
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
name = "BufferOver"
type = "api"
function start()
set_rate_limit(1)
end
function vertical(ctx, domain)
local c
local cfg = datasrc_config()
if cfg ~= nil then
c = cfg.credentials
end
if (c ~= nil and c.key ~= nil and c.key ~= "") then
local ok = commercial_api_query(ctx, domain, c.key)
if not ok then
scrape(ctx, {
url=build_url(domain, "tls"),
headers={['x-api-key']=c.key},
})
end
end
scrape(ctx, {url=build_url(domain, "dns")})
end
function commercial_api_query(ctx, domain, key)
local resp, err = request(ctx, {
url="https://bufferover-run-tls.p.rapidapi.com/ipv4/dns?q=." .. domain,
headers={
['x-rapidapi-host']="bufferover-run-tls.p.rapidapi.com",
['x-rapidapi-key']=key,
},
})
if (err ~= nil and err ~= "") then
return false
end
send_names(ctx, resp)
return true
end
function build_url(domain, sub)
return "https://" .. sub .. ".bufferover.run/dns?q=." .. domain
end
|
zhmu/ananas | Ada | 4,214 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is the VxWorks version of this package
-- It is simpler than other versions because the Ada interrupt handling
-- mechanisms are used for hardware interrupts rather than signals.
package body System.Interrupt_Management is
use System.OS_Interface;
-----------------------
-- Local Subprograms --
-----------------------
function State (Int : Interrupt_ID) return Character;
pragma Import (C, State, "__gnat_get_interrupt_state");
-- Get interrupt state. Defined in init.c The input argument is the
-- hardware interrupt number, and the result is one of the following:
Runtime : constant Character := 'r';
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)
----------------
-- Initialize --
----------------
Initialized : Boolean := False;
-- Set to True once Initialize is called, further calls have no effect
procedure Initialize is
begin
if Initialized then
return;
end if;
Initialized := True;
-- Change this if you want to use another signal for task abort.
-- SIGTERM might be a good one.
Abort_Task_Interrupt := SIGABRT;
-- Initialize hardware interrupt handling
pragma Assert (Reserve = (Interrupt_ID'Range => False));
-- Check all interrupts for state that requires keeping them reserved
for J in Interrupt_ID'Range loop
if State (J) = Default or else State (J) = Runtime then
Reserve (J) := True;
end if;
end loop;
end Initialize;
end System.Interrupt_Management;
|
Gabriel-Degret/adalib | Ada | 1,007 | ads | -- Standard Ada library specification
-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
package Ada.Strings is
pragma Pure (Strings);
Space : constant Character := ' ';
Wide_Space : constant Wide_Character := ' ';
Wide_Wide_Space : constant Wide_Wide_Character := ' ';
Length_Error, Pattern_Error, Index_Error, Translation_Error
: exception;
type Alignment is (Left, Right, Center);
type Truncation is (Left, Right, Error);
type Membership is (Inside, Outside);
type Direction is (Forward, Backward);
type Trim_End is (Left, Right, Both);
end Ada.Strings;
|
charlie5/lace | Ada | 5,311 | adb | with
openGL.Errors,
openGL.Buffer,
openGL.Tasks,
GL.Binding,
ada.unchecked_Deallocation;
package body openGL.Primitive.short_indexed
is
---------
--- Forge
--
procedure define (Self : in out Item; Kind : in facet_Kind;
Indices : in short_Indices)
is
use Buffer.short_indices.Forge;
buffer_Indices : aliased short_Indices := [Indices'Range => <>];
begin
for Each in buffer_Indices'Range
loop
buffer_Indices (Each) := Indices (Each) - 1; -- Adjust indices to zero-based indexing for GL.
end loop;
Self.facet_Kind := Kind;
Self.Indices := new Buffer.short_indices.Object' (to_Buffer (buffer_Indices'Access,
usage => Buffer.static_Draw));
end define;
procedure define (Self : in out Item; Kind : in facet_Kind;
Indices : in openGL.Indices)
is
use Buffer.short_indices.Forge;
buffer_Indices : aliased short_Indices := [Indices'Range => <>];
begin
for Each in buffer_Indices'Range
loop
buffer_Indices (Each) := short_Index_t (Indices (Each) - 1); -- Adjust indices to zero-based indexing for GL.
end loop;
Self.facet_Kind := Kind;
Self.Indices := new Buffer.short_indices.Object' (to_Buffer (buffer_Indices'Access,
usage => Buffer.static_Draw));
end define;
procedure define (Self : in out Item; Kind : in facet_Kind;
Indices : in long_Indices)
is
use Buffer.short_indices.Forge;
buffer_Indices : aliased short_indices := [Indices'Range => <>];
begin
for Each in buffer_Indices'Range
loop
buffer_Indices (Each) := short_Index_t (Indices (Each) - 1); -- Adjust indices to zero-based indexing for GL.
end loop;
Self.facet_Kind := Kind;
Self.Indices := new Buffer.short_indices.Object' (to_Buffer (buffer_Indices'Access,
usage => Buffer.static_Draw));
end define;
function new_Primitive (Kind : in facet_Kind;
Indices : in short_Indices) return Primitive.short_indexed.view
is
Self : constant View := new Item;
begin
define (Self.all, Kind, Indices);
return Self;
end new_Primitive;
function new_Primitive (Kind : in facet_Kind;
Indices : in openGL.Indices) return Primitive.short_indexed.view
is
Self : constant View := new Item;
begin
define (Self.all, Kind, Indices);
return Self;
end new_Primitive;
function new_Primitive (Kind : in facet_Kind;
Indices : in openGL.long_Indices) return Primitive.short_indexed.view
is
Self : constant View := new Item;
begin
define (Self.all, Kind, Indices);
return Self;
end new_Primitive;
overriding
procedure destroy (Self : in out Item)
is
procedure free is new ada.unchecked_Deallocation (Buffer.short_Indices.Object'Class,
Buffer.short_Indices.view);
begin
Buffer.destroy (Self.Indices.all);
free (Self.Indices);
end destroy;
--------------
-- Attributes
--
procedure Indices_are (Self : in out Item; Now : in short_Indices)
is
use Buffer.short_indices;
buffer_Indices : aliased short_Indices := [Now'Range => <>];
begin
for Each in buffer_Indices'Range
loop
buffer_Indices (Each) := Now (Each) - 1; -- Adjust indices to zero-based-indexing for GL.
end loop;
Self.Indices.set (to => buffer_Indices);
end Indices_are;
procedure Indices_are (Self : in out Item; Now : in Indices)
is
use Buffer.short_indices;
buffer_Indices : aliased short_Indices := [Now'Range => <>];
begin
for Each in buffer_Indices'Range
loop
buffer_Indices (Each) := short_Index_t (Now (Each) - 1); -- Adjust indices to zero-based-indexing for GL.
end loop;
Self.Indices.set (to => buffer_Indices);
end Indices_are;
procedure Indices_are (Self : in out Item; Now : in long_Indices)
is
use Buffer.short_indices;
buffer_Indices : aliased short_Indices := [Now'Range => <>];
begin
for Each in buffer_Indices'Range
loop
buffer_Indices (Each) := short_Index_t (Now (Each) - 1); -- Adjust indices to zero-based-indexing for GL.
end loop;
Self.Indices.set (to => buffer_Indices);
end Indices_are;
--------------
-- Operations
--
overriding
procedure render (Self : in out Item)
is
use GL,
GL.Binding;
begin
Tasks.check;
openGL.Primitive.item (Self).render; -- Do base class render.
Self.Indices.enable;
glDrawElements (Thin (Self.facet_Kind),
gl.GLint (Self.Indices.Length),
GL_UNSIGNED_BYTE,
null);
Errors.log;
end render;
end openGL.Primitive.short_indexed;
|
reznikmm/matreshka | Ada | 22,950 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Central_Buffer_Nodes is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Central_Buffer_Node_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_Central_Buffer_Node
(AMF.UML.Central_Buffer_Nodes.UML_Central_Buffer_Node_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Central_Buffer_Node_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_Central_Buffer_Node
(AMF.UML.Central_Buffer_Nodes.UML_Central_Buffer_Node_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Central_Buffer_Node_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_Central_Buffer_Node
(Visitor,
AMF.UML.Central_Buffer_Nodes.UML_Central_Buffer_Node_Access (Self),
Control);
end if;
end Visit_Element;
------------------
-- Get_In_State --
------------------
overriding function Get_In_State
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.States.Collections.Set_Of_UML_State is
begin
return
AMF.UML.States.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_State
(Self.Element)));
end Get_In_State;
-------------------------
-- Get_Is_Control_Type --
-------------------------
overriding function Get_Is_Control_Type
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Control_Type
(Self.Element);
end Get_Is_Control_Type;
-------------------------
-- Set_Is_Control_Type --
-------------------------
overriding procedure Set_Is_Control_Type
(Self : not null access UML_Central_Buffer_Node_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Control_Type
(Self.Element, To);
end Set_Is_Control_Type;
------------------
-- Get_Ordering --
------------------
overriding function Get_Ordering
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.UML_Object_Node_Ordering_Kind is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Ordering
(Self.Element);
end Get_Ordering;
------------------
-- Set_Ordering --
------------------
overriding procedure Set_Ordering
(Self : not null access UML_Central_Buffer_Node_Proxy;
To : AMF.UML.UML_Object_Node_Ordering_Kind) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Ordering
(Self.Element, To);
end Set_Ordering;
-------------------
-- Get_Selection --
-------------------
overriding function Get_Selection
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Behaviors.UML_Behavior_Access is
begin
return
AMF.UML.Behaviors.UML_Behavior_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Selection
(Self.Element)));
end Get_Selection;
-------------------
-- Set_Selection --
-------------------
overriding procedure Set_Selection
(Self : not null access UML_Central_Buffer_Node_Proxy;
To : AMF.UML.Behaviors.UML_Behavior_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Selection
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Selection;
---------------------
-- Get_Upper_Bound --
---------------------
overriding function Get_Upper_Bound
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Value_Specifications.UML_Value_Specification_Access is
begin
return
AMF.UML.Value_Specifications.UML_Value_Specification_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Upper_Bound
(Self.Element)));
end Get_Upper_Bound;
---------------------
-- Set_Upper_Bound --
---------------------
overriding procedure Set_Upper_Bound
(Self : not null access UML_Central_Buffer_Node_Proxy;
To : AMF.UML.Value_Specifications.UML_Value_Specification_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Upper_Bound
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Upper_Bound;
------------------
-- Get_Activity --
------------------
overriding function Get_Activity
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Activities.UML_Activity_Access is
begin
return
AMF.UML.Activities.UML_Activity_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Activity
(Self.Element)));
end Get_Activity;
------------------
-- Set_Activity --
------------------
overriding procedure Set_Activity
(Self : not null access UML_Central_Buffer_Node_Proxy;
To : AMF.UML.Activities.UML_Activity_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Activity
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Activity;
------------------
-- Get_In_Group --
------------------
overriding function Get_In_Group
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group is
begin
return
AMF.UML.Activity_Groups.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Group
(Self.Element)));
end Get_In_Group;
---------------------------------
-- Get_In_Interruptible_Region --
---------------------------------
overriding function Get_In_Interruptible_Region
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region is
begin
return
AMF.UML.Interruptible_Activity_Regions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Interruptible_Region
(Self.Element)));
end Get_In_Interruptible_Region;
----------------------
-- Get_In_Partition --
----------------------
overriding function Get_In_Partition
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition is
begin
return
AMF.UML.Activity_Partitions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Partition
(Self.Element)));
end Get_In_Partition;
----------------------------
-- Get_In_Structured_Node --
----------------------------
overriding function Get_In_Structured_Node
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access is
begin
return
AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Structured_Node
(Self.Element)));
end Get_In_Structured_Node;
----------------------------
-- Set_In_Structured_Node --
----------------------------
overriding procedure Set_In_Structured_Node
(Self : not null access UML_Central_Buffer_Node_Proxy;
To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_In_Structured_Node
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_In_Structured_Node;
------------------
-- Get_Incoming --
------------------
overriding function Get_Incoming
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is
begin
return
AMF.UML.Activity_Edges.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Incoming
(Self.Element)));
end Get_Incoming;
------------------
-- Get_Outgoing --
------------------
overriding function Get_Outgoing
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is
begin
return
AMF.UML.Activity_Edges.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Outgoing
(Self.Element)));
end Get_Outgoing;
------------------------
-- Get_Redefined_Node --
------------------------
overriding function Get_Redefined_Node
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node is
begin
return
AMF.UML.Activity_Nodes.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Node
(Self.Element)));
end Get_Redefined_Node;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_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_Type --
--------------
overriding function Get_Type
(Self : not null access constant UML_Central_Buffer_Node_Proxy)
return AMF.UML.Types.UML_Type_Access is
begin
return
AMF.UML.Types.UML_Type_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Type
(Self.Element)));
end Get_Type;
--------------
-- Set_Type --
--------------
overriding procedure Set_Type
(Self : not null access UML_Central_Buffer_Node_Proxy;
To : AMF.UML.Types.UML_Type_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Type
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Type;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_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_Central_Buffer_Node_Proxy.Namespace";
return Namespace (Self);
end Namespace;
end AMF.Internals.UML_Central_Buffer_Nodes;
|
francesco-bongiovanni/ewok-kernel | Ada | 2,873 | ads | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with soc.gpio;
package ewok.exported.gpios
with spark_mode => off
is
type t_gpio_settings is record
set_mode : bool;
set_type : bool;
set_speed : bool;
set_pupd : bool;
set_bsr_r : bool;
set_bsr_s : bool;
set_lck : bool;
set_af : bool;
set_exti : bool;
end record
with size => 16;
for t_gpio_settings use record
set_mode at 0 range 0 .. 0;
set_type at 0 range 1 .. 1;
set_speed at 0 range 2 .. 2;
set_pupd at 0 range 3 .. 3;
set_bsr_r at 0 range 4 .. 4;
set_bsr_s at 0 range 5 .. 5;
set_lck at 0 range 6 .. 6;
set_af at 0 range 7 .. 7;
set_exti at 0 range 8 .. 8;
end record;
type t_gpio_ref is record
pin : soc.gpio.t_gpio_pin_index;
port : soc.gpio.t_gpio_port_index;
end record
with pack, size => 8, convention => c_pass_by_copy;
type t_interface_gpio_mode is (GPIO_IN, GPIO_OUT, GPIO_AF, GPIO_ANALOG);
type t_interface_gpio_pupd is (GPIO_NOPULL, GPIO_PULLUP, GPIO_PULLDOWN);
type t_interface_gpio_type is (GPIO_PUSH_PULL, GPIO_OPEN_DRAIN);
type t_interface_gpio_speed is
(GPIO_LOW_SPEED,
GPIO_MEDIUM_SPEED,
GPIO_HIGH_SPEED,
GPIO_VERY_HIGH_SPEED);
type t_interface_gpio_exti_trigger is
(GPIO_EXTI_TRIGGER_NONE,
GPIO_EXTI_TRIGGER_RISE,
GPIO_EXTI_TRIGGER_FALL,
GPIO_EXTI_TRIGGER_BOTH);
type t_gpio_config is record
settings : t_gpio_settings; -- gpio_mask_t
kref : t_gpio_ref;
mode : t_interface_gpio_mode;
pupd : t_interface_gpio_pupd;
otype : t_interface_gpio_type;
ospeed : t_interface_gpio_speed;
af : unsigned_32;
bsr_r : unsigned_32;
bsr_s : unsigned_32;
lck : unsigned_32;
exti_trigger : t_interface_gpio_exti_trigger;
exti_handler : system_address;
end record;
type t_gpio_config_access is access all t_gpio_config;
end ewok.exported.gpios;
|
PThierry/ewok-kernel | Ada | 1,685 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
package body soc.nvic
with spark_mode => off
is
function to_irq_number
(intr : soc.interrupts.t_interrupt)
return t_irq_index
is
begin
return t_irq_index'val (soc.interrupts.t_interrupt'pos (intr) - 16);
end to_irq_number;
procedure enable_irq
(irq : in t_irq_index)
is
begin
case irq is
when 0 .. 31 => NVIC.ISER0.irq(irq) := IRQ_ENABLED;
when 32 .. 63 => NVIC.ISER1.irq(irq) := IRQ_ENABLED;
when 64 .. 80 => NVIC.ISER2.irq(irq) := IRQ_ENABLED;
end case;
end enable_irq;
procedure clear_pending_irq
(irq : in t_irq_index)
is
begin
case irq is
when 0 .. 31 => NVIC.ICPR0.irq(irq) := CLEAR_PENDING;
when 32 .. 63 => NVIC.ICPR1.irq(irq) := CLEAR_PENDING;
when 64 .. 80 => NVIC.ICPR2.irq(irq) := CLEAR_PENDING;
end case;
end clear_pending_irq;
end soc.nvic;
|
reznikmm/matreshka | Ada | 3,709 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Attributes;
package ODF.DOM.Db_Is_Nullable_Attributes is
pragma Preelaborate;
type ODF_Db_Is_Nullable_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Db_Is_Nullable_Attribute_Access is
access all ODF_Db_Is_Nullable_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Db_Is_Nullable_Attributes;
|
io7m/coreland-posix-ada | Ada | 1,150 | adb | package body POSIX.Permissions is
function Mode_To_Integer (Mode : in Mode_t) return Mode_Integer_t is
Return_Mode : Mode_Integer_t := 8#0000#;
begin
for Mode_Element in Mode_Element_t range Mode_t'First .. Mode_t'Last loop
--# assert Mode_Element <= Mode_t'Last
--# and Mode_Element >= Mode_t'First
--# and Mode_Map (Mode_Element) >= Mode_Integer_t'First
--# and Mode_Map (Mode_Element) <= Mode_Integer_t'Last;
if Mode (Mode_Element) then
Return_Mode := Return_Mode or Mode_Map (Mode_Element);
end if;
end loop;
return Return_Mode;
end Mode_To_Integer;
function Mode_Integer_To_Mode (Mode : in Mode_Integer_t) return Mode_t is
Return_Mode : Mode_t := None;
begin
for Mode_Element in Mode_Element_t range Mode_t'First .. Mode_t'Last loop
if (Mode and Mode_Map (Mode_Element)) = Mode_Map (Mode_Element) then
Return_Mode (Mode_Element) := True;
end if;
--# assert (Mode_Element <= Mode_t'Last) and
--# (Mode_Element >= Mode_t'First);
end loop;
return Return_Mode;
end Mode_Integer_To_Mode;
end POSIX.Permissions;
|
zhmu/ananas | Ada | 167 | adb | -- { dg-do run }
-- { dg-options "-O2" }
with System;
with Opt21_Pkg; use Opt21_Pkg;
procedure Opt21 is
V : System.Address := Convert (null);
begin
null;
end;
|
twinbee/lamportsBakery | Ada | 9,421 | adb | ----------------------------csc410/prog5/as5.adb----------------------------
-- Author: Matthew Bennett
-- Class: CSC410 Burgess
-- Date: 11-01-04 Modified: 11-15-04
-- Due: 11-16-04
-- Desc: Assignment 5: LAMPORT'S ALGORITHM FOR VIRTUAL TOPOLOGY NETWORKS
--
-- a nonproduction implementation of
-- LAMPORT's "bakery" algorithm which utilizes clocks (a 'ticketing' system
-- like IN the bakery or at the dept of motor vehicles) to determine which
-- process may go into the critical section next.
--
-- LAMPORT implemented as described IN
-- "Algorithms FOR Mutual Exclusion", M. Raynal
-- MIT PRESS Cambridge, 1986 ISBN: 0-262-18119-3
-- with additional revisions due to message passing across a virtual topology
----------------------------------------------------------------------------
----------------------------------------------------------------
-- dependencies
WITH ADA.TEXT_IO; USE ADA.TEXT_IO;
WITH ADA.INTEGER_TEXT_IO; USE ADA.INTEGER_TEXT_IO;
WITH ADA.NUMERICS.FLOAT_RANDOM; USE ADA.NUMERICS.FLOAT_RANDOM;
WITH ADA.CALENDAR; -- (provides cast: natural -> time FOR input into delay)
WITH ADA.STRINGS; USE ADA.STRINGS;
WITH ADA.STRINGS.UNBOUNDED; USE ADA.STRINGS.UNBOUNDED;
PROCEDURE Main IS
--GLOBALS VARS: randomPool, taskarray, go, stop
randomPool : ADA.NUMERICS.FLOAT_RANDOM.GENERATOR;
--random number pool FOR generating
go, stop: Boolean := FALSE; --allow FOR graceful execution and termination
TYPE MESG IS (REQ, ACK, REL);
PACKAGE MESG_IO IS NEW Enumeration_IO(MESG); USE MESG_IO;
--so that we can natively output enumerated type
MAX_NEIGHBORS : CONSTANT := 30;
--maximum number of neighbors, FOR efficiency IN array passing
-- 1/2 of this num is the same as euler # FOR a graph
MAX_TASKS : CONSTANT := 20;
--maximum number of neighbors, FOR efficiency IN array passing
TYPE type_message IS (REQ, ACK, REL); --request, acknowledge, release
PACKAGE ENUM_IO IS NEW Enumeration_IO(type_message); Use ENUM_IO;
--allow input and output of our enumerated names
TYPE RX_TASK;
TYPE RX_Ptr IS ACCESS RX_TASK;
--forward declaration needed FOR access type to RX_TASK FOR array of access es
TYPE passableArray IS ARRAY (0..MAX_NEIGHBORS) OF Integer;
--this is needed bc anonymous types are not allowed IN declarations
--specifically, so that we can pass arrays around between entries as arguments
taskArray : ARRAY (0..MAX_NEIGHBORS) OF RX_Ptr;
--keep up with tasks thrown off
-- Receive/listener task
TASK TYPE RX_TASK IS
ENTRY Start( id_IN : IN Integer; Neighbors_IN : IN passableArray);
--initialize variables
ENTRY FWD(dest: Integer; msg: type_message; k: Integer; j: Integer);
--method used to propogate messages through the network until dest = self
ENTRY kill;
--kill off the task, politely ask it to die
ENTRY REQUEST;
ENTRY ACKNOWLEDGE;
ENTRY RELEASE;
END RX_TASK;
-- BEGIN Receive TASK Definition --
TASK BODY RX_TASK IS
TYPE message IS
RECORD
mestype: type_message := rel;
clock: Integer := 0;
id: Integer;
END RECORD;
queue: ARRAY (0 .. MAX_TASKS) OF message;
--the distributed queue of messages
Neighbors : passableArray;
--keeps track of who task can send to, receive from
id : Integer;
--self identification
outp : Unbounded_String := Null_Unbounded_String;
--temporary string variable FOR uninterrupted output
friends : ARRAY(0..MAX_NEIGHBORS) OF RX_PTR;
--used FOR calling on receiver tasks
osn, tempOSN : Integer := 0;
--"own sequence number", Lamport clock FOR task
temp1, temp2: message;
FOR_all: boolean := TRUE;
dead: boolean := FALSE;
--temporary variables
TASK TYPE TX_TASK (
--seperate task, so it can be spawned any time!
dest: Integer; --destination IN network
mess: MESG; --the message itself
clock: Integer; --the sequence number of the sending process
i: Integer --sending process id #
)
IS --seperate task, so we can spawn a send -whenever- asynchronously
--ge that was short
END TX_TASK;
TYPE TX_PTR IS ACCESS TX_TASK;
myTX : TX_PTR; --so we can launch transmit task anytime
TASK BODY TX_TASK IS
BEGIN
null;
END TX_TASK; --definition
TASK TYPE AL_TASK
--gee, that was short
IS END AL_TASK;
--internal task, FOR lamport's algorithm
TASK BODY AL_TASK IS
BEGIN
LOOP
FOR index IN 0 .. MAX_NEIGHBORS LOOP
queue(index).id := index;
END LOOP;
EXIT WHEN (go);
END LOOP;
--intitialize the queue so that each element stores the proper process id
LOOP
--broadcast
FOR I IN 0..n
LOOP
IF(I /= id)THEN tsk_TX := new transmit(I, req, local_clock, id); END IF;
END LOOP;
q(id) := (req, local_clock, id);
osn := osn + 1;
tempOSN := osn;
wait:
LOOP
FOR j IN 0..n
LOOP
IF j /= id THEN
IF((q(id).clock < q(j).clock)
OR ((q(id).clock = q(j).clock) AND (q(id).id < q(j).id)))
THEN null;
ELSE FOR_all := FALSE;
END IF;
END IF;
END LOOP;
EXIT wait WHEN (FOR_all = TRUE);
FOR_all := TRUE;
END LOOP wait;
EXIT WHEN dead = TRUE;
outp := (((80/6)*id) * " ") & Integer'Image(id) & " IN CS.";
Put(To_String(outp)); New_line;
delay Duration(float(random(G)) + float(10));
st := (((80/(n+1))*id) * " ") & Integer'Image(id) & " out CS.";
Put_line(To_String(st));
-- broadcast
local_clock := osn;
FOR I IN 0..n
LOOP
IF(I /= id)THEN
tsk_TX := new transmit(I, rel, local_clock, id);
END IF;
END LOOP;
q(id) := (rel, local_clock, id);
osn := osn + 1;
local_clock := osn;
EXIT WHEN dead = TRUE;
END LOOP;
END AL_TASK;
TYPE AL_Ptr IS ACCESS AL_TASK;
aPtr : AL_Ptr;
--END of internal task, FOR lamport's algorithm
-- beginnig of RX_TASK definition
BEGIN
-- ACCEPT creation messages --
ACCEPT Start (
id_IN : IN Integer;
Neighbors_IN : IN passableArray
)
DO
--initialize neighbors array
FOR I IN Neighbors'First .. Neighbors'Last
LOOP
Neighbors(I) := Neighbors_IN(I);
END LOOP;
id := id_IN;
END Start;
ACCEPT KILL
DO
null;
END KILL;
ACCEPT FWD(dest: Integer; msg: type_message; k: Integer; j: Integer)
DO
null;
END FWD;
SELECT
ACCEPT REQUEST
DO
null;
END REQUEST;
ACCEPT ACKNOWLEDGE --acknkowledge
DO
null;
END ACKNOWLEDGE;
ACCEPT RELEASE
DO
null;
END RELEASE;
END SELECT;
-- RX_TASK definition
aPtr := new AL_TASK; -- spin off lamport task
-- Start Message Receiving LOOP --
--LOOP
null;
--END LOOP; -- RX LOOP
END RX_TASK;
PROCEDURE Driver IS
seedUser : Integer;
--user input random seed FOR random number generator
infile : FILE_TYPE;
--ada.standard.textIO type FOR reading ascii and iso-8XXX
filename : string(1..5);
--what file should we read from?
--Following are variables FOR building logical network topologies
taskId : Integer;
--temporary FOR keeping track of which task we are reading IN
neighbors : passableArray;
--array of neighbors to be passed into a node upon initialization
neighborCount : Integer;
--temporary to keep up with number of neighbors FOR a certain task/node
--killing time variables
toKill : Integer;
--assigned a random ID to determine which process to kill next
dead : ARRAY (0..MAX_TASKS) of Boolean := (Others => FALSE);
--keeps track of which processes have been slain, so we dont try to kill a
--process twice , which would raise an exception
BEGIN
put_line("Lamport's Algorithm");
put("# random seed: ");
get(seedUser); --to ensure a significantly random series, a seed is needed
-- to generate pseudo-random numbers
Ada.Numerics.Float_Random.Reset(randomPool,seedUser);
--seed the random number pool
put("Filename: ");
get(filename);
--first lets read IN the
Open (File=> inFile, Mode => IN_FILE, Name => filename);
--open as read only ascii and use reference infile
--file format is: nodeID neighbor neighbor neighbor...neighbor[MAX_NEIGHBORS]
WHILE NOT END_OF_FILE(infile)
LOOP
neighborCount := 0;
--receive file input
Get(infile, TASKId);
WHILE NOT END_OF_LINE(infile) --there is routing information on the line
LOOP
Get(infile, neighbors(neighborCount) );
neighborCount := neighborCount + 1;
END LOOP;
--we can have one tight LOOP now since this time
-- all neighbors are known ahead of time
--create and initialize part FOR nodes/tasks
taskArray(TASKId) := new RX_TASK;
taskArray(TASKId).start(taskId, neighbors);
END LOOP; --END of file reading LOOP
go := TRUE;
-- DELAY Duration(60.0); --allow things to run 1 minute before doom
Put("Number of tasks: "); Put (taskID); new_line;
--kill off random processes
FOR kill_index IN 0 .. (TaskID) --FOR as many as there are tasks
LOOP
delay (1.0);
Put ("Going to kill random process ... ");
toKill := (Integer(random(randomPool)) MOD TaskID);
WHILE (dead(toKill))
LOOP --iterate until process toKill isn't one that is already dead!
toKill := toKill + 1 MOD TaskID; --random didnt cut it, try the next one
END LOOP;
Put (toKill); new_line;
taskArray(toKill).kill; --kill off our random process
dead(toKill) := TRUE;
END LOOP; --END LOOP to kill out all processes
stop := TRUE;
Close(infile);
EXCEPTION
WHEN Name_Error =>
Put(Item => "File not found.");
WHEN Status_Error =>
Put(Item => "File already open.");
WHEN Use_Error =>
Put(Item => "You lack permission to open file");
-- WHEN constraint_Error =>
-- Put(Item => "problem IN code! constraint error thrown");
END Driver;
BEGIN Driver; END Main; --seperation of global vars
|
AdaCore/Ada_Drivers_Library | Ada | 1,823 | ads | -- This package was generated by the Ada_Drivers_Library project wizard script
package ADL_Config is
Architecture : constant String := "RISC-V"; -- From board definition
Board : constant String := "Unleashed"; -- From command line
CPU_Core : constant String := "RISC-V64"; -- From mcu definition
Device_Family : constant String := "U5"; -- From board definition
Device_Name : constant String := "U540"; -- From board definition
Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition
Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition
Has_ZFP_Runtime : constant String := "True"; -- From board definition
Max_Mount_Name_Length : constant := 128; -- From default value
Max_Mount_Points : constant := 2; -- From default value
Max_Path_Length : constant := 1024; -- From default value
Number_Of_Interrupts : constant := 0; -- From default value
Runtime_Name : constant String := "light-unleashed"; -- From default value
Runtime_Name_Suffix : constant String := "unleashed"; -- From board definition
Runtime_Profile : constant String := "light"; -- From command line
Use_Startup_Gen : constant Boolean := False; -- From command line
Vendor : constant String := "SiFive"; -- From board definition
end ADL_Config;
|
MinimSecure/unum-sdk | Ada | 1,295 | ads | -- Copyright 2008-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 Types is
type Object_Int is interface;
type Another_Int is interface;
type Object_Root is abstract tagged record
X : Natural;
Y : Natural;
end record;
type Object is abstract new Object_Root and Object_Int and Another_Int
with null record;
function Ident (O : Object'Class) return Object'Class;
procedure Do_Nothing (O : in out Object'Class);
type Rectangle is new Object with record
W : Natural;
H : Natural;
end record;
type Circle is new Object with record
R : Natural;
end record;
end Types;
|
AdaCore/langkit | Ada | 2,196 | adb | with Ada.Containers.Hashed_Maps;
with Ada.Text_IO; use Ada.Text_IO;
with Langkit_Support.Generic_API; use Langkit_Support.Generic_API;
with Langkit_Support.Generic_API.Analysis;
use Langkit_Support.Generic_API.Analysis;
with Libfoolang.Generic_API;
procedure Hash is
Id : Language_Id renames Libfoolang.Generic_API.Foo_Lang_Id;
package Context_Maps is new Ada.Containers.Hashed_Maps
(Lk_Context, Integer, Hash, "=");
package Unit_Maps is new Ada.Containers.Hashed_Maps
(Lk_Unit, Integer, Hash, "=");
package Node_Maps is new Ada.Containers.Hashed_Maps
(Lk_Node, Integer, Hash, "=");
package Token_Maps is new Ada.Containers.Hashed_Maps
(Lk_Token, Integer, Hash, "=");
Ctx : constant Lk_Context := Create_Context (Id);
Ctx2 : constant Lk_Context := Create_Context (Id);
U : constant Lk_Unit := Ctx.Get_From_File ("example.txt");
U2 : constant Lk_Unit := Ctx2.Get_From_File ("example2.txt");
N : constant Lk_Node := U.Root;
N2 : constant Lk_Node := U2.Root;
T : constant Lk_Token := N.Token_Start;
T2 : constant Lk_Token := N2.Token_Start;
Context_Map : Context_Maps.Map;
Unit_Map : Unit_Maps.Map;
Node_Map : Node_Maps.Map;
Token_Map : Token_Maps.Map;
begin
Context_Map.Insert (Ctx, 1);
Context_Map.Insert (Ctx2, 2);
if Context_Map.Element (Ctx) /= 1 then
raise Program_Error;
end if;
if Context_Map.Element (U2.Context) /= 2 then
raise Program_Error;
end if;
Unit_Map.Insert (U, 1);
Unit_Map.Insert (U2, 2);
if Unit_Map.Element (U) /= 1 then
raise Program_Error;
end if;
if Unit_Map.Element (N2.Unit) /= 2 then
raise Program_Error;
end if;
Node_Map.Insert (N, 1);
Node_Map.Insert (N2, 2);
if Node_Map.Element (N) /= 1 then
raise Program_Error;
end if;
if Node_Map.Element (U2.Root) /= 2 then
raise Program_Error;
end if;
Token_Map.Insert (T, 1);
Token_Map.Insert (T2, 2);
if Token_Map.Element (T) /= 1 then
raise Program_Error;
end if;
if Token_Map.Element (N2.Token_Start) /= 2 then
raise Program_Error;
end if;
Put_Line ("hash.adb: no error");
New_Line;
end Hash;
|
stcarrez/babel | Ada | 2,691 | ads | -----------------------------------------------------------------------
-- babel-commands -- Commands for babel
-- Copyright (C) 2011, 2012, 2014 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Ada.Containers.Ordered_Maps;
package Babel.Commands is
-- ------------------------------
-- Command
-- ------------------------------
type Command is abstract tagged private;
type Command_Access is access all Command'Class;
-- Execute the command with the arguments.
procedure Execute (Cmd : in Command) is abstract;
-- Write the help associated with the command.
procedure Help (Cmd : in Command) is abstract;
-- Write the command usage.
procedure Usage (Cmd : in Command);
-- Print a message on the standard output.
procedure Print (Cmd : in Command;
Message : in String);
-- ------------------------------
-- Help Command
-- ------------------------------
type Help_Command is new Command with private;
-- Execute the command with the arguments.
procedure Execute (Cmd : in Help_Command);
-- Write the help associated with the command.
procedure Help (Cmd : in Help_Command);
-- Register the command under the given name.
procedure Add_Command (Cmd : in Command_Access;
Name : in String);
-- Find the command having the given name.
function Find_Command (Name : in String) return Command_Access;
-- Print dynamo usage
procedure Usage;
-- Print dynamo short usage.
procedure Short_Help_Usage;
private
package Command_Maps is
new Ada.Containers.Ordered_Maps (Key_Type => Ada.Strings.Unbounded.Unbounded_String,
Element_Type => Command_Access,
"<" => Ada.Strings.Unbounded."<");
type Command is abstract tagged null record;
type Help_Command is new Command with null record;
end Babel.Commands;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 4,377 | adb | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
-- --
-- This file is based on: --
-- --
-- @file stm32f407xx.h et al. --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief CMSIS STM32F407xx Device Peripheral Access Layer Header File. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
-- This file provides register definitions for the STM32F4 (ARM Cortex M4F)
-- microcontrollers from ST Microelectronics.
with STM32_SVD; use STM32_SVD;
with STM32_SVD.EXTI; use STM32_SVD.EXTI;
package body STM32GD.EXTI.IRQ is
protected body IRQ_Handler is
entry Wait when Triggered is
begin
Triggered := False;
end Wait;
procedure Cancel is
begin
Triggered := True;
end Cancel;
function Status (Line : External_Line_Number) return Boolean is
begin
if Line'Enum_Rep < 19 then
return EXTI_Status.PR.Arr (Line'Enum_Rep) = 1;
end if;
return EXTI_Status.PR19 = 1;
end Status;
procedure Reset_Status (Line : External_Line_Number) is
begin
if Line'Enum_Rep < 19 then
EXTI_Status.PR.Arr (Line'Enum_Rep) := 0;
else
EXTI_Status.PR19 := 0;
end if;
end Reset_Status;
procedure Handler is
begin
EXTI_Status := EXTI_Periph.PR;
EXTI_Periph.PR.PR.Val := 2#11_1111_1111_1111_1111#;
EXTI_Periph.PR.PR19 := 1;
Triggered := True;
end Handler;
end IRQ_Handler;
end STM32GD.EXTI.IRQ;
|
Rodeo-McCabe/orka | Ada | 1,398 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2019 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.
package Orka.Inputs.Joysticks.Gamepads is
pragma Preelaborate;
type Button is
(Right_Pad_Down,
Right_Pad_Right,
Right_Pad_Left,
Right_Pad_Up,
Left_Shoulder,
Right_Shoulder,
Center_Left,
Center_Right,
Center_Logo,
Left_Stick,
Right_Stick,
Left_Pad_Up,
Left_Pad_Right,
Left_Pad_Down,
Left_Pad_Left);
type Axis is
(Left_Stick_X,
Left_Stick_Y,
Right_Stick_X,
Right_Stick_Y,
Left_Trigger,
Right_Trigger);
function Index (Value : Button) return Positive;
function Index (Value : Axis) return Positive;
procedure Normalize_Axes (Axes : in out Axis_Positions);
end Orka.Inputs.Joysticks.Gamepads;
|
stcarrez/bbox-ada-api | Ada | 1,538 | ads | -----------------------------------------------------------------------
-- druss-commands-get -- Raw JSON API Get command
-- Copyright (C) 2017, 2018, 2019, 2021 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package Druss.Commands.Get is
type Command_Type is new Druss.Commands.Drivers.Command_Type with null record;
-- Execute a GET operation on the Bbox API and return the raw JSON result.
overriding
procedure Execute (Command : in out Command_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type);
-- Write the help associated with the command.
overriding
procedure Help (Command : in out Command_Type;
Name : in String;
Context : in out Context_Type);
end Druss.Commands.Get;
|
charlie5/lace | Ada | 5,457 | adb | with
physics.Object;
package body gel.cone_twist_Joint
is
procedure define (Self : access Item; in_Space : in std_physics.Space.view;
Sprite_A, Sprite_B : access gel.Sprite.item'Class;
Frame_A, Frame_B : in Matrix_4x4)
is
A_Frame : aliased constant Matrix_4x4 := Frame_A;
B_Frame : aliased constant Matrix_4x4 := Frame_B;
type Joint_cast is access all gel.Joint.item;
sprite_A_Solid,
sprite_B_Solid : std_physics.Object.view;
begin
if Sprite_A /= null then sprite_A_Solid := standard.physics.Object.view (Sprite_A.Solid); end if;
if Sprite_B /= null then sprite_B_Solid := standard.physics.Object.view (Sprite_B.Solid); end if;
Joint.define (Joint_cast (Self), Sprite_A, Sprite_B); -- Define base class.
Self.Physics := in_Space.new_DoF6_Joint (sprite_A_Solid,
sprite_B_Solid,
A_Frame,
B_Frame);
end define;
procedure define (Self : access Item; in_Space : in std_physics.Space.view;
Sprite_A, Sprite_B : access gel.Sprite.item'Class;
pivot_Anchor : in Vector_3;
pivot_Axis : in Matrix_3x3)
is
use linear_Algebra_3D;
pivot_in_A : constant Vector_3 := pivot_Anchor - Sprite_A.Site;
pivot_in_B : constant Vector_3 := pivot_Anchor - Sprite_B.Site;
Frame_A : constant Matrix_4x4 := to_transform_Matrix (pivot_Axis, pivot_in_A);
Frame_B : constant Matrix_4x4 := to_transform_Matrix (pivot_Axis, pivot_in_B);
begin
Self.define (in_Space,
Sprite_A, Sprite_B,
Frame_A, Frame_B);
end define;
overriding
procedure destroy (Self : in out Item)
is
begin
raise Error with "TODO";
end destroy;
--------------
--- Attributes
--
overriding
function Frame_A (Self : in Item) return Matrix_4x4
is
begin
return Self.Physics.Frame_A;
end Frame_A;
overriding
function Frame_B (Self : in Item) return Matrix_4x4
is
begin
return Self.Physics.Frame_B;
end Frame_B;
overriding
procedure Frame_A_is (Self : in out Item; Now : in Matrix_4x4)
is
begin
Self.Physics.Frame_A_is (Now);
end Frame_A_is;
overriding
procedure Frame_B_is (Self : in out Item; Now : in Matrix_4x4)
is
begin
Self.Physics.Frame_B_is (Now);
end Frame_B_is;
overriding
function Physics (Self : in Item) return gel.Joint.Physics_view
is
begin
return joint.Physics_view (Self.Physics);
end Physics;
overriding
function Degrees_of_freedom (Self : in Item) return joint.Degree_of_freedom
is
pragma unreferenced (Self);
begin
return 6;
end Degrees_of_freedom;
-- Bounds - limits the range of motion for a Degree of freedom.
--
overriding
function is_Bound (Self : in Item; for_Degree : in joint.Degree_of_freedom) return Boolean
is
begin
if for_Degree in Sway .. Surge
then
return False;
end if;
return Self.Physics.is_Limited (for_Degree);
end is_Bound;
overriding
function low_Bound (Self : access Item; for_Degree : in joint.Degree_of_freedom) return Real
is
begin
case for_Degree
is
when Sway .. Surge =>
raise Error with "Unhandled Degree of freedom:" & for_Degree'Image;
when Pitch .. Roll =>
return Self.Physics.lower_Limit (for_Degree);
end case;
end low_Bound;
overriding
procedure low_Bound_is (Self : access Item; for_Degree : in joint.Degree_of_freedom;
Now : in Real)
is
begin
Self.Physics.lower_Limit_is (Now, for_Degree);
end low_Bound_is;
overriding
function high_Bound (Self : access Item; for_Degree : in joint.Degree_of_freedom) return Real
is
begin
case for_Degree
is
when Sway .. Surge =>
raise Error with "Unhandled Degree of freedom:" & for_Degree'Image;
when Pitch .. Roll =>
return Self.Physics.upper_Limit (for_Degree);
end case;
end high_Bound;
overriding
procedure high_Bound_is (Self : access Item; for_Degree : in joint.Degree_of_freedom;
Now : in Real)
is
begin
Self.Physics.upper_Limit_is (Now, for_Degree);
end high_Bound_is;
----------
--- Extent
--
overriding
function Extent (Self : in Item; for_Degree : in joint.Degree_of_freedom) return Real
is
begin
if for_Degree in Sway .. Surge
then
raise Error with "Unhandled Degree of freedom:" & for_Degree'Image;
end if;
return Self.Physics.Extent (for_Degree);
end Extent;
------------------
--- Motor Velocity
--
overriding
procedure Velocity_is (Self : in Item; for_Degree : in joint.Degree_of_freedom;
Now : in Real)
is
begin
Self.Physics.Velocity_is (Now, for_Degree);
end Velocity_is;
end gel.cone_twist_Joint;
|
zhmu/ananas | Ada | 4,833 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . V X W O R K S . E X T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
-- This package provides VxWorks specific support functions needed
-- by System.OS_Interface.
-- This is the VxWorks 6 RTP/SMP version of this package
package body System.VxWorks.Ext is
IERR : constant := -1;
--------------
-- Int_Lock --
--------------
function Int_Lock return int is
begin
return IERR;
end Int_Lock;
----------------
-- Int_Unlock --
----------------
procedure Int_Unlock (Old : int) is
pragma Unreferenced (Old);
begin
null;
end Int_Unlock;
-----------------------
-- Interrupt_Connect --
-----------------------
function Interrupt_Connect
(Vector : Interrupt_Vector;
Handler : Interrupt_Handler;
Parameter : System.Address := System.Null_Address) return STATUS
is
pragma Unreferenced (Vector, Handler, Parameter);
begin
return ERROR;
end Interrupt_Connect;
-----------------------
-- Interrupt_Context --
-----------------------
function Interrupt_Context return BOOL is
begin
-- For RTPs, never in an interrupt context
return 0;
end Interrupt_Context;
--------------------------------
-- Interrupt_Number_To_Vector --
--------------------------------
function Interrupt_Number_To_Vector
(intNum : int) return Interrupt_Vector
is
pragma Unreferenced (intNum);
begin
return 0;
end Interrupt_Number_To_Vector;
---------------
-- semDelete --
---------------
function semDelete (Sem : SEM_ID) return STATUS is
function OS_semDelete (Sem : SEM_ID) return STATUS;
pragma Import (C, OS_semDelete, "semDelete");
begin
return OS_semDelete (Sem);
end semDelete;
--------------------
-- Set_Time_Slice --
--------------------
function Set_Time_Slice (ticks : int) return STATUS is
pragma Unreferenced (ticks);
begin
return ERROR;
end Set_Time_Slice;
------------------------
-- taskCpuAffinitySet --
------------------------
function taskCpuAffinitySet (tid : t_id; CPU : int) return int
is
function Set_Affinity (tid : t_id; CPU : int) return int;
pragma Import (C, Set_Affinity, "__gnat_set_affinity");
begin
return Set_Affinity (tid, CPU);
end taskCpuAffinitySet;
-------------------------
-- taskMaskAffinitySet --
-------------------------
function taskMaskAffinitySet (tid : t_id; CPU_Set : unsigned) return int is
function Set_Affinity (tid : t_id; CPU_Set : unsigned) return int;
pragma Import (C, Set_Affinity, "__gnat_set_affinity_mask");
begin
return Set_Affinity (tid, CPU_Set);
end taskMaskAffinitySet;
end System.VxWorks.Ext;
|
apple-oss-distributions/old_ncurses | Ada | 4,307 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Form_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 <[email protected]> 1996
-- Version Control:
-- $Revision: 1.1.1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- |
-- |=====================================================================
-- | man page form__userptr.3x
-- |=====================================================================
-- |
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Form_User_Data is
use type Interfaces.C.int;
-- |
-- |
-- |
procedure Set_User_Data (Frm : in Form;
Data : in User_Access)
is
function Set_Form_Userptr (Frm : Form;
Data : User_Access) return C_Int;
pragma Import (C, Set_Form_Userptr, "set_form_userptr");
Res : constant Eti_Error := Set_Form_Userptr (Frm, Data);
begin
if Res /= E_Ok then
Eti_Exception (Res);
end if;
end Set_User_Data;
-- |
-- |
-- |
function Get_User_Data (Frm : in Form) return User_Access
is
function Form_Userptr (Frm : Form) return User_Access;
pragma Import (C, Form_Userptr, "form_userptr");
begin
return Form_Userptr (Frm);
end Get_User_Data;
procedure Get_User_Data (Frm : in Form;
Data : out User_Access)
is
begin
Data := Get_User_Data (Frm);
end Get_User_Data;
end Terminal_Interface.Curses.Forms.Form_User_Data;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 296 | ads | with STM32GD.USART.Peripheral;
with Drivers.Text_IO;
package STM32GD.Board is
pragma Preelaborate;
package USART is new STM32GD.USART.Peripheral (Filename => "Test");
package Text_IO is new Drivers.Text_IO (USART => STM32GD.Board.USART);
procedure Init;
end STM32GD.Board;
|
reznikmm/matreshka | Ada | 24,323 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_String_Expressions is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_String_Expression_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_String_Expression
(AMF.UML.String_Expressions.UML_String_Expression_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_String_Expression_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_String_Expression
(AMF.UML.String_Expressions.UML_String_Expression_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_String_Expression_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_String_Expression
(Visitor,
AMF.UML.String_Expressions.UML_String_Expression_Access (Self),
Control);
end if;
end Visit_Element;
---------------------------
-- Get_Owning_Expression --
---------------------------
overriding function Get_Owning_Expression
(Self : not null access constant UML_String_Expression_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_Owning_Expression
(Self.Element)));
end Get_Owning_Expression;
---------------------------
-- Set_Owning_Expression --
---------------------------
overriding procedure Set_Owning_Expression
(Self : not null access UML_String_Expression_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owning_Expression;
------------------------
-- Get_Sub_Expression --
------------------------
overriding function Get_Sub_Expression
(Self : not null access constant UML_String_Expression_Proxy)
return AMF.UML.String_Expressions.Collections.Set_Of_UML_String_Expression is
begin
return
AMF.UML.String_Expressions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Sub_Expression
(Self.Element)));
end Get_Sub_Expression;
-----------------
-- Get_Operand --
-----------------
overriding function Get_Operand
(Self : not null access constant UML_String_Expression_Proxy)
return AMF.UML.Value_Specifications.Collections.Ordered_Set_Of_UML_Value_Specification is
begin
return
AMF.UML.Value_Specifications.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Operand
(Self.Element)));
end Get_Operand;
----------------
-- Get_Symbol --
----------------
overriding function Get_Symbol
(Self : not null access constant UML_String_Expression_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_Symbol (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Symbol;
----------------
-- Set_Symbol --
----------------
overriding procedure Set_Symbol
(Self : not null access UML_String_Expression_Proxy;
To : AMF.Optional_String) is
begin
if To.Is_Empty then
AMF.Internals.Tables.UML_Attributes.Internal_Set_Symbol
(Self.Element, null);
else
AMF.Internals.Tables.UML_Attributes.Internal_Set_Symbol
(Self.Element,
League.Strings.Internals.Internal (To.Value));
end if;
end Set_Symbol;
--------------
-- Get_Type --
--------------
overriding function Get_Type
(Self : not null access constant UML_String_Expression_Proxy)
return AMF.UML.Types.UML_Type_Access is
begin
return
AMF.UML.Types.UML_Type_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Type
(Self.Element)));
end Get_Type;
--------------
-- Set_Type --
--------------
overriding procedure Set_Type
(Self : not null access UML_String_Expression_Proxy;
To : AMF.UML.Types.UML_Type_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Type
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Type;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_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_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_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;
------------------
-- String_Value --
------------------
overriding function String_Value
(Self : not null access constant UML_String_Expression_Proxy)
return League.Strings.Universal_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "String_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_String_Expression_Proxy.String_Value";
return String_Value (Self);
end String_Value;
-------------------
-- Boolean_Value --
-------------------
overriding function Boolean_Value
(Self : not null access constant UML_String_Expression_Proxy)
return AMF.Optional_Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Boolean_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_String_Expression_Proxy.Boolean_Value";
return Boolean_Value (Self);
end Boolean_Value;
-------------------
-- Integer_Value --
-------------------
overriding function Integer_Value
(Self : not null access constant UML_String_Expression_Proxy)
return AMF.Optional_Integer is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Integer_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_String_Expression_Proxy.Integer_Value";
return Integer_Value (Self);
end Integer_Value;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_String_Expression_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_String_Expression_Proxy.Is_Compatible_With";
return Is_Compatible_With (Self, P);
end Is_Compatible_With;
-------------------
-- Is_Computable --
-------------------
overriding function Is_Computable
(Self : not null access constant UML_String_Expression_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Computable unimplemented");
raise Program_Error with "Unimplemented procedure UML_String_Expression_Proxy.Is_Computable";
return Is_Computable (Self);
end Is_Computable;
-------------
-- Is_Null --
-------------
overriding function Is_Null
(Self : not null access constant UML_String_Expression_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Null unimplemented");
raise Program_Error with "Unimplemented procedure UML_String_Expression_Proxy.Is_Null";
return Is_Null (Self);
end Is_Null;
----------------
-- Real_Value --
----------------
overriding function Real_Value
(Self : not null access constant UML_String_Expression_Proxy)
return AMF.Optional_Real is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Real_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_String_Expression_Proxy.Real_Value";
return Real_Value (Self);
end Real_Value;
------------------
-- String_Value --
------------------
overriding function String_Value
(Self : not null access constant UML_String_Expression_Proxy)
return AMF.Optional_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "String_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_String_Expression_Proxy.String_Value";
return String_Value (Self);
end String_Value;
---------------------
-- Unlimited_Value --
---------------------
overriding function Unlimited_Value
(Self : not null access constant UML_String_Expression_Proxy)
return AMF.Optional_Unlimited_Natural is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Unlimited_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_String_Expression_Proxy.Unlimited_Value";
return Unlimited_Value (Self);
end Unlimited_Value;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_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_String_Expression_Proxy.Namespace";
return Namespace (Self);
end Namespace;
---------------------------
-- Is_Template_Parameter --
---------------------------
overriding function Is_Template_Parameter
(Self : not null access constant UML_String_Expression_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_String_Expression_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
-----------------
-- Is_Template --
-----------------
overriding function Is_Template
(Self : not null access constant UML_String_Expression_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_String_Expression_Proxy.Is_Template";
return Is_Template (Self);
end Is_Template;
----------------------------
-- Parameterable_Elements --
----------------------------
overriding function Parameterable_Elements
(Self : not null access constant UML_String_Expression_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_String_Expression_Proxy.Parameterable_Elements";
return Parameterable_Elements (Self);
end Parameterable_Elements;
end AMF.Internals.UML_String_Expressions;
|
NCommander/dnscatcher | Ada | 2,588 | adb | -- Copyright 2019 Michael Casadevall <[email protected]>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to
-- deal in the Software without restriction, including without limitation the
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-- sell copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
with Ada.Unchecked_Deallocation;
with DNSCatcher.Utils; use DNSCatcher.Utils;
package body DNSCatcher.DNS.Processor.RData.A_Parser is
-- A records are simply four octlets which we need to turn into integers
-- then decode back into an ASCII string
pragma Warnings (Off, "formal parameter ""DNS_Header"" is not referenced");
procedure From_Parsed_RR
(This : in out Parsed_A_RData;
DNS_Header : DNS_Packet_Header;
Parsed_RR : Parsed_DNS_Resource_Record)
is
begin
--This.A_Record := Decode_DNS_IPv4_Address (Parsed_RR);
This.A_Record := Inet_Ntop (IPv4, Parsed_RR.RData);
end From_Parsed_RR;
pragma Warnings (On, "formal parameter ""DNS_Header"" is not referenced");
function RData_To_String
(This : in Parsed_A_RData)
return String
is
begin
return To_String (This.A_Record);
end RData_To_String;
function Print_Packet
(This : in Parsed_A_RData)
return String
is
begin
return "A " & RData_To_String (This);
end Print_Packet;
-- Obliberate ourselves
procedure Delete (This : in out Parsed_A_RData) is
procedure Free_Parsed_A_Record is new Ada.Unchecked_Deallocation
(Object => Parsed_A_RData, Name => Parsed_A_RData_Access);
Ptr : aliased Parsed_A_RData_Access := This'Unchecked_Access;
begin
Free_Parsed_A_Record (Ptr);
end Delete;
end DNSCatcher.DNS.Processor.RData.A_Parser;
|
DavJo-dotdotdot/Ada_Drivers_Library | Ada | 3,503 | adb | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2019, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with LSM303AGR; use LSM303AGR;
with MicroBit.Display;
with MicroBit.Display.Symbols;
with MicroBit.Accelerometer;
with MicroBit.Console;
with MicroBit.Time;
use MicroBit;
procedure Main is
Data: All_Axes_Data;
Threshold : constant := 150;
begin
loop
-- Read the accelerometer data
Data := Accelerometer.Data;
-- Print the data on the serial port
Console.Put_Line ("X:" & Data.X'Img & ASCII.HT &
"Y:" & Data.Y'Img & ASCII.HT &
"Z:" & Data.Z'Img);
-- Clear the LED matrix
Display.Clear;
-- Draw a symbol on the LED matrix depending on the orientation of the
-- micro:bit.
if Data.X > Threshold then
Display.Symbols.Left_Arrow;
elsif Data.X < -Threshold then
Display.Symbols.Right_Arrow;
elsif Data.Y > Threshold then
Display.Symbols.Up_Arrow;
elsif Data.Y < -Threshold then
Display.Symbols.Down_Arrow;
else
Display.Symbols.Heart;
end if;
-- Do nothing for 100 milliseconds
Time.Sleep (100);
end loop;
end Main;
|
AdaCore/libadalang | Ada | 223 | ads | generic
type Element is (<>);
package Main_Generic_Package is
pragma Pure;
generic
with function Element_Op (X, Y : Element) return Element;
procedure Operation (X : Integer);
end Main_Generic_Package;
|
AdaCore/Ada_Drivers_Library | Ada | 2,571 | ads | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- This file provides the declaration for the task controlling the LEDs on
-- the STM32F4 Discovery board.
package Driver is
task Controller with
Storage_Size => (4 * 1024);
end Driver;
|
yannickmoy/spat | Ada | 2,489 | adb | ------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. ([email protected])
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
------------------------------------------------------------------------------
pragma License (Unrestricted);
package body SPAT.Proof_Attempt.List is
---------------------------------------------------------------------------
-- "<"
---------------------------------------------------------------------------
not overriding
function "<" (Left : in T;
Right : in T) return Boolean
is
Left_Time : Duration := 0.0;
Right_Time : Duration := 0.0;
-- FIXME: Proof_Attempts should have a field storing the max/accumulated
-- time directly, so we don't need to recalculate it each time.
begin
for A of Left loop
Left_Time := Left_Time + A.Time;
end loop;
for A of Right loop
Right_Time := Right_Time + A.Time;
end loop;
return Left_Time > Right_Time;
end "<";
---------------------------------------------------------------------------
-- Has_Failed_Attempts
---------------------------------------------------------------------------
not overriding
function Has_Failed_Attempts (This : in T) return Boolean
is
use type Subject_Name;
begin
return (for some A of This => A.Result /= "Valid");
end Has_Failed_Attempts;
---------------------------------------------------------------------------
-- Is_Unproved
---------------------------------------------------------------------------
not overriding
function Is_Unproved (This : in T) return Boolean
is
use type Subject_Name;
begin
return (for all A of This => A.Result /= "Valid");
end Is_Unproved;
package By_Duration is new
Implementation.Vectors.Generic_Sorting ("<" => "<");
---------------------------------------------------------------------------
-- Sort_By_Duration
---------------------------------------------------------------------------
not overriding
procedure Sort_By_Duration (Container : in out T) is
begin
By_Duration.Sort (Implementation.Vectors.Vector (Container));
end Sort_By_Duration;
end SPAT.Proof_Attempt.List;
|
pat-rogers/LmcpGen | Ada | 36,014 | ads | with AVTAS.LMCP.Types; use AVTAS.LMCP.Types;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with System; use System;
with Ada.Unchecked_Conversion;
with GNAT.Byte_Swapping;
with Interfaces;
package AVTAS.LMCP.ByteBuffers with
SPARK_Mode
is
pragma Assertion_Policy (Pre => Check);
-- The preconditions are required unless the clients are proved too. This
-- pragma overrides the effect of the -gnata switch.
pragma Unevaluated_Use_Of_Old (Allow);
Maximum_Length : constant := UInt32'Last - 8;
-- The largest value that we insert/remove (that is not an array) is eight
-- bytes wide, therefore the max length is 8 less than 'Last in order to
-- avoid overflow.
type Index is new Interfaces.Integer_64 range 0 .. Interfaces.Integer_64 (Maximum_Length);
subtype NonZero_Index is Index range 1 .. Index'Last;
type ByteBuffer (Capacity : NonZero_Index) is tagged private with
Default_Initial_Condition =>
Position (ByteBuffer) = 0 and
Remaining (ByteBuffer) = Capacity;
function Remaining (This : ByteBuffer'Class) return Index;
-- Returns the number of unused bytes remaining available in This
function Position (This : ByteBuffer'Class) return Index;
-- Returns the next place within This buffer for reading or writing
function High_Water_Mark (This : ByteBuffer'Class) return Index;
-- Returns the number of data bytes currently written into This buffer.
-- This value is never decremented by a Get_* routine, and is only set
-- back to 0 by a call to Reset.
procedure Rewind (This : in out ByteBuffer'Class) with
Post => Position (This) = 0 and
High_Water_Mark (This) = High_Water_Mark (This)'Old;
-- Rewinding the buffer position allows reading of existing content from
-- the beginning, presumably after writing values into it (via the Put_*
-- routines).
procedure Reset (This : in out ByteBuffer'Class) with
Post => Position (This) = 0 and
High_Water_Mark (This) = 0;
procedure Get_Byte (This : in out ByteBuffer'Class; Value : out Byte) with
Pre => Remaining (This) >= 1 and then
Position (This) <= High_Water_Mark (This) - 1,
Post => Position (This) = Position (This)'Old + 1 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 1 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old) = Value and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_Boolean (This : in out ByteBuffer'Class; Value : out Boolean) with
Pre => Remaining (This) >= 1 and then
Position (This) <= High_Water_Mark (This) - 1,
Post => Position (This) = Position (This)'Old + 1 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 1 = Remaining (This)'Old and then
(Raw_Bytes (This) (Position (This)'Old) /= 0) = Value and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_Int16 (This : in out ByteBuffer'Class; Value : out Int16) with
Pre => Remaining (This) >= 2 and then
Position (This) <= High_Water_Mark (This) - 2,
Post => Position (This) = Position (This)'Old + 2 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 2 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Two_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_UInt16 (This : in out ByteBuffer'Class; Value : out UInt16) with
Pre => Remaining (This) >= 2 and then
Position (This) <= High_Water_Mark (This) - 2,
Post => Position (This) = Position (This)'Old + 2 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 2 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Two_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_Int32 (This : in out ByteBuffer'Class; Value : out Int32) with
Pre => Remaining (This) >= 4 and then
Position (This) <= High_Water_Mark (This) - 4,
Post => Position (This) = Position (This)'Old + 4 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 4 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Four_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_UInt32
(This : ByteBuffer'Class;
Value : out UInt32;
First : Index)
with
Pre => First <= This.Capacity and then
High_Water_Mark (This) >= First + 3,
Post => Position (This) = Position (This)'Old and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) = Remaining (This)'Old and then
Raw_Bytes (This) = Raw_Bytes (This)'Old;
-- Gets the four bytes comprising a UInt32 value from This buffer, starting
-- at absolute index First (rather than from This.Position)
procedure Get_UInt32 (This : in out ByteBuffer'Class; Value : out UInt32) with
Pre => Remaining (This) >= 4 and then
Position (This) <= High_Water_Mark (This) - 4,
Post => Position (This) = Position (This)'Old + 4 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 4 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Four_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_Int64 (This : in out ByteBuffer'Class; Value : out Int64) with
Pre => Remaining (This) >= 8 and then
Position (This) <= High_Water_Mark (This) - 8,
Post => Position (This) = Position (This)'Old + 8 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 8 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Eight_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_UInt64 (This : in out ByteBuffer'Class; Value : out UInt64) with
Pre => Remaining (This) >= 8 and then
Position (This) <= High_Water_Mark (This) - 8,
Post => Position (This) = Position (This)'Old + 8 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 8 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Eight_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_Real32 (This : in out ByteBuffer'Class; Value : out Real32) with
Pre => Remaining (This) >= 4 and then
Position (This) <= High_Water_Mark (This) - 4,
Post => Position (This) = Position (This)'Old + 4 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 4 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Four_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Get_Real64 (This : in out ByteBuffer'Class; Value : out Real64) with
Pre => Remaining (This) >= 8 and then
Position (This) <= High_Water_Mark (This) - 8,
Post => Position (This) = Position (This)'Old + 8 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Remaining (This) + 8 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Eight_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
Max_String_Length : constant := 65_535;
-- Like the C++ version, we write strings' lengths as a UInt16 during
-- serialization.
procedure Get_String
(This : in out ByteBuffer'Class;
Value : in out String;
Last : out Integer;
Stored_Length : out UInt32)
-- The length indicated by the message data in the buffer, not
-- necessarily the length of the result.
with
Pre =>
Value'First in Positive and then
Value'Last in Positive and then
Value'Length in 1 .. Max_String_Length and then
Remaining (This) >= 2 and then
Position (This) <= High_Water_Mark (This) - 2,
-- The string content is preceded in the buffer by a two-byte length,
-- even when the string length is zero (ie when the string is empty).
Post =>
High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Stored_Length <= Max_String_Length and then
Raw_Bytes (This) (Position (This)'Old .. Position (This)'Old + 1) = As_Two_Bytes (UInt16 (Stored_Length)) and then
(if Index (Stored_Length) > Remaining (This)'Old - 2 then
-- This is a corrupted buffer: there are too few remaining bytes
-- available in the buffer to be assigned to the String Value.
Last = -1 and
Position (This) = Position (This)'Old + 2
elsif Stored_Length > Value'Length then
-- Presumably client error; the buffer is not necessarily corrupted.
Last = -1 and
Position (This) = Position (This)'Old + 2
elsif High_Water_Mark (This) + Index (Stored_length) > This.Capacity then
Last = -1 and
Position (This) = Position (This)'Old + 2
elsif Position (This)'Old + 2 + Index (Stored_Length) > High_Water_Mark (This)'Old then
Last = -1 and
Position (This) = Position (This)'Old + 2
elsif Stored_Length = 0 then
-- This is a normal case, specifically for an empty string.
Last = Value'First - 1 and then
Position (This) = Position (This)'Old + 2
else
-- This is a normal case for a non-empty string in the buffer. If
-- the stored length is <= Value'Length we only read Stored_Length
-- number of chars from the buffer, potentially leaving some of
-- Value unassigned (hence the need for Last).
Last = Value'First + (Positive (Stored_Length) - 1) and then
Position (This) = Position (This)'Old + 2 + Index (Stored_Length) and then
Equal (Raw_Bytes (This) (Position (This)'Old + 2 .. Position (This) - 1),
Value (Value'First .. Last)));
procedure Get_Unbounded_String
(This : in out ByteBuffer'Class;
Value : out Unbounded_String;
Stored_Length : out UInt32)
with
Pre => Remaining (This) >= 2 and then
Position (This) <= High_Water_Mark (This) - 2,
-- The string content is preceded in the buffer by a two-byte length,
-- even when the string length is zero (ie when the string is empty).
Post => High_Water_Mark (This) = High_Water_Mark (This)'Old and then
Stored_Length <= UInt32 (UInt16'Last) and then
Raw_Bytes (This) (Position (This)'Old .. Position (This)'Old + 1) = As_Two_Bytes (UInt16 (Stored_Length)) and then
(if Index (Stored_Length) > Remaining (This)'Old - 2 or else
Position (This)'Old + 2 + Index (Stored_length) > High_Water_Mark (This)
then
To_String (Value) = "Corrupted buffer" and then
Position (This) = Position (This)'Old + 2
elsif Stored_Length = 0 then
Position (This) = Position (This)'Old + 2
else
Position (This) = Position (This)'Old + 2 + Index (Stored_Length) and then
Equal (Raw_Bytes (This) (Position (This)'Old + 2 .. Position (This) - 1),
To_String (Value)));
procedure Put_Byte (This : in out ByteBuffer'Class; Value : Byte) with
Pre => Remaining (This) >= 1 and then
High_Water_Mark (This) <= This.Capacity - 1,
Post => Position (This) = Position (This)'Old + 1 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 1 and then
Remaining (This) + 1 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old) = Value and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_Boolean (This : in out ByteBuffer'Class; Value : Boolean) with
Pre => Remaining (This) >= 1 and then
High_Water_Mark (This) <= This.Capacity - 1,
Post => Position (This) = Position (This)'Old + 1 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 1 and then
Remaining (This) + 1 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old) = Boolean'Pos (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_Int16 (This : in out ByteBuffer'Class; Value : Int16) with
Pre => Remaining (This) >= 2 and then
High_Water_Mark (This) <= This.Capacity - 2,
Post => Position (This) = Position (This)'Old + 2 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 2 and then
Remaining (This) + 2 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Two_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_UInt16 (This : in out ByteBuffer'Class; Value : UInt16) with
Pre => Remaining (This) >= 2 and then
High_Water_Mark (This) <= This.Capacity - 2,
Post => Position (This) = Position (This)'Old + 2 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 2 and then
Remaining (This) + 2 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Two_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_Int32 (This : in out ByteBuffer'Class; Value : Int32) with
Pre => Remaining (This) >= 4 and then
High_Water_Mark (This) <= This.Capacity - 4,
Post => Position (This) = Position (This)'Old + 4 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 4 and then
Remaining (This) + 4 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Four_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_UInt32 (This : in out ByteBuffer'Class; Value : UInt32) with
Pre => Remaining (This) >= 4 and then
High_Water_Mark (This) <= This.Capacity - 4,
Post => Position (This) = Position (This)'Old + 4 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 4 and then
Remaining (This) + 4 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Four_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_Int64 (This : in out ByteBuffer'Class; Value : Int64) with
Pre => Remaining (This) >= 8 and then
High_Water_Mark (This) <= This.Capacity - 8,
Post => Position (This) = Position (This)'Old + 8 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 8 and then
Remaining (This) + 8 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Eight_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_UInt64 (This : in out ByteBuffer'Class; Value : UInt64) with
Pre => Remaining (This) >= 8 and then
High_Water_Mark (This) <= This.Capacity - 8,
Post => Position (This) = Position (This)'Old + 8 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 8 and then
Remaining (This) + 8 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Eight_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_Real32 (This : in out ByteBuffer'Class; Value : Real32) with
Pre => Remaining (This) >= 4 and then
High_Water_Mark (This) <= This.Capacity - 4,
Post => Position (This) = Position (This)'Old + 4 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 4 and then
Remaining (This) + 4 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Four_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_Real64 (This : in out ByteBuffer'Class; Value : Real64) with
Pre => Remaining (This) >= 8 and then
High_Water_Mark (This) <= This.Capacity - 8,
Post => Position (This) = Position (This)'Old + 8 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + 8 and then
Remaining (This) + 8 = Remaining (This)'Old and then
Raw_Bytes (This) (Position (This)'Old .. Position (This) - 1) = As_Eight_Bytes (Value) and then
Prior_Content_Unchanged (This, This'Old);
procedure Put_String (This : in out ByteBuffer'Class; Value : String) with
Pre => Value'First = 1 and then
Value'Length <= Max_String_Length and then
Remaining (This) >= Value'Length + 2 and then -- 2 bytes for the length
High_Water_Mark (This) <= This.Capacity - Value'Length - 2,
Post => Position (This) = Position (This)'Old + Value'Length + 2 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + Value'Length + 2 and then
Remaining (This) = Remaining (This)'Old - Value'Length - 2 and then
New_Content_Equal (This, This.Position'Old + 2, Value) and then
Prior_Content_Unchanged (This, Old_Value => This'Old);
procedure Put_Unbounded_String (This : in out ByteBuffer'Class; Value : Unbounded_String) with
Pre => Length (Value) <= Max_String_Length and then
Remaining (This) >= Index (Length (Value)) + 2 and then -- 2 bytes for the length
High_Water_Mark (This) <= This.Capacity - Index (Length (Value)) - 2,
Post => Position (This) = Position (This)'Old + Index (Length (Value)) + 2 and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + Index (Length (Value)) + 2 and then
Remaining (This) = Remaining (This)'Old - Index (Length (Value)) - 2 and then
New_Content_Equal (This, This.Position'Old + 2, To_String (Value)) and then
Prior_Content_Unchanged (This, Old_Value => This'Old);
-- The following two Put_Raw_Bytes routines populate the ByteBuffer from
-- the bytes in an array. One of the input array types is a String, the
-- other just an array of bytes. These are useful for then rewinding
-- and reading back out meaningful objects. The type String is supported
-- because that's the most convenient choice, based on client usage.
--
-- NB: these routines don't write the length into the buffer because
-- the content of the input string is an encoded (serialized) message
-- already. That also means that there is no two-byte length restriction.
procedure Put_Raw_Bytes (This : in out ByteBuffer'Class; Value : String) with
Pre => Value'Length <= Max_String_Length and then
Remaining (This) >= Value'Length and then
High_Water_Mark (This) + Value'Length <= This.Capacity,
Post => Position (This) = Position (This)'Old + Value'Length and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + Value'Length and then
Remaining (This) = Remaining (This)'Old - Value'Length and then
New_Content_Equal (This, This.Position'Old, Value) and then
Prior_Content_Unchanged (This, Old_Value => This'Old);
type Byte_Array is array (Index range <>) of aliased Byte with
Component_Size => Byte'Size;
procedure Put_Raw_Bytes (This : in out ByteBuffer'Class; Value : Byte_Array) with
Pre => Remaining (This) >= Value'Length and then
High_Water_Mark (This) + Value'Length <= This.Capacity,
Post => Position (This) = Position (This)'Old + Value'Length and then
High_Water_Mark (This) = High_Water_Mark (This)'Old + Value'Length and then
Remaining (This) = Remaining (This)'Old - Value'Length and then
New_Content_Equal (This, This.Position'Old, Value) and then
Prior_Content_Unchanged (This, Old_Value => This'Old);
function Raw_Bytes (This : ByteBuffer'Class) return Byte_Array;
-- Returns the internal byte array content, up to High_Water_Mark (This)
function Raw_Bytes (This : ByteBuffer'Class) return String with
Post => Raw_Bytes'Result'First = 1 and then
Raw_Bytes'Result'Length = Index'Min (Max_String_Length, High_Water_Mark (This));
-- Returns the internal byte array content, up to High_Water_Mark (This),
-- as a String
function Checksum (This : ByteBuffer'Class; Last : Index) return UInt32 with
Pre => Last <= This.Capacity;
-- Computes the checksum of the slice of the internal byte array from the
-- first byte up to Last
subtype Two_Bytes is Byte_Array (0 .. 1) with Object_Size => 16;
subtype Four_Bytes is Byte_Array (0 .. 3) with Object_Size => 32;
subtype Eight_Bytes is Byte_Array (0 .. 7) with Object_Size => 64;
function As_Two_Bytes (Value : Int16) return Two_Bytes;
-- Returns Value, with bytes swapped if necessary, as Two_Bytes
function As_Two_Bytes (Value : UInt16) return Two_Bytes;
-- Returns Value, with bytes swapped if necessary, as Two_Bytes
function As_Four_Bytes (Value : Real32) return Four_Bytes;
-- Returns Value, with bytes swapped if necessary, as Four_Bytes
function As_Four_Bytes (Value : Int32) return Four_Bytes;
-- Returns Value, with bytes swapped if necessary, as Four_Bytes
function As_Four_Bytes (Value : UInt32) return Four_Bytes;
-- Returns Value, with bytes swapped if necessary, as Four_Bytes
function As_Eight_Bytes (Value : Real64) return Eight_Bytes;
-- Returns Value, with bytes swapped if necessary, as Eight_Bytes
function As_Eight_Bytes (Value : Int64) return Eight_Bytes;
-- Returns Value, with bytes swapped if necessary, as Eight_Bytes
function As_Eight_Bytes (Value : UInt64) return Eight_Bytes;
-- Returns Value, with bytes swapped if necessary, as Eight_Bytes
----------------------
-- Ghost routines --
----------------------
function Prior_Content_Unchanged (New_Value, Old_Value : ByteBuffer'Class) return Boolean with
Ghost,
Pre => New_Value.Capacity = Old_Value.Capacity;
-- Returns whether the content of Old_Value was unchanged in New_Value
function New_Content_Equal
(This : ByteBuffer'Class;
Start : Index;
Comparand : String)
return
Boolean
with
Ghost,
Pre => Comparand'Length <= Max_String_Length and then
This.Capacity >= Comparand'Length and then
Start <= Index'Last - Comparand'Length and then
Start <= This.Capacity - Comparand'Length;
-- Returns whether the slice of This, starting at Start, equals the
-- Comparand of type String
function New_Content_Equal
(This : ByteBuffer'Class;
Start : Index;
Comparand : Byte_Array)
return
Boolean
with
Ghost,
Pre => Comparand'Length <= Position (This) and then
This.Capacity >= Comparand'Length and then
Start <= Index'Last - Comparand'Length and then
Start <= Position (This) - Comparand'Length and then
Start <= This.Capacity - Comparand'Length;
-- Returns whether the slice of This, starting at Start, equals the
-- Comparand of type Byte_Array
function Equal (Left : Byte_Array; Right : String) return Boolean with
Ghost;
-- Returns whether the individual bytes of the Left Byte_Array, when
-- considered as Character values, equal the individual characters of
-- the Right String
private
type ByteBuffer (Capacity : NonZero_Index) is tagged record
Content : Byte_Array (0 .. Capacity) := (others => 0);
Position : Index := 0;
Highest_Write_Pos : Index := 0;
end record with
Predicate => Position <= Capacity and then
Highest_Write_Pos <= Capacity and then
Position <= Highest_Write_Pos;
---------------
-- Raw_Bytes --
---------------
function Raw_Bytes (This : ByteBuffer'Class) return Byte_Array is
(if This.Highest_Write_Pos > 0
then This.Content (0 .. This.Highest_Write_Pos - 1)
else This.Content (1 .. 0));
---------------
-- Remaining --
---------------
function Remaining (This : ByteBuffer'Class) return Index is
(This.Capacity - This.Position);
--------------
-- Position --
--------------
function Position (This : ByteBuffer'Class) return Index is
(This.Position);
---------------------
-- High_Water_Mark --
---------------------
function High_Water_Mark (This : ByteBuffer'Class) return Index is
(This.Highest_Write_Pos);
--------------------------------------------------------------------
-- internal routines used in the following expression functions --
--------------------------------------------------------------------
function To_Eight_Bytes is new Ada.Unchecked_Conversion
(Source => Real64, Target => Eight_Bytes);
function To_Eight_Bytes is new Ada.Unchecked_Conversion
(Source => Int64, Target => Eight_Bytes);
function To_Eight_Bytes is new Ada.Unchecked_Conversion
(Source => UInt64, Target => Eight_Bytes);
function To_Four_Bytes is new Ada.Unchecked_Conversion
(Source => Real32, Target => Four_Bytes);
function To_Four_Bytes is new Ada.Unchecked_Conversion
(Source => Int32, Target => Four_Bytes);
function To_Four_Bytes is new Ada.Unchecked_Conversion
(Source => UInt32, Target => Four_Bytes);
function To_Two_Bytes is new Ada.Unchecked_Conversion
(Source => Int16, Target => Two_Bytes);
function To_Two_Bytes is new Ada.Unchecked_Conversion
(Source => UInt16, Target => Two_Bytes);
function To_Int16 is new Ada.Unchecked_Conversion
(Source => Two_Bytes, Target => Int16);
function To_UInt16 is new Ada.Unchecked_Conversion
(Source => Two_Bytes, Target => UInt16);
function To_Int32 is new Ada.Unchecked_Conversion
(Source => Four_Bytes, Target => Int32);
function To_UInt32 is new Ada.Unchecked_Conversion
(Source => Four_Bytes, Target => UInt32);
function To_Int64 is new Ada.Unchecked_Conversion
(Source => Eight_Bytes, Target => Int64);
function To_UInt64 is new Ada.Unchecked_Conversion
(Source => Eight_Bytes, Target => UInt64);
function Swapped is new GNAT.Byte_Swapping.Swapped8 (Real64);
function Swapped is new GNAT.Byte_Swapping.Swapped8 (Int64);
function Swapped is new GNAT.Byte_Swapping.Swapped8 (UInt64);
function Swapped is new GNAT.Byte_Swapping.Swapped4 (Real32);
function Swapped is new GNAT.Byte_Swapping.Swapped4 (Int32);
function Swapped is new GNAT.Byte_Swapping.Swapped4 (UInt32);
function Swapped is new GNAT.Byte_Swapping.Swapped2 (Int16);
function Swapped is new GNAT.Byte_Swapping.Swapped2 (UInt16);
--------------------
-- As_Eight_Bytes --
--------------------
pragma Warnings (Off, "Unreachable branch");
function As_Eight_Bytes (Value : Real64) return Eight_Bytes is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
To_Eight_Bytes (Swapped (Value))
else
To_Eight_Bytes (Value));
pragma Warnings (On, "Unreachable branch");
--------------------
-- As_Eight_Bytes --
--------------------
pragma Warnings (Off, "Unreachable branch");
function As_Eight_Bytes (Value : Int64) return Eight_Bytes is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
To_Eight_Bytes (Swapped (Value))
else
To_Eight_Bytes (Value));
pragma Warnings (On, "Unreachable branch");
--------------------
-- As_Eight_Bytes --
--------------------
pragma Warnings (Off, "Unreachable branch");
function As_Eight_Bytes (Value : UInt64) return Eight_Bytes is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
To_Eight_Bytes (Swapped (Value))
else
To_Eight_Bytes (Value));
pragma Warnings (On, "Unreachable branch");
-------------------
-- As_Four_Bytes --
-------------------
pragma Warnings (Off, "Unreachable branch");
function As_Four_Bytes (Value : Real32) return Four_Bytes is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
To_Four_Bytes (Swapped (Value))
else
To_Four_Bytes (Value));
pragma Warnings (On, "Unreachable branch");
-------------------
-- As_Four_Bytes --
-------------------
pragma Warnings (Off, "Unreachable branch");
function As_Four_Bytes (Value : Int32) return Four_Bytes is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
To_Four_Bytes (Swapped (Value))
else
To_Four_Bytes (Value));
pragma Warnings (On, "Unreachable branch");
-------------------
-- As_Four_Bytes --
-------------------
pragma Warnings (Off, "Unreachable branch");
function As_Four_Bytes (Value : UInt32) return Four_Bytes is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
To_Four_Bytes (Swapped (Value))
else
To_Four_Bytes (Value));
pragma Warnings (On, "Unreachable branch");
------------------
-- As_Two_Bytes --
------------------
pragma Warnings (Off, "Unreachable branch");
function As_Two_Bytes (Value : Int16) return Two_Bytes is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
To_Two_Bytes (Swapped (Value))
else
To_Two_Bytes (Value));
pragma Warnings (On, "Unreachable branch");
------------------
-- As_Two_Bytes --
------------------
pragma Warnings (Off, "Unreachable branch");
function As_Two_Bytes (Value : UInt16) return Two_Bytes is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
To_Two_Bytes (Swapped (Value))
else
To_Two_Bytes (Value));
pragma Warnings (On, "Unreachable branch");
--------------
-- As_Int16 --
--------------
pragma Warnings (Off, "Unreachable branch");
function As_Int16 (Value : Two_Bytes) return Int16 is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
Swapped (To_Int16 (Value))
else
To_Int16 (Value));
pragma Warnings (On, "Unreachable branch");
---------------
-- As_UInt16 --
---------------
pragma Warnings (Off, "Unreachable branch");
function As_UInt16 (Value : Two_Bytes) return UInt16 is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
Swapped (To_UInt16 (Value))
else
To_UInt16 (Value));
pragma Warnings (On, "Unreachable branch");
--------------
-- As_Int32 --
--------------
pragma Warnings (Off, "Unreachable branch");
function As_Int32 (Value : Four_Bytes) return Int32 is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
Swapped (To_Int32 (Value))
else
To_Int32 (Value));
pragma Warnings (On, "Unreachable branch");
---------------
-- As_UInt32 --
---------------
pragma Warnings (Off, "Unreachable branch");
function As_UInt32 (Value : Four_Bytes) return UInt32 is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
Swapped (To_UInt32 (Value))
else
To_UInt32 (Value));
pragma Warnings (On, "Unreachable branch");
--------------
-- As_Int64 --
--------------
pragma Warnings (Off, "Unreachable branch");
function As_Int64 (Value : Eight_Bytes) return Int64 is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
Swapped (To_Int64 (Value))
else
To_Int64 (Value));
pragma Warnings (On, "Unreachable branch");
---------------
-- As_UInt64 --
---------------
pragma Warnings (Off, "Unreachable branch");
function As_UInt64 (Value : Eight_Bytes) return UInt64 is
(if Standard'Default_Scalar_Storage_Order /= High_Order_First then -- not a Big Endian machine
Swapped (To_UInt64 (Value))
else
To_UInt64 (Value));
pragma Warnings (On, "Unreachable branch");
-----------------------------
-- Prior_Content_Unchanged --
-----------------------------
function Prior_Content_Unchanged (New_Value, Old_Value : ByteBuffer'Class) return Boolean is
(if Old_Value.Position > 0 then -- not empty, otherwise Unchanged'Result is trivially true
(New_Value.Content (0 .. Old_Value.Position - 1) = Old_Value.Content (0 .. Old_Value.Position - 1)));
-----------------------
-- New_Content_Equal --
-----------------------
function New_Content_Equal
(This : ByteBuffer'Class;
Start : Index;
Comparand : String)
return
Boolean
is
(if Comparand'Length > 0 then
(for all K in 1 .. Comparand'Length =>
This.Content (Start + Index (K) - 1) = Character'Pos (Comparand (Comparand'First - 1 + K))));
-----------------------
-- New_Content_Equal --
-----------------------
function New_Content_Equal
(This : ByteBuffer'Class;
Start : Index;
Comparand : Byte_Array)
return
Boolean
is
(if Comparand'Length > 0 then
This.Content (Start .. Start + Comparand'Length - 1) = Comparand);
-----------
-- Equal --
-----------
function Equal (Left : Byte_Array; Right : String) return Boolean is
(Left'Length = Right'Length and then
(for all K in Integer range 0 .. Left'Length - 1 =>
Character'Val (Left (Left'First + Index (K))) = Right (Right'First + K)));
end AVTAS.LMCP.ByteBuffers;
|
reznikmm/matreshka | Ada | 5,361 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UML.Instance_Specifications.Collections is
pragma Preelaborate;
package UML_Instance_Specification_Collections is
new AMF.Generic_Collections
(UML_Instance_Specification,
UML_Instance_Specification_Access);
type Set_Of_UML_Instance_Specification is
new UML_Instance_Specification_Collections.Set with null record;
Empty_Set_Of_UML_Instance_Specification : constant Set_Of_UML_Instance_Specification;
type Ordered_Set_Of_UML_Instance_Specification is
new UML_Instance_Specification_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UML_Instance_Specification : constant Ordered_Set_Of_UML_Instance_Specification;
type Bag_Of_UML_Instance_Specification is
new UML_Instance_Specification_Collections.Bag with null record;
Empty_Bag_Of_UML_Instance_Specification : constant Bag_Of_UML_Instance_Specification;
type Sequence_Of_UML_Instance_Specification is
new UML_Instance_Specification_Collections.Sequence with null record;
Empty_Sequence_Of_UML_Instance_Specification : constant Sequence_Of_UML_Instance_Specification;
private
Empty_Set_Of_UML_Instance_Specification : constant Set_Of_UML_Instance_Specification
:= (UML_Instance_Specification_Collections.Set with null record);
Empty_Ordered_Set_Of_UML_Instance_Specification : constant Ordered_Set_Of_UML_Instance_Specification
:= (UML_Instance_Specification_Collections.Ordered_Set with null record);
Empty_Bag_Of_UML_Instance_Specification : constant Bag_Of_UML_Instance_Specification
:= (UML_Instance_Specification_Collections.Bag with null record);
Empty_Sequence_Of_UML_Instance_Specification : constant Sequence_Of_UML_Instance_Specification
:= (UML_Instance_Specification_Collections.Sequence with null record);
end AMF.UML.Instance_Specifications.Collections;
|
AdaCore/gpr | Ada | 4,057 | ads | ------------------------------------------------------------------------------
-- --
-- GPR2 PROJECT MANAGER --
-- --
-- Copyright (C) 2019-2023, AdaCore --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
-- License for more details. You should have received a copy of the GNU --
-- General Public License distributed with GNAT; see file COPYING. If not, --
-- see <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Unbounded;
with GPR2.Path_Name;
with GPRname.Common;
with GPRname.Unit;
with GPRname.Unit.Vector;
package GPRname.Source is
use Ada.Strings.Unbounded;
use GPR2;
use GPRname.Common;
use GPRname.Unit;
use GPRname.Unit.Vector;
type Object (Unit_Based : Boolean) is tagged private;
-- A description of a source: its file name and language.
-- For unit-based languages (namely, Ada) we store a description of the
-- unit(s) defined in this source.
function Create
(File : Path_Name.Object;
Language : Language_Type;
Unit_Based : Boolean := False) return Object;
-- Creates a non-unit based source
procedure Append_Unit
(Self : in out Object;
Unit : GPRname.Unit.Object)
with Pre => Self.Unit_Based;
-- Associates a new unit to a source
function "<" (Left, Right : Object) return Boolean;
-- Compares two source objects using Path_Name comparison on the File field
overriding function "=" (Left, Right : Object) return Boolean;
-- Compares two source objects using Path_Name comparison on the File field
function File (Self : Object) return Path_Name.Object;
-- Returns the Path_Name object for the source Self
function Language (Self : Object) return Language_Type;
-- Returns the language for Self
function Units (Self : Object) return Unit.Vector.Object
with Pre => Self.Unit_Based;
-- Returns the unit(s) declared in Self (requires Self to be unit-based)
function Has_Units (Self : Object) return Boolean;
-- Returns True if Self is unit based and has units
private
type Object (Unit_Based : Boolean) is tagged record
File : Path_Name.Object := GPR2.Path_Name.Undefined;
Language : Unbounded_String;
case Unit_Based is
when True =>
Units : Unit.Vector.Object := Unit.Vector.Empty_Vector;
when others =>
null;
end case;
end record with Dynamic_Predicate =>
(if Language_Type (To_String (Language)) = Ada_Lang
then Unit_Based = True);
function "<" (Left, Right : Object) return Boolean is
(Path_Name."<" (Left.File, Right.File));
overriding function "=" (Left, Right : Object) return Boolean is
(Path_Name."=" (Left.File, Right.File));
function File (Self : Object) return Path_Name.Object is
(Self.File);
function Language (Self : Object) return Language_Type is
(Language_Type (To_String (Self.Language)));
function Units (Self : Object) return Unit.Vector.Object is
(Self.Units);
function Has_Units (Self : Object) return Boolean is
(Self.Unit_Based and then not Self.Units.Is_Empty);
end GPRname.Source;
|
zhmu/ananas | Ada | 22,122 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ A U X --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Package containing utility procedures used throughout the compiler.
-- Historical note. Many of the routines here were originally in Einfo, but
-- Einfo is supposed to be a relatively low level package dealing with the
-- content of entities in the tree, so this package is used for routines that
-- require more than minimal semantic knowledge.
with Alloc;
with Namet; use Namet;
with Table;
with Types; use Types;
package Sem_Aux is
--------------------------------
-- Obsolescent Warnings Table --
--------------------------------
-- This table records entities for which a pragma Obsolescent with a
-- message argument has been processed.
type OWT_Record is record
Ent : Entity_Id;
-- The entity to which the pragma applies
Msg : String_Id;
-- The string containing the message
end record;
package Obsolescent_Warnings is new Table.Table (
Table_Component_Type => OWT_Record,
Table_Index_Type => Int,
Table_Low_Bound => 0,
Table_Initial => Alloc.Obsolescent_Warnings_Initial,
Table_Increment => Alloc.Obsolescent_Warnings_Increment,
Table_Name => "Obsolescent_Warnings");
procedure Initialize;
-- Called at the start of compilation of each new main source file to
-- initialize the allocation of the Obsolescent_Warnings table.
-----------------
-- Subprograms --
-----------------
function Ancestor_Subtype (Typ : Entity_Id) return Entity_Id;
-- The argument Typ is a type or subtype entity. If the argument is a
-- subtype then it returns the subtype or type from which the subtype was
-- obtained, otherwise it returns Empty.
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function Available_View (Ent : Entity_Id) return Entity_Id;
-- Ent denotes an abstract state or a type that may come from a limited
-- with clause. Return the non-limited view of Ent if there is one or Ent
-- if this is not the case.
function Constant_Value (Ent : Entity_Id) return Node_Id;
-- Ent is a variable, constant, named integer, or named real entity. This
-- call obtains the initialization expression for the entity. Will return
-- Empty for a deferred constant whose full view is not available or
-- in some other cases of internal entities, which cannot be treated as
-- constants from the point of view of constant folding. Empty is also
-- returned for variables with no initialization expression.
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function Corresponding_Unsigned_Type (Typ : Entity_Id) return Entity_Id;
-- Typ is a signed integer subtype. This routine returns the standard
-- unsigned type with the same Esize as the implementation base type of
-- Typ, e.g. Long_Integer => Long_Unsigned.
function Enclosing_Dynamic_Scope (Ent : Entity_Id) return Entity_Id;
-- For any entity, Ent, returns the closest dynamic scope in which the
-- entity is declared or Standard_Standard for library-level entities.
function First_Discriminant (Typ : Entity_Id) return Entity_Id;
-- Typ is a type with discriminants. The discriminants are the first
-- entities declared in the type, so normally this is equivalent to
-- First_Entity. The exception arises for tagged types, where the tag
-- itself is prepended to the front of the entity chain, so the
-- First_Discriminant function steps past the tag if it is present.
-- The caller is responsible for checking that the type has discriminants.
-- When called on a private type with unknown discriminants, the function
-- always returns Empty.
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function First_Stored_Discriminant (Typ : Entity_Id) return Entity_Id;
-- Typ is a type with discriminants. Gives the first discriminant stored
-- in an object of this type. In many cases, these are the same as the
-- normal visible discriminants for the type, but in the case of renamed
-- discriminants, this is not always the case.
--
-- For tagged types, and untagged types which are root types or derived
-- types but which do not rename discriminants in their root type, the
-- stored discriminants are the same as the actual discriminants of the
-- type, and hence this function is the same as First_Discriminant.
--
-- For derived untagged types that rename discriminants in the root type
-- this is the first of the discriminants that occur in the root type. To
-- be precise, in this case stored discriminants are entities attached to
-- the entity chain of the derived type which are a copy of the
-- discriminants of the root type. Furthermore their Is_Completely_Hidden
-- flag is set since although they are actually stored in the object, they
-- are not in the set of discriminants that is visible in the type.
--
-- For derived untagged types, the set of stored discriminants are the real
-- discriminants from Gigi's standpoint, i.e. those that will be stored in
-- actual objects of the type.
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function First_Subtype (Typ : Entity_Id) return Entity_Id;
-- Applies to all types and subtypes. For types, yields the first subtype
-- of the type. For subtypes, yields the first subtype of the base type of
-- the subtype.
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function First_Tag_Component (Typ : Entity_Id) return Entity_Id;
-- Typ must be a tagged record type. This function returns the Entity for
-- the first _Tag field in the record type.
function Get_Called_Entity (Call : Node_Id) return Entity_Id;
-- Obtain the entity of the entry, operator, or subprogram being invoked
-- by call Call.
function Get_Rep_Item
(E : Entity_Id;
Nam : Name_Id;
Check_Parents : Boolean := True) return Node_Id;
-- Searches the Rep_Item chain for a given entity E, for an instance of a
-- rep item (pragma, attribute definition clause, or aspect specification)
-- whose name matches the given name Nam. If Check_Parents is False then it
-- only returns rep item that has been directly specified for E (and not
-- inherited from its parents, if any). If one is found, it is returned,
-- otherwise Empty is returned. A special case is that when Nam is
-- Name_Priority, the call will also find Interrupt_Priority.
function Get_Rep_Item
(E : Entity_Id;
Nam1 : Name_Id;
Nam2 : Name_Id;
Check_Parents : Boolean := True) return Node_Id;
-- Searches the Rep_Item chain for a given entity E, for an instance of a
-- rep item (pragma, attribute definition clause, or aspect specification)
-- whose name matches one of the given names Nam1 or Nam2. If Check_Parents
-- is False then it only returns rep item that has been directly specified
-- for E (and not inherited from its parents, if any). If one is found, it
-- is returned, otherwise Empty is returned. A special case is that when
-- one of the given names is Name_Priority, the call will also find
-- Interrupt_Priority.
function Get_Rep_Pragma
(E : Entity_Id;
Nam : Name_Id;
Check_Parents : Boolean := True) return Node_Id;
-- Searches the Rep_Item chain for a given entity E, for an instance of a
-- representation pragma whose name matches the given name Nam. If
-- Check_Parents is False then it only returns representation pragma that
-- has been directly specified for E (and not inherited from its parents,
-- if any). If one is found and if it is the first rep item in the list
-- that matches Nam, it is returned, otherwise Empty is returned. A special
-- case is that when Nam is Name_Priority, the call will also find
-- Interrupt_Priority.
function Get_Rep_Pragma
(E : Entity_Id;
Nam1 : Name_Id;
Nam2 : Name_Id;
Check_Parents : Boolean := True) return Node_Id;
-- Searches the Rep_Item chain for a given entity E, for an instance of a
-- representation pragma whose name matches one of the given names Nam1 or
-- Nam2. If Check_Parents is False then it only returns representation
-- pragma that has been directly specified for E (and not inherited from
-- its parents, if any). If one is found and if it is the first rep item in
-- the list that matches one of the given names, it is returned, otherwise
-- Empty is returned. A special case is that when one of the given names is
-- Name_Priority, the call will also find Interrupt_Priority.
function Has_Rep_Item
(E : Entity_Id;
Nam : Name_Id;
Check_Parents : Boolean := True) return Boolean;
-- Searches the Rep_Item chain for the given entity E, for an instance of a
-- rep item (pragma, attribute definition clause, or aspect specification)
-- with the given name Nam. If Check_Parents is False then it only checks
-- for a rep item that has been directly specified for E (and not inherited
-- from its parents, if any). If found then True is returned, otherwise
-- False indicates that no matching entry was found.
function Has_Rep_Item
(E : Entity_Id;
Nam1 : Name_Id;
Nam2 : Name_Id;
Check_Parents : Boolean := True) return Boolean;
-- Searches the Rep_Item chain for the given entity E, for an instance of a
-- rep item (pragma, attribute definition clause, or aspect specification)
-- with the given names Nam1 or Nam2. If Check_Parents is False then it
-- only checks for a rep item that has been directly specified for E (and
-- not inherited from its parents, if any). If found then True is returned,
-- otherwise False indicates that no matching entry was found.
function Has_Rep_Pragma
(E : Entity_Id;
Nam : Name_Id;
Check_Parents : Boolean := True) return Boolean;
-- Searches the Rep_Item chain for the given entity E, for an instance of a
-- representation pragma with the given name Nam. If Check_Parents is False
-- then it only checks for a representation pragma that has been directly
-- specified for E (and not inherited from its parents, if any). If found
-- and if it is the first rep item in the list that matches Nam then True
-- is returned, otherwise False indicates that no matching entry was found.
function Has_Rep_Pragma
(E : Entity_Id;
Nam1 : Name_Id;
Nam2 : Name_Id;
Check_Parents : Boolean := True) return Boolean;
-- Searches the Rep_Item chain for the given entity E, for an instance of a
-- representation pragma with the given names Nam1 or Nam2. If
-- Check_Parents is False then it only checks for a rep item that has been
-- directly specified for E (and not inherited from its parents, if any).
-- If found and if it is the first rep item in the list that matches one of
-- the given names then True is returned, otherwise False indicates that no
-- matching entry was found.
function Has_External_Tag_Rep_Clause (T : Entity_Id) return Boolean;
-- Defined in tagged types. Set if an External_Tag rep. clause has been
-- given for this type. Use to avoid the generation of the default
-- External_Tag.
--
-- Note: we used to use an entity flag for this purpose, but that was wrong
-- because it was not propagated from the private view to the full view. We
-- could have added that propagation, but it would have been an annoying
-- irregularity compared to other representation aspects, and the cost of
-- looking up the aspect when needed is small.
function Has_Unconstrained_Elements (T : Entity_Id) return Boolean;
-- True if T has discriminants and is unconstrained, or is an array type
-- whose element type Has_Unconstrained_Elements.
function Has_Variant_Part (Typ : Entity_Id) return Boolean;
-- Return True if the first subtype of Typ is a discriminated record type
-- which has a variant part. False otherwise.
function In_Generic_Body (Id : Entity_Id) return Boolean;
-- Determine whether entity Id appears inside a generic body
function Initialization_Suppressed (Typ : Entity_Id) return Boolean;
pragma Inline (Initialization_Suppressed);
-- Returns True if initialization should be suppressed for the given type
-- or subtype. This is true if Suppress_Initialization is set either for
-- the subtype itself, or for the corresponding base type.
function Is_Body (N : Node_Id) return Boolean;
-- Determine whether an arbitrary node denotes a body
function Is_By_Copy_Type (Ent : Entity_Id) return Boolean;
-- Ent is any entity. Returns True if Ent is a type entity where the type
-- is required to be passed by copy, as defined in (RM 6.2(3)).
function Is_By_Reference_Type (Ent : Entity_Id) return Boolean;
-- Ent is any entity. Returns True if Ent is a type entity where the type
-- is required to be passed by reference, as defined in (RM 6.2(4-9)).
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function Is_Definite_Subtype (T : Entity_Id) return Boolean;
-- T is a type entity. Returns True if T is a definite subtype.
-- Indefinite subtypes are unconstrained arrays, unconstrained
-- discriminated types without defaulted discriminants, class-wide types,
-- and types with unknown discriminants. Definite subtypes are all others
-- (elementary, constrained composites (including the case of records
-- without discriminants), and types with defaulted discriminants).
function Is_Derived_Type (Ent : Entity_Id) return Boolean;
-- Determines if the given entity Ent is a derived type. Result is always
-- false if argument is not a type.
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function Is_Generic_Formal (E : Entity_Id) return Boolean;
-- Determine whether E is a generic formal parameter. In particular this is
-- used to set the visibility of generic formals of a generic package
-- declared with a box or with partial parameterization.
function Is_Immutably_Limited_Type (Ent : Entity_Id) return Boolean;
-- Implements definition in Ada 2012 RM-7.5 (8.1/3). This differs from the
-- following predicate in that an untagged record with immutably limited
-- components is NOT by itself immutably limited. This matters, e.g. when
-- checking the legality of an access to the current instance.
function Is_Limited_View (Ent : Entity_Id) return Boolean;
-- Ent is any entity. True for a type that is "inherently" limited (i.e.
-- cannot become nonlimited). From the Ada 2005 RM-7.5(8.1/2), "a type with
-- a part that is of a task, protected, or explicitly limited record type".
-- These are the types that are defined as return-by-reference types in Ada
-- 95 (see RM95-6.5(11-16)). In Ada 2005, these are the types that require
-- build-in-place for function calls. Note that build-in-place is allowed
-- for other types, too. This is also used for identifying pure procedures
-- whose calls should not be eliminated (RM 10.2.1(18/2)).
function Is_Limited_Type (Ent : Entity_Id) return Boolean;
-- Ent is any entity. Returns true if Ent is a limited type (limited
-- private type, limited interface type, task type, protected type,
-- composite containing a limited component, or a subtype of any of
-- these types). This older routine overlaps with the previous one, this
-- should be cleaned up???
function Is_Record_Or_Limited_Type (Typ : Entity_Id) return Boolean;
-- Return True if Typ requires is a record or limited type.
function Nearest_Ancestor (Typ : Entity_Id) return Entity_Id;
-- Given a subtype Typ, this function finds out the nearest ancestor from
-- which constraints and predicates are inherited. There is no simple link
-- for doing this, consider:
--
-- subtype R is Integer range 1 .. 10;
-- type T is new R;
--
-- In this case the nearest ancestor is R, but the Etype of T'Base will
-- point to R'Base, so we have to go rummaging in the declarations to get
-- this information. It is used for making sure we freeze this before we
-- freeze Typ, and also for retrieving inherited predicate information.
-- For the case of base types or first subtypes, there is no useful entity
-- to return, so Empty is returned.
--
-- Note: this is similar to Ancestor_Subtype except that it also deals
-- with the case of derived types.
function Nearest_Dynamic_Scope (Ent : Entity_Id) return Entity_Id;
-- This is similar to Enclosing_Dynamic_Scope except that if Ent is itself
-- a dynamic scope, then it is returned. Otherwise the result is the same
-- as that returned by Enclosing_Dynamic_Scope.
function Next_Tag_Component (Tag : Entity_Id) return Entity_Id;
-- Tag must be an entity representing a _Tag field of a tagged record.
-- The result returned is the next _Tag field in this record, or Empty
-- if this is the last such field.
function Number_Discriminants (Typ : Entity_Id) return Pos;
-- Typ is a type with discriminants, yields number of discriminants in type
function Object_Type_Has_Constrained_Partial_View
(Typ : Entity_Id;
Scop : Entity_Id) return Boolean;
-- Return True if type of object has attribute Has_Constrained_Partial_View
-- set to True; in addition, within a generic body, return True if subtype
-- of the object is a descendant of an untagged generic formal private or
-- derived type, and the subtype is not an unconstrained array subtype
-- (RM 3.3(23.10/3)).
function Package_Body (E : Entity_Id) return Node_Id;
-- Given an entity for a package, return the corresponding package body, if
-- any, or else Empty.
function Package_Spec (E : Entity_Id) return Node_Id;
-- Given an entity for a package spec, return the corresponding package
-- spec if any, or else Empty.
function Package_Specification (E : Entity_Id) return Node_Id;
-- Given an entity for a package, return the corresponding package
-- specification.
function Subprogram_Body (E : Entity_Id) return Node_Id;
-- Given an entity for a subprogram (spec or body), return the
-- corresponding subprogram body if any, or else Empty.
function Subprogram_Body_Entity (E : Entity_Id) return Entity_Id;
-- Given an entity for a subprogram (spec or body), return the entity
-- corresponding to the subprogram body, which may be the same as E or
-- Empty if no body is available.
function Subprogram_Spec (E : Entity_Id) return Node_Id;
-- Given an entity for a subprogram spec, return the corresponding
-- subprogram spec if any, or else Empty.
function Subprogram_Specification (E : Entity_Id) return Node_Id;
-- Given an entity for a subprogram, return the corresponding subprogram
-- specification. If the entity is an inherited subprogram without
-- specification itself, return the specification of the inherited
-- subprogram.
function Ultimate_Alias (Prim : Entity_Id) return Entity_Id;
pragma Inline (Ultimate_Alias);
-- Return the last entity in the chain of aliased entities of Prim. If Prim
-- has no alias return Prim.
function Unit_Declaration_Node (Unit_Id : Entity_Id) return Node_Id;
-- Unit_Id is the simple name of a program unit, this function returns the
-- corresponding xxx_Declaration node for the entity. Also applies to the
-- body entities for subprograms, tasks and protected units, in which case
-- it returns the subprogram, task or protected body node for it. The unit
-- may be a child unit with any number of ancestors.
end Sem_Aux;
|
mfkiwl/ewok-kernel-security-OS | Ada | 1,957 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with system; use system;
with soc.rcc;
package body soc.exti
with spark_mode => off
is
procedure init
is
begin
for line in t_exti_line_index'range loop
clear_pending(line);
disable(line);
end loop;
soc.rcc.RCC.APB2ENR.SYSCFGEN := true;
end init;
function is_line_pending
(line : t_exti_line_index)
return boolean
is
request : t_request;
begin
request := EXTI.PR.line(line);
return (request = PENDING_REQUEST);
end is_line_pending;
procedure clear_pending
(line : in t_exti_line_index)
is
begin
EXTI.PR.line(line) := CLEAR_REQUEST;
end clear_pending;
procedure enable
(line : in t_exti_line_index)
is
begin
EXTI.IMR.line(line) := NOT_MASKED; -- interrupt is unmasked
end enable;
procedure disable
(line : in t_exti_line_index)
is
begin
EXTI.IMR.line(line) := MASKED; -- interrupt is masked
end disable;
function is_enabled (line : in t_exti_line_index)
return boolean
is
mask : t_mask;
begin
mask := EXTI.IMR.line(line);
return mask = NOT_MASKED;
end;
end soc.exti;
|
zhmu/ananas | Ada | 4,029 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ I O . F I X E D _ I O --
-- --
-- S p e c --
-- --
-- Copyright (C) 2020-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the implementation for Ada.Wide_Text_IO.Fixed_IO.
-- Routines in this package are identical semantically to those in Fixed_IO,
-- except that the default parameters have been removed because they are
-- supplied explicitly by the calls from within these units, and there are
-- additional Num and Den parameters giving the value of Num'Small, as well
-- as For0 and Aft0 giving some properties of Num'Small. In addition the Get
-- routines return the value rather than store it in an Out parameter.
private generic
type Int is range <>;
with function Scan
(Str : String;
Ptr : not null access Integer;
Max : Integer;
Num : Int;
Den : Int) return Int;
with procedure Set_Image
(V : Int;
S : in out String;
P : in out Natural;
Num : Int;
Den : Int;
For0 : Natural;
Aft0 : Natural;
Fore : Natural;
Aft : Natural;
Exp : Natural);
package Ada.Wide_Text_IO.Fixed_Aux is
function Get
(File : File_Type;
Width : Field;
Num : Int;
Den : Int) return Int;
procedure Put
(File : File_Type;
Item : Int;
Fore : Field;
Aft : Field;
Exp : Natural;
Num : Int;
Den : Int;
For0 : Natural;
Aft0 : Natural);
function Gets
(From : String;
Last : out Positive;
Num : Int;
Den : Int) return Int;
procedure Puts
(To : out String;
Item : Int;
Aft : Field;
Exp : Natural;
Num : Int;
Den : Int;
For0 : Natural;
Aft0 : Natural);
end Ada.Wide_Text_IO.Fixed_Aux;
|
io7m/coreland-lua-ada-load | Ada | 16,443 | adb | with Ada.Strings;
with Ada.Strings.Fixed;
package body Lua.Load is
package Strings reNames Ada.Strings;
package Fixed_Strings reNames Ada.Strings.Fixed;
--
-- Return float, removing from stack.
--
function Float_From_Stack (State : in State_Access_t) return Long_Float is
Number : constant Long_Float :=
Long_Float (Lua.To_Number (State.all.Lua_State, -1));
begin
Lua.Pop (State.all.Lua_State, 1);
return Number;
end Float_From_Stack;
--
-- Return string, removing from stack.
--
function String_From_Stack (State : in State_Access_t) return UString_t is
US : constant UString_t := Lua.To_Unbounded_String (State.all.Lua_State, -1);
begin
Lua.Pop (State.all.Lua_State, 1);
return US;
end String_From_Stack;
--
-- Add a Name component.
--
procedure Add_Name_Component
(State : in State_Access_t;
Name : in String) is
begin
if UB_Strings.Length (State.all.Name_Code) /= 0 then
UB_Strings.Append (State.all.Name_Code, ".");
end if;
UB_Strings.Append (State.all.Name_Code, Name);
State.all.Name_Depth := State.all.Name_Depth + 1;
end Add_Name_Component;
--
-- Remove a Name component.
--
procedure Remove_Name_Component (State : in State_Access_t) is
Length : constant Natural := UB_Strings.Length (State.all.Name_Code);
Dot : Natural := UB_Strings.Index (State.all.Name_Code, ".", Length, Strings.Backward);
begin
if Dot /= 0 then
Dot := Dot - 1;
end if;
UB_Strings.Head (State.all.Name_Code, Dot);
State.all.Name_Depth := State.all.Name_Depth - 1;
end Remove_Name_Component;
type Target_t is
(Target_Key,
Target_Value);
function Target_Name (Target : in Target_t) return String is
begin
case Target is
when Target_Key => return "Key";
when Target_Value => return "value";
end case;
end Target_Name;
--
-- Raise type error exception.
--
procedure Type_Error
(State : in State_Access_t;
Target : in Target_t;
Expected : in Lua.Type_t;
Name : in String := "") is
begin
State.all.Err_String := UB_Strings.To_Unbounded_String ("");
if UB_Strings.Length (State.all.Name_Code) /= 0 then
UB_Strings.Append (State.all.Err_String, UB_Strings.To_String (State.all.Name_Code) & ": ");
end if;
if Name /= "" then
UB_Strings.Append (State.all.Err_String, Name & ": ");
end if;
UB_Strings.Append (State.all.Err_String,
Target_Name (Target) & ": not a " & Lua.Type_Name (Expected));
raise Load_Error with UB_Strings.To_String (State.all.Err_String);
end Type_Error;
--
-- Public API.
--
--
-- Set Lua interpreter state.
--
procedure Set_Lua
(State : in State_Access_t;
Lua_State : in Lua.State_t) is
begin
State.all.Lua_State := Lua_State;
end Set_Lua;
--
-- Set file name.
--
procedure Set_File
(State : in State_Access_t;
File : in String) is
begin
State.all.Name_File := UB_Strings.To_Unbounded_String (File);
end Set_File;
--
-- Get key type.
--
function Key_Type (State : in State_Access_t) return Lua.Type_t is
begin
return Lua.Type_Of (State.all.Lua_State, -2);
end Key_Type;
--
-- Check if Key is of type Key_Type.
--
function Key_Type_Is
(State : in State_Access_t;
Type_Value : in Lua.Type_t) return Boolean is
begin
return Key_Type (State) = Type_Value;
end Key_Type_Is;
--
-- Get value type.
--
function Value_Type (State : in State_Access_t) return Lua.Type_t is
begin
return Lua.Type_Of (State.all.Lua_State, -1);
end Value_Type;
--
-- Check if value is of type Value_Type.
--
function Value_Type_Is
(State : in State_Access_t;
Type_Value : in Lua.Type_t) return Boolean is
begin
return Value_Type (State) = Type_Value;
end Value_Type_Is;
--
-- Get key on stack as number.
--
function Key (State : in State_Access_t) return Long_Float is
begin
if Key_Type_Is (State, Lua.T_Number) = False then
Type_Error
(State => State,
Target => Target_Key,
Expected => Lua.T_Number);
end if;
return Long_Float (Lua.To_Number (State.all.Lua_State, -2));
end Key;
function Key (State : in State_Access_t) return Long_Integer is
Temp_Float : constant Long_Float := Key (State);
begin
return Long_Integer (Temp_Float);
end Key;
--
-- Get key on stack as string.
--
function Key (State : in State_Access_t) return UString_t is
begin
if Key_Type_Is (State, Lua.T_String) = False then
Type_Error
(State => State,
Target => Target_Key,
Expected => Lua.T_String);
end if;
return Lua.To_Unbounded_String (State.all.Lua_State, -2);
end Key;
--
-- Get number on stack, error on invalid type.
--
function Local (State : in State_Access_t) return Long_Float is
begin
if Value_Type_Is (State, Lua.T_Number) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Expected => Lua.T_Number);
end if;
return Long_Float (Lua.To_Number (State.all.Lua_State, -1));
end Local;
function Local (State : in State_Access_t) return Long_Integer is
begin
if Value_Type_Is (State, Lua.T_Number) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Expected => Lua.T_Number);
end if;
return Long_Integer (Lua.To_Number (State.all.Lua_State, -1));
end Local;
--
-- Get number on stack, return Default on nil, raise error on invalid type.
--
function Local_Conditional
(State : in State_Access_t;
Default : in Long_Float := 0.0) return Long_Float is
begin
if Value_Type_Is (State, Lua.T_Nil) then
Lua.Pop (State.all.Lua_State, 1);
return Default;
end if;
return Local (State);
end Local_Conditional;
function Local_Conditional
(State : in State_Access_t;
Default : in Long_Integer := 0) return Long_Integer is
begin
return Long_Integer (Local_Conditional
(State => State,
Default => Long_Float (Default)));
end Local_Conditional;
--
-- Get string on stack, error on invalid type.
--
function Local (State : in State_Access_t) return UString_t is
begin
if Value_Type_Is (State, Lua.T_String) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Expected => Lua.T_String);
end if;
return Lua.To_Unbounded_String (State.all.Lua_State, -1);
end Local;
--
-- Get string on stack, return Default on nil, raise error on invalid type.
--
function Local_Conditional
(State : in State_Access_t;
Default : in String := "") return UString_t is
begin
if Value_Type_Is (State, Lua.T_Nil) then
Lua.Pop (State.all.Lua_State, 1);
return UB_Strings.To_Unbounded_String (Default);
end if;
return Local (State);
end Local_Conditional;
--
-- Get named numeric field, raise error on invalid type.
--
function Named_Local
(State : in State_Access_t;
Name : in String) return Long_Float is
begin
Lua.Get_Field (State.all.Lua_State, -1, Name);
if Value_Type_Is (State, Lua.T_Number) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Name => Name,
Expected => Lua.T_Number);
end if;
return Float_From_Stack (State);
end Named_Local;
function Named_Local
(State : in State_Access_t;
Name : in String) return Long_Integer
is
Temp_Float : constant Long_Float := (Named_Local
(State => State,
Name => Name));
begin
return Long_Integer (Temp_Float);
end Named_Local;
--
-- Get named numeric field if defined, return Default on nil, raise
-- error on other type.
--
function Named_Local_Conditional
(State : in State_Access_t;
Name : in String;
Default : in Long_Float := 0.0) return Long_Float is
begin
Lua.Get_Field (State.all.Lua_State, -1, Name);
if Value_Type_Is (State, Lua.T_Nil) then
Lua.Pop (State.all.Lua_State, 1);
return Default;
end if;
if Value_Type_Is (State, Lua.T_Number) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Name => Name,
Expected => Lua.T_Number);
end if;
return Float_From_Stack (State);
end Named_Local_Conditional;
function Named_Local_Conditional
(State : in State_Access_t;
Name : in String;
Default : in Long_Integer := 0) return Long_Integer is
begin
return Long_Integer (Named_Local_Conditional
(State => State,
Name => Name,
Default => Long_Float (Default)));
end Named_Local_Conditional;
--
-- Get named string field, raise error on other type.
--
function Named_Local
(State : in State_Access_t;
Name : in String) return UString_t is
begin
Lua.Get_Field (State.all.Lua_State, -1, Name);
if Value_Type_Is (State, Lua.T_String) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Name => Name,
Expected => Lua.T_String);
end if;
return String_From_Stack (State);
end Named_Local;
--
-- Get string if defined, raise error on other type.
--
function Named_Local_Conditional
(State : in State_Access_t;
Name : in String;
Default : in String := "") return UString_t is
begin
Lua.Get_Field (State.all.Lua_State, -1, Name);
if Value_Type_Is (State, Lua.T_Nil) then
Lua.Pop (State.all.Lua_State, 1);
return UB_Strings.To_Unbounded_String (Default);
end if;
if Value_Type_Is (State, Lua.T_String) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Name => Name,
Expected => Lua.T_String);
end if;
return String_From_Stack (State);
end Named_Local_Conditional;
--
-- Indexed local retrieval.
--
function Indexed_Local
(State : in State_Access_t;
Index : in Long_Integer) return UString_t is
begin
Lua.Push_Integer (State.all.Lua_State, Lua.Integer_t (Index));
Lua.Get_Table (State.all.Lua_State, -2);
if Value_Type_Is (State, Lua.T_String) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Name => Long_Integer'Image (Index),
Expected => Lua.T_String);
end if;
return String_From_Stack (State);
end Indexed_Local;
function Indexed_Local
(State : in State_Access_t;
Index : in Long_Integer) return Long_Float is
begin
Lua.Push_Integer (State.all.Lua_State, Lua.Integer_t (Index));
Lua.Get_Table (State.all.Lua_State, -2);
if Value_Type_Is (State, Lua.T_Number) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Name => Long_Integer'Image (Index),
Expected => Lua.T_Number);
end if;
return Float_From_Stack (State);
end Indexed_Local;
function Indexed_Local
(State : in State_Access_t;
Index : in Long_Integer) return Long_Integer
is
Temp_Float : constant Long_Float := (Indexed_Local
(State => State,
Index => Index));
begin
return Long_Integer (Temp_Float);
end Indexed_Local;
function Indexed_Local_Conditional
(State : in State_Access_t;
Index : in Long_Integer;
Default : in String := "") return UString_t is
begin
Lua.Push_Integer (State.all.Lua_State, Lua.Integer_t (Index));
Lua.Get_Table (State.all.Lua_State, -2);
if Value_Type_Is (State, Lua.T_Nil) then
Lua.Pop (State.all.Lua_State, 1);
return UB_Strings.To_Unbounded_String (Default);
end if;
if Value_Type_Is (State, Lua.T_String) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Name => Long_Integer'Image (Index),
Expected => Lua.T_String);
end if;
return String_From_Stack (State);
end Indexed_Local_Conditional;
function Indexed_Local_Conditional
(State : in State_Access_t;
Index : in Long_Integer;
Default : in Long_Float := 0.0) return Long_Float is
begin
Lua.Push_Integer (State.all.Lua_State, Lua.Integer_t (Index));
Lua.Get_Table (State.all.Lua_State, -2);
if Value_Type_Is (State, Lua.T_Nil) then
Lua.Pop (State.all.Lua_State, 1);
return Default;
end if;
if Value_Type_Is (State, Lua.T_Number) = False then
Lua.Pop (State.all.Lua_State, 1);
Type_Error
(State => State,
Target => Target_Value,
Name => Long_Integer'Image (Index),
Expected => Lua.T_Number);
end if;
return Float_From_Stack (State);
end Indexed_Local_Conditional;
function Indexed_Local_Conditional
(State : in State_Access_t;
Index : in Long_Integer;
Default : in Long_Integer := 0) return Long_Integer is
begin
return Long_Integer (Indexed_Local_Conditional
(State => State,
Index => Index,
Default => Long_Float (Default)));
end Indexed_Local_Conditional;
--
-- Push table 'Name' onto stack.
--
procedure Table_Start
(State : in State_Access_t;
Name : in String) is
begin
Lua.Get_Field (State.all.Lua_State, -1, Name);
if Value_Type_Is (State, Lua.T_Table) = False then
Type_Error
(State => State,
Target => Target_Value,
Name => Name,
Expected => Lua.T_Table);
end if;
Add_Name_Component (State, Name);
end Table_Start;
--
-- Remove table from stack.
--
procedure Table_End (State : in State_Access_t) is
begin
if Value_Type_Is (State, Lua.T_Table) = False then
Type_Error
(State => State,
Target => Target_Value,
Expected => Lua.T_Table);
end if;
Remove_Name_Component (State);
Lua.Pop (State.all.Lua_State, 1);
end Table_End;
--
-- Iterate over table, calling Process for each value.
--
procedure Table_Iterate
(State : in State_Access_t;
Process : not null access procedure
(State : in State_Access_t))
is
F_Index : Long_Float;
Index : Integer;
Added : Boolean;
begin
if Value_Type_Is (State, Lua.T_Table) = False then
Type_Error
(State => State,
Target => Target_Value,
Expected => Lua.T_Table);
end if;
-- Iterate over table keys.
Lua.Push_Nil (State.all.Lua_State);
while (Lua.Next (State.all.Lua_State, -2) /= 0) loop
Added := False;
-- build String Name based on Key type and value
case Key_Type (State) is
when Lua.T_Number =>
F_Index := Key (State);
Index := Integer (F_Index);
declare
Str : constant String :=
"[" & Fixed_Strings.Trim (Integer'Image (Index), Strings.Left) & "]";
begin
Add_Name_Component (State, Str);
Added := True;
end;
when Lua.T_String =>
Add_Name_Component (State, UB_Strings.To_String (Key (State)));
Added := True;
when others =>
null;
end case;
-- Call Process ()
begin
Process (State);
exception
when Load_Error =>
if Added then
Remove_Name_Component (State);
end if;
raise;
end;
if Added then
Remove_Name_Component (State);
end if;
Lua.Pop (State.all.Lua_State, 1);
end loop;
end Table_Iterate;
--
-- Return error string.
--
function Error_String (State : in State_Access_t) return String is
begin
return UB_Strings.To_String (State.all.Err_String);
end Error_String;
function Name_Code (State : in State_Access_t) return String is
begin
return UB_Strings.To_String (State.all.Name_Code);
end Name_Code;
end Lua.Load;
|
Componolit/libsparkcrypto | Ada | 4,942 | adb | -------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2011, Adrian-Ken Rueegsegger
-- 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 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 LSC.Internal.Ops32;
with LSC.Internal.Debug;
pragma Unreferenced (LSC.Internal.Debug);
package body LSC.Internal.HMAC_SHA1 is
IPad : constant SHA1.Block_Type :=
SHA1.Block_Type'(SHA1.Block_Index => 16#36363636#);
OPad : constant SHA1.Block_Type :=
SHA1.Block_Type'(SHA1.Block_Index => 16#5C5C5C5C#);
----------------------------------------------------------------------------
function Context_Init (Key : SHA1.Block_Type) return Context_Type
is
Result : Context_Type;
Temp : SHA1.Block_Type;
begin
pragma Debug (Debug.Put_Line ("HMAC.SHA1.Context_Init:"));
Result.Key := Key;
Result.SHA1_Context := SHA1.Context_Init;
Ops32.Block_XOR (IPad, Result.Key, Temp);
SHA1.Context_Update (Result.SHA1_Context, Temp);
return Result;
end Context_Init;
----------------------------------------------------------------------------
procedure Context_Update
(Context : in out Context_Type;
Block : in SHA1.Block_Type)
is
begin
pragma Debug (Debug.Put_Line ("HMAC.SHA1.Context_Update:"));
SHA1.Context_Update (Context.SHA1_Context, Block);
end Context_Update;
----------------------------------------------------------------------------
procedure Context_Finalize_Outer
(Context : in out Context_Type)
with Depends => (Context => Context);
procedure Context_Finalize_Outer
(Context : in out Context_Type)
is
Hash : SHA1.Hash_Type;
Temp : SHA1.Block_Type;
begin
Hash := SHA1.Get_Hash (Context.SHA1_Context);
Context.SHA1_Context := SHA1.Context_Init;
Ops32.Block_XOR (OPad, Context.Key, Temp);
SHA1.Context_Update (Context.SHA1_Context, Temp);
Temp := SHA1.Null_Block;
Ops32.Block_Copy (Hash, Temp);
SHA1.Context_Finalize (Context.SHA1_Context, Temp, 160);
end Context_Finalize_Outer;
----------------------------------------------------------------------------
procedure Context_Finalize
(Context : in out Context_Type;
Block : in SHA1.Block_Type;
Length : in SHA1.Block_Length_Type)
is
begin
pragma Debug (Debug.Put_Line ("HMAC.SHA1.Context_Finalize:"));
SHA1.Context_Finalize (Context.SHA1_Context, Block, Length);
Context_Finalize_Outer (Context);
end Context_Finalize;
----------------------------------------------------------------------------
function Get_Auth (Context : in Context_Type) return SHA1.Hash_Type
is
begin
return SHA1.Get_Hash (Context.SHA1_Context);
end Get_Auth;
----------------------------------------------------------------------------
function Authenticate
(Key : SHA1.Block_Type;
Message : SHA1.Message_Type;
Length : Types.Word64) return SHA1.Hash_Type
is
HMAC_Ctx : Context_Type;
begin
HMAC_Ctx := Context_Init (Key);
SHA1.Hash_Context (Message, Length, HMAC_Ctx.SHA1_Context);
Context_Finalize_Outer (HMAC_Ctx);
return Get_Auth (HMAC_Ctx);
end Authenticate;
end LSC.Internal.HMAC_SHA1;
|
reznikmm/matreshka | Ada | 16,282 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
package body AMF.Internals.UML_Generalization_Sets is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Generalization_Set_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_Generalization_Set
(AMF.UML.Generalization_Sets.UML_Generalization_Set_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Generalization_Set_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_Generalization_Set
(AMF.UML.Generalization_Sets.UML_Generalization_Set_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Generalization_Set_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_Generalization_Set
(Visitor,
AMF.UML.Generalization_Sets.UML_Generalization_Set_Access (Self),
Control);
end if;
end Visit_Element;
------------------------
-- Get_Generalization --
------------------------
overriding function Get_Generalization
(Self : not null access constant UML_Generalization_Set_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_Is_Covering --
---------------------
overriding function Get_Is_Covering
(Self : not null access constant UML_Generalization_Set_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Covering
(Self.Element);
end Get_Is_Covering;
---------------------
-- Set_Is_Covering --
---------------------
overriding procedure Set_Is_Covering
(Self : not null access UML_Generalization_Set_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Covering
(Self.Element, To);
end Set_Is_Covering;
---------------------
-- Get_Is_Disjoint --
---------------------
overriding function Get_Is_Disjoint
(Self : not null access constant UML_Generalization_Set_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Disjoint
(Self.Element);
end Get_Is_Disjoint;
---------------------
-- Set_Is_Disjoint --
---------------------
overriding procedure Set_Is_Disjoint
(Self : not null access UML_Generalization_Set_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Disjoint
(Self.Element, To);
end Set_Is_Disjoint;
-------------------
-- Get_Powertype --
-------------------
overriding function Get_Powertype
(Self : not null access constant UML_Generalization_Set_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
return
AMF.UML.Classifiers.UML_Classifier_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Powertype
(Self.Element)));
end Get_Powertype;
-------------------
-- Set_Powertype --
-------------------
overriding procedure Set_Powertype
(Self : not null access UML_Generalization_Set_Proxy;
To : AMF.UML.Classifiers.UML_Classifier_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Powertype
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Powertype;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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_Generalization_Set_Proxy.Namespace";
return Namespace (Self);
end Namespace;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_Generalization_Set_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_Generalization_Set_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_Generalization_Set_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_Generalization_Set_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
end AMF.Internals.UML_Generalization_Sets;
|
reznikmm/matreshka | Ada | 3,664 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Attributes;
package ODF.DOM.Svg_R_Attributes is
pragma Preelaborate;
type ODF_Svg_R_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Svg_R_Attribute_Access is
access all ODF_Svg_R_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Svg_R_Attributes;
|
reznikmm/matreshka | Ada | 6,455 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.DC;
with AMF.DG;
with AMF.Elements;
with AMF.Real_Collections;
with Matreshka.Internals.Strings;
package AMF.Internals.Tables.DD_Types is
pragma Preelaborate;
type Element_Kinds is
(E_None,
E_DG_Canvas,
E_DG_Circle,
E_DG_Clip_Path,
E_DG_Ellipse,
E_DG_Group,
E_DG_Image,
E_DG_Line,
E_DG_Linear_Gradient,
E_DG_Marked_Element,
E_DG_Marker,
E_DG_Path,
E_DG_Pattern,
E_DG_Polygon,
E_DG_Polyline,
E_DG_Radial_Gradient,
E_DG_Rectangle,
E_DG_Style,
E_DG_Text);
type Member_Kinds is
(M_None,
M_Alignment_Kind,
M_Boolean,
M_Bounds,
M_Collection_Of_Element,
M_Collection_Of_Gradient_Stop,
M_Collection_Of_Path_Command,
M_Collection_Of_Point,
M_Collection_Of_Real,
M_Collection_Of_Transform,
M_Dimension,
M_Element,
M_Holder_Of_Boolean,
M_Holder_Of_Color,
M_Holder_Of_Real,
M_Point,
M_Real,
M_String);
type Member_Record (Kind : Member_Kinds := M_None) is record
case Kind is
when M_None =>
null;
when M_Alignment_Kind =>
Alignment_Kind_Value : AMF.DC.DC_Alignment_Kind;
when M_Boolean =>
Boolean_Value : Boolean;
when M_Bounds =>
Bounds_Value : AMF.DC.DC_Bounds;
when M_Collection_Of_Element =>
Collection : AMF.Internals.AMF_Collection_Of_Element;
when M_Collection_Of_Gradient_Stop =>
Gradient_Collection : AMF.DG.Set_Of_DG_Gradient_Stop;
when M_Collection_Of_Path_Command =>
Path_Collection : AMF.DG.Sequence_Of_Path_Command;
when M_Collection_Of_Point =>
Point_Collection : AMF.DC.Sequence_Of_DC_Point;
when M_Collection_Of_Real =>
Real_Collection : AMF.Real_Collections.Sequence_Of_Real;
when M_Collection_Of_Transform =>
Transform_Collection : AMF.DG.Sequence_Of_DG_Transform;
when M_Dimension =>
Dimension_Value : AMF.DC.DC_Dimension;
when M_Element =>
Link : AMF.Internals.AMF_Link;
when M_Holder_Of_Boolean =>
Boolean_Holder : AMF.Optional_Boolean;
when M_Holder_Of_Color =>
Color_Holder : AMF.DC.Optional_DC_Color;
when M_Holder_Of_Real =>
Real_Holder : AMF.Optional_Real;
when M_Point =>
Point_Value : AMF.DC.DC_Point;
when M_Real =>
Real_Value : AMF.Real;
when M_String =>
String_Value : Matreshka.Internals.Strings.Shared_String_Access;
end case;
end record;
type Member_Array is array (Natural range 0 .. 14) of Member_Record;
type Element_Record is record
Kind : Element_Kinds := E_None;
Extent : AMF.Internals.AMF_Extent;
Proxy : AMF.Elements.Element_Access;
Member : Member_Array;
end record;
end AMF.Internals.Tables.DD_Types;
|
AdaCore/libadalang | Ada | 46 | ads | package Pkg_2 is
procedure Bar;
end Pkg_2;
|
Tim-Tom/project-euler | Ada | 1,361 | adb | with Ada.Text_IO;
with Ada.Long_Long_Integer_Text_IO;
with Ada.Numerics.Long_Long_Elementary_Functions; use Ada.Numerics.Long_Long_Elementary_Functions;
with PrimeInstances;
package body Problem_03 is
package IO renames Ada.Text_IO;
procedure Solve is
function Largest_Prime_Factor(number : in Long_Long_Integer) return Long_Long_Integer is
package Long_Long_Primes renames PrimeInstances.Long_Long_Primes;
square_root : constant Long_Long_Integer := Long_Long_Integer(Sqrt(Long_Long_Float(number)));
sieve : constant Long_Long_Primes.Sieve := Long_Long_Primes.Generate_Sieve(square_root);
quotient : Long_Long_Integer := number;
largest : Long_Long_Integer := 1;
begin
for index in sieve'Range loop
declare
prime : constant Long_Long_Integer := sieve(index);
begin
while quotient mod prime = 0 loop
quotient := quotient / prime;
largest := prime;
end loop;
end;
end loop;
if quotient /= 1 then
return quotient;
else
return largest;
end if;
end Largest_Prime_Factor;
begin
Ada.Long_Long_Integer_Text_IO.Put(Largest_Prime_Factor(600_851_475_143));
IO.New_Line;
end Solve;
end Problem_03;
|
msrLi/portingSources | Ada | 867 | adb | -- Copyright 2012-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
Full : Full_Table := (False, True, False, True, False);
begin
Do_Nothing (Full'Address); -- STOP
end Foo;
|
reznikmm/matreshka | Ada | 4,833 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.DG.Ellipses.Collections is
pragma Preelaborate;
package DG_Ellipse_Collections is
new AMF.Generic_Collections
(DG_Ellipse,
DG_Ellipse_Access);
type Set_Of_DG_Ellipse is
new DG_Ellipse_Collections.Set with null record;
Empty_Set_Of_DG_Ellipse : constant Set_Of_DG_Ellipse;
type Ordered_Set_Of_DG_Ellipse is
new DG_Ellipse_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_DG_Ellipse : constant Ordered_Set_Of_DG_Ellipse;
type Bag_Of_DG_Ellipse is
new DG_Ellipse_Collections.Bag with null record;
Empty_Bag_Of_DG_Ellipse : constant Bag_Of_DG_Ellipse;
type Sequence_Of_DG_Ellipse is
new DG_Ellipse_Collections.Sequence with null record;
Empty_Sequence_Of_DG_Ellipse : constant Sequence_Of_DG_Ellipse;
private
Empty_Set_Of_DG_Ellipse : constant Set_Of_DG_Ellipse
:= (DG_Ellipse_Collections.Set with null record);
Empty_Ordered_Set_Of_DG_Ellipse : constant Ordered_Set_Of_DG_Ellipse
:= (DG_Ellipse_Collections.Ordered_Set with null record);
Empty_Bag_Of_DG_Ellipse : constant Bag_Of_DG_Ellipse
:= (DG_Ellipse_Collections.Bag with null record);
Empty_Sequence_Of_DG_Ellipse : constant Sequence_Of_DG_Ellipse
:= (DG_Ellipse_Collections.Sequence with null record);
end AMF.DG.Ellipses.Collections;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.