CombinedText
stringlengths
4
3.42M
----------------------------------------------------------------------- -- gen-model-operations -- Operation declarations -- Copyright (C) 2012, 2016, 2017, 2021 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- 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 Gen.Model.List; package Gen.Model.Operations is type Operation_Type is (UNKNOWN, ASF_ACTION, ASF_UPLOAD, AWA_EVENT); -- ------------------------------ -- Parameter Definition -- ------------------------------ type Parameter_Definition is new Definition with private; type Parameter_Definition_Access is access all Parameter_Definition'Class; -- ------------------------------ -- Operation Definition -- ------------------------------ type Operation_Definition is new Definition with private; type Operation_Definition_Access is access all Operation_Definition'Class; -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. overriding function Get_Value (From : in Operation_Definition; Name : in String) return UBO.Object; -- Prepare the generation of the model. overriding procedure Prepare (O : in out Operation_Definition); -- Initialize the operation definition instance. overriding procedure Initialize (O : in out Operation_Definition); -- Add an operation parameter with the given name and type. procedure Add_Parameter (Into : in out Operation_Definition; Name : in UString; Of_Type : in UString; Parameter : out Parameter_Definition_Access); -- Get the operation type. function Get_Type (From : in Operation_Definition) return Operation_Type; -- Create an operation with the given name. function Create_Operation (Name : in UString) return Operation_Definition_Access; private type Parameter_Definition is new Definition with record -- The parameter type name. Type_Name : UString; end record; package Parameter_List is new Gen.Model.List (T => Parameter_Definition, T_Access => Parameter_Definition_Access); type Operation_Definition is new Definition with record Parameters : aliased Parameter_List.List_Definition; Parameters_Bean : UBO.Object; Return_Type : UString; Kind : Operation_Type := UNKNOWN; end record; end Gen.Model.Operations;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- I N T E R F A C E S . C O B O L -- -- -- -- S p e c -- -- (ASCII Version) -- -- -- -- Copyright (C) 1993-2020, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- 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 version of the COBOL interfaces package assumes that the COBOL -- compiler uses ASCII as its internal representation of characters, i.e. -- that the type COBOL_Character has the same representation as the Ada -- type Standard.Character. package Interfaces.COBOL is pragma Preelaborate (COBOL); ------------------------------------------------------------ -- Types And Operations For Internal Data Representations -- ------------------------------------------------------------ type Floating is new Float; type Long_Floating is new Long_Float; type Binary is new Integer; type Long_Binary is new Long_Long_Integer; Max_Digits_Binary : constant := 9; Max_Digits_Long_Binary : constant := 18; type Decimal_Element is mod 2**4; type Packed_Decimal is array (Positive range <>) of Decimal_Element; pragma Pack (Packed_Decimal); type COBOL_Character is new Character; Ada_To_COBOL : array (Standard.Character) of COBOL_Character := ( COBOL_Character'Val (000), COBOL_Character'Val (001), COBOL_Character'Val (002), COBOL_Character'Val (003), COBOL_Character'Val (004), COBOL_Character'Val (005), COBOL_Character'Val (006), COBOL_Character'Val (007), COBOL_Character'Val (008), COBOL_Character'Val (009), COBOL_Character'Val (010), COBOL_Character'Val (011), COBOL_Character'Val (012), COBOL_Character'Val (013), COBOL_Character'Val (014), COBOL_Character'Val (015), COBOL_Character'Val (016), COBOL_Character'Val (017), COBOL_Character'Val (018), COBOL_Character'Val (019), COBOL_Character'Val (020), COBOL_Character'Val (021), COBOL_Character'Val (022), COBOL_Character'Val (023), COBOL_Character'Val (024), COBOL_Character'Val (025), COBOL_Character'Val (026), COBOL_Character'Val (027), COBOL_Character'Val (028), COBOL_Character'Val (029), COBOL_Character'Val (030), COBOL_Character'Val (031), COBOL_Character'Val (032), COBOL_Character'Val (033), COBOL_Character'Val (034), COBOL_Character'Val (035), COBOL_Character'Val (036), COBOL_Character'Val (037), COBOL_Character'Val (038), COBOL_Character'Val (039), COBOL_Character'Val (040), COBOL_Character'Val (041), COBOL_Character'Val (042), COBOL_Character'Val (043), COBOL_Character'Val (044), COBOL_Character'Val (045), COBOL_Character'Val (046), COBOL_Character'Val (047), COBOL_Character'Val (048), COBOL_Character'Val (049), COBOL_Character'Val (050), COBOL_Character'Val (051), COBOL_Character'Val (052), COBOL_Character'Val (053), COBOL_Character'Val (054), COBOL_Character'Val (055), COBOL_Character'Val (056), COBOL_Character'Val (057), COBOL_Character'Val (058), COBOL_Character'Val (059), COBOL_Character'Val (060), COBOL_Character'Val (061), COBOL_Character'Val (062), COBOL_Character'Val (063), COBOL_Character'Val (064), COBOL_Character'Val (065), COBOL_Character'Val (066), COBOL_Character'Val (067), COBOL_Character'Val (068), COBOL_Character'Val (069), COBOL_Character'Val (070), COBOL_Character'Val (071), COBOL_Character'Val (072), COBOL_Character'Val (073), COBOL_Character'Val (074), COBOL_Character'Val (075), COBOL_Character'Val (076), COBOL_Character'Val (077), COBOL_Character'Val (078), COBOL_Character'Val (079), COBOL_Character'Val (080), COBOL_Character'Val (081), COBOL_Character'Val (082), COBOL_Character'Val (083), COBOL_Character'Val (084), COBOL_Character'Val (085), COBOL_Character'Val (086), COBOL_Character'Val (087), COBOL_Character'Val (088), COBOL_Character'Val (089), COBOL_Character'Val (090), COBOL_Character'Val (091), COBOL_Character'Val (092), COBOL_Character'Val (093), COBOL_Character'Val (094), COBOL_Character'Val (095), COBOL_Character'Val (096), COBOL_Character'Val (097), COBOL_Character'Val (098), COBOL_Character'Val (099), COBOL_Character'Val (100), COBOL_Character'Val (101), COBOL_Character'Val (102), COBOL_Character'Val (103), COBOL_Character'Val (104), COBOL_Character'Val (105), COBOL_Character'Val (106), COBOL_Character'Val (107), COBOL_Character'Val (108), COBOL_Character'Val (109), COBOL_Character'Val (110), COBOL_Character'Val (111), COBOL_Character'Val (112), COBOL_Character'Val (113), COBOL_Character'Val (114), COBOL_Character'Val (115), COBOL_Character'Val (116), COBOL_Character'Val (117), COBOL_Character'Val (118), COBOL_Character'Val (119), COBOL_Character'Val (120), COBOL_Character'Val (121), COBOL_Character'Val (122), COBOL_Character'Val (123), COBOL_Character'Val (124), COBOL_Character'Val (125), COBOL_Character'Val (126), COBOL_Character'Val (127), COBOL_Character'Val (128), COBOL_Character'Val (129), COBOL_Character'Val (130), COBOL_Character'Val (131), COBOL_Character'Val (132), COBOL_Character'Val (133), COBOL_Character'Val (134), COBOL_Character'Val (135), COBOL_Character'Val (136), COBOL_Character'Val (137), COBOL_Character'Val (138), COBOL_Character'Val (139), COBOL_Character'Val (140), COBOL_Character'Val (141), COBOL_Character'Val (142), COBOL_Character'Val (143), COBOL_Character'Val (144), COBOL_Character'Val (145), COBOL_Character'Val (146), COBOL_Character'Val (147), COBOL_Character'Val (148), COBOL_Character'Val (149), COBOL_Character'Val (150), COBOL_Character'Val (151), COBOL_Character'Val (152), COBOL_Character'Val (153), COBOL_Character'Val (154), COBOL_Character'Val (155), COBOL_Character'Val (156), COBOL_Character'Val (157), COBOL_Character'Val (158), COBOL_Character'Val (159), COBOL_Character'Val (160), COBOL_Character'Val (161), COBOL_Character'Val (162), COBOL_Character'Val (163), COBOL_Character'Val (164), COBOL_Character'Val (165), COBOL_Character'Val (166), COBOL_Character'Val (167), COBOL_Character'Val (168), COBOL_Character'Val (169), COBOL_Character'Val (170), COBOL_Character'Val (171), COBOL_Character'Val (172), COBOL_Character'Val (173), COBOL_Character'Val (174), COBOL_Character'Val (175), COBOL_Character'Val (176), COBOL_Character'Val (177), COBOL_Character'Val (178), COBOL_Character'Val (179), COBOL_Character'Val (180), COBOL_Character'Val (181), COBOL_Character'Val (182), COBOL_Character'Val (183), COBOL_Character'Val (184), COBOL_Character'Val (185), COBOL_Character'Val (186), COBOL_Character'Val (187), COBOL_Character'Val (188), COBOL_Character'Val (189), COBOL_Character'Val (190), COBOL_Character'Val (191), COBOL_Character'Val (192), COBOL_Character'Val (193), COBOL_Character'Val (194), COBOL_Character'Val (195), COBOL_Character'Val (196), COBOL_Character'Val (197), COBOL_Character'Val (198), COBOL_Character'Val (199), COBOL_Character'Val (200), COBOL_Character'Val (201), COBOL_Character'Val (202), COBOL_Character'Val (203), COBOL_Character'Val (204), COBOL_Character'Val (205), COBOL_Character'Val (206), COBOL_Character'Val (207), COBOL_Character'Val (208), COBOL_Character'Val (209), COBOL_Character'Val (210), COBOL_Character'Val (211), COBOL_Character'Val (212), COBOL_Character'Val (213), COBOL_Character'Val (214), COBOL_Character'Val (215), COBOL_Character'Val (216), COBOL_Character'Val (217), COBOL_Character'Val (218), COBOL_Character'Val (219), COBOL_Character'Val (220), COBOL_Character'Val (221), COBOL_Character'Val (222), COBOL_Character'Val (223), COBOL_Character'Val (224), COBOL_Character'Val (225), COBOL_Character'Val (226), COBOL_Character'Val (227), COBOL_Character'Val (228), COBOL_Character'Val (229), COBOL_Character'Val (230), COBOL_Character'Val (231), COBOL_Character'Val (232), COBOL_Character'Val (233), COBOL_Character'Val (234), COBOL_Character'Val (235), COBOL_Character'Val (236), COBOL_Character'Val (237), COBOL_Character'Val (238), COBOL_Character'Val (239), COBOL_Character'Val (240), COBOL_Character'Val (241), COBOL_Character'Val (242), COBOL_Character'Val (243), COBOL_Character'Val (244), COBOL_Character'Val (245), COBOL_Character'Val (246), COBOL_Character'Val (247), COBOL_Character'Val (248), COBOL_Character'Val (249), COBOL_Character'Val (250), COBOL_Character'Val (251), COBOL_Character'Val (252), COBOL_Character'Val (253), COBOL_Character'Val (254), COBOL_Character'Val (255)); COBOL_To_Ada : array (COBOL_Character) of Standard.Character := ( Standard.Character'Val (000), Standard.Character'Val (001), Standard.Character'Val (002), Standard.Character'Val (003), Standard.Character'Val (004), Standard.Character'Val (005), Standard.Character'Val (006), Standard.Character'Val (007), Standard.Character'Val (008), Standard.Character'Val (009), Standard.Character'Val (010), Standard.Character'Val (011), Standard.Character'Val (012), Standard.Character'Val (013), Standard.Character'Val (014), Standard.Character'Val (015), Standard.Character'Val (016), Standard.Character'Val (017), Standard.Character'Val (018), Standard.Character'Val (019), Standard.Character'Val (020), Standard.Character'Val (021), Standard.Character'Val (022), Standard.Character'Val (023), Standard.Character'Val (024), Standard.Character'Val (025), Standard.Character'Val (026), Standard.Character'Val (027), Standard.Character'Val (028), Standard.Character'Val (029), Standard.Character'Val (030), Standard.Character'Val (031), Standard.Character'Val (032), Standard.Character'Val (033), Standard.Character'Val (034), Standard.Character'Val (035), Standard.Character'Val (036), Standard.Character'Val (037), Standard.Character'Val (038), Standard.Character'Val (039), Standard.Character'Val (040), Standard.Character'Val (041), Standard.Character'Val (042), Standard.Character'Val (043), Standard.Character'Val (044), Standard.Character'Val (045), Standard.Character'Val (046), Standard.Character'Val (047), Standard.Character'Val (048), Standard.Character'Val (049), Standard.Character'Val (050), Standard.Character'Val (051), Standard.Character'Val (052), Standard.Character'Val (053), Standard.Character'Val (054), Standard.Character'Val (055), Standard.Character'Val (056), Standard.Character'Val (057), Standard.Character'Val (058), Standard.Character'Val (059), Standard.Character'Val (060), Standard.Character'Val (061), Standard.Character'Val (062), Standard.Character'Val (063), Standard.Character'Val (064), Standard.Character'Val (065), Standard.Character'Val (066), Standard.Character'Val (067), Standard.Character'Val (068), Standard.Character'Val (069), Standard.Character'Val (070), Standard.Character'Val (071), Standard.Character'Val (072), Standard.Character'Val (073), Standard.Character'Val (074), Standard.Character'Val (075), Standard.Character'Val (076), Standard.Character'Val (077), Standard.Character'Val (078), Standard.Character'Val (079), Standard.Character'Val (080), Standard.Character'Val (081), Standard.Character'Val (082), Standard.Character'Val (083), Standard.Character'Val (084), Standard.Character'Val (085), Standard.Character'Val (086), Standard.Character'Val (087), Standard.Character'Val (088), Standard.Character'Val (089), Standard.Character'Val (090), Standard.Character'Val (091), Standard.Character'Val (092), Standard.Character'Val (093), Standard.Character'Val (094), Standard.Character'Val (095), Standard.Character'Val (096), Standard.Character'Val (097), Standard.Character'Val (098), Standard.Character'Val (099), Standard.Character'Val (100), Standard.Character'Val (101), Standard.Character'Val (102), Standard.Character'Val (103), Standard.Character'Val (104), Standard.Character'Val (105), Standard.Character'Val (106), Standard.Character'Val (107), Standard.Character'Val (108), Standard.Character'Val (109), Standard.Character'Val (110), Standard.Character'Val (111), Standard.Character'Val (112), Standard.Character'Val (113), Standard.Character'Val (114), Standard.Character'Val (115), Standard.Character'Val (116), Standard.Character'Val (117), Standard.Character'Val (118), Standard.Character'Val (119), Standard.Character'Val (120), Standard.Character'Val (121), Standard.Character'Val (122), Standard.Character'Val (123), Standard.Character'Val (124), Standard.Character'Val (125), Standard.Character'Val (126), Standard.Character'Val (127), Standard.Character'Val (128), Standard.Character'Val (129), Standard.Character'Val (130), Standard.Character'Val (131), Standard.Character'Val (132), Standard.Character'Val (133), Standard.Character'Val (134), Standard.Character'Val (135), Standard.Character'Val (136), Standard.Character'Val (137), Standard.Character'Val (138), Standard.Character'Val (139), Standard.Character'Val (140), Standard.Character'Val (141), Standard.Character'Val (142), Standard.Character'Val (143), Standard.Character'Val (144), Standard.Character'Val (145), Standard.Character'Val (146), Standard.Character'Val (147), Standard.Character'Val (148), Standard.Character'Val (149), Standard.Character'Val (150), Standard.Character'Val (151), Standard.Character'Val (152), Standard.Character'Val (153), Standard.Character'Val (154), Standard.Character'Val (155), Standard.Character'Val (156), Standard.Character'Val (157), Standard.Character'Val (158), Standard.Character'Val (159), Standard.Character'Val (160), Standard.Character'Val (161), Standard.Character'Val (162), Standard.Character'Val (163), Standard.Character'Val (164), Standard.Character'Val (165), Standard.Character'Val (166), Standard.Character'Val (167), Standard.Character'Val (168), Standard.Character'Val (169), Standard.Character'Val (170), Standard.Character'Val (171), Standard.Character'Val (172), Standard.Character'Val (173), Standard.Character'Val (174), Standard.Character'Val (175), Standard.Character'Val (176), Standard.Character'Val (177), Standard.Character'Val (178), Standard.Character'Val (179), Standard.Character'Val (180), Standard.Character'Val (181), Standard.Character'Val (182), Standard.Character'Val (183), Standard.Character'Val (184), Standard.Character'Val (185), Standard.Character'Val (186), Standard.Character'Val (187), Standard.Character'Val (188), Standard.Character'Val (189), Standard.Character'Val (190), Standard.Character'Val (191), Standard.Character'Val (192), Standard.Character'Val (193), Standard.Character'Val (194), Standard.Character'Val (195), Standard.Character'Val (196), Standard.Character'Val (197), Standard.Character'Val (198), Standard.Character'Val (199), Standard.Character'Val (200), Standard.Character'Val (201), Standard.Character'Val (202), Standard.Character'Val (203), Standard.Character'Val (204), Standard.Character'Val (205), Standard.Character'Val (206), Standard.Character'Val (207), Standard.Character'Val (208), Standard.Character'Val (209), Standard.Character'Val (210), Standard.Character'Val (211), Standard.Character'Val (212), Standard.Character'Val (213), Standard.Character'Val (214), Standard.Character'Val (215), Standard.Character'Val (216), Standard.Character'Val (217), Standard.Character'Val (218), Standard.Character'Val (219), Standard.Character'Val (220), Standard.Character'Val (221), Standard.Character'Val (222), Standard.Character'Val (223), Standard.Character'Val (224), Standard.Character'Val (225), Standard.Character'Val (226), Standard.Character'Val (227), Standard.Character'Val (228), Standard.Character'Val (229), Standard.Character'Val (230), Standard.Character'Val (231), Standard.Character'Val (232), Standard.Character'Val (233), Standard.Character'Val (234), Standard.Character'Val (235), Standard.Character'Val (236), Standard.Character'Val (237), Standard.Character'Val (238), Standard.Character'Val (239), Standard.Character'Val (240), Standard.Character'Val (241), Standard.Character'Val (242), Standard.Character'Val (243), Standard.Character'Val (244), Standard.Character'Val (245), Standard.Character'Val (246), Standard.Character'Val (247), Standard.Character'Val (248), Standard.Character'Val (249), Standard.Character'Val (250), Standard.Character'Val (251), Standard.Character'Val (252), Standard.Character'Val (253), Standard.Character'Val (254), Standard.Character'Val (255)); type Alphanumeric is array (Positive range <>) of COBOL_Character; -- pragma Pack (Alphanumeric); function To_COBOL (Item : String) return Alphanumeric; function To_Ada (Item : Alphanumeric) return String; procedure To_COBOL (Item : String; Target : out Alphanumeric; Last : out Natural); procedure To_Ada (Item : Alphanumeric; Target : out String; Last : out Natural); type Numeric is array (Positive range <>) of COBOL_Character; -- pragma Pack (Numeric); -------------------------------------------- -- Formats For COBOL Data Representations -- -------------------------------------------- type Display_Format is private; Unsigned : constant Display_Format; Leading_Separate : constant Display_Format; Trailing_Separate : constant Display_Format; Leading_Nonseparate : constant Display_Format; Trailing_Nonseparate : constant Display_Format; type Binary_Format is private; High_Order_First : constant Binary_Format; Low_Order_First : constant Binary_Format; Native_Binary : constant Binary_Format; High_Order_First_Unsigned : constant Binary_Format; Low_Order_First_Unsigned : constant Binary_Format; Native_Binary_Unsigned : constant Binary_Format; type Packed_Format is private; Packed_Unsigned : constant Packed_Format; Packed_Signed : constant Packed_Format; ------------------------------------------------------------ -- Types For External Representation Of COBOL Binary Data -- ------------------------------------------------------------ type Byte is mod 2 ** COBOL_Character'Size; type Byte_Array is array (Positive range <>) of Byte; -- pragma Pack (Byte_Array); Conversion_Error : exception; generic type Num is delta <> digits <>; package Decimal_Conversions is -- Display Formats: data values are represented as Numeric function Valid (Item : Numeric; Format : Display_Format) return Boolean; function Length (Format : Display_Format) return Natural; function To_Decimal (Item : Numeric; Format : Display_Format) return Num; function To_Display (Item : Num; Format : Display_Format) return Numeric; -- Packed Formats: data values are represented as Packed_Decimal function Valid (Item : Packed_Decimal; Format : Packed_Format) return Boolean; function Length (Format : Packed_Format) return Natural; function To_Decimal (Item : Packed_Decimal; Format : Packed_Format) return Num; function To_Packed (Item : Num; Format : Packed_Format) return Packed_Decimal; -- Binary Formats: external data values are represented as Byte_Array function Valid (Item : Byte_Array; Format : Binary_Format) return Boolean; function Length (Format : Binary_Format) return Natural; function To_Decimal (Item : Byte_Array; Format : Binary_Format) return Num; function To_Binary (Item : Num; Format : Binary_Format) return Byte_Array; -- Internal Binary formats: data values are of type Binary/Long_Binary function To_Decimal (Item : Binary) return Num; function To_Decimal (Item : Long_Binary) return Num; function To_Binary (Item : Num) return Binary; function To_Long_Binary (Item : Num) return Long_Binary; private pragma Inline (Length); pragma Inline (To_Binary); pragma Inline (To_Decimal); pragma Inline (To_Display); pragma Inline (To_Long_Binary); pragma Inline (Valid); end Decimal_Conversions; ------------------------------------------ -- Implementation Dependent Definitions -- ------------------------------------------ -- The implementation dependent definitions are wholly contained in the -- private part of this spec (the body is implementation independent) private ------------------- -- Binary Format -- ------------------- type Binary_Format is (H, L, N, HU, LU, NU); subtype Binary_Unsigned_Format is Binary_Format range HU .. NU; High_Order_First : constant Binary_Format := H; Low_Order_First : constant Binary_Format := L; Native_Binary : constant Binary_Format := N; High_Order_First_Unsigned : constant Binary_Format := HU; Low_Order_First_Unsigned : constant Binary_Format := LU; Native_Binary_Unsigned : constant Binary_Format := NU; --------------------------- -- Packed Decimal Format -- --------------------------- -- Packed decimal numbers use the IBM mainframe format: -- dd dd ... dd dd ds -- where d are the Digits, in natural left to right order, and s is -- the sign digit. If the number of Digits os even, then the high -- order (leftmost) Digits is always a 0. For example, a six digit -- number has the format: -- 0d dd dd ds -- The sign digit has the possible values -- 16#0A# non-standard plus sign -- 16#0B# non-standard minus sign -- 16#0C# standard plus sign -- 16#0D# standard minus sign -- 16#0E# non-standard plus sign -- 16#0F# standard unsigned sign -- The non-standard signs are recognized on input, but never generated -- for output numbers. The 16#0F# distinguishes unsigned numbers from -- signed positive numbers, but is treated as positive for computational -- purposes. This format provides distinguished positive and negative -- zero values, which behave the same in all operations. type Packed_Format is (U, S); Packed_Unsigned : constant Packed_Format := U; Packed_Signed : constant Packed_Format := S; type Packed_Representation_Type is (IBM); -- Indicator for format used for packed decimal Packed_Representation : constant Packed_Representation_Type := IBM; -- This version of the spec uses IBM internal format, as described above ----------------------------- -- Display Decimal Formats -- ----------------------------- -- Display numbers are stored in standard ASCII format, as ASCII strings. -- For the embedded signs, the following codes are used: -- 0-9 positive: 16#30# .. 16#39# (i.e. natural ASCII digit code) -- 0-9 negative: 16#20# .. 16#29# (ASCII digit code - 16#10#) type Display_Format is (U, LS, TS, LN, TN); Unsigned : constant Display_Format := U; Leading_Separate : constant Display_Format := LS; Trailing_Separate : constant Display_Format := TS; Leading_Nonseparate : constant Display_Format := LN; Trailing_Nonseparate : constant Display_Format := TN; subtype COBOL_Digits is COBOL_Character range '0' .. '9'; -- Digit values in display decimal COBOL_Space : constant COBOL_Character := ' '; COBOL_Plus : constant COBOL_Character := '+'; COBOL_Minus : constant COBOL_Character := '-'; -- Sign values for Leading_Separate and Trailing_Separate formats subtype COBOL_Plus_Digits is COBOL_Character range COBOL_Character'Val (16#30#) .. COBOL_Character'Val (16#39#); -- Values used for embedded plus signs in nonseparate formats subtype COBOL_Minus_Digits is COBOL_Character range COBOL_Character'Val (16#20#) .. COBOL_Character'Val (16#29#); -- Values used for embedded minus signs in nonseparate formats end Interfaces.COBOL;
----------------------------------------------------------------------- -- gperfhash -- Perfect hash Ada generator -- Copyright (C) 2011, 2012, 2013 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Text_IO; with Ada.Strings.Unbounded; with Ada.Strings.Fixed; with Ada.IO_Exceptions; with Ada.Command_Line; with GNAT.Command_Line; with GNAT.Perfect_Hash_Generators; with Util.Log.Loggers; with Util.Files; with Util.Strings.Vectors; with Util.Strings.Transforms; -- This simple utility is an Ada perfect hash generator. Given a fixed set of keywords, -- it generates an Ada package (spec and body) which provides a perfect hash function. -- The perfect hash algorithm is in fact provided by GNAT Perfect_Hash_Generators package. -- -- Usage: gperfhash [-i] [-p package] keyword-file -- -- -i Generate a perfect hash which ignores the case -- -p package Use <b>package</b> as the name of package (default is <b>gphash</b>) -- keyword-file The file which contains the keywords, one keyword on each line procedure Gperfhash is use Util.Log.Loggers; use Ada.Strings.Unbounded; use GNAT.Command_Line; use Ada.Text_IO; -- Read a keyword and add it in the keyword list. procedure Read_Keyword (Line : in String); -- Given a package name, return the file name that correspond. function To_File_Name (Name : in String) return String; procedure Generate_Keyword_Table (Into : in out Ada.Text_IO.File_Type); -- Generate the package specification. procedure Generate_Specs (Name : in String); -- Generate the package body. procedure Generate_Body (Name : in String); Log : constant Logger := Create ("log", "samples/log4j.properties"); Pkg_Name : Unbounded_String := To_Unbounded_String ("gphash"); Names : Util.Strings.Vectors.Vector; -- When true, generate a perfect hash which ignores the case. Ignore_Case : Boolean := False; -- ------------------------------ -- Generate the keyword table. -- ------------------------------ procedure Generate_Keyword_Table (Into : in out Ada.Text_IO.File_Type) is Index : Integer := 0; procedure Print_Keyword (Pos : in Util.Strings.Vectors.Cursor); procedure Print_Table (Pos : in Util.Strings.Vectors.Cursor); -- ------------------------------ -- Print a keyword as an Ada constant string. -- ------------------------------ procedure Print_Keyword (Pos : in Util.Strings.Vectors.Cursor) is Name : constant String := Util.Strings.Vectors.Element (Pos); begin Put (Into, " K_"); Put (Into, Util.Strings.Image (Index)); Set_Col (Into, 20); Put (Into, ": aliased constant String := """); Put (Into, Name); Put_Line (Into, """;"); Index := Index + 1; end Print_Keyword; -- ------------------------------ -- Build the keyword table. -- ------------------------------ procedure Print_Table (Pos : in Util.Strings.Vectors.Cursor) is pragma Unreferenced (Pos); begin if Index > 0 then if Index mod 4 = 0 then Put_Line (Into, ","); Put (Into, " "); else Put (Into, ", "); end if; end if; Put (Into, "K_"); Put (Into, Util.Strings.Image (Index)); Put (Into, "'Access"); Index := Index + 1; end Print_Table; begin New_Line (Into); Put_Line (Into, " type Name_Access is access constant String;"); Put_Line (Into, " type Keyword_Array is array (Natural range <>) of Name_Access;"); Put_Line (Into, " Keywords : constant Keyword_Array;"); Put_Line (Into, "private"); New_Line (Into); Names.Iterate (Print_Keyword'Access); New_Line (Into); Index := 0; Put_Line (Into, " Keywords : constant Keyword_Array := ("); Put (Into, " "); Names.Iterate (Print_Table'Access); Put_Line (Into, ");"); end Generate_Keyword_Table; -- ------------------------------ -- Generate the package specification. -- ------------------------------ procedure Generate_Specs (Name : in String) is File : Ada.Text_IO.File_Type; Path : constant String := To_File_Name (Name) & ".ads"; begin Ada.Text_IO.Open (File => File, Mode => Ada.Text_IO.Out_File, Name => Path); Put_Line (File, "-- Generated by gperfhash"); Put (File, "package "); Put (File, To_String (Pkg_Name)); Put_Line (File, " is"); New_Line (File); Put_Line (File, " pragma Preelaborate;"); New_Line (File); Put_Line (File, " function Hash (S : String) return Natural;"); New_Line (File); Put_Line (File, " -- Returns true if the string <b>S</b> is a keyword."); Put_Line (File, " function Is_Keyword (S : in String) return Boolean;"); Generate_Keyword_Table (File); Put (File, "end "); Put (File, To_String (Pkg_Name)); Put (File, ";"); New_Line (File); Close (File); end Generate_Specs; -- ------------------------------ -- Generate the package body. -- ------------------------------ procedure Generate_Body (Name : in String) is -- Read the generated body file. procedure Read_Body (Line : in String); -- Re-generate the char position table to ignore the case. procedure Generate_Char_Position; Path : constant String := To_File_Name (Name) & ".adb"; File : Ada.Text_IO.File_Type; Count : Natural; Lines : Util.Strings.Vectors.Vector; -- ------------------------------ -- Read the generated body file. -- ------------------------------ procedure Read_Body (Line : in String) is begin Lines.Append (Line); end Read_Body; -- ------------------------------ -- Re-generate the char position table to ignore the case. -- ------------------------------ procedure Generate_Char_Position is use GNAT.Perfect_Hash_Generators; V : Natural; begin Put (File, " ("); for I in 0 .. 255 loop if I >= Character'Pos ('a') and I <= Character'Pos ('z') then V := Value (Used_Character_Set, I - Character'Pos ('a') + Character'Pos ('A')); else V := GNAT.Perfect_Hash_Generators.Value (Used_Character_Set, I); end if; if I > 0 then if I mod 16 = 0 then Put_Line (File, ","); Put (File, " "); else Put (File, ", "); end if; end if; Put (File, Util.Strings.Image (V)); end loop; Put_Line (File, ");"); end Generate_Char_Position; begin Util.Files.Read_File (Path => Path, Process => Read_Body'Access); Count := Natural (Lines.Length); Ada.Text_IO.Open (File => File, Mode => Ada.Text_IO.Out_File, Name => Path); Put_Line (File, "-- Generated by gperfhash"); if Ignore_Case then Put_Line (File, "with Util.Strings.Transforms;"); end if; for I in 1 .. Count loop declare L : constant String := Lines.Element (I); begin -- Replace the char position table by ours. The lower case letter are just -- mapped to the corresponding upper case letter. if Ignore_Case and I >= 6 and I <= 16 then if I = 6 then Generate_Char_Position; end if; else Put_Line (File, L); end if; -- Generate the Is_Keyword function before the package end. if I = Count - 1 then Put_Line (File, " -- Returns true if the string <b>S</b> is a keyword."); Put_Line (File, " function Is_Keyword (S : in String) return Boolean is"); Put_Line (File, " H : constant Natural := Hash (S);"); Put_Line (File, " begin"); if Ignore_Case then Put_Line (File, " return Keywords (H).all = " & "Util.Strings.Transforms.To_Upper_Case (S);"); else Put_Line (File, " return Keywords (H).all = S;"); end if; Put_Line (File, " end Is_Keyword;"); end if; end; end loop; Close (File); end Generate_Body; -- ------------------------------ -- Read a keyword and add it in the keyword list. -- ------------------------------ procedure Read_Keyword (Line : in String) is use Ada.Strings; Word : String := Fixed.Trim (Line, Both); begin if Word'Length > 0 then if Ignore_Case then Word := Util.Strings.Transforms.To_Upper_Case (Word); end if; Names.Append (Word); GNAT.Perfect_Hash_Generators.Insert (Word); end if; end Read_Keyword; -- ------------------------------ -- Given a package name, return the file name that correspond. -- ------------------------------ function To_File_Name (Name : in String) return String is Result : String (Name'Range); begin for J in Name'Range loop if Name (J) in 'A' .. 'Z' then Result (J) := Character'Val (Character'Pos (Name (J)) - Character'Pos ('A') + Character'Pos ('a')); elsif Name (J) = '.' then Result (J) := '-'; else Result (J) := Name (J); end if; end loop; return Result; end To_File_Name; begin -- Initialization is optional. Get the log configuration by reading the property -- file 'samples/log4j.properties'. The 'log.util' logger will use a DEBUG level -- and write the message in 'result.log'. Util.Log.Loggers.Initialize ("samples/log4j.properties"); loop case Getopt ("h i p: package: help") is when ASCII.NUL => exit; when 'i' => Ignore_Case := True; when 'p' => Pkg_Name := To_Unbounded_String (Parameter); when others => raise GNAT.Command_Line.Invalid_Switch; end case; end loop; declare Keywords : constant String := Get_Argument; Pkg : constant String := To_String (Pkg_Name); Count : Natural := 0; K_2_V : Float; V : Natural; Seed : constant Natural := 4321; -- Needed by the hash algorithm begin -- Read the keywords. Util.Files.Read_File (Path => Keywords, Process => Read_Keyword'Access); Count := Natural (Names.Length); if Count = 0 then Log.Error ("There is no keyword."); raise GNAT.Command_Line.Invalid_Switch; end if; -- Generate the perfect hash package. V := 2 * Count + 1; loop K_2_V := Float (V) / Float (Count); GNAT.Perfect_Hash_Generators.Initialize (Seed, K_2_V); begin GNAT.Perfect_Hash_Generators.Compute; exit; exception when GNAT.Perfect_Hash_Generators.Too_Many_Tries => V := V + 1; end; end loop; GNAT.Perfect_Hash_Generators.Produce (Pkg); -- Override what GNAT generates to have a list of keywords and other operations. Generate_Specs (Pkg); Generate_Body (Pkg); exception when Ada.IO_Exceptions.Name_Error => Log.Error ("Cannot read the keyword file."); Ada.Command_Line.Set_Exit_Status (1); end; exception when GNAT.Command_Line.Invalid_Switch => Log.Error ("Usage: gperfhash -i -p package keyword-file"); Log.Error ("-i Generate a perfect hash which ignores the case"); Log.Error ("-p package Use 'package' as the name of package (default is 'gphash')"); Log.Error ("keyword-file The file which contains the keywords, one keyword on each line"); Ada.Command_Line.Set_Exit_Status (1); end Gperfhash;
----------------------------------------------------------------------- -- awa-wikis-beans -- Beans for module wikis -- Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- 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.Beans.Objects.Time; with Util.Strings; with ADO.Utils; with ADO.Queries; with ADO.Sessions; with ADO.Datasets; with ADO.Sessions.Entities; with ADO.Parameters; with ADO.Statements; with ASF.Applications.Messages.Factory; with AWA.Services; with AWA.Services.Contexts; with AWA.Tags.Modules; with AWA.Tags.Models; with AWA.Helpers.Selectors; with AWA.Images.Modules; with Wiki.Documents; with Wiki.Parsers; with Wiki.Filters.Html; with Wiki.Filters.Autolink; with Wiki.Filters.Collectors; with Wiki.Helpers; package body AWA.Wikis.Beans is package ASC renames AWA.Services.Contexts; procedure Make_Image_Link (Renderer : in out Wiki_Links_Bean; Link : in Wiki.Strings.WString; Info : in AWA.Wikis.Models.Wiki_Image_Info; URI : out Unbounded_Wide_Wide_String; Width : in out Natural; Height : in out Natural) is Sep : Natural; begin Sep := Wiki.Strings.Index (Link, "/"); URI := Renderer.Image_Prefix; Append (URI, Wiki.Strings.To_WString (Util.Strings.Image (Integer (Info.Id)))); Append (URI, "/"); if Width = 0 and Height = 0 then Append (URI, "default/"); elsif Width = Natural'Last or Height = Natural'Last then Append (URI, "original/"); else if Width /= 0 then Append (URI, Wiki.Strings.To_WString (Util.Strings.Image (Width))); end if; Append (URI, "x"); if Height /= 0 then Append (URI, Wiki.Strings.To_WString (Util.Strings.Image (Height))); end if; Append (URI, "/"); end if; if Sep = 0 then Append (URI, Link); else Append (URI, Link (Sep + 1 .. Link'Last)); end if; if not Info.Width.Is_Null and not Info.Height.Is_Null then AWA.Images.Modules.Scale (Width => Info.Width.Value, Height => Info.Height.Value, To_Width => Width, To_Height => Height); end if; end Make_Image_Link; procedure Find_Image_Link (Renderer : in out Wiki_Links_Bean; Link : in Wiki.Strings.WString; URI : out Unbounded_Wide_Wide_String; Width : in out Natural; Height : in out Natural) is Ctx : constant ASC.Service_Context_Access := ASC.Current; Session : ADO.Sessions.Session := ASC.Get_Session (Ctx); List : AWA.Wikis.Models.Wiki_Image_Info_Vector; Sep : Natural; Query : ADO.Queries.Context; Info : AWA.Wikis.Models.Wiki_Image_Info; begin Sep := Wiki.Strings.Index (Link, "/"); Query.Bind_Param ("wiki_id", Renderer.Wiki_Space_Id); if Sep = 0 then Query.Bind_Param ("folder_name", String '("Images")); Sep := Link'First - 1; else Query.Bind_Param ("folder_name", Wiki.Strings.To_String (Link (Link'First .. Sep - 1))); end if; Query.Bind_Param ("file_name", Wiki.Strings.To_String (Link (Sep + 1 .. Link'Last))); Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Image); AWA.Wikis.Models.List (List, Session, Query); if not List.Is_Empty then Info := List.First_Element; else Info.Id := ADO.NO_IDENTIFIER; Info.Width.Is_Null := True; Info.Height.Is_Null := True; end if; Renderer.Images.Include (Link, Info); Renderer.Make_Image_Link (Link, Info, URI, Width, Height); end Find_Image_Link; -- ------------------------------ -- Get the image link that must be rendered from the wiki image link. -- ------------------------------ overriding procedure Make_Image_Link (Renderer : in out Wiki_Links_Bean; Link : in Wiki.Strings.WString; URI : out Unbounded_Wide_Wide_String; Width : in out Natural; Height : in out Natural) is Pos : Image_Info_Maps.Cursor; begin if Wiki.Helpers.Is_Url (Link) then URI := To_Unbounded_Wide_Wide_String (Link); else Pos := Renderer.Images.Find (Link); if Image_Info_Maps.Has_Element (Pos) then Renderer.Make_Image_Link (Link, Image_Info_Maps.Element (Pos), URI, Width, Height); else Renderer.Find_Image_Link (Link, URI, Width, Height); end if; end if; end Make_Image_Link; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_Links_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "count" then return Util.Beans.Objects.To_Object (Integer (From.Images.Length)); else return Util.Beans.Objects.Null_Object; end if; end Get_Value; -- ------------------------------ -- Get the number of elements in the list. -- ------------------------------ overriding function Get_Count (From : Wiki_Links_Bean) return Natural is begin return Natural (From.Images.Length); end Get_Count; -- ------------------------------ -- Set the current row index. Valid row indexes start at 1. -- ------------------------------ overriding procedure Set_Row_Index (From : in out Wiki_Links_Bean; Index : in Natural) is begin if Index = 1 then From.Pos := From.Images.First; else Image_Info_Maps.Next (From.Pos); end if; From.Info := Image_Info_Maps.Element (From.Pos); From.Info_Bean := From.Info'Unchecked_Access; end Set_Row_Index; -- ------------------------------ -- Get the element at the current row index. -- ------------------------------ overriding function Get_Row (From : in Wiki_Links_Bean) return Util.Beans.Objects.Object is begin return Util.Beans.Objects.To_Object (Value => From.Info_Bean, Storage => Util.Beans.Objects.STATIC); end Get_Row; -- ------------------------------ -- Get the page link that must be rendered from the wiki page link. -- ------------------------------ overriding procedure Make_Page_Link (Renderer : in out Wiki_Links_Bean; Link : in Wiki.Strings.WString; URI : out Unbounded_Wide_Wide_String; Exists : out Boolean) is begin if Wiki.Helpers.Is_Url (Link) then URI := To_Unbounded_Wide_Wide_String (Link); else URI := Renderer.Page_Prefix; Append (URI, Link); end if; Exists := True; end Make_Page_Link; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_Template_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "count" then return Util.Beans.Objects.To_Object (Natural (From.Templates.Length)); else return Util.Beans.Objects.Null_Object; end if; end Get_Value; -- ------------------------------ -- Get the number of elements in the list. -- ------------------------------ overriding function Get_Count (From : in Wiki_Template_Bean) return Natural is begin return Natural (From.Templates.Length); end Get_Count; -- ------------------------------ -- Set the current row index. Valid row indexes start at 1. -- ------------------------------ overriding procedure Set_Row_Index (From : in out Wiki_Template_Bean; Index : in Natural) is begin if Index = 1 then From.Pos := From.Templates.First; else Template_Maps.Next (From.Pos); end if; From.Info.Is_Public := False; From.Info.Id := ADO.NO_IDENTIFIER; From.Info.Name := Ada.Strings.Unbounded.To_Unbounded_String (Template_Maps.Key (From.Pos)); From.Info_Bean := From.Info'Unchecked_Access; end Set_Row_Index; -- ------------------------------ -- Get the element at the current row index. -- ------------------------------ overriding function Get_Row (From : in Wiki_Template_Bean) return Util.Beans.Objects.Object is begin return Util.Beans.Objects.To_Object (Value => From.Info_Bean, Storage => Util.Beans.Objects.STATIC); end Get_Row; -- ------------------------------ -- Get the template content for the plugin evaluation. -- ------------------------------ overriding procedure Get_Template (Plugin : in out Wiki_Template_Bean; Params : in out Wiki.Attributes.Attribute_List; Template : out Wiki.Strings.UString) is use Wiki.Strings; package ASC renames AWA.Services.Contexts; First : constant Wiki.Attributes.Cursor := Wiki.Attributes.First (Params); Name : constant String := "Template:" & Wiki.Attributes.Get_Value (First); Pos : constant Template_Maps.Cursor := Plugin.Templates.Find (Name); Query : ADO.Queries.Context; begin if Template_Maps.Has_Element (Pos) then Template := Template_Maps.Element (Pos); else Query.Bind_Param ("wiki_id", Plugin.Wiki_Space_Id); Query.Bind_Param ("name", Name); Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Page_Content); declare Ctx : constant ASC.Service_Context_Access := ASC.Current; Session : constant ADO.Sessions.Session := ASC.Get_Session (Ctx); Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query); Result : Ada.Strings.Unbounded.Unbounded_String; begin Stmt.Execute; if Stmt.Has_Elements then Result := Stmt.Get_Unbounded_String (0); Template := Wiki.Strings.To_UString (To_WString (Ada.Strings.Unbounded.To_String (Result))); end if; Plugin.Templates.Include (Name, Template); end; end if; end Get_Template; -- ------------------------------ -- Find a plugin knowing its name. -- ------------------------------ overriding function Find (Factory : in Wiki_Template_Bean; Name : in String) return Wiki.Plugins.Wiki_Plugin_Access is begin if Name = "if" or Name = "else" or Name = "elsif" or Name = "end" then return Factory.Condition'Unrestricted_Access; elsif Name = "set" then return Factory.Variable'Unrestricted_Access; elsif Name = "list" then return Factory.List_Variable'Unrestricted_Access; else return Factory'Unrestricted_Access; end if; end Find; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_View_Bean; Name : in String) return Util.Beans.Objects.Object is use type ADO.Identifier; begin if Name = "is_visible" then if From.Is_Public.Is_Null or else From.Acl_Id /= ADO.NO_IDENTIFIER then return Util.Beans.Objects.To_Object (False); else return Util.Beans.Objects.To_Object (From.Is_Public.Value); end if; elsif Name = "wiki_id" then return ADO.Utils.To_Object (From.Wiki_Space.Get_Id); elsif Name = "tags" then return Util.Beans.Objects.To_Object (From.Tags_Bean, Util.Beans.Objects.STATIC); elsif Name = "links" then return Util.Beans.Objects.To_Object (From.Links_Bean, Util.Beans.Objects.STATIC); elsif Name = "plugins" then return Util.Beans.Objects.To_Object (From.Plugins_Bean, Util.Beans.Objects.STATIC); elsif Name = "counter" then return Util.Beans.Objects.To_Object (From.Counter_Bean, Util.Beans.Objects.STATIC); else return AWA.Wikis.Models.Wiki_View_Info (From).Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Set the wiki identifier. -- ------------------------------ procedure Set_Wiki_Id (Into : in out Wiki_View_Bean; Id : in ADO.Identifier) is S : constant Wide_Wide_String := ADO.Identifier'Wide_Wide_Image (Id); begin Into.Wiki_Space.Set_Id (Id); Into.Plugins.Wiki_Space_Id := Id; Into.Links.Wiki_Space_Id := Id; Into.Links.Page_Prefix := Into.Module.Get_Page_Prefix; Into.Links.Image_Prefix := Into.Module.Get_Image_Prefix; Append (Into.Links.Page_Prefix, S (S'First + 1 .. S'Last)); Append (Into.Links.Page_Prefix, "/"); Append (Into.Links.Image_Prefix, S (S'First + 1 .. S'Last)); Append (Into.Links.Image_Prefix, "/"); end Set_Wiki_Id; -- ------------------------------ -- Set the value identified by the name. -- ------------------------------ overriding procedure Set_Value (From : in out Wiki_View_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "wiki_id" then From.Set_Wiki_Id (ADO.Utils.To_Identifier (Value)); else AWA.Wikis.Models.Wiki_View_Info (From).Set_Value (Name, Value); end if; exception when Constraint_Error => From.Set_Wiki_Id (ADO.NO_IDENTIFIER); end Set_Value; -- ------------------------------ -- Get the wiki syntax for the page. -- ------------------------------ function Get_Syntax (From : in Wiki_View_Bean) return Wiki.Wiki_Syntax is begin case (if From.Format.Is_Null then From.Side_Format else From.Format.Value) is when Models.FORMAT_CREOLE => return Wiki.SYNTAX_CREOLE; when Models.FORMAT_MARKDOWN => return Wiki.SYNTAX_MARKDOWN; when Models.FORMAT_HTML => return Wiki.SYNTAX_HTML; when Models.FORMAT_DOTCLEAR => return Wiki.SYNTAX_DOTCLEAR; when Models.FORMAT_MEDIAWIKI => return Wiki.SYNTAX_MEDIA_WIKI; when Models.FORMAT_PHPBB => return Wiki.SYNTAX_PHPBB; end case; end Get_Syntax; -- ------------------------------ -- Load the information about the wiki page to display it. -- ------------------------------ overriding procedure Load (Bean : in out Wiki_View_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is pragma Unreferenced (Outcome); use type ADO.Identifier; package ASC renames AWA.Services.Contexts; Ctx : constant ASC.Service_Context_Access := ASC.Current; Session : ADO.Sessions.Session := ASC.Get_Session (Ctx); Query : ADO.Queries.Context; Name : constant Ada.Strings.Unbounded.Unbounded_String := Bean.Name.Value; begin if Bean.Wiki_Space.Is_Null then Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("not-found"); return; end if; Query.Bind_Param ("wiki_id", Bean.Wiki_Space.Get_Id); if Bean.Id /= ADO.NO_IDENTIFIER then Query.Bind_Param ("id", Bean.Id); Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Page_Id); else Query.Bind_Param ("name", Name); Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Page); end if; Query.Bind_Param ("user_id", Ctx.Get_User_Identifier); ADO.Sessions.Entities.Bind_Param (Params => Query, Name => "entity_type", Table => AWA.Wikis.Models.WIKI_SPACE_TABLE, Session => Session); Bean.Load (Session, Query); if Bean.Id <= 0 or Bean.Is_Public.Is_Null then Bean.Name.Is_Null := False; Bean.Name.Value := Name; Bean.Title.Is_Null := False; Bean.Title.Value := Name; Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("not-created"); elsif not Bean.Is_Public.Value and Bean.Acl_Id <= 0 then Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("not-visible"); else -- Setup the wiki page read counter bean. ADO.Objects.Set_Value (Bean.Counter.Object, Bean.Id); Bean.Counter.Value := Bean.Read_Count.Value; -- Load the wiki page tags. Bean.Tags.Load_Tags (Session, Bean.Id); Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("loaded"); if Ctx.Get_User_Identifier /= ADO.NO_IDENTIFIER then Bean.Plugins.Condition.Append ("user", ""); Bean.Plugins.Condition.Append ("authentified", ""); else Bean.Plugins.Condition.Append ("anonymous", ""); end if; if Bean.Is_Public.Value then Bean.Plugins.Condition.Append ("public", ""); else Bean.Plugins.Condition.Append ("private", ""); end if; end if; end Load; -- ------------------------------ -- Create the Wiki_View_Bean bean instance. -- ------------------------------ function Create_Wiki_View_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is Object : constant Wiki_View_Bean_Access := new Wiki_View_Bean; begin Object.Module := Module; Object.Tags_Bean := Object.Tags'Access; Object.Tags.Set_Entity_Type (AWA.Wikis.Models.WIKI_PAGE_TABLE); Object.Tags.Set_Permission ("wiki-page-update"); Object.Counter_Bean := Object.Counter'Access; Object.Counter.Counter := AWA.Wikis.Modules.Read_Counter.Index; Object.Links_Bean := Object.Links'Access; Object.Plugins_Bean := Object.Plugins'Access; Object.Id := ADO.NO_IDENTIFIER; Object.Wiki_Space := Get_Wiki_Space_Bean ("adminWikiSpace"); -- Object.Wiki_Space_Id := ADO.NO_IDENTIFIER; return Object.all'Access; end Create_Wiki_View_Bean; function Create_From_Format is new AWA.Helpers.Selectors.Create_From_Enum (AWA.Wikis.Models.Format_Type, "wiki_format_"); -- ------------------------------ -- Get a select item list which contains a list of wiki formats. -- ------------------------------ function Create_Format_List_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is pragma Unreferenced (Module); use AWA.Helpers; begin return Selectors.Create_Selector_Bean (Bundle => "wikis", Context => null, Create => Create_From_Format'Access).all'Access; end Create_Format_List_Bean; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_Space_Bean; Name : in String) return Util.Beans.Objects.Object is begin if From.Is_Null then return Util.Beans.Objects.Null_Object; else return AWA.Wikis.Models.Wiki_Space_Bean (From).Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Set the value identified by the name. -- ------------------------------ overriding procedure Set_Value (From : in out Wiki_Space_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name /= "id" then AWA.Wikis.Models.Wiki_Space_Bean (From).Set_Value (Name, Value); elsif Name = "id" and not Util.Beans.Objects.Is_Empty (Value) then From.Module.Load_Wiki_Space (From, ADO.Utils.To_Identifier (Value)); end if; end Set_Value; -- ------------------------------ -- Create or save the wiki space. -- ------------------------------ overriding procedure Save (Bean : in out Wiki_Space_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is pragma Unreferenced (Outcome); begin if Bean.Is_Inserted then Bean.Module.Save_Wiki_Space (Bean); else Bean.Module.Create_Wiki_Space (Bean); end if; end Save; -- ------------------------------ -- Load the wiki space information. -- ------------------------------ overriding procedure Load (Bean : in out Wiki_Space_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Bean.Module.Load_Wiki_Space (Bean, Bean.Get_Id); Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("loaded"); end Load; -- Delete the wiki space. procedure Delete (Bean : in out Wiki_Space_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin null; end Delete; -- ------------------------------ -- Create the Wiki_Space_Bean bean instance. -- ------------------------------ function Create_Wiki_Space_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is Object : constant Wiki_Space_Bean_Access := new Wiki_Space_Bean; begin Object.Module := Module; return Object.all'Access; end Create_Wiki_Space_Bean; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_Page_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "wiki_id" then if From.Wiki_Space.Is_Null then return Util.Beans.Objects.Null_Object; else return ADO.Utils.To_Object (From.Wiki_Space.Get_Id); end if; elsif Name = "text" then if From.Has_Content then return Util.Beans.Objects.To_Object (From.New_Content); elsif From.Content.Is_Null then return Util.Beans.Objects.Null_Object; else return Util.Beans.Objects.To_Object (String '(From.Content.Get_Content)); end if; elsif Name = "date" then if From.Content.Is_Null then return Util.Beans.Objects.Null_Object; else return From.Content.Get_Value ("create_date"); end if; elsif Name = "format" then if not From.Content.Is_Null then return From.Content.Get_Value ("format"); elsif not From.Wiki_Space.Is_Null then return From.Wiki_Space.Get_Value ("format"); else return Util.Beans.Objects.Null_Object; end if; elsif Name = "comment" then if From.Content.Is_Null then return Util.Beans.Objects.Null_Object; else return Util.Beans.Objects.To_Object (String '(From.Content.Get_Save_Comment)); end if; elsif Name = "tags" then return Util.Beans.Objects.To_Object (From.Tags_Bean, Util.Beans.Objects.STATIC); elsif Name = "is_public" then if not From.Is_Null then return AWA.Wikis.Models.Wiki_Page_Bean (From).Get_Value (Name); elsif not From.Wiki_Space.Is_Null then return From.Wiki_Space.Get_Value (Name); else return Util.Beans.Objects.Null_Object; end if; elsif From.Is_Null then return Util.Beans.Objects.Null_Object; else return AWA.Wikis.Models.Wiki_Page_Bean (From).Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Set the value identified by the name. -- ------------------------------ overriding procedure Set_Value (From : in out Wiki_Page_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "id" then if not Util.Beans.Objects.Is_Empty (Value) then declare Id : constant ADO.Identifier := ADO.Utils.To_Identifier (Value); begin From.Module.Load_Page (From, From.Content, From.Tags, Id); end; end if; elsif Name = "wiki_id" then From.Wiki_Space.Set_Id (ADO.Utils.To_Identifier (Value)); elsif Name = "text" then From.Has_Content := True; From.New_Content := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "format" then From.Format := AWA.Wikis.Models.Format_Type_Objects.To_Value (Value); elsif Name = "comment" then From.New_Comment := Util.Beans.Objects.To_Unbounded_String (Value); From.Content.Set_Save_Comment (Util.Beans.Objects.To_String (Value)); else AWA.Wikis.Models.Wiki_Page_Bean (From).Set_Value (Name, Value); end if; exception when others => null; end Set_Value; -- ------------------------------ -- Returns True if the wiki page has a new text content and requires -- a new version to be created. -- ------------------------------ function Has_New_Content (Bean : in Wiki_Page_Bean) return Boolean is use type Ada.Strings.Unbounded.Unbounded_String; use type AWA.Wikis.Models.Format_Type; begin if not Bean.Is_Inserted then return True; elsif not Bean.Has_Content then return False; elsif Bean.Content.Get_Format /= Bean.Format then return True; else declare Current : constant Ada.Strings.Unbounded.Unbounded_String := Bean.Content.Get_Content; begin return Current /= Bean.New_Content; end; end if; end Has_New_Content; -- ------------------------------ -- Create or save the wiki page. -- ------------------------------ overriding procedure Save (Bean : in out Wiki_Page_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is use ASF.Applications; Result : ADO.Identifier; begin if not Bean.Is_Inserted then Bean.Content.Set_Content (Bean.New_Content); Bean.Content.Set_Save_Comment (Bean.New_Comment); Bean.Content.Set_Format (Bean.Format); Bean.Module.Create_Wiki_Page (Bean.Wiki_Space.all, Bean, Bean.Content); elsif not Bean.Has_New_Content then Bean.Module.Save (Bean); else Bean.Content := AWA.Wikis.Models.Null_Wiki_Content; Bean.Content.Set_Content (Bean.New_Content); Bean.Content.Set_Save_Comment (Bean.New_Comment); Bean.Content.Set_Format (Bean.Format); Bean.Module.Create_Wiki_Content (Bean, Bean.Content); end if; Result := Bean.Get_Id; Bean.Tags.Update_Tags (Result); Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("success"); exception when AWA.Wikis.Modules.Name_Used => Messages.Factory.Add_Field_Message ("name", "wikis.wiki_page_name_used"); Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("failure"); end Save; -- ------------------------------ -- Load the wiki page. -- ------------------------------ overriding procedure Load (Bean : in out Wiki_Page_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Bean.Module.Load_Page (Bean, Bean.Content, Bean.Tags, Bean.Wiki_Space.Get_Id, Bean.Get_Name); Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("loaded"); exception when ADO.Objects.NOT_FOUND => Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("not-found"); end Load; -- ------------------------------ -- Setup the wiki page for the creation. -- ------------------------------ overriding procedure Setup (Bean : in out Wiki_Page_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Bean.Module.Load_Wiki_Space (Bean.Wiki_Space.all, Bean.Wiki_Space.Get_Id); Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("loaded"); exception when ADO.Objects.NOT_FOUND => Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("not-found"); end Setup; -- ------------------------------ -- Delete the wiki page. -- ------------------------------ overriding procedure Delete (Bean : in out Wiki_Page_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is pragma Unreferenced (Outcome); begin Bean.Module.Delete (Bean); end Delete; -- ------------------------------ -- Create the Wiki_Page_Bean bean instance. -- ------------------------------ function Create_Wiki_Page_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is Object : constant Wiki_Page_Bean_Access := new Wiki_Page_Bean; begin Object.Module := Module; Object.Tags_Bean := Object.Tags'Access; Object.Tags.Set_Entity_Type (AWA.Wikis.Models.WIKI_PAGE_TABLE); Object.Tags.Set_Permission ("wiki-page-update"); Object.Wiki_Space := Get_Wiki_Space_Bean ("adminWikiSpace"); return Object.all'Access; end Create_Wiki_Page_Bean; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_List_Bean; Name : in String) return Util.Beans.Objects.Object is Pos : Natural; begin if Name = "tags" then Pos := From.Pages.Get_Row_Index; if Pos = 0 then return Util.Beans.Objects.Null_Object; end if; declare Item : constant Models.Wiki_Page_Info := From.Pages.List.Element (Pos); begin return From.Tags.Get_Tags (Item.Id); end; elsif Name = "pages" then return Util.Beans.Objects.To_Object (Value => From.Pages_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "tag" then return Util.Beans.Objects.To_Object (From.Tag); elsif Name = "page" then return Util.Beans.Objects.To_Object (From.Page); elsif Name = "sort" then return Util.Beans.Objects.To_Object (From.Sort); elsif Name = "count" then return Util.Beans.Objects.To_Object (From.Count); elsif Name = "page_count" then return Util.Beans.Objects.To_Object ((From.Count + From.Page_Size - 1) / From.Page_Size); elsif Name = "wiki_id" then return ADO.Utils.To_Object (From.Wiki_Id); elsif Name = "update_date" then if From.Pages.Get_Count = 0 then return Util.Beans.Objects.Null_Object; else declare Item : constant Models.Wiki_Page_Info := From.Pages.List.Element (1); begin return Util.Beans.Objects.Time.To_Object (Item.Create_Date); end; end if; else return From.Pages.Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Set the value identified by the name. -- ------------------------------ overriding procedure Set_Value (From : in out Wiki_List_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "tag" then From.Tag := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "page" and not Util.Beans.Objects.Is_Empty (Value) then From.Page := 1; From.Page := Util.Beans.Objects.To_Integer (Value); elsif Name = "wiki_id" and not Util.Beans.Objects.Is_Empty (Value) then From.Wiki_Id := ADO.NO_IDENTIFIER; From.Wiki_Id := ADO.Utils.To_Identifier (Value); elsif Name = "sort" and not Util.Beans.Objects.Is_Empty (Value) then From.Sort := Util.Beans.Objects.To_Unbounded_String (Value); end if; exception when Constraint_Error => null; end Set_Value; overriding procedure Load (From : in out Wiki_List_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is pragma Unreferenced (Outcome); begin From.Load_List; end Load; -- ------------------------------ -- Load the list of pages. If a tag was set, filter the list of pages with the tag. -- ------------------------------ procedure Load_List (Into : in out Wiki_List_Bean) is use AWA.Wikis.Models; use AWA.Services; use type Ada.Strings.Unbounded.Unbounded_String; use type ADO.Identifier; Ctx : constant Contexts.Service_Context_Access := AWA.Services.Contexts.Current; User : constant ADO.Identifier := Ctx.Get_User_Identifier; Session : ADO.Sessions.Session := ASC.Get_Session (Ctx); Query : ADO.Queries.Context; Count_Query : ADO.Queries.Context; Tag_Id : ADO.Identifier; First : constant Natural := (Into.Page - 1) * Into.Page_Size; Tag : constant String := Ada.Strings.Unbounded.To_String (Into.Tag); begin if Into.Wiki_Id = ADO.NO_IDENTIFIER then return; end if; Into.Wiki_Space.Set_Id (Into.Wiki_Id); if Tag'Length > 0 then AWA.Tags.Modules.Find_Tag_Id (Session, Tag, Tag_Id); if Tag_Id = ADO.NO_IDENTIFIER then return; end if; Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Page_Tag_List); Query.Bind_Param (Name => "tag", Value => Tag_Id); Count_Query.Set_Count_Query (AWA.Wikis.Models.Query_Wiki_Page_Tag_List); Count_Query.Bind_Param (Name => "tag", Value => Tag_Id); ADO.Sessions.Entities.Bind_Param (Params => Query, Name => "page_table", Table => AWA.Wikis.Models.WIKI_PAGE_TABLE, Session => Session); ADO.Sessions.Entities.Bind_Param (Params => Count_Query, Name => "page_table", Table => AWA.Wikis.Models.WIKI_PAGE_TABLE, Session => Session); else Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Page_List); Count_Query.Set_Count_Query (AWA.Wikis.Models.Query_Wiki_Page_List); end if; if Into.Sort = "name" then Query.Bind_Param (Name => "order1", Value => ADO.Parameters.Token '("page.name")); elsif Into.Sort = "recent" then Query.Bind_Param (Name => "order1", Value => ADO.Parameters.Token '("content.create_date DESC")); elsif Into.Sort = "popular" then Query.Bind_Param (Name => "order1", Value => ADO.Parameters.Token '("page.read_count DESC")); else return; end if; Query.Bind_Param (Name => "first", Value => First); Query.Bind_Param (Name => "count", Value => Into.Page_Size); Query.Bind_Param (Name => "wiki_id", Value => Into.Wiki_Id); Query.Bind_Param (Name => "user_id", Value => User); Count_Query.Bind_Param (Name => "wiki_id", Value => Into.Wiki_Id); Count_Query.Bind_Param (Name => "user_id", Value => User); ADO.Sessions.Entities.Bind_Param (Params => Query, Name => "table", Table => AWA.Wikis.Models.WIKI_SPACE_TABLE, Session => Session); ADO.Sessions.Entities.Bind_Param (Params => Count_Query, Name => "table", Table => AWA.Wikis.Models.WIKI_SPACE_TABLE, Session => Session); AWA.Wikis.Models.List (Into.Pages, Session, Query); Into.Count := ADO.Datasets.Get_Count (Session, Count_Query); declare List : ADO.Utils.Identifier_Vector; Iter : Wiki_Page_Info_Vectors.Cursor := Into.Pages.List.First; begin while Wiki_Page_Info_Vectors.Has_Element (Iter) loop List.Append (Wiki_Page_Info_Vectors.Element (Iter).Id); Wiki_Page_Info_Vectors.Next (Iter); end loop; Into.Tags.Load_Tags (Session, AWA.Wikis.Models.WIKI_PAGE_TABLE.Table.all, List); end; end Load_List; -- ------------------------------ -- Create the Wiki_List_Bean bean instance. -- ------------------------------ function Create_Wiki_List_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is Object : constant Wiki_List_Bean_Access := new Wiki_List_Bean; begin Object.Module := Module; Object.Pages_Bean := Object.Pages'Access; Object.Page_Size := 20; Object.Page := 1; Object.Count := 0; Object.Wiki_Id := ADO.NO_IDENTIFIER; Object.Wiki_Space := Get_Wiki_Space_Bean ("adminWikiSpace"); return Object.all'Access; end Create_Wiki_List_Bean; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_Version_List_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "versions" then return Util.Beans.Objects.To_Object (Value => From.Versions_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "page_count" then return Util.Beans.Objects.To_Object ((From.Count + From.Page_Size - 1) / From.Page_Size); else return AWA.Wikis.Models.Wiki_Version_List_Bean (From).Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Set the value identified by the name. -- ------------------------------ overriding procedure Set_Value (From : in out Wiki_Version_List_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "page" and not Util.Beans.Objects.Is_Empty (Value) then From.Page := Util.Beans.Objects.To_Integer (Value); elsif Name = "wiki_id" and not Util.Beans.Objects.Is_Empty (Value) then From.Wiki_Id := ADO.NO_IDENTIFIER; From.Wiki_Id := ADO.Utils.To_Identifier (Value); elsif Name = "page_id" and not Util.Beans.Objects.Is_Empty (Value) then From.Page_Id := ADO.NO_IDENTIFIER; From.Page_Id := ADO.Utils.To_Identifier (Value); end if; exception when Constraint_Error => null; end Set_Value; overriding procedure Load (Into : in out Wiki_Version_List_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is use AWA.Wikis.Models; use AWA.Services; use type Ada.Strings.Unbounded.Unbounded_String; Ctx : constant Contexts.Service_Context_Access := AWA.Services.Contexts.Current; User : constant ADO.Identifier := Ctx.Get_User_Identifier; Session : ADO.Sessions.Session := ASC.Get_Session (Ctx); Query : ADO.Queries.Context; Count_Query : ADO.Queries.Context; First : constant Natural := (Into.Page - 1) * Into.Page_Size; Page : constant Wiki_View_Bean_Access := Get_Wiki_View_Bean ("wikiView"); begin -- Load the wiki page first. Page.Id := Into.Page_Id; Page.Set_Wiki_Id (Into.Wiki_Id); Page.Load (Outcome); if Outcome /= "loaded" then return; end if; Page.Wiki_Space.Set_Id (Into.Wiki_Id); -- Get the list of versions associated with the wiki page. Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Version_List); Count_Query.Set_Count_Query (AWA.Wikis.Models.Query_Wiki_Version_List); Query.Bind_Param (Name => "first", Value => First); Query.Bind_Param (Name => "count", Value => Into.Page_Size); Query.Bind_Param (Name => "wiki_id", Value => Into.Wiki_Id); Query.Bind_Param (Name => "page_id", Value => Into.Page_Id); Query.Bind_Param (Name => "user_id", Value => User); Count_Query.Bind_Param (Name => "wiki_id", Value => Into.Wiki_Id); Count_Query.Bind_Param (Name => "page_id", Value => Into.Page_Id); Count_Query.Bind_Param (Name => "user_id", Value => User); ADO.Sessions.Entities.Bind_Param (Params => Query, Name => "table", Table => AWA.Wikis.Models.WIKI_SPACE_TABLE, Session => Session); ADO.Sessions.Entities.Bind_Param (Params => Count_Query, Name => "table", Table => AWA.Wikis.Models.WIKI_SPACE_TABLE, Session => Session); AWA.Wikis.Models.List (Into.Versions, Session, Query); Into.Count := ADO.Datasets.Get_Count (Session, Count_Query); end Load; -- ------------------------------ -- Create the Post_List_Bean bean instance. -- ------------------------------ function Create_Wiki_Version_List_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is Object : constant Wiki_Version_List_Bean_Access := new Wiki_Version_List_Bean; begin Object.Module := Module; Object.Versions_Bean := Object.Versions'Access; Object.Page_Size := 20; Object.Page := 1; Object.Count := 0; Object.Wiki_Id := ADO.NO_IDENTIFIER; Object.Page_Id := ADO.NO_IDENTIFIER; return Object.all'Access; end Create_Wiki_Version_List_Bean; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_Page_Info_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "words" then return Util.Beans.Objects.To_Object (Value => From.Words_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "pages" then return Util.Beans.Objects.To_Object (Value => From.Links_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "links" then return Util.Beans.Objects.To_Object (Value => From.Ext_Links_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "images" then return Util.Beans.Objects.To_Object (Value => From.Page.Links_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "templates" then return Util.Beans.Objects.To_Object (Value => From.Page.Plugins_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "imageThumbnail" then declare URI : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String; W : Natural := 64; H : Natural := 64; begin if Image_Info_Maps.Has_Element (From.Page.Links.Pos) then From.Page.Links.Make_Image_Link (Link => Image_Info_Maps.Key (From.Page.Links.Pos), Info => Image_Info_Maps.Element (From.Page.Links.Pos), URI => URI, Width => W, Height => H); end if; return Util.Beans.Objects.To_Object (URI); end; elsif Name = "imageTitle" then if Image_Info_Maps.Has_Element (From.Page.Links.Pos) then return Util.Beans.Objects.To_Object (Image_Info_Maps.Key (From.Page.Links.Pos)); else return Util.Beans.Objects.Null_Object; end if; else return AWA.Wikis.Models.Wiki_Page_Info_Bean (From).Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Set the value identified by the name. -- ------------------------------ overriding procedure Set_Value (From : in out Wiki_Page_Info_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "wiki_id" and not Util.Beans.Objects.Is_Empty (Value) then From.Wiki_Id := ADO.Utils.To_Identifier (Value); From.Page.Set_Wiki_Id (From.Wiki_Id); elsif Name = "page_id" and not Util.Beans.Objects.Is_Empty (Value) then From.Page_Id := ADO.Utils.To_Identifier (Value); From.Page.Id := From.Page_Id; end if; exception when Constraint_Error => From.Wiki_Id := ADO.NO_IDENTIFIER; From.Page_Id := ADO.NO_IDENTIFIER; end Set_Value; overriding procedure Load (Into : in out Wiki_Page_Info_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is use type Ada.Strings.Unbounded.Unbounded_String; begin -- Load the wiki page first. Into.Page.Load (Outcome); if Outcome /= "loaded" then return; end if; declare use Ada.Strings.Unbounded; Doc : Wiki.Documents.Document; Autolink : aliased Wiki.Filters.Autolink.Autolink_Filter; Images : aliased Wiki.Filters.Collectors.Image_Collector_Type; Links : aliased Wiki.Filters.Collectors.Link_Collector_Type; Words : aliased Wiki.Filters.Collectors.Word_Collector_Type; Filter : aliased Wiki.Filters.Html.Html_Filter_Type; Engine : Wiki.Parsers.Parser; procedure Collect_Word (Pos : in Wiki.Filters.Collectors.Cursor); procedure Collect_Link (Pos : in Wiki.Filters.Collectors.Cursor); procedure Collect_Image (Pos : in Wiki.Filters.Collectors.Cursor); procedure Collect_Word (Pos : in Wiki.Filters.Collectors.Cursor) is Word : constant Wiki.Strings.WString := Wiki.Filters.Collectors.WString_Maps.Key (Pos); Info : AWA.Tags.Models.Tag_Info; begin Info.Count := Wiki.Filters.Collectors.WString_Maps.Element (Pos); Info.Tag := To_Unbounded_String (Wiki.Strings.To_String (Word)); Into.Words.List.Append (Info); end Collect_Word; procedure Collect_Link (Pos : in Wiki.Filters.Collectors.Cursor) is Link : constant Wiki.Strings.WString := Wiki.Filters.Collectors.WString_Maps.Key (Pos); Info : AWA.Tags.Models.Tag_Info; begin Info.Count := Wiki.Filters.Collectors.WString_Maps.Element (Pos); Info.Tag := To_Unbounded_String (Wiki.Strings.To_String (Link)); if Wiki.Helpers.Is_Url (Link) then Into.Ext_Links.List.Append (Info); else Into.Links.List.Append (Info); end if; end Collect_Link; procedure Collect_Image (Pos : in Wiki.Filters.Collectors.Cursor) is Image : constant Wiki.Strings.WString := Wiki.Filters.Collectors.WString_Maps.Key (Pos); URI : Wiki.Strings.UString; W, H : Natural := 0; begin Into.Page.Links.Make_Image_Link (Link => Image, URI => URI, Width => W, Height => H); end Collect_Image; Content : constant String := To_String (Into.Page.Content.Value); begin Engine.Add_Filter (Words'Unchecked_Access); Engine.Add_Filter (Links'Unchecked_Access); Engine.Add_Filter (Images'Unchecked_Access); Engine.Add_Filter (Autolink'Unchecked_Access); Engine.Add_Filter (Filter'Unchecked_Access); Engine.Set_Syntax (Into.Page.Get_Syntax); Engine.Set_Plugin_Factory (Into.Page.Plugins'Access); Engine.Parse (Content, Doc); Words.Iterate (Collect_Word'Access); Links.Iterate (Collect_Link'Access); Images.Iterate (Collect_Image'Access); end; end Load; -- ------------------------------ -- Create the Wiki_Page_Info_Bean bean instance. -- ------------------------------ function Create_Wiki_Page_Info_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is Object : constant Wiki_Page_Info_Bean_Access := new Wiki_Page_Info_Bean; begin Object.Module := Module; Object.Words_Bean := Object.Words'Access; Object.Links_Bean := Object.Links'Access; Object.Ext_Links_Bean := Object.Ext_Links'Access; Object.Page := Get_Wiki_View_Bean ("wikiView"); return Object.all'Access; end Create_Wiki_Page_Info_Bean; -- ------------------------------ -- Get the value identified by the name. -- ------------------------------ overriding function Get_Value (From : in Wiki_Image_Info_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "wiki_id" then return ADO.Utils.To_Object (From.Wiki_Id); elsif Name = "page_id" then return ADO.Utils.To_Object (From.Page.Id); elsif Name = "folder_name" then return Util.Beans.Objects.To_Object (From.Folder_Name); elsif Name = "name" then return Util.Beans.Objects.To_Object (From.Name); elsif Name = "list" then return Util.Beans.Objects.To_Object (Value => From.List_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "imageUrl" then declare Pos : constant Natural := From.List_Bean.Get_Row_Index; Info : AWA.Wikis.Models.Wiki_Image_Info; URI : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String; W : Natural := 0; H : Natural := 0; Name : constant String := Ada.Strings.Unbounded.To_String (From.Name); WName : constant Wiki.Strings.WString := Wiki.Strings.To_WString (Name); begin if Pos < From.List_Bean.Get_Count then Info := From.List_Bean.List.Element (Pos); if not Info.Width.Is_Null and not Info.Height.Is_Null then W := Info.Width.Value; H := Info.Height.Value; end if; end if; Info.Id := From.Id; Info.Width := From.Width; Info.Height := From.Height; From.Page.Links.Make_Image_Link (Link => WName, Info => Info, URI => URI, Width => W, Height => H); return Util.Beans.Objects.To_Object (URI); end; else return Models.Wiki_Image_Bean (From).Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Set the value identified by the name. -- ------------------------------ overriding procedure Set_Value (From : in out Wiki_Image_Info_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "wiki_id" and not Util.Beans.Objects.Is_Empty (Value) then From.Wiki_Id := ADO.NO_IDENTIFIER; From.Wiki_Id := ADO.Utils.To_Identifier (Value); From.Page.Set_Wiki_Id (From.Wiki_Id); elsif Name = "folder_name" then From.Folder_Name := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "name" then From.Name := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "page_id" and not Util.Beans.Objects.Is_Empty (Value) then From.Page_Id := ADO.NO_IDENTIFIER; From.Page_Id := ADO.Utils.To_Identifier (Value); From.Page.Id := From.Page_Id; else Models.Wiki_Image_Bean (From).Set_Value (Name, Value); end if; exception when Constraint_Error => null; end Set_Value; -- ------------------------------ -- Load the information about the image. -- ------------------------------ overriding procedure Load (Into : in out Wiki_Image_Info_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is use type ADO.Identifier; use type Ada.Containers.Count_Type; use type Ada.Strings.Unbounded.Unbounded_String; Ctx : constant ASC.Service_Context_Access := ASC.Current; Session : ADO.Sessions.Session := ASC.Get_Session (Ctx); Query : ADO.Queries.Context; begin -- Load the wiki page first. Into.Page.Load (Outcome); if Outcome /= "loaded" then return; end if; -- Get the list of versions associated with the wiki page. Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Image); Query.Bind_Param (Name => "file_name", Value => Into.Name); Query.Bind_Param (Name => "folder_name", Value => Into.Folder_Name); Query.Bind_Param (Name => "wiki_id", Value => Into.Wiki_Id); AWA.Wikis.Models.List (Into.List, Session, Query); if Into.List.List.Length > 0 then declare Img : constant AWA.Wikis.Models.Wiki_Image_Info := Into.List.List.First_Element; begin if Img.Id > 0 then Into.Id := Img.Id; Into.Mime_Type := Img.Mime_Type; Into.Storage := Img.Storage; Into.File_Size := Img.File_Size; Into.Create_Date := Img.Create_Date; Into.Width := Img.Width; Into.Height := Img.Height; end if; Into.Folder_Id := Img.Folder_Id; end; end if; end Load; -- ------------------------------ -- Create the Wiki_Image_Info_BEan bean instance. -- ------------------------------ function Create_Wiki_Image_Info_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is Object : constant Wiki_Image_Info_Bean_Access := new Wiki_Image_Info_Bean; begin Object.Module := Module; Object.List_Bean := Object.List'Access; Object.Page := Get_Wiki_View_Bean ("wikiView"); Object.Id := ADO.NO_IDENTIFIER; Object.Folder_Id := ADO.NO_IDENTIFIER; Object.Width := (Is_Null => True, Value => 0); Object.Height := (Is_Null => True, Value => 0); return Object.all'Access; end Create_Wiki_Image_Info_Bean; -- ------------------------------ -- Load the list of wikis. -- ------------------------------ procedure Load_Wikis (List : in Wiki_Admin_Bean) is use AWA.Wikis.Models; use AWA.Services; Ctx : constant Contexts.Service_Context_Access := AWA.Services.Contexts.Current; User : constant ADO.Identifier := Ctx.Get_User_Identifier; Session : ADO.Sessions.Session := ASC.Get_Session (Ctx); Query : ADO.Queries.Context; begin Query.Set_Query (AWA.Wikis.Models.Query_Wiki_List); Query.Bind_Param ("user_id", User); ADO.Sessions.Entities.Bind_Param (Params => Query, Name => "table", Table => AWA.Wikis.Models.WIKI_SPACE_TABLE, Session => Session); AWA.Wikis.Models.List (List.Wiki_List_Bean.all, Session, Query); List.Flags (INIT_WIKI_LIST) := True; end Load_Wikis; -- ------------------------------ -- Get the wiki space identifier. -- ------------------------------ function Get_Wiki_Id (List : in Wiki_Admin_Bean) return ADO.Identifier is use type ADO.Identifier; begin if List.Wiki_Id = ADO.NO_IDENTIFIER then if not List.Flags (INIT_WIKI_LIST) then Load_Wikis (List); end if; if not List.Wiki_List.List.Is_Empty then return List.Wiki_List.List.Element (1).Id; end if; end if; return List.Wiki_Id; end Get_Wiki_Id; overriding function Get_Value (List : in Wiki_Admin_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "wikis" then if not List.Init_Flags (INIT_WIKI_LIST) then Load_Wikis (List); end if; return Util.Beans.Objects.To_Object (Value => List.Wiki_List_Bean, Storage => Util.Beans.Objects.STATIC); elsif Name = "id" then declare use type ADO.Identifier; Id : constant ADO.Identifier := List.Get_Wiki_Id; begin if Id = ADO.NO_IDENTIFIER then return Util.Beans.Objects.Null_Object; else return Util.Beans.Objects.To_Object (Long_Long_Integer (Id)); end if; end; else return Util.Beans.Objects.Null_Object; end if; end Get_Value; -- ------------------------------ -- Set the value identified by the name. -- ------------------------------ overriding procedure Set_Value (From : in out Wiki_Admin_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "id" and not Util.Beans.Objects.Is_Empty (Value) then From.Wiki_Id := ADO.NO_IDENTIFIER; From.Wiki_Id := ADO.Utils.To_Identifier (Value); end if; exception when Constraint_Error => null; end Set_Value; -- ------------------------------ -- Create the Wiki_Admin_Bean bean instance. -- ------------------------------ function Create_Wiki_Admin_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access is Object : constant Wiki_Admin_Bean_Access := new Wiki_Admin_Bean; begin Object.Module := Module; Object.Flags := Object.Init_Flags'Access; Object.Wiki_List_Bean := Object.Wiki_List'Access; return Object.all'Access; end Create_Wiki_Admin_Bean; end AWA.Wikis.Beans;
-- -- (c) Copyright 1993,1994,1995,1996 Silicon Graphics, Inc. -- ALL RIGHTS RESERVED -- Permission to use, copy, modify, and distribute this software for -- any purpose and without fee is hereby granted, provided that the above -- copyright notice appear in all copies and that both the copyright notice -- and this permission notice appear in supporting documentation, and that -- the name of Silicon Graphics, Inc. not be used in advertising -- or publicity pertaining to distribution of the software without specific, -- written prior permission. -- -- THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" -- AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, -- INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR -- FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -- GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, -- SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY -- KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, -- LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF -- THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN -- ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE -- POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. -- -- US Government Users Restricted Rights -- Use, duplication, or disclosure by the Government is subject to -- restrictions set forth in FAR 52.227.19(c)(2) or subparagraph -- (c)(1)(ii) of the Rights in Technical Data and Computer Software -- clause at DFARS 252.227-7013 and/or in similar or successor -- clauses in the FAR or the DOD or NASA FAR Supplement. -- Unpublished-- rights reserved under the copyright laws of the -- United States. Contractor/manufacturer is Silicon Graphics, -- Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. -- -- OpenGL(TM) is a trademark of Silicon Graphics, Inc. -- with GL; use GL; with Glut; use Glut; with Text_IO; with Texgen_Procs; use Texgen_Procs; with Interfaces.C.Strings; procedure Texgen is package Tio renames Text_IO; package ICS renames Interfaces.C.Strings; type chars_ptr_ptr is access ICS.chars_ptr; argc : aliased integer; pragma Import (C, argc, "gnat_argc"); argv : chars_ptr_ptr; pragma Import (C, argv, "gnat_argv"); foobar : Integer; begin glutInitWindowSize (300, 300); glutInit (argc'access, argv); glutInitDisplayMode(GLUT_RGB or GLUT_DEPTH or GLUT_SINGLE); foobar := glutCreateWindow ("OpenGL & Ada: texgen"); DoInit; glutReshapeFunc (ReshapeCallback'ACCESS); glutDisplayFunc (DoDisplay'ACCESS); glutMainLoop; end Texgen;
limited with Incomplete1; package Incomplete2 is pragma Elaborate_Body; generic type T is private; package G is end G; package I1 is new G (Incomplete1.T); -- { dg-error "premature use" } end Incomplete2;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Definitions; with Program.Lexical_Elements; with Program.Elements.Expressions; with Program.Elements.Constraints; package Program.Elements.Subtype_Indications is pragma Pure (Program.Elements.Subtype_Indications); type Subtype_Indication is limited interface and Program.Elements.Definitions.Definition; type Subtype_Indication_Access is access all Subtype_Indication'Class with Storage_Size => 0; not overriding function Subtype_Mark (Self : Subtype_Indication) return not null Program.Elements.Expressions.Expression_Access is abstract; not overriding function Constraint (Self : Subtype_Indication) return Program.Elements.Constraints.Constraint_Access is abstract; not overriding function Has_Not_Null (Self : Subtype_Indication) return Boolean is abstract; type Subtype_Indication_Text is limited interface; type Subtype_Indication_Text_Access is access all Subtype_Indication_Text'Class with Storage_Size => 0; not overriding function To_Subtype_Indication_Text (Self : in out Subtype_Indication) return Subtype_Indication_Text_Access is abstract; not overriding function Not_Token (Self : Subtype_Indication_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Null_Token (Self : Subtype_Indication_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Subtype_Indications;
pragma License (Unrestricted); -- extended unit with Ada.Iterator_Interfaces; private with System; package Ada.Bind_Time_Variables is -- This is similar to Ada.Environment_Variables, -- but reads bind-time variables set by gnatbind -Vkey=val. pragma Preelaborate; function Value (Name : String) return String; function Value (Name : String; Default : String) return String; function Exists (Name : String) return Boolean; procedure Iterate ( Process : not null access procedure (Name, Value : String)); -- Iterators: type Cursor is private; pragma Preelaborable_Initialization (Cursor); function Has_Element (Position : Cursor) return Boolean; pragma Inline (Has_Element); function Name (Position : Cursor) return String; function Value (Position : Cursor) return String; package Iterator_Interfaces is new Ada.Iterator_Interfaces (Cursor, Has_Element); function Iterate return Iterator_Interfaces.Forward_Iterator'Class; private type Cursor is new System.Address; type Iterator is new Iterator_Interfaces.Forward_Iterator with null record; overriding function First (Object : Iterator) return Cursor; overriding function Next (Object : Iterator; Position : Cursor) return Cursor; end Ada.Bind_Time_Variables;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- 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_Artifacts is ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant UML_Artifact_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_Artifact (AMF.UML.Artifacts.UML_Artifact_Access (Self), Control); end if; end Enter_Element; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant UML_Artifact_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_Artifact (AMF.UML.Artifacts.UML_Artifact_Access (Self), Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant UML_Artifact_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_Artifact (Visitor, AMF.UML.Artifacts.UML_Artifact_Access (Self), Control); end if; end Visit_Element; ------------------- -- Get_File_Name -- ------------------- overriding function Get_File_Name (Self : not null access constant UML_Artifact_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_File_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_File_Name; ------------------- -- Set_File_Name -- ------------------- overriding procedure Set_File_Name (Self : not null access UML_Artifact_Proxy; To : AMF.Optional_String) is begin if To.Is_Empty then AMF.Internals.Tables.UML_Attributes.Internal_Set_File_Name (Self.Element, null); else AMF.Internals.Tables.UML_Attributes.Internal_Set_File_Name (Self.Element, League.Strings.Internals.Internal (To.Value)); end if; end Set_File_Name; ----------------------- -- Get_Manifestation -- ----------------------- overriding function Get_Manifestation (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Manifestations.Collections.Set_Of_UML_Manifestation is begin return AMF.UML.Manifestations.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Manifestation (Self.Element))); end Get_Manifestation; ------------------------- -- Get_Nested_Artifact -- ------------------------- overriding function Get_Nested_Artifact (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Artifacts.Collections.Set_Of_UML_Artifact is begin return AMF.UML.Artifacts.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Nested_Artifact (Self.Element))); end Get_Nested_Artifact; ------------------------- -- Get_Owned_Attribute -- ------------------------- overriding function Get_Owned_Attribute (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property is begin return AMF.UML.Properties.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Attribute (Self.Element))); end Get_Owned_Attribute; ------------------------- -- Get_Owned_Operation -- ------------------------- overriding function Get_Owned_Operation (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Operations.Collections.Ordered_Set_Of_UML_Operation is begin return AMF.UML.Operations.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Operation (Self.Element))); end Get_Owned_Operation; ------------------- -- Get_Attribute -- ------------------- overriding function Get_Attribute (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Properties.Collections.Set_Of_UML_Property is begin return AMF.UML.Properties.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Attribute (Self.Element))); end Get_Attribute; --------------------------- -- Get_Collaboration_Use -- --------------------------- overriding function Get_Collaboration_Use (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Collaboration_Uses.Collections.Set_Of_UML_Collaboration_Use is begin return AMF.UML.Collaboration_Uses.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Collaboration_Use (Self.Element))); end Get_Collaboration_Use; ----------------- -- Get_Feature -- ----------------- overriding function Get_Feature (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Features.Collections.Set_Of_UML_Feature is begin return AMF.UML.Features.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Feature (Self.Element))); end Get_Feature; ----------------- -- Get_General -- ----------------- overriding function Get_General (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is begin return AMF.UML.Classifiers.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_General (Self.Element))); end Get_General; ------------------------ -- Get_Generalization -- ------------------------ overriding function Get_Generalization (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization is begin return AMF.UML.Generalizations.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Generalization (Self.Element))); end Get_Generalization; -------------------------- -- Get_Inherited_Member -- -------------------------- overriding function Get_Inherited_Member (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is begin return AMF.UML.Named_Elements.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Inherited_Member (Self.Element))); end Get_Inherited_Member; --------------------- -- Get_Is_Abstract -- --------------------- overriding function Get_Is_Abstract (Self : not null access constant UML_Artifact_Proxy) return Boolean is begin return AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Abstract (Self.Element); end Get_Is_Abstract; --------------------------------- -- Get_Is_Final_Specialization -- --------------------------------- overriding function Get_Is_Final_Specialization (Self : not null access constant UML_Artifact_Proxy) return Boolean is begin return AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Final_Specialization (Self.Element); end Get_Is_Final_Specialization; --------------------------------- -- Set_Is_Final_Specialization -- --------------------------------- overriding procedure Set_Is_Final_Specialization (Self : not null access UML_Artifact_Proxy; To : Boolean) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Final_Specialization (Self.Element, To); end Set_Is_Final_Specialization; ---------------------------------- -- Get_Owned_Template_Signature -- ---------------------------------- overriding function Get_Owned_Template_Signature (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access is begin return AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Template_Signature (Self.Element))); end Get_Owned_Template_Signature; ---------------------------------- -- Set_Owned_Template_Signature -- ---------------------------------- overriding procedure Set_Owned_Template_Signature (Self : not null access UML_Artifact_Proxy; To : AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Owned_Template_Signature (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Owned_Template_Signature; ------------------------ -- Get_Owned_Use_Case -- ------------------------ overriding function Get_Owned_Use_Case (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is begin return AMF.UML.Use_Cases.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Use_Case (Self.Element))); end Get_Owned_Use_Case; -------------------------- -- Get_Powertype_Extent -- -------------------------- overriding function Get_Powertype_Extent (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Generalization_Sets.Collections.Set_Of_UML_Generalization_Set is begin return AMF.UML.Generalization_Sets.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Powertype_Extent (Self.Element))); end Get_Powertype_Extent; ------------------------------ -- Get_Redefined_Classifier -- ------------------------------ overriding function Get_Redefined_Classifier (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is begin return AMF.UML.Classifiers.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Classifier (Self.Element))); end Get_Redefined_Classifier; ------------------------ -- Get_Representation -- ------------------------ overriding function Get_Representation (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access is begin return AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Representation (Self.Element))); end Get_Representation; ------------------------ -- Set_Representation -- ------------------------ overriding procedure Set_Representation (Self : not null access UML_Artifact_Proxy; To : AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Representation (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Representation; ---------------------- -- Get_Substitution -- ---------------------- overriding function Get_Substitution (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Substitutions.Collections.Set_Of_UML_Substitution is begin return AMF.UML.Substitutions.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Substitution (Self.Element))); end Get_Substitution; ---------------------------- -- Get_Template_Parameter -- ---------------------------- overriding function Get_Template_Parameter (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access is begin return AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter (Self.Element))); end Get_Template_Parameter; ---------------------------- -- Set_Template_Parameter -- ---------------------------- overriding procedure Set_Template_Parameter (Self : not null access UML_Artifact_Proxy; To : AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Template_Parameter; ------------------ -- Get_Use_Case -- ------------------ overriding function Get_Use_Case (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is begin return AMF.UML.Use_Cases.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Use_Case (Self.Element))); end Get_Use_Case; ------------------------ -- Get_Element_Import -- ------------------------ overriding function Get_Element_Import (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import is begin return AMF.UML.Element_Imports.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Element_Import (Self.Element))); end Get_Element_Import; ------------------------- -- Get_Imported_Member -- ------------------------- overriding function Get_Imported_Member (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is begin return AMF.UML.Packageable_Elements.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Imported_Member (Self.Element))); end Get_Imported_Member; ---------------- -- Get_Member -- ---------------- overriding function Get_Member (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is begin return AMF.UML.Named_Elements.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Member (Self.Element))); end Get_Member; ---------------------- -- Get_Owned_Member -- ---------------------- overriding function Get_Owned_Member (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is begin return AMF.UML.Named_Elements.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Member (Self.Element))); end Get_Owned_Member; -------------------- -- Get_Owned_Rule -- -------------------- overriding function Get_Owned_Rule (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is begin return AMF.UML.Constraints.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Rule (Self.Element))); end Get_Owned_Rule; ------------------------ -- Get_Package_Import -- ------------------------ overriding function Get_Package_Import (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import is begin return AMF.UML.Package_Imports.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Package_Import (Self.Element))); end Get_Package_Import; --------------------------- -- Get_Client_Dependency -- --------------------------- overriding function Get_Client_Dependency (Self : not null access constant UML_Artifact_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_Artifact_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_Artifact_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_Artifact_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_Artifact_Proxy) return AMF.Optional_String is begin declare use type Matreshka.Internals.Strings.Shared_String_Access; Aux : constant Matreshka.Internals.Strings.Shared_String_Access := AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element); begin if Aux = null then return (Is_Empty => True); else return (False, League.Strings.Internals.Create (Aux)); end if; end; end Get_Qualified_Name; ----------------- -- Get_Package -- ----------------- overriding function Get_Package (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Packages.UML_Package_Access is begin return AMF.UML.Packages.UML_Package_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Package (Self.Element))); end Get_Package; ----------------- -- Set_Package -- ----------------- overriding procedure Set_Package (Self : not null access UML_Artifact_Proxy; To : AMF.UML.Packages.UML_Package_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Package (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Package; ----------------------------------- -- Get_Owning_Template_Parameter -- ----------------------------------- overriding function Get_Owning_Template_Parameter (Self : not null access constant UML_Artifact_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_Artifact_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_Artifact_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_Artifact_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_Artifact_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_Artifact_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_Artifact_Proxy) return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding is begin return AMF.UML.Template_Bindings.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Binding (Self.Element))); end Get_Template_Binding; ----------------- -- Get_Is_Leaf -- ----------------- overriding function Get_Is_Leaf (Self : not null access constant UML_Artifact_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_Artifact_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_Artifact_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_Artifact_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; ------------------ -- All_Features -- ------------------ overriding function All_Features (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Features.Collections.Set_Of_UML_Feature is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "All_Features unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.All_Features"; return All_Features (Self); end All_Features; ----------------- -- Conforms_To -- ----------------- overriding function Conforms_To (Self : not null access constant UML_Artifact_Proxy; Other : AMF.UML.Classifiers.UML_Classifier_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Conforms_To unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Conforms_To"; return Conforms_To (Self, Other); end Conforms_To; ------------- -- General -- ------------- overriding function General (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "General unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.General"; return General (Self); end General; ----------------------- -- Has_Visibility_Of -- ----------------------- overriding function Has_Visibility_Of (Self : not null access constant UML_Artifact_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Has_Visibility_Of unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Has_Visibility_Of"; return Has_Visibility_Of (Self, N); end Has_Visibility_Of; ------------- -- Inherit -- ------------- overriding function Inherit (Self : not null access constant UML_Artifact_Proxy; Inhs : AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Inherit unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Inherit"; return Inherit (Self, Inhs); end Inherit; ------------------------- -- Inheritable_Members -- ------------------------- overriding function Inheritable_Members (Self : not null access constant UML_Artifact_Proxy; C : AMF.UML.Classifiers.UML_Classifier_Access) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Inheritable_Members unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Inheritable_Members"; return Inheritable_Members (Self, C); end Inheritable_Members; ---------------------- -- Inherited_Member -- ---------------------- overriding function Inherited_Member (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Inherited_Member unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Inherited_Member"; return Inherited_Member (Self); end Inherited_Member; ----------------- -- Is_Template -- ----------------- overriding function Is_Template (Self : not null access constant UML_Artifact_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_Artifact_Proxy.Is_Template"; return Is_Template (Self); end Is_Template; ------------------------- -- May_Specialize_Type -- ------------------------- overriding function May_Specialize_Type (Self : not null access constant UML_Artifact_Proxy; C : AMF.UML.Classifiers.UML_Classifier_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "May_Specialize_Type unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.May_Specialize_Type"; return May_Specialize_Type (Self, C); end May_Specialize_Type; ------------------------ -- Exclude_Collisions -- ------------------------ overriding function Exclude_Collisions (Self : not null access constant UML_Artifact_Proxy; Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Exclude_Collisions unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Exclude_Collisions"; return Exclude_Collisions (Self, Imps); end Exclude_Collisions; ------------------------- -- Get_Names_Of_Member -- ------------------------- overriding function Get_Names_Of_Member (Self : not null access constant UML_Artifact_Proxy; Element : AMF.UML.Named_Elements.UML_Named_Element_Access) return AMF.String_Collections.Set_Of_String is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Names_Of_Member unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Get_Names_Of_Member"; return Get_Names_Of_Member (Self, Element); end Get_Names_Of_Member; -------------------- -- Import_Members -- -------------------- overriding function Import_Members (Self : not null access constant UML_Artifact_Proxy; Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Import_Members unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Import_Members"; return Import_Members (Self, Imps); end Import_Members; --------------------- -- Imported_Member -- --------------------- overriding function Imported_Member (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Imported_Member unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Imported_Member"; return Imported_Member (Self); end Imported_Member; --------------------------------- -- Members_Are_Distinguishable -- --------------------------------- overriding function Members_Are_Distinguishable (Self : not null access constant UML_Artifact_Proxy) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Members_Are_Distinguishable unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Members_Are_Distinguishable"; return Members_Are_Distinguishable (Self); end Members_Are_Distinguishable; ------------------ -- Owned_Member -- ------------------ overriding function Owned_Member (Self : not null access constant UML_Artifact_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Owned_Member unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Owned_Member"; return Owned_Member (Self); end Owned_Member; ------------------------- -- All_Owning_Packages -- ------------------------- overriding function All_Owning_Packages (Self : not null access constant UML_Artifact_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_Artifact_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_Artifact_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_Artifact_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_Artifact_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_Artifact_Proxy.Namespace"; return Namespace (Self); end Namespace; ----------------- -- Conforms_To -- ----------------- overriding function Conforms_To (Self : not null access constant UML_Artifact_Proxy; Other : AMF.UML.Types.UML_Type_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Conforms_To unimplemented"); raise Program_Error with "Unimplemented procedure UML_Artifact_Proxy.Conforms_To"; return Conforms_To (Self, Other); end Conforms_To; ------------------------ -- Is_Compatible_With -- ------------------------ overriding function Is_Compatible_With (Self : not null access constant UML_Artifact_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_Artifact_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_Artifact_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_Artifact_Proxy.Is_Template_Parameter"; return Is_Template_Parameter (Self); end Is_Template_Parameter; ---------------------------- -- Parameterable_Elements -- ---------------------------- overriding function Parameterable_Elements (Self : not null access constant UML_Artifact_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_Artifact_Proxy.Parameterable_Elements"; return Parameterable_Elements (Self); end Parameterable_Elements; ------------------------ -- Is_Consistent_With -- ------------------------ overriding function Is_Consistent_With (Self : not null access constant UML_Artifact_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_Artifact_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_Artifact_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_Artifact_Proxy.Is_Redefinition_Context_Valid"; return Is_Redefinition_Context_Valid (Self, Redefined); end Is_Redefinition_Context_Valid; end AMF.Internals.UML_Artifacts;
-- Copyright 2011-2015 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 begin Hello; There; end Foo;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . O S _ L I B -- -- -- -- S p e c -- -- -- -- Copyright (C) 1995-2016, 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. -- -- -- ------------------------------------------------------------------------------ -- Operating system interface facilities -- This package contains types and procedures for interfacing to the -- underlying OS. It is used by the GNAT compiler and by tools associated -- with the GNAT compiler, and therefore works for the various operating -- systems to which GNAT has been ported. This package will undoubtedly grow -- as new services are needed by various tools. -- This package tends to use fairly low-level Ada in order to not bring in -- large portions of the RTL. For example, functions return access to string -- as part of avoiding functions returning unconstrained types. -- Except where specifically noted, these routines are portable across all -- GNAT implementations on all supported operating systems. -- Note: this package is in the System hierarchy so that it can be directly -- be used by other predefined packages. User access to this package is via -- a renaming of this package in GNAT.OS_Lib (file g-os_lib.ads). pragma Compiler_Unit_Warning; with System; with System.Strings; package System.OS_Lib is pragma Preelaborate; ----------------------- -- String Operations -- ----------------------- -- These are reexported from package Strings (which was introduced to -- avoid different packages declaring different types unnecessarily). -- See package System.Strings for details. subtype String_Access is Strings.String_Access; function "=" (Left : String_Access; Right : String_Access) return Boolean renames Strings."="; procedure Free (X : in out String_Access) renames Strings.Free; subtype String_List is Strings.String_List; function "=" (Left : String_List; Right : String_List) return Boolean renames Strings."="; function "&" (Left : String_Access; Right : String_Access) return String_List renames Strings."&"; function "&" (Left : String_Access; Right : String_List) return String_List renames Strings."&"; function "&" (Left : String_List; Right : String_Access) return String_List renames Strings."&"; function "&" (Left : String_List; Right : String_List) return String_List renames Strings."&"; subtype String_List_Access is Strings.String_List_Access; function "=" (Left : String_List_Access; Right : String_List_Access) return Boolean renames Strings."="; procedure Free (Arg : in out String_List_Access) renames Strings.Free; --------------------- -- Time/Date Stuff -- --------------------- type OS_Time is private; -- The OS's notion of time is represented by the private type OS_Time. This -- is the type returned by the File_Time_Stamp functions to obtain the time -- stamp of a specified file. Functions and a procedure (modeled after the -- similar subprograms in package Calendar) are provided for extracting -- information from a value of this type. Although these are called GM, the -- intention in the case of time stamps is not that they provide GMT times -- in all cases but rather the actual (time-zone independent) time stamp of -- the file (of course in Unix systems, this *is* in GMT form). Invalid_Time : constant OS_Time; -- A special unique value used to flag an invalid time stamp value function "<" (X : OS_Time; Y : OS_Time) return Boolean; function ">" (X : OS_Time; Y : OS_Time) return Boolean; function ">=" (X : OS_Time; Y : OS_Time) return Boolean; function "<=" (X : OS_Time; Y : OS_Time) return Boolean; -- Basic comparison operators on OS_Time with obvious meanings. Note that -- these have Intrinsic convention, so for example it is not permissible -- to create accesses to any of these functions. subtype Year_Type is Integer range 1900 .. 2099; subtype Month_Type is Integer range 1 .. 12; subtype Day_Type is Integer range 1 .. 31; subtype Hour_Type is Integer range 0 .. 23; subtype Minute_Type is Integer range 0 .. 59; subtype Second_Type is Integer range 0 .. 59; -- Declarations similar to those in Calendar, breaking down the time function Current_Time return OS_Time; -- Return the system clock value as OS_Time function Current_Time_String return String; -- Returns current local time in the form YYYY-MM-DD HH:MM:SS. The result -- has bounds 1 .. 19. function GM_Year (Date : OS_Time) return Year_Type; function GM_Month (Date : OS_Time) return Month_Type; function GM_Day (Date : OS_Time) return Day_Type; function GM_Hour (Date : OS_Time) return Hour_Type; function GM_Minute (Date : OS_Time) return Minute_Type; function GM_Second (Date : OS_Time) return Second_Type; -- Functions to extract information from OS_Time value in GMT form procedure GM_Split (Date : OS_Time; Year : out Year_Type; Month : out Month_Type; Day : out Day_Type; Hour : out Hour_Type; Minute : out Minute_Type; Second : out Second_Type); -- Analogous to the Split routine in Ada.Calendar, takes an OS_Time and -- provides a representation of it as a set of component parts, to be -- interpreted as a date point in UTC. function GM_Time_Of (Year : Year_Type; Month : Month_Type; Day : Day_Type; Hour : Hour_Type; Minute : Minute_Type; Second : Second_Type) return OS_Time; -- Analogous to the Time_Of routine in Ada.Calendar, takes a set of time -- component parts to be interpreted in the local time zone, and returns -- an OS_Time. Returns Invalid_Time if the creation fails. ---------------- -- File Stuff -- ---------------- -- These routines give access to the open/creat/close/read/write level of -- I/O routines in the typical C library (these functions are not part of -- the ANSI C standard, but are typically available in all systems). See -- also package Interfaces.C_Streams for access to the stream level -- routines. -- Note on file names. If a file name is passed as type String in any of -- the following specifications, then the name is a normal Ada string and -- need not be NUL-terminated. However, a trailing NUL character is -- permitted, and will be ignored (more accurately, the NUL and any -- characters that follow it will be ignored). type File_Descriptor is new Integer; -- Corresponds to the int file handle values used in the C routines Standin : constant File_Descriptor := 0; Standout : constant File_Descriptor := 1; Standerr : constant File_Descriptor := 2; -- File descriptors for standard input output files Invalid_FD : constant File_Descriptor := -1; -- File descriptor returned when error in opening/creating file procedure Close (FD : File_Descriptor; Status : out Boolean); -- Close file referenced by FD. Status is False if the underlying service -- failed. Reasons for failure include: disk full, disk quotas exceeded -- and invalid file descriptor (the file may have been closed twice). procedure Close (FD : File_Descriptor); -- Close file referenced by FD. This form is used when the caller wants to -- ignore any possible error (see above for error cases). type Copy_Mode is (Copy, -- Copy the file. It is an error if the target file already exists. The -- time stamps and other file attributes are preserved in the copy. Overwrite, -- If the target file exists, the file is replaced otherwise the file -- is just copied. The time stamps and other file attributes are -- preserved in the copy. Append); -- If the target file exists, the contents of the source file is -- appended at the end. Otherwise the source file is just copied. The -- time stamps and other file attributes are preserved if the -- destination file does not exist. type Attribute is (Time_Stamps, -- Copy time stamps from source file to target file. All other -- attributes are set to normal default values for file creation. Full, -- All attributes are copied from the source file to the target file. -- This includes the timestamps, and for example also includes -- read/write/execute attributes in Unix systems. None); -- No attributes are copied. All attributes including the time stamp -- values are set to normal default values for file creation. -- Note: The default is Time_Stamps, which corresponds to the normal -- default on Windows style systems. Full corresponds to the typical -- effect of "cp -p" on Unix systems, and None corresponds to the typical -- effect of "cp" on Unix systems. -- Note: Time_Stamps and Full are not supported on VxWorks 5 procedure Copy_File (Name : String; Pathname : String; Success : out Boolean; Mode : Copy_Mode := Copy; Preserve : Attribute := Time_Stamps); -- Copy a file. Name must designate a single file (no wild cards allowed). -- Pathname can be a filename or directory name. In the latter case Name -- is copied into the directory preserving the same file name. Mode -- defines the kind of copy, see above with the default being a normal -- copy in which the target file must not already exist. Success is set to -- True or False indicating if the copy is successful (depending on the -- specified Mode). procedure Copy_File_Attributes (From : String; To : String; Success : out Boolean; Copy_Timestamp : Boolean := True; Copy_Permissions : Boolean := True); -- Copy some of the file attributes from one file to another. Both files -- must exist, or Success is set to False. procedure Copy_Time_Stamps (Source : String; Dest : String; Success : out Boolean); -- Copy Source file time stamps (last modification and last access time -- stamps) to Dest file. Source and Dest must be valid filenames, -- furthermore Dest must be writable. Success will be set to True if the -- operation was successful and False otherwise. -- -- Note: this procedure is not supported on VxWorks 5. On this platform, -- Success is always set to False. type Mode is (Binary, Text); for Mode'Size use Integer'Size; for Mode use (Binary => 0, Text => 1); -- Used in all the Open and Create calls to specify if the file is to be -- opened in binary mode or text mode. In systems like Unix, this has no -- effect, but in systems capable of text mode translation, the use of -- Text as the mode parameter causes the system to do CR/LF translation -- and also to recognize the DOS end of file character on input. The use -- of Text where appropriate allows programs to take a portable Unix view -- of DOS-format files and process them appropriately. function Create_File (Name : String; Fmode : Mode) return File_Descriptor; -- Creates new file with given name for writing, returning file descriptor -- for subsequent use in Write calls. If the file already exists, it is -- overwritten. File descriptor returned is Invalid_FD if file cannot be -- successfully created. function Create_New_File (Name : String; Fmode : Mode) return File_Descriptor; -- Create new file with given name for writing, returning file descriptor -- for subsequent use in Write calls. This differs from Create_File in -- that it fails if the file already exists. File descriptor returned is -- Invalid_FD if the file exists or cannot be created. function Create_Output_Text_File (Name : String) return File_Descriptor; -- Creates new text file with given name suitable to redirect standard -- output, returning file descriptor. File descriptor returned is -- Invalid_FD if file cannot be successfully created. Temp_File_Len : constant Integer := 12; -- Length of name returned by Create_Temp_File call (GNAT-XXXXXX & NUL) subtype Temp_File_Name is String (1 .. Temp_File_Len); -- String subtype set by Create_Temp_File procedure Create_Temp_File (FD : out File_Descriptor; Name : out Temp_File_Name); -- Create and open for writing a temporary file in the current working -- directory. The name of the file and the File Descriptor are returned. -- The File Descriptor returned is Invalid_FD in the case of failure. No -- mode parameter is provided. Since this is a temporary file, there is no -- point in doing text translation on it. -- -- On some operating systems, the maximum number of temp files that can be -- created with this procedure may be limited. When the maximum is reached, -- this procedure returns Invalid_FD. On some operating systems, there may -- be a race condition between processes trying to create temp files at the -- same time in the same directory using this procedure. procedure Create_Temp_File (FD : out File_Descriptor; Name : out String_Access); -- Create and open for writing a temporary file in the current working -- directory. The name of the file and the File Descriptor are returned. -- It is the responsibility of the caller to deallocate the access value -- returned in Name. -- -- The file is opened in binary mode (no text translation). -- -- This procedure will always succeed if the current working directory is -- writable. If the current working directory is not writable, then -- Invalid_FD is returned for the file descriptor and null for the Name. -- There is no race condition problem between processes trying to create -- temp files at the same time in the same directory. procedure Create_Temp_Output_File (FD : out File_Descriptor; Name : out String_Access); -- Create and open for writing a temporary file in the current working -- directory suitable to redirect standard output. The name of the file and -- the File Descriptor are returned. It is the responsibility of the caller -- to deallocate the access value returned in Name. -- -- The file is opened in text mode -- -- This procedure will always succeed if the current working directory is -- writable. If the current working directory is not writable, then -- Invalid_FD is returned for the file descriptor and null for the Name. -- There is no race condition problem between processes trying to create -- temp files at the same time in the same directory. procedure Delete_File (Name : String; Success : out Boolean); -- Deletes file. Success is set True or False indicating if the delete is -- successful. function File_Length (FD : File_Descriptor) return Long_Integer; pragma Import (C, File_Length, "__gnat_file_length_long"); type Large_File_Size is range -2**63 .. 2**63 - 1; -- Maximum supported size for a file (8 exabytes = 8 million terabytes, -- should be enough to accomodate all possible needs for quite a while). function File_Length64 (FD : File_Descriptor) return Large_File_Size; pragma Import (C, File_Length64, "__gnat_file_length"); -- Get length of file from file descriptor FD function File_Time_Stamp (Name : String) return OS_Time; -- Given the name of a file or directory, Name, obtains and returns the -- time stamp. This function can be used for an unopened file. Returns -- Invalid_Time if Name doesn't correspond to an existing file. function File_Time_Stamp (FD : File_Descriptor) return OS_Time; -- Get time stamp of file from file descriptor FD Returns Invalid_Time is -- FD doesn't correspond to an existing file. function Get_Debuggable_Suffix return String_Access; -- Return the debuggable suffix convention. Usually this is the same as -- the convention for Get_Executable_Suffix. The result is allocated on -- the heap and should be freed after use to avoid storage leaks. function Get_Executable_Suffix return String_Access; -- Return the executable suffix convention. The result is allocated on the -- heap and should be freed after use to avoid storage leaks. function Get_Object_Suffix return String_Access; -- Return the object suffix convention. The result is allocated on the heap -- and should be freed after use to avoid storage leaks. function Get_Target_Debuggable_Suffix return String_Access; -- Return the target debuggable suffix convention. Usually this is the same -- as the convention for Get_Executable_Suffix. The result is allocated on -- the heap and should be freed after use to avoid storage leaks. function Get_Target_Executable_Suffix return String_Access; -- Return the target executable suffix convention. The result is allocated -- on the heap and should be freed after use to avoid storage leaks. function Get_Target_Object_Suffix return String_Access; -- Return the target object suffix convention. The result is allocated on -- the heap and should be freed after use to avoid storage leaks. function Is_Absolute_Path (Name : String) return Boolean; -- Returns True if Name is an absolute path name, i.e. it designates a -- file or directory absolutely rather than relative to another directory. function Is_Directory (Name : String) return Boolean; -- Determines if the given string, Name, is the name of a directory. -- Returns True if so, False otherwise. Name may be an absolute path -- name or a relative path name, including a simple file name. If it is -- a relative path name, it is relative to the current working directory. function Is_Executable_File (Name : String) return Boolean; -- Determines if the given string, Name, is the name of an existing file -- that is executable. Returns True if so, False otherwise. Note that this -- function simply interrogates the file attributes (e.g. using the C -- function stat), so it does not indicate a situation in which a file may -- not actually be readable due to some other process having exclusive -- access. function Is_Owner_Readable_File (Name : String) return Boolean; -- Determines if the given string, Name, is the name of an existing file -- that is readable. Returns True if so, False otherwise. Note that this -- function simply interrogates the file attributes (e.g. using the C -- function stat), so it does not indicate a situation in which a file may -- not actually be readable due to some other process having exclusive -- access. function Is_Regular_File (Name : String) return Boolean; -- Determines if the given string, Name, is the name of an existing -- regular file. Returns True if so, False otherwise. Name may be an -- absolute path name or a relative path name, including a simple file -- name. If it is a relative path name, it is relative to the current -- working directory. function Is_Symbolic_Link (Name : String) return Boolean; -- Determines if the given string, Name, is the path of a symbolic link on -- systems that support it. Returns True if so, False if the path is not a -- symbolic link or if the system does not support symbolic links. -- -- A symbolic link is an indirect pointer to a file; its directory entry -- contains the name of the file to which it is linked. Symbolic links may -- span file systems and may refer to directories. function Is_Owner_Writable_File (Name : String) return Boolean; -- Determines if the given string, Name, is the name of an existing file -- that is writable. Returns True if so, False otherwise. Note that this -- function simply interrogates the file attributes (e.g. using the C -- function stat), so it does not indicate a situation in which a file may -- not actually be writable due to some other process having exclusive -- access. function Is_Read_Accessible_File (Name : String) return Boolean; -- Determines if the given string, Name, is the name of an existing file -- that is readable. Returns True if so, False otherwise. function Is_Write_Accessible_File (Name : String) return Boolean; -- Determines if the given string, Name, is the name of an existing file -- that is writable. Returns True if so, False otherwise. function Is_Readable_File (Name : String) return Boolean renames Is_Read_Accessible_File; function Is_Writable_File (Name : String) return Boolean renames Is_Write_Accessible_File; -- These subprograms provided for backward compatibility and should not be -- used. Use Is_Owner_Readable_File/Is_Owner_Writable_File or -- Is_Read_Accessible_File/Is_Write_Accessible_File instead. function Locate_Exec_On_Path (Exec_Name : String) return String_Access; -- Try to locate an executable whose name is given by Exec_Name in the -- directories listed in the environment Path. If the Exec_Name does not -- have the executable suffix, it will be appended before the search. -- Otherwise works like Locate_Regular_File below. If the executable is -- not found, null is returned. -- -- Note that this function allocates memory for the returned value. This -- memory needs to be deallocated after use. function Locate_Regular_File (File_Name : String; Path : String) return String_Access; -- Try to locate a regular file whose name is given by File_Name in the -- directories listed in Path. If a file is found, its full pathname is -- returned; otherwise, a null pointer is returned. If the File_Name given -- is an absolute pathname, then Locate_Regular_File just checks that the -- file exists and is a regular file. Otherwise, if the File_Name given -- includes directory information, Locate_Regular_File first checks if the -- file exists relative to the current directory. If it does not, or if -- the File_Name given is a simple file name, the Path argument is parsed -- according to OS conventions, and for each directory in the Path a check -- is made if File_Name is a relative pathname of a regular file from that -- directory. -- -- Note that this function allocates some memory for the returned value. -- This memory needs to be deallocated after use. Seek_Cur : constant := 1; Seek_End : constant := 2; Seek_Set : constant := 0; -- Used to indicate origin for Lseek call procedure Lseek (FD : File_Descriptor; offset : Long_Integer; origin : Integer); pragma Import (C, Lseek, "__gnat_lseek"); -- Sets the current file pointer to the indicated offset value, relative -- to the current position (origin = SEEK_CUR), end of file (origin = -- SEEK_END), or start of file (origin = SEEK_SET). function Normalize_Pathname (Name : String; Directory : String := ""; Resolve_Links : Boolean := True; Case_Sensitive : Boolean := True) return String; -- Returns a file name as an absolute path name, resolving all relative -- directories, and symbolic links. If Name is a relative path, it is -- interpreted relative to Directory, or to the current directory if -- Directory is the empty string (the default). The result returned is -- the normalized name of the file, containing no "." or ".." components, -- and no duplicated directory separators. For most cases, if two file -- names designate the same file through different paths, -- Normalize_Pathname will return the same canonical name in both cases. -- However, there are cases when this is not true; for example, this is -- not true in Unix for two hard links designating the same file. -- -- On Windows, the returned path will start with a drive letter. If -- Directory is empty (the default) and Name is a relative path or an -- absolute path without drive letter, the letter of the current drive -- will start the returned path. If Case_Sensitive is True (the default), -- then this drive letter will be forced to upper case ("C:\..."). -- -- If Resolve_Links is set to True, then the symbolic links, on systems -- that support them, will be fully converted to the name of the file or -- directory pointed to. This is slightly less efficient, since it -- requires system calls. -- -- If Name cannot be resolved, is invalid (for example if it is too big) or -- is null on entry (for example if there is symbolic link circularity, -- e.g. A is a symbolic link for B, and B is a symbolic link for A), then -- Normalize_Pathname returns an empty string. -- -- For case-sensitive file systems, the value of Case_Sensitive parameter -- is ignored. For file systems that are not case-sensitive, such as -- Windows, if this parameter is set to False, then the file and directory -- names are folded to lower case. This allows checking whether two files -- are the same by applying this function to their names and comparing the -- results. If Case_Sensitive is set to True, this function does not change -- the casing of file and directory names. function Open_Append (Name : String; Fmode : Mode) return File_Descriptor; -- Opens file Name for appending, returning its file descriptor. File -- descriptor returned is Invalid_FD if the file cannot be successfully -- opened. function Open_Read (Name : String; Fmode : Mode) return File_Descriptor; -- Open file Name for reading, returning its file descriptor. File -- descriptor returned is Invalid_FD if the file cannot be opened. function Open_Read_Write (Name : String; Fmode : Mode) return File_Descriptor; -- Open file Name for both reading and writing, returning its file -- descriptor. File descriptor returned is Invalid_FD if the file -- cannot be opened. function Read (FD : File_Descriptor; A : System.Address; N : Integer) return Integer; -- Read N bytes to address A from file referenced by FD. Returned value is -- count of bytes actually read, which can be less than N at EOF. procedure Rename_File (Old_Name : String; New_Name : String; Success : out Boolean); -- Rename a file. Success is set True or False indicating if the rename is -- successful or not. -- -- WARNING: In one very important respect, this function is significantly -- non-portable. If New_Name already exists then on Unix systems, the call -- deletes the existing file, and the call signals success. On Windows, the -- call fails, without doing the rename operation. See also the procedure -- Ada.Directories.Rename, which portably provides the windows semantics, -- i.e. fails if the output file already exists. -- The following defines the mode for the Copy_File procedure below. Note -- that "time stamps and other file attributes" in the descriptions below -- refers to the creation and last modification times, and also the file -- access (read/write/execute) status flags. procedure Set_Close_On_Exec (FD : File_Descriptor; Close_On_Exec : Boolean; Status : out Boolean); -- When Close_On_Exec is True, mark FD to be closed automatically when new -- program is executed by the calling process (i.e. prevent FD from being -- inherited by child processes). When Close_On_Exec is False, mark FD to -- not be closed on exec (i.e. allow it to be inherited). Status is False -- if the operation could not be performed. S_Owner : constant := 1; S_Group : constant := 2; S_Others : constant := 4; -- Constants for use in Mode parameter to Set_Executable procedure Set_Executable (Name : String; Mode : Positive := S_Owner); -- Change permissions on the file given by Name to make it executable -- for its owner, group or others, according to the setting of Mode. -- As indicated, the default if no Mode parameter is given is owner. procedure Set_File_Last_Modify_Time_Stamp (Name : String; Time : OS_Time); -- Given the name of a file or directory, Name, set the last modification -- time stamp. This function must be used for an unopened file. procedure Set_Non_Readable (Name : String); -- Change permissions on the named file to make it non-readable for -- its owner. The writable and executable permissions are not -- modified. procedure Set_Non_Writable (Name : String); -- Change permissions on the named file to make it non-writable for its -- owner. The readable and executable permissions are not modified. procedure Set_Read_Only (Name : String) renames Set_Non_Writable; -- This renaming is provided for backwards compatibility with previous -- versions. The use of Set_Non_Writable is preferred (clearer name). procedure Set_Readable (Name : String); -- Change permissions on the named file to make it readable for its -- owner. procedure Set_Writable (Name : String); -- Change permissions on the named file to make it writable for its owner function Write (FD : File_Descriptor; A : System.Address; N : Integer) return Integer; -- Write N bytes from address A to file referenced by FD. The returned -- value is the number of bytes written, which can be less than N if a -- disk full condition was detected. -- The following section contains low-level routines using addresses to -- pass file name and executable name. In each routine the name must be -- Nul-Terminated. For complete documentation refer to the equivalent -- routine (using String in place of C_File_Name) defined above. subtype C_File_Name is System.Address; -- This subtype is used to document that a parameter is the address of a -- null-terminated string containing the name of a file. procedure Copy_File (Name : C_File_Name; Pathname : C_File_Name; Success : out Boolean; Mode : Copy_Mode := Copy; Preserve : Attribute := Time_Stamps); procedure Copy_Time_Stamps (Source : C_File_Name; Dest : C_File_Name; Success : out Boolean); function Create_File (Name : C_File_Name; Fmode : Mode) return File_Descriptor; function Create_New_File (Name : C_File_Name; Fmode : Mode) return File_Descriptor; procedure Delete_File (Name : C_File_Name; Success : out Boolean); function File_Time_Stamp (Name : C_File_Name) return OS_Time; function Is_Directory (Name : C_File_Name) return Boolean; function Is_Executable_File (Name : C_File_Name) return Boolean; function Is_Owner_Readable_File (Name : C_File_Name) return Boolean; function Is_Regular_File (Name : C_File_Name) return Boolean; function Is_Symbolic_Link (Name : C_File_Name) return Boolean; function Is_Owner_Writable_File (Name : C_File_Name) return Boolean; function Locate_Regular_File (File_Name : C_File_Name; Path : C_File_Name) return String_Access; function Open_Append (Name : C_File_Name; Fmode : Mode) return File_Descriptor; function Open_Read (Name : C_File_Name; Fmode : Mode) return File_Descriptor; function Open_Read_Write (Name : C_File_Name; Fmode : Mode) return File_Descriptor; procedure Rename_File (Old_Name : C_File_Name; New_Name : C_File_Name; Success : out Boolean); ------------------ -- Subprocesses -- ------------------ subtype Argument_List is String_List; -- Type used for argument list in call to Spawn. The lower bound of the -- array should be 1, and the length of the array indicates the number of -- arguments. subtype Argument_List_Access is String_List_Access; -- Type used to return Argument_List without dragging in secondary stack. -- Note that there is a Free procedure declared for this subtype which -- frees the array and all referenced strings. type Process_Id is private; -- A private type used to identify a process activated by the following -- non-blocking calls. The only meaningful operation on this type is a -- comparison for equality. Invalid_Pid : constant Process_Id; -- A special value used to indicate errors, as described below function Current_Process_Id return Process_Id; -- Returns the current process id or Invalid_Pid if not supported by the -- runtime. function Argument_String_To_List (Arg_String : String) return Argument_List_Access; -- Take a string that is a program and its arguments and parse it into an -- Argument_List. Note that the result is allocated on the heap, and must -- be freed by the programmer (when it is no longer needed) to avoid -- memory leaks. -- On Windows, backslashes are used as directory separators. On Unix, -- however, they are used to escape the following character, so that for -- instance "-d=name\ with\ space" is a single argument. In the result -- list, the backslashes have been cleaned up when needed. The previous -- example will thus result a single-element array, where the element is -- "-d=name with space" (Unix) or "-d=name\ with\ space" (windows). procedure Kill (Pid : Process_Id; Hard_Kill : Boolean := True); -- Kill the process designated by Pid. Does nothing if Pid is Invalid_Pid -- or on platforms where it is not supported, such as VxWorks. Hard_Kill -- is True by default, and when True the process is terminated immediately. -- If Hard_Kill is False, then a signal SIGINT is sent to the process on -- POSIX OS or a ctrl-C event on Windows, allowing the process a chance to -- terminate properly using a corresponding handler. procedure Kill_Process_Tree (Pid : Process_Id; Hard_Kill : Boolean := True); -- Kill the process designated by Pid and all it's children processes. -- Does nothing if Pid is Invalid_Pid or on platforms where it is not -- supported, such as VxWorks. Hard_Kill is True by default, and when True -- the processes are terminated immediately. If Hard_Kill is False, then a -- signal SIGINT is sent to the processes on POSIX OS or a ctrl-C event -- on Windows, allowing the processes a chance to terminate properly -- using a corresponding handler. -- -- Note that this routine is not atomic and is supported only on Linux -- and Windows. On other OS it will only kill the process identified by -- Pid. function Non_Blocking_Spawn (Program_Name : String; Args : Argument_List) return Process_Id; -- This is a non blocking call. The Process_Id of the spawned process is -- returned. Parameters are to be used as in Spawn. If Invalid_Pid is -- returned the program could not be spawned. -- -- Spawning processes from tasking programs is not recommended. See -- "NOTE: Spawn in tasking programs" below. -- -- This function will always return Invalid_Pid under VxWorks, since there -- is no notion of executables under this OS. function Non_Blocking_Spawn (Program_Name : String; Args : Argument_List; Output_File_Descriptor : File_Descriptor; Err_To_Out : Boolean := True) return Process_Id; -- Similar to the procedure above, but redirects the output to the file -- designated by Output_File_Descriptor. If Err_To_Out is True, then the -- Standard Error output is also redirected. Invalid_Pid is returned -- if the program could not be spawned successfully. -- -- Spawning processes from tasking programs is not recommended. See -- "NOTE: Spawn in tasking programs" below. -- -- This function will always return Invalid_Pid under VxWorks, since there -- is no notion of executables under this OS. function Non_Blocking_Spawn (Program_Name : String; Args : Argument_List; Output_File : String; Err_To_Out : Boolean := True) return Process_Id; -- Similar to the procedure above, but saves the output of the command to -- a file with the name Output_File. -- -- Invalid_Pid is returned if the output file could not be created or if -- the program could not be spawned successfully. -- -- Spawning processes from tasking programs is not recommended. See -- "NOTE: Spawn in tasking programs" below. -- -- This function will always return Invalid_Pid under VxWorks, since there -- is no notion of executables under this OS. function Non_Blocking_Spawn (Program_Name : String; Args : Argument_List; Stdout_File : String; Stderr_File : String) return Process_Id; -- Similar to the procedure above, but saves the standard output of the -- command to a file with the name Stdout_File and the standard output -- of the command to a file with the name Stderr_File. procedure Normalize_Arguments (Args : in out Argument_List); -- Normalize all arguments in the list. This ensure that the argument list -- is compatible with the running OS and will works fine with Spawn and -- Non_Blocking_Spawn for example. If Normalize_Arguments is called twice -- on the same list it will do nothing the second time. Note that Spawn -- and Non_Blocking_Spawn call Normalize_Arguments automatically, but -- since there is a guarantee that a second call does nothing, this -- internal call will have no effect if Normalize_Arguments is called -- before calling Spawn. The call to Normalize_Arguments assumes that the -- individual referenced arguments in Argument_List are on the heap, and -- may free them and reallocate if they are modified. function Pid_To_Integer (Pid : Process_Id) return Integer; -- Convert a process id to an Integer. Useful for writing hash functions -- for type Process_Id or to compare two Process_Id (e.g. for sorting). procedure Spawn (Program_Name : String; Args : Argument_List; Success : out Boolean); -- This procedure spawns a program with a given list of arguments. The -- first parameter of is the name of the executable. The second parameter -- contains the arguments to be passed to this program. Success is False -- if the named program could not be spawned or its execution completed -- unsuccessfully. Note that the caller will be blocked until the -- execution of the spawned program is complete. For maximum portability, -- use a full path name for the Program_Name argument. On some systems -- (notably Unix systems) a simple file name may also work (if the -- executable can be located in the path). -- -- Spawning processes from tasking programs is not recommended. See -- "NOTE: Spawn in tasking programs" below. -- -- Note: Arguments in Args that contain spaces and/or quotes such as -- "--GCC=gcc -v" or "--GCC=""gcc -v""" are not portable across all -- operating systems, and would not have the desired effect if they were -- passed directly to the operating system. To avoid this problem, Spawn -- makes an internal call to Normalize_Arguments, which ensures that such -- arguments are modified in a manner that ensures that the desired effect -- is obtained on all operating systems. The caller may call -- Normalize_Arguments explicitly before the call (e.g. to print out the -- exact form of arguments passed to the operating system). In this case -- the guarantee a second call to Normalize_Arguments has no effect -- ensures that the internal call will not affect the result. Note that -- the implicit call to Normalize_Arguments may free and reallocate some -- of the individual arguments. -- -- This function will always set Success to False under VxWorks and other -- similar operating systems which have no notion of the concept of -- dynamically executable file. Otherwise Success is set True if the exit -- status of the spawned process is zero. function Spawn (Program_Name : String; Args : Argument_List) return Integer; -- Similar to the above procedure, but returns the actual status returned -- by the operating system, or -1 under VxWorks and any other similar -- operating systems which have no notion of separately spawnable programs. -- -- Spawning processes from tasking programs is not recommended. See -- "NOTE: Spawn in tasking programs" below. procedure Spawn (Program_Name : String; Args : Argument_List; Output_File_Descriptor : File_Descriptor; Return_Code : out Integer; Err_To_Out : Boolean := True); -- Similar to the procedure above, but redirects the output to the file -- designated by Output_File_Descriptor. If Err_To_Out is True, then the -- Standard Error output is also redirected. -- Return_Code is set to the status code returned by the operating system -- -- Spawning processes from tasking programs is not recommended. See -- "NOTE: Spawn in tasking programs" below. procedure Spawn (Program_Name : String; Args : Argument_List; Output_File : String; Success : out Boolean; Return_Code : out Integer; Err_To_Out : Boolean := True); -- Similar to the procedure above, but saves the output of the command to -- a file with the name Output_File. -- -- Success is set to True if the command is executed and its output -- successfully written to the file. If Success is True, then Return_Code -- will be set to the status code returned by the operating system. -- Otherwise, Return_Code is undefined. -- -- Spawning processes from tasking programs is not recommended. See -- "NOTE: Spawn in tasking programs" below. procedure Wait_Process (Pid : out Process_Id; Success : out Boolean); -- Wait for the completion of any of the processes created by previous -- calls to Non_Blocking_Spawn. The caller will be suspended until one of -- these processes terminates (normally or abnormally). If any of these -- subprocesses terminates prior to the call to Wait_Process (and has not -- been returned by a previous call to Wait_Process), then the call to -- Wait_Process is immediate. Pid identifies the process that has -- terminated (matching the value returned from Non_Blocking_Spawn). -- Success is set to True if this sub-process terminated successfully. If -- Pid = Invalid_Pid, there were no subprocesses left to wait on. -- -- This function will always set success to False under VxWorks, since -- there is no notion of executables under this OS. ------------------------------------- -- NOTE: Spawn in Tasking Programs -- ------------------------------------- -- Spawning processes in tasking programs using the above Spawn and -- Non_Blocking_Spawn subprograms is not recommended, because there are -- subtle interactions between creating a process and signals/locks that -- can cause trouble. These issues are not specific to Ada; they depend -- primarily on the operating system. -- If you need to spawn processes in a tasking program, you will need to -- understand the semantics of your operating system, and you are likely to -- write non-portable code, because operating systems differ in this area. -- The Spawn and Non_Blocking_Spawn subprograms call the following -- operating system functions: -- On Windows: spawnvp (blocking) or CreateProcess (non-blocking) -- On Solaris: fork1, followed in the child process by execv -- On other Unix-like systems: fork, followed in the child -- process by execv. -- On vxworks, spawning of processes is not supported -- For details, look at the functions __gnat_portable_spawn and -- __gnat_portable_no_block_spawn in adaint.c. -- You should read the operating-system-specific documentation for the -- above functions, paying special attention to subtle interactions with -- threading, signals, locks, and file descriptors. Most of the issues are -- related to the fact that on Unix, there is a window of time between fork -- and execv; Windows does not have this problem, because spawning is done -- in a single operation. -- On Posix-compliant systems, such as Linux, fork duplicates just the -- calling thread. (On Solaris, fork1 is the Posix-compliant version of -- fork.) -- You should avoid using signals while spawning. This includes signals -- used internally by the Ada run-time system, such as timer signals used -- to implement delay statements. -- It is best to spawn any subprocesses very early, before the parent -- process creates tasks, locks, or installs signal handlers. Certainly -- avoid doing simultaneous spawns from multiple threads of the same -- process. -- There is no problem spawning a subprocess that uses tasking: the -- problems are caused only by tasking in the parent. -- If the parent is using tasking, and needs to spawn subprocesses at -- arbitrary times, one technique is for the parent to spawn (very early) -- a particular spawn-manager subprocess whose job is to spawn other -- processes. The spawn-manager must avoid tasking. The parent sends -- messages to the spawn-manager requesting it to spawn processes, using -- whatever inter-process communication mechanism you like, such as -- sockets. -- In short, mixing spawning of subprocesses with tasking is a tricky -- business, and should be avoided if possible, but if it is necessary, -- the above guidelines should be followed, and you should beware of -- portability problems. ------------------- -- Miscellaneous -- ------------------- function Errno return Integer; pragma Import (C, Errno, "__get_errno"); -- Return the task-safe last error number function Errno_Message (Err : Integer := Errno; Default : String := "") return String; -- Return a message describing the given Errno value. If none is provided -- by the system, return Default if not empty, else return a generic -- message indicating the numeric errno value. function Getenv (Name : String) return String_Access; -- Get the value of the environment variable. Returns an access to the -- empty string if the environment variable does not exist or has an -- explicit null value (in some operating systems these are distinct -- cases, in others they are not; this interface abstracts away that -- difference. The argument is allocated on the heap (even in the null -- case), and needs to be freed explicitly when no longer needed to avoid -- memory leaks. procedure OS_Abort; pragma Import (C, OS_Abort, "abort"); pragma No_Return (OS_Abort); -- Exit to OS signalling an abort (traceback or other appropriate -- diagnostic information should be given if possible, or entry made to -- the debugger if that is possible). procedure OS_Exit (Status : Integer); pragma No_Return (OS_Exit); -- Exit to OS with given status code (program is terminated). Note that -- this is abrupt termination. All tasks are immediately terminated. There -- are no finalization or other Ada-specific cleanup actions performed. On -- systems with atexit handlers (such as Unix and Windows), atexit handlers -- are called. type OS_Exit_Subprogram is access procedure (Status : Integer); procedure OS_Exit_Default (Status : Integer); pragma No_Return (OS_Exit_Default); -- Default implementation of procedure OS_Exit OS_Exit_Ptr : OS_Exit_Subprogram := OS_Exit_Default'Access; -- OS_Exit is implemented through this access value. It it then possible to -- change the implementation of OS_Exit by redirecting OS_Exit_Ptr to an -- other implementation. procedure Set_Errno (Errno : Integer); pragma Import (C, Set_Errno, "__set_errno"); -- Set the task-safe error number procedure Setenv (Name : String; Value : String); -- Set the value of the environment variable Name to Value. This call -- modifies the current environment, but does not modify the parent -- process environment. After a call to Setenv, Getenv (Name) will always -- return a String_Access referencing the same String as Value. This is -- true also for the null string case (the actual effect may be to either -- set an explicit null as the value, or to remove the entry, this is -- operating system dependent). Note that any following calls to Spawn -- will pass an environment to the spawned process that includes the -- changes made by Setenv calls. Directory_Separator : constant Character; -- The character that is used to separate parts of a pathname Path_Separator : constant Character; -- The character to separate paths in an environment variable value private pragma Import (C, Path_Separator, "__gnat_path_separator"); pragma Import (C, Directory_Separator, "__gnat_dir_separator"); pragma Import (C, Current_Time, "__gnat_current_time"); pragma Import (C, Current_Process_Id, "__gnat_current_process_id"); type OS_Time is range -(2 ** (Standard'Address_Size - Integer'(1))) .. +(2 ** (Standard'Address_Size - Integer'(1)) - 1); -- Type used for timestamps in the compiler. This type is used to hold -- time stamps, but may have a different representation than C's time_t. -- This type needs to match the declaration of OS_Time in adaint.h. -- Add pragma Inline statements for comparison operations on OS_Time. It -- would actually be nice to use pragma Import (Intrinsic) here, but this -- was not properly supported till GNAT 3.15a, so that would cause -- bootstrap path problems. To be changed later ??? Invalid_Time : constant OS_Time := -1; -- This value should match the return value from __gnat_file_time_* pragma Inline ("<"); pragma Inline (">"); pragma Inline ("<="); pragma Inline (">="); type Process_Id is new Integer; Invalid_Pid : constant Process_Id := -1; end System.OS_Lib;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . W C H _ W T S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2019, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System.WCh_Con; use System.WCh_Con; with System.WCh_Cnv; use System.WCh_Cnv; package body System.WCh_WtS is ----------------------- -- Local Subprograms -- ----------------------- procedure Store_UTF_32_Character (U : UTF_32_Code; S : out String; P : in out Integer; EM : WC_Encoding_Method); -- Stores the string representation of the wide or wide wide character -- whose code is given as U, starting at S (P + 1). P is incremented to -- point to the last character stored. Raises CE if character cannot be -- stored using the given encoding method. ---------------------------- -- Store_UTF_32_Character -- ---------------------------- procedure Store_UTF_32_Character (U : UTF_32_Code; S : out String; P : in out Integer; EM : WC_Encoding_Method) is procedure Out_Char (C : Character); pragma Inline (Out_Char); -- Procedure to increment P and store C at S (P) procedure Store_Chars is new UTF_32_To_Char_Sequence (Out_Char); -------------- -- Out_Char -- -------------- procedure Out_Char (C : Character) is begin P := P + 1; S (P) := C; end Out_Char; begin Store_Chars (U, EM); end Store_UTF_32_Character; --------------------------- -- Wide_String_To_String -- --------------------------- function Wide_String_To_String (S : Wide_String; EM : WC_Encoding_Method) return String is Max_Chars : constant Natural := WC_Longest_Sequences (EM); Result : String (S'First .. S'First + Max_Chars * S'Length); Result_Idx : Natural; begin Result_Idx := Result'First - 1; for S_Idx in S'Range loop Store_UTF_32_Character (U => Wide_Character'Pos (S (S_Idx)), S => Result, P => Result_Idx, EM => EM); end loop; return Result (Result'First .. Result_Idx); end Wide_String_To_String; -------------------------------- -- Wide_Wide_String_To_String -- -------------------------------- function Wide_Wide_String_To_String (S : Wide_Wide_String; EM : WC_Encoding_Method) return String is Max_Chars : constant Natural := WC_Longest_Sequences (EM); Result : String (S'First .. S'First + Max_Chars * S'Length); Result_Idx : Natural; begin Result_Idx := Result'First - 1; for S_Idx in S'Range loop Store_UTF_32_Character (U => Wide_Wide_Character'Pos (S (S_Idx)), S => Result, P => Result_Idx, EM => EM); end loop; return Result (Result'First .. Result_Idx); end Wide_Wide_String_To_String; end System.WCh_WtS;
generic type Signed_Int_Type is range <>; package Fmt.Generic_Signed_Int_Argument is function To_Argument (X : Signed_Int_Type) return Argument_Type'Class with Inline; function "&" (Args : Arguments; X : Signed_Int_Type) return Arguments with Inline; private type Digit_Style is (DS_Lowercase, DS_Uppercase); subtype Number_Base is Positive range 2 .. 36; type Signed_Int_Argument_Type is new Argument_Type with record Value : Signed_Int_Type; Width : Natural := 0; Align : Text_Align := 'R'; Fill : Character := ' '; Base : Number_Base := 10; Style : Digit_Style := DS_Lowercase; end record; overriding procedure Parse (Self : in out Signed_Int_Argument_Type; Edit : String); overriding function Get_Length (Self : in out Signed_Int_Argument_Type) return Natural; overriding procedure Put ( Self : in out Signed_Int_Argument_Type; Edit : String; To : in out String); end Fmt.Generic_Signed_Int_Argument;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, 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. -- -- -- ------------------------------------------------------------------------------ package SSD1306.Standard_Resolutions is -- type SSD1306_96x16_Screen -- (Port : not null Any_I2C_Port; -- RST : not null Any_GPIO_Point; -- Time : not null HAL.Time.Any_Delays) -- is new SSD1306_Screen ((96 * 16) / 8, 96, 16, Port, RST, Time) with null record; -- type SSD1306_128x32_Screen -- (Port : not null Any_I2C_Port; -- RST : not null Any_GPIO_Point; -- Time : not null HAL.Time.Any_Delays) -- is new SSD1306_Screen ((128 * 32) / 8, 128, 32, Port, RST, Time) with null record; -- type SSD1306_128x64_Screen -- (Port : not null Any_I2C_Port; -- RST : not null Any_GPIO_Point; -- Time : not null HAL.Time.Any_Delays) -- is new SSD1306_Screen ((128 * 64) / 8, 128, 64, Port, RST, Time) with null record; end SSD1306.Standard_Resolutions;
-- C41103A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT THE NAME IN AN INDEXED_COMPONENT MAY BE: -- AN IDENTIFIER DENOTING AN ARRAY OBJECT - N1; -- AN IDENTIFIER DENOTING AN ACCESS OBJECT WHOSE VALUE -- DESIGNATES AN ARRAY OBJECT - N2; -- A FUNCTION CALL DELIVERING AN ARRAY OBJECT USING -- A PREDEFINED FUNCTION - &, -- A USER-DEFINED FUNCTION - F1; -- A FUNCTION CALL DELIVERING AN ACCESS VALUE THAT -- DESIGNATES AN ARRAY - F2; -- A SLICE (CHECKING UPPER AND LOWER BOUND COMPONENTS) - N3; -- AN INDEXED COMPONENT DENOTING AN ARRAY OBJECT -- (ARRAY OF ARRAYS) - N4; -- AN IDENTIFIER PREFIXED BY THE NAME OF THE INNERMOST UNIT -- ENCLOSING ITS DECLARATION - C41103A.N1; -- A RECORD COMPONENT (OF A RECORD CONTAINING ONE OR MORE -- ARRAYS WHOSE BOUNDS DEPEND ON A DISCRIMINANT) - N5. -- CHECK THAT THE APPROPRIATE COMPONENT IS ACCESSED (FOR -- STATIC INDICES). -- WKB 7/27/81 -- JRK 7/28/81 -- SPS 10/26/82 -- PWN 11/30/94 SUBTYPE QUALIFIED LITERALS FOR ADA 9X. WITH REPORT; USE REPORT; PROCEDURE C41103A IS TYPE A1 IS ARRAY (INTEGER RANGE 1..4) OF INTEGER; N1 : A1 := (1,2,3,4); BEGIN TEST ("C41103A", "CHECK THAT AN INDEXED_COMPONENT MAY BE OF " & "CERTAIN FORMS AND THAT THE APPROPRIATE " & "COMPONENT IS ACCESSED (FOR STATIC INDICES)"); DECLARE TYPE A2 IS ARRAY (INTEGER RANGE 1..4) OF BOOLEAN; TYPE A3 IS ACCESS A1; TYPE A4 IS ARRAY (INTEGER RANGE 1..4) OF A1; TYPE R (LENGTH : INTEGER) IS RECORD S : STRING (1..LENGTH); END RECORD; N2 : A3 := NEW A1' (1,2,3,4); N3 : ARRAY (1..7) OF INTEGER := (1,2,3,4,5,6,7); N4 : A4 := (1 => (1,2,3,4), 2 => (5,6,7,8), 3 => (9,10,11,12), 4 => (13,14,15,16)); N5 : R(4) := (LENGTH => 4, S => "ABCD"); FUNCTION F1 RETURN A2 IS BEGIN RETURN (FALSE,FALSE,TRUE,FALSE); END F1; FUNCTION F2 RETURN A3 IS BEGIN RETURN N2; END F2; PROCEDURE P1 (X : IN INTEGER; Y : IN OUT INTEGER; Z : OUT INTEGER; W : IN STRING) IS BEGIN IF X /= 2 THEN FAILED ("WRONG VALUE FOR IN PARAMETER - " & W); END IF; IF Y /= 3 THEN FAILED ("WRONG VALUE FOR IN OUT PARAMETER - " & W); END IF; Y := 8; Z := 9; END P1; PROCEDURE P2 (X : CHARACTER) IS BEGIN IF X /= 'C' THEN FAILED ("WRONG VALUE FOR IN PARAMETER - '&'"); END IF; END P2; PROCEDURE P3 (X : BOOLEAN) IS BEGIN IF X /= TRUE THEN FAILED ("WRONG VALUE FOR IN PARAMETER - F1"); END IF; END P3; PROCEDURE P5 (X : IN CHARACTER; Y : IN OUT CHARACTER; Z : OUT CHARACTER) IS BEGIN IF X /= 'A' THEN FAILED ("WRONG VALUE FOR IN PARAMETER - N5"); END IF; IF Y /= 'D' THEN FAILED ("WRONG VALUE FOR IN OUT PARAMETER - N5"); END IF; Y := 'Y'; Z := 'Z'; END P5; BEGIN IF N1(2) /= 2 THEN FAILED ("WRONG VALUE FOR EXPRESSION - N1"); END IF; N1(2) := 7; IF N1 /= (1,7,3,4) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - N1"); END IF; N1 := (1,2,3,4); P1 (N1(2), N1(3), N1(1), "N1"); IF N1 /= (9,2,8,4) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - N1"); END IF; IF N2(3) /= 3 THEN FAILED ("WRONG VALUE FOR EXPRESSION - N2"); END IF; N2(3) := 7; IF N2.ALL /= (1,2,7,4) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - N2"); END IF; N2.ALL := (2,1,4,3); P1 (N2(1), N2(4), N2(2), "N2"); IF N2.ALL /= (2,9,4,8) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - N2"); END IF; IF "&" (STRING'("AB"), STRING'("CDEF"))(5) /= CHARACTER'('E') THEN FAILED ("WRONG VALUE FOR EXPRESSION - '&'"); END IF; P2 ("&" ("AB", "CD")(3)); IF F1(3) /= TRUE THEN FAILED ("WRONG VALUE FOR EXPRESSION - F1"); END IF; P3 (F1(3)); N2 := NEW A1' (1,2,3,4); IF F2(2) /= 2 THEN FAILED ("WRONG VALUE FOR EXPRESSION - F2"); END IF; F2(3) := 7; IF N2.ALL /= (1,2,7,4) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - F2"); END IF; N2.ALL := (1,2,3,4); P1 (F2(2), F2(3), F2(1), "F2"); IF N2.ALL /= (9,2,8,4) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - F2"); END IF; IF N3(2..5)(5) /= 5 THEN FAILED ("WRONG VALUE FOR EXPRESSION - N3"); END IF; N3(2..5)(2) := 8; IF N3 /= (1,8,3,4,5,6,7) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - N3"); END IF; N3 := (5,3,4,2,1,6,7); P1 (N3(2..5)(4), N3(2..5)(2), N3(2..5)(5), "N3"); IF N3 /= (5,8,4,2,9,6,7) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - N3"); END IF; IF N4(1)(2) /= 2 THEN FAILED ("WRONG VALUE FOR EXPRESSION - N4"); END IF; N4(3)(1) := 20; IF N4 /= ((1,2,3,4),(5,6,7,8),(20,10,11,12), (13,14,15,16)) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - N4"); END IF; N4 := (1 => (0,6,4,2), 2 => (10,11,12,13), 3 => (14,15,16,17), 4 => (7,5,3,1)); P1 (N4(1)(4), N4(4)(3), N4(2)(1), "N4"); IF N4 /= ((0,6,4,2),(9,11,12,13),(14,15,16,17), (7,5,8,1)) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - N4"); END IF; N1 := (1,2,3,4); IF C41103A.N1(2) /= 2 THEN FAILED ("WRONG VALUE FOR EXPRESSION - C41103A.N1"); END IF; C41103A.N1(2) := 7; IF N1 /= (1,7,3,4) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - C41103A.N1"); END IF; N1 := (1,2,3,4); P1 (C41103A.N1(2), C41103A.N1(3), C41103A.N1(1), "C41103A.N1"); IF N1 /= (9,2,8,4) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER " & "- C41103A.N1"); END IF; IF N5.S(3) /= 'C' THEN FAILED ("WRONG VALUE FOR EXPRESSION - N5"); END IF; N5.S(4) := 'X'; IF N5.S /= "ABCX" THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - N5"); END IF; N5.S := "ABCD"; P5 (N5.S(1), N5.S(4), N5.S(2)); IF N5.S /= "AZCY" THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - N5"); END IF; END; RESULT; END C41103A;
-- Copyright 2019-2020 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pck; procedure Length_Cond is type Enum is (One, Two, Three); Enum_Val : Enum := Three; type My_Int is range -23 .. 23; Int_Val : My_Int := 0; type My_Array is array (0..1, 0..1) of Boolean; Array_Val : My_Array := ((True, False), (False, True)); procedure p (s : String) is loc : String := s & "."; begin Pck.Do_Nothing (loc); -- BREAKPOINT end p; begin for I in 1 .. 25 loop p ((1 .. I => 'X')); end loop; end Length_Cond;
with Text_IO; procedure No_To_WAR is begin Text_IO.Put_line("No to war!"); end No_To_WAR;
----------------------------------------------------------------------- -- awa-blogs -- Blogs module -- Copyright (C) 2011, 2014, 2015, 2018 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- 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. ----------------------------------------------------------------------- -- = Blogs Module = -- The `blogs` module is a small blog application which allows users to publish articles. -- A user may own several blogs, each blog having a name and its own base URI. Within a blog, -- the user may write articles and publish them. Once published, the articles are visible to -- anonymous users. -- -- The `blogs` module uses the [AWA_Tags] and [AWA_Comments] modules to allow to associate -- tags to a post and allow users to comment on the articles. -- -- @include awa-blogs-modules.ads -- -- @include awa-blogs-beans.ads -- @include-bean blogs.xml -- @include-bean blog-admin-post-list.xml -- @include-bean blog-post-list.xml -- @include-bean blog-comment-list.xml -- @include-bean blog-list.xml -- @include-bean blog-tags.xml -- -- == Queries == -- @include-query blog-admin-post-list.xml -- @include-query blog-post-list.xml -- @include-query blog-comment-list.xml -- @include-query blog-list.xml -- @include-query blog-tags.xml -- -- == Data model == -- [images/awa_blogs_model.png] -- package AWA.Blogs is pragma Pure; end AWA.Blogs;
with Ada.Finalization; use Ada.Finalization; package Noreturn4_Pkg is type Priv is private; function It return Priv; function Value (Obj : Priv) return Integer; function OK (Obj : Priv) return Boolean; private type Priv is new Controlled with record Value : Integer := 15; end record; procedure Adjust (Obj : in out Priv); procedure Finalize (Obj : in out Priv); end Noreturn4_Pkg;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . U T F _ 3 2 -- -- -- -- S p e c -- -- -- -- Copyright (C) 2005-2013, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- 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 is an internal package that provides basic character -- classification capabilities needed by the compiler for handling full -- 32-bit wide wide characters. We avoid the use of the actual type -- Wide_Wide_Character, since we want to use these routines in the compiler -- itself, and we want to be able to compile the compiler with old versions -- of GNAT that did not implement Wide_Wide_Character. -- System.UTF_32 should not be directly used from an application program, but -- an equivalent package GNAT.UTF_32 can be used directly and provides exactly -- the same services. The reason this package is in System is so that it can -- with'ed by other packages in the Ada and System hierarchies. pragma Compiler_Unit_Warning; package System.UTF_32 is pragma Pure; type UTF_32 is range 0 .. 16#7FFF_FFFF#; -- So far, the only defined character codes are in 0 .. 16#01_FFFF# -- The following type defines the categories from the unicode definitions. -- The one addition we make is Fe, which represents the characters FFFE -- and FFFF in any of the planes. type Category is ( Cc, -- Other, Control Cf, -- Other, Format Cn, -- Other, Not Assigned Co, -- Other, Private Use Cs, -- Other, Surrogate Ll, -- Letter, Lowercase Lm, -- Letter, Modifier Lo, -- Letter, Other Lt, -- Letter, Titlecase Lu, -- Letter, Uppercase Mc, -- Mark, Spacing Combining Me, -- Mark, Enclosing Mn, -- Mark, Nonspacing Nd, -- Number, Decimal Digit Nl, -- Number, Letter No, -- Number, Other Pc, -- Punctuation, Connector Pd, -- Punctuation, Dash Pe, -- Punctuation, Close Pf, -- Punctuation, Final quote Pi, -- Punctuation, Initial quote Po, -- Punctuation, Other Ps, -- Punctuation, Open Sc, -- Symbol, Currency Sk, -- Symbol, Modifier Sm, -- Symbol, Math So, -- Symbol, Other Zl, -- Separator, Line Zp, -- Separator, Paragraph Zs, -- Separator, Space Fe); -- relative position FFFE/FFFF in any plane function Get_Category (U : UTF_32) return Category; -- Given a UTF32 code, returns corresponding Category, or Cn if -- the code does not have an assigned unicode category. -- The following functions perform category tests corresponding to lexical -- classes defined in the Ada standard. There are two interfaces for each -- function. The second takes a Category (e.g. returned by Get_Category). -- The first takes a UTF_32 code. The form taking the UTF_32 code is -- typically more efficient than calling Get_Category, but if several -- different tests are to be performed on the same code, it is more -- efficient to use Get_Category to get the category, then test the -- resulting category. function Is_UTF_32_Letter (U : UTF_32) return Boolean; function Is_UTF_32_Letter (C : Category) return Boolean; pragma Inline (Is_UTF_32_Letter); -- Returns true iff U is a letter that can be used to start an identifier, -- or if C is one of the corresponding categories, which are the following: -- Letter, Uppercase (Lu) -- Letter, Lowercase (Ll) -- Letter, Titlecase (Lt) -- Letter, Modifier (Lm) -- Letter, Other (Lo) -- Number, Letter (Nl) function Is_UTF_32_Digit (U : UTF_32) return Boolean; function Is_UTF_32_Digit (C : Category) return Boolean; pragma Inline (Is_UTF_32_Digit); -- Returns true iff U is a digit that can be used to extend an identifier, -- or if C is one of the corresponding categories, which are the following: -- Number, Decimal_Digit (Nd) function Is_UTF_32_Line_Terminator (U : UTF_32) return Boolean; pragma Inline (Is_UTF_32_Line_Terminator); -- Returns true iff U is an allowed line terminator for source programs, -- if U is in the category Zp (Separator, Paragraph), or Zl (Separator, -- Line), or if U is a conventional line terminator (CR, LF, VT, FF). -- There is no category version for this function, since the set of -- characters does not correspond to a set of Unicode categories. function Is_UTF_32_Mark (U : UTF_32) return Boolean; function Is_UTF_32_Mark (C : Category) return Boolean; pragma Inline (Is_UTF_32_Mark); -- Returns true iff U is a mark character which can be used to extend an -- identifier, or if C is one of the corresponding categories, which are -- the following: -- Mark, Non-Spacing (Mn) -- Mark, Spacing Combining (Mc) function Is_UTF_32_Other (U : UTF_32) return Boolean; function Is_UTF_32_Other (C : Category) return Boolean; pragma Inline (Is_UTF_32_Other); -- Returns true iff U is an other format character, which means that it -- can be used to extend an identifier, but is ignored for the purposes of -- matching of identifiers, or if C is one of the corresponding categories, -- which are the following: -- Other, Format (Cf) function Is_UTF_32_Punctuation (U : UTF_32) return Boolean; function Is_UTF_32_Punctuation (C : Category) return Boolean; pragma Inline (Is_UTF_32_Punctuation); -- Returns true iff U is a punctuation character that can be used to -- separate pieces of an identifier, or if C is one of the corresponding -- categories, which are the following: -- Punctuation, Connector (Pc) function Is_UTF_32_Space (U : UTF_32) return Boolean; function Is_UTF_32_Space (C : Category) return Boolean; pragma Inline (Is_UTF_32_Space); -- Returns true iff U is considered a space to be ignored, or if C is one -- of the corresponding categories, which are the following: -- Separator, Space (Zs) function Is_UTF_32_Non_Graphic (U : UTF_32) return Boolean; function Is_UTF_32_Non_Graphic (C : Category) return Boolean; pragma Inline (Is_UTF_32_Non_Graphic); -- Returns true iff U is considered to be a non-graphic character, or if C -- is one of the corresponding categories, which are the following: -- Other, Control (Cc) -- Other, Private Use (Co) -- Other, Surrogate (Cs) -- Separator, Line (Zl) -- Separator, Paragraph (Zp) -- FFFE or FFFF positions in any plane (Fe) -- -- Note that the Ada category format effector is subsumed by the above -- list of Unicode categories. -- -- Note that Other, Unassigned (Cn) is quite deliberately not included -- in the list of categories above. This means that should any of these -- code positions be defined in future with graphic characters they will -- be allowed without a need to change implementations or the standard. -- -- Note that Other, Format (Cf) is also quite deliberately not included -- in the list of categories above. This means that these characters can -- be included in character and string literals. -- The following function is used to fold to upper case, as required by -- the Ada 2005 standard rules for identifier case folding. Two -- identifiers are equivalent if they are identical after folding all -- letters to upper case using this routine. A corresponding routine to -- fold to lower case is also provided. function UTF_32_To_Lower_Case (U : UTF_32) return UTF_32; pragma Inline (UTF_32_To_Lower_Case); -- If U represents an upper case letter, returns the corresponding lower -- case letter, otherwise U is returned unchanged. The folding rule is -- simply that if the code corresponds to a 10646 entry whose name contains -- the string CAPITAL LETTER, and there is a corresponding entry whose name -- is the same but with CAPITAL LETTER replaced by SMALL LETTER, then the -- code is folded to this SMALL LETTER code. Otherwise the input code is -- returned unchanged. function UTF_32_To_Upper_Case (U : UTF_32) return UTF_32; pragma Inline (UTF_32_To_Upper_Case); -- If U represents a lower case letter, returns the corresponding lower -- case letter, otherwise U is returned unchanged. The folding rule is -- simply that if the code corresponds to a 10646 entry whose name contains -- the string SMALL LETTER, and there is a corresponding entry whose name -- is the same but with SMALL LETTER replaced by CAPITAL LETTER, then the -- code is folded to this CAPITAL LETTER code. Otherwise the input code is -- returned unchanged. end System.UTF_32;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . W C H _ C N V -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains generic subprograms used for converting between -- sequences of Character and Wide_Character. Wide_Wide_Character values -- are also handled, but represented using integer range types defined in -- this package, so that this package can be used from applications that -- are restricted to Ada 95 compatibility (such as the compiler itself). -- All the algorithms for encoding and decoding are isolated in this package -- and in System.WCh_JIS and should not be duplicated elsewhere. The only -- exception to this is that GNAT.Decode_String and GNAT.Encode_String have -- their own circuits for UTF-8 conversions, for improved efficiency. -- This unit may be used directly from an application program by providing -- an appropriate WITH, and the interface can be expected to remain stable. pragma Compiler_Unit; with System.WCh_Con; package System.WCh_Cnv is pragma Pure; type UTF_32_Code is range 0 .. 16#7FFF_FFFF#; for UTF_32_Code'Size use 32; -- Range of allowed UTF-32 encoding values type UTF_32_String is array (Positive range <>) of UTF_32_Code; generic with function In_Char return Character; function Char_Sequence_To_Wide_Char (C : Character; EM : System.WCh_Con.WC_Encoding_Method) return Wide_Character; -- C is the first character of a sequence of one or more characters which -- represent a wide character sequence. Calling the function In_Char for -- additional characters as required, Char_To_Wide_Char returns the -- corresponding wide character value. Constraint_Error is raised if the -- sequence of characters encountered is not a valid wide character -- sequence for the given encoding method. -- -- Note on the use of brackets encoding (WCEM_Brackets). The brackets -- encoding method is ambiguous in the context of this function, since -- there is no way to tell if ["1234"] is eight unencoded characters or -- one encoded character. In the context of Ada sources, any sequence -- starting [" must be the start of an encoding (since that sequence is -- not valid in Ada source otherwise). The routines in this package use -- the same approach. If the input string contains the sequence [" then -- this is assumed to be the start of a brackets encoding sequence, and -- if it does not match the syntax, an error is raised. generic with function In_Char return Character; function Char_Sequence_To_UTF_32 (C : Character; EM : System.WCh_Con.WC_Encoding_Method) return UTF_32_Code; -- This is similar to the above, but the function returns a code from -- the full UTF_32 code set, which covers the full range of possible -- values in Wide_Wide_Character. The result can be converted to -- Wide_Wide_Character form using Wide_Wide_Character'Val. generic with procedure Out_Char (C : Character); procedure Wide_Char_To_Char_Sequence (WC : Wide_Character; EM : System.WCh_Con.WC_Encoding_Method); -- Given a wide character, converts it into a sequence of one or -- more characters, calling the given Out_Char procedure for each. -- Constraint_Error is raised if the given wide character value is -- not a valid value for the given encoding method. -- -- Note on brackets encoding (WCEM_Brackets). For the input routines above, -- upper half characters can be represented as ["hh"] but this procedure -- will only use brackets encodings for codes higher than 16#FF#, so upper -- half characters will be output as single Character values. generic with procedure Out_Char (C : Character); procedure UTF_32_To_Char_Sequence (Val : UTF_32_Code; EM : System.WCh_Con.WC_Encoding_Method); -- This is similar to the above, but the input value is a code from the -- full UTF_32 code set, which covers the full range of possible values -- in Wide_Wide_Character. To convert a Wide_Wide_Character value, the -- caller can use Wide_Wide_Character'Pos in the call. end System.WCh_Cnv;
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Unchecked_Conversion; with GL.API; with GL.Enums.Getter; package body GL.Objects.Renderbuffers is function Hash (Key : Low_Level.Enums.Renderbuffer_Kind) return Ada.Containers.Hash_Type is function Value is new Ada.Unchecked_Conversion (Source => Low_Level.Enums.Renderbuffer_Kind, Target => Low_Level.Enum); begin return Ada.Containers.Hash_Type (Value (Key)); end Hash; package Renderbuffer_Maps is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => Low_Level.Enums.Renderbuffer_Kind, Element_Type => Renderbuffer'Class, Hash => Hash, Equivalent_Keys => Low_Level.Enums."="); use type Renderbuffer_Maps.Cursor; Current_Renderbuffers : Renderbuffer_Maps.Map; procedure Allocate (Object : Renderbuffer_Target; Format : Pixels.Internal_Format; Width, Height : Size; Samples : Size := 0) is begin if Samples = 0 then API.Renderbuffer_Storage (Object.Kind, Format, Width, Height); Raise_Exception_On_OpenGL_Error; else API.Renderbuffer_Storage_Multisample (Object.Kind, Samples, Format, Width, Height); end if; end Allocate; function Width (Object : Renderbuffer_Target) return Size is Value : Int := 0; begin API.Get_Renderbuffer_Parameter_Int (Object.Kind, Enums.Getter.Width, Value); return Value; end Width; function Height (Object : Renderbuffer_Target) return Size is Value : Int := 0; begin API.Get_Renderbuffer_Parameter_Int (Object.Kind, Enums.Getter.Height, Value); return Value; end Height; function Internal_Format (Object : Renderbuffer_Target) return Pixels.Internal_Format is Value : Pixels.Internal_Format := Pixels.Internal_Format'First; begin API.Get_Renderbuffer_Parameter_Internal_Format (Object.Kind, Enums.Getter.Internal_Format, Value); return Value; end Internal_Format; function Red_Size (Object : Renderbuffer_Target) return Size is Value : Int := 0; begin API.Get_Renderbuffer_Parameter_Int (Object.Kind, Enums.Getter.Green_Size, Value); return Value; end Red_Size; function Green_Size (Object : Renderbuffer_Target) return Size is Value : Int := 0; begin API.Get_Renderbuffer_Parameter_Int (Object.Kind, Enums.Getter.Green_Size, Value); return Value; end Green_Size; function Blue_Size (Object : Renderbuffer_Target) return Size is Value : Int := 0; begin API.Get_Renderbuffer_Parameter_Int (Object.Kind, Enums.Getter.Blue_Size, Value); return Value; end Blue_Size; function Alpha_Size (Object : Renderbuffer_Target) return Size is Value : Int := 0; begin API.Get_Renderbuffer_Parameter_Int (Object.Kind, Enums.Getter.Alpha_Size, Value); return Value; end Alpha_Size; function Depth_Size (Object : Renderbuffer_Target) return Size is Value : Int := 0; begin API.Get_Renderbuffer_Parameter_Int (Object.Kind, Enums.Getter.Depth_Size, Value); return Value; end Depth_Size; function Stencil_Size (Object : Renderbuffer_Target) return Size is Value : Int := 0; begin API.Get_Renderbuffer_Parameter_Int (Object.Kind, Enums.Getter.Stencil_Size, Value); return Value; end Stencil_Size; function Raw_Kind (Object : Renderbuffer_Target) return Low_Level.Enums.Renderbuffer_Kind is begin return Object.Kind; end Raw_Kind; procedure Bind (Target : Renderbuffer_Target; Object : Renderbuffer'Class) is Cursor : constant Renderbuffer_Maps.Cursor := Current_Renderbuffers.Find (Target.Kind); begin if Cursor = Renderbuffer_Maps.No_Element or else Renderbuffer_Maps.Element (Cursor).Reference.GL_Id /= Object.Reference.GL_Id then API.Bind_Renderbuffer (Target.Kind, Object.Reference.GL_Id); Raise_Exception_On_OpenGL_Error; if Cursor = Renderbuffer_Maps.No_Element then Current_Renderbuffers.Insert (Target.Kind, Object); else Current_Renderbuffers.Replace_Element (Cursor, Object); end if; end if; end Bind; function Current (Target : Renderbuffer_Target) return Renderbuffer'Class is Cursor : constant Renderbuffer_Maps.Cursor := Current_Renderbuffers.Find (Target.Kind); begin if Cursor = Renderbuffer_Maps.No_Element then raise No_Object_Bound_Exception with Target.Kind'Img; else return Renderbuffer_Maps.Element (Cursor); end if; end Current; overriding procedure Internal_Create_Id (Object : Renderbuffer; Id : out UInt) is pragma Unreferenced (Object); begin API.Gen_Renderbuffers (1, Id); Raise_Exception_On_OpenGL_Error; end Internal_Create_Id; overriding procedure Internal_Release_Id (Object : Renderbuffer; Id : UInt) is pragma Unreferenced (Object); begin API.Delete_Renderbuffers (1, (1 => Id)); Raise_Exception_On_OpenGL_Error; end Internal_Release_Id; end GL.Objects.Renderbuffers;
-- Copyright 2012-2017 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Classes is procedure Draw (R : Circle) is begin null; end Draw; end Classes;
package body Adda.Generator is use Successors; overriding procedure Initialize (Object : in out Decision_Diagram) is begin if Object.Data /= null then Object.Data.Reference_Counter.all := Object.Data.Reference_Counter.all + 1; end if; end Initialize; overriding procedure Adjust (Object : in out Decision_Diagram) renames Initialize; overriding procedure Finalize (Object : in out Decision_Diagram) is begin if Object.Data /= null then Object.Data.Reference_Counter.all := Object.Data.Reference_Counter.all - 1; if Object.Data.Reference_Counter.all = 0 then null; -- FIXME end if; end if; end Finalize; function Hash (Element : in Decision_Diagram) return Hash_Type is begin return Hash_Type (Element.Data.Identifier); end Hash; function "=" (Left, Right : in Decision_Diagram) return Boolean is begin return Left.Data = Right.Data; -- TODO: check that it is a pointer comparison end "="; function Hash (Element : in Structure) return Hash_Type is begin case Element.Of_Type is when Terminal => return Hash_Terminal (Element.Value); when Non_Terminal => declare Result : Hash_Type := Hash_Variable (Element.Variable); Current : Successors.Cursor := Successors.First (Element.Alpha); begin while Successors.Has_Element (Current) loop Result := Result xor (Hash_Value (Successors.Key (Current)) xor Hash (Successors.Element (Current))); Successors.Next (Current); end loop; return Result; end; end case; end Hash; overriding function "=" (Left, Right : in Structure) return Boolean is begin if Left.Of_Type = Right.Of_Type then case Left.Of_Type is when Terminal => return Left.Value = Right.Value; when Non_Terminal => return Left.Variable = Right.Variable and then Left.Alpha = Right.Alpha; end case; else return False; end if; end "="; function Make (Value : in Terminal_Type) return Decision_Diagram is To_Insert : constant Structure := (Of_Type => Terminal, Identifier => 0, Reference_Counter => null, Value => Value); Position : Unicity.Cursor; Inserted : Boolean; begin Unicity_Table.Insert (New_Item => To_Insert, Position => Position, Inserted => Inserted); declare Subdata : aliased Structure := Unicity.Element (Position); Data : constant Any_Structure := Subdata'Unchecked_Access; begin if Inserted then Identifier := Identifier + 1; Subdata.Identifier := Identifier + 1; Subdata.Reference_Counter := new Natural'(0); end if; return (Controlled with Data => Data); end; end Make; function Make (Variable : in Variable_Type; Value : in Value_Type; Successor : in Decision_Diagram) return Decision_Diagram is Result : Decision_Diagram; begin return Result; end Make; begin null; end Adda.Generator;
-- Copyright 2008, 2009, 2010, 2011 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;
-- C94001C.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT A UNIT WITH INDIRECT DEPENDENT TASKS CREATED BY OBJECT -- DECLARATIONS IS NOT TERMINATED UNTIL ALL INDIRECT DEPENDENT TASKS -- BECOME TERMINATED. -- SUBTESTS ARE: -- (A, B) A BLOCK CONTAINING A SIMPLE TASK OBJECT, IN A BLOCK. -- (C, D) A FUNCTION CONTAINING AN ARRAY OF TASK OBJECT, IN A -- FUNCTION. -- (E, F) A TASK CONTAINING AN ARRAY OF RECORD OF TASK OBJECT, -- IN A TASK BODY. -- CASES (B, D, F) EXIT BY RAISING AN EXCEPTION. -- THIS TEST CONTAINS SHARED VARIABLES AND RACE CONDITIONS. -- TBN 8/25/86 -- PWN 01/31/95 REMOVED PRAGMA PRIORITY FOR ADA 9X. with Impdef; WITH REPORT; USE REPORT; WITH SYSTEM; USE SYSTEM; PROCEDURE C94001C IS MY_EXCEPTION : EXCEPTION; GLOBAL : INTEGER; TASK TYPE TT IS ENTRY E (I : INTEGER); END TT; TASK BODY TT IS LOCAL : INTEGER; BEGIN ACCEPT E (I : INTEGER) DO LOCAL := I; END E; DELAY 30.0 * Impdef.One_Second; -- SINCE THE PARENT UNIT HAS HIGHER PRIORITY -- AT THIS POINT, IT WILL RECEIVE CONTROL AND -- TERMINATE IF THE ERROR IS PRESENT. GLOBAL := LOCAL; END TT; BEGIN TEST ("C94001C", "CHECK THAT A UNIT WITH INDIRECT DEPENDENT " & "TASKS CREATED BY OBJECT DECLARATIONS IS NOT " & "TERMINATED UNTIL ALL INDIRECT DEPENDENT TASKS " & "BECOME TERMINATED"); -------------------------------------------------- GLOBAL := IDENT_INT (0); BEGIN -- (A) DECLARE T : TT; BEGIN T.E (IDENT_INT(1)); END; END; -- (A) IF GLOBAL /= 1 THEN FAILED ("DEPENDENT TASK NOT TERMINATED BEFORE " & "BLOCK EXIT - 1"); END IF; -------------------------------------------------- BEGIN -- (B) GLOBAL := IDENT_INT (0); BEGIN DECLARE T : TT; BEGIN T.E (IDENT_INT(2)); RAISE MY_EXCEPTION; END; END; FAILED ("MY_EXCEPTION WAS NOT RAISED - 2"); EXCEPTION WHEN MY_EXCEPTION => IF GLOBAL /= 2 THEN FAILED ("DEPENDENT TASK NOT TERMINATED BEFORE " & "BLOCK EXIT - 2"); END IF; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION - 2"); END; -- (B) -------------------------------------------------- GLOBAL := IDENT_INT (0); DECLARE -- (C) OBJ_INT : INTEGER; FUNCTION F1 RETURN INTEGER IS I : INTEGER; FUNCTION F2 RETURN INTEGER IS A : ARRAY (1..1) OF TT; BEGIN A(1).E (IDENT_INT(3)); RETURN 0; END F2; BEGIN I := F2; RETURN (0); END F1; BEGIN -- (C) OBJ_INT := F1; IF GLOBAL /= 3 THEN FAILED ("DEPENDENT TASK NOT TERMINATED BEFORE " & "FUNCTION EXIT - 3"); END IF; END; -- (C) -------------------------------------------------- DECLARE -- (D) OBJ_INT : INTEGER; FUNCTION F1 RETURN INTEGER IS I : INTEGER; FUNCTION F2 RETURN INTEGER IS A : ARRAY (1..1) OF TT; BEGIN A(1).E (IDENT_INT(4)); IF EQUAL (3, 3) THEN RAISE MY_EXCEPTION; END IF; RETURN 0; END F2; BEGIN I := F2; RETURN (0); END F1; BEGIN -- (D) GLOBAL := IDENT_INT (0); OBJ_INT := F1; FAILED ("MY_EXCEPTION WAS NOT RAISED - 4"); EXCEPTION WHEN MY_EXCEPTION => IF GLOBAL /= 4 THEN FAILED ("DEPENDENT TASK NOT TERMINATED BEFORE " & "FUNCTION EXIT - 4"); END IF; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION - 4"); END; -- (D) -------------------------------------------------- GLOBAL := IDENT_INT (0); DECLARE -- (E) DELAY_COUNT : INTEGER := 0; TASK OUT_TSK; TASK BODY OUT_TSK IS TASK TSK IS ENTRY ENT; END TSK; TASK BODY TSK IS TYPE RT IS RECORD T : TT; END RECORD; AR : ARRAY (1..1) OF RT; BEGIN AR(1).T.E (IDENT_INT(5)); END TSK; BEGIN NULL; END OUT_TSK; BEGIN -- (E) WHILE NOT(OUT_TSK'TERMINATED) AND DELAY_COUNT < 60 LOOP DELAY 1.0 * Impdef.One_Long_Second; DELAY_COUNT := DELAY_COUNT + 1; END LOOP; IF DELAY_COUNT = 60 THEN FAILED ("OUT_TSK HAS NOT TERMINATED - 5"); ELSIF GLOBAL /= 5 THEN FAILED ("DEPENDENT TASK NOT TERMINATED BEFORE " & "BLOCK EXIT - 5"); END IF; END; -- (E) -------------------------------------------------- GLOBAL := IDENT_INT (0); DECLARE DELAY_COUNT : INTEGER := 0; TASK OUT_TSK; TASK BODY OUT_TSK IS TASK TSK IS ENTRY ENT; END TSK; TASK BODY TSK IS TYPE RT IS RECORD T : TT; END RECORD; AR : ARRAY (1..1) OF RT; BEGIN AR(1).T.E (IDENT_INT(6)); RAISE MY_EXCEPTION; END TSK; BEGIN RAISE MY_EXCEPTION; END OUT_TSK; BEGIN WHILE NOT(OUT_TSK'TERMINATED) AND DELAY_COUNT < 60 LOOP DELAY 1.0 * Impdef.One_Long_Second; DELAY_COUNT := DELAY_COUNT + 1; END LOOP; IF DELAY_COUNT = 60 THEN FAILED ("OUT_TSK HAS NOT TERMINATED - 6"); ELSIF GLOBAL /= 6 THEN FAILED ("DEPENDENT TASK NOT TERMINATED BEFORE " & "BLOCK EXIT - 6"); END IF; END; RESULT; END C94001C;
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="15"> <syndb class_id="0" tracking_level="0" version="0"> <userIPLatency>-1</userIPLatency> <userIPName/> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>colorthresholding_9_0_3_2160_3840_1_s</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>rgb2hsv_4100</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName>FIFO_SRL</coreName> <coreId>3580080480</coreId> </Obj> <bitwidth>24</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>imgHelper1_4101</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName>FIFO_SRL</coreName> <coreId>1769566319</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <direction>1</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_3"> <Value> <Obj> <type>1</type> <id>3</id> <name>low_thresh</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName>RAM_1P</coreName> <coreId>892418672</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>9</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_4"> <Value> <Obj> <type>1</type> <id>4</id> <name>high_thresh</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName>RAM_1P</coreName> <coreId>1702127986</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>9</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_5"> <Value> <Obj> <type>1</type> <id>5</id> <name>p_src_mat_rows</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName>FIFO_SRL</coreName> <coreId>1295661686</coreId> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_6"> <Value> <Obj> <type>1</type> <id>6</id> <name>p_src_mat_cols</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName>FIFO_SRL</coreName> <coreId>741422136</coreId> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>27</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_7"> <Value> <Obj> <type>0</type> <id>9</id> <name>p_src_mat_cols_c_i</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>p_src_mat_cols_c_i_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>53</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>10</id> <name>p_src_mat_rows_c_i</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>p_src_mat_rows_c_i_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>54</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>2</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>26</id> <name>_ln0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>colorthresholding_9_0_3_2160_3840_1_entry29_U0</rtlName> <control/> <opType/> <implIndex/> <coreName/> <coreId>1013801317</coreId> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>5</count> <item_version>0</item_version> <item>56</item> <item>57</item> <item>58</item> <item>59</item> <item>60</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>27</id> <name>call_ret</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0</rtlName> <control/> <opType/> <implIndex/> <coreName/> <coreId>1868705636</coreId> </Obj> <bitwidth>144</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>62</item> <item>63</item> <item>64</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>28</id> <name>low_th_0_0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[0][0]</originalName> <rtlName>low_th_0_0_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>65</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>29</id> <name>low_th_0_1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[0][1]</originalName> <rtlName>low_th_0_1_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>66</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>30</id> <name>low_th_0_2</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[0][2]</originalName> <rtlName>low_th_0_2_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>67</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>31</id> <name>high_th_0_0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[0][0]</originalName> <rtlName>high_th_0_0_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>68</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>32</id> <name>high_th_0_1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[0][1]</originalName> <rtlName>high_th_0_1_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>69</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>33</id> <name>high_th_0_2</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[0][2]</originalName> <rtlName>high_th_0_2_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>70</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>10</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>34</id> <name>low_th_1_0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[1][0]</originalName> <rtlName>low_th_1_0_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>71</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>11</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>35</id> <name>low_th_1_1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[1][1]</originalName> <rtlName>low_th_1_1_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>72</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>12</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>36</id> <name>low_th_1_2</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[1][2]</originalName> <rtlName>low_th_1_2_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>73</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>13</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>37</id> <name>high_th_1_0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[1][0]</originalName> <rtlName>high_th_1_0_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>74</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>14</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>38</id> <name>high_th_1_1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[1][1]</originalName> <rtlName>high_th_1_1_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>75</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>15</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>39</id> <name>high_th_1_2</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[1][2]</originalName> <rtlName>high_th_1_2_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>76</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>16</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>40</id> <name>low_th_2_0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[2][0]</originalName> <rtlName>low_th_2_0_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>77</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>17</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>41</id> <name>low_th_2_1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[2][1]</originalName> <rtlName>low_th_2_1_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>78</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>18</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>42</id> <name>low_th_2_2</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>low_th[2][2]</originalName> <rtlName>low_th_2_2_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>79</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>19</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>43</id> <name>high_th_2_0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[2][0]</originalName> <rtlName>high_th_2_0_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>80</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>20</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>44</id> <name>high_th_2_1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[2][1]</originalName> <rtlName>high_th_2_1_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>81</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>21</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>45</id> <name>high_th_2_2</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>high_th[2][2]</originalName> <rtlName>high_th_2_2_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>82</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>22</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>46</id> <name>call_ret1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc_U0</rtlName> <control/> <opType/> <implIndex/> <coreName/> <coreId>645164649</coreId> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>5</count> <item_version>0</item_version> <item>84</item> <item>85</item> <item>86</item> <item>374</item> <item>375</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>23</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>47</id> <name>img_height_loc_i_channel</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>img_height_loc_i_channel_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>87</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>24</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>48</id> <name>img_width_loc_i_channel</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>img_width_loc_i_channel_U</rtlName> <control>auto</control> <opType>fifo</opType> <implIndex>srl</implIndex> <coreName>FIFO_SRL</coreName> <coreId>81</coreId> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>88</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>25</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>49</id> <name>_ln155</name> <fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_colorthresholding.hpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>155</lineNumber> <contextFuncName>colorthresholding&amp;lt;9, 0, 3, 2160, 3840, 1&amp;gt;</contextFuncName> <contextNormFuncName>colorthresholding_9_0_3_2160_3840_1_s</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first> <second class_id="12" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="13" tracking_level="0" version="0"> <first class_id="14" tracking_level="0" version="0"> <first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/imgproc/xf_colorthresholding.hpp</first> <second>colorthresholding&amp;lt;9, 0, 3, 2160, 3840, 1&amp;gt;</second> </first> <second>155</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>xFInRange_9_0_2160_3840_15_0_1_9_1_3_U0</rtlName> <control/> <opType/> <implIndex/> <coreName/> <coreId>1936683105</coreId> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>23</count> <item_version>0</item_version> <item>90</item> <item>91</item> <item>92</item> <item>93</item> <item>94</item> <item>95</item> <item>96</item> <item>97</item> <item>98</item> <item>99</item> <item>100</item> <item>101</item> <item>102</item> <item>103</item> <item>104</item> <item>105</item> <item>106</item> <item>107</item> <item>108</item> <item>109</item> <item>110</item> <item>111</item> <item>112</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.82</m_delay> <m_topoIndex>26</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>50</id> <name>_ln0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName/> <coreId>2037148777</coreId> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>27</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_34"> <Value> <Obj> <type>2</type> <id>52</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName/> <coreId>574452846</coreId> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_35"> <Value> <Obj> <type>2</type> <id>55</id> <name>colorthresholding_9_0_3_2160_3840_1_entry29</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName/> <coreId>976974951</coreId> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:colorthresholding&lt;9, 0, 3, 2160, 3840, 1&gt;.entry29&gt;</content> </item> <item class_id_reference="16" object_id="_36"> <Value> <Obj> <type>2</type> <id>61</id> <name>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName/> <coreId>1852270963</coreId> </Obj> <bitwidth>144</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:colorthresholding&lt;9, 0, 3, 2160, 3840, 1&gt;_Loop_VITIS_LOOP_138_1_proc&gt;</content> </item> <item class_id_reference="16" object_id="_37"> <Value> <Obj> <type>2</type> <id>83</id> <name>colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName/> <coreId>673215073</coreId> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:colorthresholding&lt;9, 0, 3, 2160, 3840, 1&gt;_Block_colorthresholding&lt;9, 0, 3, 2160, 3840, 1&gt;_.exit_proc&gt;</content> </item> <item class_id_reference="16" object_id="_38"> <Value> <Obj> <type>2</type> <id>89</id> <name>xFInRange_9_0_2160_3840_15_0_1_9_1_3_s</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName/> <coreId>539119430</coreId> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:xFInRange&lt;9, 0, 2160, 3840, 15, 0, 1, 9, 1, 3&gt;&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_39"> <Obj> <type>3</type> <id>51</id> <name>colorthresholding&lt;9, 0, 3, 2160, 3840, 1&gt;</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <contextNormFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <control/> <opType/> <implIndex/> <coreName/> <coreId>1768189039</coreId> </Obj> <node_objs> <count>27</count> <item_version>0</item_version> <item>9</item> <item>10</item> <item>26</item> <item>27</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>34</item> <item>35</item> <item>36</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> <item>42</item> <item>43</item> <item>44</item> <item>45</item> <item>46</item> <item>47</item> <item>48</item> <item>49</item> <item>50</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>58</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_40"> <id>53</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_41"> <id>54</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_42"> <id>56</id> <edge_type>1</edge_type> <source_obj>55</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_43"> <id>57</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_44"> <id>58</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_45"> <id>59</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_46"> <id>60</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_47"> <id>62</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_48"> <id>63</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_49"> <id>64</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_50"> <id>65</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>28</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_51"> <id>66</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>29</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_52"> <id>67</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>30</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_53"> <id>68</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_54"> <id>69</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>32</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_55"> <id>70</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>33</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_56"> <id>71</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>34</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_57"> <id>72</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>35</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_58"> <id>73</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>36</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_59"> <id>74</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_60"> <id>75</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>38</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_61"> <id>76</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>39</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_62"> <id>77</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_63"> <id>78</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>41</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_64"> <id>79</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>42</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_65"> <id>80</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>43</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_66"> <id>81</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>44</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_67"> <id>82</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>45</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_68"> <id>84</id> <edge_type>1</edge_type> <source_obj>83</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_69"> <id>85</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_70"> <id>86</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_71"> <id>87</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>47</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_72"> <id>88</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_73"> <id>90</id> <edge_type>1</edge_type> <source_obj>89</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_74"> <id>91</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_75"> <id>92</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_76"> <id>93</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_77"> <id>94</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_78"> <id>95</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_79"> <id>96</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_80"> <id>97</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_81"> <id>98</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_82"> <id>99</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_83"> <id>100</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_84"> <id>101</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_85"> <id>102</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_86"> <id>103</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_87"> <id>104</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_88"> <id>105</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_89"> <id>106</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_90"> <id>107</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_91"> <id>108</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_92"> <id>109</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_93"> <id>110</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_94"> <id>111</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_95"> <id>112</id> <edge_type>1</edge_type> <source_obj>48</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_96"> <id>374</id> <edge_type>4</edge_type> <source_obj>26</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_97"> <id>375</id> <edge_type>4</edge_type> <source_obj>26</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_98"> <mId>1</mId> <mTag>colorthresholding&lt;9, 0, 3, 2160, 3840, 1&gt;</mTag> <mNormTag>colorthresholding_9_0_3_2160_3840_1_s</mNormTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>51</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>17</mMinLatency> <mMaxLatency>8294418</mMaxLatency> <mIsDfPipe>1</mIsDfPipe> <mDfPipe class_id="23" tracking_level="1" version="0" object_id="_99"> <port_list class_id="24" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="25" tracking_level="1" version="0" object_id="_100"> <name>rgb2hsv_4100</name> <dir>0</dir> <type>0</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </item> <item class_id_reference="25" object_id="_101"> <name>imgHelper1_4101</name> <dir>1</dir> <type>0</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </item> <item class_id_reference="25" object_id="_102"> <name>low_thresh</name> <dir>0</dir> <type>2</type> <need_hs>1</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </item> <item class_id_reference="25" object_id="_103"> <name>high_thresh</name> <dir>0</dir> <type>2</type> <need_hs>1</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </item> <item class_id_reference="25" object_id="_104"> <name>p_src_mat_rows</name> <dir>0</dir> <type>0</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </item> <item class_id_reference="25" object_id="_105"> <name>p_src_mat_cols</name> <dir>0</dir> <type>0</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </item> </port_list> <process_list class_id="27" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_106"> <type>0</type> <name>colorthresholding_9_0_3_2160_3840_1_entry29_U0</name> <ssdmobj_id>26</ssdmobj_id> <pins class_id="29" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_107"> <port class_id_reference="25" object_id="_108"> <name>p_src_mat_rows</name> <dir>0</dir> <type>0</type> <need_hs>0</need_hs> <top_port class_id_reference="25" object_id_reference="_104"/> <chan class_id="-1"/> </port> <inst class_id="31" tracking_level="1" version="0" object_id="_109"> <type>0</type> <name>colorthresholding_9_0_3_2160_3840_1_entry29_U0</name> <ssdmobj_id>26</ssdmobj_id> </inst> </item> <item class_id_reference="30" object_id="_110"> <port class_id_reference="25" object_id="_111"> <name>p_src_mat_cols</name> <dir>0</dir> <type>0</type> <need_hs>0</need_hs> <top_port class_id_reference="25" object_id_reference="_105"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_109"/> </item> </pins> <in_source_fork>1</in_source_fork> <in_sink_join>0</in_sink_join> <flag_in_gui>0</flag_in_gui> </item> <item class_id_reference="28" object_id="_112"> <type>0</type> <name>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0</name> <ssdmobj_id>27</ssdmobj_id> <pins> <count>2</count> <item_version>0</item_version> <item class_id_reference="30" object_id="_113"> <port class_id_reference="25" object_id="_114"> <name>low_thresh</name> <dir>0</dir> <type>2</type> <need_hs>1</need_hs> <top_port class_id_reference="25" object_id_reference="_102"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id="_115"> <type>0</type> <name>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0</name> <ssdmobj_id>27</ssdmobj_id> </inst> </item> <item class_id_reference="30" object_id="_116"> <port class_id_reference="25" object_id="_117"> <name>high_thresh</name> <dir>0</dir> <type>2</type> <need_hs>1</need_hs> <top_port class_id_reference="25" object_id_reference="_103"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </item> </pins> <in_source_fork>1</in_source_fork> <in_sink_join>0</in_sink_join> <flag_in_gui>0</flag_in_gui> </item> <item class_id_reference="28" object_id="_118"> <type>0</type> <name>colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc_U0</name> <ssdmobj_id>46</ssdmobj_id> <pins> <count>0</count> <item_version>0</item_version> </pins> <in_source_fork>0</in_source_fork> <in_sink_join>0</in_sink_join> <flag_in_gui>0</flag_in_gui> </item> <item class_id_reference="28" object_id="_119"> <type>0</type> <name>xFInRange_9_0_2160_3840_15_0_1_9_1_3_U0</name> <ssdmobj_id>49</ssdmobj_id> <pins> <count>2</count> <item_version>0</item_version> <item class_id_reference="30" object_id="_120"> <port class_id_reference="25" object_id="_121"> <name>rgb2hsv_4100</name> <dir>0</dir> <type>0</type> <need_hs>0</need_hs> <top_port class_id_reference="25" object_id_reference="_100"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id="_122"> <type>0</type> <name>xFInRange_9_0_2160_3840_15_0_1_9_1_3_U0</name> <ssdmobj_id>49</ssdmobj_id> </inst> </item> <item class_id_reference="30" object_id="_123"> <port class_id_reference="25" object_id="_124"> <name>imgHelper1_4101</name> <dir>1</dir> <type>0</type> <need_hs>0</need_hs> <top_port class_id_reference="25" object_id_reference="_101"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </item> </pins> <in_source_fork>0</in_source_fork> <in_sink_join>1</in_sink_join> <flag_in_gui>1</flag_in_gui> </item> </process_list> <channel_list class_id="32" tracking_level="0" version="0"> <count>22</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_125"> <type>1</type> <name>p_src_mat_rows_c_i</name> <ssdmobj_id>10</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>16</bitwidth> <suggested_type>2</suggested_type> <suggested_depth>2</suggested_depth> <source class_id_reference="30" object_id="_126"> <port class_id_reference="25" object_id="_127"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_109"/> </source> <sink class_id_reference="30" object_id="_128"> <port class_id_reference="25" object_id="_129"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id="_130"> <type>0</type> <name>colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc_U0</name> <ssdmobj_id>46</ssdmobj_id> </inst> </sink> </item> <item class_id_reference="26" object_id="_131"> <type>1</type> <name>p_src_mat_cols_c_i</name> <ssdmobj_id>9</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>16</bitwidth> <suggested_type>2</suggested_type> <suggested_depth>2</suggested_depth> <source class_id_reference="30" object_id="_132"> <port class_id_reference="25" object_id="_133"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_109"/> </source> <sink class_id_reference="30" object_id="_134"> <port class_id_reference="25" object_id="_135"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_130"/> </sink> </item> <item class_id_reference="26" object_id="_136"> <type>1</type> <name>low_th_0_0</name> <ssdmobj_id>28</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_137"> <port class_id_reference="25" object_id="_138"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_139"> <port class_id_reference="25" object_id="_140"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_141"> <type>1</type> <name>low_th_0_1</name> <ssdmobj_id>29</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_142"> <port class_id_reference="25" object_id="_143"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_144"> <port class_id_reference="25" object_id="_145"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_146"> <type>1</type> <name>low_th_0_2</name> <ssdmobj_id>30</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_147"> <port class_id_reference="25" object_id="_148"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_149"> <port class_id_reference="25" object_id="_150"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_151"> <type>1</type> <name>high_th_0_0</name> <ssdmobj_id>31</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_152"> <port class_id_reference="25" object_id="_153"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_154"> <port class_id_reference="25" object_id="_155"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_156"> <type>1</type> <name>high_th_0_1</name> <ssdmobj_id>32</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_157"> <port class_id_reference="25" object_id="_158"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_159"> <port class_id_reference="25" object_id="_160"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_161"> <type>1</type> <name>high_th_0_2</name> <ssdmobj_id>33</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_162"> <port class_id_reference="25" object_id="_163"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_164"> <port class_id_reference="25" object_id="_165"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_166"> <type>1</type> <name>low_th_1_0</name> <ssdmobj_id>34</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_167"> <port class_id_reference="25" object_id="_168"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_169"> <port class_id_reference="25" object_id="_170"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_171"> <type>1</type> <name>low_th_1_1</name> <ssdmobj_id>35</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_172"> <port class_id_reference="25" object_id="_173"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_174"> <port class_id_reference="25" object_id="_175"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_176"> <type>1</type> <name>low_th_1_2</name> <ssdmobj_id>36</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_177"> <port class_id_reference="25" object_id="_178"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_179"> <port class_id_reference="25" object_id="_180"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_181"> <type>1</type> <name>high_th_1_0</name> <ssdmobj_id>37</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_182"> <port class_id_reference="25" object_id="_183"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_184"> <port class_id_reference="25" object_id="_185"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_186"> <type>1</type> <name>high_th_1_1</name> <ssdmobj_id>38</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_187"> <port class_id_reference="25" object_id="_188"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_189"> <port class_id_reference="25" object_id="_190"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_191"> <type>1</type> <name>high_th_1_2</name> <ssdmobj_id>39</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_192"> <port class_id_reference="25" object_id="_193"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_194"> <port class_id_reference="25" object_id="_195"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_196"> <type>1</type> <name>low_th_2_0</name> <ssdmobj_id>40</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_197"> <port class_id_reference="25" object_id="_198"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_199"> <port class_id_reference="25" object_id="_200"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_201"> <type>1</type> <name>low_th_2_1</name> <ssdmobj_id>41</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_202"> <port class_id_reference="25" object_id="_203"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_204"> <port class_id_reference="25" object_id="_205"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_206"> <type>1</type> <name>low_th_2_2</name> <ssdmobj_id>42</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_207"> <port class_id_reference="25" object_id="_208"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_209"> <port class_id_reference="25" object_id="_210"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_211"> <type>1</type> <name>high_th_2_0</name> <ssdmobj_id>43</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_212"> <port class_id_reference="25" object_id="_213"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_214"> <port class_id_reference="25" object_id="_215"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_216"> <type>1</type> <name>high_th_2_1</name> <ssdmobj_id>44</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_217"> <port class_id_reference="25" object_id="_218"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_219"> <port class_id_reference="25" object_id="_220"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_221"> <type>1</type> <name>high_th_2_2</name> <ssdmobj_id>45</ssdmobj_id> <ctype>0</ctype> <depth>3</depth> <bitwidth>8</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>3</suggested_depth> <source class_id_reference="30" object_id="_222"> <port class_id_reference="25" object_id="_223"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_115"/> </source> <sink class_id_reference="30" object_id="_224"> <port class_id_reference="25" object_id="_225"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_226"> <type>1</type> <name>img_height_loc_i_channel</name> <ssdmobj_id>47</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>16</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>2</suggested_depth> <source class_id_reference="30" object_id="_227"> <port class_id_reference="25" object_id="_228"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_130"/> </source> <sink class_id_reference="30" object_id="_229"> <port class_id_reference="25" object_id="_230"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> <item class_id_reference="26" object_id="_231"> <type>1</type> <name>img_width_loc_i_channel</name> <ssdmobj_id>48</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>16</bitwidth> <suggested_type>1</suggested_type> <suggested_depth>2</suggested_depth> <source class_id_reference="30" object_id="_232"> <port class_id_reference="25" object_id="_233"> <name>in</name> <dir>0</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_130"/> </source> <sink class_id_reference="30" object_id="_234"> <port class_id_reference="25" object_id="_235"> <name>out</name> <dir>1</dir> <type>3</type> <need_hs>0</need_hs> <top_port class_id="-1"/> <chan class_id="-1"/> </port> <inst class_id_reference="31" object_id_reference="_122"/> </sink> </item> </channel_list> <net_list class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </net_list> </mDfPipe> </item> </cdfg_regions> <fsm class_id="34" tracking_level="1" version="0" object_id="_236"> <states class_id="35" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="36" tracking_level="1" version="0" object_id="_237"> <id>1</id> <operations class_id="37" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="38" tracking_level="1" version="0" object_id="_238"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_239"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_240"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_241"> <id>27</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_242"> <id>2</id> <operations> <count>23</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_243"> <id>27</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="38" object_id="_244"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_245"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_246"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_247"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_248"> <id>32</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_249"> <id>33</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_250"> <id>34</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_251"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_252"> <id>36</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_253"> <id>37</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_254"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_255"> <id>39</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_256"> <id>40</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_257"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_258"> <id>42</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_259"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_260"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_261"> <id>45</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_262"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_263"> <id>47</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_264"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_265"> <id>49</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_266"> <id>3</id> <operations> <count>19</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_267"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_268"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_269"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_270"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_271"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_272"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_273"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_274"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_275"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_276"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_277"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_278"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_279"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_280"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_281"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_282"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_283"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_284"> <id>49</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="38" object_id="_285"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="39" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="40" tracking_level="1" version="0" object_id="_286"> <inState>1</inState> <outState>2</outState> <condition class_id="41" tracking_level="0" version="0"> <id>-1</id> <sop class_id="42" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="43" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_287"> <inState>2</inState> <outState>3</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="44" tracking_level="1" version="0" object_id="_288"> <dp_component_resource class_id="45" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc_U0 (colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc)</first> <second class_id="47" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first>FF</first> <second>34</second> </item> <item> <first>LUT</first> <second>46</second> </item> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0 (colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>168</second> </item> <item> <first>LUT</first> <second>136</second> </item> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_entry29_U0 (colorthresholding_9_0_3_2160_3840_1_entry29)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>3</second> </item> <item> <first>LUT</first> <second>55</second> </item> </second> </item> <item> <first>start_for_colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2dEe_U (start_for_colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2dEe)</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>xFInRange_9_0_2160_3840_15_0_1_9_1_3_U0 (xFInRange_9_0_2160_3840_15_0_1_9_1_3_s)</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>DSP</first> <second>1</second> </item> <item> <first>FF</first> <second>79</second> </item> <item> <first>LUT</first> <second>262</second> </item> </second> </item> </dp_component_resource> <dp_expression_resource> <count>49</count> <item_version>0</item_version> <item> <first>ap_channel_done_high_th_0_0 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_high_th_0_1 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_high_th_0_2 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_high_th_1_0 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_high_th_1_1 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_high_th_1_2 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_high_th_2_0 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_high_th_2_1 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_high_th_2_2 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_img_height_loc_i_channel ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_img_width_loc_i_channel ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_0_0 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_0_1 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_0_2 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_1_0 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_1_1 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_1_2 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_2_0 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_2_1 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_channel_done_low_th_2_2 ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_idle ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_0_0 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_0_1 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_0_2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_1_0 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_1_1 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_1_2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_2_0 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_2_1 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_high_th_2_2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_img_height_loc_i_channel ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_img_width_loc_i_channel ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_0_0 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_0_1 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_0_2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_1_0 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_1_1 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_1_2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_2_0 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_2_1 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_channel_write_low_th_2_2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0_ap_ready ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_colorthresholding_9_0_3_2160_3840_1_entry29_U0_ap_ready ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_ready ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc_U0_ap_continue ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0_ap_continue ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0_ap_start ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_entry29_U0_ap_start ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> <item> <first>xFInRange_9_0_2160_3840_15_0_1_9_1_3_U0_ap_start ( and ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</second> </item> </second> </item> </dp_expression_resource> <dp_fifo_resource> <count>22</count> <item_version>0</item_version> <item> <first>high_th_0_0_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>high_th_0_1_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>high_th_0_2_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>high_th_1_0_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>high_th_1_1_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>high_th_1_2_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>high_th_2_0_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>high_th_2_1_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>high_th_2_2_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>img_height_loc_i_channel_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>16</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>img_width_loc_i_channel_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>16</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_0_0_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_0_1_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_0_2_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_1_0_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_1_1_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_1_2_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_2_0_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_2_1_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>low_th_2_2_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>8</second> </item> <item> <first>(2Size:D*B)</first> <second>24</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>p_src_mat_cols_c_i_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>16</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> <item> <first>p_src_mat_rows_c_i_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>16</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>FF</first> <second>99</second> </item> <item> <first>LUT</first> <second>68</second> </item> </second> </item> </dp_fifo_resource> <dp_memory_resource> <count>0</count> <item_version>0</item_version> </dp_memory_resource> <dp_multiplexer_resource> <count>22</count> <item_version>0</item_version> <item> <first>ap_sync_reg_channel_write_high_th_0_0</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_0_1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_0_2</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_1_0</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_1_1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_1_2</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_2_0</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_2_1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_2_2</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_img_height_loc_i_channel</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_img_width_loc_i_channel</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_0_0</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_0_1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_0_2</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_1_0</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_1_1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_1_2</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_2_0</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_2_1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_2_2</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0_ap_ready</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_sync_reg_colorthresholding_9_0_3_2160_3840_1_entry29_U0_ap_ready</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> </dp_multiplexer_resource> <dp_register_resource> <count>22</count> <item_version>0</item_version> <item> <first>ap_sync_reg_channel_write_high_th_0_0</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_0_1</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_0_2</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_1_0</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_1_1</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_1_2</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_2_0</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_2_1</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_high_th_2_2</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_img_height_loc_i_channel</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_img_width_loc_i_channel</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_0_0</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_0_1</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_0_2</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_1_0</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_1_1</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_1_2</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_2_0</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_2_1</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_channel_write_low_th_2_2</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0_ap_ready</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_sync_reg_colorthresholding_9_0_3_2160_3840_1_entry29_U0_ap_ready</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> </dp_register_resource> <dp_dsp_resource> <count>5</count> <item_version>0</item_version> <item> <first>colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_entry29_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>start_for_colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2dEe_U</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>xFInRange_9_0_2160_3840_15_0_1_9_1_3_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> </dp_dsp_resource> <dp_component_map class_id="49" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="50" tracking_level="0" version="0"> <first>colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc_U0 (colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc)</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_U0 (colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc)</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>colorthresholding_9_0_3_2160_3840_1_entry29_U0 (colorthresholding_9_0_3_2160_3840_1_entry29)</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>xFInRange_9_0_2160_3840_15_0_1_9_1_3_U0 (xFInRange_9_0_2160_3840_15_0_1_9_1_3_s)</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> </dp_component_map> <dp_expression_map> <count>0</count> <item_version>0</item_version> </dp_expression_map> <dp_fifo_map> <count>22</count> <item_version>0</item_version> <item> <first>high_th_0_0_U</first> <second> <count>1</count> <item_version>0</item_version> <item>369</item> </second> </item> <item> <first>high_th_0_1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>379</item> </second> </item> <item> <first>high_th_0_2_U</first> <second> <count>1</count> <item_version>0</item_version> <item>389</item> </second> </item> <item> <first>high_th_1_0_U</first> <second> <count>1</count> <item_version>0</item_version> <item>429</item> </second> </item> <item> <first>high_th_1_1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>439</item> </second> </item> <item> <first>high_th_1_2_U</first> <second> <count>1</count> <item_version>0</item_version> <item>449</item> </second> </item> <item> <first>high_th_2_0_U</first> <second> <count>1</count> <item_version>0</item_version> <item>489</item> </second> </item> <item> <first>high_th_2_1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>499</item> </second> </item> <item> <first>high_th_2_2_U</first> <second> <count>1</count> <item_version>0</item_version> <item>509</item> </second> </item> <item> <first>img_height_loc_i_channel_U</first> <second> <count>1</count> <item_version>0</item_version> <item>519</item> </second> </item> <item> <first>img_width_loc_i_channel_U</first> <second> <count>1</count> <item_version>0</item_version> <item>529</item> </second> </item> <item> <first>low_th_0_0_U</first> <second> <count>1</count> <item_version>0</item_version> <item>340</item> </second> </item> <item> <first>low_th_0_1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>349</item> </second> </item> <item> <first>low_th_0_2_U</first> <second> <count>1</count> <item_version>0</item_version> <item>359</item> </second> </item> <item> <first>low_th_1_0_U</first> <second> <count>1</count> <item_version>0</item_version> <item>399</item> </second> </item> <item> <first>low_th_1_1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>409</item> </second> </item> <item> <first>low_th_1_2_U</first> <second> <count>1</count> <item_version>0</item_version> <item>419</item> </second> </item> <item> <first>low_th_2_0_U</first> <second> <count>1</count> <item_version>0</item_version> <item>459</item> </second> </item> <item> <first>low_th_2_1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>469</item> </second> </item> <item> <first>low_th_2_2_U</first> <second> <count>1</count> <item_version>0</item_version> <item>479</item> </second> </item> <item> <first>p_src_mat_cols_c_i_U</first> <second> <count>1</count> <item_version>0</item_version> <item>329</item> </second> </item> <item> <first>p_src_mat_rows_c_i_U</first> <second> <count>1</count> <item_version>0</item_version> <item>319</item> </second> </item> </dp_fifo_map> <dp_memory_map> <count>0</count> <item_version>0</item_version> </dp_memory_map> </res> <node_label_latency class_id="51" tracking_level="0" version="0"> <count>27</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>9</first> <second class_id="53" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>10</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>26</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>0</first> <second>1</second> </second> </item> <item> <first>28</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>29</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>31</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>34</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>36</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>38</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>40</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>42</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>45</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>47</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>48</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>49</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>50</first> <second> <first>2</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="54" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="55" tracking_level="0" version="0"> <first>51</first> <second class_id="56" tracking_level="0" version="0"> <first>0</first> <second>2</second> </second> </item> </bblk_ent_exit> <regions class_id="57" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="58" tracking_level="1" version="0" object_id="_289"> <region_name>colorthresholding&lt;9, 0, 3, 2160, 3840, 1&gt;</region_name> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>51</item> </basic_blocks> <nodes> <count>44</count> <item_version>0</item_version> <item>7</item> <item>8</item> <item>9</item> <item>10</item> <item>11</item> <item>12</item> <item>13</item> <item>14</item> <item>15</item> <item>16</item> <item>17</item> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>26</item> <item>27</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>34</item> <item>35</item> <item>36</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> <item>42</item> <item>43</item> <item>44</item> <item>45</item> <item>46</item> <item>47</item> <item>48</item> <item>49</item> <item>50</item> </nodes> <anchor_node>-1</anchor_node> <region_type>16</region_type> <interval>0</interval> <pipe_depth>0</pipe_depth> </item> </regions> <dp_fu_nodes class_id="59" tracking_level="0" version="0"> <count>26</count> <item_version>0</item_version> <item class_id="60" tracking_level="0" version="0"> <first>60</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>64</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>68</first> <second> <count>2</count> <item_version>0</item_version> <item>49</item> <item>49</item> </second> </item> <item> <first>96</first> <second> <count>2</count> <item_version>0</item_version> <item>27</item> <item>27</item> </second> </item> <item> <first>104</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>114</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>120</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>125</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>130</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>135</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>140</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>145</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>150</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>155</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>160</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>165</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>170</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>175</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>180</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>185</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>190</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>195</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>200</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>205</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>210</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>215</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="62" tracking_level="0" version="0"> <count>22</count> <item_version>0</item_version> <item class_id="63" tracking_level="0" version="0"> <first>high_th_0_0_fu_135</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>high_th_0_1_fu_140</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>high_th_0_2_fu_145</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>high_th_1_0_fu_165</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>high_th_1_1_fu_170</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>high_th_1_2_fu_175</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>high_th_2_0_fu_195</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>high_th_2_1_fu_200</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>high_th_2_2_fu_205</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>img_height_loc_i_channel_fu_210</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>img_width_loc_i_channel_fu_215</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>low_th_0_0_fu_120</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>low_th_0_1_fu_125</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>low_th_0_2_fu_130</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>low_th_1_0_fu_150</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>low_th_1_1_fu_155</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>low_th_1_2_fu_160</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>low_th_2_0_fu_180</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>low_th_2_1_fu_185</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>low_th_2_2_fu_190</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>p_src_mat_cols_c_i_fu_60</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>p_src_mat_rows_c_i_fu_64</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>4</count> <item_version>0</item_version> <item> <first>call_ln0_colorthresholding_9_0_3_2160_3840_1_entry29_fu_104</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>call_ret1_colorthresholding_9_0_3_2160_3840_1_Block_colorthresholding_9_0_3_2160_3840_1_exit_proc_fu_114</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>grp_colorthresholding_9_0_3_2160_3840_1_Loop_VITIS_LOOP_138_1_proc_fu_96</first> <second> <count>2</count> <item_version>0</item_version> <item>27</item> <item>27</item> </second> </item> <item> <first>grp_xFInRange_9_0_2160_3840_15_0_1_9_1_3_s_fu_68</first> <second> <count>2</count> <item_version>0</item_version> <item>49</item> <item>49</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="64" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>22</count> <item_version>0</item_version> <item> <first>220</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>226</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>232</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>237</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>242</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>247</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>252</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>257</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>262</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>267</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>272</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>277</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>282</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>287</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>292</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>297</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>302</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>307</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>312</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>317</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>322</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>327</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>22</count> <item_version>0</item_version> <item> <first>high_th_0_0_reg_247</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>high_th_0_1_reg_252</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>high_th_0_2_reg_257</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>high_th_1_0_reg_277</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>high_th_1_1_reg_282</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>high_th_1_2_reg_287</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>high_th_2_0_reg_307</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>high_th_2_1_reg_312</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>high_th_2_2_reg_317</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>img_height_loc_i_channel_reg_322</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>img_width_loc_i_channel_reg_327</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>low_th_0_0_reg_232</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>low_th_0_1_reg_237</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>low_th_0_2_reg_242</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>low_th_1_0_reg_262</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>low_th_1_1_reg_267</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>low_th_1_2_reg_272</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>low_th_2_0_reg_292</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>low_th_2_1_reg_297</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>low_th_2_2_reg_302</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>p_src_mat_cols_c_i_reg_220</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>p_src_mat_rows_c_i_reg_226</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="65" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="66" tracking_level="0" version="0"> <first>imgHelper1_4101</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> </second> </item> <item> <first>p_src_mat_cols</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> </second> </item> <item> <first>p_src_mat_rows</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> </second> </item> <item> <first>rgb2hsv_4100</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core> <count>6</count> <item_version>0</item_version> <item> <first>1</first> <second> <first>1150</first> <second>10</second> </second> </item> <item> <first>2</first> <second> <first>1151</first> <second>10</second> </second> </item> <item> <first>3</first> <second> <first>666</first> <second>17</second> </second> </item> <item> <first>4</first> <second> <first>666</first> <second>17</second> </second> </item> <item> <first>5</first> <second> <first>1150</first> <second>10</second> </second> </item> <item> <first>6</first> <second> <first>1150</first> <second>10</second> </second> </item> </port2core> <node2core> <count>26</count> <item_version>0</item_version> <item> <first>9</first> <second> <first>1150</first> <second>10</second> </second> </item> <item> <first>10</first> <second> <first>1150</first> <second>10</second> </second> </item> <item> <first>26</first> <second> <first>-1</first> <second>-1</second> </second> </item> <item> <first>27</first> <second> <first>-1</first> <second>-1</second> </second> </item> <item> <first>28</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>29</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>30</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>31</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>32</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>33</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>34</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>35</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>36</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>37</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>38</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>39</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>40</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>41</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>42</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>43</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>44</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>45</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>46</first> <second> <first>-1</first> <second>-1</second> </second> </item> <item> <first>47</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>48</first> <second> <first>666</first> <second>10</second> </second> </item> <item> <first>49</first> <second> <first>-1</first> <second>-1</second> </second> </item> </node2core> </syndb> </boost_serialization>
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996 -- Version Control -- $Revision: 1.7 $ -- Binding Version 00.93 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Terminal_Interface.Curses.Menus.Menu_User_Data; with Terminal_Interface.Curses.Menus.Item_User_Data; with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Sample.Manifest; use Sample.Manifest; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Menu_Demo.Handler; with Sample.Helpers; use Sample.Helpers; with Sample.Explanation; use Sample.Explanation; package body Sample.Menu_Demo is package Spacing_Demo is procedure Spacing_Test; end Spacing_Demo; package body Spacing_Demo is procedure Spacing_Test is function My_Driver (M : Menu; K : Key_Code; P : Panel) return Boolean; procedure Set_Option_Key; procedure Set_Select_Key; procedure Set_Description_Key; procedure Set_Hide_Key; package Mh is new Sample.Menu_Demo.Handler (My_Driver); I : Item_Array_Access := new Item_Array' (New_Item ("January", "31 Days"), New_Item ("February", "28/29 Days"), New_Item ("March", "31 Days"), New_Item ("April", "30 Days"), New_Item ("May", "31 Days"), New_Item ("June", "30 Days"), New_Item ("July", "31 Days"), New_Item ("August", "31 Days"), New_Item ("September", "30 Days"), New_Item ("October", "31 Days"), New_Item ("November", "30 Days"), New_Item ("December", "31 Days"), Null_Item); M : Menu := New_Menu (I); Flip_State : Boolean := True; Hide_Long : Boolean := False; type Format_Code is (Four_By_1, Four_By_2, Four_By_3); type Operations is (Flip, Reorder, Reformat, Reselect, Describe); type Change is array (Operations) of Boolean; pragma Pack (Change); No_Change : constant Change := Change'(others => False); Current_Format : Format_Code := Four_By_1; To_Change : Change := No_Change; function My_Driver (M : Menu; K : Key_Code; P : Panel) return Boolean is begin To_Change := No_Change; if K in User_Key_Code'Range then if K = QUIT then return True; end if; end if; if K in Special_Key_Code'Range then case K is when Key_F4 => To_Change (Flip) := True; return True; when Key_F5 => To_Change (Reformat) := True; Current_Format := Four_By_1; return True; when Key_F6 => To_Change (Reformat) := True; Current_Format := Four_By_2; return True; when Key_F7 => To_Change (Reformat) := True; Current_Format := Four_By_3; return True; when Key_F8 => To_Change (Reorder) := True; return True; when Key_F9 => To_Change (Reselect) := True; return True; when Key_F10 => if Current_Format /= Four_By_3 then To_Change (Describe) := True; return True; else return False; end if; when Key_F11 => Hide_Long := not Hide_Long; declare O : Item_Option_Set; begin for J in I'Range loop Get_Options (I (J), O); O.Selectable := True; if Hide_Long then case J is when 1 | 3 | 5 | 7 | 8 | 10 | 12 => O.Selectable := False; when others => null; end case; end if; Set_Options (I (J), O); end loop; end; return False; when others => null; end case; end if; return False; end My_Driver; procedure Set_Option_Key is O : Menu_Option_Set; begin if Current_Format = Four_By_1 then Set_Soft_Label_Key (8, ""); else Get_Options (M, O); if O.Row_Major_Order then Set_Soft_Label_Key (8, "O-Col"); else Set_Soft_Label_Key (8, "O-Row"); end if; end if; Refresh_Soft_Label_Keys_Without_Update; end Set_Option_Key; procedure Set_Select_Key is O : Menu_Option_Set; begin Get_Options (M, O); if O.One_Valued then Set_Soft_Label_Key (9, "Multi"); else Set_Soft_Label_Key (9, "Singl"); end if; Refresh_Soft_Label_Keys_Without_Update; end Set_Select_Key; procedure Set_Description_Key is O : Menu_Option_Set; begin if Current_Format = Four_By_3 then Set_Soft_Label_Key (10, ""); else Get_Options (M, O); if O.Show_Descriptions then Set_Soft_Label_Key (10, "-Desc"); else Set_Soft_Label_Key (10, "+Desc"); end if; end if; Refresh_Soft_Label_Keys_Without_Update; end Set_Description_Key; procedure Set_Hide_Key is begin if Hide_Long then Set_Soft_Label_Key (11, "Enab"); else Set_Soft_Label_Key (11, "Disab"); end if; Refresh_Soft_Label_Keys_Without_Update; end Set_Hide_Key; begin Push_Environment ("MENU01"); Notepad ("MENU-PAD01"); Default_Labels; Set_Soft_Label_Key (4, "Flip"); Set_Soft_Label_Key (5, "4x1"); Set_Soft_Label_Key (6, "4x2"); Set_Soft_Label_Key (7, "4x3"); Set_Option_Key; Set_Select_Key; Set_Description_Key; Set_Hide_Key; Set_Format (M, 4, 1); loop Mh.Drive_Me (M); exit when To_Change = No_Change; if To_Change (Flip) then if Flip_State then Flip_State := False; Set_Spacing (M, 3, 2, 0); else Flip_State := True; Set_Spacing (M); end if; elsif To_Change (Reformat) then case Current_Format is when Four_By_1 => Set_Format (M, 4, 1); when Four_By_2 => Set_Format (M, 4, 2); when Four_By_3 => declare O : Menu_Option_Set; begin Get_Options (M, O); O.Show_Descriptions := False; Set_Options (M, O); Set_Format (M, 4, 3); end; end case; Set_Option_Key; Set_Description_Key; elsif To_Change (Reorder) then declare O : Menu_Option_Set; begin Get_Options (M, O); O.Row_Major_Order := not O.Row_Major_Order; Set_Options (M, O); Set_Option_Key; end; elsif To_Change (Reselect) then declare O : Menu_Option_Set; begin Get_Options (M, O); O.One_Valued := not O.One_Valued; Set_Options (M, O); Set_Select_Key; end; elsif To_Change (Describe) then declare O : Menu_Option_Set; begin Get_Options (M, O); O.Show_Descriptions := not O.Show_Descriptions; Set_Options (M, O); Set_Description_Key; end; else null; end if; end loop; Set_Spacing (M); Flip_State := True; Pop_Environment; Delete (M); Free (I, True); end Spacing_Test; end Spacing_Demo; procedure Demo is -- We use this datatype only to test the instantiation of -- the Menu_User_Data generic package. No functionality -- behind it. type User_Data is new Integer; type User_Data_Access is access User_Data; -- Those packages are only instantiated to test the usability. -- No real functionality is shown in the demo. package MUD is new Menu_User_Data (User_Data, User_Data_Access); package IUD is new Item_User_Data (User_Data, User_Data_Access); function My_Driver (M : Menu; K : Key_Code; P : Panel) return Boolean; package Mh is new Sample.Menu_Demo.Handler (My_Driver); Itm : Item_Array_Access := new Item_Array' (New_Item ("Menu Layout Options"), New_Item ("Demo of Hook functions"), Null_Item); M : Menu := New_Menu (Itm); U1 : User_Data_Access := new User_Data'(4711); U2 : User_Data_Access; U3 : User_Data_Access := new User_Data'(4712); U4 : User_Data_Access; function My_Driver (M : Menu; K : Key_Code; P : Panel) return Boolean is Idx : constant Positive := Get_Index (Current (M)); begin if K in User_Key_Code'Range then if K = QUIT then return True; elsif K = SELECT_ITEM then if Idx in Itm'Range then Hide (P); Update_Panels; end if; case Idx is when 1 => Spacing_Demo.Spacing_Test; when others => Not_Implemented; end case; if Idx in Itm'Range then Top (P); Show (P); Update_Panels; Update_Screen; end if; end if; end if; return False; end My_Driver; begin Push_Environment ("MENU00"); Notepad ("MENU-PAD00"); Default_Labels; Refresh_Soft_Label_Keys_Without_Update; Set_Pad_Character (M, '|'); MUD.Set_User_Data (M, U1); IUD.Set_User_Data (Itm (1), U3); Mh.Drive_Me (M); MUD.Get_User_Data (M, U2); pragma Assert (U1 = U2 and U1.all = 4711); IUD.Get_User_Data (Itm (1), U4); pragma Assert (U3 = U4 and U3.all = 4712); Pop_Environment; Delete (M); Free (Itm, True); end Demo; end Sample.Menu_Demo;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- 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.Classifier_Template_Parameters.Collections is pragma Preelaborate; package UML_Classifier_Template_Parameter_Collections is new AMF.Generic_Collections (UML_Classifier_Template_Parameter, UML_Classifier_Template_Parameter_Access); type Set_Of_UML_Classifier_Template_Parameter is new UML_Classifier_Template_Parameter_Collections.Set with null record; Empty_Set_Of_UML_Classifier_Template_Parameter : constant Set_Of_UML_Classifier_Template_Parameter; type Ordered_Set_Of_UML_Classifier_Template_Parameter is new UML_Classifier_Template_Parameter_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Classifier_Template_Parameter : constant Ordered_Set_Of_UML_Classifier_Template_Parameter; type Bag_Of_UML_Classifier_Template_Parameter is new UML_Classifier_Template_Parameter_Collections.Bag with null record; Empty_Bag_Of_UML_Classifier_Template_Parameter : constant Bag_Of_UML_Classifier_Template_Parameter; type Sequence_Of_UML_Classifier_Template_Parameter is new UML_Classifier_Template_Parameter_Collections.Sequence with null record; Empty_Sequence_Of_UML_Classifier_Template_Parameter : constant Sequence_Of_UML_Classifier_Template_Parameter; private Empty_Set_Of_UML_Classifier_Template_Parameter : constant Set_Of_UML_Classifier_Template_Parameter := (UML_Classifier_Template_Parameter_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Classifier_Template_Parameter : constant Ordered_Set_Of_UML_Classifier_Template_Parameter := (UML_Classifier_Template_Parameter_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Classifier_Template_Parameter : constant Bag_Of_UML_Classifier_Template_Parameter := (UML_Classifier_Template_Parameter_Collections.Bag with null record); Empty_Sequence_Of_UML_Classifier_Template_Parameter : constant Sequence_Of_UML_Classifier_Template_Parameter := (UML_Classifier_Template_Parameter_Collections.Sequence with null record); end AMF.UML.Classifier_Template_Parameters.Collections;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Internals.Utp_Elements; with AMF.UML.Read_Structural_Feature_Actions; with AMF.Utp.Timer_Running_Actions; with AMF.Visitors; package AMF.Internals.Utp_Timer_Running_Actions is type Utp_Timer_Running_Action_Proxy is limited new AMF.Internals.Utp_Elements.Utp_Element_Proxy and AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action with null record; overriding function Get_Base_Read_Structural_Feature_Action (Self : not null access constant Utp_Timer_Running_Action_Proxy) return AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access; -- Getter of TimerRunningAction::base_ReadStructuralFeatureAction. -- overriding procedure Set_Base_Read_Structural_Feature_Action (Self : not null access Utp_Timer_Running_Action_Proxy; To : AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access); -- Setter of TimerRunningAction::base_ReadStructuralFeatureAction. -- overriding procedure Enter_Element (Self : not null access constant Utp_Timer_Running_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); overriding procedure Leave_Element (Self : not null access constant Utp_Timer_Running_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); overriding procedure Visit_Element (Self : not null access constant Utp_Timer_Running_Action_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); end AMF.Internals.Utp_Timer_Running_Actions;
-- Implantation du module Ensembles. with Ada.Unchecked_Deallocation; package body Ensembles_Chainage is -- Libérer la mémoire alloué auparavant. procedure Free is new Ada.Unchecked_Deallocation (T_Cellule, T_Ensemble); procedure Initialiser (Ensemble : out T_Ensemble) is begin Ensemble := Null; end Initialiser; procedure Detruire (Ensemble : in out T_Ensemble) is begin if (Ensemble /= Null) then Detruire (Ensemble.all.Suivant); Free (Ensemble); else null; end if; end Detruire; function Est_Vide (Ensemble : in T_Ensemble) return Boolean is begin return Ensemble = Null; end Est_Vide; function Taille (Ensemble : in T_Ensemble) return Integer is begin if (Ensemble = Null) then return 0; else return 1 + Taille (Ensemble.all.suivant); end if; end Taille; function Est_Present (Ensemble : in T_Ensemble; Element : in T_Element) return Boolean is present : Boolean; Temp : T_Ensemble; begin present := False; Temp := Ensemble; while (Temp /= Null) loop if (Temp.all.Element = Element) then present := True; end if; Temp := Temp.all.Suivant; end loop; return present; end Est_Present; procedure Ajouter (Ensemble : in out T_Ensemble; Element : in T_Element) is Nouvelle_Cellule, Temp : T_Ensemble; begin Nouvelle_Cellule := New T_Cellule'(Element, Null); if ( Ensemble = Null) then -- Si l'ensemble est vide. Ensemble := Nouvelle_Cellule; --Créer une nouvelle cellule. else -- Sinon, on ajoute à la fin de l'ensemble. Temp := Ensemble; while (Temp.all.Suivant /= Null) loop Temp := Temp.all.Suivant; end loop; Temp.all.Suivant := Nouvelle_Cellule; --Créer une nouvelle cellule.; end if; end Ajouter; procedure Supprimer (Ensemble : in out T_Ensemble; Element : in T_Element) is Temp : T_Ensemble; begin if (Ensemble.all.Element = Element) then Temp := Ensemble.all.Suivant; Free (Ensemble); Ensemble := Temp; else Supprimer (Ensemble.all.Suivant, Element); end if; end Supprimer; procedure Appliquer_Sur_Tous (Ensemble : in T_Ensemble) is Temp : T_Ensemble; begin Temp := Ensemble; while (Temp /= NULL) loop Operation (Temp.all.Element); Temp := Temp.all.Suivant; end loop; end Appliquer_Sur_Tous; end Ensembles_Chainage;
with System; use System; with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure Main is N : Integer := 12; P : Integer := 6; H : Integer := N / P; type GeneralVector is array (Integer range <>) of Integer; subtype Vector is GeneralVector (1 .. N); subtype VectorH is GeneralVector (1 .. H); subtype Vector2H is GeneralVector (1 .. 2 * H); subtype Vector4H is GeneralVector (1 .. 4 * H); subtype Vector5H is GeneralVector (1 .. 5 * H); type GeneralMatrix is array (Integer range <>) of Vector; subtype Matrix is GeneralMatrix (1 .. N); subtype MatrixH is GeneralMatrix (1 .. H); subtype Matrix2H is GeneralMatrix (1 .. 2 * H); subtype Matrix3H is GeneralMatrix (1 .. 3 * H); subtype Matrix4H is GeneralMatrix (1 .. 4 * H); subtype Matrix5H is GeneralMatrix (1 .. 5 * H); task T1 is entry Data2 (MB_p : in MatrixH; MK_p : in Matrix); entry ShareM (m_p : in Integer); end T1; task T2 is entry Data2 (MB_p : in Matrix2H; MK_p : in Matrix); entry Data1 (Z_p : in Vector5H; MO_p : in Matrix5H); entry SendMin1 (m1_p : in Integer); entry ShareM (m_p : in Integer); entry Rezult1 (MA_p : in MatrixH); end T2; task T3 is entry Data2 (MB_p123 : in Matrix3H; MB_p56 : in Matrix2H; MK_p : in Matrix); entry Data1 (Z_p : in Vector4H; MO_p : in Matrix4H); entry SendMin12 (m1_p, m2_p : in Integer); entry SendMin5 (m5_p : in Integer); entry SendMin6 (m6_p : in Integer); entry ShareM (m_p : in Integer); entry Rezult2 (MA_p : in Matrix2H); entry Rezult5 (MA_p : in MatrixH); entry Rezult6 (MA_p : in MatrixH); end T3; task T4 is entry SendMin12356 (m1_p, m2_p, m3_p, m5_p, m6_p : in Integer); entry Data1 (Z_p : in VectorH; MO_p : in MatrixH); entry Rezult12356 (MA_p : in Matrix5H); end T4; task T5 is entry Data2 (MB_p : in MatrixH; MK_p : in Matrix); entry Data1 (Z_p : in VectorH; MO_p : in MatrixH); entry ShareM (m_p : in Integer); end T5; task T6 is entry Data2 (MB_p : in MatrixH; MK_p : in Matrix); entry Data1 (Z_p : in VectorH; MO_p : in MatrixH); entry ShareM (m_p : in Integer); end T6; task body T1 is Z : Vector; MO, MK : Matrix; m1, m : Integer; MA, MB : MatrixH; from, to : Integer; begin Put_Line ("T1 started"); from := 1; to := H; --Input Z, MO for i in 1 .. N loop Z (i) := 1; for j in 1 .. N loop MO (i) (j) := 1; end loop; end loop; --Send Z, MO to T2 T2.Data1 (Z (H + 1 .. N), MO (H + 1 .. N)); --Receive MB, MK from T2 accept Data2 (MB_p : in MatrixH; MK_p : in Matrix) do MB := MB_p; MK := MK_p; end Data2; --Calculate m1 m1 := Z(1); for i in 2 .. H loop if Z (i) < m1 then m1 := Z (i); end if; end loop; --Send m1 to T2 T2.SendMin1 (m1); --Receive m from T2 accept ShareM (m_p : in Integer) do m := m_p; end ShareM; --Calculate MAH = MBH + m*(MOH*MK) for i in from .. to loop for j in 1 .. N loop MA (i) (j) := 0; for K in 1 .. N loop MA (i) (j) := MA (i) (j) + MO (i) (K) * MK (K) (j); end loop; MA (i) (j) := MB (i) (j) + m * MA (i) (j); end loop; end loop; --Send MAH to T2 T2.Rezult1 (MA (1 .. H)); --Put_Line ("T1 finished"); end T1; task body T2 is Z : Vector5H; MK : Matrix; MO : Matrix5H; MB, MA : Matrix2H; m1, m2, m : Integer; from, to : Integer; begin Put_Line ("T2 started"); from := H + 1; to := 2 * H; --Receive Z, MO from T1; accept Data1 (Z_p : in Vector5H; MO_p : in Matrix5H) do Z := Z_p; MO := MO_p; end Data1; --Send Z, MO to T3; T3.Data1 (Z (H + 1 .. 5 * H), MO (H + 1 .. 5 * H)); --Receive MB, MK from T3; accept Data2 (MB_p : in Matrix2H; MK_p : in Matrix) do MB := MB_p; MK := MK_p; end Data2; --Send MB, MK to T1; T1.Data2 (MB (1 .. H), MK); --Calculate m2; m2 := Z(H+1); for i in H + 2 .. 2 * H loop if Z (i) < m2 then m2 := Z (i); end if; end loop; --Receive m1 from T1; accept SendMin1 (m1_p : in Integer) do m1 := m1_p; end SendMin1; --Send m1, m2 to T3; T3.SendMin12 (m1, m2); --Receive m from T3; accept ShareM (m_p : in Integer) do m := m_p; end ShareM; --Send m to T1; T1.ShareM (m); --Calculate MAH = MBH + m*(MOH*MK) for i in H + 1 .. 2 * H loop for j in 1 .. N loop MA (i) (j) := 0; for K in 1 .. N loop MA (i) (j) := MA (i) (j) + MO (i) (K) * MK (K) (j); end loop; MA (i) (j) := MB (i) (j) + m * MA (i) (j); end loop; end loop; --Receive MA from T1; accept Rezult1 (MA_p : in MatrixH) do MA (1 .. H) := MA_p; end Rezult1; --Send MA2H to T3 T3.Rezult2 (MA); --Put_Line ("T2 finished"); end T2; task body T3 is m1, m2, m3, m5, m6, m : Integer; MA : Matrix5H; Z : Vector4H; MO : Matrix4H; MK : Matrix; MB : Matrix5H; begin Put_Line ("T3 started"); --Receive Z, MO from T2; accept Data1 (Z_p : in Vector4H; MO_p : in Matrix4H) do Z := Z_p; MO := MO_p; end Data1; --Receive MB, MK from T4; accept Data2 (MB_p123 : in Matrix3H; MB_p56 : in Matrix2H; MK_p : in Matrix) do MB (1 .. 3 * H) := MB_p123; MB (3 * H + 1 .. 5 * H) := MB_p56; MK := MK_p; end Data2; --Send MB,MK to T2; T2.Data2 (MB (1 .. 2 * H), MK); --Send Z,MO to T4; T4.Data1 (Z (H + 1 .. 2 * H), MO (H + 1 .. 2 * H)); --Send Z,MO to T5; T5.Data1 (Z (2 * H + 1 .. 3 * H), MO (2 * H + 1 .. 3 * H)); --Send MB,MK to T5; T5.Data2 (MB (3 * H + 1 .. 4 * H), MK); --Send Z,MO to T6; T6.Data1 (Z (3 * H + 1 .. 4 * H), MO (3 * H + 1 .. 4 * H)); --Send MB,MK to T6; T6.Data2 (MB (4 * H + 1 .. 5 * H), MK); --Calculate m3; m3 := Z(1); for i in 2 .. H loop if Z (i) < m3 then m3 := Z (i); end if; end loop; --Receive m1,m2 from T2; accept SendMin12 (m1_p : in Integer; m2_p : in Integer) do m1 := m1_p; m2 := m2_p; end SendMin12; --Receive m5 from T5; accept SendMin5 (m5_p : in Integer) do m5 := m5_p; end SendMin5; --Receive m6 from T6; accept SendMin6 (m6_p : in Integer) do m6 := m6_p; end SendMin6; --Send m1,m2,m3,m5,m6 to T4; T4.SendMin12356 (m1, m2, m3, m5, m6); --Receive m from T4; accept ShareM (m_p : in Integer) do m := m_p; end ShareM; --Send m to T2; T2.ShareM (m); --Send m to T5; T5.ShareM (m); --Send m to T6; T6.ShareM (m); --Calculate MAH = MBH + m*(MOH*MK); for i in 2 * H + 1 .. 3 * H loop for j in 1 .. N loop MA (i) (j) := 0; for K in 1 .. N loop MA (i) (j) := MA (i) (j) + MO (i) (K) * MK (K) (j); end loop; MA (i) (j) := MB (i + H) (j) + m * MA (i) (j); end loop; end loop; --Receive MA from T2; accept Rezult2 (MA_p : in Matrix2H) do MA (1 .. 2 * H) := MA_p; end Rezult2; --Receive MA from T5; accept Rezult5 (MA_p : in MatrixH) do MA (3 * H + 1 .. 4 * H) := MA_p; end Rezult5; --Receive MA from T6; accept Rezult6 (MA_p : in MatrixH) do MA (4 * H + 1 .. 5 * H) := MA_p; end Rezult6; --Send MA to T4; T4.Rezult12356 (MA); --Put_Line ("T3 finished"); end T3; task body T4 is MA, MB, MK : Matrix; Z : VectorH; MO : MatrixH; m4, min : Integer; from, to : Integer; M : array (1 .. 6) of Integer; begin Put_Line ("T4 started"); from := 3 * H + 1; to := 4 * H; --Input MB,MK; for i in 1 .. N loop for j in 1 .. N loop MB (i) (j) := 1; MK (i) (j) := 1; end loop; end loop; --Send MB, MK to T3; T3.Data2 (MB (1 .. 3 * H), MB (4 * H + 1 .. N), MK); --Receive Z, MO from T3; accept Data1 (Z_p : in VectorH; MO_p : in MatrixH) do Z := Z_p; MO := MO_p; end Data1; --Calculate m4; m4 := Z(1); for i in 2 .. H loop if Z (i) < m4 then m4 := Z (i); end if; end loop; M (4) := m4; --Receive m1,m2,m3,m5,m6 from T3; accept SendMin12356 (m1_p : in Integer; m2_p : in Integer; m3_p : in Integer; m5_p : in Integer; m6_p : in Integer) do M (1) := m1_p; M (2) := m2_p; M (3) := m3_p; M (5) := m5_p; M (6) := m6_p; end SendMin12356; --Calculate m; min := M(1); for i in 2 .. P loop if M (i) < min then min := M (i); end if; end loop; --Send m to T3; T3.ShareM (min); --Calculate MAH = MBH + m*(MOH*MK); for i in 3 * H + 1 .. 4 * H loop for j in 1 .. N loop MA (i) (j) := 0; for K in 1 .. N loop MA (i) (j) := MA (i) (j) + MO (i - 3 * H) (K) * MK (K) (j); end loop; MA (i) (j) := MB (i) (j) + min * MA (i) (j); end loop; end loop; --Receive MA from T3; accept Rezult12356 (MA_p : in Matrix5H) do MA (1 .. 3 * H) := MA_p (1 .. 3 * H); MA (4 * H + 1 .. N) := MA_p (3 * H + 1 .. 5 * H); end Rezult12356; --Output MA; if N <= 12 then for i in 1 .. N loop for j in 1 .. N loop Put (MA (i) (j)); Put (" "); end loop; Put_Line (" "); end loop; end if; -- Put_Line ("T4 finished"); end T4; task body T5 is MK : Matrix; MB, MO, MA : MatrixH; Z : VectorH; m5, m : Integer; from, to : Integer; begin Put_Line ("T5 started"); from := 4 * H + 1; to := 5 * H; --Receive Z, MO from T3; accept Data1 (Z_p : in VectorH; MO_p : in MatrixH) do Z := Z_p; MO := MO_p; end Data1; --Receive MB, MK from T3; accept Data2 (MB_p : in MatrixH; MK_p : in Matrix) do MB := MB_p; MK := MK_p; end Data2; --Calculate m5; m5 := Z(1); for i in 2 .. H loop if Z (i) < m5 then m5 := Z (i); end if; end loop; --Send m5 to T3; T3.SendMin5 (m5); --Receive m from T3; accept ShareM (m_p : in Integer) do m := m_p; end ShareM; --Calculate MAH = MBH + m*(MOH*MK); for i in 1 .. H loop for j in 1 .. N loop MA (i) (j) := 0; for K in 1 .. N loop MA (i) (j) := MA (i) (j) + MO (i) (K) * MK (K) (j); end loop; MA (i) (j) := MB (i) (j) + m * MA (i) (j); end loop; end loop; --Send MA to T3; T3.Rezult5 (MA); --Put_Line ("T5 finished"); end T5; task body T6 is MK : Matrix; MB, MO, MA : MatrixH; Z : VectorH; m6, m : Integer; from, to : Integer; begin Put_Line ("T6 started"); from := 5 * H + 1; to := N; --Receive Z, MO from T3; accept Data1 (Z_p : in VectorH; MO_p : in MatrixH) do Z := Z_p; MO := MO_p; end Data1; --Receive MB, MK from T3; accept Data2 (MB_p : in MatrixH; MK_p : in Matrix) do MB := MB_p; MK := MK_p; end Data2; --Calculate m6; m6 := Z(1); for i in 2 .. H loop if Z (i) < m6 then m6 := Z (i); end if; end loop; --Send m6 to T3; T3.SendMin6 (m6); --Receive m from T3; accept ShareM (m_p : in Integer) do m := m_p; end ShareM; --Calculate MAH = MBH + m*(MOH*MK); for i in 1 .. H loop for j in 1 .. N loop MA (i) (j) := 0; for K in 1 .. N loop MA (i) (j) := MA (i) (j) + MO (i) (K) * MK (K) (j); end loop; MA (i) (j) := MB (i) (j) + m * MA (i) (j); end loop; end loop; --Send MA to T3; T3.Rezult6 (MA); -- Put_Line ("T6 finished"); end T6; begin null; end Main;
-- -- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -- -- The version of the OpenAPI document: 20220523 -- -- -- NOTE: This package is auto generated by OpenAPI-Generator 5.4.0. -- https://openapi-generator.tech -- Do not edit the class manually. pragma Warnings (Off, "*is not referenced"); with Swagger.Streams; with Swagger.Servers.Operation; package body .Skeletons is pragma Style_Checks ("-mr"); pragma Warnings (Off, "*use clause for package*"); use Swagger.Streams; package body Skeleton is package API_Ability_List is new Swagger.Servers.Operation (Handler => Ability_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/ability/"); -- procedure Ability_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Ability_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Ability_List; package API_Ability_Read is new Swagger.Servers.Operation (Handler => Ability_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/ability/{id}/"); -- procedure Ability_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Ability_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Ability_Read; package API_Berry_List is new Swagger.Servers.Operation (Handler => Berry_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry/"); -- procedure Berry_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Berry_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_List; package API_Berry_Read is new Swagger.Servers.Operation (Handler => Berry_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry/{id}/"); -- procedure Berry_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Berry_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Read; package API_Berry_Firmness_List is new Swagger.Servers.Operation (Handler => Berry_Firmness_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry-firmness/"); -- procedure Berry_Firmness_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Berry_Firmness_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Firmness_List; package API_Berry_Firmness_Read is new Swagger.Servers.Operation (Handler => Berry_Firmness_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry-firmness/{id}/"); -- procedure Berry_Firmness_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Berry_Firmness_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Firmness_Read; package API_Berry_Flavor_List is new Swagger.Servers.Operation (Handler => Berry_Flavor_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry-flavor/"); -- procedure Berry_Flavor_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Berry_Flavor_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Flavor_List; package API_Berry_Flavor_Read is new Swagger.Servers.Operation (Handler => Berry_Flavor_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry-flavor/{id}/"); -- procedure Berry_Flavor_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Berry_Flavor_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Flavor_Read; package API_Characteristic_List is new Swagger.Servers.Operation (Handler => Characteristic_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/characteristic/"); -- procedure Characteristic_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Characteristic_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Characteristic_List; package API_Characteristic_Read is new Swagger.Servers.Operation (Handler => Characteristic_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/characteristic/{id}/"); -- procedure Characteristic_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Characteristic_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Characteristic_Read; package API_Contest_Effect_List is new Swagger.Servers.Operation (Handler => Contest_Effect_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/contest-effect/"); -- procedure Contest_Effect_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Contest_Effect_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Contest_Effect_List; package API_Contest_Effect_Read is new Swagger.Servers.Operation (Handler => Contest_Effect_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/contest-effect/{id}/"); -- procedure Contest_Effect_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Contest_Effect_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Contest_Effect_Read; package API_Contest_Type_List is new Swagger.Servers.Operation (Handler => Contest_Type_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/contest-type/"); -- procedure Contest_Type_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Contest_Type_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Contest_Type_List; package API_Contest_Type_Read is new Swagger.Servers.Operation (Handler => Contest_Type_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/contest-type/{id}/"); -- procedure Contest_Type_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Contest_Type_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Contest_Type_Read; package API_Egg_Group_List is new Swagger.Servers.Operation (Handler => Egg_Group_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/egg-group/"); -- procedure Egg_Group_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Egg_Group_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Egg_Group_List; package API_Egg_Group_Read is new Swagger.Servers.Operation (Handler => Egg_Group_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/egg-group/{id}/"); -- procedure Egg_Group_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Egg_Group_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Egg_Group_Read; package API_Encounter_Condition_List is new Swagger.Servers.Operation (Handler => Encounter_Condition_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-condition/"); -- procedure Encounter_Condition_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Encounter_Condition_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Condition_List; package API_Encounter_Condition_Read is new Swagger.Servers.Operation (Handler => Encounter_Condition_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-condition/{id}/"); -- procedure Encounter_Condition_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Encounter_Condition_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Condition_Read; package API_Encounter_Condition_Value_List is new Swagger.Servers.Operation (Handler => Encounter_Condition_Value_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-condition-value/"); -- procedure Encounter_Condition_Value_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Encounter_Condition_Value_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Condition_Value_List; package API_Encounter_Condition_Value_Read is new Swagger.Servers.Operation (Handler => Encounter_Condition_Value_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-condition-value/{id}/"); -- procedure Encounter_Condition_Value_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Encounter_Condition_Value_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Condition_Value_Read; package API_Encounter_Method_List is new Swagger.Servers.Operation (Handler => Encounter_Method_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-method/"); -- procedure Encounter_Method_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Encounter_Method_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Method_List; package API_Encounter_Method_Read is new Swagger.Servers.Operation (Handler => Encounter_Method_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-method/{id}/"); -- procedure Encounter_Method_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Encounter_Method_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Method_Read; package API_Evolution_Chain_List is new Swagger.Servers.Operation (Handler => Evolution_Chain_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/evolution-chain/"); -- procedure Evolution_Chain_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Evolution_Chain_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Evolution_Chain_List; package API_Evolution_Chain_Read is new Swagger.Servers.Operation (Handler => Evolution_Chain_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/evolution-chain/{id}/"); -- procedure Evolution_Chain_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Evolution_Chain_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Evolution_Chain_Read; package API_Evolution_Trigger_List is new Swagger.Servers.Operation (Handler => Evolution_Trigger_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/evolution-trigger/"); -- procedure Evolution_Trigger_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Evolution_Trigger_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Evolution_Trigger_List; package API_Evolution_Trigger_Read is new Swagger.Servers.Operation (Handler => Evolution_Trigger_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/evolution-trigger/{id}/"); -- procedure Evolution_Trigger_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Evolution_Trigger_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Evolution_Trigger_Read; package API_Gender_List is new Swagger.Servers.Operation (Handler => Gender_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/gender/"); -- procedure Gender_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Gender_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Gender_List; package API_Gender_Read is new Swagger.Servers.Operation (Handler => Gender_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/gender/{id}/"); -- procedure Gender_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Gender_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Gender_Read; package API_Generation_List is new Swagger.Servers.Operation (Handler => Generation_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/generation/"); -- procedure Generation_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Generation_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Generation_List; package API_Generation_Read is new Swagger.Servers.Operation (Handler => Generation_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/generation/{id}/"); -- procedure Generation_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Generation_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Generation_Read; package API_Growth_Rate_List is new Swagger.Servers.Operation (Handler => Growth_Rate_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/growth-rate/"); -- procedure Growth_Rate_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Growth_Rate_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Growth_Rate_List; package API_Growth_Rate_Read is new Swagger.Servers.Operation (Handler => Growth_Rate_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/growth-rate/{id}/"); -- procedure Growth_Rate_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Growth_Rate_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Growth_Rate_Read; package API_Item_List is new Swagger.Servers.Operation (Handler => Item_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item/"); -- procedure Item_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Item_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_List; package API_Item_Read is new Swagger.Servers.Operation (Handler => Item_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item/{id}/"); -- procedure Item_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Item_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Read; package API_Item_Attribute_List is new Swagger.Servers.Operation (Handler => Item_Attribute_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-attribute/"); -- procedure Item_Attribute_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Item_Attribute_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Attribute_List; package API_Item_Attribute_Read is new Swagger.Servers.Operation (Handler => Item_Attribute_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-attribute/{id}/"); -- procedure Item_Attribute_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Item_Attribute_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Attribute_Read; package API_Item_Category_List is new Swagger.Servers.Operation (Handler => Item_Category_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-category/"); -- procedure Item_Category_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Item_Category_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Category_List; package API_Item_Category_Read is new Swagger.Servers.Operation (Handler => Item_Category_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-category/{id}/"); -- procedure Item_Category_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Item_Category_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Category_Read; package API_Item_Fling_Effect_List is new Swagger.Servers.Operation (Handler => Item_Fling_Effect_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-fling-effect/"); -- procedure Item_Fling_Effect_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Item_Fling_Effect_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Fling_Effect_List; package API_Item_Fling_Effect_Read is new Swagger.Servers.Operation (Handler => Item_Fling_Effect_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-fling-effect/{id}/"); -- procedure Item_Fling_Effect_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Item_Fling_Effect_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Fling_Effect_Read; package API_Item_Pocket_List is new Swagger.Servers.Operation (Handler => Item_Pocket_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-pocket/"); -- procedure Item_Pocket_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Item_Pocket_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Pocket_List; package API_Item_Pocket_Read is new Swagger.Servers.Operation (Handler => Item_Pocket_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-pocket/{id}/"); -- procedure Item_Pocket_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Item_Pocket_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Pocket_Read; package API_Language_List is new Swagger.Servers.Operation (Handler => Language_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/language/"); -- procedure Language_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Language_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Language_List; package API_Language_Read is new Swagger.Servers.Operation (Handler => Language_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/language/{id}/"); -- procedure Language_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Language_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Language_Read; package API_Location_List is new Swagger.Servers.Operation (Handler => Location_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/location/"); -- procedure Location_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Location_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Location_List; package API_Location_Read is new Swagger.Servers.Operation (Handler => Location_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/location/{id}/"); -- procedure Location_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Location_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Location_Read; package API_Location_Area_List is new Swagger.Servers.Operation (Handler => Location_Area_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/location-area/"); -- procedure Location_Area_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Location_Area_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Location_Area_List; package API_Location_Area_Read is new Swagger.Servers.Operation (Handler => Location_Area_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/location-area/{id}/"); -- procedure Location_Area_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Location_Area_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Location_Area_Read; package API_Machine_List is new Swagger.Servers.Operation (Handler => Machine_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/machine/"); -- procedure Machine_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Machine_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Machine_List; package API_Machine_Read is new Swagger.Servers.Operation (Handler => Machine_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/machine/{id}/"); -- procedure Machine_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Machine_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Machine_Read; package API_Move_List is new Swagger.Servers.Operation (Handler => Move_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move/"); -- procedure Move_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Move_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_List; package API_Move_Read is new Swagger.Servers.Operation (Handler => Move_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move/{id}/"); -- procedure Move_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Move_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Read; package API_Move_Ailment_List is new Swagger.Servers.Operation (Handler => Move_Ailment_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-ailment/"); -- procedure Move_Ailment_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Move_Ailment_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Ailment_List; package API_Move_Ailment_Read is new Swagger.Servers.Operation (Handler => Move_Ailment_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-ailment/{id}/"); -- procedure Move_Ailment_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Move_Ailment_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Ailment_Read; package API_Move_Battle_Style_List is new Swagger.Servers.Operation (Handler => Move_Battle_Style_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-battle-style/"); -- procedure Move_Battle_Style_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Move_Battle_Style_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Battle_Style_List; package API_Move_Battle_Style_Read is new Swagger.Servers.Operation (Handler => Move_Battle_Style_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-battle-style/{id}/"); -- procedure Move_Battle_Style_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Move_Battle_Style_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Battle_Style_Read; package API_Move_Category_List is new Swagger.Servers.Operation (Handler => Move_Category_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-category/"); -- procedure Move_Category_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Move_Category_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Category_List; package API_Move_Category_Read is new Swagger.Servers.Operation (Handler => Move_Category_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-category/{id}/"); -- procedure Move_Category_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Move_Category_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Category_Read; package API_Move_Damage_Class_List is new Swagger.Servers.Operation (Handler => Move_Damage_Class_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-damage-class/"); -- procedure Move_Damage_Class_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Move_Damage_Class_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Damage_Class_List; package API_Move_Damage_Class_Read is new Swagger.Servers.Operation (Handler => Move_Damage_Class_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-damage-class/{id}/"); -- procedure Move_Damage_Class_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Move_Damage_Class_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Damage_Class_Read; package API_Move_Learn_Method_List is new Swagger.Servers.Operation (Handler => Move_Learn_Method_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-learn-method/"); -- procedure Move_Learn_Method_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Move_Learn_Method_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Learn_Method_List; package API_Move_Learn_Method_Read is new Swagger.Servers.Operation (Handler => Move_Learn_Method_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-learn-method/{id}/"); -- procedure Move_Learn_Method_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Move_Learn_Method_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Learn_Method_Read; package API_Move_Target_List is new Swagger.Servers.Operation (Handler => Move_Target_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-target/"); -- procedure Move_Target_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Move_Target_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Target_List; package API_Move_Target_Read is new Swagger.Servers.Operation (Handler => Move_Target_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-target/{id}/"); -- procedure Move_Target_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Move_Target_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Target_Read; package API_Nature_List is new Swagger.Servers.Operation (Handler => Nature_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/nature/"); -- procedure Nature_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Nature_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Nature_List; package API_Nature_Read is new Swagger.Servers.Operation (Handler => Nature_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/nature/{id}/"); -- procedure Nature_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Nature_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Nature_Read; package API_Pal_Park_Area_List is new Swagger.Servers.Operation (Handler => Pal_Park_Area_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pal-park-area/"); -- procedure Pal_Park_Area_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pal_Park_Area_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pal_Park_Area_List; package API_Pal_Park_Area_Read is new Swagger.Servers.Operation (Handler => Pal_Park_Area_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pal-park-area/{id}/"); -- procedure Pal_Park_Area_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pal_Park_Area_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pal_Park_Area_Read; package API_Pokeathlon_Stat_List is new Swagger.Servers.Operation (Handler => Pokeathlon_Stat_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokeathlon-stat/"); -- procedure Pokeathlon_Stat_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pokeathlon_Stat_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokeathlon_Stat_List; package API_Pokeathlon_Stat_Read is new Swagger.Servers.Operation (Handler => Pokeathlon_Stat_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokeathlon-stat/{id}/"); -- procedure Pokeathlon_Stat_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pokeathlon_Stat_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokeathlon_Stat_Read; package API_Pokedex_List is new Swagger.Servers.Operation (Handler => Pokedex_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokedex/"); -- procedure Pokedex_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pokedex_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokedex_List; package API_Pokedex_Read is new Swagger.Servers.Operation (Handler => Pokedex_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokedex/{id}/"); -- procedure Pokedex_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pokedex_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokedex_Read; package API_Pokemon_List is new Swagger.Servers.Operation (Handler => Pokemon_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon/"); -- procedure Pokemon_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pokemon_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_List; package API_Pokemon_Read is new Swagger.Servers.Operation (Handler => Pokemon_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon/{id}/"); -- procedure Pokemon_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pokemon_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Read; package API_Pokemon_Color_List is new Swagger.Servers.Operation (Handler => Pokemon_Color_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-color/"); -- procedure Pokemon_Color_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pokemon_Color_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Color_List; package API_Pokemon_Color_Read is new Swagger.Servers.Operation (Handler => Pokemon_Color_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-color/{id}/"); -- procedure Pokemon_Color_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pokemon_Color_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Color_Read; package API_Pokemon_Form_List is new Swagger.Servers.Operation (Handler => Pokemon_Form_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-form/"); -- procedure Pokemon_Form_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pokemon_Form_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Form_List; package API_Pokemon_Form_Read is new Swagger.Servers.Operation (Handler => Pokemon_Form_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-form/{id}/"); -- procedure Pokemon_Form_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pokemon_Form_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Form_Read; package API_Pokemon_Habitat_List is new Swagger.Servers.Operation (Handler => Pokemon_Habitat_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-habitat/"); -- procedure Pokemon_Habitat_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pokemon_Habitat_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Habitat_List; package API_Pokemon_Habitat_Read is new Swagger.Servers.Operation (Handler => Pokemon_Habitat_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-habitat/{id}/"); -- procedure Pokemon_Habitat_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pokemon_Habitat_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Habitat_Read; package API_Pokemon_Shape_List is new Swagger.Servers.Operation (Handler => Pokemon_Shape_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-shape/"); -- procedure Pokemon_Shape_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pokemon_Shape_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Shape_List; package API_Pokemon_Shape_Read is new Swagger.Servers.Operation (Handler => Pokemon_Shape_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-shape/{id}/"); -- procedure Pokemon_Shape_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pokemon_Shape_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Shape_Read; package API_Pokemon_Species_List is new Swagger.Servers.Operation (Handler => Pokemon_Species_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-species/"); -- procedure Pokemon_Species_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Pokemon_Species_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Species_List; package API_Pokemon_Species_Read is new Swagger.Servers.Operation (Handler => Pokemon_Species_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-species/{id}/"); -- procedure Pokemon_Species_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Pokemon_Species_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Species_Read; package API_Region_List is new Swagger.Servers.Operation (Handler => Region_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/region/"); -- procedure Region_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Region_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Region_List; package API_Region_Read is new Swagger.Servers.Operation (Handler => Region_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/region/{id}/"); -- procedure Region_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Region_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Region_Read; package API_Stat_List is new Swagger.Servers.Operation (Handler => Stat_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/stat/"); -- procedure Stat_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Stat_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Stat_List; package API_Stat_Read is new Swagger.Servers.Operation (Handler => Stat_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/stat/{id}/"); -- procedure Stat_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Stat_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Stat_Read; package API_Super_Contest_Effect_List is new Swagger.Servers.Operation (Handler => Super_Contest_Effect_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/super-contest-effect/"); -- procedure Super_Contest_Effect_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Super_Contest_Effect_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Super_Contest_Effect_List; package API_Super_Contest_Effect_Read is new Swagger.Servers.Operation (Handler => Super_Contest_Effect_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/super-contest-effect/{id}/"); -- procedure Super_Contest_Effect_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Super_Contest_Effect_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Super_Contest_Effect_Read; package API_Type_List is new Swagger.Servers.Operation (Handler => Type_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/type/"); -- procedure Type_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Type_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Type_List; package API_Type_Read is new Swagger.Servers.Operation (Handler => Type_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/type/{id}/"); -- procedure Type_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Type_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Type_Read; package API_Version_List is new Swagger.Servers.Operation (Handler => Version_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/version/"); -- procedure Version_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Version_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Version_List; package API_Version_Read is new Swagger.Servers.Operation (Handler => Version_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/version/{id}/"); -- procedure Version_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Version_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Version_Read; package API_Version_Group_List is new Swagger.Servers.Operation (Handler => Version_Group_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/version-group/"); -- procedure Version_Group_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Impl.Version_Group_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Version_Group_List; package API_Version_Group_Read is new Swagger.Servers.Operation (Handler => Version_Group_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/version-group/{id}/"); -- procedure Version_Group_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Impl.Version_Group_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Version_Group_Read; procedure Register (Server : in out Swagger.Servers.Application_Type'Class) is begin Swagger.Servers.Register (Server, API_Ability_List.Definition); Swagger.Servers.Register (Server, API_Ability_Read.Definition); Swagger.Servers.Register (Server, API_Berry_List.Definition); Swagger.Servers.Register (Server, API_Berry_Read.Definition); Swagger.Servers.Register (Server, API_Berry_Firmness_List.Definition); Swagger.Servers.Register (Server, API_Berry_Firmness_Read.Definition); Swagger.Servers.Register (Server, API_Berry_Flavor_List.Definition); Swagger.Servers.Register (Server, API_Berry_Flavor_Read.Definition); Swagger.Servers.Register (Server, API_Characteristic_List.Definition); Swagger.Servers.Register (Server, API_Characteristic_Read.Definition); Swagger.Servers.Register (Server, API_Contest_Effect_List.Definition); Swagger.Servers.Register (Server, API_Contest_Effect_Read.Definition); Swagger.Servers.Register (Server, API_Contest_Type_List.Definition); Swagger.Servers.Register (Server, API_Contest_Type_Read.Definition); Swagger.Servers.Register (Server, API_Egg_Group_List.Definition); Swagger.Servers.Register (Server, API_Egg_Group_Read.Definition); Swagger.Servers.Register (Server, API_Encounter_Condition_List.Definition); Swagger.Servers.Register (Server, API_Encounter_Condition_Read.Definition); Swagger.Servers.Register (Server, API_Encounter_Condition_Value_List.Definition); Swagger.Servers.Register (Server, API_Encounter_Condition_Value_Read.Definition); Swagger.Servers.Register (Server, API_Encounter_Method_List.Definition); Swagger.Servers.Register (Server, API_Encounter_Method_Read.Definition); Swagger.Servers.Register (Server, API_Evolution_Chain_List.Definition); Swagger.Servers.Register (Server, API_Evolution_Chain_Read.Definition); Swagger.Servers.Register (Server, API_Evolution_Trigger_List.Definition); Swagger.Servers.Register (Server, API_Evolution_Trigger_Read.Definition); Swagger.Servers.Register (Server, API_Gender_List.Definition); Swagger.Servers.Register (Server, API_Gender_Read.Definition); Swagger.Servers.Register (Server, API_Generation_List.Definition); Swagger.Servers.Register (Server, API_Generation_Read.Definition); Swagger.Servers.Register (Server, API_Growth_Rate_List.Definition); Swagger.Servers.Register (Server, API_Growth_Rate_Read.Definition); Swagger.Servers.Register (Server, API_Item_List.Definition); Swagger.Servers.Register (Server, API_Item_Read.Definition); Swagger.Servers.Register (Server, API_Item_Attribute_List.Definition); Swagger.Servers.Register (Server, API_Item_Attribute_Read.Definition); Swagger.Servers.Register (Server, API_Item_Category_List.Definition); Swagger.Servers.Register (Server, API_Item_Category_Read.Definition); Swagger.Servers.Register (Server, API_Item_Fling_Effect_List.Definition); Swagger.Servers.Register (Server, API_Item_Fling_Effect_Read.Definition); Swagger.Servers.Register (Server, API_Item_Pocket_List.Definition); Swagger.Servers.Register (Server, API_Item_Pocket_Read.Definition); Swagger.Servers.Register (Server, API_Language_List.Definition); Swagger.Servers.Register (Server, API_Language_Read.Definition); Swagger.Servers.Register (Server, API_Location_List.Definition); Swagger.Servers.Register (Server, API_Location_Read.Definition); Swagger.Servers.Register (Server, API_Location_Area_List.Definition); Swagger.Servers.Register (Server, API_Location_Area_Read.Definition); Swagger.Servers.Register (Server, API_Machine_List.Definition); Swagger.Servers.Register (Server, API_Machine_Read.Definition); Swagger.Servers.Register (Server, API_Move_List.Definition); Swagger.Servers.Register (Server, API_Move_Read.Definition); Swagger.Servers.Register (Server, API_Move_Ailment_List.Definition); Swagger.Servers.Register (Server, API_Move_Ailment_Read.Definition); Swagger.Servers.Register (Server, API_Move_Battle_Style_List.Definition); Swagger.Servers.Register (Server, API_Move_Battle_Style_Read.Definition); Swagger.Servers.Register (Server, API_Move_Category_List.Definition); Swagger.Servers.Register (Server, API_Move_Category_Read.Definition); Swagger.Servers.Register (Server, API_Move_Damage_Class_List.Definition); Swagger.Servers.Register (Server, API_Move_Damage_Class_Read.Definition); Swagger.Servers.Register (Server, API_Move_Learn_Method_List.Definition); Swagger.Servers.Register (Server, API_Move_Learn_Method_Read.Definition); Swagger.Servers.Register (Server, API_Move_Target_List.Definition); Swagger.Servers.Register (Server, API_Move_Target_Read.Definition); Swagger.Servers.Register (Server, API_Nature_List.Definition); Swagger.Servers.Register (Server, API_Nature_Read.Definition); Swagger.Servers.Register (Server, API_Pal_Park_Area_List.Definition); Swagger.Servers.Register (Server, API_Pal_Park_Area_Read.Definition); Swagger.Servers.Register (Server, API_Pokeathlon_Stat_List.Definition); Swagger.Servers.Register (Server, API_Pokeathlon_Stat_Read.Definition); Swagger.Servers.Register (Server, API_Pokedex_List.Definition); Swagger.Servers.Register (Server, API_Pokedex_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Color_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Color_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Form_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Form_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Habitat_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Habitat_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Shape_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Shape_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Species_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Species_Read.Definition); Swagger.Servers.Register (Server, API_Region_List.Definition); Swagger.Servers.Register (Server, API_Region_Read.Definition); Swagger.Servers.Register (Server, API_Stat_List.Definition); Swagger.Servers.Register (Server, API_Stat_Read.Definition); Swagger.Servers.Register (Server, API_Super_Contest_Effect_List.Definition); Swagger.Servers.Register (Server, API_Super_Contest_Effect_Read.Definition); Swagger.Servers.Register (Server, API_Type_List.Definition); Swagger.Servers.Register (Server, API_Type_Read.Definition); Swagger.Servers.Register (Server, API_Version_List.Definition); Swagger.Servers.Register (Server, API_Version_Read.Definition); Swagger.Servers.Register (Server, API_Version_Group_List.Definition); Swagger.Servers.Register (Server, API_Version_Group_Read.Definition); end Register; end Skeleton; package body Shared_Instance is -- procedure Ability_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Ability_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Ability_List; package API_Ability_List is new Swagger.Servers.Operation (Handler => Ability_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/ability/"); -- procedure Ability_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Ability_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Ability_Read; package API_Ability_Read is new Swagger.Servers.Operation (Handler => Ability_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/ability/{id}/"); -- procedure Berry_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Berry_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_List; package API_Berry_List is new Swagger.Servers.Operation (Handler => Berry_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry/"); -- procedure Berry_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Berry_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Read; package API_Berry_Read is new Swagger.Servers.Operation (Handler => Berry_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry/{id}/"); -- procedure Berry_Firmness_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Berry_Firmness_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Firmness_List; package API_Berry_Firmness_List is new Swagger.Servers.Operation (Handler => Berry_Firmness_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry-firmness/"); -- procedure Berry_Firmness_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Berry_Firmness_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Firmness_Read; package API_Berry_Firmness_Read is new Swagger.Servers.Operation (Handler => Berry_Firmness_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry-firmness/{id}/"); -- procedure Berry_Flavor_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Berry_Flavor_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Flavor_List; package API_Berry_Flavor_List is new Swagger.Servers.Operation (Handler => Berry_Flavor_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry-flavor/"); -- procedure Berry_Flavor_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Berry_Flavor_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Berry_Flavor_Read; package API_Berry_Flavor_Read is new Swagger.Servers.Operation (Handler => Berry_Flavor_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/berry-flavor/{id}/"); -- procedure Characteristic_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Characteristic_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Characteristic_List; package API_Characteristic_List is new Swagger.Servers.Operation (Handler => Characteristic_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/characteristic/"); -- procedure Characteristic_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Characteristic_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Characteristic_Read; package API_Characteristic_Read is new Swagger.Servers.Operation (Handler => Characteristic_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/characteristic/{id}/"); -- procedure Contest_Effect_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Contest_Effect_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Contest_Effect_List; package API_Contest_Effect_List is new Swagger.Servers.Operation (Handler => Contest_Effect_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/contest-effect/"); -- procedure Contest_Effect_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Contest_Effect_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Contest_Effect_Read; package API_Contest_Effect_Read is new Swagger.Servers.Operation (Handler => Contest_Effect_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/contest-effect/{id}/"); -- procedure Contest_Type_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Contest_Type_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Contest_Type_List; package API_Contest_Type_List is new Swagger.Servers.Operation (Handler => Contest_Type_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/contest-type/"); -- procedure Contest_Type_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Contest_Type_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Contest_Type_Read; package API_Contest_Type_Read is new Swagger.Servers.Operation (Handler => Contest_Type_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/contest-type/{id}/"); -- procedure Egg_Group_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Egg_Group_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Egg_Group_List; package API_Egg_Group_List is new Swagger.Servers.Operation (Handler => Egg_Group_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/egg-group/"); -- procedure Egg_Group_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Egg_Group_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Egg_Group_Read; package API_Egg_Group_Read is new Swagger.Servers.Operation (Handler => Egg_Group_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/egg-group/{id}/"); -- procedure Encounter_Condition_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Encounter_Condition_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Condition_List; package API_Encounter_Condition_List is new Swagger.Servers.Operation (Handler => Encounter_Condition_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-condition/"); -- procedure Encounter_Condition_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Encounter_Condition_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Condition_Read; package API_Encounter_Condition_Read is new Swagger.Servers.Operation (Handler => Encounter_Condition_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-condition/{id}/"); -- procedure Encounter_Condition_Value_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Encounter_Condition_Value_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Condition_Value_List; package API_Encounter_Condition_Value_List is new Swagger.Servers.Operation (Handler => Encounter_Condition_Value_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-condition-value/"); -- procedure Encounter_Condition_Value_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Encounter_Condition_Value_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Condition_Value_Read; package API_Encounter_Condition_Value_Read is new Swagger.Servers.Operation (Handler => Encounter_Condition_Value_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-condition-value/{id}/"); -- procedure Encounter_Method_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Encounter_Method_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Method_List; package API_Encounter_Method_List is new Swagger.Servers.Operation (Handler => Encounter_Method_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-method/"); -- procedure Encounter_Method_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Encounter_Method_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Encounter_Method_Read; package API_Encounter_Method_Read is new Swagger.Servers.Operation (Handler => Encounter_Method_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/encounter-method/{id}/"); -- procedure Evolution_Chain_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Evolution_Chain_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Evolution_Chain_List; package API_Evolution_Chain_List is new Swagger.Servers.Operation (Handler => Evolution_Chain_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/evolution-chain/"); -- procedure Evolution_Chain_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Evolution_Chain_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Evolution_Chain_Read; package API_Evolution_Chain_Read is new Swagger.Servers.Operation (Handler => Evolution_Chain_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/evolution-chain/{id}/"); -- procedure Evolution_Trigger_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Evolution_Trigger_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Evolution_Trigger_List; package API_Evolution_Trigger_List is new Swagger.Servers.Operation (Handler => Evolution_Trigger_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/evolution-trigger/"); -- procedure Evolution_Trigger_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Evolution_Trigger_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Evolution_Trigger_Read; package API_Evolution_Trigger_Read is new Swagger.Servers.Operation (Handler => Evolution_Trigger_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/evolution-trigger/{id}/"); -- procedure Gender_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Gender_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Gender_List; package API_Gender_List is new Swagger.Servers.Operation (Handler => Gender_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/gender/"); -- procedure Gender_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Gender_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Gender_Read; package API_Gender_Read is new Swagger.Servers.Operation (Handler => Gender_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/gender/{id}/"); -- procedure Generation_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Generation_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Generation_List; package API_Generation_List is new Swagger.Servers.Operation (Handler => Generation_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/generation/"); -- procedure Generation_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Generation_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Generation_Read; package API_Generation_Read is new Swagger.Servers.Operation (Handler => Generation_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/generation/{id}/"); -- procedure Growth_Rate_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Growth_Rate_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Growth_Rate_List; package API_Growth_Rate_List is new Swagger.Servers.Operation (Handler => Growth_Rate_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/growth-rate/"); -- procedure Growth_Rate_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Growth_Rate_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Growth_Rate_Read; package API_Growth_Rate_Read is new Swagger.Servers.Operation (Handler => Growth_Rate_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/growth-rate/{id}/"); -- procedure Item_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Item_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_List; package API_Item_List is new Swagger.Servers.Operation (Handler => Item_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item/"); -- procedure Item_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Item_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Read; package API_Item_Read is new Swagger.Servers.Operation (Handler => Item_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item/{id}/"); -- procedure Item_Attribute_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Item_Attribute_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Attribute_List; package API_Item_Attribute_List is new Swagger.Servers.Operation (Handler => Item_Attribute_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-attribute/"); -- procedure Item_Attribute_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Item_Attribute_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Attribute_Read; package API_Item_Attribute_Read is new Swagger.Servers.Operation (Handler => Item_Attribute_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-attribute/{id}/"); -- procedure Item_Category_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Item_Category_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Category_List; package API_Item_Category_List is new Swagger.Servers.Operation (Handler => Item_Category_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-category/"); -- procedure Item_Category_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Item_Category_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Category_Read; package API_Item_Category_Read is new Swagger.Servers.Operation (Handler => Item_Category_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-category/{id}/"); -- procedure Item_Fling_Effect_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Item_Fling_Effect_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Fling_Effect_List; package API_Item_Fling_Effect_List is new Swagger.Servers.Operation (Handler => Item_Fling_Effect_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-fling-effect/"); -- procedure Item_Fling_Effect_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Item_Fling_Effect_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Fling_Effect_Read; package API_Item_Fling_Effect_Read is new Swagger.Servers.Operation (Handler => Item_Fling_Effect_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-fling-effect/{id}/"); -- procedure Item_Pocket_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Item_Pocket_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Pocket_List; package API_Item_Pocket_List is new Swagger.Servers.Operation (Handler => Item_Pocket_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-pocket/"); -- procedure Item_Pocket_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Item_Pocket_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Item_Pocket_Read; package API_Item_Pocket_Read is new Swagger.Servers.Operation (Handler => Item_Pocket_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/item-pocket/{id}/"); -- procedure Language_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Language_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Language_List; package API_Language_List is new Swagger.Servers.Operation (Handler => Language_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/language/"); -- procedure Language_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Language_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Language_Read; package API_Language_Read is new Swagger.Servers.Operation (Handler => Language_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/language/{id}/"); -- procedure Location_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Location_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Location_List; package API_Location_List is new Swagger.Servers.Operation (Handler => Location_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/location/"); -- procedure Location_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Location_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Location_Read; package API_Location_Read is new Swagger.Servers.Operation (Handler => Location_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/location/{id}/"); -- procedure Location_Area_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Location_Area_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Location_Area_List; package API_Location_Area_List is new Swagger.Servers.Operation (Handler => Location_Area_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/location-area/"); -- procedure Location_Area_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Location_Area_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Location_Area_Read; package API_Location_Area_Read is new Swagger.Servers.Operation (Handler => Location_Area_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/location-area/{id}/"); -- procedure Machine_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Machine_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Machine_List; package API_Machine_List is new Swagger.Servers.Operation (Handler => Machine_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/machine/"); -- procedure Machine_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Machine_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Machine_Read; package API_Machine_Read is new Swagger.Servers.Operation (Handler => Machine_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/machine/{id}/"); -- procedure Move_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Move_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_List; package API_Move_List is new Swagger.Servers.Operation (Handler => Move_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move/"); -- procedure Move_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Move_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Read; package API_Move_Read is new Swagger.Servers.Operation (Handler => Move_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move/{id}/"); -- procedure Move_Ailment_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Move_Ailment_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Ailment_List; package API_Move_Ailment_List is new Swagger.Servers.Operation (Handler => Move_Ailment_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-ailment/"); -- procedure Move_Ailment_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Move_Ailment_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Ailment_Read; package API_Move_Ailment_Read is new Swagger.Servers.Operation (Handler => Move_Ailment_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-ailment/{id}/"); -- procedure Move_Battle_Style_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Move_Battle_Style_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Battle_Style_List; package API_Move_Battle_Style_List is new Swagger.Servers.Operation (Handler => Move_Battle_Style_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-battle-style/"); -- procedure Move_Battle_Style_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Move_Battle_Style_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Battle_Style_Read; package API_Move_Battle_Style_Read is new Swagger.Servers.Operation (Handler => Move_Battle_Style_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-battle-style/{id}/"); -- procedure Move_Category_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Move_Category_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Category_List; package API_Move_Category_List is new Swagger.Servers.Operation (Handler => Move_Category_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-category/"); -- procedure Move_Category_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Move_Category_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Category_Read; package API_Move_Category_Read is new Swagger.Servers.Operation (Handler => Move_Category_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-category/{id}/"); -- procedure Move_Damage_Class_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Move_Damage_Class_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Damage_Class_List; package API_Move_Damage_Class_List is new Swagger.Servers.Operation (Handler => Move_Damage_Class_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-damage-class/"); -- procedure Move_Damage_Class_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Move_Damage_Class_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Damage_Class_Read; package API_Move_Damage_Class_Read is new Swagger.Servers.Operation (Handler => Move_Damage_Class_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-damage-class/{id}/"); -- procedure Move_Learn_Method_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Move_Learn_Method_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Learn_Method_List; package API_Move_Learn_Method_List is new Swagger.Servers.Operation (Handler => Move_Learn_Method_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-learn-method/"); -- procedure Move_Learn_Method_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Move_Learn_Method_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Learn_Method_Read; package API_Move_Learn_Method_Read is new Swagger.Servers.Operation (Handler => Move_Learn_Method_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-learn-method/{id}/"); -- procedure Move_Target_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Move_Target_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Target_List; package API_Move_Target_List is new Swagger.Servers.Operation (Handler => Move_Target_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-target/"); -- procedure Move_Target_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Move_Target_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Move_Target_Read; package API_Move_Target_Read is new Swagger.Servers.Operation (Handler => Move_Target_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/move-target/{id}/"); -- procedure Nature_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Nature_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Nature_List; package API_Nature_List is new Swagger.Servers.Operation (Handler => Nature_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/nature/"); -- procedure Nature_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Nature_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Nature_Read; package API_Nature_Read is new Swagger.Servers.Operation (Handler => Nature_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/nature/{id}/"); -- procedure Pal_Park_Area_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pal_Park_Area_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pal_Park_Area_List; package API_Pal_Park_Area_List is new Swagger.Servers.Operation (Handler => Pal_Park_Area_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pal-park-area/"); -- procedure Pal_Park_Area_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pal_Park_Area_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pal_Park_Area_Read; package API_Pal_Park_Area_Read is new Swagger.Servers.Operation (Handler => Pal_Park_Area_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pal-park-area/{id}/"); -- procedure Pokeathlon_Stat_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pokeathlon_Stat_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokeathlon_Stat_List; package API_Pokeathlon_Stat_List is new Swagger.Servers.Operation (Handler => Pokeathlon_Stat_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokeathlon-stat/"); -- procedure Pokeathlon_Stat_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pokeathlon_Stat_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokeathlon_Stat_Read; package API_Pokeathlon_Stat_Read is new Swagger.Servers.Operation (Handler => Pokeathlon_Stat_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokeathlon-stat/{id}/"); -- procedure Pokedex_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pokedex_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokedex_List; package API_Pokedex_List is new Swagger.Servers.Operation (Handler => Pokedex_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokedex/"); -- procedure Pokedex_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pokedex_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokedex_Read; package API_Pokedex_Read is new Swagger.Servers.Operation (Handler => Pokedex_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokedex/{id}/"); -- procedure Pokemon_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pokemon_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_List; package API_Pokemon_List is new Swagger.Servers.Operation (Handler => Pokemon_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon/"); -- procedure Pokemon_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pokemon_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Read; package API_Pokemon_Read is new Swagger.Servers.Operation (Handler => Pokemon_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon/{id}/"); -- procedure Pokemon_Color_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pokemon_Color_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Color_List; package API_Pokemon_Color_List is new Swagger.Servers.Operation (Handler => Pokemon_Color_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-color/"); -- procedure Pokemon_Color_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pokemon_Color_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Color_Read; package API_Pokemon_Color_Read is new Swagger.Servers.Operation (Handler => Pokemon_Color_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-color/{id}/"); -- procedure Pokemon_Form_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pokemon_Form_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Form_List; package API_Pokemon_Form_List is new Swagger.Servers.Operation (Handler => Pokemon_Form_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-form/"); -- procedure Pokemon_Form_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pokemon_Form_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Form_Read; package API_Pokemon_Form_Read is new Swagger.Servers.Operation (Handler => Pokemon_Form_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-form/{id}/"); -- procedure Pokemon_Habitat_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pokemon_Habitat_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Habitat_List; package API_Pokemon_Habitat_List is new Swagger.Servers.Operation (Handler => Pokemon_Habitat_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-habitat/"); -- procedure Pokemon_Habitat_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pokemon_Habitat_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Habitat_Read; package API_Pokemon_Habitat_Read is new Swagger.Servers.Operation (Handler => Pokemon_Habitat_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-habitat/{id}/"); -- procedure Pokemon_Shape_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pokemon_Shape_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Shape_List; package API_Pokemon_Shape_List is new Swagger.Servers.Operation (Handler => Pokemon_Shape_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-shape/"); -- procedure Pokemon_Shape_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pokemon_Shape_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Shape_Read; package API_Pokemon_Shape_Read is new Swagger.Servers.Operation (Handler => Pokemon_Shape_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-shape/{id}/"); -- procedure Pokemon_Species_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Pokemon_Species_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Species_List; package API_Pokemon_Species_List is new Swagger.Servers.Operation (Handler => Pokemon_Species_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-species/"); -- procedure Pokemon_Species_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Pokemon_Species_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Pokemon_Species_Read; package API_Pokemon_Species_Read is new Swagger.Servers.Operation (Handler => Pokemon_Species_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/pokemon-species/{id}/"); -- procedure Region_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Region_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Region_List; package API_Region_List is new Swagger.Servers.Operation (Handler => Region_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/region/"); -- procedure Region_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Region_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Region_Read; package API_Region_Read is new Swagger.Servers.Operation (Handler => Region_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/region/{id}/"); -- procedure Stat_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Stat_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Stat_List; package API_Stat_List is new Swagger.Servers.Operation (Handler => Stat_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/stat/"); -- procedure Stat_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Stat_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Stat_Read; package API_Stat_Read is new Swagger.Servers.Operation (Handler => Stat_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/stat/{id}/"); -- procedure Super_Contest_Effect_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Super_Contest_Effect_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Super_Contest_Effect_List; package API_Super_Contest_Effect_List is new Swagger.Servers.Operation (Handler => Super_Contest_Effect_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/super-contest-effect/"); -- procedure Super_Contest_Effect_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Super_Contest_Effect_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Super_Contest_Effect_Read; package API_Super_Contest_Effect_Read is new Swagger.Servers.Operation (Handler => Super_Contest_Effect_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/super-contest-effect/{id}/"); -- procedure Type_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Type_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Type_List; package API_Type_List is new Swagger.Servers.Operation (Handler => Type_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/type/"); -- procedure Type_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Type_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Type_Read; package API_Type_Read is new Swagger.Servers.Operation (Handler => Type_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/type/{id}/"); -- procedure Version_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Version_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Version_List; package API_Version_List is new Swagger.Servers.Operation (Handler => Version_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/version/"); -- procedure Version_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Version_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Version_Read; package API_Version_Read is new Swagger.Servers.Operation (Handler => Version_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/version/{id}/"); -- procedure Version_Group_List (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Limit : Swagger.Nullable_Integer; Offset : Swagger.Nullable_Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Query_Parameter (Req, "limit", Limit); Swagger.Servers.Get_Query_Parameter (Req, "offset", Offset); Server.Version_Group_List (Limit, Offset, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Version_Group_List; package API_Version_Group_List is new Swagger.Servers.Operation (Handler => Version_Group_List, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/version-group/"); -- procedure Version_Group_Read (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Id : Integer; Result : Swagger.UString; begin Swagger.Servers.Get_Path_Parameter (Req, 1, Id); Server.Version_Group_Read (Id, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; Swagger.Streams.Serialize (Stream, "", Result); Stream.End_Document; end if; end Version_Group_Read; package API_Version_Group_Read is new Swagger.Servers.Operation (Handler => Version_Group_Read, Method => Swagger.Servers.GET, URI => URI_Prefix & "/api/v2/version-group/{id}/"); procedure Register (Server : in out Swagger.Servers.Application_Type'Class) is begin Swagger.Servers.Register (Server, API_Ability_List.Definition); Swagger.Servers.Register (Server, API_Ability_Read.Definition); Swagger.Servers.Register (Server, API_Berry_List.Definition); Swagger.Servers.Register (Server, API_Berry_Read.Definition); Swagger.Servers.Register (Server, API_Berry_Firmness_List.Definition); Swagger.Servers.Register (Server, API_Berry_Firmness_Read.Definition); Swagger.Servers.Register (Server, API_Berry_Flavor_List.Definition); Swagger.Servers.Register (Server, API_Berry_Flavor_Read.Definition); Swagger.Servers.Register (Server, API_Characteristic_List.Definition); Swagger.Servers.Register (Server, API_Characteristic_Read.Definition); Swagger.Servers.Register (Server, API_Contest_Effect_List.Definition); Swagger.Servers.Register (Server, API_Contest_Effect_Read.Definition); Swagger.Servers.Register (Server, API_Contest_Type_List.Definition); Swagger.Servers.Register (Server, API_Contest_Type_Read.Definition); Swagger.Servers.Register (Server, API_Egg_Group_List.Definition); Swagger.Servers.Register (Server, API_Egg_Group_Read.Definition); Swagger.Servers.Register (Server, API_Encounter_Condition_List.Definition); Swagger.Servers.Register (Server, API_Encounter_Condition_Read.Definition); Swagger.Servers.Register (Server, API_Encounter_Condition_Value_List.Definition); Swagger.Servers.Register (Server, API_Encounter_Condition_Value_Read.Definition); Swagger.Servers.Register (Server, API_Encounter_Method_List.Definition); Swagger.Servers.Register (Server, API_Encounter_Method_Read.Definition); Swagger.Servers.Register (Server, API_Evolution_Chain_List.Definition); Swagger.Servers.Register (Server, API_Evolution_Chain_Read.Definition); Swagger.Servers.Register (Server, API_Evolution_Trigger_List.Definition); Swagger.Servers.Register (Server, API_Evolution_Trigger_Read.Definition); Swagger.Servers.Register (Server, API_Gender_List.Definition); Swagger.Servers.Register (Server, API_Gender_Read.Definition); Swagger.Servers.Register (Server, API_Generation_List.Definition); Swagger.Servers.Register (Server, API_Generation_Read.Definition); Swagger.Servers.Register (Server, API_Growth_Rate_List.Definition); Swagger.Servers.Register (Server, API_Growth_Rate_Read.Definition); Swagger.Servers.Register (Server, API_Item_List.Definition); Swagger.Servers.Register (Server, API_Item_Read.Definition); Swagger.Servers.Register (Server, API_Item_Attribute_List.Definition); Swagger.Servers.Register (Server, API_Item_Attribute_Read.Definition); Swagger.Servers.Register (Server, API_Item_Category_List.Definition); Swagger.Servers.Register (Server, API_Item_Category_Read.Definition); Swagger.Servers.Register (Server, API_Item_Fling_Effect_List.Definition); Swagger.Servers.Register (Server, API_Item_Fling_Effect_Read.Definition); Swagger.Servers.Register (Server, API_Item_Pocket_List.Definition); Swagger.Servers.Register (Server, API_Item_Pocket_Read.Definition); Swagger.Servers.Register (Server, API_Language_List.Definition); Swagger.Servers.Register (Server, API_Language_Read.Definition); Swagger.Servers.Register (Server, API_Location_List.Definition); Swagger.Servers.Register (Server, API_Location_Read.Definition); Swagger.Servers.Register (Server, API_Location_Area_List.Definition); Swagger.Servers.Register (Server, API_Location_Area_Read.Definition); Swagger.Servers.Register (Server, API_Machine_List.Definition); Swagger.Servers.Register (Server, API_Machine_Read.Definition); Swagger.Servers.Register (Server, API_Move_List.Definition); Swagger.Servers.Register (Server, API_Move_Read.Definition); Swagger.Servers.Register (Server, API_Move_Ailment_List.Definition); Swagger.Servers.Register (Server, API_Move_Ailment_Read.Definition); Swagger.Servers.Register (Server, API_Move_Battle_Style_List.Definition); Swagger.Servers.Register (Server, API_Move_Battle_Style_Read.Definition); Swagger.Servers.Register (Server, API_Move_Category_List.Definition); Swagger.Servers.Register (Server, API_Move_Category_Read.Definition); Swagger.Servers.Register (Server, API_Move_Damage_Class_List.Definition); Swagger.Servers.Register (Server, API_Move_Damage_Class_Read.Definition); Swagger.Servers.Register (Server, API_Move_Learn_Method_List.Definition); Swagger.Servers.Register (Server, API_Move_Learn_Method_Read.Definition); Swagger.Servers.Register (Server, API_Move_Target_List.Definition); Swagger.Servers.Register (Server, API_Move_Target_Read.Definition); Swagger.Servers.Register (Server, API_Nature_List.Definition); Swagger.Servers.Register (Server, API_Nature_Read.Definition); Swagger.Servers.Register (Server, API_Pal_Park_Area_List.Definition); Swagger.Servers.Register (Server, API_Pal_Park_Area_Read.Definition); Swagger.Servers.Register (Server, API_Pokeathlon_Stat_List.Definition); Swagger.Servers.Register (Server, API_Pokeathlon_Stat_Read.Definition); Swagger.Servers.Register (Server, API_Pokedex_List.Definition); Swagger.Servers.Register (Server, API_Pokedex_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Color_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Color_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Form_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Form_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Habitat_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Habitat_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Shape_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Shape_Read.Definition); Swagger.Servers.Register (Server, API_Pokemon_Species_List.Definition); Swagger.Servers.Register (Server, API_Pokemon_Species_Read.Definition); Swagger.Servers.Register (Server, API_Region_List.Definition); Swagger.Servers.Register (Server, API_Region_Read.Definition); Swagger.Servers.Register (Server, API_Stat_List.Definition); Swagger.Servers.Register (Server, API_Stat_Read.Definition); Swagger.Servers.Register (Server, API_Super_Contest_Effect_List.Definition); Swagger.Servers.Register (Server, API_Super_Contest_Effect_Read.Definition); Swagger.Servers.Register (Server, API_Type_List.Definition); Swagger.Servers.Register (Server, API_Type_Read.Definition); Swagger.Servers.Register (Server, API_Version_List.Definition); Swagger.Servers.Register (Server, API_Version_Read.Definition); Swagger.Servers.Register (Server, API_Version_Group_List.Definition); Swagger.Servers.Register (Server, API_Version_Group_Read.Definition); end Register; protected body Server is -- procedure Ability_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Ability_List (Limit, Offset, Result, Context); end Ability_List; -- procedure Ability_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Ability_Read (Id, Result, Context); end Ability_Read; -- procedure Berry_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Berry_List (Limit, Offset, Result, Context); end Berry_List; -- procedure Berry_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Berry_Read (Id, Result, Context); end Berry_Read; -- procedure Berry_Firmness_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Berry_Firmness_List (Limit, Offset, Result, Context); end Berry_Firmness_List; -- procedure Berry_Firmness_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Berry_Firmness_Read (Id, Result, Context); end Berry_Firmness_Read; -- procedure Berry_Flavor_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Berry_Flavor_List (Limit, Offset, Result, Context); end Berry_Flavor_List; -- procedure Berry_Flavor_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Berry_Flavor_Read (Id, Result, Context); end Berry_Flavor_Read; -- procedure Characteristic_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Characteristic_List (Limit, Offset, Result, Context); end Characteristic_List; -- procedure Characteristic_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Characteristic_Read (Id, Result, Context); end Characteristic_Read; -- procedure Contest_Effect_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Contest_Effect_List (Limit, Offset, Result, Context); end Contest_Effect_List; -- procedure Contest_Effect_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Contest_Effect_Read (Id, Result, Context); end Contest_Effect_Read; -- procedure Contest_Type_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Contest_Type_List (Limit, Offset, Result, Context); end Contest_Type_List; -- procedure Contest_Type_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Contest_Type_Read (Id, Result, Context); end Contest_Type_Read; -- procedure Egg_Group_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Egg_Group_List (Limit, Offset, Result, Context); end Egg_Group_List; -- procedure Egg_Group_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Egg_Group_Read (Id, Result, Context); end Egg_Group_Read; -- procedure Encounter_Condition_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Encounter_Condition_List (Limit, Offset, Result, Context); end Encounter_Condition_List; -- procedure Encounter_Condition_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Encounter_Condition_Read (Id, Result, Context); end Encounter_Condition_Read; -- procedure Encounter_Condition_Value_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Encounter_Condition_Value_List (Limit, Offset, Result, Context); end Encounter_Condition_Value_List; -- procedure Encounter_Condition_Value_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Encounter_Condition_Value_Read (Id, Result, Context); end Encounter_Condition_Value_Read; -- procedure Encounter_Method_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Encounter_Method_List (Limit, Offset, Result, Context); end Encounter_Method_List; -- procedure Encounter_Method_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Encounter_Method_Read (Id, Result, Context); end Encounter_Method_Read; -- procedure Evolution_Chain_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Evolution_Chain_List (Limit, Offset, Result, Context); end Evolution_Chain_List; -- procedure Evolution_Chain_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Evolution_Chain_Read (Id, Result, Context); end Evolution_Chain_Read; -- procedure Evolution_Trigger_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Evolution_Trigger_List (Limit, Offset, Result, Context); end Evolution_Trigger_List; -- procedure Evolution_Trigger_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Evolution_Trigger_Read (Id, Result, Context); end Evolution_Trigger_Read; -- procedure Gender_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Gender_List (Limit, Offset, Result, Context); end Gender_List; -- procedure Gender_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Gender_Read (Id, Result, Context); end Gender_Read; -- procedure Generation_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Generation_List (Limit, Offset, Result, Context); end Generation_List; -- procedure Generation_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Generation_Read (Id, Result, Context); end Generation_Read; -- procedure Growth_Rate_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Growth_Rate_List (Limit, Offset, Result, Context); end Growth_Rate_List; -- procedure Growth_Rate_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Growth_Rate_Read (Id, Result, Context); end Growth_Rate_Read; -- procedure Item_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_List (Limit, Offset, Result, Context); end Item_List; -- procedure Item_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Read (Id, Result, Context); end Item_Read; -- procedure Item_Attribute_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Attribute_List (Limit, Offset, Result, Context); end Item_Attribute_List; -- procedure Item_Attribute_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Attribute_Read (Id, Result, Context); end Item_Attribute_Read; -- procedure Item_Category_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Category_List (Limit, Offset, Result, Context); end Item_Category_List; -- procedure Item_Category_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Category_Read (Id, Result, Context); end Item_Category_Read; -- procedure Item_Fling_Effect_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Fling_Effect_List (Limit, Offset, Result, Context); end Item_Fling_Effect_List; -- procedure Item_Fling_Effect_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Fling_Effect_Read (Id, Result, Context); end Item_Fling_Effect_Read; -- procedure Item_Pocket_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Pocket_List (Limit, Offset, Result, Context); end Item_Pocket_List; -- procedure Item_Pocket_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Item_Pocket_Read (Id, Result, Context); end Item_Pocket_Read; -- procedure Language_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Language_List (Limit, Offset, Result, Context); end Language_List; -- procedure Language_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Language_Read (Id, Result, Context); end Language_Read; -- procedure Location_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Location_List (Limit, Offset, Result, Context); end Location_List; -- procedure Location_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Location_Read (Id, Result, Context); end Location_Read; -- procedure Location_Area_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Location_Area_List (Limit, Offset, Result, Context); end Location_Area_List; -- procedure Location_Area_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Location_Area_Read (Id, Result, Context); end Location_Area_Read; -- procedure Machine_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Machine_List (Limit, Offset, Result, Context); end Machine_List; -- procedure Machine_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Machine_Read (Id, Result, Context); end Machine_Read; -- procedure Move_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_List (Limit, Offset, Result, Context); end Move_List; -- procedure Move_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Read (Id, Result, Context); end Move_Read; -- procedure Move_Ailment_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Ailment_List (Limit, Offset, Result, Context); end Move_Ailment_List; -- procedure Move_Ailment_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Ailment_Read (Id, Result, Context); end Move_Ailment_Read; -- procedure Move_Battle_Style_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Battle_Style_List (Limit, Offset, Result, Context); end Move_Battle_Style_List; -- procedure Move_Battle_Style_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Battle_Style_Read (Id, Result, Context); end Move_Battle_Style_Read; -- procedure Move_Category_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Category_List (Limit, Offset, Result, Context); end Move_Category_List; -- procedure Move_Category_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Category_Read (Id, Result, Context); end Move_Category_Read; -- procedure Move_Damage_Class_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Damage_Class_List (Limit, Offset, Result, Context); end Move_Damage_Class_List; -- procedure Move_Damage_Class_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Damage_Class_Read (Id, Result, Context); end Move_Damage_Class_Read; -- procedure Move_Learn_Method_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Learn_Method_List (Limit, Offset, Result, Context); end Move_Learn_Method_List; -- procedure Move_Learn_Method_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Learn_Method_Read (Id, Result, Context); end Move_Learn_Method_Read; -- procedure Move_Target_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Target_List (Limit, Offset, Result, Context); end Move_Target_List; -- procedure Move_Target_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Move_Target_Read (Id, Result, Context); end Move_Target_Read; -- procedure Nature_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Nature_List (Limit, Offset, Result, Context); end Nature_List; -- procedure Nature_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Nature_Read (Id, Result, Context); end Nature_Read; -- procedure Pal_Park_Area_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pal_Park_Area_List (Limit, Offset, Result, Context); end Pal_Park_Area_List; -- procedure Pal_Park_Area_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pal_Park_Area_Read (Id, Result, Context); end Pal_Park_Area_Read; -- procedure Pokeathlon_Stat_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokeathlon_Stat_List (Limit, Offset, Result, Context); end Pokeathlon_Stat_List; -- procedure Pokeathlon_Stat_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokeathlon_Stat_Read (Id, Result, Context); end Pokeathlon_Stat_Read; -- procedure Pokedex_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokedex_List (Limit, Offset, Result, Context); end Pokedex_List; -- procedure Pokedex_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokedex_Read (Id, Result, Context); end Pokedex_Read; -- procedure Pokemon_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_List (Limit, Offset, Result, Context); end Pokemon_List; -- procedure Pokemon_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Read (Id, Result, Context); end Pokemon_Read; -- procedure Pokemon_Color_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Color_List (Limit, Offset, Result, Context); end Pokemon_Color_List; -- procedure Pokemon_Color_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Color_Read (Id, Result, Context); end Pokemon_Color_Read; -- procedure Pokemon_Form_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Form_List (Limit, Offset, Result, Context); end Pokemon_Form_List; -- procedure Pokemon_Form_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Form_Read (Id, Result, Context); end Pokemon_Form_Read; -- procedure Pokemon_Habitat_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Habitat_List (Limit, Offset, Result, Context); end Pokemon_Habitat_List; -- procedure Pokemon_Habitat_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Habitat_Read (Id, Result, Context); end Pokemon_Habitat_Read; -- procedure Pokemon_Shape_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Shape_List (Limit, Offset, Result, Context); end Pokemon_Shape_List; -- procedure Pokemon_Shape_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Shape_Read (Id, Result, Context); end Pokemon_Shape_Read; -- procedure Pokemon_Species_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Species_List (Limit, Offset, Result, Context); end Pokemon_Species_List; -- procedure Pokemon_Species_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Pokemon_Species_Read (Id, Result, Context); end Pokemon_Species_Read; -- procedure Region_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Region_List (Limit, Offset, Result, Context); end Region_List; -- procedure Region_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Region_Read (Id, Result, Context); end Region_Read; -- procedure Stat_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Stat_List (Limit, Offset, Result, Context); end Stat_List; -- procedure Stat_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Stat_Read (Id, Result, Context); end Stat_Read; -- procedure Super_Contest_Effect_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Super_Contest_Effect_List (Limit, Offset, Result, Context); end Super_Contest_Effect_List; -- procedure Super_Contest_Effect_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Super_Contest_Effect_Read (Id, Result, Context); end Super_Contest_Effect_Read; -- procedure Type_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Type_List (Limit, Offset, Result, Context); end Type_List; -- procedure Type_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Type_Read (Id, Result, Context); end Type_Read; -- procedure Version_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Version_List (Limit, Offset, Result, Context); end Version_List; -- procedure Version_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Version_Read (Id, Result, Context); end Version_Read; -- procedure Version_Group_List (Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Version_Group_List (Limit, Offset, Result, Context); end Version_Group_List; -- procedure Version_Group_Read (Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin Impl.Version_Group_Read (Id, Result, Context); end Version_Group_Read; end Server; end Shared_Instance; end .Skeletons;
-- //////////////////////////////////////////////////////////// -- // -- // SFML - Simple and Fast Multimedia Library -- // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com) -- // -- // 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. -- // -- //////////////////////////////////////////////////////////// -- //////////////////////////////////////////////////////////// -- // Headers -- //////////////////////////////////////////////////////////// with Sf.Config; with Sf.Network.IPAddress; with Sf.Network.SocketStatus; with Sf.Network.Types; package Sf.Network.SocketUDP is use Sf.Config; use Sf.Network.IPAddress; use Sf.Network.SocketStatus; use Sf.Network.Types; -- //////////////////////////////////////////////////////////// -- /// Construct a new UDP socket -- /// -- /// \return Pointer to the new socket -- /// -- //////////////////////////////////////////////////////////// function sfSocketUDP_Create return sfSocketUDP_Ptr; -- //////////////////////////////////////////////////////////// -- /// Destroy an existing UDP socket -- /// -- /// \param Socket : Socket to destroy -- /// -- //////////////////////////////////////////////////////////// procedure sfSocketUDP_Destroy (Socket : sfSocketUDP_Ptr); -- //////////////////////////////////////////////////////////// -- /// Change the blocking state of a UDP socket. -- /// The default behaviour of a socket is blocking -- /// -- /// \param Socket : Socket to modify -- /// \param Blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking -- /// -- //////////////////////////////////////////////////////////// procedure sfSocketUDP_SetBlocking (Socket : sfSocketUDP_Ptr; Blocking : sfBool); -- //////////////////////////////////////////////////////////// -- /// Bind a socket to a specific port -- /// -- /// \param Socket : Socket to bind -- /// \param Port : Port to bind the socket to -- /// -- /// \return True if operation has been successful -- /// -- //////////////////////////////////////////////////////////// function sfSocketUDP_Bind (Socket : sfSocketUDP_Ptr; Port : sfUint16) return sfBool; -- //////////////////////////////////////////////////////////// -- /// Unbind a socket from its previous port, if any -- /// -- /// \param Socket : Socket to unbind -- /// -- /// \return sfTrue if operation has been successful -- /// -- //////////////////////////////////////////////////////////// function sfSocketUDP_Unbind (Socket : sfSocketUDP_Ptr) return sfBool; -- //////////////////////////////////////////////////////////// -- /// Send an array of bytes -- /// -- /// \param Socket : Socket to use for sending -- /// \param Data : Pointer to the bytes to send -- /// \param Size : Number of bytes to send -- /// \param Address : Address of the computer to send the packet to -- /// \param Port : Port to use for communication -- /// -- /// \return Socket status -- /// -- //////////////////////////////////////////////////////////// function sfSocketUDP_Send (Socket : sfSocketUDP_Ptr; Data : sfInt8_Ptr; Size : sfSize_t; Address : sfIPAddress; Port : sfUint16) return sfSocketStatus; -- //////////////////////////////////////////////////////////// -- /// Receive an array of bytes. -- /// This function is blocking, ie. it won't return before some -- /// bytes have been received -- /// -- /// \param Socket : Socket to use for receiving -- /// \param Data : Pointer to a byte array to fill (make sure it is big enough) -- /// \param MaxSize : Maximum number of bytes to read -- /// \param SizeReceived : Number of bytes received -- /// \param Address : Address of the computer which sent the data -- /// \param Port : Port on which the remote computer sent the data -- /// -- /// \return Socket status -- /// -- //////////////////////////////////////////////////////////// function sfSocketUDP_Receive (Socket : sfSocketUDP_Ptr; Data : sfInt8_Ptr; MaxSize : sfSize_t; SizeReceived : access sfSize_t; Address : access sfIPAddress; Port : access sfUint16) return sfSocketStatus; -- //////////////////////////////////////////////////////////// -- /// Send a packet of data -- /// -- /// \param Socket : Socket to use for sending -- /// \param Packet : Packet to send -- /// \param Address : Address of the computer to send the packet to -- /// \param Port : Port to use for communication -- /// -- /// \return Socket status -- /// -- //////////////////////////////////////////////////////////// function sfSocketUDP_SendPacket (Socket : sfSocketUDP_Ptr; Packet : sfPacket_Ptr; Address : sfIPAddress; Port : sfUint16) return sfSocketStatus; -- //////////////////////////////////////////////////////////// -- /// Receive a packet. -- /// This function is blocking, ie. it won't return before a -- /// packet is received -- /// -- /// \param Socket : Socket to use for receiving -- /// \param Packet : Packet to fill with received data -- /// \param Address : Address of the computer which sent the packet -- /// \param Port : Port on which the remote computer sent the data -- /// -- /// \return Socket status -- /// -- //////////////////////////////////////////////////////////// function sfSocketUDP_ReceivePacket (Socket : sfSocketUDP_Ptr; Packet : sfPacket_Ptr; Address : access sfIPAddress; Port : access sfUint16) return sfSocketStatus; -- //////////////////////////////////////////////////////////// -- /// Check if a socket is in a valid state ; this function -- /// can be called any time to check if the socket is OK -- /// -- /// \param Socket : Socket to check -- /// -- /// \return sfTrue if the socket is valid -- /// -- //////////////////////////////////////////////////////////// function sfSocketUDP_IsValid (Socket : sfSocketUDP_Ptr) return sfBool; private pragma Import (C, sfSocketUDP_Create, "sfSocketUDP_Create"); pragma Import (C, sfSocketUDP_Destroy, "sfSocketUDP_Destroy"); pragma Import (C, sfSocketUDP_SetBlocking, "sfSocketUDP_SetBlocking"); pragma Import (C, sfSocketUDP_Bind, "sfSocketUDP_Bind"); pragma Import (C, sfSocketUDP_Unbind, "sfSocketUDP_Unbind"); pragma Import (C, sfSocketUDP_Send, "sfSocketUDP_Send"); pragma Import (C, sfSocketUDP_Receive, "sfSocketUDP_Receive"); pragma Import (C, sfSocketUDP_SendPacket, "sfSocketUDP_SendPacket"); pragma Import (C, sfSocketUDP_ReceivePacket, "sfSocketUDP_ReceivePacket"); pragma Import (C, sfSocketUDP_IsValid, "sfSocketUDP_IsValid"); end Sf.Network.SocketUDP;
with System.Address_To_Constant_Access_Conversions; with System.Address_To_Named_Access_Conversions; package body System.Zero_Terminated_Strings is pragma Suppress (All_Checks); use type C.size_t; function strlen (s : not null access constant C.char) return C.size_t with Import, Convention => Intrinsic, External_Name => "__builtin_strlen"; procedure memcpy (s1, s2 : Address; n : C.size_t) with Import, Convention => Intrinsic, External_Name => "__builtin_memcpy"; -- implementation function Value (Item : not null access constant C.char) return String is begin return Value (Item, strlen (Item)); end Value; function Value (Item : not null access constant C.char; Length : C.size_t) return String is type char_const_ptr is access constant C.char -- local type with Convention => C; for char_const_ptr'Storage_Size use 0; package Conv is new Address_To_Constant_Access_Conversions (C.char, char_const_ptr); Item_All : String (1 .. Natural (Length)); for Item_All'Address use Conv.To_Address (char_const_ptr (Item)); begin return Item_All; end Value; procedure To_C (Source : String; Result : not null access C.char) is Dummy : C.size_t; begin To_C (Source, Result, Dummy); end To_C; procedure To_C ( Source : String; Result : not null access C.char; Result_Length : out C.size_t) is begin -- Source and Result should not be overlapped Result_Length := Source'Length; declare type char_ptr is access all C.char -- local type with Convention => C; for char_ptr'Storage_Size use 0; package Conv is new Address_To_Named_Access_Conversions (C.char, char_ptr); Result_All : aliased C.char_array (0 .. Result_Length); for Result_All'Address use Conv.To_Address (char_ptr (Result)); begin memcpy (Result_All'Address, Source'Address, Result_Length); Result_All (Result_Length) := C.char'Val (0); end; end To_C; end System.Zero_Terminated_Strings;
with Libadalang.Common; use Libadalang.Common; package body Finder is function Find (Node : Ada_Node'Class; P : Pattern) return Match_Pattern_List.Vector is (if P.As_Ada_Node.Kind in Ada_Ada_List then Find_Sub_List (Node, P) else Find_Full (Node, P)); end Finder;
-- @file get_rdate.adb -- @date 7 July 2019 -- @author Chester Gillon -- @brief Example program using GNAT.sockets to get the date from a RFC 868 TCP protocol server -- @details The output as seconds since the Linux epoch can be verified by running: -- $ date -d @`./get_rdate sandy-ubuntu` -- Sun 7 Jul 19:42:14 BST 2019 with Ada.Text_IO; with Ada.Integer_Text_IO; with Ada.Command_Line; with Ada.Strings.Fixed; with Interfaces; use Interfaces; with GNAT.Sockets; procedure Get_RDate is Rdate_Client : GNAT.Sockets.Socket_Type; Address : GNAT.Sockets.Sock_Addr_Type; Channel : GNAT.Sockets.Stream_Access; Rdate_Port : GNAT.Sockets.Port_Type := 37; -- Define am array to receive the rdate time as a big-endian 32-bit number of seconds -- since the epoch of 00:00 (midnight) 1 January 1900 GMT type Rdate_Time_Packet is Array (0..3) of Interfaces.Unsigned_8; Raw_Time : Rdate_Time_Packet; Host_Rdate_Time : Interfaces.Unsigned_32; -- From RFC 868 Rdate_To_Linux_Epoch_Seconds : constant := 2208988800; Time_Since_Linux_Epoch : Interfaces.Unsigned_32; begin if Ada.Command_Line.Argument_Count /= 1 then Ada.Text_IO.Put_Line ("Usage: " & Ada.Command_Line.Command_Name & "get_rdate <rdate_server>"); return; end if; declare Rdate_Server : constant String := Ada.Command_Line.Argument (1); begin -- Connect to the specified rdate server and retrieve a packet with the time GNAT.Sockets.Initialize; GNAT.Sockets.Create_Socket (Rdate_Client); Address.Addr := GNAT.Sockets.Addresses (GNAT.Sockets.Get_Host_By_Name (Rdate_Server)); Address.Port := Rdate_Port; GNAT.Sockets.Connect_Socket (Rdate_Client, Address); Channel := GNAT.Sockets.Stream (Rdate_Client); Rdate_Time_Packet'Read (Channel, Raw_Time); GNAT.Sockets.Close_Socket (Rdate_Client); -- Convert the big-endian received rdate Host_Rdate_Time := Interfaces.Shift_Left (Interfaces.Unsigned_32 (Raw_Time(0)), 24) + Interfaces.Shift_Left (Interfaces.Unsigned_32 (Raw_Time(1)), 16) + Interfaces.Shift_Left (Interfaces.Unsigned_32 (Raw_Time(2)), 8) + Interfaces.Unsigned_32 (Raw_Time(3)); -- Display the time as the number of seconds since the Linux epoch. Time_Since_Linux_Epoch := Host_Rdate_Time - Rdate_To_Linux_Epoch_Seconds; declare Raw_Image : constant String := Interfaces.Unsigned_32'Image (Time_Since_Linux_Epoch); begin Ada.Text_Io.Put (Ada.Strings.Fixed.Trim (Raw_Image, Ada.Strings.Left)); end; end; end Get_Rdate;
----------------------------------------------------------------------- -- wiki-helpers-parser -- Generic procedure for the wiki parser -- Copyright (C) 2016, 2018 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- 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 Wiki.Helpers; with Wiki.Streams; procedure Wiki.Helpers.Parser (Engine : in out Engine_Type; Content : in Element_Type; Doc : in out Wiki.Documents.Document) is type Wide_Input is new Wiki.Streams.Input_Stream with record Pos : Positive; Len : Natural; end record; overriding procedure Read (Buf : in out Wide_Input; Token : out Wiki.Strings.WChar; Is_Eof : out Boolean); procedure Read (Buf : in out Wide_Input; Token : out Wiki.Strings.WChar; Is_Eof : out Boolean) is begin if Buf.Pos <= Buf.Len then Element (Content, Buf.Pos, Token); Is_Eof := False; else Is_Eof := True; Token := Wiki.Helpers.CR; end if; end Read; Buffer : aliased Wide_Input; begin Buffer.Pos := 1; Buffer.Len := Length (Content); Parse (Engine, Buffer'Unchecked_Access, Doc); end Wiki.Helpers.Parser;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017-2018, AdaCore and other contributors -- -- -- -- See github.com/AdaCore/Ada_Drivers_Library/graphs/contributors -- -- for more information -- -- -- -- 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 FE310; with HiFive1.LEDs; use HiFive1.LEDs; with FE310.Time; use FE310.Time; procedure Main is begin -- The SPI flash clock divider should be as small as possible to increase -- the execution speed of instructions that are not yet in the instruction -- cache. FE310.Set_SPI_Flash_Clock_Divider (2); -- Load the internal oscillator factory calibration to be sure it -- oscillates at a known frequency. FE310.Load_Internal_Oscilator_Calibration; -- Use the HiFive1 16 MHz crystal oscillator which is more acurate than the -- internal oscillator. FE310.Use_Crystal_Oscillator; HiFive1.LEDs.Initialize; -- Blinky! loop Turn_On (Red_LED); Delay_S (1); Turn_Off (Red_LED); Turn_On (Green_LED); Delay_S (1); Turn_Off (Green_LED); Turn_On (Blue_LED); Delay_S (1); Turn_Off (Blue_LED); end loop; end Main;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . M A C H I N E _ C O D E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides machine code support, both for intrinsic machine -- operations, and also for machine code statements. See GNAT documentation -- for full details. package System.Machine_Code is pragma Pure; type Asm_Input_Operand is private; type Asm_Output_Operand is private; -- These types are never used directly, they are declared only so that -- the calls to Asm are type correct according to Ada semantic rules. No_Input_Operands : constant Asm_Input_Operand; No_Output_Operands : constant Asm_Output_Operand; type Asm_Input_Operand_List is array (Integer range <>) of Asm_Input_Operand; type Asm_Output_Operand_List is array (Integer range <>) of Asm_Output_Operand; type Asm_Insn is private; -- This type is not used directly. It is declared only so that the -- aggregates used in code statements are type correct by Ada rules. procedure Asm ( Template : String; Outputs : Asm_Output_Operand_List; Inputs : Asm_Input_Operand_List; Clobber : String := ""; Volatile : Boolean := False); procedure Asm ( Template : String; Outputs : Asm_Output_Operand := No_Output_Operands; Inputs : Asm_Input_Operand_List; Clobber : String := ""; Volatile : Boolean := False); procedure Asm ( Template : String; Outputs : Asm_Output_Operand_List; Inputs : Asm_Input_Operand := No_Input_Operands; Clobber : String := ""; Volatile : Boolean := False); procedure Asm ( Template : String; Outputs : Asm_Output_Operand := No_Output_Operands; Inputs : Asm_Input_Operand := No_Input_Operands; Clobber : String := ""; Volatile : Boolean := False); function Asm ( Template : String; Outputs : Asm_Output_Operand_List; Inputs : Asm_Input_Operand_List; Clobber : String := ""; Volatile : Boolean := False) return Asm_Insn; function Asm ( Template : String; Outputs : Asm_Output_Operand := No_Output_Operands; Inputs : Asm_Input_Operand_List; Clobber : String := ""; Volatile : Boolean := False) return Asm_Insn; function Asm ( Template : String; Outputs : Asm_Output_Operand_List; Inputs : Asm_Input_Operand := No_Input_Operands; Clobber : String := ""; Volatile : Boolean := False) return Asm_Insn; function Asm ( Template : String; Outputs : Asm_Output_Operand := No_Output_Operands; Inputs : Asm_Input_Operand := No_Input_Operands; Clobber : String := ""; Volatile : Boolean := False) return Asm_Insn; pragma Import (Intrinsic, Asm); private type Asm_Input_Operand is new Integer; type Asm_Output_Operand is new Integer; type Asm_Insn is new Integer; -- All three of these types are dummy types, to meet the requirements of -- type consistency. No values of these types are ever referenced. No_Input_Operands : constant Asm_Input_Operand := 0; No_Output_Operands : constant Asm_Output_Operand := 0; end System.Machine_Code;
--------------------------------------------------------------------------- -- package Hessenberg -- Copyright (C) 2011-2018 Jonathan S. Parker -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------- generic type Real is digits <>; type Index is range <>; type A_Matrix is array(Index, Index) of Real; package Hessenberg is subtype C_Index is Index; subtype R_Index is Index; function Identity return A_Matrix; -- The input matrix A is transformed with similarity transformations: -- -- A_hessenberg = Q_transpose * A * Q. -- -- The Q's are orthogonal matrices constructed from the products of -- 2 x 2 Givens matrices. -- Q matrix has the same shape as A. procedure Lower_Hessenberg (A : in out A_Matrix; Q : out A_Matrix; Starting_Col : in C_Index := C_Index'First; Final_Col : in C_Index := C_Index'Last; Initial_Q : in A_Matrix := Identity); procedure Upper_Hessenberg (A : in out A_Matrix; Q : out A_Matrix; Starting_Col : in C_Index := C_Index'First; Final_Col : in C_Index := C_Index'Last; Initial_Q : in A_Matrix := Identity); end Hessenberg;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . F I N A L I Z A T I O N _ R O O T -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This unit provides the basic support for controlled (finalizable) types package System.Finalization_Root is pragma Preelaborate; -- The base for types Controlled and Limited_Controlled declared in Ada. -- Finalization. type Root_Controlled is abstract tagged null record; procedure Adjust (Object : in out Root_Controlled); procedure Finalize (Object : in out Root_Controlled); procedure Initialize (Object : in out Root_Controlled); end System.Finalization_Root;
-- Ada regular expression library -- (c) Kristian Klomsten Skordal 2020 <kristian.skordal@wafflemail.net> -- Report bugs and issues on <https://github.com/skordal/ada-regex> with AUnit.Test_Suites; package Regex_Test_Suite is -- Creates the Regex library test suite: function Test_Suite return AUnit.Test_Suites.Access_Test_Suite; end Regex_Test_Suite;
-- { dg-do compile } with Discr23_Pkg; use Discr23_Pkg; package body Discr23 is N : constant Text := Get; function Try (A : in Text) return Text is begin return A; exception when others => return N; end; procedure Dummy is begin null; end; end Discr23;
-- Simple password generator -- Luke A. Guest -- 23/01/10 with Ada.Command_Line; with Ada.Text_IO; with Ada.Numerics.Discrete_Random; with Ada.Characters.Latin_1; procedure Password is package L1 renames Ada.Characters.Latin_1; package Random_Char is new Ada.Numerics.Discrete_Random (Character); Gen : Random_Char.Generator; begin if Ada.Command_Line.Argument_Count /= 1 then Ada.Text_IO.Put_Line (" Usage: password <length>"); Ada.Text_IO.Put_Line (" Creates a random set of characters from the range of [a..zA..Z0..9]"); else declare Current : Character := Character'First; Length : constant Integer := Integer'Value (Ada.Command_Line.Argument (1)); Pass : String (1 .. Length) := (others => L1.Space); Index : Positive := Positive'First; begin Random_Char.Reset (Gen); while Index /= Length loop Current := Random_Char.Random (Gen); if Current in L1.Exclamation .. L1.Solidus | '0' .. '9' | L1.Colon .. L1.Commercial_At | 'A' .. 'Z' | L1.Left_Square_Bracket .. L1.Low_Line | L1.LC_A .. L1.Tilde then Pass (Index) := Current; Index := @ + 1; -- New Ada 2020 feature! end if; end loop; Ada.Text_IO.Put_Line ("Password is: " & Pass); end; end if; end Password;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- M D L L . T O O L S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Interface to externals tools used to build DLL and import libraries package MDLL.Utl is procedure Dlltool (Def_Filename : String; DLL_Name : String; Library : String; Exp_Table : String := ""; Base_File : String := ""; Build_Import : Boolean); -- Run dlltool binary. -- This tools is used to build an import library and an export table procedure Gcc (Output_File : String; Files : Argument_List; Options : Argument_List; Base_File : String := ""; Build_Lib : Boolean := False); -- Run gcc binary procedure Gnatbind (Alis : Argument_List; Args : Argument_List := Null_Argument_List); -- Run gnatbind binary to build the binder program. -- it Runs the command : gnatbind -n alis... to build the binder program. procedure Gnatlink (Ali : String; Args : Argument_List := Null_Argument_List); -- Run gnatlink binary. -- It runs the command : gnatlink ali arg1 arg2... procedure Locate; -- Look for the needed tools in the path and record the full path for each -- one in a variable. end MDLL.Utl;
------------------------------------------------------------------------------ -- -- -- Ada binding for OpenGL/WebGL -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2016-2021, Vadim Godunko <vgodunko@gmail.com> -- -- 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. -- -- -- ------------------------------------------------------------------------------ with OpenGL.Contexts.Internals; --with OpenGL.Renderbuffers.Internals; --with OpenGL.Textures.Internals; package body OpenGL.Framebuffers is use type Web.GL.Rendering_Contexts.WebGL_Rendering_Context; -- use type WebAPI.WebGL.Framebuffers.WebGL_Framebuffer_Access; -- -- ---------- -- -- Bind -- -- ---------- -- -- function Bind (Self : in out OpenGL_Framebuffer'Class) return Boolean is -- begin -- if Self.Context = null -- or Self.Context /= OpenGL.Contexts.Internals.Current_WebGL_Context -- or Self.Framebuffer = null -- then -- return False; -- end if; -- -- Self.Context.Bind_Framebuffer -- (WebAPI.WebGL.Rendering_Contexts.FRAMEBUFFER, Self.Framebuffer); -- -- return True; -- end Bind; -- -- ---------- -- -- Bind -- -- ---------- -- -- procedure Bind (Self : in out OpenGL_Framebuffer'Class) is -- begin -- if not Self.Bind then -- raise Program_Error; -- end if; -- end Bind; ------------ -- Create -- ------------ function Create (Self : in out OpenGL_Framebuffer'Class; Width : Natural; Height : Natural) return Boolean is begin if Self.Context.Is_Null then Self.Context := OpenGL.Contexts.Internals.Current_WebGL_Context; if Self.Context.Is_Null then return False; end if; end if; if Self.Framebuffer.Is_Null then Self.Framebuffer := Self.Context.Create_Framebuffer; if Self.Framebuffer.Is_Null then return False; end if; end if; Self.Context.Bind_Framebuffer (Web.GL.Rendering_Contexts.FRAMEBUFFER, Self.Framebuffer); -- Initialize texture. if Self.Texture.Is_Null then Self.Texture := Self.Context.Create_Texture; if Self.Texture.Is_Null then return False; end if; end if; Self.Context.Bind_Texture (Web.GL.Rendering_Contexts.TEXTURE_2D, Self.Texture); Self.Context.Tex_Parameteri (Web.GL.Rendering_Contexts.TEXTURE_2D, Web.GL.Rendering_Contexts.TEXTURE_MIN_FILTER, Web.GL.Rendering_Contexts.NEAREST); Self.Context.Tex_Parameteri (Web.GL.Rendering_Contexts.TEXTURE_2D, Web.GL.Rendering_Contexts.TEXTURE_MAG_FILTER, Web.GL.Rendering_Contexts.NEAREST); Self.Context.Tex_Parameteri (Web.GL.Rendering_Contexts.TEXTURE_2D, Web.GL.Rendering_Contexts.TEXTURE_WRAP_S, Web.GL.Rendering_Contexts.CLAMP_TO_EDGE); Self.Context.Tex_Parameteri (Web.GL.Rendering_Contexts.TEXTURE_2D, Web.GL.Rendering_Contexts.TEXTURE_WRAP_T, Web.GL.Rendering_Contexts.CLAMP_TO_EDGE); Self.Context.Tex_Image_2D (Web.GL.Rendering_Contexts.TEXTURE_2D, 0, Web.GL.Rendering_Contexts.RGBA, Web.GL.GLsizei (Width), Web.GL.GLsizei (Height), 0, Web.GL.Rendering_Contexts.RGBA, Web.GL.Rendering_Contexts.UNSIGNED_BYTE); Self.Context.Framebuffer_Texture_2D (Web.GL.Rendering_Contexts.FRAMEBUFFER, Web.GL.Rendering_Contexts.COLOR_ATTACHMENT_0, Web.GL.Rendering_Contexts.TEXTURE_2D, Self.Texture, 0); -- unbind texture? -- Initialize renderbuffer. if Self.Renderbuffer.Is_Null then Self.Renderbuffer := Self.Context.Create_Renderbuffer; if Self.Renderbuffer.Is_Null then return False; end if; end if; Self.Context.Bind_Renderbuffer (Web.GL.Rendering_Contexts.RENDERBUFFER, Self.Renderbuffer); Self.Context.Renderbuffer_Storage (Web.GL.Rendering_Contexts.RENDERBUFFER, Web.GL.Rendering_Contexts.DEPTH_STENCIL, Web.GL.Glsizei (Width), Web.GL.Glsizei (Height)); Self.Context.Framebuffer_Renderbuffer (Web.GL.Rendering_Contexts.FRAMEBUFFER, Web.GL.Rendering_Contexts.DEPTH_STENCIL_ATTACHMENT, Web.GL.Rendering_Contexts.RENDERBUFFER, Self.Renderbuffer); -- unbind renderbuffer? -- unbind framebuffer? return True; end Create; ------------ -- Create -- ------------ procedure Create (Self : in out OpenGL_Framebuffer'Class; Width : Natural; Height : Natural) is begin if not Self.Create (Width, Height) then raise Program_Error; end if; end Create; ------------ -- Delete -- ------------ procedure Delete (Self : in out OpenGL_Framebuffer'Class) is begin if Self.Context.Is_Null or Self.Context /= OpenGL.Contexts.Internals.Current_WebGL_Context then return; end if; if not Self.Framebuffer.Is_Null then Self.Context.Delete_Framebuffer (Self.Framebuffer); end if; if not Self.Texture.Is_Null then Self.Context.Delete_Texture (Self.Texture); end if; Self.Texture.Set_Null; Self.Framebuffer.Set_Null; Self.Context.Set_Null; end Delete; -------------- -- Finalize -- -------------- overriding procedure Finalize (Self : in out OpenGL_Framebuffer) is begin Self.Delete; end Finalize; ----------------- -- Read_Pixels -- ----------------- procedure Read_Pixels (Self : in out OpenGL_Framebuffer'Class; X : OpenGL.GLint; Y : OpenGL.GLint; Width : OpenGL.GLsizei; Height : OpenGL.GLsizei; Pixels : System.Address; Size : Interfaces.Unsigned_32) is -- procedure Read_Pixels -- (Self : in out OpenGL_Framebuffer'Class; -- X : OpenGL.GLint; -- Y : OpenGL.GLint; -- Width : OpenGL.GLsizei; -- Height : OpenGL.GLsizei; -- Data : out OpenGL.GLubyte_Vector_4_Array) is begin if Self.Context.Is_Null or Self.Context /= OpenGL.Contexts.Internals.Current_WebGL_Context or Self.Framebuffer.Is_Null then return; end if; Self.Context.Read_Pixels (Web.GL.GLint (X), Web.GL.GLint (Y), Web.GL.GLsizei (Width), Web.GL.GLsizei (Height), Web.GL.Rendering_Contexts.RGBA, Web.GL.Rendering_Contexts.UNSIGNED_BYTE, Pixels, Size); -- Data'Address); end Read_Pixels; -- ------------- -- -- Release -- -- ------------- -- -- procedure Release (Self : in out OpenGL_Framebuffer'Class) is -- begin -- if Self.Context = null -- or Self.Context /= OpenGL.Contexts.Internals.Current_WebGL_Context -- or Self.Framebuffer = null -- then -- return; -- end if; -- -- Self.Context.Bind_Framebuffer -- (WebAPI.WebGL.Rendering_Contexts.FRAMEBUFFER, null); -- end Release; -- -- ---------------------- -- -- Set_Renderbuffer -- -- ---------------------- -- -- procedure Set_Renderbuffer -- (Self : in out OpenGL_Framebuffer'Class; -- Renderbuffer : OpenGL.Renderbuffers.OpenGL_Renderbuffer'Class; -- Attachment : OpenGL.GLenum) is -- begin -- if Self.Context = null -- or Self.Context /= OpenGL.Contexts.Internals.Current_WebGL_Context -- or Self.Framebuffer = null -- then -- return; -- end if; -- -- Self.Context.Framebuffer_Renderbuffer -- (WebAPI.WebGL.Rendering_Contexts.FRAMEBUFFER, -- (case Attachment is -- when OpenGL.GL_COLOR_ATTACHMENT0 => -- WebAPI.WebGL.Rendering_Contexts.COLOR_ATTACHMENT0, -- when OpenGL.GL_DEPTH_ATTACHMENT => -- WebAPI.WebGL.Rendering_Contexts.DEPTH_ATTACHMENT, -- when OpenGL.GL_STENCIL_ATTACHMENT => -- WebAPI.WebGL.Rendering_Contexts.STENCIL_ATTACHMENT, -- when others => -- WebAPI.WebGL.Rendering_Contexts.COLOR_ATTACHMENT0), ---- raise Constraint_Error), -- WebAPI.WebGL.Rendering_Contexts.RENDERBUFFER, -- OpenGL.Renderbuffers.Internals.Get_WebGL_Renderbuffer (Renderbuffer)); -- end Set_Renderbuffer; -- -- ----------------- -- -- Set_Texture -- -- ----------------- -- -- procedure Set_Texture -- (Self : in out OpenGL_Framebuffer'Class; -- Texture : OpenGL.Textures.OpenGL_Texture'Class; -- Attachment : OpenGL.GLenum) is -- begin -- if Self.Context = null -- or Self.Context /= OpenGL.Contexts.Internals.Current_WebGL_Context -- or Self.Framebuffer = null -- then -- return; -- end if; -- -- Self.Context.Framebuffer_Texture_2D -- (WebAPI.WebGL.Rendering_Contexts.FRAMEBUFFER, -- (case Attachment is -- when OpenGL.GL_COLOR_ATTACHMENT0 => -- WebAPI.WebGL.Rendering_Contexts.COLOR_ATTACHMENT0, -- when OpenGL.GL_DEPTH_ATTACHMENT => -- WebAPI.WebGL.Rendering_Contexts.DEPTH_ATTACHMENT, -- when OpenGL.GL_STENCIL_ATTACHMENT => -- WebAPI.WebGL.Rendering_Contexts.STENCIL_ATTACHMENT, -- when others => -- WebAPI.WebGL.Rendering_Contexts.COLOR_ATTACHMENT0), ---- raise Constraint_Error), -- (case Texture.Texture_Type is -- when Texture_2D => -- WebAPI.WebGL.Rendering_Contexts.TEXTURE_2D, -- when Cube_Map_Positive_X => -- WebAPI.WebGL.Rendering_Contexts.TEXTURE_CUBE_MAP_POSITIVE_X, -- when Cube_Map_Negative_X => -- WebAPI.WebGL.Rendering_Contexts.TEXTURE_CUBE_MAP_NEGATIVE_X, -- when Cube_Map_Positive_Y => -- WebAPI.WebGL.Rendering_Contexts.TEXTURE_CUBE_MAP_POSITIVE_Y, -- when Cube_Map_Negative_Y => -- WebAPI.WebGL.Rendering_Contexts.TEXTURE_CUBE_MAP_NEGATIVE_Y, -- when Cube_Map_Positive_Z => -- WebAPI.WebGL.Rendering_Contexts.TEXTURE_CUBE_MAP_POSITIVE_Z, -- when Cube_Map_Negative_Z => -- WebAPI.WebGL.Rendering_Contexts.TEXTURE_CUBE_MAP_NEGATIVE_Z), -- OpenGL.Textures.Internals.Get_WebGL_Texture (Texture), -- 0); -- end Set_Texture; end OpenGL.Framebuffers;
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- Reference Implementation -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019-2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This package implements the Library_Unit type for us in tracking all -- "withed" units across the entire AURA project. This type is intended to act -- as the Element_Type for the Hashed Set declared in the Units.Unit_Sets child -- package with Ada.Containers; with Ada.Containers.Hashed_Sets; with Ada.Strings.Unbounded; with Unit_Names; with Unit_Names.Hash; with Stream_Hashing; with Registrar.Source_Files; package Registrar.Library_Units is use type Unit_Names.Unit_Name; -- Library_Unit_State -- ------------------------ -- The Library_Unit_State pertains to each with'ed library unit in a -- given Unit_Set. An Aquired Library_Unit_Status never regresses to -- Requested. If any Library_Unit cannot be Aquired, AURA fails. type Library_Unit_State is (Requested, -- Unit is needed but not yet Aquired -- -- The Unit has been explicitly withed by any program unit of the AURA -- project, but that Unit was not present in the Set. It is added with -- the Requested State. Available, -- At least one source item for the unit has been entered, indicating -- that the source is available, but has not been compiled. Compiled); -- The library unit has been successfully compiled, or can be "assumed" -- compiled due to having no reverse dependencies. -- Library_Unit_Kind -- ----------------------- -- Library unit kind is used to control compilation, and specifically to -- control binding and linking of the main program/library. If the main -- unit is a package, the binder is instructed that there is "no main -- subprogram" type Library_Unit_Kind is (Unknown, -- For requested Ada units External_Unit, -- Unit is an external dependency Package_Unit, -- Library unit is a package Subprogram_Unit, -- Library unit is a subprogram Subunit); -- This kind is somewhat rare, and is not technically a "library unit", -- but occurs when subunits are nested. In order words, if a Library_Unit -- has this kind, it is itself a subunit of a library unit, which has -- it's own subunits. -- -- Separate_Units are not directly compiled, just as the Subunit_Bodies -- vector ------------------ -- Library_Unit -- ------------------ type Library_Unit is record Name : Unit_Names.Unit_Name; State : Library_Unit_State := Requested; Kind : Library_Unit_Kind := Unknown; Spec_File: Source_Files.Source_File_Access := null; Body_File: Source_Files.Source_File_Access := null; -- Source_Files are limited objects. The intention of any given -- Library_Unit is that each Source_File_Access value is initialized -- with an allocator exactly once, and then used for the life of the -- program (by being entered into the Registry) -- -- Deallocation of these members should never be necessary. -- -- There is some potential for memory leaks with this configuration, -- but that is not likely to be much of a problem given that the AURA -- CLI is designed to run once to completion. -- -- These members should only be allocated by Registrar.Enter_Unit, -- which then passes the new unit to the registry. Subunit_Bodies: Source_Files.Source_File_Vectors.Vector; -- any subunit bodies are attached to the unit record so that the -- subsystem hashes may be generated -- Hashes -- -- Note that these values are never meaninful when Kind is Subunit. -- Only library units (Package_Unit or Subprogram_Unit) retain hash -- values. The most immediate parent library unit of a tree of -- subunits contains a Body_Source_Hash that includes all subunits Specification_Hash : Stream_Hashing.Hash_Type; -- This hash is derrived from Spec_File.Hash, and is set during -- a Implementation_Hash run. Since Source_Files cannot be saved to -- Last_Run, this ensures that the Specification hashes can be saved -- without overly elaborate methods -- -- This value is only valid if the unit has a spec Implementation_Hash: Stream_Hashing.Hash_Type; -- This is a collective hash that includes the Body_File, -- as well as all files in Subunit_Bodies, including children subunits -- of those subunits. This hash is valid after a Hash_Pass when Kind -- is not Subunit, and State is not Requested. -- -- This value is only valid if the unit has a body Compilation_Hash: Stream_Hashing.Hash_Type; -- A collective hash of all compilation products of this unit. -- (For GNAT this would be the .o and .ali files). -- This value is not valid of Kind is "Subunit". -- -- This value is valid only if State = Compiled end record; -- For implementation of Library_Units.Library_Unit_Sets function Library_Unit_Name_Hash (Unit: Library_Unit) return Ada.Containers.Hash_Type is (Unit_Names.Hash (Unit.Name)); function Equivalent_Units (Left, Right: Library_Unit) return Boolean is (Left.Name = Right.Name); ----------------------- -- Library_Unit_Sets -- ----------------------- package Library_Unit_Sets is new Ada.Containers.Hashed_Sets (Element_Type => Library_Unit, Hash => Library_Unit_Name_Hash, Equivalent_Elements => Equivalent_Units); -- Key operations function Key (Unit: Library_Unit) return Unit_Names.Unit_Name is (Unit.Name); package Library_Unit_Sets_Keyed_Operations is new Library_Unit_Sets.Generic_Keys (Key_Type => Unit_Names.Unit_Name, Key => Key, Hash => Unit_Names.Hash, Equivalent_Keys => Unit_Names."="); end Registrar.Library_Units;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . T A G S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- For performance analysis, take into account that the operations in this -- package provide the guarantee that all dispatching calls on primitive -- operations of tagged types and interfaces take constant time (in terms -- of source lines executed), that is to say, the cost of these calls is -- independent of the number of primitives of the type or interface, and -- independent of the number of ancestors or interface progenitors that a -- tagged type may have. -- The following subprograms of the public part of this package take constant -- time (in terms of source lines executed): -- Expanded_Name, Wide_Expanded_Name, Wide_Wide_Expanded_Name, External_Tag, -- Is_Descendant_At_Same_Level, Parent_Tag, Type_Is_Abstract -- Descendant_Tag (when used with a library-level tagged type), -- Internal_Tag (when used with a library-level tagged type). -- The following subprograms of the public part of this package execute in -- time that is not constant (in terms of sources line executed): -- Internal_Tag (when used with a locally defined tagged type), because in -- such cases this routine processes the external tag, extracts from it an -- address available there, and converts it into the tag value returned by -- this function. The number of instructions executed is not constant since -- it depends on the length of the external tag string. -- Descendant_Tag (when used with a locally defined tagged type), because -- it relies on the subprogram Internal_Tag() to provide its functionality. -- Interface_Ancestor_Tags, because this function returns a table whose -- length depends on the number of interfaces covered by a tagged type. with System.Storage_Elements; package Ada.Tags is pragma Preelaborate; -- In accordance with Ada 2005 AI-362 type Tag is private; pragma Preelaborable_Initialization (Tag); No_Tag : constant Tag; function Expanded_Name (T : Tag) return String; function Wide_Expanded_Name (T : Tag) return Wide_String; pragma Ada_05 (Wide_Expanded_Name); function Wide_Wide_Expanded_Name (T : Tag) return Wide_Wide_String; pragma Ada_05 (Wide_Wide_Expanded_Name); function External_Tag (T : Tag) return String; function Internal_Tag (External : String) return Tag; function Descendant_Tag (External : String; Ancestor : Tag) return Tag; pragma Ada_05 (Descendant_Tag); function Is_Descendant_At_Same_Level (Descendant : Tag; Ancestor : Tag) return Boolean; pragma Ada_05 (Is_Descendant_At_Same_Level); function Parent_Tag (T : Tag) return Tag; pragma Ada_05 (Parent_Tag); type Tag_Array is array (Positive range <>) of Tag; function Interface_Ancestor_Tags (T : Tag) return Tag_Array; pragma Ada_05 (Interface_Ancestor_Tags); function Type_Is_Abstract (T : Tag) return Boolean; pragma Ada_2012 (Type_Is_Abstract); Tag_Error : exception; private -- Structure of the GNAT Primary Dispatch Table -- +--------------------+ -- | Signature | -- +--------------------+ -- | Tagged_Kind | -- +--------------------+ Predef Prims -- | Predef_Prims -----------------------------> +------------+ -- +--------------------+ | table of | -- | Offset_To_Top | | predefined | -- +--------------------+ | primitives | -- |Typeinfo_Ptr/TSD_Ptr---> Type Specific Data +------------+ -- Tag ---> +--------------------+ +-------------------+ -- | table of | | inheritance depth | -- : primitive ops : +-------------------+ -- | pointers | | access level | -- +--------------------+ +-------------------+ -- | alignment | -- +-------------------+ -- | expanded name | -- +-------------------+ -- | external tag | -- +-------------------+ -- | hash table link | -- +-------------------+ -- | transportable | -- +-------------------+ -- | type_is_abstract | -- +-------------------+ -- | needs finalization| -- +-------------------+ -- | Ifaces_Table ---> Interface Data -- +-------------------+ +------------+ -- Select Specific Data <---- SSD | | Nb_Ifaces | -- +------------------+ +-------------------+ +------------+ -- |table of primitive| | table of | | table | -- : operation : : ancestor : : of : -- | kinds | | tags | | interfaces | -- +------------------+ +-------------------+ +------------+ -- |table of | -- : entry : -- | indexes | -- +------------------+ -- Structure of the GNAT Secondary Dispatch Table -- +--------------------+ -- | Signature | -- +--------------------+ -- | Tagged_Kind | -- +--------------------+ Predef Prims -- | Predef_Prims -----------------------------> +------------+ -- +--------------------+ | table of | -- | Offset_To_Top | | predefined | -- +--------------------+ | primitives | -- | OSD_Ptr |---> Object Specific Data | thunks | -- Tag ---> +--------------------+ +---------------+ +------------+ -- | table of | | num prim ops | -- : primitive op : +---------------+ -- | thunk pointers | | table of | -- +--------------------+ + primitive | -- | op offsets | -- +---------------+ -- The runtime information kept for each tagged type is separated into two -- objects: the Dispatch Table and the Type Specific Data record. package SSE renames System.Storage_Elements; subtype Cstring is String (Positive); type Cstring_Ptr is access all Cstring; pragma No_Strict_Aliasing (Cstring_Ptr); -- Declarations for the table of interfaces type Offset_To_Top_Function_Ptr is access function (This : System.Address) return SSE.Storage_Offset; -- Type definition used to call the function that is generated by the -- expander in case of tagged types with discriminants that have secondary -- dispatch tables. This function provides the Offset_To_Top value in this -- specific case. type Interface_Data_Element is record Iface_Tag : Tag; Static_Offset_To_Top : Boolean; Offset_To_Top_Value : SSE.Storage_Offset; Offset_To_Top_Func : Offset_To_Top_Function_Ptr; Secondary_DT : Tag; end record; -- If some ancestor of the tagged type has discriminants the field -- Static_Offset_To_Top is False and the field Offset_To_Top_Func -- is used to store the access to the function generated by the -- expander which provides this value; otherwise Static_Offset_To_Top -- is True and such value is stored in the Offset_To_Top_Value field. -- Secondary_DT references a secondary dispatch table whose contents -- are pointers to the primitives of the tagged type that cover the -- interface primitives. Secondary_DT gives support to dispatching -- calls through interface types associated with Generic Dispatching -- Constructors. type Interfaces_Array is array (Natural range <>) of Interface_Data_Element; type Interface_Data (Nb_Ifaces : Positive) is record Ifaces_Table : Interfaces_Array (1 .. Nb_Ifaces); end record; type Interface_Data_Ptr is access all Interface_Data; -- Table of abstract interfaces used to give support to backward interface -- conversions and also to IW_Membership. -- Primitive operation kinds. These values differentiate the kinds of -- callable entities stored in the dispatch table. Certain kinds may -- not be used, but are added for completeness. type Prim_Op_Kind is (POK_Function, POK_Procedure, POK_Protected_Entry, POK_Protected_Function, POK_Protected_Procedure, POK_Task_Entry, POK_Task_Function, POK_Task_Procedure); -- Select specific data types type Select_Specific_Data_Element is record Index : Positive; Kind : Prim_Op_Kind; end record; type Select_Specific_Data_Array is array (Positive range <>) of Select_Specific_Data_Element; type Select_Specific_Data (Nb_Prim : Positive) is record SSD_Table : Select_Specific_Data_Array (1 .. Nb_Prim); -- NOTE: Nb_Prim is the number of non-predefined primitive operations end record; type Select_Specific_Data_Ptr is access all Select_Specific_Data; -- A table used to store the primitive operation kind and entry index of -- primitive subprograms of a type that implements a limited interface. -- The Select Specific Data table resides in the Type Specific Data of a -- type. This construct is used in the handling of dispatching triggers -- in select statements. type Prim_Ptr is access procedure; type Address_Array is array (Positive range <>) of Prim_Ptr; subtype Dispatch_Table is Address_Array (1 .. 1); -- Used by GDB to identify the _tags and traverse the run-time structure -- associated with tagged types. For compatibility with older versions of -- gdb, its name must not be changed. type Tag is access all Dispatch_Table; pragma No_Strict_Aliasing (Tag); type Interface_Tag is access all Dispatch_Table; No_Tag : constant Tag := null; -- The expander ensures that Tag objects reference the Prims_Ptr component -- of the wrapper. type Tag_Ptr is access all Tag; pragma No_Strict_Aliasing (Tag_Ptr); type Offset_To_Top_Ptr is access all SSE.Storage_Offset; pragma No_Strict_Aliasing (Offset_To_Top_Ptr); type Tag_Table is array (Natural range <>) of Tag; type Size_Ptr is access function (A : System.Address) return Long_Long_Integer; type Type_Specific_Data (Idepth : Natural) is record -- The discriminant Idepth is the Inheritance Depth Level: Used to -- implement the membership test associated with single inheritance of -- tagged types in constant-time. It also indicates the size of the -- Tags_Table component. Access_Level : Natural; -- Accessibility level required to give support to Ada 2005 nested type -- extensions. This feature allows safe nested type extensions by -- shifting the accessibility checks to certain operations, rather than -- being enforced at the type declaration. In particular, by performing -- run-time accessibility checks on class-wide allocators, class-wide -- function return, and class-wide stream I/O, the danger of objects -- outliving their type declaration can be eliminated (Ada 2005: AI-344) Alignment : Natural; Expanded_Name : Cstring_Ptr; External_Tag : Cstring_Ptr; HT_Link : Tag_Ptr; -- Components used to support to the Ada.Tags subprograms in RM 3.9 -- Note: Expanded_Name is referenced by GDB to determine the actual name -- of the tagged type. Its requirements are: 1) it must have this exact -- name, and 2) its contents must point to a C-style Nul terminated -- string containing its expanded name. GDB has no requirement on a -- given position inside the record. Transportable : Boolean; -- Used to check RM E.4(18), set for types that satisfy the requirements -- for being used in remote calls as actuals for classwide formals or as -- return values for classwide functions. Type_Is_Abstract : Boolean; -- True if the type is abstract (Ada 2012: AI05-0173) Needs_Finalization : Boolean; -- Used to dynamically check whether an object is controlled or not Size_Func : Size_Ptr; -- Pointer to the subprogram computing the _size of the object. Used by -- the run-time whenever a call to the 'size primitive is required. We -- cannot assume that the contents of dispatch tables are addresses -- because in some architectures the ABI allows descriptors. Interfaces_Table : Interface_Data_Ptr; -- Pointer to the table of interface tags. It is used to implement the -- membership test associated with interfaces and also for backward -- abstract interface type conversions (Ada 2005:AI-251) SSD : Select_Specific_Data_Ptr; -- Pointer to a table of records used in dispatching selects. This field -- has a meaningful value for all tagged types that implement a limited, -- protected, synchronized or task interfaces and have non-predefined -- primitive operations. Tags_Table : Tag_Table (0 .. Idepth); -- Table of ancestor tags. Its size actually depends on the inheritance -- depth level of the tagged type. end record; type Type_Specific_Data_Ptr is access all Type_Specific_Data; pragma No_Strict_Aliasing (Type_Specific_Data_Ptr); -- Declarations for the dispatch table record type Signature_Kind is (Unknown, Primary_DT, Secondary_DT); -- Tagged type kinds with respect to concurrency and limitedness type Tagged_Kind is (TK_Abstract_Limited_Tagged, TK_Abstract_Tagged, TK_Limited_Tagged, TK_Protected, TK_Tagged, TK_Task); type Dispatch_Table_Wrapper (Num_Prims : Natural) is record Signature : Signature_Kind; Tag_Kind : Tagged_Kind; Predef_Prims : System.Address; -- Pointer to the dispatch table of predefined Ada primitives -- According to the C++ ABI the components Offset_To_Top and TSD are -- stored just "before" the dispatch table, and they are referenced with -- negative offsets referring to the base of the dispatch table. The -- _Tag (or the VTable_Ptr in C++ terminology) must point to the base -- of the virtual table, just after these components, to point to the -- Prims_Ptr table. Offset_To_Top : SSE.Storage_Offset; TSD : System.Address; Prims_Ptr : aliased Address_Array (1 .. Num_Prims); -- The size of the Prims_Ptr array actually depends on the tagged type -- to which it applies. For each tagged type, the expander computes the -- actual array size, allocates the Dispatch_Table record accordingly. end record; type Dispatch_Table_Ptr is access all Dispatch_Table_Wrapper; pragma No_Strict_Aliasing (Dispatch_Table_Ptr); -- The following type declaration is used by the compiler when the program -- is compiled with restriction No_Dispatching_Calls. It is also used with -- interface types to generate the tag and run-time information associated -- with them. type No_Dispatch_Table_Wrapper is record NDT_TSD : System.Address; NDT_Prims_Ptr : Natural; end record; DT_Predef_Prims_Size : constant SSE.Storage_Count := SSE.Storage_Count (1 * (Standard'Address_Size / System.Storage_Unit)); -- Size of the Predef_Prims field of the Dispatch_Table DT_Offset_To_Top_Size : constant SSE.Storage_Count := SSE.Storage_Count (1 * (Standard'Address_Size / System.Storage_Unit)); -- Size of the Offset_To_Top field of the Dispatch Table DT_Typeinfo_Ptr_Size : constant SSE.Storage_Count := SSE.Storage_Count (1 * (Standard'Address_Size / System.Storage_Unit)); -- Size of the Typeinfo_Ptr field of the Dispatch Table use type System.Storage_Elements.Storage_Offset; DT_Offset_To_Top_Offset : constant SSE.Storage_Count := DT_Typeinfo_Ptr_Size + DT_Offset_To_Top_Size; DT_Predef_Prims_Offset : constant SSE.Storage_Count := DT_Typeinfo_Ptr_Size + DT_Offset_To_Top_Size + DT_Predef_Prims_Size; -- Offset from Prims_Ptr to Predef_Prims component -- Object Specific Data record of secondary dispatch tables type Object_Specific_Data_Array is array (Positive range <>) of Positive; type Object_Specific_Data (OSD_Num_Prims : Positive) is record OSD_Table : Object_Specific_Data_Array (1 .. OSD_Num_Prims); -- Table used in secondary DT to reference their counterpart in the -- select specific data (in the TSD of the primary DT). This construct -- is used in the handling of dispatching triggers in select statements. -- Nb_Prim is the number of non-predefined primitive operations. end record; type Object_Specific_Data_Ptr is access all Object_Specific_Data; pragma No_Strict_Aliasing (Object_Specific_Data_Ptr); -- The following subprogram specifications are placed here instead of the -- package body to see them from the frontend through rtsfind. function Base_Address (This : System.Address) return System.Address; -- Ada 2005 (AI-251): Displace "This" to point to the base address of the -- object (that is, the address of the primary tag of the object). procedure Check_TSD (TSD : Type_Specific_Data_Ptr); -- Ada 2012 (AI-113): Raise Program_Error if the external tag of this TSD -- is the same as the external tag for some other tagged type declaration. function Displace (This : System.Address; T : Tag) return System.Address; -- Ada 2005 (AI-251): Displace "This" to point to the secondary dispatch -- table of T. function Secondary_Tag (T, Iface : Tag) return Tag; -- Ada 2005 (AI-251): Given a primary tag T associated with a tagged type -- Typ, search for the secondary tag of the interface type Iface covered -- by Typ. function DT (T : Tag) return Dispatch_Table_Ptr; -- Return the pointer to the TSD record associated with T function Get_Entry_Index (T : Tag; Position : Positive) return Positive; -- Ada 2005 (AI-251): Return a primitive operation's entry index (if entry) -- given a dispatch table T and a position of a primitive operation in T. function Get_Offset_Index (T : Tag; Position : Positive) return Positive; -- Ada 2005 (AI-251): Given a pointer to a secondary dispatch table (T) -- and a position of an operation in the DT, retrieve the corresponding -- operation's position in the primary dispatch table from the Offset -- Specific Data table of T. function Get_Prim_Op_Kind (T : Tag; Position : Positive) return Prim_Op_Kind; -- Ada 2005 (AI-251): Return a primitive operation's kind given a dispatch -- table T and a position of a primitive operation in T. function Get_Tagged_Kind (T : Tag) return Tagged_Kind; -- Ada 2005 (AI-345): Given a pointer to either a primary or a secondary -- dispatch table, return the tagged kind of a type in the context of -- concurrency and limitedness. function IW_Membership (This : System.Address; T : Tag) return Boolean; -- Ada 2005 (AI-251): General routine that checks if a given object -- implements a tagged type. Its common usage is to check if Obj is in -- Iface'Class, but it is also used to check if a class-wide interface -- implements a given type (Iface_CW_Typ in T'Class). For example: -- -- type I is interface; -- type T is tagged ... -- -- function Test (O : I'Class) is -- begin -- return O in T'Class. -- end Test; function Offset_To_Top (This : System.Address) return SSE.Storage_Offset; -- Ada 2005 (AI-251): Returns the current value of the Offset_To_Top -- component available in the prologue of the dispatch table. If the parent -- of the tagged type has discriminants this value is stored in a record -- component just immediately after the tag component. function Needs_Finalization (T : Tag) return Boolean; -- A helper routine used in conjunction with finalization collections which -- service class-wide types. The function dynamically determines whether an -- object is controlled or has controlled components. function Parent_Size (Obj : System.Address; T : Tag) return SSE.Storage_Count; -- Computes the size the ancestor part of a tagged extension object whose -- address is 'obj' by calling indirectly the ancestor _size function. The -- ancestor is the parent of the type represented by tag T. This function -- assumes that _size is always in slot one of the dispatch table. procedure Register_Interface_Offset (This : System.Address; Interface_T : Tag; Is_Static : Boolean; Offset_Value : SSE.Storage_Offset; Offset_Func : Offset_To_Top_Function_Ptr); -- Register in the table of interfaces of the tagged type associated with -- "This" object the offset of the record component associated with the -- progenitor Interface_T (that is, the distance from "This" to the object -- component containing the tag of the secondary dispatch table). In case -- of constant offset, Is_Static is true and Offset_Value has such value. -- In case of variable offset, Is_Static is false and Offset_Func is an -- access to function that must be called to evaluate the offset. procedure Register_Tag (T : Tag); -- Insert the Tag and its associated external_tag in a table for the sake -- of Internal_Tag. procedure Set_Dynamic_Offset_To_Top (This : System.Address; Interface_T : Tag; Offset_Value : SSE.Storage_Offset; Offset_Func : Offset_To_Top_Function_Ptr); -- Ada 2005 (AI-251): The compiler generates calls to this routine only -- when initializing the Offset_To_Top field of dispatch tables associated -- with tagged type whose parent has variable size components. "This" is -- the object whose dispatch table is being initialized. Interface_T is the -- interface for which the secondary dispatch table is being initialized, -- and Offset_Value is the distance from "This" to the object component -- containing the tag of the secondary dispatch table (a zero value means -- that this interface shares the primary dispatch table). Offset_Func -- references a function that must be called to evaluate the offset at -- runtime. This routine also takes care of registering these values in -- the table of interfaces of the type. procedure Set_Entry_Index (T : Tag; Position : Positive; Value : Positive); -- Ada 2005 (AI-345): Set the entry index of a primitive operation in T's -- TSD table indexed by Position. procedure Set_Prim_Op_Kind (T : Tag; Position : Positive; Value : Prim_Op_Kind); -- Ada 2005 (AI-251): Set the kind of a primitive operation in T's TSD -- table indexed by Position. procedure Unregister_Tag (T : Tag); -- Remove a particular tag from the external tag hash table Max_Predef_Prims : constant Positive := 15; -- Number of reserved slots for the following predefined ada primitives: -- -- 1. Size -- 2. Read -- 3. Write -- 4. Input -- 5. Output -- 6. "=" -- 7. assignment -- 8. deep adjust -- 9. deep finalize -- 10. async select -- 11. conditional select -- 12. prim_op kind -- 13. task_id -- 14. dispatching requeue -- 15. timed select -- -- The compiler checks that the value here is correct subtype Predef_Prims_Table is Address_Array (1 .. Max_Predef_Prims); type Predef_Prims_Table_Ptr is access Predef_Prims_Table; pragma No_Strict_Aliasing (Predef_Prims_Table_Ptr); type Addr_Ptr is access System.Address; pragma No_Strict_Aliasing (Addr_Ptr); -- This type is used by the frontend to generate the code that handles -- dispatch table slots of types declared at the local level. end Ada.Tags;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S F N _ S C A N -- -- -- -- B o d y -- -- -- -- Copyright (C) 2000-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Exceptions; use Ada.Exceptions; package body SFN_Scan is use ASCII; -- Allow easy access to control character definitions EOF : constant Character := ASCII.SUB; -- The character SUB (16#1A#) is used in DOS-derived systems, such as -- Windows to signal the end of a text file. If this character appears as -- the last character of a file scanned by a call to Scan_SFN_Pragmas, then -- it is ignored, otherwise it is treated as an illegal character. type String_Ptr is access String; S : String_Ptr; -- Points to the gnat.adc input file P : Natural; -- Subscript of next character to process in S Line_Num : Natural; -- Current line number Start_Of_Line : Natural; -- Subscript of first character at start of current line ---------------------- -- Local Procedures -- ---------------------- function Acquire_Integer return Natural; -- This function skips white space, and then scans and returns -- an unsigned integer. Raises Error if no integer is present -- or if the integer is greater than 999. function Acquire_String (B : Natural; E : Natural) return String; -- This function takes a string scanned out by Scan_String, strips -- the enclosing quote characters and any internal doubled quote -- characters, and returns the result as a String. The arguments -- B and E are as returned from a call to Scan_String. The lower -- bound of the string returned is always 1. function Acquire_Unit_Name return String; -- Skips white space, and then scans and returns a unit name. The -- unit name is cased exactly as it appears in the source file. -- The terminating character must be white space, or a comma or -- a right parenthesis or end of file. function At_EOF return Boolean; pragma Inline (At_EOF); -- Returns True if at end of file, False if not. Note that this -- function does NOT skip white space, so P is always unchanged. procedure Check_Not_At_EOF; pragma Inline (Check_Not_At_EOF); -- Skips past white space if any, and then raises Error if at -- end of file. Otherwise returns with P skipped past whitespace. function Check_File_Type return Character; -- Skips white space if any, and then looks for any of the tokens -- Spec_File_Name, Body_File_Name, or Subunit_File_Name. If one -- of these is found then the value returned is 's', 'b' or 'u' -- respectively, and P is bumped past the token. If none of -- these tokens is found, then P is unchanged (except for -- possible skip of white space), and a space is returned. function Check_Token (T : String) return Boolean; -- Skips white space if any, and then checks if the string at the -- current location matches the given string T, and the character -- immediately following is non-alphabetic, non-numeric. If so, -- P is stepped past the token, and True is returned. If not, -- P is unchanged (except for possibly skipping past whitespace), -- and False is returned. S may contain only lower-case letters -- ('a' .. 'z'). procedure Error (Err : String); -- Called if an error is detected. Raises Syntax_Error_In_GNAT_ADC -- with a message of the form gnat.adc:line:col: xxx, where xxx is -- the string Err passed as a parameter. procedure Require_Token (T : String); -- Skips white space if any, and then requires the given string -- to be present. If it is, the P is stepped past it, otherwise -- Error is raised, since this is a syntax error. Require_Token -- is used only for sequences of special characters, so there -- is no issue of terminators, or casing of letters. procedure Scan_String (B : out Natural; E : out Natural); -- Skips white space if any, then requires that a double quote -- or percent be present (start of string). Raises error if -- neither of these two characters is found. Otherwise scans -- out the string, and returns with P pointing past the -- closing quote and S (B .. E) contains the characters of the -- string (including the enclosing quotes, with internal quotes -- still doubled). Raises Error if the string is malformed. procedure Skip_WS; -- Skips P past any white space characters (end of line -- characters, spaces, comments, horizontal tab characters). --------------------- -- Acquire_Integer -- --------------------- function Acquire_Integer return Natural is N : Natural := 0; begin Skip_WS; if S (P) not in '0' .. '9' then Error ("missing index parameter"); end if; while S (P) in '0' .. '9' loop N := N * 10 + Character'Pos (S (P)) - Character'Pos ('0'); if N > 999 then Error ("index value greater than 999"); end if; P := P + 1; end loop; return N; end Acquire_Integer; -------------------- -- Acquire_String -- -------------------- function Acquire_String (B : Natural; E : Natural) return String is Str : String (1 .. E - B - 1); Q : constant Character := S (B); J : Natural; Ptr : Natural; begin Ptr := B + 1; J := 0; while Ptr < E loop J := J + 1; Str (J) := S (Ptr); if S (Ptr) = Q and then S (Ptr + 1) = Q then Ptr := Ptr + 2; else Ptr := Ptr + 1; end if; end loop; return Str (1 .. J); end Acquire_String; ----------------------- -- Acquire_Unit_Name -- ----------------------- function Acquire_Unit_Name return String is B : Natural; begin Check_Not_At_EOF; B := P; while not At_EOF loop exit when S (P) not in '0' .. '9' and then S (P) /= '.' and then S (P) /= '_' and then not (S (P) = '[' and then S (P + 1) = '"') and then not (S (P) = '"' and then S (P - 1) = '[') and then not (S (P) = '"' and then S (P + 1) = ']') and then not (S (P) = ']' and then S (P - 1) = '"') and then S (P) < 'A'; P := P + 1; end loop; if P = B then Error ("null unit name"); end if; return S (B .. P - 1); end Acquire_Unit_Name; ------------ -- At_EOF -- ------------ function At_EOF return Boolean is begin -- Immediate return (False) if before last character of file if P < S'Last then return False; -- Special case: DOS EOF character as last character of file is -- allowed and treated as an end of file. elsif P = S'Last then return S (P) = EOF; -- If beyond last character of file, then definitely at EOF else return True; end if; end At_EOF; --------------------- -- Check_File_Type -- --------------------- function Check_File_Type return Character is begin if Check_Token ("spec_file_name") then return 's'; elsif Check_Token ("body_file_name") then return 'b'; elsif Check_Token ("subunit_file_name") then return 'u'; else return ' '; end if; end Check_File_Type; ---------------------- -- Check_Not_At_EOF -- ---------------------- procedure Check_Not_At_EOF is begin Skip_WS; if At_EOF then Error ("unexpected end of file"); end if; return; end Check_Not_At_EOF; ----------------- -- Check_Token -- ----------------- function Check_Token (T : String) return Boolean is Save_P : Natural; C : Character; begin Skip_WS; Save_P := P; for K in T'Range loop if At_EOF then P := Save_P; return False; end if; C := S (P); if C in 'A' .. 'Z' then C := Character'Val (Character'Pos (C) + (Character'Pos ('a') - Character'Pos ('A'))); end if; if C /= T (K) then P := Save_P; return False; end if; P := P + 1; end loop; if At_EOF then return True; end if; C := S (P); if C in '0' .. '9' or else C in 'a' .. 'z' or else C in 'A' .. 'Z' or else C > Character'Val (127) then P := Save_P; return False; else return True; end if; end Check_Token; ----------- -- Error -- ----------- procedure Error (Err : String) is C : Natural := 0; -- Column number M : String (1 .. 80); -- Buffer used to build resulting error msg LM : Natural := 0; -- Pointer to last set location in M procedure Add_Nat (N : Natural); -- Add chars of integer to error msg buffer ------------- -- Add_Nat -- ------------- procedure Add_Nat (N : Natural) is begin if N > 9 then Add_Nat (N / 10); end if; LM := LM + 1; M (LM) := Character'Val (N mod 10 + Character'Pos ('0')); end Add_Nat; -- Start of processing for Error begin M (1 .. 9) := "gnat.adc:"; LM := 9; Add_Nat (Line_Num); LM := LM + 1; M (LM) := ':'; -- Determine column number for X in Start_Of_Line .. P loop C := C + 1; if S (X) = HT then C := (C + 7) / 8 * 8; end if; end loop; Add_Nat (C); M (LM + 1) := ':'; LM := LM + 1; M (LM + 1) := ' '; LM := LM + 1; M (LM + 1 .. LM + Err'Length) := Err; LM := LM + Err'Length; Raise_Exception (Syntax_Error_In_GNAT_ADC'Identity, M (1 .. LM)); end Error; ------------------- -- Require_Token -- ------------------- procedure Require_Token (T : String) is SaveP : Natural; begin Skip_WS; SaveP := P; for J in T'Range loop if At_EOF or else S (P) /= T (J) then declare S : String (1 .. T'Length + 10); begin S (1 .. 9) := "missing """; S (10 .. T'Length + 9) := T; S (T'Length + 10) := '"'; P := SaveP; Error (S); end; else P := P + 1; end if; end loop; end Require_Token; ---------------------- -- Scan_SFN_Pragmas -- ---------------------- procedure Scan_SFN_Pragmas (Source : String; SFN_Ptr : Set_File_Name_Ptr; SFNP_Ptr : Set_File_Name_Pattern_Ptr) is B, E : Natural; Typ : Character; Cas : Character; begin Line_Num := 1; S := Source'Unrestricted_Access; P := Source'First; Start_Of_Line := P; -- Loop through pragmas in file Main_Scan_Loop : loop Skip_WS; exit Main_Scan_Loop when At_EOF; -- Error if something other than pragma if not Check_Token ("pragma") then Error ("non pragma encountered"); end if; -- Source_File_Name pragma case if Check_Token ("source_file_name") or else Check_Token ("source_file_name_project") then Require_Token ("("); Typ := Check_File_Type; -- First format, with unit name first if Typ = ' ' then if Check_Token ("unit_name") then Require_Token ("=>"); end if; declare U : constant String := Acquire_Unit_Name; begin Require_Token (","); Typ := Check_File_Type; if Typ /= 's' and then Typ /= 'b' then Error ("bad pragma"); end if; Require_Token ("=>"); Scan_String (B, E); declare F : constant String := Acquire_String (B, E); X : Natural; begin -- Scan Index parameter if present if Check_Token (",") then if Check_Token ("index") then Require_Token ("=>"); end if; X := Acquire_Integer; else X := 0; end if; Require_Token (")"); Require_Token (";"); SFN_Ptr.all (Typ, U, F, X); end; end; -- Second format with pattern string else Require_Token ("=>"); Scan_String (B, E); declare Pat : constant String := Acquire_String (B, E); Nas : Natural := 0; begin -- Check exactly one asterisk for J in Pat'Range loop if Pat (J) = '*' then Nas := Nas + 1; end if; end loop; if Nas /= 1 then Error ("** not allowed"); end if; B := 0; E := 0; Cas := ' '; -- Loop to scan out Casing or Dot_Replacement parameters loop Check_Not_At_EOF; exit when S (P) = ')'; Require_Token (","); if Check_Token ("casing") then Require_Token ("=>"); if Cas /= ' ' then Error ("duplicate casing argument"); elsif Check_Token ("lowercase") then Cas := 'l'; elsif Check_Token ("uppercase") then Cas := 'u'; elsif Check_Token ("mixedcase") then Cas := 'm'; else Error ("invalid casing argument"); end if; elsif Check_Token ("dot_replacement") then Require_Token ("=>"); if E /= 0 then Error ("duplicate dot_replacement"); else Scan_String (B, E); end if; else Error ("invalid argument"); end if; end loop; Require_Token (")"); Require_Token (";"); if Cas = ' ' then Cas := 'l'; end if; if E = 0 then SFNP_Ptr.all (Pat, Typ, ".", Cas); else declare Dot : constant String := Acquire_String (B, E); begin SFNP_Ptr.all (Pat, Typ, Dot, Cas); end; end if; end; end if; -- Some other pragma, scan to semicolon at end of pragma else Skip_Loop : loop exit Main_Scan_Loop when At_EOF; exit Skip_Loop when S (P) = ';'; if S (P) = '"' or else S (P) = '%' then Scan_String (B, E); else P := P + 1; end if; end loop Skip_Loop; -- We successfully skipped to semicolon, so skip past it P := P + 1; end if; end loop Main_Scan_Loop; exception when others => Cursor := P - S'First + 1; raise; end Scan_SFN_Pragmas; ----------------- -- Scan_String -- ----------------- procedure Scan_String (B : out Natural; E : out Natural) is Q : Character; begin Check_Not_At_EOF; if S (P) = '"' then Q := '"'; elsif S (P) = '%' then Q := '%'; else Error ("bad string"); Q := '"'; end if; -- Scan out the string, B points to first char B := P; P := P + 1; loop if At_EOF or else S (P) = LF or else S (P) = CR then Error -- CODEFIX ("missing string quote"); elsif S (P) = HT then Error ("tab character in string"); elsif S (P) /= Q then P := P + 1; -- We have a quote else P := P + 1; -- Check for doubled quote if not At_EOF and then S (P) = Q then P := P + 1; -- Otherwise this is the terminating quote else E := P - 1; return; end if; end if; end loop; end Scan_String; ------------- -- Skip_WS -- ------------- procedure Skip_WS is begin WS_Scan : while not At_EOF loop case S (P) is -- End of physical line when CR | LF => Line_Num := Line_Num + 1; P := P + 1; while not At_EOF and then (S (P) = CR or else S (P) = LF) loop Line_Num := Line_Num + 1; P := P + 1; end loop; Start_Of_Line := P; -- All other cases of white space characters when ' ' | FF | VT | HT => P := P + 1; -- Comment when '-' => P := P + 1; if At_EOF then Error ("bad comment"); elsif S (P) = '-' then P := P + 1; while not At_EOF loop case S (P) is when CR | LF | FF | VT => exit; when others => P := P + 1; end case; end loop; else P := P - 1; exit WS_Scan; end if; when others => exit WS_Scan; end case; end loop WS_Scan; end Skip_WS; end SFN_Scan;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- SYSTEM.TASK_PRIMITIVES.OPERATIONS.ATCB_ALLOCATION -- -- -- -- B o d y -- -- -- -- Copyright (C) 2011, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; separate (System.Task_Primitives.Operations) package body ATCB_Allocation is --------------- -- Free_ATCB -- --------------- procedure Free_ATCB (T : Task_Id) is Tmp : Task_Id := T; Is_Self : constant Boolean := T = Self; procedure Free is new Ada.Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id); begin if Is_Self then declare Local_ATCB : aliased Ada_Task_Control_Block (0); -- Create a dummy ATCB and initialize it minimally so that "Free" -- can still call Self and Defer/Undefer_Abort after Tmp is freed -- by the underlying memory management library. begin Local_ATCB.Common.LL.Thread := T.Common.LL.Thread; Local_ATCB.Common.Current_Priority := T.Common.Current_Priority; Specific.Set (Local_ATCB'Unchecked_Access); Free (Tmp); -- Note: it is assumed here that for all platforms, Specific.Set -- deletes the task specific information if passed a null value. Specific.Set (null); end; else Free (Tmp); end if; end Free_ATCB; -------------- -- New_ATCB -- -------------- function New_ATCB (Entry_Num : Task_Entry_Index) return Task_Id is begin return new Ada_Task_Control_Block (Entry_Num); end New_ATCB; end ATCB_Allocation;
------------------------------------------------------------------------------- -- Copyright (c) 2016 Daniel King -- -- Permission is hereby granted, free of charge, to any person obtaining a -- copy of this software and associated documentation files (the "Software"), -- to deal in the Software without restriction, including without limitation -- the rights to use, copy, modify, merge, publish, distribute, sublicense, -- and/or sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- with DW1000.Generic_RO_Register_Driver; with DW1000.Generic_WO_Register_Driver; package body DW1000.Generic_RW_Register_Driver is ------------------- -- Read_Driver -- ------------------- -- Reuse the Read/Write procedures from the other drivers. package Read_Driver is new Generic_RO_Register_Driver (Register_Type, Register_ID, Sub_Register); package Write_Driver is new Generic_WO_Register_Driver (Register_Type, Register_ID, Sub_Register); ------------ -- Read -- ------------ procedure Read (Reg : out Register_Type) is begin Read_Driver.Read (Reg); end Read; ------------- -- Write -- ------------- procedure Write (Reg : in Register_Type) is begin Write_Driver.Write (Reg); end Write; end DW1000.Generic_RW_Register_Driver;
-- Copyright 2019-2020 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pack; use Pack; procedure Foo is S : String := "test string"; I : Natural := S'First; begin declare procedure Nested is begin Do_Nothing (S); -- BREAK end Nested; begin Nested; end; end Foo;
-- { dg-do run } with Text_IO; use Text_IO; procedure Named_Test is type Base is tagged limited record Flag : boolean; Value : integer; end record; -- function Build (X : Integer; Y : Integer) return Base is begin return Result : Base do Result.Flag := (X = Y); Result.Value := X * Y; end return; end; -- type Table is array (1..1) of Base; It : Table := (1 => Build ( Y => 17, X => 11)); begin if It (1).Flag or else It (1).Value /= 187 then raise Program_Error; end if; end;
generic with procedure Process_Data(Item: Data); with function Stop return Boolean; with procedure Finish; package Bin_Trees.Traverse is task Inorder_Task is entry Run(Tree: Tree_Type); -- this will call each Item in Tree and, at the very end, it will call Finish -- except when Stop becomes true; in this case, the task terminates end Inorder_Task; end Bin_Trees.Traverse;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Expressions; with Program.Lexical_Elements; package Program.Elements.Parenthesized_Expressions is pragma Pure (Program.Elements.Parenthesized_Expressions); type Parenthesized_Expression is limited interface and Program.Elements.Expressions.Expression; type Parenthesized_Expression_Access is access all Parenthesized_Expression'Class with Storage_Size => 0; not overriding function Expression (Self : Parenthesized_Expression) return not null Program.Elements.Expressions.Expression_Access is abstract; type Parenthesized_Expression_Text is limited interface; type Parenthesized_Expression_Text_Access is access all Parenthesized_Expression_Text'Class with Storage_Size => 0; not overriding function To_Parenthesized_Expression_Text (Self : in out Parenthesized_Expression) return Parenthesized_Expression_Text_Access is abstract; not overriding function Left_Bracket_Token (Self : Parenthesized_Expression_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Right_Bracket_Token (Self : Parenthesized_Expression_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Parenthesized_Expressions;
-- This package has been generated automatically by GNATtest. -- Do not edit any part of it, see GNATtest documentation for more details. -- begin read only with Gnattest_Generated; package ShipModules.Test_Data.Tests is type Test is new GNATtest_Generated.GNATtest_Standard.ShipModules.Test_Data .Test with null record; procedure Test_GetModuleType_51fe9c_525d49(Gnattest_T: in out Test); -- shipmodules.ads:115:4:GetModuleType:Test_GetModuleType end ShipModules.Test_Data.Tests; -- end read only
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- -- -- -- 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 <Juergen.Pfeifer@T-Online.de> 1996 -- Version Control: -- $Revision: 1.6 $ -- Binding Version 00.93 ------------------------------------------------------------------------------ with Ada.Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Terminal_Interface.Curses.Text_IO.Aux; package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is package Aux renames Terminal_Interface.Curses.Text_IO.Aux; package EIO is new Ada.Text_IO.Enumeration_IO (Enum); procedure Put (Win : in Window; Item : in Enum; Width : in Field := Default_Width; Set : in Type_Set := Default_Setting) is Buf : String (1 .. Field'Last); Tset : Ada.Text_IO.Type_Set; begin if Set /= Mixed_Case then Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set)); else Tset := Ada.Text_IO.Lower_Case; end if; EIO.Put (Buf, Item, Tset); if Set = Mixed_Case then Buf (Buf'First) := To_Upper (Buf (Buf'First)); end if; Aux.Put_Buf (Win, Buf, Width, True, True); end Put; procedure Put (Item : in Enum; Width : in Field := Default_Width; Set : in Type_Set := Default_Setting) is begin Put (Get_Window, Item, Width, Set); end Put; end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
------------------------------------------------------------------------------ -- Copyright (c) 2016-2017, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Natools.Smaz_4096 provides the subprograms needed to instantiate -- -- Natools.Smaz_Generic into a variant of the Smaz compression algorithm -- -- that output directly base-64 printable symbols, but with a dictionary -- -- indexed by two symbols, allowing a maximum size of 4095 entries. -- ------------------------------------------------------------------------------ with Natools.Smaz_Generic; with Natools.Smaz_Implementations.Base_4096; package Natools.Smaz_4096 is new Natools.Smaz_Generic (Dictionary_Code => Natools.Smaz_Implementations.Base_4096.Base_4096_Digit, Read_Code => Natools.Smaz_Implementations.Base_4096.Read_Code, Read_Verbatim => Natools.Smaz_Implementations.Base_4096.Read_Verbatim, Skip_Verbatim => Natools.Smaz_Implementations.Base_4096.Skip_Verbatim, Verbatim_Size => Natools.Smaz_Implementations.Base_4096.Verbatim_Size, Write_Code => Natools.Smaz_Implementations.Base_4096.Write_Code, Write_Verbatim => Natools.Smaz_Implementations.Base_4096.Write_Verbatim); pragma Pure (Natools.Smaz_4096);
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . M A C H I N E _ R E S E T -- -- -- -- B o d y -- -- -- -- Copyright (C) 2011-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Reset for TMS570 with Interfaces; use Interfaces; package body System.Machine_Reset is procedure Os_Exit (Status : Integer); pragma No_Return (Os_Exit); pragma Weak_External (Os_Exit); pragma Export (Ada, Os_Exit, "_exit"); -- Shutdown or restart the board procedure Os_Abort; pragma No_Return (Os_Abort); pragma Export (Ada, Os_Abort, "abort"); -- Likewise -------------- -- Os_Abort -- -------------- procedure Os_Abort is begin Os_Exit (1); end Os_Abort; ------------- -- Os_Exit -- ------------- procedure Os_Exit (Status : Integer) is pragma Unreferenced (Status); -- The parameter is just for ISO-C compatibility -- Reset: write 0x8000 so SYSECR SYSECR : Unsigned_32 with Import, Volatile, Address => 16#FFFF_FFE0#; begin SYSECR := 16#8000#; loop null; end loop; end Os_Exit; ---------- -- Stop -- ---------- procedure Stop is begin Os_Exit (0); end Stop; end System.Machine_Reset;
package TLSF with SPARK_Mode, Pure, Preelaborate is end TLSF;
------------------------------------------------------------------------------ -- -- -- Copyright (c) 2014-2021 Vitalii Bondarenko <vibondare@gmail.com> -- -- -- ------------------------------------------------------------------------------ -- -- -- The MIT License (MIT) -- -- -- -- 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. -- ------------------------------------------------------------------------------ -- Notify_Notification — A passive pop-up notification. with Gdk.Pixbuf; use Gdk.Pixbuf; with Glib; use Glib; with Glib.Object; use Glib.Object; with Glib.Error; use Glib.Error; with Glib.Properties; with Glib.Variant; use Glib.Variant; package Notify.Notification is type Notify_Notification_Record is new GObject_Record with null record; type Notify_Notification is access all Notify_Notification_Record'Class; NOTIFY_EXPIRES_DEFAULT : constant Integer := -1; -- The default expiration time on a notification. NOTIFY_EXPIRES_NEVER : constant Integer := 0; -- The notification never expires. It stays open until closed by the -- calling API or the user. type Notify_Urgency is (NOTIFY_URGENCY_LOW, NOTIFY_URGENCY_NORMAL, NOTIFY_URGENCY_CRITICAL); pragma Convention (C, Notify_Urgency); -- The urgency level of the notification. -- NOTIFY_URGENCY_LOW : Low urgency. Used for unimportant notifications. -- NOTIFY_URGENCY_NORMAL : Normal urgency. Used for most standard -- notifications. -- NOTIFY_URGENCY_CRITICAL: Critical urgency. Used for very important -- notifications. function Notify_Notification_Get_Type return Glib.GType; procedure G_New (Notification : out Notify_Notification; Summary : UTF8_String; Body_Text : UTF8_String := ""; Icon_Name : UTF8_String := ""); -- Creates a new Notification. The summary text is required, but all other -- parameters are optional. -- -- Notification : Returns the new Notify_Notification. -- Summary : The required summary text. -- Body_Text : The optional body text. -- Icon_Name : The optional icon theme icon name or filename. procedure Initialize (Notification : not null access Notify_Notification_Record'Class; Summary : UTF8_String; Body_Text : UTF8_String; Icon_Name : UTF8_String); -- Initializes a newly created Notification. function Update (Notification : not null access Notify_Notification_Record; Summary : UTF8_String; Body_Text : UTF8_String := ""; Icon_Name : UTF8_String := "") return Boolean; -- Updates the notification text and icon. This won't send the update out -- and display it on the screen. For that, you will need to call Show. -- -- Notification : The notification to update. -- Summary : The new required summary text. -- Body_Text : The optional body text. -- Icon_Name : The optional icon theme icon name or filename. -- Returns : TRUE, unless an invalid parameter was passed. function Show (Notification : not null access Notify_Notification_Record; Error : access GError := null) return Boolean; -- Tells the notification server to display the notification on the screen. -- -- Notification : The notification. -- Error : The returned error information. -- Returns : TRUE if successful. On error, this will return FALSE and -- set error. procedure Set_Timeout (Notification : not null access Notify_Notification_Record; Timeout : Integer); -- Sets the timeout of the Notification. To set the default time, pass -- NOTIFY_EXPIRES_DEFAULT as timeout. To set the notification to never -- expire, pass NOTIFY_EXPIRES_NEVER. -- -- Note that the timeout may be ignored by the server. -- -- Notification : The notification. -- Timeout : The timeout in milliseconds. procedure Set_Category (Notification : not null access Notify_Notification_Record; Category : String); -- Sets the category of this Notification. This can be used by the -- notification server to filter or display the data in a certain way. -- -- Notification : The notification. -- Category : The category. procedure Set_Urgency (Notification : not null access Notify_Notification_Record; Urgency : Notify_Urgency); -- Sets the urgency level of this notification. -- See: Notify_Urgency -- -- Notification : The notification. -- Urgency : The urgency level. procedure Set_Image_From_Pixbuf (Notification : not null access Notify_Notification_Record; Pixbuf : Gdk_Pixbuf); -- Sets the image in the notification from a GdkPixbuf. -- -- Notification : The notification. -- Pixbuf : The image. procedure Set_Hint (Notification : not null access Notify_Notification_Record; Key : String; Value : GVariant); -- Sets a hint for Key with value Value. If Value is NULL, a previously -- set hint for key is unset. -- If value is floating, it is consumed. -- -- Notification : A Notify_Notification. -- Key : The hint key. -- Value : The hint value, or NULL to unset the hint. procedure Set_App_Name (Notification : not null access Notify_Notification_Record; App_Name : String); -- Sets the application name for the Notification. If this function is not -- called or if App_Name is blank, the application name will be set from -- the value used in Notify_Init or overridden with Notify_Set_App_Name. -- -- Notification : A Notify_Notification. -- App_Name : The localised application name. procedure Clear_Hints (Notification : not null access Notify_Notification_Record); -- Clears all hints from the notification. -- -- Notification : The notification. type Notify_Action_Callback_Void is not null access procedure (Notification : Notify_Notification; Action : UTF8_String); -- An action callback function. procedure Add_Action (Notification : not null access Notify_Notification_Record; Action : UTF8_String; Label : UTF8_String; Callback : Notify_Action_Callback_Void); -- Adds an Action to a Notification. When the Action is invoked, the -- specified Callback function will be called, along with the value passed -- to User_Data. -- -- Notification : The notification. -- Action : The action ID. -- Label : The human-readable action label. -- Callback : The action's callback function. procedure Clear_Actions (Notification : not null access Notify_Notification_Record); -- Clears all actions from the notification. -- -- Notification : The notification. function Close (Notification : not null access Notify_Notification_Record; Error : access GError := null) return Boolean; -- Synchronously tells the notification server to hide the notification on -- the screen. -- -- Notification : The notification. -- Error : The returned error information. -- Returns : TRUE on success, or FALSE on error with error filled in. function Get_Closed_Reason (Notification : not null access Notify_Notification_Record) return Integer; -- Returns the closed reason code for the Notification. This is valid only -- after the "closed" signal is emitted. -- -- Notification : The notification. -- Returns : The closed reason code. ---------------------------------- -- package Add_Action_User_Data -- ---------------------------------- generic type User_Data_Type (<>) is private; with procedure Destroy (Data : in out User_Data_Type) is null; package Add_Action_User_Data is type Notify_Action_Callback_Void is not null access procedure (Notification : Notify_Notification; Action : UTF8_String; User_Data : User_Data_Type); -- An action callback function. procedure Add_Action (Notification : not null access Notify_Notification_Record'Class; Action : UTF8_String; Label : UTF8_String; Callback : Notify_Action_Callback_Void; User_Data : User_Data_Type); -- Adds an Action to a Notification. When the Action is invoked, the -- specified Callback function will be called, along with the value passed -- to User_Data. -- -- Notification : The notification. -- Action : The action ID. -- Label : The human-readable action label. -- Callback : The action's callback function. -- User_Data : Custom data to pass to callback. end Add_Action_User_Data; ---------------- -- Properties -- ---------------- App_Name_Property : constant Glib.Properties.Property_String; -- The application name to use for this notification. -- Default value: "" Body_Property : constant Glib.Properties.Property_String; -- The message body text. -- Default value: "" Closed_Reason_Property : constant Glib.Properties.Property_Int; -- The reason code for why the notification was closed. -- Allowed values: >= -1 -- Default value : -1 Icon_Name_Property : constant Glib.Properties.Property_String; -- The icon filename or icon theme-compliant name. -- Default value: "" Id_Property : constant Glib.Properties.Property_Int; -- The notification ID. -- Allowed values: >= 0 -- Default value : 0 Summary_Property : constant Glib.Properties.Property_String; -- The summary text. -- Default value: "" ------------- -- Signals -- ------------- type Cb_Notify_Notification_Void is not null access procedure (Self : access Notify_Notification_Record'Class); type Cb_GObject_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class); Signal_Closed : constant Glib.Signal_Name := "closed"; procedure On_Closed (Self : not null access Notify_Notification_Record; Call : Cb_Notify_Notification_Void; After : Boolean := False); procedure On_Closed (Self : not null access Notify_Notification_Record; Call : Cb_GObject_Void; Slot : not null access Glib.Object.GObject_Record'Class; After : Boolean := False); -- The "closed" signal. -- Emitted when the notification is closed. private App_Name_Property : constant Glib.Properties.Property_String := Glib.Properties.Build ("app-name"); Body_Property : constant Glib.Properties.Property_String := Glib.Properties.Build ("body"); Closed_Reason_Property : constant Glib.Properties.Property_Int := Glib.Properties.Build ("closed-reason"); Icon_Name_Property : constant Glib.Properties.Property_String := Glib.Properties.Build ("icon-name"); Id_Property : constant Glib.Properties.Property_Int := Glib.Properties.Build ("id"); Summary_Property : constant Glib.Properties.Property_String := Glib.Properties.Build ("summary"); end Notify.Notification;
with openGL.geometry.colored, openGL.Font, openGL.Palette; package openGL.Model.arrow.colored -- -- Models a colored arrow. -- is type Item is new openGL.Model.arrow.item with private; type View is access all Item'Class; --------- --- Forge -- function new_Arrow (Color : in openGL.Color := Palette.White; line_Width : in Real := 1.0; End_1, End_2 : in Vector_3 := Origin_3D) return View; -------------- --- Attributes -- overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in Font.font_id_Map_of_font) return Geometry.views; procedure end_Site_is (Self : in out Item; Now : in Vector_3; for_End : in Integer); function end_Site (Self : in Item; for_End : in Integer) return Vector_3; overriding procedure modify (Self : in out Item); overriding function is_Modified (Self : in Item) return Boolean; private type Item is new openGL.Model.arrow.item with record Color : openGL.Color; line_Width : Real; Vertices : aliased Geometry.colored.Vertex_array (1 .. 4); Geometry : access Geometry.colored.item'Class; is_Modified : Boolean := False; end record; procedure set_side_Bits (Self : in out Item); end openGL.Model.arrow.colored;
package Discr27 is procedure Proc; end Discr27;
-- RUN: %llvmgcc -S %s -I%p/Support package body Var_Offset is function F (X : T) return Character is begin return X.Bad_Field; end; end;
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with glib; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h; with glib; with glib.Values; with System; with System; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h; with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_dataprotocol_dataprotocol_h is -- unsupported macro: GST_TYPE_DP_VERSION (gst_dp_version_get_type ()) GST_DP_VERSION_MAJOR : constant := 0; -- gst/dataprotocol/dataprotocol.h:52 GST_DP_VERSION_MINOR : constant := 2; -- gst/dataprotocol/dataprotocol.h:58 GST_DP_HEADER_LENGTH : constant := 62; -- gst/dataprotocol/dataprotocol.h:65 -- GStreamer -- * Copyright (C) 1999 Erik Walthinsen <omega@cse.ogi.edu> -- * Copyright (C) 2004,2006 Thomas Vander Stichele <thomas at apestaart dot org> -- * -- * dataprotocol.h: Functions implementing the GStreamer Data Protocol -- * -- * 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. -- --* -- * GstDPVersion: -- * @GST_DP_VERSION_0_2: protocol version 0.2 -- * @GST_DP_VERSION_1_0: protocol version 1.0 -- * -- * The version of the GDP protocol being used. -- subtype GstDPVersion is unsigned; GST_DP_VERSION_0_2 : constant GstDPVersion := 1; GST_DP_VERSION_1_0 : constant GstDPVersion := 2; -- gst/dataprotocol/dataprotocol.h:42 function gst_dp_version_get_type return GLIB.GType; -- gst/dataprotocol/dataprotocol.h:44 pragma Import (C, gst_dp_version_get_type, "gst_dp_version_get_type"); --* -- * GST_DP_VERSION_MAJOR: -- * -- * The major version number of the GStreamer Data Protocol. -- --* -- * GST_DP_VERSION_MINOR: -- * -- * The minor version number of the GStreamer Data Protocol. -- --* -- * GST_DP_HEADER_LENGTH: -- * -- * The header size in bytes. -- --* -- * GstDPHeaderFlag: -- * @GST_DP_HEADER_FLAG_NONE: No flag present. -- * @GST_DP_HEADER_FLAG_CRC_HEADER: a header CRC field is present. -- * @GST_DP_HEADER_FLAG_CRC_PAYLOAD: a payload CRC field is present. -- * @GST_DP_HEADER_FLAG_CRC: a CRC for header and payload is present. -- * -- * header flags for the dataprotocol. -- type GstDPHeaderFlag is (GST_DP_HEADER_FLAG_NONE, GST_DP_HEADER_FLAG_CRC_HEADER, GST_DP_HEADER_FLAG_CRC_PAYLOAD, GST_DP_HEADER_FLAG_CRC); pragma Convention (C, GstDPHeaderFlag); -- gst/dataprotocol/dataprotocol.h:81 --* -- * GstDPPayloadType: -- * @GST_DP_PAYLOAD_NONE: Invalid payload type. -- * @GST_DP_PAYLOAD_BUFFER: #GstBuffer payload packet. -- * @GST_DP_PAYLOAD_CAPS: #GstCaps payload packet. -- * @GST_DP_PAYLOAD_EVENT_NONE: First value of #GstEvent payload packets. -- * -- * The GDP payload types. a #GstEvent payload type is encoded with the -- * event type number starting from @GST_DP_PAYLOAD_EVENT_NONE. -- subtype GstDPPayloadType is unsigned; GST_DP_PAYLOAD_NONE : constant GstDPPayloadType := 0; GST_DP_PAYLOAD_BUFFER : constant GstDPPayloadType := 1; GST_DP_PAYLOAD_CAPS : constant GstDPPayloadType := 2; GST_DP_PAYLOAD_EVENT_NONE : constant GstDPPayloadType := 64; -- gst/dataprotocol/dataprotocol.h:98 type GstDPHeaderFromBufferFunction is access function (arg1 : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; arg2 : GstDPHeaderFlag; arg3 : access GLIB.guint; arg4 : System.Address) return GLIB.gboolean; pragma Convention (C, GstDPHeaderFromBufferFunction); -- gst/dataprotocol/dataprotocol.h:100 type GstDPPacketFromCapsFunction is access function (arg1 : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; arg2 : GstDPHeaderFlag; arg3 : access GLIB.guint; arg4 : System.Address; arg5 : System.Address) return GLIB.gboolean; pragma Convention (C, GstDPPacketFromCapsFunction); -- gst/dataprotocol/dataprotocol.h:104 type GstDPPacketFromEventFunction is access function (arg1 : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent; arg2 : GstDPHeaderFlag; arg3 : access GLIB.guint; arg4 : System.Address; arg5 : System.Address) return GLIB.gboolean; pragma Convention (C, GstDPPacketFromEventFunction); -- gst/dataprotocol/dataprotocol.h:109 --* -- * GstDPPacketizer: -- * @version: the #GstDPVersion of the protocol to be used -- * @header_from_buffer: buffer serializer function -- * @packet_from_caps: caps serializer function -- * @packet_from_event: event serializer function -- * -- * Data protocol packetizer handle. -- type GstDPPacketizer_u_gst_reserved_array is array (0 .. 3) of System.Address; type GstDPPacketizer is record version : aliased GstDPVersion; -- gst/dataprotocol/dataprotocol.h:125 header_from_buffer : GstDPHeaderFromBufferFunction; -- gst/dataprotocol/dataprotocol.h:127 packet_from_caps : GstDPPacketFromCapsFunction; -- gst/dataprotocol/dataprotocol.h:128 packet_from_event : GstDPPacketFromEventFunction; -- gst/dataprotocol/dataprotocol.h:129 u_gst_reserved : GstDPPacketizer_u_gst_reserved_array; -- gst/dataprotocol/dataprotocol.h:132 end record; pragma Convention (C_Pass_By_Copy, GstDPPacketizer); -- gst/dataprotocol/dataprotocol.h:133 -- skipped anonymous struct anon_369 --< private > procedure gst_dp_init; -- gst/dataprotocol/dataprotocol.h:136 pragma Import (C, gst_dp_init, "gst_dp_init"); -- packetizer function gst_dp_packetizer_new (version : GstDPVersion) return access GstDPPacketizer; -- gst/dataprotocol/dataprotocol.h:140 pragma Import (C, gst_dp_packetizer_new, "gst_dp_packetizer_new"); procedure gst_dp_packetizer_free (packetizer : access GstDPPacketizer); -- gst/dataprotocol/dataprotocol.h:141 pragma Import (C, gst_dp_packetizer_free, "gst_dp_packetizer_free"); -- crc checksum function gst_dp_crc (buffer : access GLIB.guint8; length : GLIB.guint) return GLIB.guint16; -- gst/dataprotocol/dataprotocol.h:144 pragma Import (C, gst_dp_crc, "gst_dp_crc"); -- payload information from header function gst_dp_header_payload_length (header : access GLIB.guint8) return GLIB.guint32; -- gst/dataprotocol/dataprotocol.h:148 pragma Import (C, gst_dp_header_payload_length, "gst_dp_header_payload_length"); function gst_dp_header_payload_type (header : access GLIB.guint8) return GstDPPayloadType; -- gst/dataprotocol/dataprotocol.h:150 pragma Import (C, gst_dp_header_payload_type, "gst_dp_header_payload_type"); -- converting from GstBuffer/GstEvent/GstCaps function gst_dp_header_from_buffer (buffer : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; flags : GstDPHeaderFlag; length : access GLIB.guint; header : System.Address) return GLIB.gboolean; -- gst/dataprotocol/dataprotocol.h:154 pragma Import (C, gst_dp_header_from_buffer, "gst_dp_header_from_buffer"); function gst_dp_packet_from_caps (caps : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; flags : GstDPHeaderFlag; length : access GLIB.guint; header : System.Address; payload : System.Address) return GLIB.gboolean; -- gst/dataprotocol/dataprotocol.h:160 pragma Import (C, gst_dp_packet_from_caps, "gst_dp_packet_from_caps"); function gst_dp_packet_from_event (event : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent; flags : GstDPHeaderFlag; length : access GLIB.guint; header : System.Address; payload : System.Address) return GLIB.gboolean; -- gst/dataprotocol/dataprotocol.h:167 pragma Import (C, gst_dp_packet_from_event, "gst_dp_packet_from_event"); -- converting to GstBuffer/GstEvent/GstCaps function gst_dp_buffer_from_header (header_length : GLIB.guint; header : access GLIB.guint8) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/dataprotocol/dataprotocol.h:174 pragma Import (C, gst_dp_buffer_from_header, "gst_dp_buffer_from_header"); function gst_dp_caps_from_packet (header_length : GLIB.guint; header : access GLIB.guint8; payload : access GLIB.guint8) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/dataprotocol/dataprotocol.h:176 pragma Import (C, gst_dp_caps_from_packet, "gst_dp_caps_from_packet"); function gst_dp_event_from_packet (header_length : GLIB.guint; header : access GLIB.guint8; payload : access GLIB.guint8) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent; -- gst/dataprotocol/dataprotocol.h:179 pragma Import (C, gst_dp_event_from_packet, "gst_dp_event_from_packet"); -- validation function gst_dp_validate_header (header_length : GLIB.guint; header : access GLIB.guint8) return GLIB.gboolean; -- gst/dataprotocol/dataprotocol.h:184 pragma Import (C, gst_dp_validate_header, "gst_dp_validate_header"); function gst_dp_validate_payload (header_length : GLIB.guint; header : access GLIB.guint8; payload : access GLIB.guint8) return GLIB.gboolean; -- gst/dataprotocol/dataprotocol.h:186 pragma Import (C, gst_dp_validate_payload, "gst_dp_validate_payload"); function gst_dp_validate_packet (header_length : GLIB.guint; header : access GLIB.guint8; payload : access GLIB.guint8) return GLIB.gboolean; -- gst/dataprotocol/dataprotocol.h:189 pragma Import (C, gst_dp_validate_packet, "gst_dp_validate_packet"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_dataprotocol_dataprotocol_h;
------------------------------------------------------------------------------ -- EMAIL: <darkestkhan@gmail.com> -- -- License: ISC License (see COPYING file) -- -- -- -- Copyright © 2014 - 2015 darkestkhan -- ------------------------------------------------------------------------------ -- Permission to use, copy, modify, and/or distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- The software is provided "as is" and the author disclaims all warranties -- -- with regard to this software including all implied warranties of -- -- merchantability and fitness. In no event shall the author be liable for -- -- any special, direct, indirect, or consequential damages or any damages -- -- whatsoever resulting from loss of use, data or profits, whether in an -- -- action of contract, negligence or other tortious action, arising out of -- -- or in connection with the use or performance of this software. -- ------------------------------------------------------------------------------ with Ada.Directories; with Ada.Environment_Variables; private with XDG.Defaults; package body XDG is ---------------------------------------------------------------------------- package EV renames Ada.Environment_Variables; -- Directory separator is different for Windows and UNIX so use appropriate -- one. Sep: constant Character := XDG.Defaults.Separator; ---------------------------------------------------------------------------- generic Variable: String; Default : String; function Get_Home return String; function Get_Home return String is Home: constant String := EV.Value ("HOME"); begin if EV.Exists (Variable) then declare Value: constant String := EV.Value (Variable); begin if Value (Value'Last) = Sep then return Value; else return Value & Sep; end if; end; else if Home (Home'Last) = Sep then return Home & Default; else return Home & Sep & Default; end if; end if; end Get_Home; function Get_Data_Home is new Get_Home ("XDG_DATA_HOME", XDG.Defaults.Home); function Get_Config_Home is new Get_Home ("XDG_CONFIG_HOME", XDG.Defaults.Config); function Get_Cache_Home is new Get_Home ("XDG_CACHE_HOME", XDG.Defaults.Cache); function Data_Home return String renames Get_Data_Home; function Config_Home return String renames Get_Config_Home; function Cache_Home return String renames Get_Cache_Home; function Runtime_Dir return String is begin if EV.Exists ("XDG_RUNTIME_DIR") then declare Value: constant String := EV.Value ("XDG_RUNTIME_DIR"); begin if Value (Value'Last) = Sep then return Value; else return Value & Sep; end if; end; else return ""; end if; end Runtime_Dir; function Data_Dirs return String is begin if EV.Exists ("XDG_DATA_DIRS") then return EV.Value ("XDG_DATA_DIRS"); else return XDG.Defaults.Data_Dirs; end if; end Data_Dirs; function Config_Dirs return String is begin if EV.Exists ("XDG_CONFIG_DIRS") then return EV.Value ("XDG_CONFIG_DIRS"); else return XDG.Defaults.Config_Dirs; end if; end Config_Dirs; ---------------------------------------------------------------------------- generic with function XDG_Path return String; function XDG_Home (Directory: in String) return String; function XDG_Home (Directory: in String) return String is Path: constant String := XDG_Path; begin if Path (Path'Last) = Sep then if Directory (Directory'Last) = Sep then return Path & Directory; else return Path & Directory & Sep; end if; else if Directory (Directory'Last) = Sep then return Path & Sep & Directory; else return Path & Sep & Directory & Sep; end if; end if; end XDG_Home; function Data_Home_Path is new XDG_Home (Data_Home); function Config_Home_Path is new XDG_Home (Config_Home); function Cache_Home_Path is new XDG_Home (Cache_Home); function Data_Home (Directory: in String) return String renames Data_Home_Path; function Config_Home (Directory: in String) return String renames Config_Home_Path; function Cache_Home (Directory: in String) return String renames Cache_Home_Path; function Runtime_Dir (Directory: in String) return String is Path: constant String := Runtime_Dir; begin if Path'Length = 0 then raise No_Runtime_Dir; elsif Directory (Directory'Last) = Sep then return Path & Directory; else return Path & Directory & Sep; end if; end Runtime_Dir; ---------------------------------------------------------------------------- generic with function XDG_Path (Directory: in String) return String; procedure Create_Home (Directory: in String); procedure Create_Home (Directory: in String) is package AD renames Ada.Directories; Path: constant String := XDG_Path (Directory); begin AD.Create_Path (Path); end Create_Home; procedure Create_Data is new Create_Home (Data_Home); procedure Create_Config is new Create_Home (Config_Home); procedure Create_Cache is new Create_Home (Cache_Home); procedure Create_Runtime is new Create_Home (Runtime_Dir); procedure Create_Data_Home (Directory: in String) renames Create_Data; procedure Create_Config_Home (Directory: in String) renames Create_Config; procedure Create_Cache_Home (Directory: in String) renames Create_Cache; procedure Create_Runtime_Dir (Directory: in String) renames Create_Runtime; ---------------------------------------------------------------------------- generic with function XDG_Path (Directory: in String) return String; procedure Delete_Home (Directory: in String; Empty_Only: in Boolean := True); procedure Delete_Home (Directory: in String; Empty_Only: in Boolean := True) is package AD renames Ada.Directories; Path: constant String := XDG_Path (Directory); begin if Empty_Only then AD.Delete_Directory (Path); else AD.Delete_Tree (Path); end if; end Delete_Home; procedure Delete_Data is new Delete_Home (Data_Home); procedure Delete_Config is new Delete_Home (Config_Home); procedure Delete_Cache is new Delete_Home (Cache_Home); procedure Delete_Runtime is new Delete_Home (Runtime_Dir); procedure Delete_Data_Home ( Directory : in String; Empty_Only: in Boolean := True ) renames Delete_Data; procedure Delete_Config_Home ( Directory : in String; Empty_Only: in Boolean := True ) renames Delete_Config; procedure Delete_Cache_Home ( Directory : in String; Empty_Only: in Boolean := True ) renames Delete_Cache; procedure Delete_Runtime_Dir ( Directory : in String; Empty_Only: in Boolean := True ) renames Delete_Runtime; ---------------------------------------------------------------------------- generic with function XDG_Home (Directory: in String) return String; function Check_Home (Directory: in String) return Boolean; function Check_Home (Directory: in String) return Boolean is package AD renames Ada.Directories; use type AD.File_Kind; Path: constant String := XDG_Home (Directory); begin if AD.Exists (Path) and then AD.Kind (Path) /= AD.Directory then return False; else return True; end if; end Check_Home; function Check_Data_Home is new Check_Home (Data_Home); function Check_Config_Home is new Check_Home (Config_Home); function Check_Cache_Home is new Check_Home (Cache_Home); function Check_Runtime_Dir is new Check_Home (Runtime_Dir); function Is_Valid_Data_Home (Directory: in String) return Boolean renames Check_Data_Home; function Is_Valid_Config_Home (Directory: in String) return Boolean renames Check_Config_Home; function Is_Valid_Cache_Home (Directory: in String) return Boolean renames Check_Cache_Home; function Is_Valid_Runtime_Dir (Directory: in String) return Boolean renames Check_Runtime_Dir; ---------------------------------------------------------------------------- end XDG;
-- Copyright 2013-2020 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pck; use Pck; procedure Foo is begin Set_Float (1.0); -- START Set_Double (1, 1.0); Set_Long_Double (1, (I => 2), 1.0); end Foo;
------------------------------------------------------------------------------ -- Copyright (c) 2013-2014, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ package body Natools.S_Expressions is function To_String (Data : in Atom) return String is begin return Result : String (1 .. Data'Length) do for I in Result'Range loop Result (I) := Character'Val (Data (Data'First + Offset (I - 1))); end loop; end return; end To_String; function To_Atom (Data : in String) return Atom is begin return Result : Atom (0 .. Data'Length - 1) do for I in Result'Range loop Result (I) := Character'Pos (Data (Data'First + Integer (I))); end loop; end return; end To_Atom; function Less_Than (Left, Right : Atom) return Boolean is begin return Left'Length < Right'Length or else (Left'Length = Right'Length and then Left < Right); end Less_Than; procedure Next (Object : in out Descriptor'Class) is Discarded : Events.Event; pragma Unreferenced (Discarded); begin Next (Object, Discarded); end Next; procedure Close_Current_List (Object : in out Descriptor'Class) is Level : Natural := 0; Event : Events.Event := Object.Current_Event; begin if Object.Current_Event in Events.Error | Events.End_Of_Input then return; end if; loop Object.Next (Event); case Event is when Events.Error | Events.End_Of_Input => exit; when Events.Open_List => Level := Level + 1; when Events.Close_List => exit when Level = 0; Level := Level - 1; when Events.Add_Atom => null; end case; end loop; end Close_Current_List; end Natools.S_Expressions;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Elements.Defining_Names; with Program.Elements.Aspect_Specifications; with Program.Element_Vectors; with Program.Elements.Expressions; with Program.Elements.Package_Declarations; with Program.Element_Visitors; package Program.Nodes.Package_Declarations is pragma Preelaborate; type Package_Declaration is new Program.Nodes.Node and Program.Elements.Package_Declarations.Package_Declaration and Program.Elements.Package_Declarations.Package_Declaration_Text with private; function Create (Package_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Name : not null Program.Elements.Defining_Names .Defining_Name_Access; With_Token : Program.Lexical_Elements.Lexical_Element_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Is_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Visible_Declarations : Program.Element_Vectors.Element_Vector_Access; Private_Token : Program.Lexical_Elements.Lexical_Element_Access; Private_Declarations : Program.Element_Vectors.Element_Vector_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; End_Name : Program.Elements.Expressions.Expression_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Package_Declaration; type Implicit_Package_Declaration is new Program.Nodes.Node and Program.Elements.Package_Declarations.Package_Declaration with private; function Create (Name : not null Program.Elements.Defining_Names .Defining_Name_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Visible_Declarations : Program.Element_Vectors.Element_Vector_Access; Private_Declarations : Program.Element_Vectors.Element_Vector_Access; End_Name : Program.Elements.Expressions.Expression_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Package_Declaration with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Package_Declaration is abstract new Program.Nodes.Node and Program.Elements.Package_Declarations.Package_Declaration with record Name : not null Program.Elements.Defining_Names .Defining_Name_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Visible_Declarations : Program.Element_Vectors.Element_Vector_Access; Private_Declarations : Program.Element_Vectors.Element_Vector_Access; End_Name : Program.Elements.Expressions.Expression_Access; end record; procedure Initialize (Self : in out Base_Package_Declaration'Class); overriding procedure Visit (Self : not null access Base_Package_Declaration; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Name (Self : Base_Package_Declaration) return not null Program.Elements.Defining_Names.Defining_Name_Access; overriding function Aspects (Self : Base_Package_Declaration) return Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; overriding function Visible_Declarations (Self : Base_Package_Declaration) return Program.Element_Vectors.Element_Vector_Access; overriding function Private_Declarations (Self : Base_Package_Declaration) return Program.Element_Vectors.Element_Vector_Access; overriding function End_Name (Self : Base_Package_Declaration) return Program.Elements.Expressions.Expression_Access; overriding function Is_Package_Declaration (Self : Base_Package_Declaration) return Boolean; overriding function Is_Declaration (Self : Base_Package_Declaration) return Boolean; type Package_Declaration is new Base_Package_Declaration and Program.Elements.Package_Declarations.Package_Declaration_Text with record Package_Token : not null Program.Lexical_Elements .Lexical_Element_Access; With_Token : Program.Lexical_Elements.Lexical_Element_Access; Is_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Private_Token : Program.Lexical_Elements.Lexical_Element_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access; end record; overriding function To_Package_Declaration_Text (Self : in out Package_Declaration) return Program.Elements.Package_Declarations .Package_Declaration_Text_Access; overriding function Package_Token (Self : Package_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function With_Token (Self : Package_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Is_Token (Self : Package_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Private_Token (Self : Package_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function End_Token (Self : Package_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Semicolon_Token (Self : Package_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; type Implicit_Package_Declaration is new Base_Package_Declaration with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; end record; overriding function To_Package_Declaration_Text (Self : in out Implicit_Package_Declaration) return Program.Elements.Package_Declarations .Package_Declaration_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Package_Declaration) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Package_Declaration) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Package_Declaration) return Boolean; end Program.Nodes.Package_Declarations;
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Keyboard_Handler -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control -- $Revision: 1.16 $ -- $Date: 2011/03/23 00:34:24 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Characters.Handling; use Ada.Characters.Handling; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; with Terminal_Interface.Curses.Forms.Field_Types.Enumeration; use Terminal_Interface.Curses.Forms.Field_Types.Enumeration; with Sample.Header_Handler; use Sample.Header_Handler; with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux; with Sample.Manifest; use Sample.Manifest; with Sample.Form_Demo.Handler; -- This package contains a centralized keyboard handler used throughout -- this example. The handler establishes a timeout mechanism that provides -- periodical updates of the common header lines used in this example. -- package body Sample.Keyboard_Handler is In_Command : Boolean := False; function Get_Key (Win : Window := Standard_Window) return Real_Key_Code is K : Real_Key_Code; function Command return Real_Key_Code; function Command return Real_Key_Code is function My_Driver (F : Form; C : Key_Code; P : Panel) return Boolean; package Fh is new Sample.Form_Demo.Handler (My_Driver); type Label_Array is array (Label_Number) of String (1 .. 8); Labels : Label_Array; FA : Field_Array_Access := new Field_Array' (Make (0, 0, "Command:"), Make (Top => 0, Left => 9, Width => Columns - 11), Null_Field); K : Real_Key_Code := Key_None; N : Natural := 0; function My_Driver (F : Form; C : Key_Code; P : Panel) return Boolean is Ch : Character; begin if P = Null_Panel then raise Panel_Exception; end if; if C in User_Key_Code'Range and then C = QUIT then if Driver (F, F_Validate_Field) = Form_Ok then K := Key_None; return True; end if; elsif C in Normal_Key_Code'Range then Ch := Character'Val (C); if Ch = LF or else Ch = CR then if Driver (F, F_Validate_Field) = Form_Ok then declare Buffer : String (1 .. Positive (Columns - 11)); Cmdc : String (1 .. 8); begin Get_Buffer (Fld => FA.all (2), Str => Buffer); Trim (Buffer, Left); if Buffer (1) /= ' ' then Cmdc := To_Upper (Buffer (Cmdc'Range)); for I in Labels'Range loop if Cmdc = Labels (I) then K := Function_Key_Code (Function_Key_Number (I)); exit; end if; end loop; end if; return True; end; end if; end if; end if; return False; end My_Driver; begin In_Command := True; for I in Label_Number'Range loop Get_Soft_Label_Key (I, Labels (I)); Trim (Labels (I), Left); Translate (Labels (I), Upper_Case_Map); if Labels (I) (1) /= ' ' then N := N + 1; end if; end loop; if N > 0 then -- some labels were really set declare Enum_Info : Enumeration_Info (N); Enum_Field : Enumeration_Field; J : Positive := Enum_Info.Names'First; Frm : Form := Create (FA); begin for I in Label_Number'Range loop if Labels (I) (1) /= ' ' then Enum_Info.Names (J) := new String'(Labels (I)); J := J + 1; end if; end loop; Enum_Field := Create (Enum_Info, True); Set_Field_Type (FA.all (2), Enum_Field); Set_Background (FA.all (2), Normal_Video); Fh.Drive_Me (Frm, Lines - 3, 0); Delete (Frm); Update_Panels; Update_Screen; end; end if; Free (FA, True); In_Command := False; return K; end Command; begin Set_Timeout_Mode (Win, Delayed, 30000); loop K := Get_Keystroke (Win); if K = Key_None then -- a timeout occurred Update_Header_Window; elsif K = 3 and then not In_Command then -- CTRL-C K := Command; exit when K /= Key_None; else exit; end if; end loop; return K; end Get_Key; procedure Init_Keyboard_Handler is begin null; end Init_Keyboard_Handler; end Sample.Keyboard_Handler;
-- Copyright 2014-2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pck; use Pck; procedure Foo is Before : Time_T := (Secs => 1384395743); begin Do_Nothing (Before'Address); -- BREAK end Foo;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . O S _ I N T E R F A C E -- -- -- -- B o d y -- -- -- -- Copyright (C) 1998-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the DEC Unix version of this package -- This package encapsulates all direct interfaces to OS services -- that are needed by children of System. pragma Polling (Off); -- Turn off polling, we do not want ATC polling to take place during -- tasking operations. It causes infinite loops and other problems. with Interfaces.C; use Interfaces.C; with System.Machine_Code; use System.Machine_Code; package body System.OS_Interface is -------------------- -- Get_Stack_Base -- -------------------- function Get_Stack_Base (thread : pthread_t) return Address is pragma Unreferenced (thread); begin return Null_Address; end Get_Stack_Base; ------------------ -- pthread_init -- ------------------ procedure pthread_init is begin null; end pthread_init; ------------------ -- pthread_self -- ------------------ function pthread_self return pthread_t is Self : pthread_t; begin Asm ("call_pal 0x9e" & ASCII.LF & ASCII.HT & "bis $31, $0, %0", Outputs => pthread_t'Asm_Output ("=r", Self), Clobber => "$0"); return Self; end pthread_self; ---------------------- -- Hide_Yellow_Zone -- ---------------------- procedure Hide_Yellow_Zone is type Teb_Ptr is access all pthread_teb_t; Teb : Teb_Ptr; Res : Interfaces.C.int; pragma Unreferenced (Res); begin -- Get the Thread Environment Block address Asm ("call_pal 0x9e" & ASCII.LF & ASCII.HT & "bis $31, $0, %0", Outputs => Teb_Ptr'Asm_Output ("=r", Teb), Clobber => "$0"); -- Stick a guard page right above the Yellow Zone if it exists if Teb.all.stack_yellow /= Teb.all.stack_guard then Res := mprotect (Teb.all.stack_yellow, Get_Page_Size, PROT_ON); end if; end Hide_Yellow_Zone; ----------------- -- To_Duration -- ----------------- function To_Duration (TS : timespec) return Duration is begin return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; end To_Duration; function To_Duration (TV : struct_timeval) return Duration is begin return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6; end To_Duration; ----------------- -- To_Timespec -- ----------------- function To_Timespec (D : Duration) return timespec is S : time_t; F : Duration; begin S := time_t (Long_Long_Integer (D)); F := D - Duration (S); -- If F has negative value due to a round-up, adjust for positive F -- value. if F < 0.0 then S := S - 1; F := F + 1.0; end if; return timespec'(tv_sec => S, tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); end To_Timespec; ---------------- -- To_Timeval -- ---------------- function To_Timeval (D : Duration) return struct_timeval is S : time_t; F : Duration; begin S := time_t (Long_Long_Integer (D)); F := D - Duration (S); -- If F has negative value due to a round-up, adjust for positive F -- value. if F < 0.0 then S := S - 1; F := F + 1.0; end if; return struct_timeval' (tv_sec => S, tv_usec => time_t (Long_Long_Integer (F * 10#1#E6))); end To_Timeval; end System.OS_Interface;
-- C9A011A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT IF A CALLED TASK IS ABORTED WHILE IN RENDEZVOUS, THEN -- "TASKING_ERROR" IS RAISED IN THE CALLING TASK. -- HISTORY: -- DHH 03/28/88 CREATED ORIGINAL TEST. WITH SYSTEM; USE SYSTEM; WITH REPORT; USE REPORT; PROCEDURE C9A011A IS TASK TYPE CHOICE IS ENTRY E1; END CHOICE; T : CHOICE; TASK BODY CHOICE IS X : INTEGER; BEGIN ACCEPT E1 DO X := IDENT_INT(3); IF EQUAL(X,X) THEN ABORT CHOICE; END IF; END E1; END CHOICE; BEGIN TEST("C9A011A", "CHECK THAT IF A CALLED TASK IS ABORTED WHILE " & "IN RENDEZVOUS, THEN ""TASKING_ERROR"" IS " & "RAISED IN THE CALLING TASK"); T.E1; FAILED("EXCEPTION NOT RAISED ON ABORT"); RESULT; EXCEPTION WHEN TASKING_ERROR => RESULT; WHEN OTHERS => FAILED("UNEXPECTED EXCEPTION RAISED ON ABORT"); RESULT; END C9A011A;
-- remote_server.ads - Main package for use by NymphRPC clients (Spec). -- -- 2017/07/01, Maya Posch -- (c) Nyanko.ws package NymphRemoteServer is function init(logger : in LogFunction, level : in integer, timeout: in integer) return Boolean; function sync(handle : in integer, result : out string) return Boolean; procedure setLogger(); function shutdown() return Boolean; function connect(host : in string, port : in integer, handle : out integer, data : in out, result : out string); function connect(url : in string, handle : out integer, private -- end NymphRemoteServer;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a version for Solaris native threads separate (System.Task_Primitives.Operations) package body Specific is ---------------- -- Initialize -- ---------------- procedure Initialize (Environment_Task : Task_Id) is pragma Unreferenced (Environment_Task); Result : Interfaces.C.int; begin Result := thr_keycreate (ATCB_Key'Access, System.Null_Address); pragma Assert (Result = 0); end Initialize; ------------------- -- Is_Valid_Task -- ------------------- function Is_Valid_Task return Boolean is Unknown_Task : aliased System.Address; Result : Interfaces.C.int; begin Result := thr_getspecific (ATCB_Key, Unknown_Task'Unchecked_Access); pragma Assert (Result = 0); return Unknown_Task /= System.Null_Address; end Is_Valid_Task; --------- -- Set -- --------- procedure Set (Self_Id : Task_Id) is Result : Interfaces.C.int; begin Result := thr_setspecific (ATCB_Key, To_Address (Self_Id)); pragma Assert (Result = 0); end Set; ---------- -- Self -- ---------- -- To make Ada tasks and C threads interoperate better, we have -- added some functionality to Self. Suppose a C main program -- (with threads) calls an Ada procedure and the Ada procedure -- calls the tasking run-time system. Eventually, a call will be -- made to self. Since the call is not coming from an Ada task, -- there will be no corresponding ATCB. -- What we do in Self is to catch references that do not come -- from recognized Ada tasks, and create an ATCB for the calling -- thread. -- The new ATCB will be "detached" from the normal Ada task -- master hierarchy, much like the existing implicitly created -- signal-server tasks. function Self return Task_Id is Result : Interfaces.C.int; Self_Id : aliased System.Address; begin Result := thr_getspecific (ATCB_Key, Self_Id'Unchecked_Access); pragma Assert (Result = 0); if Self_Id = System.Null_Address then return Register_Foreign_Thread; else return To_Task_Id (Self_Id); end if; end Self; end Specific;
package p is type t is private; end p;
with ada.containers.ordered_sets, ada.text_io; use ada.text_io; procedure set_demo is package cs is new ada.containers.ordered_sets (character); use cs; function "+" (s : string) return set is (if s = "" then empty_set else Union(+ s(s'first..s'last - 1), To_Set (s(s'last)))); function "-" (s : Set) return string is (if s = empty_set then "" else - (s - To_Set (s.last_element)) & s.last_element); s1, s2 : set; begin loop put ("s1= "); s1 := + get_line; exit when s1 = +"Quit!"; put ("s2= "); s2 := + get_line; Put_Line("Sets [" & (-s1) & "], [" & (-s2) & "] of size" & S1.Length'img & " and" & s2.Length'img & "."); Put_Line("Intersection: [" & (-(Intersection(S1, S2))) & "],"); Put_Line("Union: [" & (-(Union(s1, s2))) & "],"); Put_Line("Difference: [" & (-(Difference(s1, s2))) & "],"); Put_Line("Symmetric Diff: [" & (-(s1 xor s2)) & "],"); Put_Line("Subset: " & Boolean'Image(s1.Is_Subset(s2)) & ", Equal: " & Boolean'Image(s1 = s2) & "."); end loop; end set_demo;
----------------------------------------------------------------------- -- css-printer -- CSS printer tools -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Text_IO; package CSS.Printer.Text_IO is type File_Type is new CSS.Printer.File_Type with record File : Ada.Text_IO.File_Type; end record; overriding procedure New_Line (Stream : in out File_Type); overriding procedure Print (Stream : in out File_Type; Content : in String); overriding procedure Print (Stream : in out File_Type; Content : in Character); end CSS.Printer.Text_IO;
-- CA2007A3.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- WKB 7/1/81 SEPARATE (CA2007A0M) PACKAGE BODY CA2007A3 IS BEGIN ELAB_ORDER (NEXT) := '3'; NEXT := NEXT + 1; END CA2007A3;
------------------------------------------------------------------------------ -- -- -- GNAT EXAMPLE -- -- -- -- Copyright (C) 2013, 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 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Text_IO; use Ada.Text_IO; with Netutils; use Netutils; with Netproto; use Netproto; with Ethdrv; use Ethdrv; with Netcfg; with Memory_Copy; with Interfaces.C; -- Implement a tftp server (that accept only write requests). -- RFC1350 package body Nettftp is procedure Get_Next_Data; Block_Size : constant := 512; Pkt_Len : Natural; -- Length in byte of the last tftp data packet Tftp_File_Offset : Unsigned_32; -- Offset in the file of the last tftp data packet Blk_Num : Unsigned_16; -- Block number of the last received data packet (also the packet to ack) procedure Open is Rcv : Rcv_Status; Rq : Unsigned_16; B : Unsigned_8; Mode_Off : Natural; Octet : constant Netbuf := (Character'Pos ('o'), Character'Pos ('c'), Character'Pos ('t'), Character'Pos ('e'), Character'Pos ('t')); begin My_Udp_Port := 69; loop -- Accept request from anyone Netcfg.Srv_Ip_Addr := Null_Ip_Addr; -- Wait for a packet Eth_Rcv_Wait; Rcv := Handle_Eth_Packet; if Rcv = Rcv_Udp then if Packet_Len - Packet_Off >= 4 then Rq := Read_BE2 (Packet_Off); Packet_Off := Packet_Off + 2; if Rq = 2 then Put ("Got write request for: "); while Packet_Off < Packet_Len loop B := Packet (Packet_Off); Packet_Off := Packet_Off + 1; exit when B = 0; Put (Character'Val (B)); end loop; Put (", mode: "); Mode_Off := Packet_Off; while Packet_Off < Packet_Len loop B := Packet (Packet_Off); Packet_Off := Packet_Off + 1; exit when B = 0; Put (Character'Val (B)); end loop; New_Line; if Packet (Mode_Off .. Packet_Off - 2) = Octet then exit; else Put_Line ("not octet mode"); end if; Dump_Pkt (Packet_Off); else Put_Line ("Unhandled request"); Dump_Pkt (Packet_Off); end if; end if; end if; end loop; Route_To_Server; if Netcfg.Srv_Eth_Addr = Null_Eth_Addr then Put_Line ("Cannot route to server"); return; end if; My_Udp_Port := 49200; Pkt_Len := Block_Size; Blk_Num := 0; Get_Next_Data; Tftp_File_Offset := 0; end Open; procedure Send_Ack is Off : Natural; begin if False then Put ("tftp: ack "); Put_Hex (Blk_Num); New_Line; end if; Prepare_Udp (Off); -- Ack Write_BE2 (4); Write_BE2 (Blk_Num); Send_Udp (Off); end Send_Ack; procedure Get_Next_Data is Rcv : Rcv_Status; Rq : Unsigned_16; begin Send_Ack; loop -- Wait for a packet Eth_Rcv_Wait; Rcv := Handle_Eth_Packet; if Rcv = Rcv_Udp and then Packet_Len - Packet_Off >= 4 then Rq := Read_BE2 (Packet_Off); Packet_Off := Packet_Off + 2; if Rq = 3 then if Read_BE2 (Packet_Off) /= Blk_Num + 1 then Put ("Out of sync, got: "); Put_Hex (Read_BE2 (Packet_Off)); Put (", next is "); Put_Hex (Blk_Num + 1); New_Line; else Packet_Off := Packet_Off + 2; Pkt_Len := Packet_Len - Packet_Off; if False then Put ("Got "); Put_Dec (Unsigned_16 (Pkt_Len)); Put_Line (" bytes"); end if; Blk_Num := Blk_Num + 1; return; end if; else Put ("Got unhandled op: "); Put_Hex (Rq); New_Line; end if; end if; end loop; end Get_Next_Data; procedure Read (Off : Unsigned_32; Data : Address; Count : in out Natural) is Res : Natural; Pkt_Off : Natural; begin if Off < Tftp_File_Offset then -- Cannot rewind Put_Line ("tftp: cannot rewind"); Count := 0; return; end if; -- Skip data while Off >= Tftp_File_Offset + Unsigned_32 (Pkt_Len) loop if Pkt_Len < Block_Size then Count := 0; return; end if; Tftp_File_Offset := Tftp_File_Offset + Unsigned_32 (Pkt_Len); Get_Next_Data; end loop; Pkt_Off := Natural (Off - Tftp_File_Offset); Res := Pkt_Len - Pkt_Off; if Res > Count then Res := Count; end if; if False then Put ("tftp read: off="); Put_Dec (Unsigned_16 (Off)); Put ("/"); Put_Dec (Unsigned_16 (Tftp_File_Offset)); Put (" pkt_off="); Put_Dec (Unsigned_16 (Packet_Off)); Put ("+"); Put_Dec (Unsigned_16 (Pkt_Off)); Put (" res="); Put_Dec (Unsigned_16 (Res)); New_Line; end if; Memory_Copy.memcpy (Data, Packet (Packet_Off + Pkt_Off)'Address, C.size_t (Res)); Count := Res; end Read; procedure Close is begin Put_Line ("closing"); while Pkt_Len = Block_Size loop Get_Next_Data; end loop; Send_Ack; end Close; end Nettftp;
----------------------------------------------------------------------- -- akt-commands-info -- Info command of keystore -- Copyright (C) 2019 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with AKT.Commands.Drivers; private package AKT.Commands.Info is type Command_Type is new AKT.Commands.Drivers.Command_Type with null record; -- Give information about the keystore. overriding procedure Execute (Command : in out Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type); end AKT.Commands.Info;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_01F3 is pragma Preelaborate; Group_01F3 : aliased constant Core_Second_Stage := (16#2D# .. 16#2F# => -- 01F32D .. 01F32F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#7E# .. 16#7F# => -- 01F37E .. 01F37F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#9C# .. 16#9D# => -- 01F39C .. 01F39D (Other_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#B5# .. 16#B6# => -- 01F3B5 .. 01F3B6 (Other_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#BC# => -- 01F3BC (Other_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#CF# .. 16#D3# => -- 01F3CF .. 01F3D3 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#F8# .. 16#FF# => -- 01F3F8 .. 01F3FF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), others => (Other_Symbol, Neutral, Other, Other, Other, Ideographic, (Grapheme_Base => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_01F3;
-- Copyright 2017 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local json = require("json") name = "VirusTotal" type = "api" function start() setratelimit(15) end function vertical(ctx, domain) local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end local haskey = true if (c == nil or c.key == nil or c.key == "") then haskey = false end local resp local respstr = domain local vurl = buildurl(domain) if haskey then vurl = apiurl(domain, c.api) respstr = domain .. api end -- Check if the response data is in the graph database if (cfg and cfg.ttl ~= nil and cfg.ttl > 0) then resp = obtain_response(respstr, cfg.ttl) end if (resp == nil or resp == "") then local err resp, err = request({ url=vurl, headers={['Content-Type']="application/json"}, }) if (err ~= nil and err ~= "") then return end if (cfg and cfg.ttl ~= nil and cfg.ttl > 0) then cache_response(respstr, resp) end end local d = json.decode(resp) if haskey then if d['response_code'] ~= 1 then log(ctx, name .. ": " .. vurl .. ": Response code " .. d['response_code'] .. ": " .. d['verbose_msg']) return end for i, sub in pairs(d.subdomains) do sendnames(ctx, sub) end else for i, data in pairs(d.data) do if data.type == "domain" then sendnames(ctx, data.id) end end end end function buildurl(domain) return "https://www.virustotal.com/ui/domains/" .. domain .. "/subdomains?limit=40" end function apiurl(domain, key) return "https://www.virustotal.com/vtapi/v2/domain/report?apikey=" .. key .. "&domain=" .. domain end function sendnames(ctx, content) local names = find(content, subdomainre) if names == nil then return end for i, v in pairs(names) do newname(ctx, v) end end
with Ada.Unchecked_Conversion; package Tkmrpc.Request.Ike.Dh_Get_Shared_Secret.Convert is function To_Request is new Ada.Unchecked_Conversion ( Source => Dh_Get_Shared_Secret.Request_Type, Target => Request.Data_Type); function From_Request is new Ada.Unchecked_Conversion ( Source => Request.Data_Type, Target => Dh_Get_Shared_Secret.Request_Type); end Tkmrpc.Request.Ike.Dh_Get_Shared_Secret.Convert;
-- openapi_ipify -- OpenAPI client for ipify, a simple public IP address API -- -- OpenAPI spec version: 0.9.0 -- Contact: blah@cliffano.com -- -- NOTE: This package is auto generated by the swagger code generator 3.2.1-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. with Swagger.Streams; with Swagger.Servers.Operation; package body .Skeletons is package body Skeleton is package API_Get_Ip is new Swagger.Servers.Operation (Handler => Get_Ip, Method => Swagger.Servers.GET, URI => "/"); -- Get your public IP address procedure Get_Ip (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Impl : Implementation_Type; Format : Swagger.Nullable_UString; Callback : Swagger.Nullable_UString; Result : Swagger.Object; begin Swagger.Servers.Get_Query_Parameter (Req, "format", Format); Swagger.Servers.Get_Query_Parameter (Req, "callback", Callback); Impl.Get_Ip (Format, Callback, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Ip; procedure Register (Server : in out Swagger.Servers.Application_Type'Class) is begin Swagger.Servers.Register (Server, API_Get_Ip.Definition); end Register; end Skeleton; package body Shared_Instance is -- Get your public IP address procedure Get_Ip (Req : in out Swagger.Servers.Request'Class; Reply : in out Swagger.Servers.Response'Class; Stream : in out Swagger.Servers.Output_Stream'Class; Context : in out Swagger.Servers.Context_Type) is Format : Swagger.Nullable_UString; Callback : Swagger.Nullable_UString; Result : Swagger.Object; begin Swagger.Servers.Get_Query_Parameter (Req, "format", Format); Swagger.Servers.Get_Query_Parameter (Req, "callback", Callback); Server.Get_Ip (Format, Callback, Result, Context); if Context.Get_Status = 200 then Stream.Start_Document; .Models.Serialize (Stream, "", Result); Stream.End_Document; end if; end Get_Ip; package API_Get_Ip is new Swagger.Servers.Operation (Handler => Get_Ip, Method => Swagger.Servers.GET, URI => "/"); procedure Register (Server : in out Swagger.Servers.Application_Type'Class) is begin Swagger.Servers.Register (Server, API_Get_Ip.Definition); end Register; protected body Server is -- Get your public IP address procedure Get_Ip (Format : in Swagger.Nullable_UString; Callback : in Swagger.Nullable_UString; Result : out Swagger.Object; Context : in out Swagger.Servers.Context_Type) is begin Impl.Get_Ip (Format, Callback, Result, Context); end Get_Ip; end Server; end Shared_Instance; end .Skeletons;
-- CE3605D.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT PUT DOES NOT RAISE LAYOUT_ERROR WHEN THE NUMBER OF -- CHARACTERS TO BE OUTPUT EXCEEDS THE LINE LENGTH. -- CHECK THAT PUT HAS THE EFFECT OF NEW_LINE (AS WELL AS -- OUTPUTTING THE ITEM) WHEN THE NUMBER OF CHARACTERS TO BE OUTPUT -- OVERFLOWS A BOUNDED LINE LENGTH. -- CHECK THAT PUT WITH A NULL STRING PERFORMS NO OPERATION. -- APPLICABILITY CRITERIA: -- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT -- TEXT FILES. -- HISTORY: -- SPS 09/02/82 -- JBG 12/28/82 -- RJW 11/04/86 REVISED TEST TO OUTPUT A NOT_APPLICABLE -- RESULT WHEN FILES ARE NOT SUPPORTED. -- JLH 09/08/87 CORRECTED EXCEPTION HANDLING. WITH REPORT; USE REPORT; WITH TEXT_IO; USE TEXT_IO; WITH CHECK_FILE; PROCEDURE CE3605D IS INCOMPLETE : EXCEPTION; BEGIN TEST ("CE3605D", "CHECK THAT LAYOUT_ERROR IS NOT RAISED BY PUT " & "FOR STRING"); DECLARE FT : FILE_TYPE; LC : POSITIVE_COUNT; BEGIN BEGIN CREATE (FT, OUT_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " & "WITH OUT_FILE MODE"); RAISE INCOMPLETE; WHEN NAME_ERROR => NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " & "CREATE WITH OUT_FILE MODE"); RAISE INCOMPLETE; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED ON " & "TEXT CREATE"); RAISE INCOMPLETE; END; SET_LINE_LENGTH (FT, 5); BEGIN PUT (FT, "STRING"); IF LINE(FT) /= 2 THEN FAILED ("LINE COUNT WAS" & COUNT'IMAGE(LINE(FT)) & " INSTEAD OF 2"); END IF; IF COL(FT) /= 2 THEN FAILED ("COLUMN COUNT WAS" & COUNT'IMAGE(COL(FT)) & " INSTEAD OF 2"); END IF; EXCEPTION WHEN LAYOUT_ERROR => FAILED ("LAYOUT_ERROR RAISED - 1"); WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED - 1"); END; PUT (FT, "NEW"); IF LINE(FT) /= 2 THEN FAILED ("LINE COUNT WRONG - 2; WAS" & COUNT'IMAGE(LINE(FT)) & " INSTEAD OF 2"); END IF; IF COL(FT) /= 5 THEN FAILED ("COL COUNT WRONG - 2; WAS" & COUNT'IMAGE(COL(FT)) & " INSTEAD OF 5"); END IF; BEGIN PUT (FT, "STR"); IF LINE (FT) /= 3 THEN FAILED ("PUT STRING WHEN IN MIDDLE OF " & "LINE DOES NOT HAVE EFFECT OF " & "NEW_LINE; LINE COUNT IS" & COUNT'IMAGE(LINE(FT))); END IF; IF COL(FT) /= 3 THEN FAILED ("COL COUNT WRONG - 3; WAS" & COUNT'IMAGE(COL(FT)) & " INSTEAD OF 3"); END IF; EXCEPTION WHEN LAYOUT_ERROR => FAILED ("LAYOUT_ERROR RAISED - 2"); WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED - 2"); END; PUT (FT, "ING"); IF LINE(FT) /= 3 THEN FAILED ("LINE COUNT WRONG - 3; WAS" & COUNT'IMAGE(LINE(FT)) & " INSTEAD OF 3"); END IF; IF COL(FT) /= 6 THEN FAILED ("COL COUNT WRONG - 3; WAS" & COUNT'IMAGE(COL(FT)) & " INSTEAD OF 6"); END IF; BEGIN PUT (FT, ""); IF LINE(FT) /= 3 THEN FAILED ("LINE COUNT WRONG - 3; WAS" & COUNT'IMAGE(LINE(FT)) & " INSTEAD OF 3"); END IF; IF COL(FT) /= 6 THEN FAILED ("COL COUNT WRONG - 3; WAS" & COUNT'IMAGE(COL(FT)) & " INSTEAD OF 6"); END IF; EXCEPTION WHEN LAYOUT_ERROR => FAILED ("LAYOUT_ERROR RAISED - 3"); WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED - 3"); END; CHECK_FILE (FT, "STRIN#" & "GNEWS#" & "TRING#@%"); BEGIN DELETE (FT); EXCEPTION WHEN USE_ERROR => NULL; END; EXCEPTION WHEN INCOMPLETE => NULL; END; RESULT; END CE3605D;
with AdaM.Any, Ada.Containers.Vectors, Ada.Streams; package AdaM.subprogram_Body is type Item is new Any.item with private; -- View -- type View is access all Item'Class; procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : in View); procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : out View); for View'write use View_write; for View'read use View_read; -- Vector -- package Vectors is new ada.Containers.Vectors (Positive, View); subtype Vector is Vectors.Vector; -- Forge -- function new_Subprogram return subprogram_Body.view; procedure free (Self : in out subprogram_Body.view); procedure destruct (Self : in out subprogram_Body.item); -- Attributes -- overriding function Id (Self : access Item) return AdaM.Id; private type Item is new Any.item with record null; end record; end AdaM.subprogram_Body;
-- Copyright 2018-2021 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Enum_With_Gap is type Enum_With_Gaps is ( LIT0, LIT1, LIT2, LIT3, LIT4 ); for Enum_With_Gaps use ( LIT0 => 3, LIT1 => 5, LIT2 => 8, LIT3 => 13, LIT4 => 21 ); for Enum_With_Gaps'size use 16; type Enum_Subrange is new Enum_With_Gaps range Lit1 .. Lit3; type MyWord is range 0 .. 16#FFFF# ; for MyWord'Size use 16; type AR is array (Enum_With_Gaps range <>) of MyWord; type AR_Access is access AR; type String_Access is access String; procedure Do_Nothing (E : AR_Access); procedure Do_Nothing (E : String_Access); end Enum_With_Gap;
with Interfaces.C; with System; package body Generic_Callback is function paMinLatCallback (inputBuffer : System.Address; outputBuffer : System.Address; framesPerBuffer : IC.unsigned_long; timeInfo : access PaStreamCallbackTimeInfo; statusFlags : PaStreamCallbackFlags; userData : System.Address) return PaStreamCallbackResult with Export => True, Convention => C; --------------------- -- PAA_Open_Stream -- --------------------- function PAA_Open_Stream (stream : access PaStream_Ptr; inputParameters : access PaStreamParameters; outputParameters : access PaStreamParameters; sampleRate : Long_Float; framesPerBuffer : Long_Integer; streamFlags : PaStreamFlags; pre : Pre_Callback; post : Post_Callback; userData : User_Data) return PaError is begin end PAA_Open_Stream; ---------------------- -- paMinLatCallback -- ---------------------- function paMinLatCallback (inputBuffer : System.Address; outputBuffer : System.Address; framesPerBuffer : Interfaces.C.unsigned_long; timeInfo : access PaStreamCallbackTimeInfo; statusFlags : PaStreamCallbackFlags; userData : System.Address) return PaStreamCallbackResult is begin for i in 1 .. Integer (framesPerBuffer) loop null; end loop; return paContinue; end paMinLatCallback; end Generic_Callback;
-- SPDX-FileCopyrightText: 2020 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ---------------------------------------------------------------- with Ada.Containers.Generic_Anonymous_Array_Sort; with Ada.Iterator_Interfaces; with League.Characters; with League.Regexps; with Markdown.Common_Patterns; with Markdown.Inline_Parsers.Autolinks; with Markdown.Inline_Parsers.Code_Spans; with Markdown.Inline_Parsers.Raw_HTML; package body Markdown.Inline_Parsers is function "+" (Text : Wide_Wide_String) return League.Regexps.Regexp_Pattern is (League.Regexps.Compile (League.Strings.To_Universal_String (Text))); Link_Title : Wide_Wide_String renames Markdown.Common_Patterns.Link_Title; -- Groups: 4 Link_Start_Pattern : constant League.Regexps.Regexp_Pattern := +("^\([\ \t\n\v\f\r\>]*"); Title_Pattern : constant League.Regexps.Regexp_Pattern := +("^[\ \t\n\v\f\r\>]*(" & Link_Title & ")?([\ \t\n\v\f\r\>]*\))?"); -- Groups: 1 2,3,4,5 6 Title_Close_Group : constant array (Positive range 1 .. 3) of Positive := (2, 3, 5); -- Close title group numbers package body Plain_Texts is function First (Self : Plain_Text'Class) return Position is (Self.From); procedure Initialize (Self : in out Plain_Text'Class; Text : League.String_Vectors.Universal_String_Vector; From : Position := (1, 1); To : Position := (Positive'Last, Positive'Last)) is begin Self.Data := Text; Self.From := From; if To.Line > Text.Length then Self.To := (Text.Length, Text (Text.Length).Length); else Self.To := To; end if; end Initialize; procedure Initialize (Self : in out Plain_Text'Class; Text : Plain_Text'Class; From : Position; To : Position := (Positive'Last, Positive'Last)) is begin Self.Data := Text.Data; Self.From := From; if To > Text.To then Self.To := Text.To; elsif To.Column = 1 then Self.To := (To.Line - 1, Text.Data (To.Line - 1).Length); else Self.To := (To.Line, To.Column - 1); end if; end Initialize; function Join (Self : Plain_Text'Class; From : Position; Char : Wide_Wide_Character) return League.Strings.Universal_String is Nested : Plain_Text; List : League.String_Vectors.Universal_String_Vector := Self.Data; begin Nested.Initialize (Self, From); if From.Line > 1 or Self.To.Line < Self.Data.Length then List := List.Slice (From.Line, Self.To.Line); end if; if From.Column > 1 then List.Replace (1, Nested.Line (From.Line)); end if; if Self.To.Column < List (List.Length).Length then List.Replace (List.Length, List (List.Length).Head_To (Self.To.Column)); end if; return List.Join (Char); end Join; function Last (Self : Plain_Text'Class) return Position is (Self.To); function Line (Self : Plain_Text'Class; Index : Positive) return League.Strings.Universal_String is use type League.Strings.Universal_String; function Space (Count : Positive) return League.Strings.Universal_String; ----------- -- Space -- ----------- function Space (Count : Positive) return League.Strings.Universal_String is Blank : constant Wide_Wide_String (1 .. 80) := (others => ' '); begin if Count <= Blank'Last then return League.Strings.To_Universal_String (Blank (1 .. Count)); else return Blank & Space (Count - Blank'Last); end if; end Space; Result : League.Strings.Universal_String := Self.Data (Index); begin if Index = Self.From.Line and Self.From.Column > 1 then Result := Space (Self.From.Column - 1) & Result.Tail_From (Self.From.Column); end if; if Index = Self.To.Line and Self.To.Column < Result.Length then Result := Result.Head_To (Self.To.Column); end if; return Result; end Line; ---------- -- Line -- ---------- function Line (Self : Plain_Text'Class; From : Position) return League.Strings.Universal_String is begin return Self.Data (From.Line).Tail_From (From.Column); end Line; function Lines (Self : Plain_Text'Class) return Positive is begin return Self.To.Line - Self.From.Line + 1; end Lines; procedure Step (Self : Plain_Text'Class; Value : Natural; Cursor : in out Position) is Line : League.Strings.Universal_String renames Self.Data (Cursor.Line); begin if Cursor.Column + Value > Line.Length then Cursor := (Cursor.Line + 1, 1); else Cursor.Column := Cursor.Column + Value; end if; end Step; end Plain_Texts; type Delimiter_Kind is ('*', '_', '[', ']'); subtype Emphasis_Kind is Delimiter_Kind range '*' .. '_'; type Delimiter (Kind : Delimiter_Kind := '*') is record From : Position; Is_Deleted : Boolean := False; case Kind is when '*' | '_' => Count : Positive; Is_Active : Boolean; Can_Open : Boolean; Can_Close : Boolean; when '[' => null; when ']' => To : Position; end case; end record; type Markup_Kind is (Emphasis, Link); type Markup (Kind : Markup_Kind := Emphasis) is record From : Position; Length : Positive; case Kind is when Link => URL : League.Strings.Universal_String; Title : League.String_Vectors.Universal_String_Vector; when Emphasis => null; end case; end record; type Markup_Index is new Positive; package Markup_Vectors is new Ada.Containers.Vectors (Markup_Index, Markup); procedure Find_Markup (Register : Markdown.Link_Registers.Link_Register'Class; Text : Plain_Texts.Plain_Text; Markup : in out Markup_Vectors.Vector); type Scanner_State is record Is_White_Space : Boolean := True; Is_Punctuation : Boolean := False; end record; procedure Read_Delimiter (Text : Plain_Texts.Plain_Text; Cursor : in out Position; State : in out Scanner_State; Item : out Delimiter; Is_Delimiter : out Boolean); procedure Read_Character (Text : Plain_Texts.Plain_Text; Cursor : in out Position; Result : in out League.Strings.Universal_String); function Get_State (Text : Plain_Texts.Plain_Text; Cursor : Position) return Scanner_State; function To_Annotation (Item : Markup; Pos : Positive) return Annotation; function To_Annotated_Text (Text : Plain_Texts.Plain_Text; Markup : Markup_Vectors.Vector) return Annotated_Text; function Count_Character (Line : League.Strings.Universal_String; From : Positive) return Positive; type Inline_Kind is new Positive; -- Top priority inline kinds. type Inline_Parser_State is array (Inline_Kind range <>) of Optional_Inline_State; Known_Inline : constant array (Inline_Kind range 1 .. 3) of access procedure (Text : Plain_Texts.Plain_Text; Cursor : Position; State : in out Optional_Inline_State) := (Markdown.Inline_Parsers.Code_Spans.Find'Access, Markdown.Inline_Parsers.Autolinks.Find'Access, Markdown.Inline_Parsers.Raw_HTML.Find'Access); procedure Parse_Inline (Text : Plain_Texts.Plain_Text; State : in out Inline_Parser_State; Result : out Optional_Inline_State); procedure Find_All_Inlines (Text : Plain_Texts.Plain_Text; Cursor : Position; State : out Inline_Parser_State); procedure Append (Self : in out Annotated_Text; Value : Annotated_Text); procedure Append (Self : in out Annotated_Text; Value : Annotated_Text) is Offset : constant Natural := Self.Plain_Text.Length; begin Self.Plain_Text.Append (Value.Plain_Text); for X of Value.Annotation loop declare Shifted : Annotation := X; begin Shifted.From := Shifted.From + Offset; Shifted.To := Shifted.To + Offset; Self.Annotation.Append (Shifted); end; end loop; end Append; --------------------- -- Count_Character -- --------------------- function Count_Character (Line : League.Strings.Universal_String; From : Positive) return Positive is use type League.Characters.Universal_Character; Char : constant League.Characters.Universal_Character := Line (From); Result : Positive := 1; begin for J in From + 1 .. Line.Length loop exit when Line (J) /= Char; Result := Result + 1; end loop; return Result; end Count_Character; --------------------- -- Delimiter_Lists -- --------------------- package Delimiter_Lists is type Delimiter_List is tagged private with Variable_Indexing => Reference, Default_Iterator => Iterate, Iterator_Element => Delimiter; type Delimiter_Index is new Positive; subtype Extended_Delimiter_Index is Delimiter_Index'Base range 0 .. Delimiter_Index'Last; function Has_Element (Cursor : Extended_Delimiter_Index) return Boolean is (Cursor > 0); package Delimiter_Iterator_Interfaces is new Ada.Iterator_Interfaces (Extended_Delimiter_Index, Has_Element); type Reference_Type (Element : not null access Delimiter) is null record with Implicit_Dereference => Element; function Reference (Self : aliased in out Delimiter_List'Class; Cursor : Delimiter_Index) return Reference_Type with Inline; function Iterate (Self : aliased Delimiter_List'Class) return Delimiter_Iterator_Interfaces.Reversible_Iterator'Class; type Delimiter_Filter_Kind is (Any_Element, Kind_Of, Emphasis_Close, Emphasis_Open); type Delimiter_Filter (Kind : Delimiter_Filter_Kind := Any_Element) is record case Kind is when Any_Element | Emphasis_Close => null; when Kind_Of => Given_Kind : Delimiter_Kind; when Emphasis_Open => Emphasis : Emphasis_Kind; end case; end record; function Each (Self : aliased Delimiter_List'Class; Filter : Delimiter_Filter := (Kind => Any_Element); From : Delimiter_Index := 1; To : Extended_Delimiter_Index := Delimiter_Index'Last) return Delimiter_Iterator_Interfaces.Reversible_Iterator'Class; procedure Append (Self : in out Delimiter_List'Class; Item : Delimiter); private package Delimiter_Vectors is new Ada.Containers.Vectors (Delimiter_Index, Delimiter); type Delimiter_List is tagged record Data : Delimiter_Vectors.Vector; end record; end Delimiter_Lists; package body Delimiter_Lists is type Iterator is limited new Delimiter_Iterator_Interfaces.Reversible_Iterator with record List : not null access constant Delimiter_List; Filter : Delimiter_Filter; First : Delimiter_Index; Last : Extended_Delimiter_Index; end record; overriding function First (Self : Iterator) return Extended_Delimiter_Index; overriding function Last (Self : Iterator) return Extended_Delimiter_Index; overriding function Next (Self : Iterator; Index : Extended_Delimiter_Index) return Extended_Delimiter_Index; overriding function Previous (Self : Iterator; Index : Extended_Delimiter_Index) return Extended_Delimiter_Index; function Check (Item : Delimiter; Filter : Delimiter_Filter) return Boolean; ------------ -- Append -- ------------ procedure Append (Self : in out Delimiter_List'Class; Item : Delimiter) is begin Self.Data.Append (Item); end Append; ----------- -- Check -- ----------- function Check (Item : Delimiter; Filter : Delimiter_Filter) return Boolean is begin if not Item.Is_Deleted then case Filter.Kind is when Emphasis_Open => if Item.Kind = Filter.Emphasis and then Item.Can_Open then return True; end if; when Emphasis_Close => if Item.Kind in Emphasis_Kind and then Item.Can_Close then return True; end if; when Kind_Of => if Item.Kind = Filter.Given_Kind then return True; end if; when Any_Element => return True; end case; end if; return False; end Check; ---------- -- Each -- ---------- function Each (Self : aliased Delimiter_List'Class; Filter : Delimiter_Filter := (Kind => Any_Element); From : Delimiter_Index := 1; To : Extended_Delimiter_Index := Delimiter_Index'Last) return Delimiter_Iterator_Interfaces.Reversible_Iterator'Class is begin return Iterator'(Self'Access, Filter, From, Delimiter_Index'Min (To, Self.Data.Last_Index)); end Each; ----------- -- First -- ----------- overriding function First (Self : Iterator) return Extended_Delimiter_Index is begin for J in Self.First .. Self.Last loop if Check (Self.List.Data (J), Self.Filter) then return J; end if; end loop; return 0; end First; function Iterate (Self : aliased Delimiter_List'Class) return Delimiter_Iterator_Interfaces.Reversible_Iterator'Class is (Self.Each); overriding function Last (Self : Iterator) return Extended_Delimiter_Index is (Self.Previous (Self.Last + 1)); ---------- -- Next -- ---------- overriding function Next (Self : Iterator; Index : Extended_Delimiter_Index) return Extended_Delimiter_Index is begin if Index > 0 then for J in Index + 1 .. Self.Last loop if Check (Self.List.Data (J), Self.Filter) then return J; end if; end loop; end if; return 0; end Next; -------------- -- Previous -- -------------- overriding function Previous (Self : Iterator; Index : Extended_Delimiter_Index) return Extended_Delimiter_Index is begin if Index > 0 then for J in reverse Self.First .. Index - 1 loop if Check (Self.List.Data (J), Self.Filter) then return J; end if; end loop; end if; return 0; end Previous; function Reference (Self : aliased in out Delimiter_List'Class; Cursor : Delimiter_Index) return Reference_Type is begin return (Element => Self.Data.Reference (Cursor).Element); end Reference; end Delimiter_Lists; procedure Process_Emphasis (DL : in out Delimiter_Lists.Delimiter_List; Markup : in out Markup_Vectors.Vector; From : Delimiter_Lists.Delimiter_Index := 1; To : Delimiter_Lists.Delimiter_Index := Delimiter_Lists.Delimiter_Index'Last); procedure Process_Links (Register : Markdown.Link_Registers.Link_Register'Class; Text : Plain_Texts.Plain_Text; DL : in out Delimiter_Lists.Delimiter_List; Markup : in out Markup_Vectors.Vector; Bottom : Delimiter_Lists.Delimiter_Index := 1); procedure Parse_Link_Ahead (Register : Markdown.Link_Registers.Link_Register'Class; Text : Plain_Texts.Plain_Text; DL : in out Delimiter_Lists.Delimiter_List; Open : Delimiter_Lists.Delimiter_Index; Close : Delimiter_Lists.Delimiter_Index; URL : out League.Strings.Universal_String; Title : out League.String_Vectors.Universal_String_Vector; Ok : out Boolean); ---------------------- -- Find_All_Inlines -- ---------------------- procedure Find_All_Inlines (Text : Plain_Texts.Plain_Text; Cursor : Position; State : out Inline_Parser_State) is begin for Kind in State'Range loop Known_Inline (Kind) (Text, Cursor, State (Kind)); end loop; end Find_All_Inlines; ------------------ -- Parse_Inline -- ------------------ procedure Parse_Inline (Text : Plain_Texts.Plain_Text; State : in out Inline_Parser_State; Result : out Optional_Inline_State) is begin Result := (Is_Set => False); for X of State loop if X.Is_Set then if Result.Is_Set then if X.Span.From < Result.Span.From then Result := X; end if; else Result := X; end if; end if; end loop; if Result.Is_Set then declare Next : Position := Result.Span.To; begin Text.Step (1, Next); for Kind in State'Range loop if State (Kind).Is_Set and then State (Kind).Span.From <= Result.Span.To then if Next <= Text.Last then Known_Inline (Kind) (Text, Next, State (Kind)); else State (Kind) := (Is_Set => False); end if; end if; end loop; end; end if; end Parse_Inline; ---------------------- -- Parse_Link_Ahead -- ---------------------- procedure Parse_Link_Ahead (Register : Markdown.Link_Registers.Link_Register'Class; Text : Plain_Texts.Plain_Text; DL : in out Delimiter_Lists.Delimiter_List; Open : Delimiter_Lists.Delimiter_Index; Close : Delimiter_Lists.Delimiter_Index; URL : out League.Strings.Universal_String; Title : out League.String_Vectors.Universal_String_Vector; Ok : out Boolean) is procedure To_Link_Label (Text : Plain_Texts.Plain_Text; Open : Position; Close : Position; Label : out League.Strings.Universal_String; Ok : out Boolean); procedure To_Inline_Link (Text : Plain_Texts.Plain_Text; From : Position; To : in out Position; Ok : out Boolean); -------------------- -- To_Inline_Link -- -------------------- procedure To_Inline_Link (Text : Plain_Texts.Plain_Text; From : Position; To : in out Position; Ok : out Boolean) is Start : Wide_Wide_Character; -- Title quote character pragma Unreferenced (Start); Skip : Positive := From.Column; Last : Natural; Line : League.Strings.Universal_String := Text.Line ((From.Line, Skip + 1)); Match : League.Regexps.Regexp_Match := Link_Start_Pattern.Find_Match (Line); Complete : Boolean; -- We have whole inline_link matched Has_Title : Boolean; -- Is title complete begin if not Match.Is_Matched then Ok := False; -- No '(' return; end if; Skip := Skip + Match.Last_Index; Line := Line.Tail_From (Match.Last_Index + 1); -- drop '(' Markdown.Common_Patterns.Parse_Link_Destination (Line, Last, URL); if Last > 0 then Skip := Skip + Last; Line := Line.Tail_From (Last + 1); -- drop link destination end if; Match := Title_Pattern.Find_Match (Line); Complete := Match.Last_Index (6) >= Match.First_Index (6); if not Complete and Match.Last_Index /= Line.Length then Ok := False; -- unmatched text before ')' return; elsif Last > 0 and Match.Last_Index (1) >= Match.First_Index (1) and Match.First_Index (1) = 1 then Ok := False; -- No space between destinationa and title return; end if; Has_Title := (for some J of Title_Close_Group => Match.Last_Index (J) >= Match.First_Index (J)); Line := Match.Capture (1); if Has_Title then Title.Append (Line.Slice (2, Line.Length - 1)); elsif not Line.Is_Empty then if Complete then Ok := False; -- No closing ', " or ')' in link title return; end if; Start := Line (1).To_Wide_Wide_Character; Title.Append (Line.Tail_From (2)); end if; if Complete then To.Column := Skip + Match.Last_Index; Ok := True; return; end if; -- for J in To.Line + 1 .. Text.Length loop -- Line := Text (J); -- end loop; Ok := False; end To_Inline_Link; ------------------- -- To_Link_Label -- ------------------- procedure To_Link_Label (Text : Plain_Texts.Plain_Text; Open : Position; Close : Position; Label : out League.Strings.Universal_String; Ok : out Boolean) is Line : constant League.Strings.Universal_String := Text.Line (Open.Line); begin if Open.Line = Close.Line then Label := Line.Slice (Open.Column, Close.Column); Ok := True; else Ok := False; end if; end To_Link_Label; Label : League.Strings.Universal_String; begin To_Inline_Link (Text, DL (Close).From, DL (Close).To, Ok); if not Ok then To_Link_Label (Text, DL (Open).From, DL (Close).From, Label, Ok); if Ok then Register.Resolve (Label, Ok, URL, Title); end if; end if; end Parse_Link_Ahead; ---------------------- -- Process_Emphasis -- ---------------------- procedure Process_Emphasis (DL : in out Delimiter_Lists.Delimiter_List; Markup : in out Markup_Vectors.Vector; From : Delimiter_Lists.Delimiter_Index := 1; To : Delimiter_Lists.Delimiter_Index := Delimiter_Lists.Delimiter_Index'Last) is use Delimiter_Lists; Openers_Bottom : array (Emphasis_Kind, Natural range 0 .. 2) of Extended_Delimiter_Index := (others => (others => 0)); begin for J in DL.Each ((Kind => Emphasis_Close), From, To) loop declare Closer : Delimiter renames DL (J); Found : Boolean := False; begin Each_Open_Emphasis : for K in reverse DL.Each ((Emphasis_Open, Closer.Kind), From => Delimiter_Index'Max (From, Openers_Bottom (Closer.Kind, Closer.Count mod 3)), To => J - 1) loop declare Opener : Delimiter renames DL (K); Count : Positive range 1 .. 2; begin while not Opener.Is_Deleted and then -- If one of the delimiters can both open and close -- emphasis, then the sum of the lengths of the -- delimiter runs containing the opening and closing -- delimiters must not be a multiple of 3 unless both -- lengths are multiples of 3. (not ((Opener.Can_Open and Opener.Can_Close) or (Closer.Can_Open and Closer.Can_Close)) or else (Opener.Count + Closer.Count) mod 3 /= 0 or else (Opener.Count mod 3 = 0 and Closer.Count mod 3 = 0)) loop Found := True; Count := Positive'Min (2, Positive'Min (Opener.Count, Closer.Count)); Markup.Append ((Emphasis, Opener.From + (Opener.Count - Count), Count)); Markup.Append ((Emphasis, Closer.From, Count)); for M in K + 1 .. J - 1 loop DL (M).Is_Deleted := True; end loop; if Opener.Count = Count then Opener.Is_Deleted := True; else Opener.Count := Opener.Count - Count; end if; if Closer.Count = Count then Closer.Is_Deleted := True; exit Each_Open_Emphasis; else Closer.Count := Closer.Count - Count; Closer.From := Closer.From + Count; end if; end loop; end; end loop Each_Open_Emphasis; if not Found then if not Closer.Can_Open then Closer.Is_Deleted := True; end if; Openers_Bottom (Closer.Kind, Closer.Count mod 3) := J; end if; end; end loop; end Process_Emphasis; ------------------- -- Process_Links -- ------------------- procedure Process_Links (Register : Markdown.Link_Registers.Link_Register'Class; Text : Plain_Texts.Plain_Text; DL : in out Delimiter_Lists.Delimiter_List; Markup : in out Markup_Vectors.Vector; Bottom : Delimiter_Lists.Delimiter_Index := 1) is use Delimiter_Lists; begin for J in DL.Each ((Kind_Of, ']')) loop declare Closer : Delimiter renames DL (J); begin for K in reverse DL.Each ((Kind_Of, '['), From => Bottom, To => J - 1) loop declare Opener : Delimiter renames DL (K); URL : League.Strings.Universal_String; Title : League.String_Vectors.Universal_String_Vector; Ok : Boolean; begin Parse_Link_Ahead (Register, Text, DL, K, J, URL, Title, Ok); if Ok then Markup.Append ((Link, Opener.From, 1, URL, Title)); Markup.Append ((Link, Closer.From, Closer.To.Column - Closer.From.Column + 1, URL, Title)); Process_Emphasis (DL, Markup, K + 1, J - 1); for M in DL.Each ((Kind_Of, '['), From => Bottom, To => J - 1) loop DL (M).Is_Deleted := True; end loop; end if; end; end loop; Closer.Is_Deleted := True; end; end loop; end Process_Links; ----------------- -- Find_Markup -- ----------------- procedure Find_Markup (Register : Markdown.Link_Registers.Link_Register'Class; Text : Plain_Texts.Plain_Text; Markup : in out Markup_Vectors.Vector) is State : Scanner_State; List : Delimiter_Lists.Delimiter_List; Cursor : Position := Text.First; Item : Delimiter; Is_Delimiter : Boolean; begin while Cursor <= Text.Last loop Read_Delimiter (Text, Cursor, State, Item, Is_Delimiter); if Is_Delimiter then List.Append (Item); end if; end loop; Process_Links (Register, Text, List, Markup); Process_Emphasis (List, Markup); end Find_Markup; --------------- -- Get_State -- --------------- function Get_State (Text : Plain_Texts.Plain_Text; Cursor : Position) return Scanner_State is Line : League.Strings.Universal_String; -- FIXME: use Zs and Pc, Pd, Pe, Pf, Pi, Po, or Ps begin if Cursor > Text.Last or else Text.Line (Cursor.Line).Is_Empty then return (Is_White_Space => True, Is_Punctuation => False); else Line := Text.Line (Cursor.Line); end if; if Line (Cursor.Column).To_Wide_Wide_Character in ' ' then return (Is_White_Space => True, Is_Punctuation => False); elsif Line (Cursor.Column).To_Wide_Wide_Character in '!' | '"' | '#' | '$' | '%' | '&' | ''' | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '@' | '[' | '\' | ']' | '^' | '_' | '`' | '{' | '|' | '}' | '~' then return (Is_White_Space => False, Is_Punctuation => True); else return (Is_White_Space => False, Is_Punctuation => False); end if; end Get_State; ----------- -- Parse -- ----------- function Parse (Register : Markdown.Link_Registers.Link_Register'Class; Lines : League.String_Vectors.Universal_String_Vector) return Annotated_Text is Result : Annotated_Text; Text : Plain_Texts.Plain_Text; State : Inline_Parser_State := (Known_Inline'Range => <>); Cursor : Position; begin Text.Initialize (Lines); Cursor := Text.First; Find_All_Inlines (Text, Cursor, State); while Cursor <= Text.Last loop declare Markup : Markup_Vectors.Vector; Value : Optional_Inline_State; begin Parse_Inline (Text, State, Value); if Value.Is_Set then if Cursor /= Value.Span.From then declare Nested : Plain_Texts.Plain_Text; begin Nested.Initialize (Text, Cursor, Value.Span.From); Find_Markup (Register, Nested, Markup); Append (Result, To_Annotated_Text (Nested, Markup)); end; end if; Append (Result, Value.Value); Cursor := Value.Span.To; Text.Step (1, Cursor); else declare Nested : Plain_Texts.Plain_Text; begin Nested.Initialize (Text, Cursor); Find_Markup (Register, Nested, Markup); Append (Result, To_Annotated_Text (Nested, Markup)); Cursor := Text.Last; Text.Step (1, Cursor); end; end if; end; end loop; return Result; end Parse; -------------------- -- Read_Character -- -------------------- procedure Read_Character (Text : Plain_Texts.Plain_Text; Cursor : in out Position; Result : in out League.Strings.Universal_String) is Line : constant League.Strings.Universal_String := Text.Line (Cursor.Line); begin if Line.Is_Empty then Text.Step (1, Cursor); return; end if; case Line (Cursor.Column).To_Wide_Wide_Character is when '\' => Text.Step (1, Cursor); if Cursor > Text.Last then Result.Append ('\'); elsif Get_State (Text, Cursor).Is_Punctuation then Result.Append (Line (Cursor.Column)); Text.Step (1, Cursor); else Result.Append ('\'); end if; when others => Result.Append (Line (Cursor.Column)); Text.Step (1, Cursor); end case; end Read_Character; -------------------- -- Read_Delimiter -- -------------------- procedure Read_Delimiter (Text : Plain_Texts.Plain_Text; Cursor : in out Position; State : in out Scanner_State; Item : out Delimiter; Is_Delimiter : out Boolean) is function Get_Follow_State (Cursor : Position) return Scanner_State; ---------------------- -- Get_Follow_State -- ---------------------- function Get_Follow_State (Cursor : Position) return Scanner_State is begin if Cursor.Column = 1 then return (Is_White_Space => True, Is_Punctuation => False); else return Get_State (Text, Cursor); end if; end Get_Follow_State; Line : constant League.Strings.Universal_String := Text.Line (Cursor.Line); Follow : Scanner_State; begin if Line.Is_Empty then State := Get_State (Text, Cursor); Text.Step (1, Cursor); Is_Delimiter := False; return; end if; case Line (Cursor.Column).To_Wide_Wide_Character is when '*' => declare Next : Delimiter := (Kind => '*', From => Cursor, Count => Count_Character (Line, Cursor.Column), others => False); begin Text.Step (Next.Count, Cursor); Follow := Get_Follow_State (Cursor); -- Left flanking Next.Can_Open := not Follow.Is_White_Space and then (not Follow.Is_Punctuation or else (State.Is_White_Space or State.Is_Punctuation)); -- Right flanking Next.Can_Close := not State.Is_White_Space and then (not State.Is_Punctuation or else (Follow.Is_White_Space or Follow.Is_Punctuation)); State := Follow; Item := Next; Is_Delimiter := True; end; when '_' => declare Left_Flanking : Boolean; Right_Flanking : Boolean; Next : Delimiter := (Kind => '_', From => Cursor, Count => Count_Character (Line, Cursor.Column), others => False); begin Text.Step (Next.Count, Cursor); Follow := Get_Follow_State (Cursor); Left_Flanking := not Follow.Is_White_Space and then (not Follow.Is_Punctuation or else (State.Is_White_Space or State.Is_Punctuation)); -- Right flanking Right_Flanking := not State.Is_White_Space and then (not State.Is_Punctuation or else (Follow.Is_White_Space or Follow.Is_Punctuation)); Next.Can_Open := Left_Flanking and (not Right_Flanking or else State.Is_Punctuation); Next.Can_Close := Right_Flanking and (not Left_Flanking or else Follow.Is_Punctuation); State := Follow; Item := Next; Is_Delimiter := True; end; when '[' => State := Get_State (Text, Cursor); Item := (Kind => '[', From => Cursor, Is_Deleted => False); Text.Step (1, Cursor); Is_Delimiter := True; when ']' => State := Get_State (Text, Cursor); Item := (Kind => ']', From => Cursor, To => Cursor, Is_Deleted => False); Text.Step (1, Cursor); Is_Delimiter := True; when '\' => State := Get_State (Text, Cursor); Text.Step (2, Cursor); Is_Delimiter := False; when others => State := Get_State (Text, Cursor); Text.Step (1, Cursor); Is_Delimiter := False; end case; if Cursor.Column = 1 then State := (Is_White_Space => True, Is_Punctuation => False); end if; end Read_Delimiter; ----------------------- -- To_Annotated_Text -- ----------------------- function To_Annotated_Text (Text : Plain_Texts.Plain_Text; Markup : Markup_Vectors.Vector) return Annotated_Text is function Less (Left, Right : Positive) return Boolean; procedure Swap (Left, Right : Positive); Map : array (Positive range 1 .. Natural (Markup.Length)) of Markup_Index; Annotation_Map : array (Markup_Index range 1 .. Markup.Last_Index / 2) of Natural := (others => 0); ---------- -- Less -- ---------- function Less (Left, Right : Positive) return Boolean is L : Inline_Parsers.Markup renames Markup (Map (Left)); R : Inline_Parsers.Markup renames Markup (Map (Right)); begin return L.From.Line < R.From.Line or (L.From.Line = R.From.Line and L.From.Column < R.From.Column); end Less; ---------- -- Swap -- ---------- procedure Swap (Left, Right : Positive) is Temp : constant Markup_Index := Map (Left); begin Map (Left) := Map (Right); Map (Right) := Temp; end Swap; procedure Sort is new Ada.Containers.Generic_Anonymous_Array_Sort (Index_Type => Positive, Less => Less, Swap => Swap); Result : League.Strings.Universal_String; Cursor : Position := Text.First; Index : Positive := Map'First; Annotation : Annotation_Vectors.Vector; begin for J in 1 .. Map'Last loop Map (J) := Markup_Index (J); end loop; Sort (1, Map'Last); while Cursor <= Text.Last loop if Index in Map'Range and then Cursor = Markup (Map (Index)).From then declare Item : Inline_Parsers.Markup renames Markup (Map (Index)); begin if Map (Index) mod 2 = 1 then -- Open markup Annotation.Append (To_Annotation (Item, Result.Length + 1)); Annotation_Map ((Map (Index) + 1) / 2) := Annotation.Last_Index; else -- Close markup Annotation (Annotation_Map ((Map (Index)) / 2)).To := Result.Length; end if; Text.Step (Item.Length, Cursor); Index := Index + 1; end; else Read_Character (Text, Cursor, Result); end if; if Cursor <= Text.Last and Cursor.Column = 1 then Result.Append (' '); Annotation.Append ((Soft_Line_Break, Result.Length, Result.Length)); end if; end loop; return (Result, Annotation); end To_Annotated_Text; ------------------- -- To_Annotation -- ------------------- function To_Annotation (Item : Markup; Pos : Positive) return Annotation is begin if Item.Kind = Link then return (Link, Pos, Pos, Item.URL, Item.Title); elsif Item.Length = 1 then return (Emphasis, Pos, Pos); else return (Strong, Pos, Pos); end if; end To_Annotation; end Markdown.Inline_Parsers;
with Ada.Text_IO; use Ada.Text_IO; generic N, H : in Natural; package Data is type Vector is array(Integer range <>) of Integer; Subtype VectorN is Vector(1..N); Subtype Vector4H is Vector(1..4 * H); Subtype Vector3H is Vector(1..3 * H); Subtype Vector2H is Vector(1..2 * H); Subtype VectorH is Vector(1..H); type Matrix is array(Integer range <>) of VectorN; Subtype MatrixN is Matrix(1..N); Subtype Matrix4H is Matrix(1..4 * H); Subtype Matrix3H is Matrix(1..3 * H); Subtype Matrix2H is Matrix(1..2 * H); Subtype MatrixH is Matrix(1..H); procedure Input ( V : out Vector; Value : in Integer); procedure Input ( MA : out Matrix; Value : in Integer); procedure Output (V : in VectorN); procedure Output (MA : in Matrix); procedure FindMinZ (V : in VectorH; minZi : out Integer); function Min (A, B: Integer) return Integer; function Calculation (X : in VectorN; MA : in MatrixN; MS : in MatrixH; q : in Integer; R : in VectorN; MF: in MatrixH) return VectorH; end Data;
package Semaphores is protected type SIMA (Initial_Value: Natural; Max_Value: Natural;) is entry P; entry V; private Count : Natural := Initial_Value; Max_Count : Natural := Max_Value; end SIMA; end Semaphores;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T . M B B S _ F L O A T _ R A N D O M -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Calendar; package body GNAT.MBBS_Float_Random is ------------------------- -- Implementation Note -- ------------------------- -- The design of this spec is a bit awkward, as a result of Ada 95 not -- permitting in-out parameters for function formals (most naturally -- Generator values would be passed this way). In pure Ada 95, the only -- solution would be to add a self-referential component to the generator -- allowing access to the generator object from inside the function. This -- would work because the generator is limited, which prevents any copy. -- This is a bit heavy, so what we do is to use Unrestricted_Access to -- get a pointer to the state in the passed Generator. This works because -- Generator is a limited type and will thus always be passed by reference. package Calendar renames Ada.Calendar; type Pointer is access all State; ----------------------- -- Local Subprograms -- ----------------------- procedure Euclid (P, Q : Int; X, Y : out Int; GCD : out Int); function Euclid (P, Q : Int) return Int; function Square_Mod_N (X, N : Int) return Int; ------------ -- Euclid -- ------------ procedure Euclid (P, Q : Int; X, Y : out Int; GCD : out Int) is XT : Int := 1; YT : Int := 0; procedure Recur (P, Q : Int; -- a (i-1), a (i) X, Y : Int; -- x (i), y (i) XP, YP : in out Int; -- x (i-1), y (i-1) GCD : out Int); procedure Recur (P, Q : Int; X, Y : Int; XP, YP : in out Int; GCD : out Int) is Quo : Int := P / Q; -- q <-- |_ a (i-1) / a (i) _| XT : Int := X; -- x (i) YT : Int := Y; -- y (i) begin if P rem Q = 0 then -- while does not divide GCD := Q; XP := X; YP := Y; else Recur (Q, P - Q * Quo, XP - Quo * X, YP - Quo * Y, XT, YT, Quo); -- a (i) <== a (i) -- a (i+1) <-- a (i-1) - q*a (i) -- x (i+1) <-- x (i-1) - q*x (i) -- y (i+1) <-- y (i-1) - q*y (i) -- x (i) <== x (i) -- y (i) <== y (i) XP := XT; YP := YT; GCD := Quo; end if; end Recur; -- Start of processing for Euclid begin Recur (P, Q, 0, 1, XT, YT, GCD); X := XT; Y := YT; end Euclid; function Euclid (P, Q : Int) return Int is X, Y, GCD : Int; pragma Unreferenced (Y, GCD); begin Euclid (P, Q, X, Y, GCD); return X; end Euclid; ----------- -- Image -- ----------- function Image (Of_State : State) return String is begin return Int'Image (Of_State.X1) & ',' & Int'Image (Of_State.X2) & ',' & Int'Image (Of_State.P) & ',' & Int'Image (Of_State.Q); end Image; ------------ -- Random -- ------------ function Random (Gen : Generator) return Uniformly_Distributed is Genp : constant Pointer := Gen.Gen_State'Unrestricted_Access; begin Genp.X1 := Square_Mod_N (Genp.X1, Genp.P); Genp.X2 := Square_Mod_N (Genp.X2, Genp.Q); return Float ((Flt (((Genp.X2 - Genp.X1) * Genp.X) mod Genp.Q) * Flt (Genp.P) + Flt (Genp.X1)) * Genp.Scl); end Random; ----------- -- Reset -- ----------- -- Version that works from given initiator value procedure Reset (Gen : Generator; Initiator : Integer) is Genp : constant Pointer := Gen.Gen_State'Unrestricted_Access; X1, X2 : Int; begin X1 := 2 + Int (Initiator) mod (K1 - 3); X2 := 2 + Int (Initiator) mod (K2 - 3); -- Eliminate effects of small initiators for J in 1 .. 5 loop X1 := Square_Mod_N (X1, K1); X2 := Square_Mod_N (X2, K2); end loop; Genp.all := (X1 => X1, X2 => X2, P => K1, Q => K2, X => 1, Scl => Scal); end Reset; -- Version that works from specific saved state procedure Reset (Gen : Generator; From_State : State) is Genp : constant Pointer := Gen.Gen_State'Unrestricted_Access; begin Genp.all := From_State; end Reset; -- Version that works from calendar procedure Reset (Gen : Generator) is Genp : constant Pointer := Gen.Gen_State'Unrestricted_Access; Now : constant Calendar.Time := Calendar.Clock; X1, X2 : Int; begin X1 := Int (Calendar.Year (Now)) * 12 * 31 + Int (Calendar.Month (Now)) * 31 + Int (Calendar.Day (Now)); X2 := Int (Calendar.Seconds (Now) * Duration (1000.0)); X1 := 2 + X1 mod (K1 - 3); X2 := 2 + X2 mod (K2 - 3); -- Eliminate visible effects of same day starts for J in 1 .. 5 loop X1 := Square_Mod_N (X1, K1); X2 := Square_Mod_N (X2, K2); end loop; Genp.all := (X1 => X1, X2 => X2, P => K1, Q => K2, X => 1, Scl => Scal); end Reset; ---------- -- Save -- ---------- procedure Save (Gen : Generator; To_State : out State) is begin To_State := Gen.Gen_State; end Save; ------------------ -- Square_Mod_N -- ------------------ function Square_Mod_N (X, N : Int) return Int is Temp : constant Flt := Flt (X) * Flt (X); Div : Int; begin Div := Int (Temp / Flt (N)); Div := Int (Temp - Flt (Div) * Flt (N)); if Div < 0 then return Div + N; else return Div; end if; end Square_Mod_N; ----------- -- Value -- ----------- function Value (Coded_State : String) return State is Last : constant Natural := Coded_State'Last; Start : Positive := Coded_State'First; Stop : Positive := Coded_State'First; Outs : State; begin while Stop <= Last and then Coded_State (Stop) /= ',' loop Stop := Stop + 1; end loop; if Stop > Last then raise Constraint_Error; end if; Outs.X1 := Int'Value (Coded_State (Start .. Stop - 1)); Start := Stop + 1; loop Stop := Stop + 1; exit when Stop > Last or else Coded_State (Stop) = ','; end loop; if Stop > Last then raise Constraint_Error; end if; Outs.X2 := Int'Value (Coded_State (Start .. Stop - 1)); Start := Stop + 1; loop Stop := Stop + 1; exit when Stop > Last or else Coded_State (Stop) = ','; end loop; if Stop > Last then raise Constraint_Error; end if; Outs.P := Int'Value (Coded_State (Start .. Stop - 1)); Outs.Q := Int'Value (Coded_State (Stop + 1 .. Last)); Outs.X := Euclid (Outs.P, Outs.Q); Outs.Scl := 1.0 / (Flt (Outs.P) * Flt (Outs.Q)); -- Now do *some* sanity checks if Outs.Q < 31 or else Outs.P < 31 or else Outs.X1 not in 2 .. Outs.P - 1 or else Outs.X2 not in 2 .. Outs.Q - 1 then raise Constraint_Error; end if; return Outs; end Value; end GNAT.MBBS_Float_Random;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Editor_Package; use Editor_Package; with Utilities_Package; use Utilities_Package; package Command_Package is type Cmd_Flag_Type is ( NOFLAGS, MARK, CLEARSBLOCK, NEEDSLINE, NEEDSBLOCK, SETSHILITE, NOLOCATOR); type Arg_Type is (ARG_STRING); type Arg is record T : Arg_Type; S1 : Unbounded_String; end record; type Cmd_Func_Type is access procedure (E : in out Editor; V : in out View; A : Arg); procedure Run_File (E : Editor; V : in out View; A : Arg); function Command (E : in out Editor; V : in out View; F : Cmd_Flag_Type; Func : Cmd_Func_Type; A : Arg) return Boolean; procedure Cmd_Insert_File (E : in out Editor; V : in out View; A : Arg); procedure Fix_Block (V : in out View); private function Test_None (V : View) return Boolean; end Command_Package;
---------------------------------------------------------------- -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2003 Dmitriy Anisimkov -- -- -- -- Open source license information is in the zlib.ads file. -- ---------------------------------------------------------------- -- $Id: zlib-streams.ads,v 1.11 2003/08/12 13:15:31 vagul Exp $ package ZLib.Streams is type Stream_Mode is (In_Stream, Out_Stream, Duplex); type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class; type Stream_Type is new Ada.Streams.Root_Stream_Type with private; procedure Read (Stream : in out Stream_Type; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); procedure Write (Stream : in out Stream_Type; Item : in Ada.Streams.Stream_Element_Array); procedure Flush (Stream : in out Stream_Type; Mode : in Flush_Mode := Sync_Flush); -- Flush the written data to the back stream, -- all data placed to the compressor is flushing to the Back stream. -- Should not be used untill necessary, becouse it is decreasing -- compression. function Read_Total_In (Stream : in Stream_Type) return Count; pragma Inline (Read_Total_In); -- Return total number of bytes read from back stream so far. function Read_Total_Out (Stream : in Stream_Type) return Count; pragma Inline (Read_Total_Out); -- Return total number of bytes read so far. function Write_Total_In (Stream : in Stream_Type) return Count; pragma Inline (Write_Total_In); -- Return total number of bytes written so far. function Write_Total_Out (Stream : in Stream_Type) return Count; pragma Inline (Write_Total_Out); -- Return total number of bytes written to the back stream. procedure Create (Stream : out Stream_Type; Mode : in Stream_Mode; Back : in Stream_Access; Back_Compressed : in Boolean; Level : in Compression_Level := Default_Compression; Strategy : in Strategy_Type := Default_Strategy; Header : in Header_Type := Default; Read_Buffer_Size : in Ada.Streams.Stream_Element_Offset := Default_Buffer_Size; Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset := Default_Buffer_Size); -- Create the Comression/Decompression stream. -- If mode is In_Stream then Write operation is disabled. -- If mode is Out_Stream then Read operation is disabled. -- If Back_Compressed is true then -- Data written to the Stream is compressing to the Back stream -- and data read from the Stream is decompressed data from the Back stream. -- If Back_Compressed is false then -- Data written to the Stream is decompressing to the Back stream -- and data read from the Stream is compressed data from the Back stream. -- !!! When the Need_Header is False ZLib-Ada is using undocumented -- ZLib 1.1.4 functionality to do not create/wait for ZLib headers. procedure Close (Stream : in out Stream_Type); private use Ada.Streams; type Buffer_Access is access all Stream_Element_Array; type Stream_Type is new Root_Stream_Type with record Mode : Stream_Mode; Buffer : Buffer_Access; Rest_First : Stream_Element_Offset; Rest_Last : Stream_Element_Offset; -- Buffer for Read operation. -- We need to have this buffer in the record -- becouse not all read data from back stream -- could be processed during the read operation. Buffer_Size : Stream_Element_Offset; -- Buffer size for write operation. -- We do not need to have this buffer -- in the record becouse all data could be -- processed in the write operation. Back : Stream_Access; Reader : Filter_Type; Writer : Filter_Type; end record; end ZLib.Streams;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Tools Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2015-2018, Vadim Godunko <vgodunko@gmail.com> -- -- 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 Asis; with League.Strings; package Properties.Tools is function Get_Aspect (Element : Asis.Declaration; Name : Wide_String) return Wide_String; function Library_Level_Header (Unit : Asis.Compilation_Unit) return League.Strings.Universal_String; function Corresponding_Type_Subprograms (Definition : Asis.Definition) return Asis.Declaration_List; -- For given type definition return list of primitive subprograms function Corresponding_Type_Components (Definition : Asis.Definition) return Asis.Declaration_List; -- For given (non-array complex) type definition return list of component function Corresponding_Type_Discriminants (Definition : Asis.Definition) return Asis.Declaration_List; -- For given (non-array complex) type definition return list of discr-s. function Is_Primitive_Subprogram (Definition : Asis.Definition; Subprogram : Asis.Declaration) return Boolean; -- Check if given Subprogram is primitive subprograms for given type function Parameter_Profile (Prefix : Asis.Expression) return Asis.Parameter_Specification_List; -- For given prefix of procedure call return corresponding parameter -- declaration list function Corresponding_Type (Declaration : Asis.Declaration) return Asis.Declaration; -- Return type declaration for given primitive subprogram function Corresponding_Declaration (Name : Asis.Expression) return Asis.Declaration; -- Like Asis.Expressions.Corresponding_Name_Declaration, but takes -- selector of selected_component function Type_Declaration_View (Declaration : Asis.Declaration) return Asis.Definition; -- Like Asis.Declarations.Type_Declaration_View but expand derived types function Array_Component_Definition (Type_Definition : Asis.Type_Definition) return Asis.Component_Definition; -- Like Asis.Definitions.Array_Component_Definition, but takes into account -- implicit dereference. function Is_Equal_Type (Left : Asis.Declaration; Right : Asis.Declaration) return Boolean; function Is_Array (Exp : Asis.Expression) return Boolean; function Enclosing_Declaration (X : Asis.Element) return Asis.Declaration; function Has_Controlling_Result (Func : Asis.Declaration) return Boolean; -- Check if function Func is like 'function F return T' where T is tagged function Is_Array_Buffer (Element : Asis.Declaration) return Boolean; -- Check if given type declaration has corresponding pragma -- JavaScript_Array_Buffer function Join (Left, Right : League.Strings.Universal_String) return League.Strings.Universal_String; -- Return Left & Right function Comma (Left, Right : League.Strings.Universal_String) return League.Strings.Universal_String; -- Return Left & "," & Right function "or" (Left, Right : Boolean) return Boolean is (Standard."or" (Left, Right)); function Get_Dimension (Exp : Asis.Expression) return Natural; -- Return dimention of an array aggregate Exp. Return 0 if subaggregate function Attribute_Definition (Decl : Asis.Declaration; Attr : Wide_String) return Asis.Expression; -- find corresponding attribute declaration end Properties.Tools;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2018, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- USB Device Controller stub for testing with Ada.Containers.Doubly_Linked_Lists; with System; with HAL; use HAL; with USB; use USB; with USB.Device; use USB.Device; with USB.HAL.Device; use USB.HAL.Device; with USB.Utils; package USB_Testing.UDC_Stub is type Scenario_Event_Kind is (Set_Verbose, UDC_Event_E, Transfer_Out, Transfer_In); type Scenario_Event (Kind : Scenario_Event_Kind := UDC_Event_E) is record case Kind is when Set_Verbose => Verbose : Boolean; when UDC_Event_E => Evt : UDC_Event; when Transfer_Out => EP_Out : EP_Id; Count_Out : Natural; when Transfer_In => EP_In : EP_Id; end case; end record; type Stub_Scenario is array (Natural range <>) of Scenario_Event; Empty_Scenario : constant Stub_Scenario (1 .. 0) := (others => <>); type Controller (Scenario : not null access constant Stub_Scenario; RX_Data : not null access constant UInt8_Array; Has_Early_Address : Boolean; Max_Packet_Size : UInt32; EP_Buffers_Size : Natural; Number_Of_EPs : EP_Id) is new USB_Device_Controller with private; function End_Of_Scenario (This : Controller) return Boolean; overriding procedure Initialize (This : in out Controller); overriding function Request_Buffer (This : in out Controller; Ep : EP_Addr; Len : UInt11; Min_Alignment : UInt8 := 1) return System.Address; overriding function Valid_EP_Id (This : in out Controller; EP : EP_Id) return Boolean is (EP <= This.Number_Of_EPs); overriding procedure Start (This : in out Controller); overriding procedure Reset (This : in out Controller); overriding function Poll (This : in out Controller) return UDC_Event; overriding procedure EP_Write_Packet (This : in out Controller; Ep : EP_Id; Addr : System.Address; Len : UInt32); overriding procedure EP_Setup (This : in out Controller; EP : EP_Addr; Typ : EP_Type; Max_Size : UInt16); overriding procedure EP_Ready_For_Data (This : in out Controller; EP : EP_Id; Addr : System.Address; Size : UInt32; Ready : Boolean := True); overriding procedure EP_Stall (This : in out Controller; EP : EP_Addr; Set : Boolean); overriding procedure Set_Address (This : in out Controller; Addr : UInt7); overriding function Early_Address (This : Controller) return Boolean is (This.Has_Early_Address); private package Event_Stack is new Ada.Containers.Doubly_Linked_Lists (Scenario_Event); use Event_Stack; type EP_Stub is record Setup : Boolean := False; NAK : Boolean := False; Stall : Boolean := False; Typ : EP_Type := Control; Buf : System.Address := System.Null_Address; Buf_Len : UInt11 := 0; Max_Size : UInt16 := 0; Scenario_Waiting_For_Data : Boolean := False; end record; type EP_Stub_Couple is array (EP_Dir) of EP_Stub; type EP_Stub_Array is array (EP_Id range <>) of EP_Stub_Couple; type Controller_State is (Nominal, Device_To_Host_Transfer, Host_To_Device_Transfer); type Controller (Scenario : not null access constant Stub_Scenario; RX_Data : not null access constant UInt8_Array; Has_Early_Address : Boolean; Max_Packet_Size : UInt32; EP_Buffers_Size : Natural; Number_Of_EPs : EP_Id) is new USB_Device_Controller with record State : Controller_State := Nominal; Stack : Event_Stack.List; Scenario_Index : Natural := Scenario.all'First; RX_Index : Natural := RX_Data.all'First; Verbose : Boolean := True; EPs : EP_Stub_Array (0 .. 5); -- Arbitrary number of EP Got_Ack : Boolean := False; Alloc : USB.Utils.Basic_RAM_Allocator (EP_Buffers_Size); end record; function Pop (This : in out Controller) return Scenario_Event with Pre => not This.Stack.Is_Empty; procedure Push (This : in out Controller; Evt : Scenario_Event); procedure Put_Line (This : Controller; Str : String); -- Print on the console iff in verbose mode procedure Put (This : Controller; Str : String); -- Print on the console iff in verbose mode procedure Hex_Dump (This : Controller; Data : HAL.UInt8_Array); -- Print on the console iff in verbose mode end USB_Testing.UDC_Stub;
-- MIT License -- -- Copyright (c) 2020 Max Reznik -- -- 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 League.Strings; with Google.Protobuf.Descriptor; with Google.Protobuf.Compiler.Plugin; with Compiler.Context; package Compiler.File_Descriptors is procedure Populate_Named_Types (Self : Google.Protobuf.Descriptor.File_Descriptor_Proto; Map : in out Compiler.Context.Named_Type_Maps.Map); -- Fill Map with type information found in a file descriptor function File_Name (Self : Google.Protobuf.Descriptor.File_Descriptor_Proto) return League.Strings.Universal_String; -- Return base name for Ada package function Specification_Text (Self : Google.Protobuf.Descriptor.File_Descriptor_Proto; Request : Google.Protobuf.Compiler.Plugin.Code_Generator_Request) return League.Strings.Universal_String; -- Return base name for Ada package function Body_Text (Self : Google.Protobuf.Descriptor.File_Descriptor_Proto) return League.Strings.Universal_String; end Compiler.File_Descriptors;
----------------------------------------------------------------------- -- security-random-tests - Tests for random package -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- 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 Security.Random.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; procedure Test_Generate (T : in out Test); end Security.Random.Tests;