hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
163 values
lang
stringclasses
53 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
112
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
sequencelengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
113
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
sequencelengths
1
10
max_issues_count
float64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
113
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
sequencelengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
3
1.05M
avg_line_length
float64
1
966k
max_line_length
int64
1
977k
alphanum_fraction
float64
0
1
a1d86f3ab77f0289a9ec0faa1603a2c89408bac3
3,784
ads
Ada
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-comver.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-comver.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-comver.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . C O M P I L E R _ V E R S I O N -- -- -- -- S p e c -- -- -- -- Copyright (C) 2002-2021, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides a routine for obtaining the version number of the -- GNAT compiler used to compile the program. It relies on the generated -- constant in the binder generated package that records this information. -- Note: to use this package you must first instantiate it, for example: -- package CVer is new GNAT.Compiler_Version; -- and then you use the function in the instantiated package (Cver.Version). -- The reason that this unit is generic is that otherwise the direct attempt -- to import the necessary variable from the binder file causes trouble when -- building a shared library, since the symbol is not available. -- Note: this unit is only useable if the main program is written in Ada. -- It cannot be used if the main program is written in foreign language. generic package GNAT.Compiler_Version is pragma Pure; function Version return String; -- This function returns the version in the form "v.vvx (yyyyddmm)". -- Here v.vv is the main version number (e.g. 3.16), x is the version -- designator (e.g. a1 in 3.16a1), and yyyyddmm is the date in ISO form. -- An example of the returned value would be "3.16w (20021029)". The -- version is actually that of the binder used to bind the program, -- which will be the same as the compiler version if a consistent -- set of tools is used to build the program. end GNAT.Compiler_Version;
61.032258
78
0.45666
06b0c0b1c0ca59c553db9c78586f424f562f33e1
467
adb
Ada
examples/ada-config/src/show_config.adb
stcarrez/resource-embedder
b1134306db459f87506703ba0a266c0b5e0045b9
[ "Apache-2.0" ]
7
2021-06-04T16:58:59.000Z
2021-06-14T08:51:11.000Z
examples/ada-config/src/show_config.adb
stcarrez/resource-embedder
b1134306db459f87506703ba0a266c0b5e0045b9
[ "Apache-2.0" ]
2
2021-07-20T15:25:33.000Z
2021-08-20T18:39:58.000Z
examples/ada-config/src/show_config.adb
stcarrez/resource-embedder
b1134306db459f87506703ba0a266c0b5e0045b9
[ "Apache-2.0" ]
null
null
null
with Ada.Text_IO; with Ada.Command_Line; with Config; procedure Show_Config is use Config; C : constant Content_Type := Get_Content ("example.conf"); begin if C.Content = null then Ada.Text_IO.Put_Line ("FAIL: No configuration file 'example.conf'"); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); return; end if; for Val of C.Content.all loop Ada.Text_IO.Put (Character'Val (Val)); end loop; end Show_Config;
24.578947
74
0.700214
12f3483e6dd759f5351cf6b2447e009ab3d18be9
2,414
ads
Ada
source/asis/spec/ada-sequential_io.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
4
2016-02-05T15:51:56.000Z
2022-03-25T20:38:32.000Z
source/asis/spec/ada-sequential_io.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
source/asis/spec/ada-sequential_io.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- A d a r u n - t i m e s p e c i f i c a t i o n -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of ada.ads file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ with Ada.IO_Exceptions; generic type Element_Type (<>) is private; package Ada.Sequential_IO is type File_Type is limited private; type File_Mode is (In_File, Out_File, Append_File); -- File management procedure Create (File : in out File_Type; Mode : in File_Mode := Out_File; Name : in String := ""; Form : in String := ""); procedure Open (File : in out File_Type; Mode : in File_Mode; Name : in String; Form : in String := ""); procedure Close (File : in out File_Type); procedure Delete (File : in out File_Type); procedure Reset (File : in out File_Type; Mode : in File_Mode); procedure Reset (File : in out File_Type); function Mode (File : in File_Type) return File_Mode; function Name (File : in File_Type) return String; function Form (File : in File_Type) return String; function Is_Open (File : in File_Type) return Boolean; -- Input and output operations procedure Read (File : in File_Type; Item : out Element_Type); procedure Write (File : in File_Type; Item : in Element_Type); function End_Of_File (File : in File_Type) return Boolean; -- Exceptions Status_Error : exception renames IO_Exceptions.Status_Error; Mode_Error : exception renames IO_Exceptions.Mode_Error; Name_Error : exception renames IO_Exceptions.Name_Error; Use_Error : exception renames IO_Exceptions.Use_Error; Device_Error : exception renames IO_Exceptions.Device_Error; End_Error : exception renames IO_Exceptions.End_Error; Data_Error : exception renames IO_Exceptions.Data_Error; private type File_Type is limited null record; end Ada.Sequential_IO;
36.029851
78
0.570423
06c6ea33de2292ff89654dc93fefd508c2ed4440
2,599
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c66002g.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c66002g.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c66002g.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C66002G.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 OVERLOADED SUBPROGRAM DECLARATIONS -- ARE PERMITTED IN WHICH THERE IS A MINIMAL -- DIFFERENCE BETWEEN THE DECLARATIONS. -- (G) THE RESULT TYPE OF TWO FUNCTION DECLARATIONS IS DIFFERENT. -- CVP 5/4/81 -- JRK 5/8/81 -- NL 10/13/81 -- SPS 10/26/82 WITH REPORT; PROCEDURE C66002G IS USE REPORT; BEGIN TEST ("C66002G", "SUBPROGRAM OVERLOADING WITH " & "MINIMAL DIFFERENCES ALLOWED"); -------------------------------------------------- -- THE RESULT TYPES OF TWO FUNCTION -- DECLARATIONS ARE DIFFERENT. DECLARE I : INTEGER; B : BOOLEAN; S : STRING (1..2) := "12"; FUNCTION F RETURN INTEGER IS BEGIN S(1) := 'A'; RETURN IDENT_INT (0); -- THIS VALUE IS IRRELEVENT. END F; FUNCTION F RETURN BOOLEAN IS BEGIN S(2) := 'B'; RETURN IDENT_BOOL (TRUE); -- THIS VALUE IS IRRELEVANT. END F; BEGIN I := F; B := F; IF S /= "AB" THEN FAILED ("FUNCTIONS DIFFERING ONLY IN " & "BASE TYPE OF RETURNED VALUE " & "CAUSED CONFUSION"); END IF; END; -------------------------------------------------- RESULT; END C66002G;
31.313253
79
0.572913
4d14d1d4efb36af269a31a6253a4873d77ef65d0
23,486
adb
Ada
src/latin_utils/latin_utils-inflections_package.adb
Alex-Vasile/whitakers-words
9fa16606d97842746fea0379839f40c959c53d56
[ "FTL" ]
3
2019-02-22T13:24:42.000Z
2021-02-22T13:20:55.000Z
src/latin_utils/latin_utils-inflections_package.adb
Alex-Vasile/whitakers-words
9fa16606d97842746fea0379839f40c959c53d56
[ "FTL" ]
null
null
null
src/latin_utils/latin_utils-inflections_package.adb
Alex-Vasile/whitakers-words
9fa16606d97842746fea0379839f40c959c53d56
[ "FTL" ]
null
null
null
-- WORDS, a Latin dictionary, by Colonel William Whitaker (USAF, Retired) -- -- Copyright William A. Whitaker (1936–2010) -- -- This is a free program, which means it is proper to copy it and pass -- it on to your friends. Consider it a developmental item for which -- there is no charge. However, just for form, it is Copyrighted -- (c). Permission is hereby freely given for any and all use of program -- and data. You can sell it as your own, but at least tell me. -- -- This version is distributed without obligation, but the developer -- would appreciate comments and suggestions. -- -- All parts of the WORDS system, source code and data files, are made freely -- available to anyone who wishes to use them, for whatever purpose. with Ada.Integer_Text_IO; with Latin_Utils.Latin_File_Names; use Latin_Utils.Latin_File_Names; with Latin_Utils.Preface; package body Latin_Utils.Inflections_Package is --------------------------------------------------------------------------- function "<" (Left, Right : Decn_Record) return Boolean is begin if Left.Which < Right.Which or else (Left.Which = Right.Which and then Left.Var < Right.Var) then return True; else return False; end if; end "<"; --------------------------------------------------------------------------- -- FIXME: should the function below, comparing two Quality_Records -- not call the function above, comparing two Decn_Records? function "<" (Left, Right : Quality_Record) return Boolean is begin if Left.Pofs = Right.Pofs then case Left.Pofs is when N => if Left.Noun.Decl.Which < Right.Noun.Decl.Which or else (Left.Noun.Decl.Which = Right.Noun.Decl.Which and then Left.Noun.Decl.Var < Right.Noun.Decl.Var) or else (Left.Noun.Decl.Which = Right.Noun.Decl.Which and then Left.Noun.Decl.Var = Right.Noun.Decl.Var and then Left.Noun.Number < Right.Noun.Number) or else (Left.Noun.Decl.Which = Right.Noun.Decl.Which and then Left.Noun.Decl.Var = Right.Noun.Decl.Var and then Left.Noun.Number = Right.Noun.Number and then Left.Noun.Of_Case < Right.Noun.Of_Case) or else (Left.Noun.Decl.Which = Right.Noun.Decl.Which and then Left.Noun.Decl.Var = Right.Noun.Decl.Var and then Left.Noun.Number = Right.Noun.Number and then Left.Noun.Of_Case = Right.Noun.Of_Case and then Left.Noun.Gender < Right.Noun.Gender) then return True; end if; when Pron => if Left.Pron.Decl.Which < Right.Pron.Decl.Which or else (Left.Pron.Decl.Which = Right.Pron.Decl.Which and then Left.Pron.Decl.Var < Right.Pron.Decl.Var) or else (Left.Pron.Decl.Which = Right.Pron.Decl.Which and then Left.Pron.Decl.Var = Right.Pron.Decl.Var and then Left.Pron.Number < Right.Pron.Number) or else (Left.Pron.Decl.Which = Right.Pron.Decl.Which and then Left.Pron.Decl.Var = Right.Pron.Decl.Var and then Left.Pron.Number = Right.Pron.Number and then Left.Pron.Of_Case < Right.Pron.Of_Case) or else (Left.Pron.Decl.Which = Right.Pron.Decl.Which and then Left.Pron.Decl.Var = Right.Pron.Decl.Var and then Left.Pron.Number = Right.Pron.Number and then Left.Pron.Of_Case = Right.Pron.Of_Case and then Left.Pron.Gender < Right.Pron.Gender) then return True; end if; when Pack => if Left.Pack.Decl.Which < Right.Pack.Decl.Which or else (Left.Pack.Decl.Which = Right.Pack.Decl.Which and then Left.Pack.Decl.Var < Right.Pack.Decl.Var) or else (Left.Pack.Decl.Which = Right.Pack.Decl.Which and then Left.Pack.Decl.Var = Right.Pack.Decl.Var and then Left.Pack.Number < Right.Pack.Number) or else (Left.Pack.Decl.Which = Right.Pack.Decl.Which and then Left.Pack.Decl.Var = Right.Pack.Decl.Var and then Left.Pack.Number = Right.Pack.Number and then Left.Pack.Of_Case < Right.Pack.Of_Case) or else (Left.Pack.Decl.Which = Right.Pack.Decl.Which and then Left.Pack.Decl.Var = Right.Pack.Decl.Var and then Left.Pack.Number = Right.Pack.Number and then Left.Pack.Of_Case = Right.Pack.Of_Case and then Left.Pack.Gender < Right.Pack.Gender) then return True; end if; when Adj => if Left.Adj.Decl.Which < Right.Adj.Decl.Which or else (Left.Adj.Decl.Which = Right.Adj.Decl.Which and then Left.Adj.Decl.Var < Right.Adj.Decl.Var) or else (Left.Adj.Decl.Which = Right.Adj.Decl.Which and then Left.Adj.Decl.Var = Right.Adj.Decl.Var and then Left.Adj.Number < Right.Adj.Number) or else (Left.Adj.Decl.Which = Right.Adj.Decl.Which and then Left.Adj.Decl.Var = Right.Adj.Decl.Var and then Left.Adj.Number = Right.Adj.Number and then Left.Adj.Of_Case < Right.Adj.Of_Case) or else (Left.Adj.Decl.Which = Right.Adj.Decl.Which and then Left.Adj.Decl.Var = Right.Adj.Decl.Var and then Left.Adj.Number = Right.Adj.Number and then Left.Adj.Of_Case = Right.Adj.Of_Case and then Left.Adj.Gender < Right.Adj.Gender) or else (Left.Adj.Decl.Which = Right.Adj.Decl.Which and then Left.Adj.Decl.Var = Right.Adj.Decl.Var and then Left.Adj.Number = Right.Adj.Number and then Left.Adj.Of_Case = Right.Adj.Of_Case and then Left.Adj.Gender = Right.Adj.Gender and then Left.Adj.Comparison < Right.Adj.Comparison) then return True; end if; when Adv => return Left.Adv.Comparison < Right.Adv.Comparison; when V => if (Left.Verb.Con.Which < Right.Verb.Con.Which) or else (Left.Verb.Con.Which = Right.Verb.Con.Which and then Left.Verb.Con.Var < Right.Verb.Con.Var) or else (Left.Verb.Con.Which = Right.Verb.Con.Which and then Left.Verb.Con.Var = Right.Verb.Con.Var and then Left.Verb.Number < Right.Verb.Number) or else (Left.Verb.Con.Which = Right.Verb.Con.Which and then Left.Verb.Con.Var = Right.Verb.Con.Var and then Left.Verb.Number = Right.Verb.Number and then Left.Verb.Tense_Voice_Mood.Tense < Right.Verb.Tense_Voice_Mood.Tense) or else (Left.Verb.Con.Which = Right.Verb.Con.Which and then Left.Verb.Con.Var = Right.Verb.Con.Var and then Left.Verb.Number = Right.Verb.Number and then Left.Verb.Tense_Voice_Mood.Tense = Right.Verb.Tense_Voice_Mood.Tense and then Left.Verb.Tense_Voice_Mood.Voice < Right.Verb.Tense_Voice_Mood.Voice) or else (Left.Verb.Con.Which = Right.Verb.Con.Which and then Left.Verb.Con.Var = Right.Verb.Con.Var and then Left.Verb.Number = Right.Verb.Number and then Left.Verb.Tense_Voice_Mood.Tense = Right.Verb.Tense_Voice_Mood.Tense and then Left.Verb.Tense_Voice_Mood.Voice = Right.Verb.Tense_Voice_Mood.Voice and then Left.Verb.Tense_Voice_Mood.Mood < Right.Verb.Tense_Voice_Mood.Mood) or else (Left.Verb.Con.Which = Right.Verb.Con.Which and then Left.Verb.Con.Var = Right.Verb.Con.Var and then Left.Verb.Number = Right.Verb.Number and then Left.Verb.Tense_Voice_Mood.Tense = Right.Verb.Tense_Voice_Mood.Tense and then Left.Verb.Tense_Voice_Mood.Voice = Right.Verb.Tense_Voice_Mood.Voice and then Left.Verb.Tense_Voice_Mood.Mood = Right.Verb.Tense_Voice_Mood.Mood and then Left.Verb.Person < Right.Verb.Person) then return True; end if; when Vpar => if Left.Vpar.Con.Which < Right.Vpar.Con.Which or else (Left.Vpar.Con.Which = Right.Vpar.Con.Which and then Left.Vpar.Con.Var < Right.Vpar.Con.Var) or else (Left.Vpar.Con.Which = Right.Vpar.Con.Which and then Left.Vpar.Con.Var = Right.Vpar.Con.Var and then Left.Vpar.Number < Right.Vpar.Number) or else (Left.Vpar.Con.Which = Right.Vpar.Con.Which and then Left.Vpar.Con.Var = Right.Vpar.Con.Var and then Left.Vpar.Number = Right.Vpar.Number and then Left.Vpar.Of_Case < Right.Vpar.Of_Case) or else (Left.Vpar.Con.Which = Right.Vpar.Con.Which and then Left.Vpar.Con.Var = Right.Vpar.Con.Var and then Left.Vpar.Number = Right.Vpar.Number and then Left.Vpar.Of_Case = Right.Vpar.Of_Case and then Left.Vpar.Gender < Right.Vpar.Gender) then return True; end if; when Supine => if Left.Supine.Con.Which < Right.Supine.Con.Which or else (Left.Supine.Con.Which = Right.Supine.Con.Which and then Left.Supine.Con.Var < Right.Supine.Con.Var) or else (Left.Supine.Con.Which = Right.Supine.Con.Which and then Left.Supine.Con.Var = Right.Supine.Con.Var and then Left.Supine.Number < Right.Supine.Number) or else (Left.Supine.Con.Which = Right.Supine.Con.Which and then Left.Supine.Con.Var = Right.Supine.Con.Var and then Left.Supine.Number = Right.Supine.Number and then Left.Supine.Of_Case < Right.Supine.Of_Case) or else (Left.Supine.Con.Which = Right.Supine.Con.Which and then Left.Supine.Con.Var = Right.Supine.Con.Var and then Left.Supine.Number = Right.Supine.Number and then Left.Supine.Of_Case = Right.Supine.Of_Case and then Left.Supine.Gender < Right.Supine.Gender) then return True; end if; when Prep => return Left.Prep.Of_Case < Right.Prep.Of_Case; when Conj => null; when Interj => null; when Num => if Left.Num.Decl.Which < Right.Num.Decl.Which or else (Left.Num.Decl.Which = Right.Num.Decl.Which and then Left.Num.Decl.Var < Right.Num.Decl.Var) or else (Left.Num.Decl.Which = Right.Num.Decl.Which and then Left.Num.Decl.Var = Right.Num.Decl.Var and then Left.Num.Number < Right.Num.Number) or else (Left.Num.Decl.Which = Right.Num.Decl.Which and then Left.Num.Decl.Var = Right.Num.Decl.Var and then Left.Num.Number = Right.Num.Number and then Left.Num.Of_Case < Right.Num.Of_Case) or else (Left.Num.Decl.Which = Right.Num.Decl.Which and then Left.Num.Decl.Var = Right.Num.Decl.Var and then Left.Num.Number = Right.Num.Number and then Left.Num.Of_Case = Right.Num.Of_Case and then Left.Num.Gender < Right.Num.Gender) or else (Left.Num.Decl.Which = Right.Num.Decl.Which and then Left.Num.Decl.Var = Right.Num.Decl.Var and then Left.Num.Number = Right.Num.Number and then Left.Num.Of_Case = Right.Num.Of_Case and then Left.Num.Gender = Right.Num.Gender and then Left.Num.Sort < Right.Num.Sort) then return True; end if; when Tackon .. Suffix => null; when X => null; end case; else return Left.Pofs < Right.Pofs; end if; return False; exception when Constraint_Error => return Left.Pofs < Right.Pofs; end "<"; overriding function "<=" (Left, Right : Part_Of_Speech_Type) return Boolean is begin if Right = Left or else (Left = Pack and Right = Pron) or else Right = X then return True; else return False; end if; end "<="; function "<=" (Left, Right : Decn_Record) return Boolean is begin if Right = Left or else (Right = Decn_Record'(0, 0) and Left.Which /= 9) or else Right = Decn_Record'(Left.Which, 0) then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Gender_Type) return Boolean is begin if Right = Left or else Right = X or else (Right = C and then (Left = M or Left = F)) then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Case_Type) return Boolean is begin if Right = Left or else Right = X then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Number_Type) return Boolean is begin if Right = Left or else Right = X then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Person_Type) return Boolean is begin if Right = Left or else Right = 0 then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Comparison_Type) return Boolean is begin if Right = Left or else Right = X then return True; else return False; end if; end "<="; function "<=" (Left, Right : Tense_Voice_Mood_Record) return Boolean is begin if (Right.Tense = Left.Tense or else Right.Tense = X) and then (Right.Voice = Left.Voice or else Right.Voice = X) and then (Right.Mood = Left.Mood or else Right.Mood = X) then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Noun_Kind_Type) return Boolean is begin if Right = Left or else Right = X then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Pronoun_Kind_Type) return Boolean is begin if Right = Left or else Right = X then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Stem_Key_Type) return Boolean is begin -- Only works for 2 stem parts, not verbs if Right = Left or else Right = 0 then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Age_Type) return Boolean is begin if Right = Left or else Right = X then return True; else return False; end if; end "<="; overriding function "<=" (Left, Right : Frequency_Type) return Boolean is begin if Right = Left or else Right = X then return True; else return False; end if; end "<="; --------------------------------------------------------------------------- package body Stem_Type_IO is separate; package body Decn_Record_IO is separate; package body Tense_Voice_Mood_Record_IO is separate; package body Noun_Record_IO is separate; package body Pronoun_Record_IO is separate; package body Propack_Record_IO is separate; package body Adjective_Record_IO is separate; package body Numeral_Record_IO is separate; package body Adverb_Record_IO is separate; package body Verb_Record_IO is separate; package body Vpar_Record_IO is separate; package body Supine_Record_IO is separate; package body Preposition_Record_IO is separate; package body Conjunction_Record_IO is separate; package body Interjection_Record_IO is separate; package body Tackon_Record_IO is separate; package body Prefix_Record_IO is separate; package body Suffix_Record_IO is separate; package body Quality_Record_IO is separate; package body Ending_Record_IO is separate; package body Inflection_Record_IO is separate; --------------------------------------------------------------------------- procedure Establish_Inflections_Section is -- Loads the inflection array from the file prepared in -- FILE_INFLECTIONS_SECTION -- If N = 0 (an artificial flag for the section for blank -- inflections = 5) -- computes the LELL .. LELF indices for use in WORD use Lel_Section_Io; procedure Load_Lel_Indexes is -- Load arrays from file I : Integer := 0; N, Xn : Integer := 0; Ch, Xch : Character := ' '; Inflections_Sections_File : Lel_Section_Io.File_Type; -- FIXME: This enumeration and its values should be changed to -- something more meaningful. type Paradigm is (P1, P2, P3, P4, P5); procedure Read_Inflections (P : Paradigm) is Count : constant Integer := Paradigm'Pos (P) + 1; begin if P /= P5 then Lel_Section_Io.Read (Inflections_Sections_File, Lel, Lel_Section_Io.Positive_Count (Count)); I := 1; end if; N := Lel (I).Ending.Size; Ch := Lel (I).Ending.Suf (N); Xn := N; Xch := Ch; if P /= P5 then Lelf (N, Ch) := I; else Pelf (N, Ch) := I; Pell (N, Ch) := 0; end if; C1_Loop : loop N1_Loop : loop case P is when P1 | P2 | P3 | P5 => exit C1_Loop when Lel (I) = Null_Inflection_Record; when P4 => exit C1_Loop when Lel (I).Qual.Pofs = Pron and then (Lel (I).Qual.Pron.Decl.Which = 1 or Lel (I).Qual.Pron.Decl.Which = 2); end case; N := Lel (I).Ending.Size; Ch := Lel (I).Ending.Suf (N); case P is when P1 | P4 | P5 => null; when P2 => exit N1_Loop when Ch > 'r'; when P3 => exit N1_Loop when Ch > 's'; end case; if P /= P5 then if Ch /= Xch then Lell (Xn, Xch) := I - 1; Lelf (N, Ch) := I; Lell (N, Ch) := 0; Xch := Ch; Xn := N; elsif N /= Xn then Lell (Xn, Ch) := I - 1; Lelf (N, Ch) := I; Lell (N, Ch) := 0; Xn := N; exit N1_Loop; end if; else if Ch /= Xch then Pell (Xn, Xch) := I - 1; Pelf (N, Ch) := I; Pell (N, Ch) := 0; Xch := Ch; Xn := N; elsif N /= Xn then Pell (Xn, Ch) := I - 1; Pelf (N, Ch) := I; Pell (N, Ch) := 0; Xn := N; exit N1_Loop; end if; end if; I := I + 1; end loop N1_Loop; end loop C1_Loop; if P /= P5 then Lell (Xn, Xch) := I - 1; end if; end Read_Inflections; begin Open (Inflections_Sections_File, In_File, Inflections_Sections_Name); Number_Of_Inflections := 0; Lel_Section_Io.Read (Inflections_Sections_File, Lel, Lel_Section_Io.Positive_Count (5)); I := 1; Belf (0, ' ') := I; Bell (0, ' ') := 0; loop exit when Lel (I) = Null_Inflection_Record; Bel (I) := Lel (I); Bell (0, ' ') := I; I := I + 1; end loop; for K in Paradigm'Range loop if K /= P5 then Number_Of_Inflections := Number_Of_Inflections + I - 1; end if; Read_Inflections (K); end loop; Pell (Xn, Xch) := I - 1; Number_Of_Inflections := Number_Of_Inflections + I - 1; Close (Inflections_Sections_File); end Load_Lel_Indexes; begin Preface.Put ("INFLECTION_ARRAY being loaded"); Preface.Set_Col (33); Preface.Put ("-- "); Load_Lel_Indexes; -- Makes indexes from array Preface.Put (Number_Of_Inflections, 6); Preface.Put (" entries"); Preface.Set_Col (55); Preface.Put_Line ("-- Loaded correctly"); exception when Ada.Text_IO.Name_Error => New_Line; Put_Line ("There is no " & Inflections_Sections_Name & " file."); Put_Line ("The program cannot work without one."); Put_Line ("Make sure you are in the" & " subdirectory containing the files"); Put_Line ("for inflections, dictionary, addons and uniques."); raise Give_Up; end Establish_Inflections_Section; begin -- initialization of body of INFLECTIONS_PACKAGE Part_Of_Speech_Type_IO.Default_Width := Part_Of_Speech_Type'Width; Gender_Type_IO.Default_Width := Gender_Type'Width; Case_Type_IO.Default_Width := Case_Type'Width; Number_Type_IO.Default_Width := Number_Type'Width; Person_Type_IO.Default_Width := 1; Comparison_Type_IO.Default_Width := Comparison_Type'Width; Tense_Type_IO.Default_Width := Tense_Type'Width; Voice_Type_IO.Default_Width := Voice_Type'Width; Mood_Type_IO.Default_Width := Mood_Type'Width; Numeral_Sort_Type_IO.Default_Width := Numeral_Sort_Type'Width; end Latin_Utils.Inflections_Package;
39.672297
78
0.532232
4d876ba8df612d727e35f432aff0b7dd856a7b0c
331
ads
Ada
source/numerics/a-numeri.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/numerics/a-numeri.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/numerics/a-numeri.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
pragma License (Unrestricted); package Ada.Numerics is pragma Pure; Argument_Error : exception; Pi : constant := 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511; ["03C0"] : constant := Pi; e : constant := 2.71828_18284_59045_23536_02874_71352_66249_77572_47093_69996; end Ada.Numerics;
22.066667
68
0.740181
50a1409987c9ba4066d7fb7452907f64a5cd63b9
1,895
ads
Ada
src/message-reader.ads
zenharris/ada-bbs
6294bc29979289b40927011bdff6cedf62719ef8
[ "Unlicense" ]
2
2019-07-13T03:51:43.000Z
2019-07-17T08:27:38.000Z
src/message-reader.ads
zenharris/ada-bbs
6294bc29979289b40927011bdff6cedf62719ef8
[ "Unlicense" ]
null
null
null
src/message-reader.ads
zenharris/ada-bbs
6294bc29979289b40927011bdff6cedf62719ef8
[ "Unlicense" ]
2
2019-10-08T08:14:38.000Z
2021-03-11T20:50:02.000Z
with Ada.Text_IO; with Ada.Directories; use Ada.Text_IO; use Ada.Directories; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Fixed; with Ada.Calendar; use Ada.Calendar; With Ada.Text_IO.Unbounded_IO; with Ada.Containers.Doubly_Linked_Lists; with Ada.Containers; use Ada.Containers; with Display_Warning; with Process_Menu; with Message.Login; package Message.Reader is package SU renames Ada.Strings.Unbounded; package SUIO renames Ada.Text_IO.Unbounded_IO; package SF renames Ada.Strings.Fixed; type Directory_Record is record FileName : Unbounded_String; Prompt : Unbounded_String; -- Func : Function_Access; end record; package Directory_List is new Ada.Containers.Doubly_Linked_Lists(Directory_Record); use Directory_List; Directory_Buffer : Directory_List.List; CurrentLine : Line_Position := 0; CurrentCurs : Cursor; TopLine : Line_Position; TermLnth : Line_Position; TermWdth : Column_Position; BottomLine : Line_Position ; Curr_Dir : string := Current_Directory; procedure Read_Directory (ReplyID : Unbounded_String := To_Unbounded_String("")); procedure Read_Messages; procedure Read_Header (FileName : in String; Sender : out Unbounded_String; Subject : out Unbounded_String; Msgid : out Unbounded_String; ReplyTo : out Unbounded_String); -- function Post_Message (ReplyID : in Unbounded_String := To_Unbounded_String(""); -- ReplySubject : in Unbounded_String := To_Unbounded_String("") ) return Boolean; function CharPad(InStr : Unbounded_String; PadWidth : Integer) return String; end Message.Reader;
30.079365
109
0.710818
a1f6a35edce9eb0aa9387c616f62f22484b0d52f
195
adb
Ada
dependencies/agar/ada-gui/agar-gui-widget-hsvpal.adb
alexakuzin/GUCEF-1
436035c4266c5d90cd8716c1d0fad519c7059e34
[ "Apache-2.0" ]
286
2017-07-31T20:05:16.000Z
2022-03-26T20:26:24.000Z
dependencies/agar/ada-gui/agar-gui-widget-hsvpal.adb
alexakuzin/GUCEF-1
436035c4266c5d90cd8716c1d0fad519c7059e34
[ "Apache-2.0" ]
67
2017-08-30T18:56:21.000Z
2021-09-08T03:38:20.000Z
dependencies/agar/ada-gui/agar-gui-widget-hsvpal.adb
alexakuzin/GUCEF-1
436035c4266c5d90cd8716c1d0fad519c7059e34
[ "Apache-2.0" ]
31
2017-08-14T13:34:12.000Z
2022-03-14T15:33:49.000Z
package body agar.gui.widget.hsvpal is function widget (hsvpal : hsvpal_access_t) return widget_access_t is begin return hsvpal.widget'access; end widget; end agar.gui.widget.hsvpal;
21.666667
70
0.769231
102eb1f2173ae8d998431d71ccf6b80d1c52cebb
59,721
ads
Ada
software/hal/hpl/STM32/svd/stm32f429x/stm32_svd-dma.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
12
2017-06-08T14:19:57.000Z
2022-03-09T02:48:59.000Z
software/hal/hpl/STM32/svd/stm32f429x/stm32_svd-dma.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
6
2017-06-08T13:13:50.000Z
2020-05-15T09:32:43.000Z
software/hal/hpl/STM32/svd/stm32f429x/stm32_svd-dma.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
3
2017-06-30T14:05:06.000Z
2022-02-17T12:20:45.000Z
-- This spec has been automatically generated from STM32F429x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; with HAL; with System; package STM32_SVD.DMA is pragma Preelaborate; --------------- -- Registers -- --------------- ------------------- -- LISR_Register -- ------------------- -- low interrupt status register type LISR_Register is record -- Read-only. Stream x FIFO error interrupt flag (x=3..0) FEIF0 : Boolean; -- unspecified Reserved_1_1 : HAL.Bit; -- Read-only. Stream x direct mode error interrupt flag (x=3..0) DMEIF0 : Boolean; -- Read-only. Stream x transfer error interrupt flag (x=3..0) TEIF0 : Boolean; -- Read-only. Stream x half transfer interrupt flag (x=3..0) HTIF0 : Boolean; -- Read-only. Stream x transfer complete interrupt flag (x = 3..0) TCIF0 : Boolean; -- Read-only. Stream x FIFO error interrupt flag (x=3..0) FEIF1 : Boolean; -- unspecified Reserved_7_7 : HAL.Bit; -- Read-only. Stream x direct mode error interrupt flag (x=3..0) DMEIF1 : Boolean; -- Read-only. Stream x transfer error interrupt flag (x=3..0) TEIF1 : Boolean; -- Read-only. Stream x half transfer interrupt flag (x=3..0) HTIF1 : Boolean; -- Read-only. Stream x transfer complete interrupt flag (x = 3..0) TCIF1 : Boolean; -- unspecified Reserved_12_15 : HAL.UInt4; -- Read-only. Stream x FIFO error interrupt flag (x=3..0) FEIF2 : Boolean; -- unspecified Reserved_17_17 : HAL.Bit; -- Read-only. Stream x direct mode error interrupt flag (x=3..0) DMEIF2 : Boolean; -- Read-only. Stream x transfer error interrupt flag (x=3..0) TEIF2 : Boolean; -- Read-only. Stream x half transfer interrupt flag (x=3..0) HTIF2 : Boolean; -- Read-only. Stream x transfer complete interrupt flag (x = 3..0) TCIF2 : Boolean; -- Read-only. Stream x FIFO error interrupt flag (x=3..0) FEIF3 : Boolean; -- unspecified Reserved_23_23 : HAL.Bit; -- Read-only. Stream x direct mode error interrupt flag (x=3..0) DMEIF3 : Boolean; -- Read-only. Stream x transfer error interrupt flag (x=3..0) TEIF3 : Boolean; -- Read-only. Stream x half transfer interrupt flag (x=3..0) HTIF3 : Boolean; -- Read-only. Stream x transfer complete interrupt flag (x = 3..0) TCIF3 : Boolean; -- unspecified Reserved_28_31 : HAL.UInt4; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for LISR_Register use record FEIF0 at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; DMEIF0 at 0 range 2 .. 2; TEIF0 at 0 range 3 .. 3; HTIF0 at 0 range 4 .. 4; TCIF0 at 0 range 5 .. 5; FEIF1 at 0 range 6 .. 6; Reserved_7_7 at 0 range 7 .. 7; DMEIF1 at 0 range 8 .. 8; TEIF1 at 0 range 9 .. 9; HTIF1 at 0 range 10 .. 10; TCIF1 at 0 range 11 .. 11; Reserved_12_15 at 0 range 12 .. 15; FEIF2 at 0 range 16 .. 16; Reserved_17_17 at 0 range 17 .. 17; DMEIF2 at 0 range 18 .. 18; TEIF2 at 0 range 19 .. 19; HTIF2 at 0 range 20 .. 20; TCIF2 at 0 range 21 .. 21; FEIF3 at 0 range 22 .. 22; Reserved_23_23 at 0 range 23 .. 23; DMEIF3 at 0 range 24 .. 24; TEIF3 at 0 range 25 .. 25; HTIF3 at 0 range 26 .. 26; TCIF3 at 0 range 27 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; ------------------- -- HISR_Register -- ------------------- -- high interrupt status register type HISR_Register is record -- Read-only. Stream x FIFO error interrupt flag (x=7..4) FEIF4 : Boolean; -- unspecified Reserved_1_1 : HAL.Bit; -- Read-only. Stream x direct mode error interrupt flag (x=7..4) DMEIF4 : Boolean; -- Read-only. Stream x transfer error interrupt flag (x=7..4) TEIF4 : Boolean; -- Read-only. Stream x half transfer interrupt flag (x=7..4) HTIF4 : Boolean; -- Read-only. Stream x transfer complete interrupt flag (x=7..4) TCIF4 : Boolean; -- Read-only. Stream x FIFO error interrupt flag (x=7..4) FEIF5 : Boolean; -- unspecified Reserved_7_7 : HAL.Bit; -- Read-only. Stream x direct mode error interrupt flag (x=7..4) DMEIF5 : Boolean; -- Read-only. Stream x transfer error interrupt flag (x=7..4) TEIF5 : Boolean; -- Read-only. Stream x half transfer interrupt flag (x=7..4) HTIF5 : Boolean; -- Read-only. Stream x transfer complete interrupt flag (x=7..4) TCIF5 : Boolean; -- unspecified Reserved_12_15 : HAL.UInt4; -- Read-only. Stream x FIFO error interrupt flag (x=7..4) FEIF6 : Boolean; -- unspecified Reserved_17_17 : HAL.Bit; -- Read-only. Stream x direct mode error interrupt flag (x=7..4) DMEIF6 : Boolean; -- Read-only. Stream x transfer error interrupt flag (x=7..4) TEIF6 : Boolean; -- Read-only. Stream x half transfer interrupt flag (x=7..4) HTIF6 : Boolean; -- Read-only. Stream x transfer complete interrupt flag (x=7..4) TCIF6 : Boolean; -- Read-only. Stream x FIFO error interrupt flag (x=7..4) FEIF7 : Boolean; -- unspecified Reserved_23_23 : HAL.Bit; -- Read-only. Stream x direct mode error interrupt flag (x=7..4) DMEIF7 : Boolean; -- Read-only. Stream x transfer error interrupt flag (x=7..4) TEIF7 : Boolean; -- Read-only. Stream x half transfer interrupt flag (x=7..4) HTIF7 : Boolean; -- Read-only. Stream x transfer complete interrupt flag (x=7..4) TCIF7 : Boolean; -- unspecified Reserved_28_31 : HAL.UInt4; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for HISR_Register use record FEIF4 at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; DMEIF4 at 0 range 2 .. 2; TEIF4 at 0 range 3 .. 3; HTIF4 at 0 range 4 .. 4; TCIF4 at 0 range 5 .. 5; FEIF5 at 0 range 6 .. 6; Reserved_7_7 at 0 range 7 .. 7; DMEIF5 at 0 range 8 .. 8; TEIF5 at 0 range 9 .. 9; HTIF5 at 0 range 10 .. 10; TCIF5 at 0 range 11 .. 11; Reserved_12_15 at 0 range 12 .. 15; FEIF6 at 0 range 16 .. 16; Reserved_17_17 at 0 range 17 .. 17; DMEIF6 at 0 range 18 .. 18; TEIF6 at 0 range 19 .. 19; HTIF6 at 0 range 20 .. 20; TCIF6 at 0 range 21 .. 21; FEIF7 at 0 range 22 .. 22; Reserved_23_23 at 0 range 23 .. 23; DMEIF7 at 0 range 24 .. 24; TEIF7 at 0 range 25 .. 25; HTIF7 at 0 range 26 .. 26; TCIF7 at 0 range 27 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; -------------------- -- LIFCR_Register -- -------------------- -- low interrupt flag clear register type LIFCR_Register is record -- Stream x clear FIFO error interrupt flag (x = 3..0) CFEIF0 : Boolean := False; -- unspecified Reserved_1_1 : HAL.Bit := 16#0#; -- Stream x clear direct mode error interrupt flag (x = 3..0) CDMEIF0 : Boolean := False; -- Stream x clear transfer error interrupt flag (x = 3..0) CTEIF0 : Boolean := False; -- Stream x clear half transfer interrupt flag (x = 3..0) CHTIF0 : Boolean := False; -- Stream x clear transfer complete interrupt flag (x = 3..0) CTCIF0 : Boolean := False; -- Stream x clear FIFO error interrupt flag (x = 3..0) CFEIF1 : Boolean := False; -- unspecified Reserved_7_7 : HAL.Bit := 16#0#; -- Stream x clear direct mode error interrupt flag (x = 3..0) CDMEIF1 : Boolean := False; -- Stream x clear transfer error interrupt flag (x = 3..0) CTEIF1 : Boolean := False; -- Stream x clear half transfer interrupt flag (x = 3..0) CHTIF1 : Boolean := False; -- Stream x clear transfer complete interrupt flag (x = 3..0) CTCIF1 : Boolean := False; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Stream x clear FIFO error interrupt flag (x = 3..0) CFEIF2 : Boolean := False; -- unspecified Reserved_17_17 : HAL.Bit := 16#0#; -- Stream x clear direct mode error interrupt flag (x = 3..0) CDMEIF2 : Boolean := False; -- Stream x clear transfer error interrupt flag (x = 3..0) CTEIF2 : Boolean := False; -- Stream x clear half transfer interrupt flag (x = 3..0) CHTIF2 : Boolean := False; -- Stream x clear transfer complete interrupt flag (x = 3..0) CTCIF2 : Boolean := False; -- Stream x clear FIFO error interrupt flag (x = 3..0) CFEIF3 : Boolean := False; -- unspecified Reserved_23_23 : HAL.Bit := 16#0#; -- Stream x clear direct mode error interrupt flag (x = 3..0) CDMEIF3 : Boolean := False; -- Stream x clear transfer error interrupt flag (x = 3..0) CTEIF3 : Boolean := False; -- Stream x clear half transfer interrupt flag (x = 3..0) CHTIF3 : Boolean := False; -- Stream x clear transfer complete interrupt flag (x = 3..0) CTCIF3 : Boolean := False; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for LIFCR_Register use record CFEIF0 at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; CDMEIF0 at 0 range 2 .. 2; CTEIF0 at 0 range 3 .. 3; CHTIF0 at 0 range 4 .. 4; CTCIF0 at 0 range 5 .. 5; CFEIF1 at 0 range 6 .. 6; Reserved_7_7 at 0 range 7 .. 7; CDMEIF1 at 0 range 8 .. 8; CTEIF1 at 0 range 9 .. 9; CHTIF1 at 0 range 10 .. 10; CTCIF1 at 0 range 11 .. 11; Reserved_12_15 at 0 range 12 .. 15; CFEIF2 at 0 range 16 .. 16; Reserved_17_17 at 0 range 17 .. 17; CDMEIF2 at 0 range 18 .. 18; CTEIF2 at 0 range 19 .. 19; CHTIF2 at 0 range 20 .. 20; CTCIF2 at 0 range 21 .. 21; CFEIF3 at 0 range 22 .. 22; Reserved_23_23 at 0 range 23 .. 23; CDMEIF3 at 0 range 24 .. 24; CTEIF3 at 0 range 25 .. 25; CHTIF3 at 0 range 26 .. 26; CTCIF3 at 0 range 27 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; -------------------- -- HIFCR_Register -- -------------------- -- high interrupt flag clear register type HIFCR_Register is record -- Stream x clear FIFO error interrupt flag (x = 7..4) CFEIF4 : Boolean := False; -- unspecified Reserved_1_1 : HAL.Bit := 16#0#; -- Stream x clear direct mode error interrupt flag (x = 7..4) CDMEIF4 : Boolean := False; -- Stream x clear transfer error interrupt flag (x = 7..4) CTEIF4 : Boolean := False; -- Stream x clear half transfer interrupt flag (x = 7..4) CHTIF4 : Boolean := False; -- Stream x clear transfer complete interrupt flag (x = 7..4) CTCIF4 : Boolean := False; -- Stream x clear FIFO error interrupt flag (x = 7..4) CFEIF5 : Boolean := False; -- unspecified Reserved_7_7 : HAL.Bit := 16#0#; -- Stream x clear direct mode error interrupt flag (x = 7..4) CDMEIF5 : Boolean := False; -- Stream x clear transfer error interrupt flag (x = 7..4) CTEIF5 : Boolean := False; -- Stream x clear half transfer interrupt flag (x = 7..4) CHTIF5 : Boolean := False; -- Stream x clear transfer complete interrupt flag (x = 7..4) CTCIF5 : Boolean := False; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Stream x clear FIFO error interrupt flag (x = 7..4) CFEIF6 : Boolean := False; -- unspecified Reserved_17_17 : HAL.Bit := 16#0#; -- Stream x clear direct mode error interrupt flag (x = 7..4) CDMEIF6 : Boolean := False; -- Stream x clear transfer error interrupt flag (x = 7..4) CTEIF6 : Boolean := False; -- Stream x clear half transfer interrupt flag (x = 7..4) CHTIF6 : Boolean := False; -- Stream x clear transfer complete interrupt flag (x = 7..4) CTCIF6 : Boolean := False; -- Stream x clear FIFO error interrupt flag (x = 7..4) CFEIF7 : Boolean := False; -- unspecified Reserved_23_23 : HAL.Bit := 16#0#; -- Stream x clear direct mode error interrupt flag (x = 7..4) CDMEIF7 : Boolean := False; -- Stream x clear transfer error interrupt flag (x = 7..4) CTEIF7 : Boolean := False; -- Stream x clear half transfer interrupt flag (x = 7..4) CHTIF7 : Boolean := False; -- Stream x clear transfer complete interrupt flag (x = 7..4) CTCIF7 : Boolean := False; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for HIFCR_Register use record CFEIF4 at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; CDMEIF4 at 0 range 2 .. 2; CTEIF4 at 0 range 3 .. 3; CHTIF4 at 0 range 4 .. 4; CTCIF4 at 0 range 5 .. 5; CFEIF5 at 0 range 6 .. 6; Reserved_7_7 at 0 range 7 .. 7; CDMEIF5 at 0 range 8 .. 8; CTEIF5 at 0 range 9 .. 9; CHTIF5 at 0 range 10 .. 10; CTCIF5 at 0 range 11 .. 11; Reserved_12_15 at 0 range 12 .. 15; CFEIF6 at 0 range 16 .. 16; Reserved_17_17 at 0 range 17 .. 17; CDMEIF6 at 0 range 18 .. 18; CTEIF6 at 0 range 19 .. 19; CHTIF6 at 0 range 20 .. 20; CTCIF6 at 0 range 21 .. 21; CFEIF7 at 0 range 22 .. 22; Reserved_23_23 at 0 range 23 .. 23; CDMEIF7 at 0 range 24 .. 24; CTEIF7 at 0 range 25 .. 25; CHTIF7 at 0 range 26 .. 26; CTCIF7 at 0 range 27 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; ------------------- -- S0CR_Register -- ------------------- subtype S0CR_DIR_Field is HAL.UInt2; subtype S0CR_PSIZE_Field is HAL.UInt2; subtype S0CR_MSIZE_Field is HAL.UInt2; subtype S0CR_PL_Field is HAL.UInt2; subtype S0CR_PBURST_Field is HAL.UInt2; subtype S0CR_MBURST_Field is HAL.UInt2; subtype S0CR_CHSEL_Field is HAL.UInt3; -- stream x configuration register type S0CR_Register is record -- Stream enable / flag stream ready when read low EN : Boolean := False; -- Direct mode error interrupt enable DMEIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Peripheral flow controller PFCTRL : Boolean := False; -- Data transfer direction DIR : S0CR_DIR_Field := 16#0#; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral data size PSIZE : S0CR_PSIZE_Field := 16#0#; -- Memory data size MSIZE : S0CR_MSIZE_Field := 16#0#; -- Peripheral increment offset size PINCOS : Boolean := False; -- Priority level PL : S0CR_PL_Field := 16#0#; -- Double buffer mode DBM : Boolean := False; -- Current target (only in double buffer mode) CT : Boolean := False; -- unspecified Reserved_20_20 : HAL.Bit := 16#0#; -- Peripheral burst transfer configuration PBURST : S0CR_PBURST_Field := 16#0#; -- Memory burst transfer configuration MBURST : S0CR_MBURST_Field := 16#0#; -- Channel selection CHSEL : S0CR_CHSEL_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S0CR_Register use record EN at 0 range 0 .. 0; DMEIE at 0 range 1 .. 1; TEIE at 0 range 2 .. 2; HTIE at 0 range 3 .. 3; TCIE at 0 range 4 .. 4; PFCTRL at 0 range 5 .. 5; DIR at 0 range 6 .. 7; CIRC at 0 range 8 .. 8; PINC at 0 range 9 .. 9; MINC at 0 range 10 .. 10; PSIZE at 0 range 11 .. 12; MSIZE at 0 range 13 .. 14; PINCOS at 0 range 15 .. 15; PL at 0 range 16 .. 17; DBM at 0 range 18 .. 18; CT at 0 range 19 .. 19; Reserved_20_20 at 0 range 20 .. 20; PBURST at 0 range 21 .. 22; MBURST at 0 range 23 .. 24; CHSEL at 0 range 25 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; --------------------- -- S0NDTR_Register -- --------------------- subtype S0NDTR_NDT_Field is HAL.Short; -- stream x number of data register type S0NDTR_Register is record -- Number of data items to transfer NDT : S0NDTR_NDT_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S0NDTR_Register use record NDT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- S0FCR_Register -- -------------------- subtype S0FCR_FTH_Field is HAL.UInt2; subtype S0FCR_FS_Field is HAL.UInt3; -- stream x FIFO control register type S0FCR_Register is record -- FIFO threshold selection FTH : S0FCR_FTH_Field := 16#1#; -- Direct mode disable DMDIS : Boolean := False; -- Read-only. FIFO status FS : S0FCR_FS_Field := 16#4#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- FIFO error interrupt enable FEIE : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S0FCR_Register use record FTH at 0 range 0 .. 1; DMDIS at 0 range 2 .. 2; FS at 0 range 3 .. 5; Reserved_6_6 at 0 range 6 .. 6; FEIE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ------------------- -- S1CR_Register -- ------------------- subtype S1CR_DIR_Field is HAL.UInt2; subtype S1CR_PSIZE_Field is HAL.UInt2; subtype S1CR_MSIZE_Field is HAL.UInt2; subtype S1CR_PL_Field is HAL.UInt2; subtype S1CR_PBURST_Field is HAL.UInt2; subtype S1CR_MBURST_Field is HAL.UInt2; subtype S1CR_CHSEL_Field is HAL.UInt3; -- stream x configuration register type S1CR_Register is record -- Stream enable / flag stream ready when read low EN : Boolean := False; -- Direct mode error interrupt enable DMEIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Peripheral flow controller PFCTRL : Boolean := False; -- Data transfer direction DIR : S1CR_DIR_Field := 16#0#; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral data size PSIZE : S1CR_PSIZE_Field := 16#0#; -- Memory data size MSIZE : S1CR_MSIZE_Field := 16#0#; -- Peripheral increment offset size PINCOS : Boolean := False; -- Priority level PL : S1CR_PL_Field := 16#0#; -- Double buffer mode DBM : Boolean := False; -- Current target (only in double buffer mode) CT : Boolean := False; -- ACK ACK : Boolean := False; -- Peripheral burst transfer configuration PBURST : S1CR_PBURST_Field := 16#0#; -- Memory burst transfer configuration MBURST : S1CR_MBURST_Field := 16#0#; -- Channel selection CHSEL : S1CR_CHSEL_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S1CR_Register use record EN at 0 range 0 .. 0; DMEIE at 0 range 1 .. 1; TEIE at 0 range 2 .. 2; HTIE at 0 range 3 .. 3; TCIE at 0 range 4 .. 4; PFCTRL at 0 range 5 .. 5; DIR at 0 range 6 .. 7; CIRC at 0 range 8 .. 8; PINC at 0 range 9 .. 9; MINC at 0 range 10 .. 10; PSIZE at 0 range 11 .. 12; MSIZE at 0 range 13 .. 14; PINCOS at 0 range 15 .. 15; PL at 0 range 16 .. 17; DBM at 0 range 18 .. 18; CT at 0 range 19 .. 19; ACK at 0 range 20 .. 20; PBURST at 0 range 21 .. 22; MBURST at 0 range 23 .. 24; CHSEL at 0 range 25 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; --------------------- -- S1NDTR_Register -- --------------------- subtype S1NDTR_NDT_Field is HAL.Short; -- stream x number of data register type S1NDTR_Register is record -- Number of data items to transfer NDT : S1NDTR_NDT_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S1NDTR_Register use record NDT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- S1FCR_Register -- -------------------- subtype S1FCR_FTH_Field is HAL.UInt2; subtype S1FCR_FS_Field is HAL.UInt3; -- stream x FIFO control register type S1FCR_Register is record -- FIFO threshold selection FTH : S1FCR_FTH_Field := 16#1#; -- Direct mode disable DMDIS : Boolean := False; -- Read-only. FIFO status FS : S1FCR_FS_Field := 16#4#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- FIFO error interrupt enable FEIE : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S1FCR_Register use record FTH at 0 range 0 .. 1; DMDIS at 0 range 2 .. 2; FS at 0 range 3 .. 5; Reserved_6_6 at 0 range 6 .. 6; FEIE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ------------------- -- S2CR_Register -- ------------------- subtype S2CR_DIR_Field is HAL.UInt2; subtype S2CR_PSIZE_Field is HAL.UInt2; subtype S2CR_MSIZE_Field is HAL.UInt2; subtype S2CR_PL_Field is HAL.UInt2; subtype S2CR_PBURST_Field is HAL.UInt2; subtype S2CR_MBURST_Field is HAL.UInt2; subtype S2CR_CHSEL_Field is HAL.UInt3; -- stream x configuration register type S2CR_Register is record -- Stream enable / flag stream ready when read low EN : Boolean := False; -- Direct mode error interrupt enable DMEIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Peripheral flow controller PFCTRL : Boolean := False; -- Data transfer direction DIR : S2CR_DIR_Field := 16#0#; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral data size PSIZE : S2CR_PSIZE_Field := 16#0#; -- Memory data size MSIZE : S2CR_MSIZE_Field := 16#0#; -- Peripheral increment offset size PINCOS : Boolean := False; -- Priority level PL : S2CR_PL_Field := 16#0#; -- Double buffer mode DBM : Boolean := False; -- Current target (only in double buffer mode) CT : Boolean := False; -- ACK ACK : Boolean := False; -- Peripheral burst transfer configuration PBURST : S2CR_PBURST_Field := 16#0#; -- Memory burst transfer configuration MBURST : S2CR_MBURST_Field := 16#0#; -- Channel selection CHSEL : S2CR_CHSEL_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S2CR_Register use record EN at 0 range 0 .. 0; DMEIE at 0 range 1 .. 1; TEIE at 0 range 2 .. 2; HTIE at 0 range 3 .. 3; TCIE at 0 range 4 .. 4; PFCTRL at 0 range 5 .. 5; DIR at 0 range 6 .. 7; CIRC at 0 range 8 .. 8; PINC at 0 range 9 .. 9; MINC at 0 range 10 .. 10; PSIZE at 0 range 11 .. 12; MSIZE at 0 range 13 .. 14; PINCOS at 0 range 15 .. 15; PL at 0 range 16 .. 17; DBM at 0 range 18 .. 18; CT at 0 range 19 .. 19; ACK at 0 range 20 .. 20; PBURST at 0 range 21 .. 22; MBURST at 0 range 23 .. 24; CHSEL at 0 range 25 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; --------------------- -- S2NDTR_Register -- --------------------- subtype S2NDTR_NDT_Field is HAL.Short; -- stream x number of data register type S2NDTR_Register is record -- Number of data items to transfer NDT : S2NDTR_NDT_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S2NDTR_Register use record NDT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- S2FCR_Register -- -------------------- subtype S2FCR_FTH_Field is HAL.UInt2; subtype S2FCR_FS_Field is HAL.UInt3; -- stream x FIFO control register type S2FCR_Register is record -- FIFO threshold selection FTH : S2FCR_FTH_Field := 16#1#; -- Direct mode disable DMDIS : Boolean := False; -- Read-only. FIFO status FS : S2FCR_FS_Field := 16#4#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- FIFO error interrupt enable FEIE : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S2FCR_Register use record FTH at 0 range 0 .. 1; DMDIS at 0 range 2 .. 2; FS at 0 range 3 .. 5; Reserved_6_6 at 0 range 6 .. 6; FEIE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ------------------- -- S3CR_Register -- ------------------- subtype S3CR_DIR_Field is HAL.UInt2; subtype S3CR_PSIZE_Field is HAL.UInt2; subtype S3CR_MSIZE_Field is HAL.UInt2; subtype S3CR_PL_Field is HAL.UInt2; subtype S3CR_PBURST_Field is HAL.UInt2; subtype S3CR_MBURST_Field is HAL.UInt2; subtype S3CR_CHSEL_Field is HAL.UInt3; -- stream x configuration register type S3CR_Register is record -- Stream enable / flag stream ready when read low EN : Boolean := False; -- Direct mode error interrupt enable DMEIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Peripheral flow controller PFCTRL : Boolean := False; -- Data transfer direction DIR : S3CR_DIR_Field := 16#0#; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral data size PSIZE : S3CR_PSIZE_Field := 16#0#; -- Memory data size MSIZE : S3CR_MSIZE_Field := 16#0#; -- Peripheral increment offset size PINCOS : Boolean := False; -- Priority level PL : S3CR_PL_Field := 16#0#; -- Double buffer mode DBM : Boolean := False; -- Current target (only in double buffer mode) CT : Boolean := False; -- ACK ACK : Boolean := False; -- Peripheral burst transfer configuration PBURST : S3CR_PBURST_Field := 16#0#; -- Memory burst transfer configuration MBURST : S3CR_MBURST_Field := 16#0#; -- Channel selection CHSEL : S3CR_CHSEL_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S3CR_Register use record EN at 0 range 0 .. 0; DMEIE at 0 range 1 .. 1; TEIE at 0 range 2 .. 2; HTIE at 0 range 3 .. 3; TCIE at 0 range 4 .. 4; PFCTRL at 0 range 5 .. 5; DIR at 0 range 6 .. 7; CIRC at 0 range 8 .. 8; PINC at 0 range 9 .. 9; MINC at 0 range 10 .. 10; PSIZE at 0 range 11 .. 12; MSIZE at 0 range 13 .. 14; PINCOS at 0 range 15 .. 15; PL at 0 range 16 .. 17; DBM at 0 range 18 .. 18; CT at 0 range 19 .. 19; ACK at 0 range 20 .. 20; PBURST at 0 range 21 .. 22; MBURST at 0 range 23 .. 24; CHSEL at 0 range 25 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; --------------------- -- S3NDTR_Register -- --------------------- subtype S3NDTR_NDT_Field is HAL.Short; -- stream x number of data register type S3NDTR_Register is record -- Number of data items to transfer NDT : S3NDTR_NDT_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S3NDTR_Register use record NDT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- S3FCR_Register -- -------------------- subtype S3FCR_FTH_Field is HAL.UInt2; subtype S3FCR_FS_Field is HAL.UInt3; -- stream x FIFO control register type S3FCR_Register is record -- FIFO threshold selection FTH : S3FCR_FTH_Field := 16#1#; -- Direct mode disable DMDIS : Boolean := False; -- Read-only. FIFO status FS : S3FCR_FS_Field := 16#4#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- FIFO error interrupt enable FEIE : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S3FCR_Register use record FTH at 0 range 0 .. 1; DMDIS at 0 range 2 .. 2; FS at 0 range 3 .. 5; Reserved_6_6 at 0 range 6 .. 6; FEIE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ------------------- -- S4CR_Register -- ------------------- subtype S4CR_DIR_Field is HAL.UInt2; subtype S4CR_PSIZE_Field is HAL.UInt2; subtype S4CR_MSIZE_Field is HAL.UInt2; subtype S4CR_PL_Field is HAL.UInt2; subtype S4CR_PBURST_Field is HAL.UInt2; subtype S4CR_MBURST_Field is HAL.UInt2; subtype S4CR_CHSEL_Field is HAL.UInt3; -- stream x configuration register type S4CR_Register is record -- Stream enable / flag stream ready when read low EN : Boolean := False; -- Direct mode error interrupt enable DMEIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Peripheral flow controller PFCTRL : Boolean := False; -- Data transfer direction DIR : S4CR_DIR_Field := 16#0#; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral data size PSIZE : S4CR_PSIZE_Field := 16#0#; -- Memory data size MSIZE : S4CR_MSIZE_Field := 16#0#; -- Peripheral increment offset size PINCOS : Boolean := False; -- Priority level PL : S4CR_PL_Field := 16#0#; -- Double buffer mode DBM : Boolean := False; -- Current target (only in double buffer mode) CT : Boolean := False; -- ACK ACK : Boolean := False; -- Peripheral burst transfer configuration PBURST : S4CR_PBURST_Field := 16#0#; -- Memory burst transfer configuration MBURST : S4CR_MBURST_Field := 16#0#; -- Channel selection CHSEL : S4CR_CHSEL_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S4CR_Register use record EN at 0 range 0 .. 0; DMEIE at 0 range 1 .. 1; TEIE at 0 range 2 .. 2; HTIE at 0 range 3 .. 3; TCIE at 0 range 4 .. 4; PFCTRL at 0 range 5 .. 5; DIR at 0 range 6 .. 7; CIRC at 0 range 8 .. 8; PINC at 0 range 9 .. 9; MINC at 0 range 10 .. 10; PSIZE at 0 range 11 .. 12; MSIZE at 0 range 13 .. 14; PINCOS at 0 range 15 .. 15; PL at 0 range 16 .. 17; DBM at 0 range 18 .. 18; CT at 0 range 19 .. 19; ACK at 0 range 20 .. 20; PBURST at 0 range 21 .. 22; MBURST at 0 range 23 .. 24; CHSEL at 0 range 25 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; --------------------- -- S4NDTR_Register -- --------------------- subtype S4NDTR_NDT_Field is HAL.Short; -- stream x number of data register type S4NDTR_Register is record -- Number of data items to transfer NDT : S4NDTR_NDT_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S4NDTR_Register use record NDT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- S4FCR_Register -- -------------------- subtype S4FCR_FTH_Field is HAL.UInt2; subtype S4FCR_FS_Field is HAL.UInt3; -- stream x FIFO control register type S4FCR_Register is record -- FIFO threshold selection FTH : S4FCR_FTH_Field := 16#1#; -- Direct mode disable DMDIS : Boolean := False; -- Read-only. FIFO status FS : S4FCR_FS_Field := 16#4#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- FIFO error interrupt enable FEIE : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S4FCR_Register use record FTH at 0 range 0 .. 1; DMDIS at 0 range 2 .. 2; FS at 0 range 3 .. 5; Reserved_6_6 at 0 range 6 .. 6; FEIE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ------------------- -- S5CR_Register -- ------------------- subtype S5CR_DIR_Field is HAL.UInt2; subtype S5CR_PSIZE_Field is HAL.UInt2; subtype S5CR_MSIZE_Field is HAL.UInt2; subtype S5CR_PL_Field is HAL.UInt2; subtype S5CR_PBURST_Field is HAL.UInt2; subtype S5CR_MBURST_Field is HAL.UInt2; subtype S5CR_CHSEL_Field is HAL.UInt3; -- stream x configuration register type S5CR_Register is record -- Stream enable / flag stream ready when read low EN : Boolean := False; -- Direct mode error interrupt enable DMEIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Peripheral flow controller PFCTRL : Boolean := False; -- Data transfer direction DIR : S5CR_DIR_Field := 16#0#; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral data size PSIZE : S5CR_PSIZE_Field := 16#0#; -- Memory data size MSIZE : S5CR_MSIZE_Field := 16#0#; -- Peripheral increment offset size PINCOS : Boolean := False; -- Priority level PL : S5CR_PL_Field := 16#0#; -- Double buffer mode DBM : Boolean := False; -- Current target (only in double buffer mode) CT : Boolean := False; -- ACK ACK : Boolean := False; -- Peripheral burst transfer configuration PBURST : S5CR_PBURST_Field := 16#0#; -- Memory burst transfer configuration MBURST : S5CR_MBURST_Field := 16#0#; -- Channel selection CHSEL : S5CR_CHSEL_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S5CR_Register use record EN at 0 range 0 .. 0; DMEIE at 0 range 1 .. 1; TEIE at 0 range 2 .. 2; HTIE at 0 range 3 .. 3; TCIE at 0 range 4 .. 4; PFCTRL at 0 range 5 .. 5; DIR at 0 range 6 .. 7; CIRC at 0 range 8 .. 8; PINC at 0 range 9 .. 9; MINC at 0 range 10 .. 10; PSIZE at 0 range 11 .. 12; MSIZE at 0 range 13 .. 14; PINCOS at 0 range 15 .. 15; PL at 0 range 16 .. 17; DBM at 0 range 18 .. 18; CT at 0 range 19 .. 19; ACK at 0 range 20 .. 20; PBURST at 0 range 21 .. 22; MBURST at 0 range 23 .. 24; CHSEL at 0 range 25 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; --------------------- -- S5NDTR_Register -- --------------------- subtype S5NDTR_NDT_Field is HAL.Short; -- stream x number of data register type S5NDTR_Register is record -- Number of data items to transfer NDT : S5NDTR_NDT_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S5NDTR_Register use record NDT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- S5FCR_Register -- -------------------- subtype S5FCR_FTH_Field is HAL.UInt2; subtype S5FCR_FS_Field is HAL.UInt3; -- stream x FIFO control register type S5FCR_Register is record -- FIFO threshold selection FTH : S5FCR_FTH_Field := 16#1#; -- Direct mode disable DMDIS : Boolean := False; -- Read-only. FIFO status FS : S5FCR_FS_Field := 16#4#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- FIFO error interrupt enable FEIE : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S5FCR_Register use record FTH at 0 range 0 .. 1; DMDIS at 0 range 2 .. 2; FS at 0 range 3 .. 5; Reserved_6_6 at 0 range 6 .. 6; FEIE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ------------------- -- S6CR_Register -- ------------------- subtype S6CR_DIR_Field is HAL.UInt2; subtype S6CR_PSIZE_Field is HAL.UInt2; subtype S6CR_MSIZE_Field is HAL.UInt2; subtype S6CR_PL_Field is HAL.UInt2; subtype S6CR_PBURST_Field is HAL.UInt2; subtype S6CR_MBURST_Field is HAL.UInt2; subtype S6CR_CHSEL_Field is HAL.UInt3; -- stream x configuration register type S6CR_Register is record -- Stream enable / flag stream ready when read low EN : Boolean := False; -- Direct mode error interrupt enable DMEIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Peripheral flow controller PFCTRL : Boolean := False; -- Data transfer direction DIR : S6CR_DIR_Field := 16#0#; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral data size PSIZE : S6CR_PSIZE_Field := 16#0#; -- Memory data size MSIZE : S6CR_MSIZE_Field := 16#0#; -- Peripheral increment offset size PINCOS : Boolean := False; -- Priority level PL : S6CR_PL_Field := 16#0#; -- Double buffer mode DBM : Boolean := False; -- Current target (only in double buffer mode) CT : Boolean := False; -- ACK ACK : Boolean := False; -- Peripheral burst transfer configuration PBURST : S6CR_PBURST_Field := 16#0#; -- Memory burst transfer configuration MBURST : S6CR_MBURST_Field := 16#0#; -- Channel selection CHSEL : S6CR_CHSEL_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S6CR_Register use record EN at 0 range 0 .. 0; DMEIE at 0 range 1 .. 1; TEIE at 0 range 2 .. 2; HTIE at 0 range 3 .. 3; TCIE at 0 range 4 .. 4; PFCTRL at 0 range 5 .. 5; DIR at 0 range 6 .. 7; CIRC at 0 range 8 .. 8; PINC at 0 range 9 .. 9; MINC at 0 range 10 .. 10; PSIZE at 0 range 11 .. 12; MSIZE at 0 range 13 .. 14; PINCOS at 0 range 15 .. 15; PL at 0 range 16 .. 17; DBM at 0 range 18 .. 18; CT at 0 range 19 .. 19; ACK at 0 range 20 .. 20; PBURST at 0 range 21 .. 22; MBURST at 0 range 23 .. 24; CHSEL at 0 range 25 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; --------------------- -- S6NDTR_Register -- --------------------- subtype S6NDTR_NDT_Field is HAL.Short; -- stream x number of data register type S6NDTR_Register is record -- Number of data items to transfer NDT : S6NDTR_NDT_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S6NDTR_Register use record NDT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- S6FCR_Register -- -------------------- subtype S6FCR_FTH_Field is HAL.UInt2; subtype S6FCR_FS_Field is HAL.UInt3; -- stream x FIFO control register type S6FCR_Register is record -- FIFO threshold selection FTH : S6FCR_FTH_Field := 16#1#; -- Direct mode disable DMDIS : Boolean := False; -- Read-only. FIFO status FS : S6FCR_FS_Field := 16#4#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- FIFO error interrupt enable FEIE : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S6FCR_Register use record FTH at 0 range 0 .. 1; DMDIS at 0 range 2 .. 2; FS at 0 range 3 .. 5; Reserved_6_6 at 0 range 6 .. 6; FEIE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ------------------- -- S7CR_Register -- ------------------- subtype S7CR_DIR_Field is HAL.UInt2; subtype S7CR_PSIZE_Field is HAL.UInt2; subtype S7CR_MSIZE_Field is HAL.UInt2; subtype S7CR_PL_Field is HAL.UInt2; subtype S7CR_PBURST_Field is HAL.UInt2; subtype S7CR_MBURST_Field is HAL.UInt2; subtype S7CR_CHSEL_Field is HAL.UInt3; -- stream x configuration register type S7CR_Register is record -- Stream enable / flag stream ready when read low EN : Boolean := False; -- Direct mode error interrupt enable DMEIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Peripheral flow controller PFCTRL : Boolean := False; -- Data transfer direction DIR : S7CR_DIR_Field := 16#0#; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral data size PSIZE : S7CR_PSIZE_Field := 16#0#; -- Memory data size MSIZE : S7CR_MSIZE_Field := 16#0#; -- Peripheral increment offset size PINCOS : Boolean := False; -- Priority level PL : S7CR_PL_Field := 16#0#; -- Double buffer mode DBM : Boolean := False; -- Current target (only in double buffer mode) CT : Boolean := False; -- ACK ACK : Boolean := False; -- Peripheral burst transfer configuration PBURST : S7CR_PBURST_Field := 16#0#; -- Memory burst transfer configuration MBURST : S7CR_MBURST_Field := 16#0#; -- Channel selection CHSEL : S7CR_CHSEL_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S7CR_Register use record EN at 0 range 0 .. 0; DMEIE at 0 range 1 .. 1; TEIE at 0 range 2 .. 2; HTIE at 0 range 3 .. 3; TCIE at 0 range 4 .. 4; PFCTRL at 0 range 5 .. 5; DIR at 0 range 6 .. 7; CIRC at 0 range 8 .. 8; PINC at 0 range 9 .. 9; MINC at 0 range 10 .. 10; PSIZE at 0 range 11 .. 12; MSIZE at 0 range 13 .. 14; PINCOS at 0 range 15 .. 15; PL at 0 range 16 .. 17; DBM at 0 range 18 .. 18; CT at 0 range 19 .. 19; ACK at 0 range 20 .. 20; PBURST at 0 range 21 .. 22; MBURST at 0 range 23 .. 24; CHSEL at 0 range 25 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; --------------------- -- S7NDTR_Register -- --------------------- subtype S7NDTR_NDT_Field is HAL.Short; -- stream x number of data register type S7NDTR_Register is record -- Number of data items to transfer NDT : S7NDTR_NDT_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S7NDTR_Register use record NDT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- S7FCR_Register -- -------------------- subtype S7FCR_FTH_Field is HAL.UInt2; subtype S7FCR_FS_Field is HAL.UInt3; -- stream x FIFO control register type S7FCR_Register is record -- FIFO threshold selection FTH : S7FCR_FTH_Field := 16#1#; -- Direct mode disable DMDIS : Boolean := False; -- Read-only. FIFO status FS : S7FCR_FS_Field := 16#4#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- FIFO error interrupt enable FEIE : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for S7FCR_Register use record FTH at 0 range 0 .. 1; DMDIS at 0 range 2 .. 2; FS at 0 range 3 .. 5; Reserved_6_6 at 0 range 6 .. 6; FEIE at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- DMA controller type DMA_Peripheral is record -- low interrupt status register LISR : LISR_Register; -- high interrupt status register HISR : HISR_Register; -- low interrupt flag clear register LIFCR : LIFCR_Register; -- high interrupt flag clear register HIFCR : HIFCR_Register; -- stream x configuration register S0CR : S0CR_Register; -- stream x number of data register S0NDTR : S0NDTR_Register; -- stream x peripheral address register S0PAR : HAL.Word; -- stream x memory 0 address register S0M0AR : HAL.Word; -- stream x memory 1 address register S0M1AR : HAL.Word; -- stream x FIFO control register S0FCR : S0FCR_Register; -- stream x configuration register S1CR : S1CR_Register; -- stream x number of data register S1NDTR : S1NDTR_Register; -- stream x peripheral address register S1PAR : HAL.Word; -- stream x memory 0 address register S1M0AR : HAL.Word; -- stream x memory 1 address register S1M1AR : HAL.Word; -- stream x FIFO control register S1FCR : S1FCR_Register; -- stream x configuration register S2CR : S2CR_Register; -- stream x number of data register S2NDTR : S2NDTR_Register; -- stream x peripheral address register S2PAR : HAL.Word; -- stream x memory 0 address register S2M0AR : HAL.Word; -- stream x memory 1 address register S2M1AR : HAL.Word; -- stream x FIFO control register S2FCR : S2FCR_Register; -- stream x configuration register S3CR : S3CR_Register; -- stream x number of data register S3NDTR : S3NDTR_Register; -- stream x peripheral address register S3PAR : HAL.Word; -- stream x memory 0 address register S3M0AR : HAL.Word; -- stream x memory 1 address register S3M1AR : HAL.Word; -- stream x FIFO control register S3FCR : S3FCR_Register; -- stream x configuration register S4CR : S4CR_Register; -- stream x number of data register S4NDTR : S4NDTR_Register; -- stream x peripheral address register S4PAR : HAL.Word; -- stream x memory 0 address register S4M0AR : HAL.Word; -- stream x memory 1 address register S4M1AR : HAL.Word; -- stream x FIFO control register S4FCR : S4FCR_Register; -- stream x configuration register S5CR : S5CR_Register; -- stream x number of data register S5NDTR : S5NDTR_Register; -- stream x peripheral address register S5PAR : HAL.Word; -- stream x memory 0 address register S5M0AR : HAL.Word; -- stream x memory 1 address register S5M1AR : HAL.Word; -- stream x FIFO control register S5FCR : S5FCR_Register; -- stream x configuration register S6CR : S6CR_Register; -- stream x number of data register S6NDTR : S6NDTR_Register; -- stream x peripheral address register S6PAR : HAL.Word; -- stream x memory 0 address register S6M0AR : HAL.Word; -- stream x memory 1 address register S6M1AR : HAL.Word; -- stream x FIFO control register S6FCR : S6FCR_Register; -- stream x configuration register S7CR : S7CR_Register; -- stream x number of data register S7NDTR : S7NDTR_Register; -- stream x peripheral address register S7PAR : HAL.Word; -- stream x memory 0 address register S7M0AR : HAL.Word; -- stream x memory 1 address register S7M1AR : HAL.Word; -- stream x FIFO control register S7FCR : S7FCR_Register; end record with Volatile; for DMA_Peripheral use record LISR at 0 range 0 .. 31; HISR at 4 range 0 .. 31; LIFCR at 8 range 0 .. 31; HIFCR at 12 range 0 .. 31; S0CR at 16 range 0 .. 31; S0NDTR at 20 range 0 .. 31; S0PAR at 24 range 0 .. 31; S0M0AR at 28 range 0 .. 31; S0M1AR at 32 range 0 .. 31; S0FCR at 36 range 0 .. 31; S1CR at 40 range 0 .. 31; S1NDTR at 44 range 0 .. 31; S1PAR at 48 range 0 .. 31; S1M0AR at 52 range 0 .. 31; S1M1AR at 56 range 0 .. 31; S1FCR at 60 range 0 .. 31; S2CR at 64 range 0 .. 31; S2NDTR at 68 range 0 .. 31; S2PAR at 72 range 0 .. 31; S2M0AR at 76 range 0 .. 31; S2M1AR at 80 range 0 .. 31; S2FCR at 84 range 0 .. 31; S3CR at 88 range 0 .. 31; S3NDTR at 92 range 0 .. 31; S3PAR at 96 range 0 .. 31; S3M0AR at 100 range 0 .. 31; S3M1AR at 104 range 0 .. 31; S3FCR at 108 range 0 .. 31; S4CR at 112 range 0 .. 31; S4NDTR at 116 range 0 .. 31; S4PAR at 120 range 0 .. 31; S4M0AR at 124 range 0 .. 31; S4M1AR at 128 range 0 .. 31; S4FCR at 132 range 0 .. 31; S5CR at 136 range 0 .. 31; S5NDTR at 140 range 0 .. 31; S5PAR at 144 range 0 .. 31; S5M0AR at 148 range 0 .. 31; S5M1AR at 152 range 0 .. 31; S5FCR at 156 range 0 .. 31; S6CR at 160 range 0 .. 31; S6NDTR at 164 range 0 .. 31; S6PAR at 168 range 0 .. 31; S6M0AR at 172 range 0 .. 31; S6M1AR at 176 range 0 .. 31; S6FCR at 180 range 0 .. 31; S7CR at 184 range 0 .. 31; S7NDTR at 188 range 0 .. 31; S7PAR at 192 range 0 .. 31; S7M0AR at 196 range 0 .. 31; S7M1AR at 200 range 0 .. 31; S7FCR at 204 range 0 .. 31; end record; -- DMA controller DMA1_Periph : aliased DMA_Peripheral with Import, Address => DMA1_Base; -- DMA controller DMA2_Periph : aliased DMA_Peripheral with Import, Address => DMA2_Base; end STM32_SVD.DMA;
35.782504
73
0.52906
50b797007b2881bb0cd27c0872cd2880eb7b90a9
169
ads
Ada
tests/lib_a/src/lib_a.ads
alire-project/resources
a418da627ec3d18f50f60edaee41a2f47f173a0e
[ "MIT" ]
null
null
null
tests/lib_a/src/lib_a.ads
alire-project/resources
a418da627ec3d18f50f60edaee41a2f47f173a0e
[ "MIT" ]
null
null
null
tests/lib_a/src/lib_a.ads
alire-project/resources
a418da627ec3d18f50f60edaee41a2f47f173a0e
[ "MIT" ]
null
null
null
with lib_a_Config; with Resources; package Lib_A is package Resources is new Standard.Resources (lib_a_Config.Crate_Name); procedure Print_Content; end Lib_A;
15.363636
73
0.786982
a1cb7bc273037207e1fa06015ddc95cbc91844cd
332
ads
Ada
Ada/semaphores.ads
UdayanSinha/Code_Blocks
43c010dcfb587942b6e6f8ba72b93862042afa1d
[ "MIT" ]
3
2016-10-30T05:54:44.000Z
2021-05-17T20:24:42.000Z
Ada/semaphores.ads
UdayanSinha/Code_Blocks
43c010dcfb587942b6e6f8ba72b93862042afa1d
[ "MIT" ]
null
null
null
Ada/semaphores.ads
UdayanSinha/Code_Blocks
43c010dcfb587942b6e6f8ba72b93862042afa1d
[ "MIT" ]
1
2018-10-04T08:20:25.000Z
2018-10-04T08:20:25.000Z
-- Package: Semaphores package Semaphores is protected type CountingSemaphore(Max: Natural; Initial: Natural) is entry Wait; entry Signal; private Count : Natural := Initial; --number of keys available MaxCount : Natural := Max; --total number of keys end CountingSemaphore; end Semaphores;
25.538462
71
0.683735
06ee3f5f826214552fe3962c149079148ae97ce6
1,535
ads
Ada
tier-1/xcb/source/thin/xcb-xcb_render_glyphinfo_iterator_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
2
2015-11-12T11:16:20.000Z
2021-08-24T22:32:04.000Z
tier-1/xcb/source/thin/xcb-xcb_render_glyphinfo_iterator_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
1
2018-06-05T05:19:35.000Z
2021-11-20T01:13:23.000Z
tier-1/xcb/source/thin/xcb-xcb_render_glyphinfo_iterator_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
null
null
null
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces.C; with xcb.xcb_render_glyphinfo_t; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_render_glyphinfo_iterator_t is -- Item -- type Item is record data : access xcb.xcb_render_glyphinfo_t.Item; the_rem : aliased Interfaces.C.int; index : aliased Interfaces.C.int; end record; -- Item_Array -- type Item_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_render_glyphinfo_iterator_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_render_glyphinfo_iterator_t.Item, Element_Array => xcb.xcb_render_glyphinfo_iterator_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_render_glyphinfo_iterator_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_render_glyphinfo_iterator_t.Pointer, Element_Array => xcb.xcb_render_glyphinfo_iterator_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_render_glyphinfo_iterator_t;
27.410714
78
0.674267
0b9c3595cc8e7ffc77e4bf83b000e9ac9e907db0
3,253
adb
Ada
examples/embedded_simulator/src/main.adb
Fabien-Chouteau/libriscv
eed3ddf24a9682a95f9d315650b753577853eb92
[ "BSD-3-Clause" ]
null
null
null
examples/embedded_simulator/src/main.adb
Fabien-Chouteau/libriscv
eed3ddf24a9682a95f9d315650b753577853eb92
[ "BSD-3-Clause" ]
null
null
null
examples/embedded_simulator/src/main.adb
Fabien-Chouteau/libriscv
eed3ddf24a9682a95f9d315650b753577853eb92
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2019, Fabien Chouteau -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with LibRISCV.Sim.Platform; with LibRISCV.Sim.Memory_Bus; with LibRISCV.Sim.Shutdown; with LibRISCV.Examples; use LibRISCV; use LibRISCV.Sim; with Last_Chance_Handler; pragma Unreferenced (Last_Chance_Handler); procedure Main is SOC : Platform.Instance (Hart_Count => 1); Bus : Memory_Bus.Instance (RAM_Base => 16#8000_0000#, RAM_Size => 1024); use type Platform.State_Kind; pragma Warnings (Off, "*has been made static*"); Tohost : Word with Volatile; pragma Export (C, Tohost, "tohost"); pragma Warnings (On, "*has been made static*"); begin SOC.Reset; SOC.Resume; Bus.Set_Tohost (16#E000_0000#); Bus.Enable_HTIF; Examples.Load_Hello_World (Bus, 16#E000_0000#); loop SOC.Cycle (Bus); exit when SOC.State = Platform.Reset or else Shutdown.Requested; end loop; Tohost := 1; end Main;
45.180556
78
0.552106
4dee28a3cdcd30c58ed98eb26c8afb49d1a2e547
371
ads
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/controlled3.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/controlled3.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/controlled3.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
with Ada.Finalization; use Ada.Finalization; package controlled3 is type Test is new Controlled with null record; procedure Add_Test (T : access Test'Class); type Test_Case1 is new Test with null record; type Test_Suite is new Test with null record; type Test_Case is new Test_Case1 with record Link_Under_Test : Natural; end record; end;
28.538462
48
0.735849
4d3ccb7a5fb07463853cd9b13316eb64baa0706b
1,772
ada
Ada
Task/Accumulator-factory/Ada/accumulator-factory-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/Accumulator-factory/Ada/accumulator-factory-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/Accumulator-factory/Ada/accumulator-factory-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
package body Accumulator is -- The accumulator lives through three states. It is in Virgin_State -- before any use of The_Function. It changes to Integer_State or -- Float_State, according to the input type used. The accumulation is -- memorized in variable I or F, according to the state. Float_State, -- once reached, is never left. A Float output on an Integer_State is -- simply a conversion, sans effect on state. (Marius Amado-Alves) type State_T is (Virgin_State, Integer_State, Float_State); State : State_T := Virgin_State; I : Integer; F : Float; function The_Function (X : Float) return Float is begin case State is when Virgin_State => State := Float_State; F := X; return F; when Integer_State => State := Float_State; F := Float (I) + X; return F; when Float_State => F := F + X; return F; end case; end; function The_Function (X : Integer) return Float is begin case State is when Virgin_State => State := Integer_State; I := X; return Float (I); when Integer_State => I := I + X; return Float (I); when Float_State => F := F + Float (X); return F; end case; end; function The_Function (X : Integer) return Integer is begin case State is when Virgin_State => State := Integer_State; I := X; return I; when Integer_State => I := I + X; return I; when Float_State => F := F + Float (X); return Integer (F); end case; end; end;
27.261538
70
0.544018
fbb685994378572b560942325a472a1c2b2bdfd1
35,435
adb
Ada
test/halide_data/pldi_camera_ready/big_apps_32_real/conv2d/collateral/conv2d/hls_target/.autopilot/db/call.adb
David-Durst/embeddedHaskellAetherling
34c5403e07433e572170699f3bd69c5b5c3eff2d
[ "BSD-3-Clause" ]
20
2019-03-12T20:12:31.000Z
2022-02-07T04:23:22.000Z
apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d/conv2d_div39/hls_target/.autopilot/db/call.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
30
2019-07-22T19:25:42.000Z
2020-06-18T17:58:43.000Z
test/halide_data/pldi_camera_ready/big_apps_32_real/conv2d/collateral/conv2d/hls_target/.autopilot/db/call.adb
David-Durst/embeddedHaskellAetherling
34c5403e07433e572170699f3bd69c5b5c3eff2d
[ "BSD-3-Clause" ]
3
2019-10-14T18:07:26.000Z
2022-01-20T14:36:17.000Z
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="14"> <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>call</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>in_stream_V_value_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>in_stream.V.value.V</originalName> <rtlName/> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>32</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>out_stream_V_value_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>out_stream.V.value.V</originalName> <rtlName/> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>288</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> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>8</id> <name>slice_stream_V_value</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>172</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first> <second class_id="11" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="12" tracking_level="0" version="0"> <first class_id="13" tracking_level="0" version="0"> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>172</second> </item> </second> </item> </inlineStackInfo> <originalName>slice_stream.V.value.V</originalName> <rtlName>slice_stream_V_value_U</rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>96</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>17</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>12</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>call_Loop_LB2D_buf_p_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>19</item> <item>20</item> <item>21</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>13</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>call_Loop_LB2D_shift_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>5</count> <item_version>0</item_version> <item>23</item> <item>24</item> <item>25</item> <item>135</item> <item>136</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>14</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>219</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>219</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_7"> <Value> <Obj> <type>2</type> <id>16</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_8"> <Value> <Obj> <type>2</type> <id>18</id> <name>call_Loop_LB2D_buf_p</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:call_Loop_LB2D_buf_p&gt;</content> </item> <item class_id_reference="16" object_id="_9"> <Value> <Obj> <type>2</type> <id>22</id> <name>call_Loop_LB2D_shift</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:call_Loop_LB2D_shift&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="_10"> <Obj> <type>3</type> <id>15</id> <name>call</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>8</item> <item>12</item> <item>13</item> <item>14</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_11"> <id>17</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>8</sink_obj> </item> <item class_id_reference="20" object_id="_12"> <id>19</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_13"> <id>20</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_14"> <id>21</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_15"> <id>23</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_16"> <id>24</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_17"> <id>25</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_18"> <id>135</id> <edge_type>4</edge_type> <source_obj>12</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_19"> <id>136</id> <edge_type>4</edge_type> <source_obj>12</source_obj> <sink_obj>13</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_20"> <mId>1</mId> <mTag>call</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>15</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>2077921</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>1</mIsDfPipe> <mDfPipe class_id="23" tracking_level="1" version="0" object_id="_21"> <port_list class_id="24" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port_list> <process_list class_id="25" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_22"> <type>0</type> <name>call_Loop_LB2D_buf_p_U0</name> <ssdmobj_id>12</ssdmobj_id> <pins class_id="27" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_23"> <port class_id="29" tracking_level="1" version="0" object_id="_24"> <name>in_stream_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id="30" tracking_level="1" version="0" object_id="_25"> <type>0</type> <name>call_Loop_LB2D_buf_p_U0</name> <ssdmobj_id>12</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_26"> <port class_id_reference="29" object_id="_27"> <name>slice_stream_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_25"/> </item> </pins> </item> <item class_id_reference="26" object_id="_28"> <type>0</type> <name>call_Loop_LB2D_shift_U0</name> <ssdmobj_id>13</ssdmobj_id> <pins> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_29"> <port class_id_reference="29" object_id="_30"> <name>slice_stream_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_31"> <type>0</type> <name>call_Loop_LB2D_shift_U0</name> <ssdmobj_id>13</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_32"> <port class_id_reference="29" object_id="_33"> <name>out_stream_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_31"/> </item> </pins> </item> </process_list> <channel_list class_id="31" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="32" tracking_level="1" version="0" object_id="_34"> <type>1</type> <name>slice_stream_V_value</name> <ssdmobj_id>8</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>96</bitwidth> <source class_id_reference="28" object_id="_35"> <port class_id_reference="29" object_id="_36"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_25"/> </source> <sink class_id_reference="28" object_id="_37"> <port class_id_reference="29" object_id="_38"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_31"/> </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="_39"> <states class_id="35" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="36" tracking_level="1" version="0" object_id="_40"> <id>1</id> <operations class_id="37" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="38" tracking_level="1" version="0" object_id="_41"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_42"> <id>12</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_43"> <id>2</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_44"> <id>12</id> <stage>1</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_45"> <id>3</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_46"> <id>13</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_47"> <id>4</id> <operations> <count>10</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_48"> <id>3</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_49"> <id>4</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_50"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_51"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_52"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_53"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_54"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_55"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_56"> <id>13</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="38" object_id="_57"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="39" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="40" tracking_level="1" version="0" object_id="_58"> <inState>1</inState> <outState>2</outState> <condition class_id="41" tracking_level="0" version="0"> <id>0</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="_59"> <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> <item class_id_reference="40" object_id="_60"> <inState>3</inState> <outState>4</outState> <condition> <id>2</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="_61"> <dp_component_resource class_id="45" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>call_Loop_LB2D_buf_p_U0 (call_Loop_LB2D_buf_p)</first> <second class_id="47" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first>BRAM</first> <second>8</second> </item> <item> <first>FF</first> <second>787</second> </item> <item> <first>LUT</first> <second>493</second> </item> </second> </item> <item> <first>call_Loop_LB2D_shift_U0 (call_Loop_LB2D_shift)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>310</second> </item> <item> <first>LUT</first> <second>146</second> </item> </second> </item> <item> <first>start_for_call_LodEe_U (start_for_call_LodEe)</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> </dp_component_resource> <dp_expression_resource> <count>2</count> <item_version>0</item_version> <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>2</second> </item> </second> </item> <item> <first>call_Loop_LB2D_buf_p_U0_start_full_n ( 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>2</second> </item> </second> </item> </dp_expression_resource> <dp_fifo_resource> <count>1</count> <item_version>0</item_version> <item> <first>slice_stream_V_value_U</first> <second> <count>5</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>1</second> </item> <item> <first>(1Bits)</first> <second>96</second> </item> <item> <first>(2Size:D*B)</first> <second>96</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>1</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>0</count> <item_version>0</item_version> </dp_multiplexer_resource> <dp_register_resource> <count>0</count> <item_version>0</item_version> </dp_register_resource> <dp_component_map class_id="49" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="50" tracking_level="0" version="0"> <first>call_Loop_LB2D_buf_p_U0 (call_Loop_LB2D_buf_p)</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>call_Loop_LB2D_shift_U0 (call_Loop_LB2D_shift)</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> </dp_component_map> <dp_expression_map> <count>0</count> <item_version>0</item_version> </dp_expression_map> <dp_fifo_map> <count>1</count> <item_version>0</item_version> <item> <first>slice_stream_V_value_U</first> <second> <count>1</count> <item_version>0</item_version> <item>43</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>4</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>8</first> <second class_id="53" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>0</first> <second>1</second> </second> </item> <item> <first>13</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>14</first> <second> <first>3</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>15</first> <second class_id="56" tracking_level="0" version="0"> <first>0</first> <second>3</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="_62"> <region_name>call</region_name> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>15</item> </basic_blocks> <nodes> <count>12</count> <item_version>0</item_version> <item>3</item> <item>4</item> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> <item>10</item> <item>11</item> <item>12</item> <item>13</item> <item>14</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>3</count> <item_version>0</item_version> <item class_id="60" tracking_level="0" version="0"> <first>36</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>40</first> <second> <count>2</count> <item_version>0</item_version> <item>12</item> <item>12</item> </second> </item> <item> <first>47</first> <second> <count>2</count> <item_version>0</item_version> <item>13</item> <item>13</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="62" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="63" tracking_level="0" version="0"> <first>slice_stream_V_value_fu_36</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>2</count> <item_version>0</item_version> <item> <first>grp_call_Loop_LB2D_buf_p_fu_40</first> <second> <count>2</count> <item_version>0</item_version> <item>12</item> <item>12</item> </second> </item> <item> <first>grp_call_Loop_LB2D_shift_fu_47</first> <second> <count>2</count> <item_version>0</item_version> <item>13</item> <item>13</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>1</count> <item_version>0</item_version> <item> <first>54</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>1</count> <item_version>0</item_version> <item> <first>slice_stream_V_value_reg_54</first> <second> <count>1</count> <item_version>0</item_version> <item>8</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>2</count> <item_version>0</item_version> <item class_id="66" tracking_level="0" version="0"> <first>in_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> </second> </item> <item> <first>out_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="67" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="68" tracking_level="0" version="0"> <first>1</first> <second>FIFO_SRL</second> </item> <item> <first>2</first> <second>FIFO_SRL</second> </item> </port2core> <node2core> <count>1</count> <item_version>0</item_version> <item> <first>8</first> <second>FIFO_SRL</second> </item> </node2core> </syndb> </boost_serialization>
32.871058
130
0.480768
06c5109afb55f490e6bddabea837fb5ed2aa45e2
6,311
ads
Ada
source/amf/uml/amf-uml-deployment_specifications.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/uml/amf-uml-deployment_specifications.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/uml/amf-uml-deployment_specifications.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A deployment specification specifies a set of properties that determine -- execution parameters of a component artifact that is deployed on a node. A -- deployment specification can be aimed at a specific type of container. An -- artifact that reifies or implements deployment specification properties is -- a deployment descriptor. ------------------------------------------------------------------------------ with AMF.UML.Artifacts; limited with AMF.UML.Deployments; package AMF.UML.Deployment_Specifications is pragma Preelaborate; type UML_Deployment_Specification is limited interface and AMF.UML.Artifacts.UML_Artifact; type UML_Deployment_Specification_Access is access all UML_Deployment_Specification'Class; for UML_Deployment_Specification_Access'Storage_Size use 0; not overriding function Get_Deployment (Self : not null access constant UML_Deployment_Specification) return AMF.UML.Deployments.UML_Deployment_Access is abstract; -- Getter of DeploymentSpecification::deployment. -- -- The deployment with which the DeploymentSpecification is associated. not overriding procedure Set_Deployment (Self : not null access UML_Deployment_Specification; To : AMF.UML.Deployments.UML_Deployment_Access) is abstract; -- Setter of DeploymentSpecification::deployment. -- -- The deployment with which the DeploymentSpecification is associated. not overriding function Get_Deployment_Location (Self : not null access constant UML_Deployment_Specification) return AMF.Optional_String is abstract; -- Getter of DeploymentSpecification::deploymentLocation. -- -- The location where an Artifact is deployed onto a Node. This is -- typically a 'directory' or 'memory address'. not overriding procedure Set_Deployment_Location (Self : not null access UML_Deployment_Specification; To : AMF.Optional_String) is abstract; -- Setter of DeploymentSpecification::deploymentLocation. -- -- The location where an Artifact is deployed onto a Node. This is -- typically a 'directory' or 'memory address'. not overriding function Get_Execution_Location (Self : not null access constant UML_Deployment_Specification) return AMF.Optional_String is abstract; -- Getter of DeploymentSpecification::executionLocation. -- -- The location where a component Artifact executes. This may be a local -- or remote location. not overriding procedure Set_Execution_Location (Self : not null access UML_Deployment_Specification; To : AMF.Optional_String) is abstract; -- Setter of DeploymentSpecification::executionLocation. -- -- The location where a component Artifact executes. This may be a local -- or remote location. end AMF.UML.Deployment_Specifications;
55.849558
79
0.54508
fb8513b627a3777b711fa37d53fb8d591b5e9bc6
1,111
ads
Ada
memsim-master/src/util.ads
strenkml/EE368
00f15bce9e65badddc613355643b1061fd4a8195
[ "MIT" ]
null
null
null
memsim-master/src/util.ads
strenkml/EE368
00f15bce9e65badddc613355643b1061fd4a8195
[ "MIT" ]
null
null
null
memsim-master/src/util.ads
strenkml/EE368
00f15bce9e65badddc613355643b1061fd4a8195
[ "MIT" ]
null
null
null
-- Miscellaneous types and functions. package Util is -- Type to represent a memory address. type Address_Type is mod 2 ** 64; -- Type to represent access time in cycles. type Time_Type is new Long_Integer range 0 .. Long_Integer'Last; -- Type to represent the cost of a memory subsystem. type Cost_Type is new Long_Integer range 0 .. Long_Integer'Last; -- Add two cost types (saturating addition). function "+"(a, b : Cost_Type) return Cost_Type; -- Compute the log base 2 of a Natural. function Log2(n : Natural) return Natural; -- Compute the log base 2 of a Long_Integer. function Log2(n : Long_Integer) return Natural; -- Round n to the next highest power of 2. function Round_Power2(n : Natural) return Natural; -- Convert an Integer to a string (without spaces). function To_String(i : Integer) return String; -- Convert a Long_Integer to a string (without spaces). function To_String(i : Long_Integer) return String; -- Convert a Long_Float to a string (without spaces). function To_String(f : Long_Float) return String; end Util;
30.861111
67
0.710171
124c920c6f32132121bc8ce5357490ffa128e9b5
1,185
ads
Ada
source/tasking/machine-w64-mingw32/a-intnam.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/tasking/machine-w64-mingw32/a-intnam.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/tasking/machine-w64-mingw32/a-intnam.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
pragma License (Unrestricted); -- specialized for Windows private with System.Interrupt_Numbers; package Ada.Interrupts.Names is -- This package is system-specific. SIGINT : constant Interrupt_Id; SIGILL : constant Interrupt_Id; SIGABRT_COMPAT : constant Interrupt_Id; SIGFPE : constant Interrupt_Id; SIGSEGV : constant Interrupt_Id; SIGTERM : constant Interrupt_Id; SIGBREAK : constant Interrupt_Id; SIGABRT : constant Interrupt_Id; -- SIGABRT2 : constant Interrupt_Id renames SIGABRT; First_Interrupt_Id : constant Interrupt_Id; Last_Interrupt_Id : constant Interrupt_Id; private SIGINT : constant Interrupt_Id := 2; SIGILL : constant Interrupt_Id := 4; SIGABRT_COMPAT : constant Interrupt_Id := 6; SIGFPE : constant Interrupt_Id := 8; SIGSEGV : constant Interrupt_Id := 11; SIGTERM : constant Interrupt_Id := 15; SIGBREAK : constant Interrupt_Id := 21; SIGABRT : constant Interrupt_Id := 22; First_Interrupt_Id : constant Interrupt_Id := System.Interrupt_Numbers.First_Interrupt_Id; Last_Interrupt_Id : constant Interrupt_Id := System.Interrupt_Numbers.Last_Interrupt_Id; end Ada.Interrupts.Names;
32.027027
53
0.750211
4dfbd171d8e373749d3f360c68e116874d5ec12f
63
adb
Ada
src_pruebas/prueba_alarmas.adb
Asier98/AdaCar
1faaed09842c0c3573f359f049f559d97ccfe454
[ "MIT" ]
null
null
null
src_pruebas/prueba_alarmas.adb
Asier98/AdaCar
1faaed09842c0c3573f359f049f559d97ccfe454
[ "MIT" ]
null
null
null
src_pruebas/prueba_alarmas.adb
Asier98/AdaCar
1faaed09842c0c3573f359f049f559d97ccfe454
[ "MIT" ]
null
null
null
procedure Prueba_Alarmas is begin null; end Prueba_Alarmas;
12.6
27
0.809524
0b033f65a7eeef5535c2180fa42291572a963d6b
5,064
adb
Ada
src/rejuvenation-placeholders.adb
TNO/Rejuvenation-Ada
8113ec28da3923ccde40d76cbab70e0e614f4b75
[ "BSD-3-Clause" ]
1
2022-03-08T13:00:47.000Z
2022-03-08T13:00:47.000Z
src/libraries/Rejuvenation_Lib/src/rejuvenation-placeholders.adb
selroc/Renaissance-Ada
39230b34aced4a9d83831be346ca103136c53715
[ "BSD-3-Clause" ]
null
null
null
src/libraries/Rejuvenation_Lib/src/rejuvenation-placeholders.adb
selroc/Renaissance-Ada
39230b34aced4a9d83831be346ca103136c53715
[ "BSD-3-Clause" ]
null
null
null
with GNAT.Regpat; use GNAT.Regpat; with Rejuvenation.Finder; use Rejuvenation.Finder; with Rejuvenation.Utils; use Rejuvenation.Utils; package body Rejuvenation.Placeholders is Placeholder_Matcher : constant GNAT.Regpat.Pattern_Matcher := Compile ("\$[SM]_[a-zA-Z0-9_]+"); function Is_Placeholder_Name (Name : String) return Boolean is (GNAT.Regpat.Match (Placeholder_Matcher, Name)); Single_Placeholder_Matcher : constant GNAT.Regpat.Pattern_Matcher := Compile ("\$S_[a-zA-Z0-9_]+"); function Is_Single_Placeholder_Name (Name : String) return Boolean is (GNAT.Regpat.Match (Single_Placeholder_Matcher, Name)); Multiple_Placeholder_Matcher : constant GNAT.Regpat.Pattern_Matcher := Compile ("\$M_[a-zA-Z0-9_]+"); function Is_Multiple_Placeholder_Name (Name : String) return Boolean is (GNAT.Regpat.Match (Multiple_Placeholder_Matcher, Name)); function Get_Name_At_Placeholder_Location (Node : Ada_Node'Class) return String; -- return the string at the location of a placeholder name -- in case of absence of placeholder location, the empty string is returned -- -- Get_Name_At_Placeholder_Location -- is introduced to localize the information -- * what kind of nodes can be placeholders -- * where is the placeholder name located for the different kinds function Get_Name_At_Placeholder_Location (Node : Ada_Node'Class) return String is begin case Node.Kind is when Ada_Identifier | Ada_Defining_Name | Ada_Enum_Literal_Decl => return Raw_Signature (Node); when Ada_Call_Stmt => declare Name : constant Libadalang.Analysis.Name := Node.As_Call_Stmt.F_Call; begin if Name.Kind = Ada_Identifier then return Raw_Signature (Name); end if; end; when Ada_Discriminant_Assoc => declare D_A : constant Discriminant_Assoc := Node.As_Discriminant_Assoc; Ids : constant Discriminant_Choice_List := D_A.F_Ids; Discr_Expr : constant Expr := D_A.F_Discr_Expr; begin if Ids.Children_Count = 0 and then Discr_Expr.Kind = Ada_Identifier then return Raw_Signature (Discr_Expr); end if; end; when Ada_Param_Assoc => declare P_A : constant Param_Assoc := Node.As_Param_Assoc; Designator : constant Ada_Node := P_A.F_Designator; R_Expr : constant Expr := P_A.F_R_Expr; begin if Designator.Is_Null and then R_Expr.Kind = Ada_Identifier then return Raw_Signature (R_Expr); end if; end; when Ada_Aspect_Assoc => declare A_A : constant Aspect_Assoc := Node.As_Aspect_Assoc; N : constant Name := A_A.F_Id; begin if A_A.F_Expr.Is_Null and then N.Kind = Ada_Identifier then return Raw_Signature (N); end if; end; when Ada_Subtype_Indication => declare SI : constant Subtype_Indication := Node.As_Subtype_Indication; Name : constant Libadalang.Analysis.Name := SI.F_Name; begin if Name.Kind = Ada_Identifier and then SI.F_Constraint.Is_Null then return Raw_Signature (Name); end if; end; when others => null; end case; return ""; end Get_Name_At_Placeholder_Location; function Is_Placeholder (Node : Ada_Node'Class) return Boolean is (Is_Placeholder_Name (Get_Name_At_Placeholder_Location (Node))); function Is_Single_Placeholder (Node : Ada_Node'Class) return Boolean is (Is_Single_Placeholder_Name (Get_Name_At_Placeholder_Location (Node))); function Is_Multiple_Placeholder (Node : Ada_Node'Class) return Boolean is (Is_Multiple_Placeholder_Name (Get_Name_At_Placeholder_Location (Node))); function Get_Placeholder_Name (Node : Ada_Node'Class) return String is (Get_Name_At_Placeholder_Location (Node)); function Get_Placeholders (Node : Ada_Node'Class) return Node_List.Vector is (Find_Non_Contained (Node, Is_Placeholder'Access)); function Get_Placeholder_Names (Node : Ada_Node'Class) return String_Sets.Set is Result : String_Sets.Set; function Visit (Node : Ada_Node'Class) return Visit_Status; function Visit (Node : Ada_Node'Class) return Visit_Status is begin if Is_Placeholder (Node) then Result.Include (Get_Placeholder_Name (Node)); return Over; else return Into; end if; end Visit; begin Node.Traverse (Visit'Access); return Result; end Get_Placeholder_Names; end Rejuvenation.Placeholders;
35.914894
79
0.631714
060f352a85305ace0cff3bf097e84ded97fbcae9
19,791
adb
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-arit64.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-arit64.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-arit64.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . A R I T H _ 6 4 -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Interfaces; use Interfaces; with Ada.Unchecked_Conversion; package body System.Arith_64 is pragma Suppress (Overflow_Check); pragma Suppress (Range_Check); subtype Uns64 is Unsigned_64; function To_Uns is new Ada.Unchecked_Conversion (Int64, Uns64); function To_Int is new Ada.Unchecked_Conversion (Uns64, Int64); subtype Uns32 is Unsigned_32; ----------------------- -- Local Subprograms -- ----------------------- function "+" (A, B : Uns32) return Uns64 is (Uns64 (A) + Uns64 (B)); function "+" (A : Uns64; B : Uns32) return Uns64 is (A + Uns64 (B)); -- Length doubling additions function "*" (A, B : Uns32) return Uns64 is (Uns64 (A) * Uns64 (B)); -- Length doubling multiplication function "/" (A : Uns64; B : Uns32) return Uns64 is (A / Uns64 (B)); -- Length doubling division function "&" (Hi, Lo : Uns32) return Uns64 is (Shift_Left (Uns64 (Hi), 32) or Uns64 (Lo)); -- Concatenate hi, lo values to form 64-bit result function "abs" (X : Int64) return Uns64 is (if X = Int64'First then 2**63 else Uns64 (Int64'(abs X))); -- Convert absolute value of X to unsigned. Note that we can't just use -- the expression of the Else, because it overflows for X = Int64'First. function "rem" (A : Uns64; B : Uns32) return Uns64 is (A rem Uns64 (B)); -- Length doubling remainder function Le3 (X1, X2, X3 : Uns32; Y1, Y2, Y3 : Uns32) return Boolean; -- Determines if 96 bit value X1&X2&X3 <= Y1&Y2&Y3 function Lo (A : Uns64) return Uns32 is (Uns32 (A and 16#FFFF_FFFF#)); -- Low order half of 64-bit value function Hi (A : Uns64) return Uns32 is (Uns32 (Shift_Right (A, 32))); -- High order half of 64-bit value procedure Sub3 (X1, X2, X3 : in out Uns32; Y1, Y2, Y3 : Uns32); -- Computes X1&X2&X3 := X1&X2&X3 - Y1&Y1&Y3 with mod 2**96 wrap function To_Neg_Int (A : Uns64) return Int64 with Inline; -- Convert to negative integer equivalent. If the input is in the range -- 0 .. 2 ** 63, then the corresponding negative signed integer (obtained -- by negating the given value) is returned, otherwise constraint error -- is raised. function To_Pos_Int (A : Uns64) return Int64 with Inline; -- Convert to positive integer equivalent. If the input is in the range -- 0 .. 2 ** 63-1, then the corresponding non-negative signed integer is -- returned, otherwise constraint error is raised. procedure Raise_Error with Inline; pragma No_Return (Raise_Error); -- Raise constraint error with appropriate message -------------------------- -- Add_With_Ovflo_Check -- -------------------------- function Add_With_Ovflo_Check (X, Y : Int64) return Int64 is R : constant Int64 := To_Int (To_Uns (X) + To_Uns (Y)); begin if X >= 0 then if Y < 0 or else R >= 0 then return R; end if; else -- X < 0 if Y > 0 or else R < 0 then return R; end if; end if; Raise_Error; end Add_With_Ovflo_Check; ------------------- -- Double_Divide -- ------------------- procedure Double_Divide (X, Y, Z : Int64; Q, R : out Int64; Round : Boolean) is Xu : constant Uns64 := abs X; Yu : constant Uns64 := abs Y; Yhi : constant Uns32 := Hi (Yu); Ylo : constant Uns32 := Lo (Yu); Zu : constant Uns64 := abs Z; Zhi : constant Uns32 := Hi (Zu); Zlo : constant Uns32 := Lo (Zu); T1, T2 : Uns64; Du, Qu, Ru : Uns64; Den_Pos : Boolean; begin if Yu = 0 or else Zu = 0 then Raise_Error; end if; -- Set final signs (RM 4.5.5(27-30)) Den_Pos := (Y < 0) = (Z < 0); -- Compute Y * Z. Note that if the result overflows 64 bits unsigned, -- then the rounded result is zero, except for the very special case -- where X = -2**63 and abs(Y*Z) = 2**64, when Round is True. if Yhi /= 0 then if Zhi /= 0 then -- Handle the special case when Round is True if Yhi = 1 and then Zhi = 1 and then Ylo = 0 and then Zlo = 0 and then X = Int64'First and then Round then Q := (if Den_Pos then -1 else 1); else Q := 0; end if; R := X; return; else T2 := Yhi * Zlo; end if; else T2 := Ylo * Zhi; end if; T1 := Ylo * Zlo; T2 := T2 + Hi (T1); if Hi (T2) /= 0 then -- Handle the special case when Round is True if Hi (T2) = 1 and then Lo (T2) = 0 and then Lo (T1) = 0 and then X = Int64'First and then Round then Q := (if Den_Pos then -1 else 1); else Q := 0; end if; R := X; return; end if; Du := Lo (T2) & Lo (T1); -- Check overflow case of largest negative number divided by -1 if X = Int64'First and then Du = 1 and then not Den_Pos then Raise_Error; end if; -- Perform the actual division Qu := Xu / Du; Ru := Xu rem Du; -- Deal with rounding case if Round and then Ru > (Du - Uns64'(1)) / Uns64'(2) then Qu := Qu + Uns64'(1); end if; -- Case of dividend (X) sign positive if X >= 0 then R := To_Int (Ru); Q := (if Den_Pos then To_Int (Qu) else -To_Int (Qu)); -- Case of dividend (X) sign negative -- We perform the unary minus operation on the unsigned value -- before conversion to signed, to avoid a possible overflow for -- value -2**63, both for computing R and Q. else R := To_Int (-Ru); Q := (if Den_Pos then To_Int (-Qu) else To_Int (Qu)); end if; end Double_Divide; --------- -- Le3 -- --------- function Le3 (X1, X2, X3 : Uns32; Y1, Y2, Y3 : Uns32) return Boolean is begin if X1 < Y1 then return True; elsif X1 > Y1 then return False; elsif X2 < Y2 then return True; elsif X2 > Y2 then return False; else return X3 <= Y3; end if; end Le3; ------------------------------- -- Multiply_With_Ovflo_Check -- ------------------------------- function Multiply_With_Ovflo_Check (X, Y : Int64) return Int64 is Xu : constant Uns64 := abs X; Xhi : constant Uns32 := Hi (Xu); Xlo : constant Uns32 := Lo (Xu); Yu : constant Uns64 := abs Y; Yhi : constant Uns32 := Hi (Yu); Ylo : constant Uns32 := Lo (Yu); T1, T2 : Uns64; begin if Xhi /= 0 then if Yhi /= 0 then Raise_Error; else T2 := Xhi * Ylo; end if; elsif Yhi /= 0 then T2 := Xlo * Yhi; else -- Yhi = Xhi = 0 T2 := 0; end if; -- Here we have T2 set to the contribution to the upper half of the -- result from the upper halves of the input values. T1 := Xlo * Ylo; T2 := T2 + Hi (T1); if Hi (T2) /= 0 then Raise_Error; end if; T2 := Lo (T2) & Lo (T1); if X >= 0 then if Y >= 0 then return To_Pos_Int (T2); else return To_Neg_Int (T2); end if; else -- X < 0 if Y < 0 then return To_Pos_Int (T2); else return To_Neg_Int (T2); end if; end if; end Multiply_With_Ovflo_Check; ----------------- -- Raise_Error -- ----------------- procedure Raise_Error is begin raise Constraint_Error with "64-bit arithmetic overflow"; end Raise_Error; ------------------- -- Scaled_Divide -- ------------------- procedure Scaled_Divide (X, Y, Z : Int64; Q, R : out Int64; Round : Boolean) is Xu : constant Uns64 := abs X; Xhi : constant Uns32 := Hi (Xu); Xlo : constant Uns32 := Lo (Xu); Yu : constant Uns64 := abs Y; Yhi : constant Uns32 := Hi (Yu); Ylo : constant Uns32 := Lo (Yu); Zu : Uns64 := abs Z; Zhi : Uns32 := Hi (Zu); Zlo : Uns32 := Lo (Zu); D : array (1 .. 4) of Uns32; -- The dividend, four digits (D(1) is high order) Qd : array (1 .. 2) of Uns32; -- The quotient digits, two digits (Qd(1) is high order) S1, S2, S3 : Uns32; -- Value to subtract, three digits (S1 is high order) Qu : Uns64; Ru : Uns64; -- Unsigned quotient and remainder Scale : Natural; -- Scaling factor used for multiple-precision divide. Dividend and -- Divisor are multiplied by 2 ** Scale, and the final remainder is -- divided by the scaling factor. The reason for this scaling is to -- allow more accurate estimation of quotient digits. T1, T2, T3 : Uns64; -- Temporary values begin -- First do the multiplication, giving the four digit dividend T1 := Xlo * Ylo; D (4) := Lo (T1); D (3) := Hi (T1); if Yhi /= 0 then T1 := Xlo * Yhi; T2 := D (3) + Lo (T1); D (3) := Lo (T2); D (2) := Hi (T1) + Hi (T2); if Xhi /= 0 then T1 := Xhi * Ylo; T2 := D (3) + Lo (T1); D (3) := Lo (T2); T3 := D (2) + Hi (T1); T3 := T3 + Hi (T2); D (2) := Lo (T3); D (1) := Hi (T3); T1 := (D (1) & D (2)) + Uns64'(Xhi * Yhi); D (1) := Hi (T1); D (2) := Lo (T1); else D (1) := 0; end if; else if Xhi /= 0 then T1 := Xhi * Ylo; T2 := D (3) + Lo (T1); D (3) := Lo (T2); D (2) := Hi (T1) + Hi (T2); else D (2) := 0; end if; D (1) := 0; end if; -- Now it is time for the dreaded multiple precision division. First an -- easy case, check for the simple case of a one digit divisor. if Zhi = 0 then if D (1) /= 0 or else D (2) >= Zlo then Raise_Error; -- Here we are dividing at most three digits by one digit else T1 := D (2) & D (3); T2 := Lo (T1 rem Zlo) & D (4); Qu := Lo (T1 / Zlo) & Lo (T2 / Zlo); Ru := T2 rem Zlo; end if; -- If divisor is double digit and dividend is too large, raise error elsif (D (1) & D (2)) >= Zu then Raise_Error; -- This is the complex case where we definitely have a double digit -- divisor and a dividend of at least three digits. We use the classical -- multiple-precision division algorithm (see section (4.3.1) of Knuth's -- "The Art of Computer Programming", Vol. 2 for a description -- (algorithm D). else -- First normalize the divisor so that it has the leading bit on. -- We do this by finding the appropriate left shift amount. Scale := 0; if (Zhi and 16#FFFF0000#) = 0 then Scale := 16; Zu := Shift_Left (Zu, 16); end if; if (Hi (Zu) and 16#FF00_0000#) = 0 then Scale := Scale + 8; Zu := Shift_Left (Zu, 8); end if; if (Hi (Zu) and 16#F000_0000#) = 0 then Scale := Scale + 4; Zu := Shift_Left (Zu, 4); end if; if (Hi (Zu) and 16#C000_0000#) = 0 then Scale := Scale + 2; Zu := Shift_Left (Zu, 2); end if; if (Hi (Zu) and 16#8000_0000#) = 0 then Scale := Scale + 1; Zu := Shift_Left (Zu, 1); end if; Zhi := Hi (Zu); Zlo := Lo (Zu); -- Note that when we scale up the dividend, it still fits in four -- digits, since we already tested for overflow, and scaling does -- not change the invariant that (D (1) & D (2)) < Zu. T1 := Shift_Left (D (1) & D (2), Scale); D (1) := Hi (T1); T2 := Shift_Left (0 & D (3), Scale); D (2) := Lo (T1) or Hi (T2); T3 := Shift_Left (0 & D (4), Scale); D (3) := Lo (T2) or Hi (T3); D (4) := Lo (T3); -- Loop to compute quotient digits, runs twice for Qd(1) and Qd(2) for J in 0 .. 1 loop -- Compute next quotient digit. We have to divide three digits by -- two digits. We estimate the quotient by dividing the leading -- two digits by the leading digit. Given the scaling we did above -- which ensured the first bit of the divisor is set, this gives -- an estimate of the quotient that is at most two too high. Qd (J + 1) := (if D (J + 1) = Zhi then 2 ** 32 - 1 else Lo ((D (J + 1) & D (J + 2)) / Zhi)); -- Compute amount to subtract T1 := Qd (J + 1) * Zlo; T2 := Qd (J + 1) * Zhi; S3 := Lo (T1); T1 := Hi (T1) + Lo (T2); S2 := Lo (T1); S1 := Hi (T1) + Hi (T2); -- Adjust quotient digit if it was too high -- We use the version of the algorithm in the 2nd Edition of -- "The Art of Computer Programming". This had a bug not -- discovered till 1995, see Vol 2 errata: -- http://www-cs-faculty.stanford.edu/~uno/err2-2e.ps.gz. -- Under rare circumstances the expression in the test could -- overflow. This version was further corrected in 2005, see -- Vol 2 errata: -- http://www-cs-faculty.stanford.edu/~uno/all2-pre.ps.gz. -- This implementation is not impacted by these bugs, due to the -- use of a word-size comparison done in function Le3 instead of -- a comparison on two-word integer quantities in the original -- algorithm. loop exit when Le3 (S1, S2, S3, D (J + 1), D (J + 2), D (J + 3)); Qd (J + 1) := Qd (J + 1) - 1; Sub3 (S1, S2, S3, 0, Zhi, Zlo); end loop; -- Now subtract S1&S2&S3 from D1&D2&D3 ready for next step Sub3 (D (J + 1), D (J + 2), D (J + 3), S1, S2, S3); end loop; -- The two quotient digits are now set, and the remainder of the -- scaled division is in D3&D4. To get the remainder for the -- original unscaled division, we rescale this dividend. -- We rescale the divisor as well, to make the proper comparison -- for rounding below. Qu := Qd (1) & Qd (2); Ru := Shift_Right (D (3) & D (4), Scale); Zu := Shift_Right (Zu, Scale); end if; -- Deal with rounding case if Round and then Ru > (Zu - Uns64'(1)) / Uns64'(2) then -- Protect against wrapping around when rounding, by signaling -- an overflow when the quotient is too large. if Qu = Uns64'Last then Raise_Error; end if; Qu := Qu + Uns64 (1); end if; -- Set final signs (RM 4.5.5(27-30)) -- Case of dividend (X * Y) sign positive if (X >= 0 and then Y >= 0) or else (X < 0 and then Y < 0) then R := To_Pos_Int (Ru); Q := (if Z > 0 then To_Pos_Int (Qu) else To_Neg_Int (Qu)); -- Case of dividend (X * Y) sign negative else R := To_Neg_Int (Ru); Q := (if Z > 0 then To_Neg_Int (Qu) else To_Pos_Int (Qu)); end if; end Scaled_Divide; ---------- -- Sub3 -- ---------- procedure Sub3 (X1, X2, X3 : in out Uns32; Y1, Y2, Y3 : Uns32) is begin if Y3 > X3 then if X2 = 0 then X1 := X1 - 1; end if; X2 := X2 - 1; end if; X3 := X3 - Y3; if Y2 > X2 then X1 := X1 - 1; end if; X2 := X2 - Y2; X1 := X1 - Y1; end Sub3; ------------------------------- -- Subtract_With_Ovflo_Check -- ------------------------------- function Subtract_With_Ovflo_Check (X, Y : Int64) return Int64 is R : constant Int64 := To_Int (To_Uns (X) - To_Uns (Y)); begin if X >= 0 then if Y > 0 or else R >= 0 then return R; end if; else -- X < 0 if Y <= 0 or else R < 0 then return R; end if; end if; Raise_Error; end Subtract_With_Ovflo_Check; ---------------- -- To_Neg_Int -- ---------------- function To_Neg_Int (A : Uns64) return Int64 is R : constant Int64 := (if A = 2**63 then Int64'First else -To_Int (A)); -- Note that we can't just use the expression of the Else, because it -- overflows for A = 2**63. begin if R <= 0 then return R; else Raise_Error; end if; end To_Neg_Int; ---------------- -- To_Pos_Int -- ---------------- function To_Pos_Int (A : Uns64) return Int64 is R : constant Int64 := To_Int (A); begin if R >= 0 then return R; else Raise_Error; end if; end To_Pos_Int; end System.Arith_64;
30.031866
79
0.482037
10583915dda95cb41f39eccc1ce82365f3fafb81
1,054
adb
Ada
out/record2.adb
Melyodas/metalang
399a9f1a71402c979d7f8024d4f98f081c80e771
[ "BSD-2-Clause" ]
22
2017-04-24T10:00:45.000Z
2021-04-01T10:11:05.000Z
out/record2.adb
Melyodas/metalang
399a9f1a71402c979d7f8024d4f98f081c80e771
[ "BSD-2-Clause" ]
12
2017-03-26T18:34:21.000Z
2019-03-21T19:13:03.000Z
out/record2.adb
Melyodas/metalang
399a9f1a71402c979d7f8024d4f98f081c80e771
[ "BSD-2-Clause" ]
7
2017-10-14T13:33:33.000Z
2021-03-18T15:18:50.000Z
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C; use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C; procedure record2 is type stringptr is access all char_array; procedure PInt(i : in Integer) is begin String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left)); end; procedure SkipSpaces is C : Character; Eol : Boolean; begin loop Look_Ahead(C, Eol); exit when Eol or C /= ' '; Get(C); end loop; end; type toto; type toto_PTR is access toto; type toto is record foo : Integer; bar : Integer; blah : Integer; end record; function mktoto(v1 : in Integer) return toto_PTR is t : toto_PTR; begin t := new toto; t.foo := v1; t.bar := 0; t.blah := 0; return t; end; function result(t : in toto_PTR) return Integer is begin t.blah := t.blah + 1; return t.foo + t.blah * t.bar + t.bar * t.foo; end; t : toto_PTR; begin t := mktoto(4); Get(t.bar); SkipSpaces; Get(t.blah); PInt(result(t)); end;
19.518519
97
0.676471
fb767c78d55c15e893fbfb90935ddfcad28610f4
3,811
ads
Ada
tools/scitools/sample/mahjongg/input_ln.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/sample/mahjongg/input_ln.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/sample/mahjongg/input_ln.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
-------------------------------------------------------------------- --| Package : Input_Line Version : -------------------------------------------------------------------- --| Abstract : This package handles everything concerning a user's input. --| The raw user input is converted into a command or a move. --| Command is one letter (from the list below). --| Move is four characters which specify two board positions, --| for example: B2E7 -------------------------------------------------------------------- --| Compiler/System : --| Author : John Dalbey Date : 1/93 --| References : -------------------------------------------------------------------- --| NOTES : --| : --| Version History : -------------------------------------------------------------------- PACKAGE Input_Line IS TYPE Command IS (load, save, hint, undo, help, quit); Legal_Commands : CONSTANT STRING(1..6) := "LSHU?Q"; Prompt : CONSTANT STRING(1..47) := "L)oad, S)ave, H)int, U)ndo, Q)uit, ?, or move: "; PROCEDURE Get; -- Purpose: A line of user's input (terminated by Enter) is read from keyboard. -- Assumes: At least one character must be typed. -- Exception: Constraint Error is raised if length > 80. FUNCTION IsCommand RETURN BOOLEAN; -- Purpose: Determine if the user's input was a legal command. -- Assumes: Get has been completed. -- Returns: TRUE if only a single character was entered and it's a legal command FUNCTION IsMove RETURN BOOLEAN; -- Purpose: Determine if the user's input was a move (2 board locations). -- E.g., D3H8 -- Assumes: Get has been completed. -- Returns: TRUE if user input is syntactically correct for a move. -- Returns FALSE if -- a) columns are not valid COL type -- b) rows are not valid ROW type -- c) length of user input /= 4 FUNCTION Get_Command RETURN Command; -- Purpose: Converts the user input into a value of command type. -- Assumes: Get has been completed, and Is_Command is TRUE. -- Returns: the command type value corresponding to user's input. FUNCTION Validate_Move RETURN BOOLEAN; -- Purpose: Determine if the users_input is really a valid move. I.e., the -- tiles are matching and removable. -- Assumes: Get has been completed, and Is_Move is true. -- Return: TRUE if it is a valid move. -- Otherwise, display appropriate error msg and return FALSE. -- Note: Valid move means -- 1) both locations really contain a tile -- 2) both tiles can match and can be removed -- 3) the tiles are in two different locations (they aren't -- the same tile). PROCEDURE Make_Move; -- Purpose: Process the player's move, remove the tiles from the board. -- Take the two matching tiles off the board and update the screen -- Assumes: Validate_Move is TRUE. -- Returns: nothing. The Board and screen are updated. -- PSEUDOCODE: -- Reset hints. -- Remove the matching tiles from the board. -- display the updated board. -- Decrement tiles remaining. -- add tiles to move history. -- If no tiles left, display win message. PROCEDURE Undo_Move; -- Purpose: Undo the previous move -- Assumes: nothing. -- Returns: nothing. The most recent move is "undone" and the board -- and screen restored to their previous state. -- Note: Undo can be invoked multiple times, backing up until the -- board is in it's original state. END Input_Line;
44.835294
81
0.554972
120e51a357e53c34ecbf48034330ed6e1686ca0c
2,537
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c38108b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c38108b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c38108b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C38108B.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 AN INCOMPLETE TYPE CAN BE DECLARED IN THE PRIVATE PART OF -- A LIBRARY PACKAGE, WITH THE FULL DECLARATION OCCURRING LATER IN A -- PACKAGE BODY. -- AH 8/20/86 PACKAGE C38108B_P IS TYPE L IS LIMITED PRIVATE; PROCEDURE ASSIGN (X : IN INTEGER; Y : IN OUT L); FUNCTION "=" (X, Y : IN L) RETURN BOOLEAN; PRIVATE TYPE INC (D : INTEGER); TYPE L IS ACCESS INC; END C38108B_P; PACKAGE BODY C38108B_P IS TYPE INC (D : INTEGER) IS RECORD C : INTEGER; END RECORD; PROCEDURE ASSIGN (X : IN INTEGER; Y : IN OUT L) IS BEGIN Y := NEW INC(1); Y.C := X; END ASSIGN; FUNCTION "=" (X, Y : IN L) RETURN BOOLEAN IS BEGIN RETURN (X.C = Y.C); END "="; END C38108B_P; WITH REPORT; USE REPORT; WITH C38108B_P; USE C38108B_P; PROCEDURE C38108B IS VAL_1, VAL_2 : L; BEGIN TEST ("C38108B", "CHECK THAT INCOMPLETE TYPE CAN BE DECLARED IN " & "PRIVATE PART WITHOUT FULL DECLARATION - " & "LIBRARY PACKAGE"); ASSIGN (2, VAL_1); ASSIGN (2, VAL_2); IF NOT "=" (VAL_1, VAL_2) THEN FAILED ("INCOMPLETE TYPE NOT FULLY DECLARED"); END IF; RESULT; END C38108B;
32.948052
79
0.623177
4d0715150522ef67db61a401772d0b37a2bfde18
5,589
adb
Ada
src/regex-utilities-sorted_sets.adb
skordal/ada-regex
cda71d076184f9dc607c132343b60678b8dc2ec8
[ "MIT" ]
2
2020-04-15T06:02:06.000Z
2021-05-12T23:09:18.000Z
src/regex-utilities-sorted_sets.adb
skordal/ada-regex
cda71d076184f9dc607c132343b60678b8dc2ec8
[ "MIT" ]
null
null
null
src/regex-utilities-sorted_sets.adb
skordal/ada-regex
cda71d076184f9dc607c132343b60678b8dc2ec8
[ "MIT" ]
null
null
null
-- Ada regular expression library -- (c) Kristian Klomsten Skordal 2020 <[email protected]> -- Report bugs and issues on <https://github.com/skordal/ada-regex> with Ada.Containers.Generic_Array_Sort; package body Regex.Utilities.Sorted_Sets is function To_Set (Item : in Element_Type) return Sorted_Set is Retval : Sorted_Set := Empty_Set; begin Retval.Add (Item); return Retval; end To_Set; function Create_Set (Capacity : in Natural) return Sorted_Set is begin return Retval : Sorted_Set do Retval.Capacity := Capacity; Retval.Item_Count := 0; Retval.Items := new Item_Array (1 .. Capacity); end return; end Create_Set; function Length (This : in Sorted_Set) return Natural is begin return This.Item_Count; end Length; procedure Add (This : in out Sorted_Set; Item : in Element_Type) is procedure Sort_Array is new Ada.Containers.Generic_Array_Sort ( Index_Type => Positive, Element_Type => Element_Type, Array_Type => Item_Array); begin -- Check if the element exists in the set: if This.Element_Exists (Item) then return; end if; if This.Item_Count = 0 or else This.Item_Count >= This.Capacity then This.Enlarge_Item_Array; end if; This.Item_Count := This.Item_Count + 1; This.Items (This.Item_Count) := Item; Sort_Array (This.Items (1 .. This.Item_Count)); end Add; procedure Add (This : in out Sorted_Set; Items : in Sorted_Set) is begin for Item of Items loop This.Add (Item); end loop; end Add; function Element_Exists (This : in Sorted_Set; Item : in Element_Type) return Boolean is begin for I of This loop if I = Item then return True; end if; end loop; return False; end Element_Exists; function "&" (Left : in Sorted_Set; Right : in Element_Type) return Sorted_Set is Retval : Sorted_Set := Left; begin Retval.Add (Right); return Retval; end "&"; function "&" (Left, Right : in Sorted_Set) return Sorted_Set is Result_Set : Sorted_Set := Create_Set (Natural'Max (Left.Capacity, Right.Capacity)); begin for I of Left loop Result_Set.Add (I); end loop; for I of Right loop Result_Set.Add (I); end loop; return Result_Set; end "&"; function "=" (Left, Right : in Sorted_Set) return Boolean is begin if Left.Length /= Right.Length then return False; end if; for I in 1 .. Left.Item_Count loop if Left.Items (I) /= Right.Items (I) then return False; end if; end loop; return True; end "="; function Has_Element (Position : in Cursor) return Boolean is begin return Position.Index > 0 and Position.Index <= Position.End_Index; end Has_Element; function Iterate (This : in Sorted_Set) return Set_Iterators.Forward_Iterator'Class is begin return Retval : Set_Iterator do Retval.Items := This.Items; Retval.Item_Count := This.Item_Count; end return; end Iterate; function Element_Value (This : in Sorted_Set; Position : in Cursor) return Element_Type is begin return This.Items (Position.Index); end Element_Value; function Constant_Reference (This : in Sorted_Set; Position : in Cursor) return Constant_Reference_Type is Retval : Constant_Reference_Type (Item => This.Items (Position.Index)'Access); begin return Retval; end Constant_Reference; procedure Adjust (This : in out Sorted_Set) is New_Array : Item_Array_Access; begin if This.Items /= null then New_Array := new Item_Array (This.Items'Range); for I in This.Items'Range loop New_Array (I) := This.Items (I); end loop; This.Items := New_Array; end if; end Adjust; procedure Finalize (This : in out Sorted_Set) is begin if This.Items /= null then Free_Item_Array (This.Items); end if; end Finalize; procedure Enlarge_Item_Array (This : in out Sorted_Set) is New_Capacity : Natural; New_Array : Item_Array_Access; begin if This.Capacity = 0 then This.Items := new Item_Array (1 .. Default_Capacity); This.Capacity := Default_Capacity; else -- Enlarge the item array by ~10 %, minimum Default_Capacity elements: New_Capacity := Natural (Float (This.Capacity) * 1.1); if New_Capacity < This.Capacity + Default_Capacity then New_Capacity := This.Capacity + Default_Capacity; end if; New_Array := new Item_Array (1 .. New_Capacity); for I in This.Items'Range loop New_Array (I) := This.Items (I); end loop; Free_Item_Array (This.Items); This.Capacity := New_Capacity; This.Items := New_Array; end if; end Enlarge_Item_Array; function First (This : in Set_Iterator) return Cursor is begin return Retval : Cursor do Retval.Items := This.Items; Retval.Index := 1; Retval.End_Index := This.Item_Count; end return; end First; function Next (This : in Set_Iterator; Position : in Cursor) return Cursor is Retval : Cursor := Position; begin Retval.Items := This.Items; Retval.Index := Retval.Index + 1; Retval.End_Index := This.Item_Count; return Retval; end Next; end Regex.Utilities.Sorted_Sets;
29.109375
109
0.636429
12aaba760f10053ebef3849495276761d05f17f3
3,635
ads
Ada
gcc-gcc-7_3_0-release/gcc/ada/g-tty.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/g-tty.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/g-tty.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . T T Y -- -- -- -- S p e c -- -- -- -- Copyright (C) 2002-2011, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides control over pseudo terminals (ttys) -- This package is only supported on unix systems. See function TTY_Supported -- to test dynamically whether other functions of this package can be called. with System; with GNAT.OS_Lib; package GNAT.TTY is type TTY_Handle is private; -- Handle for a tty descriptor function TTY_Supported return Boolean; -- If True, the other functions of this package can be called. Otherwise, -- all functions in this package will raise Program_Error if called. procedure Allocate_TTY (Handle : out TTY_Handle); -- Allocate a new tty procedure Reset_TTY (Handle : TTY_Handle); -- Reset settings of a given tty procedure Close_TTY (Handle : in out TTY_Handle); -- Close a given tty function TTY_Name (Handle : TTY_Handle) return String; -- Return the external name of a tty. The name depends on the tty handling -- on the given target. It will typically look like: "/dev/ptya1" function TTY_Descriptor (Handle : TTY_Handle) return GNAT.OS_Lib.File_Descriptor; -- Return the low level descriptor associated with Handle private type TTY_Handle is record Handle : System.Address := System.Null_Address; end record; end GNAT.TTY;
49.121622
78
0.484182
12b566c954a3877df1d94d4cee6758346ba5d659
1,938
ads
Ada
boards/stm32f429_discovery/src/sfp/adl_config.ads
mbdme26/Ada_Drivers_Library
dc9cc80f5338c9d1ae942dd461eef6a2402e44de
[ "BSD-3-Clause" ]
192
2016-06-01T18:32:04.000Z
2022-03-26T22:52:31.000Z
boards/stm32f429_discovery/src/sfp/adl_config.ads
mbdme26/Ada_Drivers_Library
dc9cc80f5338c9d1ae942dd461eef6a2402e44de
[ "BSD-3-Clause" ]
239
2016-05-26T20:02:01.000Z
2022-03-31T09:46:56.000Z
boards/stm32f429_discovery/src/sfp/adl_config.ads
mbdme26/Ada_Drivers_Library
dc9cc80f5338c9d1ae942dd461eef6a2402e44de
[ "BSD-3-Clause" ]
142
2016-06-05T08:12:20.000Z
2022-03-24T17:37:17.000Z
-- This package was generated by the Ada_Drivers_Library project wizard script package ADL_Config is Architecture : constant String := "ARM"; -- From board definition Board : constant String := "STM32F429_Discovery"; -- From command line CPU_Core : constant String := "ARM Cortex-M4F"; -- From mcu definition Device_Family : constant String := "STM32F4"; -- From board definition Device_Name : constant String := "STM32F429ZITx"; -- From board definition Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition Has_ZFP_Runtime : constant String := "False"; -- From board definition High_Speed_External_Clock : constant := 8000000; -- From board definition Max_Mount_Name_Length : constant := 128; -- From default value Max_Mount_Points : constant := 2; -- From default value Max_Path_Length : constant := 1024; -- From default value Number_Of_Interrupts : constant := 0; -- From default value Runtime_Name : constant String := "ravenscar-sfp-stm32f429disco"; -- From default value Runtime_Name_Suffix : constant String := "stm32f429disco"; -- From board definition Runtime_Profile : constant String := "ravenscar-sfp"; -- From command line Use_Startup_Gen : constant Boolean := False; -- From command line Vendor : constant String := "STMicro"; -- From board definition end ADL_Config;
88.090909
109
0.546956
062623676bcfb24c35ee974d7ddc05aa4208378b
3,193
ads
Ada
software/libsparklemma/src/spark-constrained_array_lemmas.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
12
2017-06-08T14:19:57.000Z
2022-03-09T02:48:59.000Z
software/libsparklemma/src/spark-constrained_array_lemmas.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
6
2017-06-08T13:13:50.000Z
2020-05-15T09:32:43.000Z
software/libsparklemma/src/spark-constrained_array_lemmas.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
3
2017-06-30T14:05:06.000Z
2022-02-17T12:20:45.000Z
------------------------------------------------------------------------------ -- -- -- SPARK LIBRARY COMPONENTS -- -- -- -- S P A R K . C O N S T R A I N E D _ A R R A Y _ L E M M A S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2016, AdaCore -- -- -- -- SPARK 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. SPARK 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/>. -- -- -- ------------------------------------------------------------------------------ generic type Index_Type is range <>; type Element_T is private; type A is array (Index_Type) of Element_T; -- Function Less should be transitive like the predefined "<" or "<=", -- where transitivity is the property that, for all X, Y, Z of type -- Element_T: -- (if Less(X,Y) and Less(Y,Z) then Less(X,Z)) -- If this property is not ensured, the lemmas are likely to introduce -- inconsistencies. with function Less (X, Y : Element_T) return Boolean; package SPARK.Constrained_Array_Lemmas with SPARK_Mode, Pure, Ghost is pragma Warnings (Off, "postcondition does not check the outcome of calling"); procedure Lemma_Transitive_Order (Arr : A) with Global => null, Pre => (for all I in Arr'Range => (if I /= Arr'First then Less (Arr (Index_Type'Pred (I)), Arr (I)))), Post => (for all I in Arr'Range => (for all J in Arr'Range => (if I < J then Less (Arr (I), Arr (J))))); end SPARK.Constrained_Array_Lemmas;
53.216667
78
0.43658
50e568211bacc7b8b052feb9c4e3d25839d5a0ac
5,702
adb
Ada
llvm-gcc-4.2-2.9/gcc/ada/s-sequio.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
llvm-gcc-4.2-2.9/gcc/ada/s-sequio.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/s-sequio.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . S E Q U E N T I A L _ I O -- -- -- -- B o d y -- -- -- -- 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. -- -- -- -- 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 System.File_IO; with Unchecked_Deallocation; package body System.Sequential_IO is subtype AP is FCB.AFCB_Ptr; package FIO renames System.File_IO; ------------------- -- AFCB_Allocate -- ------------------- function AFCB_Allocate (Control_Block : Sequential_AFCB) return FCB.AFCB_Ptr is pragma Warnings (Off, Control_Block); begin return new Sequential_AFCB; end AFCB_Allocate; ---------------- -- AFCB_Close -- ---------------- -- No special processing required for Sequential_IO close procedure AFCB_Close (File : access Sequential_AFCB) is pragma Warnings (Off, File); begin null; end AFCB_Close; --------------- -- AFCB_Free -- --------------- procedure AFCB_Free (File : access Sequential_AFCB) is type FCB_Ptr is access all Sequential_AFCB; FT : FCB_Ptr := FCB_Ptr (File); procedure Free is new Unchecked_Deallocation (Sequential_AFCB, FCB_Ptr); begin Free (FT); end AFCB_Free; ------------ -- Create -- ------------ procedure Create (File : in out File_Type; Mode : FCB.File_Mode := FCB.Out_File; Name : String := ""; Form : String := "") is Dummy_File_Control_Block : Sequential_AFCB; pragma Warnings (Off, Dummy_File_Control_Block); -- Yes, we know this is never assigned a value, only the tag -- is used for dispatching purposes, so that's expected. begin FIO.Open (File_Ptr => AP (File), Dummy_FCB => Dummy_File_Control_Block, Mode => Mode, Name => Name, Form => Form, Amethod => 'Q', Creat => True, Text => False); end Create; ---------- -- Open -- ---------- procedure Open (File : in out File_Type; Mode : FCB.File_Mode; Name : String; Form : String := "") is Dummy_File_Control_Block : Sequential_AFCB; pragma Warnings (Off, Dummy_File_Control_Block); -- Yes, we know this is never assigned a value, only the tag -- is used for dispatching purposes, so that's expected. begin FIO.Open (File_Ptr => AP (File), Dummy_FCB => Dummy_File_Control_Block, Mode => Mode, Name => Name, Form => Form, Amethod => 'Q', Creat => False, Text => False); end Open; ---------- -- Read -- ---------- -- Not used, since Sequential_IO files are not used as streams procedure Read (File : in out Sequential_AFCB; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) is begin raise Program_Error; end Read; ----------- -- Write -- ----------- -- Not used, since Sequential_IO files are not used as streams procedure Write (File : in out Sequential_AFCB; Item : Ada.Streams.Stream_Element_Array) is begin raise Program_Error; end Write; end System.Sequential_IO;
33.940476
78
0.48597
06f9d3691074ed00b36d00e29dadb750b1995fdd
30,094
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/a-stwiun.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/a-stwiun.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/a-stwiun.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R I N G S . W I D E _ U N B O U N D E D -- -- -- -- B o d y -- -- -- -- 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. -- -- -- -- 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.Strings.Wide_Fixed; with Ada.Strings.Wide_Search; with Ada.Unchecked_Deallocation; package body Ada.Strings.Wide_Unbounded is use Ada.Finalization; --------- -- "&" -- --------- function "&" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Unbounded_Wide_String is L_Length : constant Natural := Left.Last; R_Length : constant Natural := Right.Last; Result : Unbounded_Wide_String; begin Result.Last := L_Length + R_Length; Result.Reference := new Wide_String (1 .. Result.Last); Result.Reference (1 .. L_Length) := Left.Reference (1 .. Left.Last); Result.Reference (L_Length + 1 .. Result.Last) := Right.Reference (1 .. Right.Last); return Result; end "&"; function "&" (Left : Unbounded_Wide_String; Right : Wide_String) return Unbounded_Wide_String is L_Length : constant Natural := Left.Last; Result : Unbounded_Wide_String; begin Result.Last := L_Length + Right'Length; Result.Reference := new Wide_String (1 .. Result.Last); Result.Reference (1 .. L_Length) := Left.Reference (1 .. Left.Last); Result.Reference (L_Length + 1 .. Result.Last) := Right; return Result; end "&"; function "&" (Left : Wide_String; Right : Unbounded_Wide_String) return Unbounded_Wide_String is R_Length : constant Natural := Right.Last; Result : Unbounded_Wide_String; begin Result.Last := Left'Length + R_Length; Result.Reference := new Wide_String (1 .. Result.Last); Result.Reference (1 .. Left'Length) := Left; Result.Reference (Left'Length + 1 .. Result.Last) := Right.Reference (1 .. Right.Last); return Result; end "&"; function "&" (Left : Unbounded_Wide_String; Right : Wide_Character) return Unbounded_Wide_String is Result : Unbounded_Wide_String; begin Result.Last := Left.Last + 1; Result.Reference := new Wide_String (1 .. Result.Last); Result.Reference (1 .. Result.Last - 1) := Left.Reference (1 .. Left.Last); Result.Reference (Result.Last) := Right; return Result; end "&"; function "&" (Left : Wide_Character; Right : Unbounded_Wide_String) return Unbounded_Wide_String is Result : Unbounded_Wide_String; begin Result.Last := Right.Last + 1; Result.Reference := new Wide_String (1 .. Result.Last); Result.Reference (1) := Left; Result.Reference (2 .. Result.Last) := Right.Reference (1 .. Right.Last); return Result; end "&"; --------- -- "*" -- --------- function "*" (Left : Natural; Right : Wide_Character) return Unbounded_Wide_String is Result : Unbounded_Wide_String; begin Result.Last := Left; Result.Reference := new Wide_String (1 .. Left); for J in Result.Reference'Range loop Result.Reference (J) := Right; end loop; return Result; end "*"; function "*" (Left : Natural; Right : Wide_String) return Unbounded_Wide_String is Len : constant Natural := Right'Length; K : Positive; Result : Unbounded_Wide_String; begin Result.Last := Left * Len; Result.Reference := new Wide_String (1 .. Result.Last); K := 1; for J in 1 .. Left loop Result.Reference (K .. K + Len - 1) := Right; K := K + Len; end loop; return Result; end "*"; function "*" (Left : Natural; Right : Unbounded_Wide_String) return Unbounded_Wide_String is Len : constant Natural := Right.Last; K : Positive; Result : Unbounded_Wide_String; begin Result.Last := Left * Len; Result.Reference := new Wide_String (1 .. Result.Last); K := 1; for J in 1 .. Left loop Result.Reference (K .. K + Len - 1) := Right.Reference (1 .. Right.Last); K := K + Len; end loop; return Result; end "*"; --------- -- "<" -- --------- function "<" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) < Right.Reference (1 .. Right.Last); end "<"; function "<" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) < Right; end "<"; function "<" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left < Right.Reference (1 .. Right.Last); end "<"; ---------- -- "<=" -- ---------- function "<=" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) <= Right.Reference (1 .. Right.Last); end "<="; function "<=" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) <= Right; end "<="; function "<=" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left <= Right.Reference (1 .. Right.Last); end "<="; --------- -- "=" -- --------- function "=" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) = Right.Reference (1 .. Right.Last); end "="; function "=" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) = Right; end "="; function "=" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left = Right.Reference (1 .. Right.Last); end "="; --------- -- ">" -- --------- function ">" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) > Right.Reference (1 .. Right.Last); end ">"; function ">" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) > Right; end ">"; function ">" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left > Right.Reference (1 .. Right.Last); end ">"; ---------- -- ">=" -- ---------- function ">=" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) >= Right.Reference (1 .. Right.Last); end ">="; function ">=" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean is begin return Left.Reference (1 .. Left.Last) >= Right; end ">="; function ">=" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean is begin return Left >= Right.Reference (1 .. Right.Last); end ">="; ------------ -- Adjust -- ------------ procedure Adjust (Object : in out Unbounded_Wide_String) is begin -- Copy string, except we do not copy the statically allocated null -- string, since it can never be deallocated. Note that we do not copy -- extra string room here to avoid dragging unused allocated memory. if Object.Reference /= Null_Wide_String'Access then Object.Reference := new Wide_String'(Object.Reference (1 .. Object.Last)); end if; end Adjust; ------------ -- Append -- ------------ procedure Append (Source : in out Unbounded_Wide_String; New_Item : Unbounded_Wide_String) is begin Realloc_For_Chunk (Source, New_Item.Last); Source.Reference (Source.Last + 1 .. Source.Last + New_Item.Last) := New_Item.Reference (1 .. New_Item.Last); Source.Last := Source.Last + New_Item.Last; end Append; procedure Append (Source : in out Unbounded_Wide_String; New_Item : Wide_String) is begin Realloc_For_Chunk (Source, New_Item'Length); Source.Reference (Source.Last + 1 .. Source.Last + New_Item'Length) := New_Item; Source.Last := Source.Last + New_Item'Length; end Append; procedure Append (Source : in out Unbounded_Wide_String; New_Item : Wide_Character) is begin Realloc_For_Chunk (Source, 1); Source.Reference (Source.Last + 1) := New_Item; Source.Last := Source.Last + 1; end Append; ----------- -- Count -- ----------- function Count (Source : Unbounded_Wide_String; Pattern : Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural is begin return Wide_Search.Count (Source.Reference (1 .. Source.Last), Pattern, Mapping); end Count; function Count (Source : Unbounded_Wide_String; Pattern : Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural is begin return Wide_Search.Count (Source.Reference (1 .. Source.Last), Pattern, Mapping); end Count; function Count (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set) return Natural is begin return Wide_Search.Count (Source.Reference (1 .. Source.Last), Set); end Count; ------------ -- Delete -- ------------ function Delete (Source : Unbounded_Wide_String; From : Positive; Through : Natural) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Delete (Source.Reference (1 .. Source.Last), From, Through)); end Delete; procedure Delete (Source : in out Unbounded_Wide_String; From : Positive; Through : Natural) is begin if From > Through then null; elsif From < Source.Reference'First or else Through > Source.Last then raise Index_Error; else declare Len : constant Natural := Through - From + 1; begin Source.Reference (From .. Source.Last - Len) := Source.Reference (Through + 1 .. Source.Last); Source.Last := Source.Last - Len; end; end if; end Delete; ------------- -- Element -- ------------- function Element (Source : Unbounded_Wide_String; Index : Positive) return Wide_Character is begin if Index <= Source.Last then return Source.Reference (Index); else raise Strings.Index_Error; end if; end Element; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Unbounded_Wide_String) is procedure Deallocate is new Ada.Unchecked_Deallocation (Wide_String, Wide_String_Access); begin -- Note: Don't try to free statically allocated null string if Object.Reference /= Null_Wide_String'Access then Deallocate (Object.Reference); Object.Reference := Null_Unbounded_Wide_String.Reference; Object.Last := 0; end if; end Finalize; ---------------- -- Find_Token -- ---------------- procedure Find_Token (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set; From : Positive; Test : Strings.Membership; First : out Positive; Last : out Natural) is begin Wide_Search.Find_Token (Source.Reference (From .. Source.Last), Set, Test, First, Last); end Find_Token; procedure Find_Token (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set; Test : Strings.Membership; First : out Positive; Last : out Natural) is begin Wide_Search.Find_Token (Source.Reference (1 .. Source.Last), Set, Test, First, Last); end Find_Token; ---------- -- Free -- ---------- procedure Free (X : in out Wide_String_Access) is procedure Deallocate is new Ada.Unchecked_Deallocation (Wide_String, Wide_String_Access); begin -- Note: Do not try to free statically allocated null string if X /= Null_Unbounded_Wide_String.Reference then Deallocate (X); end if; end Free; ---------- -- Head -- ---------- function Head (Source : Unbounded_Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Head (Source.Reference (1 .. Source.Last), Count, Pad)); end Head; procedure Head (Source : in out Unbounded_Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space) is Old : Wide_String_Access := Source.Reference; begin Source.Reference := new Wide_String' (Wide_Fixed.Head (Source.Reference (1 .. Source.Last), Count, Pad)); Source.Last := Source.Reference'Length; Free (Old); end Head; ----------- -- Index -- ----------- function Index (Source : Unbounded_Wide_String; Pattern : Wide_String; Going : Strings.Direction := Strings.Forward; Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural is begin return Wide_Search.Index (Source.Reference (1 .. Source.Last), Pattern, Going, Mapping); end Index; function Index (Source : Unbounded_Wide_String; Pattern : Wide_String; Going : Direction := Forward; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural is begin return Wide_Search.Index (Source.Reference (1 .. Source.Last), Pattern, Going, Mapping); end Index; function Index (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set; Test : Strings.Membership := Strings.Inside; Going : Strings.Direction := Strings.Forward) return Natural is begin return Wide_Search.Index (Source.Reference (1 .. Source.Last), Set, Test, Going); end Index; function Index (Source : Unbounded_Wide_String; Pattern : Wide_String; From : Positive; Going : Direction := Forward; Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural is begin return Wide_Search.Index (Source.Reference (1 .. Source.Last), Pattern, From, Going, Mapping); end Index; function Index (Source : Unbounded_Wide_String; Pattern : Wide_String; From : Positive; Going : Direction := Forward; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural is begin return Wide_Search.Index (Source.Reference (1 .. Source.Last), Pattern, From, Going, Mapping); end Index; function Index (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set; From : Positive; Test : Membership := Inside; Going : Direction := Forward) return Natural is begin return Wide_Search.Index (Source.Reference (1 .. Source.Last), Set, From, Test, Going); end Index; function Index_Non_Blank (Source : Unbounded_Wide_String; Going : Strings.Direction := Strings.Forward) return Natural is begin return Wide_Search.Index_Non_Blank (Source.Reference (1 .. Source.Last), Going); end Index_Non_Blank; function Index_Non_Blank (Source : Unbounded_Wide_String; From : Positive; Going : Direction := Forward) return Natural is begin return Wide_Search.Index_Non_Blank (Source.Reference (1 .. Source.Last), From, Going); end Index_Non_Blank; ---------------- -- Initialize -- ---------------- procedure Initialize (Object : in out Unbounded_Wide_String) is begin Object.Reference := Null_Unbounded_Wide_String.Reference; Object.Last := 0; end Initialize; ------------ -- Insert -- ------------ function Insert (Source : Unbounded_Wide_String; Before : Positive; New_Item : Wide_String) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Insert (Source.Reference (1 .. Source.Last), Before, New_Item)); end Insert; procedure Insert (Source : in out Unbounded_Wide_String; Before : Positive; New_Item : Wide_String) is begin if Before not in Source.Reference'First .. Source.Last + 1 then raise Index_Error; end if; Realloc_For_Chunk (Source, New_Item'Length); Source.Reference (Before + New_Item'Length .. Source.Last + New_Item'Length) := Source.Reference (Before .. Source.Last); Source.Reference (Before .. Before + New_Item'Length - 1) := New_Item; Source.Last := Source.Last + New_Item'Length; end Insert; ------------ -- Length -- ------------ function Length (Source : Unbounded_Wide_String) return Natural is begin return Source.Last; end Length; --------------- -- Overwrite -- --------------- function Overwrite (Source : Unbounded_Wide_String; Position : Positive; New_Item : Wide_String) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Overwrite (Source.Reference (1 .. Source.Last), Position, New_Item)); end Overwrite; procedure Overwrite (Source : in out Unbounded_Wide_String; Position : Positive; New_Item : Wide_String) is NL : constant Natural := New_Item'Length; begin if Position <= Source.Last - NL + 1 then Source.Reference (Position .. Position + NL - 1) := New_Item; else declare Old : Wide_String_Access := Source.Reference; begin Source.Reference := new Wide_String' (Wide_Fixed.Overwrite (Source.Reference (1 .. Source.Last), Position, New_Item)); Source.Last := Source.Reference'Length; Free (Old); end; end if; end Overwrite; ----------------------- -- Realloc_For_Chunk -- ----------------------- procedure Realloc_For_Chunk (Source : in out Unbounded_Wide_String; Chunk_Size : Natural) is Growth_Factor : constant := 32; -- The growth factor controls how much extra space is allocated when -- we have to increase the size of an allocated unbounded string. By -- allocating extra space, we avoid the need to reallocate on every -- append, particularly important when a string is built up by repeated -- append operations of small pieces. This is expressed as a factor so -- 32 means add 1/32 of the length of the string as growth space. Min_Mul_Alloc : constant := Standard'Maximum_Alignment; -- Allocation will be done by a multiple of Min_Mul_Alloc This causes -- no memory loss as most (all?) malloc implementations are obliged to -- align the returned memory on the maximum alignment as malloc does not -- know the target alignment. S_Length : constant Natural := Source.Reference'Length; begin if Chunk_Size > S_Length - Source.Last then declare New_Size : constant Positive := S_Length + Chunk_Size + (S_Length / Growth_Factor); New_Rounded_Up_Size : constant Positive := ((New_Size - 1) / Min_Mul_Alloc + 1) * Min_Mul_Alloc; Tmp : constant Wide_String_Access := new Wide_String (1 .. New_Rounded_Up_Size); begin Tmp (1 .. Source.Last) := Source.Reference (1 .. Source.Last); Free (Source.Reference); Source.Reference := Tmp; end; end if; end Realloc_For_Chunk; --------------------- -- Replace_Element -- --------------------- procedure Replace_Element (Source : in out Unbounded_Wide_String; Index : Positive; By : Wide_Character) is begin if Index <= Source.Last then Source.Reference (Index) := By; else raise Strings.Index_Error; end if; end Replace_Element; ------------------- -- Replace_Slice -- ------------------- function Replace_Slice (Source : Unbounded_Wide_String; Low : Positive; High : Natural; By : Wide_String) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Replace_Slice (Source.Reference (1 .. Source.Last), Low, High, By)); end Replace_Slice; procedure Replace_Slice (Source : in out Unbounded_Wide_String; Low : Positive; High : Natural; By : Wide_String) is Old : Wide_String_Access := Source.Reference; begin Source.Reference := new Wide_String' (Wide_Fixed.Replace_Slice (Source.Reference (1 .. Source.Last), Low, High, By)); Source.Last := Source.Reference'Length; Free (Old); end Replace_Slice; ------------------------------- -- Set_Unbounded_Wide_String -- ------------------------------- procedure Set_Unbounded_Wide_String (Target : out Unbounded_Wide_String; Source : Wide_String) is begin Target.Last := Source'Length; Target.Reference := new Wide_String (1 .. Source'Length); Target.Reference.all := Source; end Set_Unbounded_Wide_String; ----------- -- Slice -- ----------- function Slice (Source : Unbounded_Wide_String; Low : Positive; High : Natural) return Wide_String is begin -- Note: test of High > Length is in accordance with AI95-00128 if Low > Source.Last + 1 or else High > Source.Last then raise Index_Error; else return Source.Reference (Low .. High); end if; end Slice; ---------- -- Tail -- ---------- function Tail (Source : Unbounded_Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Tail (Source.Reference (1 .. Source.Last), Count, Pad)); end Tail; procedure Tail (Source : in out Unbounded_Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space) is Old : Wide_String_Access := Source.Reference; begin Source.Reference := new Wide_String' (Wide_Fixed.Tail (Source.Reference (1 .. Source.Last), Count, Pad)); Source.Last := Source.Reference'Length; Free (Old); end Tail; ------------------------------ -- To_Unbounded_Wide_String -- ------------------------------ function To_Unbounded_Wide_String (Source : Wide_String) return Unbounded_Wide_String is Result : Unbounded_Wide_String; begin Result.Last := Source'Length; Result.Reference := new Wide_String (1 .. Source'Length); Result.Reference.all := Source; return Result; end To_Unbounded_Wide_String; function To_Unbounded_Wide_String (Length : Natural) return Unbounded_Wide_String is Result : Unbounded_Wide_String; begin Result.Last := Length; Result.Reference := new Wide_String (1 .. Length); return Result; end To_Unbounded_Wide_String; ------------------- -- To_Wide_String -- -------------------- function To_Wide_String (Source : Unbounded_Wide_String) return Wide_String is begin return Source.Reference (1 .. Source.Last); end To_Wide_String; --------------- -- Translate -- --------------- function Translate (Source : Unbounded_Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Translate (Source.Reference (1 .. Source.Last), Mapping)); end Translate; procedure Translate (Source : in out Unbounded_Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping) is begin Wide_Fixed.Translate (Source.Reference (1 .. Source.Last), Mapping); end Translate; function Translate (Source : Unbounded_Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Translate (Source.Reference (1 .. Source.Last), Mapping)); end Translate; procedure Translate (Source : in out Unbounded_Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function) is begin Wide_Fixed.Translate (Source.Reference (1 .. Source.Last), Mapping); end Translate; ---------- -- Trim -- ---------- function Trim (Source : Unbounded_Wide_String; Side : Trim_End) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Trim (Source.Reference (1 .. Source.Last), Side)); end Trim; procedure Trim (Source : in out Unbounded_Wide_String; Side : Trim_End) is Old : Wide_String_Access := Source.Reference; begin Source.Reference := new Wide_String' (Wide_Fixed.Trim (Source.Reference (1 .. Source.Last), Side)); Source.Last := Source.Reference'Length; Free (Old); end Trim; function Trim (Source : Unbounded_Wide_String; Left : Wide_Maps.Wide_Character_Set; Right : Wide_Maps.Wide_Character_Set) return Unbounded_Wide_String is begin return To_Unbounded_Wide_String (Wide_Fixed.Trim (Source.Reference (1 .. Source.Last), Left, Right)); end Trim; procedure Trim (Source : in out Unbounded_Wide_String; Left : Wide_Maps.Wide_Character_Set; Right : Wide_Maps.Wide_Character_Set) is Old : Wide_String_Access := Source.Reference; begin Source.Reference := new Wide_String' (Wide_Fixed.Trim (Source.Reference (1 .. Source.Last), Left, Right)); Source.Last := Source.Reference'Length; Free (Old); end Trim; --------------------- -- Unbounded_Slice -- --------------------- function Unbounded_Slice (Source : Unbounded_Wide_String; Low : Positive; High : Natural) return Unbounded_Wide_String is begin if Low > Source.Last + 1 or else High > Source.Last then raise Index_Error; else return To_Unbounded_Wide_String (Source.Reference.all (Low .. High)); end if; end Unbounded_Slice; procedure Unbounded_Slice (Source : Unbounded_Wide_String; Target : out Unbounded_Wide_String; Low : Positive; High : Natural) is begin if Low > Source.Last + 1 or else High > Source.Last then raise Index_Error; else Target := To_Unbounded_Wide_String (Source.Reference.all (Low .. High)); end if; end Unbounded_Slice; end Ada.Strings.Wide_Unbounded;
27.408015
79
0.577025
061fa4f4e13ace60c6b4487d598293b74228a765
5,275
adb
Ada
src/sparknacl-mac.adb
yannickmoy/SPARKNaCl
c27fa811bf38b3706c1dc242f30e82967ad8f1c6
[ "BSD-2-Clause" ]
76
2020-02-24T20:30:15.000Z
2022-02-16T15:10:56.000Z
src/sparknacl-mac.adb
yannickmoy/SPARKNaCl
c27fa811bf38b3706c1dc242f30e82967ad8f1c6
[ "BSD-2-Clause" ]
10
2020-04-15T10:02:49.000Z
2022-02-24T20:10:46.000Z
src/sparknacl-mac.adb
yannickmoy/SPARKNaCl
c27fa811bf38b3706c1dc242f30e82967ad8f1c6
[ "BSD-2-Clause" ]
4
2020-03-10T15:19:45.000Z
2022-02-17T09:46:20.000Z
package body SPARKNaCl.MAC with SPARK_Mode => On is pragma Warnings (GNATProve, Off, "pragma * ignored (not yet supported)"); subtype Index_17 is I32 range 0 .. 16; subtype Poly_1305_F is U32_Seq (Index_17); MinusP : constant Poly_1305_F := (5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252); function Construct (K : in Bytes_32) return Poly_1305_Key is begin return Poly_1305_Key'(F => K); end Construct; procedure Construct (K : out Poly_1305_Key; X : in Bytes_32) is begin K.F := X; end Construct; function Serialize (K : in Poly_1305_Key) return Bytes_32 is begin return K.F; end Serialize; procedure Sanitize (K : out Poly_1305_Key) is begin Sanitize (K.F); end Sanitize; procedure Onetimeauth (Output : out Bytes_16; M : in Byte_Seq; K : in Poly_1305_Key) is S, U : U32; J : Index_17; N : I64; -- Because M'Length can be > I32'Last M_Offset : N32; X, R, H, C, G : Poly_1305_F; procedure Add_1305 (H : in out Poly_1305_F; C : in Poly_1305_F) with Global => null; procedure Add_1305 (H : in out Poly_1305_F; C : in Poly_1305_F) is U : U32 := 0; begin for J in Index_17 loop pragma Loop_Optimize (No_Unroll); U := U + H (J) + C (J); H (J) := U and 255; U := Shift_Right (U, 8); end loop; end Add_1305; begin H := (others => 0); X := (others => 0); R := (0 => U32 (K.F (0)), 1 => U32 (K.F (1)), 2 => U32 (K.F (2)), 3 => U32 (K.F (3)) and 15, 4 => U32 (K.F (4)) and 252, 5 => U32 (K.F (5)), 6 => U32 (K.F (6)), 7 => U32 (K.F (7)) and 15, 8 => U32 (K.F (8)) and 252, 9 => U32 (K.F (9)), 10 => U32 (K.F (10)), 11 => U32 (K.F (11)) and 15, 12 => U32 (K.F (12)) and 252, 13 => U32 (K.F (13)), 14 => U32 (K.F (14)), 15 => U32 (K.F (15)) and 15, 16 => 0); N := M'Length; M_Offset := 0; while (N > 0) loop pragma Loop_Optimize (No_Unroll); C := (others => 0); J := 0; pragma Loop_Invariant (N + I64 (M_Offset) = M'Length); while ((J < 16) and (I64 (J) < N)) loop pragma Loop_Optimize (No_Unroll); pragma Loop_Invariant (N + I64 (M_Offset) = M'Length and M_Offset + J in M'Range); C (J) := U32 (M (M_Offset + J)); J := J + 1; end loop; C (J) := 1; N := N - I64 (J); -- If N > 0 now, then there at least one more block to process. -- If N = 0, then this is the final loop iteration, so no need to -- increment M_Offset. This also protects against overflow -- when M'Last is at or near N32'Last if N > 0 then M_Offset := M_Offset + J; -- POV end if; Add_1305 (H, C); for I in Index_17 loop pragma Loop_Optimize (No_Unroll); X (I) := 0; for P in Index_17 loop pragma Loop_Optimize (No_Unroll); X (I) := X (I) + H (P) * (if P <= I then R (I - P) else 320 * R (I + 17 - P)); end loop; end loop; H := X; U := 0; for P in Index_16 loop pragma Loop_Optimize (No_Unroll); U := U + H (P); H (P) := U and 255; U := Shift_Right (U, 8); end loop; U := U + H (16); H (16) := U and 3; U := 5 * Shift_Right (U, 2); for P in Index_16 loop pragma Loop_Optimize (No_Unroll); U := U + H (P); H (P) := U and 255; U := Shift_Right (U, 8); end loop; U := U + H (16); H (16) := U; end loop; G := H; Add_1305 (H, MinusP); S := -Shift_Right (H (16), 7); for P in Index_17 loop pragma Loop_Optimize (No_Unroll); H (P) := H (P) xor (S and (G (P) xor H (P))); end loop; C := (U32 (K.F (16)), U32 (K.F (17)), U32 (K.F (18)), U32 (K.F (19)), U32 (K.F (20)), U32 (K.F (21)), U32 (K.F (22)), U32 (K.F (23)), U32 (K.F (24)), U32 (K.F (25)), U32 (K.F (26)), U32 (K.F (27)), U32 (K.F (28)), U32 (K.F (29)), U32 (K.F (30)), U32 (K.F (31)), 0); Add_1305 (H, C); for P in Index_16 loop pragma Loop_Optimize (No_Unroll); Output (P) := Byte (H (P) mod 256); end loop; end Onetimeauth; function Onetimeauth_Verify (H : in Bytes_16; M : in Byte_Seq; K : in Poly_1305_Key) return Boolean is X : Bytes_16; begin Onetimeauth (X, M, K); return Equal (H, X); end Onetimeauth_Verify; end SPARKNaCl.MAC;
27.051282
77
0.436019
a1a5eacad749d29de2571097bc9a2e02e41022a3
640
ads
Ada
include/bits_types_struct_timeval_h.ads
docandrew/troodon
9240611708f92ffb5491fa677bffb6ecac58a51e
[ "MIT" ]
5
2021-11-03T04:34:16.000Z
2021-11-10T23:06:30.000Z
include/bits_types_struct_timeval_h.ads
docandrew/troodon
9240611708f92ffb5491fa677bffb6ecac58a51e
[ "MIT" ]
null
null
null
include/bits_types_struct_timeval_h.ads
docandrew/troodon
9240611708f92ffb5491fa677bffb6ecac58a51e
[ "MIT" ]
null
null
null
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with bits_types_h; package bits_types_struct_timeval_h is -- A time value that is accurate to the nearest -- microsecond but also has a range of years. -- Seconds. type timeval is record tv_sec : aliased bits_types_h.uu_time_t; -- /usr/include/bits/types/struct_timeval.h:10 tv_usec : aliased bits_types_h.uu_suseconds_t; -- /usr/include/bits/types/struct_timeval.h:11 end record with Convention => C_Pass_By_Copy; -- /usr/include/bits/types/struct_timeval.h:8 -- Microseconds. end bits_types_struct_timeval_h;
30.47619
100
0.7375
1278c32f185ca1dd04376c55be483de1234701d6
6,004
ads
Ada
spec/stddef_h.ads
0xA1/pi-spi
f1976005eee16947a0f5d68bf7e01504d140b83e
[ "0BSD" ]
null
null
null
spec/stddef_h.ads
0xA1/pi-spi
f1976005eee16947a0f5d68bf7e01504d140b83e
[ "0BSD" ]
null
null
null
spec/stddef_h.ads
0xA1/pi-spi
f1976005eee16947a0f5d68bf7e01504d140b83e
[ "0BSD" ]
null
null
null
pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; package stddef_h is -- unsupported macro: NULL __null -- arg-macro: procedure offsetof __builtin_offsetof (TYPE, MEMBER) -- __builtin_offsetof (TYPE, MEMBER) -- Copyright (C) 1989-2014 Free Software Foundation, Inc. --This file is part of GCC. --GCC is free software; you can redistribute it and/or modify --it under the terms of the GNU General Public License as published by --the Free Software Foundation; either version 3, or (at your option) --any later version. --GCC is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --GNU General Public License for more details. --Under Section 7 of GPL version 3, you are granted additional --permissions described in the GCC Runtime Library Exception, version --3.1, as published by the Free Software Foundation. --You should have received a copy of the GNU General Public License and --a copy of the GCC Runtime Library Exception along with this program; --see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --<http://www.gnu.org/licenses/>. -- * ISO C Standard: 7.17 Common definitions <stddef.h> -- -- Any one of these symbols __need_* means that GNU libc -- wants us just to define one data type. So don't define -- the symbols that indicate this file's entire job has been done. -- [email protected] says the NeXT needs this. -- This avoids lossage on SunOS but only if stdtypes.h comes first. -- There's no way to win with the other order! Sun lossage. -- On 4.3bsd-net2, make sure ansi.h is included, so we have -- one less case to deal with in the following. -- On FreeBSD 5, machine/ansi.h does not exist anymore... -- In 4.3bsd-net2, machine/ansi.h defines these symbols, which are -- defined if the corresponding type is *not* defined. -- FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. -- NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ -- On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ -- instead of _WCHAR_T_. -- Undef _FOO_T_ if we are supposed to define foo_t. -- Sequent's header files use _PTRDIFF_T_ in some conflicting way. -- Just ignore it. -- On VxWorks, <type/vxTypesBase.h> may have defined macros like -- _TYPE_size_t which will typedef size_t. fixincludes patched the -- vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is -- not defined, and so that defining this macro defines _GCC_SIZE_T. -- If we find that the macros are still defined at this point, we must -- invoke them so that the type is defined as expected. -- In case nobody has defined these types, but we aren't running under -- GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and -- __WCHAR_TYPE__ have reasonable values. This can happen if the -- parts of GCC is compiled by an older compiler, that actually -- include gstddef.h, such as collect2. -- Signed type of difference of two pointers. -- Define this type if we are doing the whole job, -- or if we want this type in particular. subtype ptrdiff_t is int; -- /usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stddef.h:147 -- If this symbol has done its job, get rid of it. -- Unsigned type of `sizeof' something. -- Define this type if we are doing the whole job, -- or if we want this type in particular. -- __size_t is a typedef on FreeBSD 5, must not trash it. -- __size_t is also a typedef on VMS. subtype size_t is unsigned; -- /usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stddef.h:212 -- Wide character type. -- Locale-writers should change this as necessary to -- be big enough to hold unique values not between 0 and 127, -- and not (wchar_t) -1, for each defined multibyte character. -- Define this type if we are doing the whole job, -- or if we want this type in particular. -- On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ -- instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other -- symbols in the _FOO_T_ family, stays defined even after its -- corresponding type is defined). If we define wchar_t, then we -- must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if -- we undef _WCHAR_T_, then we must also define rune_t, since -- headers like runetype.h assume that if machine/ansi.h is included, -- and _BSD_WCHAR_T_ is not defined, then rune_t is available. -- machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of -- the same type." -- Why is this file so hard to maintain properly? In contrast to -- the comment above regarding BSD/386 1.1, on FreeBSD for as long -- as the symbol has existed, _BSD_RUNE_T_ must not stay defined or -- redundant typedefs will occur when stdlib.h is included after this file. -- FreeBSD 5 can't be handled well using "traditional" logic above -- since it no longer defines _BSD_RUNE_T_ yet still desires to export -- rune_t in some cases... -- In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. -- are already defined. -- BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. -- NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. -- The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ -- are probably typos and should be removed before 2.8 is released. -- The following ones are the real ones. -- A null pointer constant. -- Offset of member MEMBER in a struct of type TYPE. -- Type whose alignment is supported in every context and is at least -- as great as that of any standard type not using alignment -- specifiers. end stddef_h;
46.90625
92
0.704364
a149be7c166fc0a733d5b2412bf2997fa62dfd79
5,824
ads
Ada
source/league/league-json-streams.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/league/league-json-streams.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/league/league-json-streams.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014-2016, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ private with Ada.Containers.Vectors; with Ada.Streams; private with League.JSON.Arrays; with League.JSON.Documents; private with League.JSON.Objects; with League.JSON.Values; with League.Strings; package League.JSON.Streams is pragma Preelaborate; type JSON_Stream is new Ada.Streams.Root_Stream_Type with private; procedure Start_Object (Self : not null access JSON_Stream'Class); procedure End_Object (Self : not null access JSON_Stream'Class); procedure Start_Array (Self : not null access JSON_Stream'Class); procedure End_Array (Self : not null access JSON_Stream'Class); function End_Of_Array (Self : not null access JSON_Stream'Class) return Boolean; -- Returns True when there are no array elements to be read. procedure Key (Self : not null access JSON_Stream'Class; Key : League.Strings.Universal_String); function Get_JSON_Document (Self : not null access JSON_Stream'Class) return League.JSON.Documents.JSON_Document; procedure Set_JSON_Document (Self : not null access JSON_Stream'Class; Data : League.JSON.Documents.JSON_Document); function Read (Self : in out JSON_Stream'Class) return League.JSON.Values.JSON_Value; -- Reads current value and updates stream's position. procedure Write (Self : in out JSON_Stream'Class; Item : League.JSON.Values.JSON_Value); -- Writes value into the stream and updates stream's position. private type State_Kinds is (Array_State, Object_State); type State (Kind : State_Kinds := Array_State) is record Modified : Boolean := False; case Kind is when Array_State => Current_Array : League.JSON.Arrays.JSON_Array; Index : Positive := 1; when Object_State => Current_Object : League.JSON.Objects.JSON_Object; Key : League.Strings.Universal_String; end case; end record; package State_Vectors is new Ada.Containers.Vectors (Positive, State); type JSON_Stream is new Ada.Streams.Root_Stream_Type with record Current : State; Stack : State_Vectors.Vector; end record; overriding procedure Read (Stream : in out JSON_Stream; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); overriding procedure Write (Stream : in out JSON_Stream; Item : Ada.Streams.Stream_Element_Array); end League.JSON.Streams;
45.5
78
0.529361
fb5a657575cec75654658043ea7db82044513b1e
63
ads
Ada
tests/syntax_examples/src/package_without_body.ads
TNO/Dependency_Graph_Extractor-Ada
cfcc9132cf181e4db5139c14150f221efa69a6d6
[ "BSD-3-Clause" ]
1
2022-03-08T13:00:47.000Z
2022-03-08T13:00:47.000Z
src/tools/Dependency_Graph_Extractor/tests/Syntax_Examples/src/package_without_body.ads
selroc/Renaissance-Ada
39230b34aced4a9d83831be346ca103136c53715
[ "BSD-3-Clause" ]
null
null
null
src/tools/Dependency_Graph_Extractor/tests/Syntax_Examples/src/package_without_body.ads
selroc/Renaissance-Ada
39230b34aced4a9d83831be346ca103136c53715
[ "BSD-3-Clause" ]
null
null
null
package Package_Without_Body is end Package_Without_Body;
12.6
31
0.825397
50eb6ca469e6b23cb546b2a3b543d10d971c18c3
1,581
adb
Ada
ejercicios1/prueba_diviporrestas.adb
iyan22/AprendeAda
18bd2a224e5bda30c43d9ceabe0c05278e069ebf
[ "MIT" ]
null
null
null
ejercicios1/prueba_diviporrestas.adb
iyan22/AprendeAda
18bd2a224e5bda30c43d9ceabe0c05278e069ebf
[ "MIT" ]
null
null
null
ejercicios1/prueba_diviporrestas.adb
iyan22/AprendeAda
18bd2a224e5bda30c43d9ceabe0c05278e069ebf
[ "MIT" ]
null
null
null
with ada.text_io, ada.integer_text_io; use ada.text_io, ada.integer_text_io; with diviporrestas; procedure prueba_diviporrestas is dividendo, divisor, resto, resultado :integer:=0; begin -- caso de prueba 1: dividendo:=7; divisor:=3; put("El resultado de la division es 2 y el resto 1:"); new_line; put("Y tu programa dice que es:"); diviporrestas(dividendo, divisor, resultado, resto); put(resultado); put(resto); new_line; -- caso de prueba 2: dividendo:=0; divisor:=4; put("El resultado de la division es 0 y el resto 0:"); new_line; put("Y tu programa dice que es:"); diviporrestas(dividendo, divisor, resultado, resto); put(resultado); put(resto); new_line; -- caso de prueba 3: dividendo:=100; divisor:=10; put("El resultado de la division es 10 y el resto 0:"); new_line; put("Y tu programa dice que es:"); diviporrestas(dividendo, divisor, resultado, resto); put(resultado); put(resto); new_line; -- caso de prueba 4: dividendo:=50; divisor:=11; put("El resultado de la division es 4 y el resto 6:"); new_line; put("Y tu programa dice que es:"); diviporrestas(dividendo, divisor, resultado, resto); put(resultado); put(resto); new_line; -- caso de prueba 5: dividendo:=50; divisor:=50; put("El resultado de la division es 1 y el resto 0:"); new_line; put("Y tu programa dice que es:"); diviporrestas(dividendo, divisor, resultado, resto); put(resultado); put(resto); new_line; end prueba_diviporrestas;
21.08
58
0.657812
a19ea257db7bbc4f65c08defb9efa7cc23782076
5,469
adb
Ada
src/asf-components-widgets-progress.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
null
null
null
src/asf-components-widgets-progress.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
null
null
null
src/asf-components-widgets-progress.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- components-widgets-progress -- Simple progress bar -- Copyright (C) 2021 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Beans.Objects; with ASF.Components.Base; with ASF.Contexts.Writer; with Ada.Text_IO.Editing; package body ASF.Components.Widgets.Progress is use Util.Beans.Objects; package Formatter is new Ada.Text_IO.Editing.Decimal_Output (Num => Progress_Type); Format : constant Ada.Text_IO.Editing.Picture := Ada.Text_IO.Editing.To_Picture ("ZZ9.9"); function Get_Progress (UI : in UIProgressBar; Context : in ASF.Contexts.Faces.Faces_Context'Class) return Progress_Type is Value_Obj : constant Object := UI.Get_Attribute (Context, VALUE_ATTR_NAME); Min_Obj : constant Object := UI.Get_Attribute (Context, MIN_VALUE_ATTR_NAME); Max_Obj : constant Object := UI.Get_Attribute (Context, MAX_VALUE_ATTR_NAME); Value : Long_Long_Float := To_Long_Long_Float (Value_Obj); Min_Val : Long_Long_Float := 0.0; Max_Val : Long_Long_Float := 0.0; Div : Long_Long_Float; begin if not Is_Null (Min_Obj) then Min_Val := To_Long_Long_Float (Min_Obj); end if; if not Is_Null (Max_Obj) then Max_Val := To_Long_Long_Float (Max_Obj); end if; if Max_Val < Min_Val then Base.Log_Error (UI, "progress min value ({0}) is < max value ({1})", To_String (Min_Obj), To_String (Max_Obj)); end if; Div := Max_Val - Min_Val; if Div <= 0.0 then return 0.0; end if; Value := Value - Min_Val; if Value >= Div then return 100.0; else return Progress_Type (100.0 * Value / Div); end if; end Get_Progress; -- ------------------------------ -- Render the tab start. -- ------------------------------ overriding procedure Encode_Begin (UI : in UIProgressBar; Context : in out ASF.Contexts.Faces.Faces_Context'Class) is Writer : constant Contexts.Writer.Response_Writer_Access := Context.Get_Response_Writer; begin if UI.Is_Rendered (Context) then Writer.Start_Element ("div"); declare Style : constant Object := UI.Get_Attribute (Context, "style"); Class : constant Object := UI.Get_Attribute (Context, "styleClass"); Title : constant Object := UI.Get_Attribute (Context, "title"); Direction : constant Object := UI.Get_Attribute (Context, DIRECTION_ATTR_NAME); Progress : constant Progress_Type := UI.Get_Progress (Context); Image : constant String := Formatter.Image (Progress, Format); Pos : Positive := Image'First; Vertical : constant Boolean := To_String (Direction) = "vertical"; begin while Pos < Image'Last and then Image (Pos) = ' ' loop Pos := Pos + 1; end loop; if not UI.Is_Generated_Id then Writer.Write_Attribute ("id", UI.Get_Client_Id); end if; if not Is_Null (Class) then Writer.Write_Attribute ("class", Class); else Writer.Write_Attribute ("class", "asf-progress-bar"); end if; if not Is_Null (Style) then Writer.Write_Attribute ("style", Style); end if; if not Is_Null (Title) then Writer.Write_Attribute ("title", Title); end if; Writer.Start_Element ("span"); if Vertical then Writer.Write_Attribute ("class", "asf-progress-status-vertical"); Writer.Write_Attribute ("style", "height:" & Image (Pos .. Image'Last) & "%"); else Writer.Write_Attribute ("class", "asf-progress-status-horizontal"); Writer.Write_Attribute ("style", "width:" & Image (Pos .. Image'Last) & "%"); end if; end; end if; end Encode_Begin; -- ------------------------------ -- Render the tab close. -- ------------------------------ overriding procedure Encode_End (UI : in UIProgressBar; Context : in out ASF.Contexts.Faces.Faces_Context'Class) is Writer : constant Contexts.Writer.Response_Writer_Access := Context.Get_Response_Writer; begin if UI.Is_Rendered (Context) then Writer.End_Element ("span"); Writer.End_Element ("div"); end if; end Encode_End; end ASF.Components.Widgets.Progress;
41.120301
95
0.568843
1c9d41863c9251570444c26404f8477ad60fb3e8
3,172
ads
Ada
src/open_weather_map-api-query.ads
Jellix/open_weather_map_api
fa3484b361411b9362500a25e36d63d4bb6dbca3
[ "WTFPL" ]
1
2020-09-04T18:31:05.000Z
2020-09-04T18:31:05.000Z
src/open_weather_map-api-query.ads
Jellix/open_weather_map_api
fa3484b361411b9362500a25e36d63d4bb6dbca3
[ "WTFPL" ]
2
2020-03-22T16:28:32.000Z
2020-03-22T16:31:51.000Z
src/open_weather_map-api-query.ads
HeisenbugLtd/open_weather_map_api
fa3484b361411b9362500a25e36d63d4bb6dbca3
[ "WTFPL" ]
null
null
null
-------------------------------------------------------------------------------- -- Copyright (C) 2020 by Heisenbug Ltd. ([email protected]) -- -- This work is free. You can redistribute it and/or modify it under the -- terms of the Do What The Fuck You Want To Public License, Version 2, -- as published by Sam Hocevar. See the LICENSE file for more details. -------------------------------------------------------------------------------- pragma License (Unrestricted); -------------------------------------------------------------------------------- --% @summary --% Open_Weather_Map.API.Query (private) -- --% @description --% Provides the abstract tagged type implementing a context where query timings --% are stored. -------------------------------------------------------------------------------- private package Open_Weather_Map.API.Query is ----------------------------------------------------------------------------- -- Abstract context base type, and its primitive operations. ----------------------------------------------------------------------------- type T is abstract new Open_Weather_Map.API.T with private; ----------------------------------------------------------------------------- -- Initialize ----------------------------------------------------------------------------- procedure Initialize (Self : out T); --% Initializes the object. -- --% @param Self --% The object to be initialized. ----------------------------------------------------------------------------- -- Last_Query ----------------------------------------------------------------------------- overriding function Last_Query (Self : in T) return Ada.Real_Time.Time with Inline => True; --% Returns the time of the last query done with that context. -- --% @param Self --% The object to retrive its last update time from. -- --% @return --% Time of the last server update for This. ----------------------------------------------------------------------------- -- Set_Last_Query ----------------------------------------------------------------------------- procedure Set_Last_Query (Self : in out T; Value : in Ada.Real_Time.Time); --% Sets a new last time a query has been executed. Should be called by --% derived types whenever a query is about to be performed. -- --% @param Self --% The object to be updated. -- --% @param Value --% The new time to be set for the last update being performed. private type T is abstract new Open_Weather_Map.API.T with record Last_Query : Ada.Real_Time.Time; --% @field Last_Query --% Stores the last time the object has been updated from the server. -- Used to implement and caching and rate limiting. end record; ----------------------------------------------------------------------------- -- Last_Query ----------------------------------------------------------------------------- overriding function Last_Query (Self : in T) return Ada.Real_Time.Time is (Self.Last_Query); end Open_Weather_Map.API.Query;
40.151899
80
0.428436
fb3510be1a15fa147524a3bddd0f2d815d2d3900
2,548
ads
Ada
regtests/keystore-gpg_tests.ads
My-Colaborations/ada-keystore
6ab222c2df81f32309c5a7b4f94a475214ef5ce3
[ "Apache-2.0" ]
null
null
null
regtests/keystore-gpg_tests.ads
My-Colaborations/ada-keystore
6ab222c2df81f32309c5a7b4f94a475214ef5ce3
[ "Apache-2.0" ]
null
null
null
regtests/keystore-gpg_tests.ads
My-Colaborations/ada-keystore
6ab222c2df81f32309c5a7b4f94a475214ef5ce3
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- keystore-gpg_tests -- Test AKT with GPG2 -- Copyright (C) 2019, 2020 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with Util.Tests; package Keystore.GPG_Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Test the akt keystore creation. procedure Test_Create (T : in out Test); -- Test the akt keystore for several users each having their own GPG key. procedure Test_Create_Multi_User (T : in out Test); -- Test the akt info command on the GPG protected keystore. procedure Test_Info (T : in out Test); -- Test the akt password-add command to add a GPG key to a keystore. procedure Test_Add_Password (T : in out Test); -- Test the akt password-remove command to remove a GPG key from the keystore. procedure Test_Remove_Password (T : in out Test); -- Test update content with store command procedure Test_Update_File (T : in out Test); -- Test when gpg execution fails procedure Test_GPG_Error (T : in out Test); procedure Execute (T : in out Test; Command : in String; Input : in String; Output : in String; Result : out Ada.Strings.Unbounded.Unbounded_String; Status : in Natural := 0); procedure Execute (T : in out Test; Command : in String; Result : out Ada.Strings.Unbounded.Unbounded_String; Status : in Natural := 0); procedure Execute (T : in out Test; Command : in String; Expect : in String; Status : in Natural := 0); end Keystore.GPG_Tests;
38.606061
82
0.604003
20e49d87996c9b9da57149104487357bc68d2aca
1,705
ads
Ada
tools/scitools/conf/understand/ada/ada05/a-coprnu.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
llvm-gcc-4.2-2.9/gcc/ada/a-coprnu.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/a-coprnu.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- A D A . C O N T A I N E R S . P R I M E _ N U M B E R S -- -- -- -- S p e c -- -- -- -- This specification is adapted from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ package Ada.Containers.Prime_Numbers is pragma Pure; type Primes_Type is array (Positive range <>) of Hash_Type; Primes : constant Primes_Type := (53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917, 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, 1610612741, 3221225473, 4294967291); function To_Prime (Length : Count_Type) return Hash_Type; end Ada.Containers.Prime_Numbers;
53.28125
78
0.384164
4deebaee1ce0b7efdc7530df2e6eac45db812891
835
adb
Ada
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/info_addr_mixed_case/pck.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
3
2021-05-04T17:09:06.000Z
2021-10-04T07:19:26.000Z
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/info_addr_mixed_case/pck.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/info_addr_mixed_case/pck.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
-- Copyright 2018-2020 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pck is procedure Do_Nothing (A : System.Address) is begin null; end Do_Nothing; end Pck;
33.4
73
0.726946
1c232540895c8a3cf25b435d9fd5f7bf9e8eccb7
8,477
adb
Ada
firmware/coreboot/3rdparty/libgfxinit/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb
fabiojna02/OpenCellular
45b6a202d6b2e2485c89955b9a6da920c4d56ddb
[ "CC-BY-4.0", "BSD-3-Clause" ]
1
2019-02-05T09:50:07.000Z
2019-02-05T09:50:07.000Z
firmware/coreboot/3rdparty/libgfxinit/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb
aimin-wang/OpenCellular
5308146bf7edf43cc81c0e4d15305b711117070a
[ "CC-BY-4.0", "BSD-3-Clause" ]
13
2018-10-12T21:29:09.000Z
2018-10-25T20:06:51.000Z
firmware/coreboot/3rdparty/libgfxinit/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb
aimin-wang/OpenCellular
5308146bf7edf43cc81c0e4d15305b711117070a
[ "CC-BY-4.0", "BSD-3-Clause" ]
null
null
null
-- -- Copyright (C) 2014-2018 secunet Security Networks AG -- -- 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 2 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. -- with GNAT.Source_Info; with HW.Time; with HW.Debug; with HW.GFX.GMA.Config; with HW.GFX.GMA.Registers; package body HW.GFX.GMA.Power_And_Clocks_Haswell is PWR_WELL_CTL_ENABLE_REQUEST : constant := 1 * 2 ** 31; PWR_WELL_CTL_DISABLE_REQUEST : constant := 0 * 2 ** 31; PWR_WELL_CTL_STATE_ENABLED : constant := 1 * 2 ** 30; ---------------------------------------------------------------------------- SRD_CTL_ENABLE : constant := 1 * 2 ** 31; SRD_STATUS_STATE_MASK : constant := 7 * 2 ** 29; type Pipe is (EDP, A, B, C); type SRD_Regs is record CTL : Registers.Registers_Index; STATUS : Registers.Registers_Index; end record; type SRD_Per_Pipe_Regs is array (Pipe) of SRD_Regs; SRD : constant SRD_Per_Pipe_Regs := SRD_Per_Pipe_Regs' (A => SRD_Regs' (CTL => Registers.SRD_CTL_A, STATUS => Registers.SRD_STATUS_A), B => SRD_Regs' (CTL => Registers.SRD_CTL_B, STATUS => Registers.SRD_STATUS_B), C => SRD_Regs' (CTL => Registers.SRD_CTL_C, STATUS => Registers.SRD_STATUS_C), EDP => SRD_Regs' (CTL => Registers.SRD_CTL_EDP, STATUS => Registers.SRD_STATUS_EDP)); ---------------------------------------------------------------------------- IPS_CTL_ENABLE : constant := 1 * 2 ** 31; DISPLAY_IPS_CONTROL : constant := 16#19#; GT_MAILBOX_READY : constant := 1 * 2 ** 31; ---------------------------------------------------------------------------- procedure PSR_Off is Enabled : Boolean; begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); if Config.Has_Per_Pipe_SRD then for P in Pipe loop Registers.Is_Set_Mask (SRD (P).CTL, SRD_CTL_ENABLE, Enabled); if Enabled then Registers.Unset_Mask (SRD (P).CTL, SRD_CTL_ENABLE); Registers.Wait_Unset_Mask (SRD (P).STATUS, SRD_STATUS_STATE_MASK); pragma Debug (Debug.Put_Line ("Disabled PSR.")); end if; end loop; else Registers.Is_Set_Mask (Registers.SRD_CTL, SRD_CTL_ENABLE, Enabled); if Enabled then Registers.Unset_Mask (Registers.SRD_CTL, SRD_CTL_ENABLE); Registers.Wait_Unset_Mask (Registers.SRD_STATUS, SRD_STATUS_STATE_MASK); pragma Debug (Debug.Put_Line ("Disabled PSR.")); end if; end if; end PSR_Off; ---------------------------------------------------------------------------- procedure GT_Mailbox_Write (MBox : Word32; Value : Word32) is begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); Registers.Wait_Unset_Mask (Registers.GT_MAILBOX, GT_MAILBOX_READY); Registers.Write (Registers.GT_MAILBOX_DATA, Value); Registers.Write (Registers.GT_MAILBOX, GT_MAILBOX_READY or MBox); Registers.Wait_Unset_Mask (Registers.GT_MAILBOX, GT_MAILBOX_READY); Registers.Write (Registers.GT_MAILBOX_DATA, 0); end GT_Mailbox_Write; procedure IPS_Off is Enabled : Boolean; begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); if Config.Has_IPS then Registers.Is_Set_Mask (Registers.IPS_CTL, IPS_CTL_ENABLE, Enabled); if Enabled then if Config.Has_IPS_CTL_Mailbox then GT_Mailbox_Write (DISPLAY_IPS_CONTROL, 0); Registers.Wait_Unset_Mask (Register => Registers.IPS_CTL, Mask => IPS_CTL_ENABLE, TOut_MS => 42); else Registers.Unset_Mask (Registers.IPS_CTL, IPS_CTL_ENABLE); end if; pragma Debug (Debug.Put_Line ("Disabled IPS.")); -- We have to wait until the next vblank here. -- 20ms should be enough. Time.M_Delay (20); end if; end if; end IPS_Off; ---------------------------------------------------------------------------- procedure PDW_Off is Ctl1, Ctl2, Ctl3, Ctl4 : Word32; begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); Registers.Read (Registers.PWR_WELL_CTL_BIOS, Ctl1); Registers.Read (Registers.PWR_WELL_CTL_DRIVER, Ctl2); Registers.Read (Registers.PWR_WELL_CTL_KVMR, Ctl3); Registers.Read (Registers.PWR_WELL_CTL_DEBUG, Ctl4); pragma Debug (Registers.Posting_Read (Registers.PWR_WELL_CTL5)); -- Result for debugging only pragma Debug (Registers.Posting_Read (Registers.PWR_WELL_CTL6)); -- Result for debugging only if ((Ctl1 or Ctl2 or Ctl3 or Ctl4) and PWR_WELL_CTL_ENABLE_REQUEST) /= 0 then Registers.Wait_Set_Mask (Registers.PWR_WELL_CTL_DRIVER, PWR_WELL_CTL_STATE_ENABLED); end if; if (Ctl1 and PWR_WELL_CTL_ENABLE_REQUEST) /= 0 then Registers.Write (Registers.PWR_WELL_CTL_BIOS, PWR_WELL_CTL_DISABLE_REQUEST); end if; if (Ctl2 and PWR_WELL_CTL_ENABLE_REQUEST) /= 0 then Registers.Write (Registers.PWR_WELL_CTL_DRIVER, PWR_WELL_CTL_DISABLE_REQUEST); end if; end PDW_Off; procedure PDW_On is Ctl1, Ctl2, Ctl3, Ctl4 : Word32; begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); Registers.Read (Registers.PWR_WELL_CTL_BIOS, Ctl1); Registers.Read (Registers.PWR_WELL_CTL_DRIVER, Ctl2); Registers.Read (Registers.PWR_WELL_CTL_KVMR, Ctl3); Registers.Read (Registers.PWR_WELL_CTL_DEBUG, Ctl4); pragma Debug (Registers.Posting_Read (Registers.PWR_WELL_CTL5)); -- Result for debugging only pragma Debug (Registers.Posting_Read (Registers.PWR_WELL_CTL6)); -- Result for debugging only if ((Ctl1 or Ctl2 or Ctl3 or Ctl4) and PWR_WELL_CTL_ENABLE_REQUEST) = 0 then Registers.Wait_Unset_Mask (Registers.PWR_WELL_CTL_DRIVER, PWR_WELL_CTL_STATE_ENABLED); end if; if (Ctl2 and PWR_WELL_CTL_ENABLE_REQUEST) = 0 then Registers.Write (Registers.PWR_WELL_CTL_DRIVER, PWR_WELL_CTL_ENABLE_REQUEST); Registers.Wait_Set_Mask (Registers.PWR_WELL_CTL_DRIVER, PWR_WELL_CTL_STATE_ENABLED); end if; end PDW_On; function Need_PDW (Checked_Configs : Pipe_Configs) return Boolean is Primary : Pipe_Config renames Checked_Configs (GMA.Primary); begin return (Config.Use_PDW_For_EDP_Scaling and then (Primary.Port = Internal and Requires_Scaling (Primary))) or (Primary.Port /= Disabled and Primary.Port /= Internal) or Checked_Configs (Secondary).Port /= Disabled or Checked_Configs (Tertiary).Port /= Disabled; end Need_PDW; ---------------------------------------------------------------------------- procedure Pre_All_Off is begin -- HSW: disable panel self refresh (PSR) on eDP if enabled -- wait for PSR idling PSR_Off; IPS_Off; end Pre_All_Off; procedure Initialize is begin -- HSW: disable power down well PDW_Off; Config.Raw_Clock := Config.Default_RawClk_Freq; end Initialize; procedure Power_Set_To (Configs : Pipe_Configs) is begin if Need_PDW (Configs) then PDW_On; else PDW_Off; end if; end Power_Set_To; procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is begin if not Need_PDW (Old_Configs) and Need_PDW (New_Configs) then PDW_On; end if; end Power_Up; procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs) is begin if (Need_PDW (Old_Configs) or Need_PDW (Tmp_Configs)) and not Need_PDW (New_Configs) then PDW_Off; end if; end Power_Down; end HW.GFX.GMA.Power_And_Clocks_Haswell;
34.319838
100
0.620503
12954a9f5a6fb4a3a9af92595c72634ef4e6ad2d
3,030
adb
Ada
source/oasis/program-compilation_unit_vectors.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/oasis/program-compilation_unit_vectors.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/oasis/program-compilation_unit_vectors.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
1
2019-10-16T09:05:27.000Z
2019-10-16T09:05:27.000Z
-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Compilation_Unit_Vectors is procedure Skip_Elements (Self : Iterator; Pos : in out Compilation_Unit_Cursor; Step : Integer); -- Find a good Element starting from Pos.Index and set other fields of Pos --------------- -- Each_Unit -- --------------- function Each_Unit (Self : access Compilation_Unit_Vector'Class; When_Unit : Compilation_Unit_Checker := null) return Iterator is begin return (Vector => Self, Condition => When_Unit); end Each_Unit; ----------- -- First -- ----------- overriding function First (Self : Iterator) return Program.Compilation_Unit_Vectors.Compilation_Unit_Cursor is begin return Result : Compilation_Unit_Cursor := (Index => 1, others => <>) do Self.Skip_Elements (Result, Step => 1); end return; end First; ---------- -- Last -- ---------- overriding function Last (Self : Iterator) return Program.Compilation_Unit_Vectors.Compilation_Unit_Cursor is begin return Result : Compilation_Unit_Cursor := (Index => Self.Vector.Length, others => <>) do Self.Skip_Elements (Result, Step => -1); end return; end Last; ---------- -- Next -- ---------- overriding function Next (Self : Iterator; Cursor : Program.Compilation_Unit_Vectors.Compilation_Unit_Cursor) return Program.Compilation_Unit_Vectors.Compilation_Unit_Cursor is begin return Result : Compilation_Unit_Cursor := Cursor do Result.Index := Result.Index + 1; Self.Skip_Elements (Result, Step => 1); end return; end Next; -------------- -- Previous -- -------------- overriding function Previous (Self : Iterator; Cursor : Program.Compilation_Unit_Vectors.Compilation_Unit_Cursor) return Program.Compilation_Unit_Vectors.Compilation_Unit_Cursor is begin return Result : Compilation_Unit_Cursor := Cursor do Result.Index := Result.Index - 1; Self.Skip_Elements (Result, Step => -1); end return; end Previous; ------------------- -- Skip_Elements -- ------------------- procedure Skip_Elements (Self : Iterator; Pos : in out Compilation_Unit_Cursor; Step : Integer) is begin while Pos.Index in 1 .. Self.Vector.Length and then Self.Condition /= null and then not Self.Condition (Self.Vector.Element (Pos.Index).all) loop Pos.Index := Pos.Index + Step; end loop; if Pos.Index in 1 .. Self.Vector.Length then Pos := (Self.Vector.Element (Pos.Index), Pos.Index, Pos.Index = Self.Vector.Length); else Pos := (null, 1, False); end if; end Skip_Elements; end Program.Compilation_Unit_Vectors;
28.055556
78
0.592409
0e938806cc0ec874d4b348eb794c5939ca8a162e
596
adb
Ada
tests/tcl-strings-test_data.adb
thindil/tashy2
43fcbadb33c0062b2c8d6138a8238441dec5fd80
[ "Apache-2.0" ]
2
2020-12-09T07:27:07.000Z
2021-10-19T13:31:54.000Z
tests/tcl-strings-test_data.adb
thindil/tashy2
43fcbadb33c0062b2c8d6138a8238441dec5fd80
[ "Apache-2.0" ]
null
null
null
tests/tcl-strings-test_data.adb
thindil/tashy2
43fcbadb33c0062b2c8d6138a8238441dec5fd80
[ "Apache-2.0" ]
null
null
null
-- This package is intended to set up and tear down the test environment. -- Once created by GNATtest, this package will never be overwritten -- automatically. Contents of this package can be modified in any way -- except for sections surrounded by a 'read only' marker. package body Tcl.Strings.Test_Data is procedure Set_Up(Gnattest_T: in out Test) is pragma Unreferenced(Gnattest_T); begin null; end Set_Up; procedure Tear_Down(Gnattest_T: in out Test) is pragma Unreferenced(Gnattest_T); begin null; end Tear_Down; end Tcl.Strings.Test_Data;
29.8
75
0.728188
063b72d5cfaacc073afe1f4e86de3b9754cdf81d
2,820
adb
Ada
list_iface/src/lists-vectors.adb
gerr135/ada_gems
fc1b55e991766110581fcc340c8bc7c51ef7a49b
[ "BSD-2-Clause" ]
6
2020-11-26T20:01:50.000Z
2022-03-04T22:22:12.000Z
list_iface/src/lists-vectors.adb
gerr135/ada_gems
fc1b55e991766110581fcc340c8bc7c51ef7a49b
[ "BSD-2-Clause" ]
null
null
null
list_iface/src/lists-vectors.adb
gerr135/ada_gems
fc1b55e991766110581fcc340c8bc7c51ef7a49b
[ "BSD-2-Clause" ]
null
null
null
-- with Ada.Text_IO; use Ada.Text_IO; package body Lists.Vectors is overriding function List_Constant_Reference (Container : aliased in List; Index : Index_Type) return Constant_Reference_Type is VCR : ACV.Constant_Reference_Type := ACV.Vector(Container).Constant_Reference(Index); CR : Constant_Reference_Type(VCR.Element); begin -- Put_Line("List_Constant_Reference (LD, " & Index'Img & ");"); return CR; end; overriding function List_Constant_Reference (Container : aliased in List; Position : Cursor) return Constant_Reference_Type is begin -- Put_Line("List_Constant_Reference (CLD, " & Position.Index'Img & ");"); return List_Constant_Reference(Container, Position.Index); end; overriding function List_Reference (Container : aliased in out List; Index : Index_Type) return Reference_Type is VR : ACV.Reference_Type := ACV.Vector(Container).Reference(Index); R : Reference_Type(VR.Element); begin -- Put_Line("List_Reference (LD, " & Index'Img & ");"); return R; end; overriding function List_Reference (Container : aliased in out List; Position : Cursor) return Reference_Type is begin -- Put_Line("List_Reference (CLD, " & Position.Index'Img & ");"); return List_Reference(Container, Position.Index); end; overriding function Iterate (Container : in List) return Iterator_Interface'Class is It : Iterator := (Container'Unrestricted_Access, Index_Base'First); begin return It; end; function Has_Element (L : List; Position : Index_Base) return Boolean is -- here we pass the check to the underlying Vector begin return ACV.Has_Element(L.To_Cursor(Position)); end; overriding function First (Object : Iterator) return Cursor is C : Cursor := (Object.Container, Index_Type'First); begin -- Put_Line("First (Iterator) = " & C.Index'Img & ";"); return C; end; overriding function Last (Object : Iterator) return Cursor is C : Cursor := (Object.Container, List(Object.Container.all).Last_Index); begin -- Put_Line("Last (Iterator) = " & C.Index'Img & ";"); return C; end; overriding function Next (Object : Iterator; Position : Cursor) return Cursor is C : Cursor := (Object.Container, Position.Index + 1); begin -- Put_Line("Next (Iterator) = " & C.Index'Img & ";"); return C; end; overriding function Previous (Object : Iterator; Position : Cursor) return Cursor is C : Cursor := (Object.Container, Position.Index - 1); begin -- Put_Line("Prev (Iterator) = " & C.Index'Img & ";"); return C; end; end Lists.Vectors;
33.176471
120
0.641844
06ca403d601aea2ce9afb7f9f04a44e626b54211
1,183
adb
Ada
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/lang_switch/lang_switch.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
3
2021-05-04T17:09:06.000Z
2021-10-04T07:19:26.000Z
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/lang_switch/lang_switch.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/lang_switch/lang_switch.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
-- Copyright 2008-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 System; procedure Lang_Switch is pragma Linker_Options ("foo.o"); function C_Procedure (Msg : String) return Integer; pragma Import(C, C_Procedure, "c_procedure"); procedure Ada_Procedure (Msg : String) is C_Msg : String (1 .. 1024); Tmp_Int : Integer; begin C_Msg (1 .. Msg'length + 1) := Msg & Ascii.Nul; Tmp_Int := C_Procedure (Msg => C_Msg); end Ada_Procedure; begin Ada_Procedure ("msg"); end Lang_Switch;
33.8
73
0.703297
fb628c872e025136b723c34fee5de07aaebbdcc7
5,940
ads
Ada
src/API/protypo-api-engine_values-handlers.ads
fintatarta/protypo
c0c2bca17bc766ab95acc99b7422485388a10cb4
[ "MIT" ]
null
null
null
src/API/protypo-api-engine_values-handlers.ads
fintatarta/protypo
c0c2bca17bc766ab95acc99b7422485388a10cb4
[ "MIT" ]
4
2019-10-09T11:16:38.000Z
2019-10-09T11:20:38.000Z
src/API/protypo-api-engine_values-handlers.ads
fintatarta/protypo
c0c2bca17bc766ab95acc99b7422485388a10cb4
[ "MIT" ]
null
null
null
with Protypo.Api.Engine_Values.Engine_Value_Vectors; use Protypo.Api.Engine_Values.Engine_Value_Vectors; with Protypo.Api.Engine_Values.Parameter_Lists; use Protypo.Api.Engine_Values.Parameter_Lists; package Protypo.Api.Engine_Values.Handlers is type Array_Interface is interface; type Array_Interface_Access is access all Array_Interface'Class; function Get (X : Array_Interface; Index : Engine_Value_vectors.Vector) return Handler_Value is abstract with Post'Class => Get'Result.Class in Handler_Classes; function Create (Val : Array_Interface_Access) return Engine_Value with Post => Create'Result.Class = Array_Handler; Out_Of_Range : exception; type Record_Interface is interface; type Record_Interface_Access is access all Record_Interface'Class; function Is_Field (X : Record_Interface; Field : Id) return Boolean is abstract; function Get (X : Record_Interface; Field : Id) return Handler_Value is abstract with Post'Class => Get'Result.Class in Handler_Classes; Unknown_Field : exception; function Create (Val : Record_Interface_Access) return Engine_Value with Post => Create'Result.Class = Record_Handler; type Ambivalent_Interface is interface and Record_Interface and Array_Interface; type Ambivalent_Interface_Access is access all Ambivalent_Interface'Class; function Create (Val : Ambivalent_Interface_Access) return Engine_Value with Post => Create'Result.Class = Ambivalent_Handler; type Constant_Interface is interface; type Constant_Interface_Access is access all Constant_Interface'Class; function Read (X : Constant_Interface) return Engine_Value is abstract; function Create (Val : Constant_Interface_Access) return Engine_Value with Post => Create'Result.Class = Constant_Handler; type Reference_Interface is interface and Constant_Interface; type Reference_Interface_Access is access all Reference_Interface'Class; procedure Write (What : Reference_Interface; Value : Engine_Value) is abstract; function Create (Val : Reference_Interface_Access) return Engine_Value with Post => Create'Result.Class = Reference_Handler; type Iterator_Interface is limited interface; type Iterator_Interface_Access is access all Iterator_Interface'Class; procedure Reset (Iter : in out Iterator_Interface) is abstract; procedure Next (Iter : in out Iterator_Interface) is abstract with Pre'Class => not Iter.End_Of_Iteration; function End_Of_Iteration (Iter : Iterator_Interface) return Boolean is abstract; function Element (Iter : Iterator_Interface) return Handler_Value is abstract with Pre'Class => not Iter.End_Of_Iteration; function Create (Val : Iterator_Interface_Access) return Engine_Value with Post => Create'Result.Class = Iterator; type Function_Interface is interface; type Function_Interface_Access is access all Function_Interface'Class; function Process (Fun : Function_Interface; Parameter : Engine_Value_vectors.Vector) return Engine_Value_Vectors.Vector is abstract; function Signature (Fun : Function_Interface) return Parameter_Signature is abstract with Post'Class => Parameter_Lists.Is_Valid_Parameter_Signature (Signature'Result); function Create (Val : Function_Interface_Access) return Engine_Value with Post => Create'Result.Class = Function_Handler; type Callback_Function_Access is not null access function (Parameters : Engine_Value_vectors.Vector) return Engine_Value_Vectors.Vector; function Create (Val : Callback_Function_Access; Min_Parameters : Natural; Max_Parameters : Natural; With_Varargin : Boolean := False) return Engine_Value with Pre => Max_Parameters >= Min_Parameters, Post => Create'Result.Class = Function_Handler; function Create (Val : Callback_Function_Access; N_Parameters : Natural := 1) return Engine_Value with Post => Create'Result.Class = Function_Handler; function Get_Array (Val : Array_Value) return Array_Interface_Access; function Get_Record (Val : Record_Value) return Record_Interface_Access; function Get_Ambivalent (Val : Ambivalent_Value) return Ambivalent_Interface_Access; function Get_Iterator (Val : Iterator_Value) return Iterator_Interface_Access; function Get_Function (Val : Function_Value) return Function_Interface_Access; function Get_Reference (Val : Reference_Value) return Reference_Interface_Access; function Get_Constant (Val : Constant_Value) return Constant_Interface_Access; function Force_Handler (Item : Engine_Value) return Handler_Value with Pre => Item.Class /= Void and Item.Class /= Iterator; -- Take any Engine_Value (but Void and Iterator) and embed it -- (if necessary) into a Constant handler value. If Item is -- already a handler, just return Item. private type Callback_Based_Handler is new Function_Interface with record Callback : Callback_Function_Access; Min_Parameters : Natural; Max_Parameters : Natural; With_Varargin : Boolean; end record; function Process (Fun : Callback_Based_Handler; Parameter : Engine_Value_vectors.Vector) return Engine_Value_vectors.Vector is (Fun.Callback (Parameter)); function Signature (Fun : Callback_Based_Handler) return Parameter_Signature; -- is (Engine_Value_Array(2..Fun.N_Parameters+1)'(others => Void_Value)); end Protypo.Api.Engine_Values.Handlers;
37.125
106
0.715152
065ac1bcf172833e08787bdc10012fe1d1780c86
4,138
ads
Ada
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-crc32.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-crc32.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-crc32.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- S Y S T E M . C R C 3 2 -- -- -- -- S p e c -- -- -- -- Copyright (C) 2001-2019, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides routines for computing a commonly used checksum -- called CRC-32. This is a checksum based on treating the binary data -- as a polynomial over a binary field, and the exact specifications of -- the CRC-32 algorithm are as follows: -- -- Name : "CRC-32" -- Width : 32 -- Poly : 04C11DB7 -- Init : FFFFFFFF -- RefIn : True -- RefOut : True -- XorOut : FFFFFFFF -- Check : CBF43926 -- -- Note that this is the algorithm used by PKZip, Ethernet and FDDI. -- -- For more information about this algorithm see: -- -- ftp://ftp.rocksoft.com/papers/crc_v3.txt -- "A Painless Guide to CRC Error Detection Algorithms", Ross N. Williams -- -- "Computation of Cyclic Redundancy Checks via Table Look-Up", Communications -- of the ACM, Vol. 31 No. 8, pp.1008-1013 Aug. 1988. Sarwate, D.V. pragma Compiler_Unit_Warning; with Interfaces; package System.CRC32 is type CRC32 is new Interfaces.Unsigned_32; -- Used to represent CRC32 values, which are 32 bit bit-strings procedure Initialize (C : out CRC32); pragma Inline (Initialize); -- Initialize CRC value by assigning the standard Init value (16#FFFF_FFFF) procedure Update (C : in out CRC32; Value : Character); pragma Inline (Update); -- Evolve CRC by including the contribution from Character'Pos (Value) function Get_Value (C : CRC32) return Interfaces.Unsigned_32; pragma Inline (Get_Value); -- Get_Value computes the CRC32 value by performing an XOR with the -- standard XorOut value (16#FFFF_FFFF). Note that this does not -- change the value of C, so it may be used to retrieve intermediate -- values of the CRC32 value during a sequence of Update calls. end System.CRC32;
49.261905
79
0.504833
0bd9a96f8cddb2075e9c640b8a34ec25db7b51fd
2,268
adb
Ada
memsim-master/src/memory-transform-eor.adb
strenkml/EE368
00f15bce9e65badddc613355643b1061fd4a8195
[ "MIT" ]
null
null
null
memsim-master/src/memory-transform-eor.adb
strenkml/EE368
00f15bce9e65badddc613355643b1061fd4a8195
[ "MIT" ]
null
null
null
memsim-master/src/memory-transform-eor.adb
strenkml/EE368
00f15bce9e65badddc613355643b1061fd4a8195
[ "MIT" ]
null
null
null
with Device; with Memory.Container; use Memory.Container; package body Memory.Transform.EOR is function Create_EOR return EOR_Pointer is result : constant EOR_Pointer := new EOR_Type; begin return result; end Create_EOR; function Random_EOR(next : access Memory_Type'Class; generator : Distribution_Type; max_cost : Cost_Type) return Memory_Pointer is result : constant EOR_Pointer := Create_EOR; abits : constant Positive := Device.Get_Address_Bits - 1; rand : constant Positive := Random(generator); bit : constant Long_Integer := Long_Integer(2) ** (rand mod abits); begin Set_Memory(result.all, next); result.value := bit; return Memory_Pointer(result); end Random_EOR; function Clone(mem : EOR_Type) return Memory_Pointer is result : constant EOR_Pointer := new EOR_Type'(mem); begin return Memory_Pointer(result); end Clone; procedure Permute(mem : in out EOR_Type; generator : in Distribution_Type; max_cost : in Cost_Type) is abits : constant Positive := Device.Get_Address_Bits - 1; rand : constant Positive := Random(generator); bit : constant Long_Integer := Long_Integer(2) ** (rand mod abits); begin mem.value := bit; end Permute; function Get_Name(mem : EOR_Type) return String is begin return "eor"; end Get_Name; function Is_Empty(mem : EOR_Type) return Boolean is begin return mem.value = 0; end Is_Empty; function Apply(mem : EOR_Type; address : Address_Type; dir : Boolean) return Address_Type is begin return address xor Address_Type'Mod(mem.value); end Apply; function Get_Alignment(mem : EOR_Type) return Positive is begin for i in 0 .. 16 loop if (Address_Type'Mod(mem.value) and (2 ** i)) /= 0 then return Positive(2 ** i); end if; end loop; return 2 ** 16; end Get_Alignment; function Get_Transform_Length(mem : EOR_Type) return Natural is begin return 1; end Get_Transform_Length; end Memory.Transform.EOR;
30.24
78
0.625661
129c5ef3600c08bf90c3f9f4c764694ba73dcc24
130
adb
Ada
Blob_Lib/assimp-5.2.3/assimp/contrib/zlib/contrib/ada/zlib.adb
antholuo/Blob_Traffic
5d6acf88044e9abc63c0ff356714179eaa4b75bf
[ "MIT" ]
null
null
null
Blob_Lib/assimp-5.2.3/assimp/contrib/zlib/contrib/ada/zlib.adb
antholuo/Blob_Traffic
5d6acf88044e9abc63c0ff356714179eaa4b75bf
[ "MIT" ]
null
null
null
Blob_Lib/assimp-5.2.3/assimp/contrib/zlib/contrib/ada/zlib.adb
antholuo/Blob_Traffic
5d6acf88044e9abc63c0ff356714179eaa4b75bf
[ "MIT" ]
null
null
null
version https://git-lfs.github.com/spec/v1 oid sha256:c9ca5dc34fbcdf06e2dc777b7e9dcd0ba31085b772b440eb0e12421323ab672c size 20400
32.5
75
0.884615
18b2cc5b9b311c85536a15ac1b79ed3e76702507
1,536
ads
Ada
src/ada-core/src/linted-poller.ads
mstewartgallus/linted
4d4cf9390353ea045b95671474ab278456793a35
[ "Apache-2.0" ]
null
null
null
src/ada-core/src/linted-poller.ads
mstewartgallus/linted
4d4cf9390353ea045b95671474ab278456793a35
[ "Apache-2.0" ]
null
null
null
src/ada-core/src/linted-poller.ads
mstewartgallus/linted
4d4cf9390353ea045b95671474ab278456793a35
[ "Apache-2.0" ]
null
null
null
-- Copyright 2016,2017 Steven Stewart-Gallus -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -- implied. See the License for the specific language governing -- permissions and limitations under the License. with Linted.IO_Pool; with Linted.KOs; with Linted.Triggers; package Linted.Poller is subtype Event is Linted.IO_Pool.Poller_Event; subtype Event_Type is Linted.IO_Pool.Poller_Event_Type; subtype Event_Set is Linted.IO_Pool.Poller_Event_Set; Readable : Event_Type renames Linted.IO_Pool.Readable; Writable : Event_Type renames Linted.IO_Pool.Writable; subtype Future is Linted.IO_Pool.Poll_Future; function Future_Is_Live (F : Future) return Boolean renames IO_Pool.Poll_Future_Is_Live; procedure Poll (Object : Linted.KOs.KO; Events : Event_Set; Signaller : Triggers.Signaller; F : out Future) renames IO_Pool.Poll; procedure Poll_Wait (F : in out Future; E : out Event) renames IO_Pool.Poll_Wait; procedure Poll_Poll (F : in out Future; E : out Event; Init : out Boolean) renames IO_Pool.Poll_Poll; end Linted.Poller;
30.72
70
0.72526
50128f6547eb488c93ddcb644ef67f6bbef8b4b9
120
ada
Ada
Task/Solve-the-no-connection-puzzle/Ada/solve-the-no-connection-puzzle-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/Solve-the-no-connection-puzzle/Ada/solve-the-no-connection-puzzle-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/Solve-the-no-connection-puzzle/Ada/solve-the-no-connection-puzzle-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
Pragma Ada_2012; with Connection_Types; use Connection_Types; Function Connection_Combinations return Partial_Board;
17.142857
54
0.858333
fb533fe3820274ddc96a066e1d367fd72e777450
2,041
adb
Ada
Source/improved_trie.adb
bkold/RISC-CPU-Assembler
4a984ed02e516652f60b3e94eed13208a1b88d59
[ "MIT" ]
null
null
null
Source/improved_trie.adb
bkold/RISC-CPU-Assembler
4a984ed02e516652f60b3e94eed13208a1b88d59
[ "MIT" ]
null
null
null
Source/improved_trie.adb
bkold/RISC-CPU-Assembler
4a984ed02e516652f60b3e94eed13208a1b88d59
[ "MIT" ]
null
null
null
package body Improved_Trie is function Find_Move_Immediate_Child (Parent : in out Cursor; Element : Element_Type) return Boolean is Tree_Leaf : Trie.Cursor; begin Tree_Leaf := Trie.First_Child(Parent); while Trie.Has_Element(Tree_Leaf) loop if Trie.Element(Tree_Leaf) = Element then Parent:=Tree_Leaf; return True; else Trie.Next_Sibling(Tree_Leaf); end if; end loop; return False; end Find_Move_Immediate_Child; function Find_Immediate_Child (Parent : Cursor; Element : Element_Type) return Cursor is Tree_Leaf : Cursor; begin Tree_Leaf := First_Child(Parent); while Has_Element(Tree_Leaf) loop if Trie.Element(Tree_Leaf) = Element then return Tree_Leaf; else Next_Sibling(Tree_Leaf); end if; end loop; return No_Element; end Find_Immediate_Child; function Add_String (T : in out Tree; Input : String; Address : Integer) return Boolean is Tree_Leaf : Cursor := T.Root; Test_Element : Element_Type; begin Test_Element.B := -1; --Ada.Text_IO.Put_Line("----"); for I in Input'First..Input'Last loop Test_Element.A := Input(I); --Ada.Text_IO.Put_Line(Character'Image(Test_Element.A)); if Find_Move_Immediate_Child(Tree_Leaf, Test_Element) = False then --Ada.Text_IO.Put_Line("Appending " & Character'Image(Test_Element.A)); Append_Child(T, Tree_Leaf, Test_Element); Tree_Leaf := Last_Child(Tree_Leaf); end if; end loop; Test_Element.A := Input(Input'Last); Test_Element.B := Address; if Element(Tree_Leaf).B > -1 then return False; --Duplicate string end if; Replace_Element(T, Tree_Leaf, Test_Element); return True; end Add_String; function Find_String (T : Tree; Input : String) return Integer is Tree_Leaf : Cursor := T.Root; Test_Element : Element_Type; begin for I in 1..Input'Length loop Test_Element.A := Input(I); if Find_Move_Immediate_Child(Tree_Leaf, Test_Element) = False then return -1; end if; end loop; return Element(Tree_Leaf).B; end Find_String; end Improved_Trie;
27.958904
102
0.717785
fbdbd90dd378696874631f7530d68918e3652399
4,408
adb
Ada
src/ewok-perm.adb
PThierry/ewok-kernel
e9c23cb3fd0afd8378bc27418778e1117d5e16cc
[ "Apache-2.0" ]
null
null
null
src/ewok-perm.adb
PThierry/ewok-kernel
e9c23cb3fd0afd8378bc27418778e1117d5e16cc
[ "Apache-2.0" ]
null
null
null
src/ewok-perm.adb
PThierry/ewok-kernel
e9c23cb3fd0afd8378bc27418778e1117d5e16cc
[ "Apache-2.0" ]
null
null
null
-- -- Copyright 2018 The wookey project team <[email protected]> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- #if CONFIG_KERNEL_DOMAIN with ewok.tasks; #end if; package body ewok.perm with spark_mode => on is function dmashm_is_granted (from : in t_real_task_id; to : in t_real_task_id) return boolean is begin return ewok.perm_auto.com_dmashm_perm (from, to); end dmashm_is_granted; function ipc_is_granted (from : in t_real_task_id; to : in t_real_task_id) return boolean is begin return ewok.perm_auto.com_ipc_perm (from, to); end ipc_is_granted; #if CONFIG_KERNEL_DOMAIN function is_same_domain (from : in t_real_task_id; to : in t_real_task_id) return boolean with spark_mode => off -- implies tasks.get_domain() to be SPARK compatible is begin return ewok.tasks.get_domain (from) = ewok.tasks.get_domain (to); end is_same_domain; #end if; function ressource_is_granted (perm_name : in t_perm_name; task_id : in applications.t_real_task_id) return boolean is begin -- is there some assertion checking that some ressources tuples are -- forbidden case perm_name is when PERM_RES_DEV_DMA => return ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_DMA = 1; when PERM_RES_DEV_CRYPTO_USR => return ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 1 or ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 3; when PERM_RES_DEV_CRYPTO_CFG => return ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 2 or ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 3; when PERM_RES_DEV_CRYPTO_FULL => return ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 3; when PERM_RES_DEV_BUSES => return ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_BUS = 1; when PERM_RES_DEV_EXTI => return ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_EXTI = 1; when PERM_RES_DEV_TIM => return ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_TIM = 1; when PERM_RES_TIM_GETMILLI => return ewok.perm_auto.ressource_perm_register_tab(task_id).TIM_TIME > 0; when PERM_RES_TIM_GETMICRO => return ewok.perm_auto.ressource_perm_register_tab(task_id).TIM_TIME > 1; when PERM_RES_TIM_GETCYCLE => return ewok.perm_auto.ressource_perm_register_tab(task_id).TIM_TIME > 2; when PERM_RES_TSK_FISR => return ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_FISR = 1; when PERM_RES_TSK_FIPC => return ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_FIPC = 1; when PERM_RES_TSK_RESET => return ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_RESET = 1; when PERM_RES_TSK_UPGRADE => return ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_UPGRADE = 1; when PERM_RES_TSK_RNG => return ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_RNG = 1; when PERM_RES_MEM_DYNAMIC_MAP => return ewok.perm_auto.ressource_perm_register_tab(task_id).MEM_DYNAMIC_MAP = 1; end case; end ressource_is_granted; end ewok.perm;
29.783784
87
0.646779
a115f445b203387e10f2afa5bedabf98a6db9d68
7,918
ads
Ada
source/compiler/generated/google-protobuf-compiler-plugin.ads
mgrojo/protobuf
ffc50782c0c5bbb60e8f1504fcfc5a5fbafdb7dd
[ "MIT" ]
12
2020-05-04T09:30:21.000Z
2022-02-08T21:47:32.000Z
source/compiler/generated/google-protobuf-compiler-plugin.ads
mgrojo/protobuf
ffc50782c0c5bbb60e8f1504fcfc5a5fbafdb7dd
[ "MIT" ]
6
2021-03-16T15:17:33.000Z
2022-03-31T21:32:47.000Z
source/compiler/generated/google-protobuf-compiler-plugin.ads
mgrojo/protobuf
ffc50782c0c5bbb60e8f1504fcfc5a5fbafdb7dd
[ "MIT" ]
1
2021-03-16T15:09:27.000Z
2021-03-16T15:09:27.000Z
with Ada.Finalization; with Ada.Streams; with Google.Protobuf.Descriptor; with League.String_Vectors; with PB_Support.Universal_String_Vectors; package Google.Protobuf.Compiler.Plugin is type Code_Generator_Request_Vector is tagged private with Variable_Indexing => Get_Code_Generator_Request_Variable_Reference, Constant_Indexing => Get_Code_Generator_Request_Constant_Reference; type Code_Generator_Response_Vector is tagged private with Variable_Indexing => Get_Code_Generator_Response_Variable_Reference, Constant_Indexing => Get_Code_Generator_Response_Constant_Reference; type File_Vector is tagged private with Variable_Indexing => Get_File_Variable_Reference, Constant_Indexing => Get_File_Constant_Reference; type Code_Generator_Request is record File_To_Generate : League.String_Vectors.Universal_String_Vector; Parameter : PB_Support.Universal_String_Vectors.Option; Proto_File : Google.Protobuf.Descriptor .File_Descriptor_Proto_Vector; end record; type Optional_Code_Generator_Request (Is_Set : Boolean := False) is record case Is_Set is when True => Value : Google.Protobuf.Compiler.Plugin.Code_Generator_Request; when False => null; end case; end record; function Length (Self : Code_Generator_Request_Vector) return Natural; procedure Clear (Self : in out Code_Generator_Request_Vector); procedure Append (Self : in out Code_Generator_Request_Vector; V : Code_Generator_Request); type Code_Generator_Request_Variable_Reference (Element : not null access Code_Generator_Request) is null record with Implicit_Dereference => Element; not overriding function Get_Code_Generator_Request_Variable_Reference (Self : aliased in out Code_Generator_Request_Vector; Index : Positive) return Code_Generator_Request_Variable_Reference with Inline; type Code_Generator_Request_Constant_Reference (Element : not null access constant Code_Generator_Request) is null record with Implicit_Dereference => Element; not overriding function Get_Code_Generator_Request_Constant_Reference (Self : aliased Code_Generator_Request_Vector; Index : Positive) return Code_Generator_Request_Constant_Reference with Inline; type File is record Name : PB_Support.Universal_String_Vectors.Option; Insertion_Point : PB_Support.Universal_String_Vectors.Option; Content : PB_Support.Universal_String_Vectors.Option; end record; type Optional_File (Is_Set : Boolean := False) is record case Is_Set is when True => Value : Google.Protobuf.Compiler.Plugin.File; when False => null; end case; end record; function Length (Self : File_Vector) return Natural; procedure Clear (Self : in out File_Vector); procedure Append (Self : in out File_Vector; V : File); type File_Variable_Reference (Element : not null access File) is null record with Implicit_Dereference => Element; not overriding function Get_File_Variable_Reference (Self : aliased in out File_Vector; Index : Positive) return File_Variable_Reference with Inline; type File_Constant_Reference (Element : not null access constant File) is null record with Implicit_Dereference => Element; not overriding function Get_File_Constant_Reference (Self : aliased File_Vector; Index : Positive) return File_Constant_Reference with Inline; type Code_Generator_Response is record Error : PB_Support.Universal_String_Vectors.Option; File : Google.Protobuf.Compiler.Plugin.File_Vector; end record; type Optional_Code_Generator_Response (Is_Set : Boolean := False) is record case Is_Set is when True => Value : Google.Protobuf.Compiler.Plugin.Code_Generator_Response; when False => null; end case; end record; function Length (Self : Code_Generator_Response_Vector) return Natural; procedure Clear (Self : in out Code_Generator_Response_Vector); procedure Append (Self : in out Code_Generator_Response_Vector; V : Code_Generator_Response); type Code_Generator_Response_Variable_Reference (Element : not null access Code_Generator_Response) is null record with Implicit_Dereference => Element; not overriding function Get_Code_Generator_Response_Variable_Reference (Self : aliased in out Code_Generator_Response_Vector; Index : Positive) return Code_Generator_Response_Variable_Reference with Inline; type Code_Generator_Response_Constant_Reference (Element : not null access constant Code_Generator_Response) is null record with Implicit_Dereference => Element; not overriding function Get_Code_Generator_Response_Constant_Reference (Self : aliased Code_Generator_Response_Vector; Index : Positive) return Code_Generator_Response_Constant_Reference with Inline; private procedure Read_Code_Generator_Request (Stream : access Ada.Streams.Root_Stream_Type'Class; V : out Code_Generator_Request); procedure Write_Code_Generator_Request (Stream : access Ada.Streams.Root_Stream_Type'Class; V : Code_Generator_Request); for Code_Generator_Request'Read use Read_Code_Generator_Request; for Code_Generator_Request'Write use Write_Code_Generator_Request; type Code_Generator_Request_Array is array (Positive range <>) of aliased Code_Generator_Request; type Code_Generator_Request_Array_Access is access Code_Generator_Request_Array; type Code_Generator_Request_Vector is new Ada.Finalization.Controlled with record Data : Code_Generator_Request_Array_Access; Length : Natural := 0; end record; overriding procedure Adjust (Self : in out Code_Generator_Request_Vector); overriding procedure Finalize (Self : in out Code_Generator_Request_Vector); procedure Read_File (Stream : access Ada.Streams.Root_Stream_Type'Class; V : out File); procedure Write_File (Stream : access Ada.Streams.Root_Stream_Type'Class; V : File); for File'Read use Read_File; for File'Write use Write_File; type File_Array is array (Positive range <>) of aliased File; type File_Array_Access is access File_Array; type File_Vector is new Ada.Finalization.Controlled with record Data : File_Array_Access; Length : Natural := 0; end record; overriding procedure Adjust (Self : in out File_Vector); overriding procedure Finalize (Self : in out File_Vector); procedure Read_Code_Generator_Response (Stream : access Ada.Streams.Root_Stream_Type'Class; V : out Code_Generator_Response); procedure Write_Code_Generator_Response (Stream : access Ada.Streams.Root_Stream_Type'Class; V : Code_Generator_Response); for Code_Generator_Response'Read use Read_Code_Generator_Response; for Code_Generator_Response'Write use Write_Code_Generator_Response; type Code_Generator_Response_Array is array (Positive range <>) of aliased Code_Generator_Response; type Code_Generator_Response_Array_Access is access Code_Generator_Response_Array; type Code_Generator_Response_Vector is new Ada.Finalization.Controlled with record Data : Code_Generator_Response_Array_Access; Length : Natural := 0; end record; overriding procedure Adjust (Self : in out Code_Generator_Response_Vector); overriding procedure Finalize (Self : in out Code_Generator_Response_Vector); end Google.Protobuf.Compiler.Plugin;
32.719008
79
0.736044
50f4401389a5bb2376f1e2f32bc61f1051dd7941
837
adb
Ada
gdb/testsuite/gdb.ada/win_fu_syms/foo.adb
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
1
2020-10-14T03:24:35.000Z
2020-10-14T03:24:35.000Z
gdb/testsuite/gdb.ada/win_fu_syms/foo.adb
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
null
null
null
gdb/testsuite/gdb.ada/win_fu_syms/foo.adb
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
null
null
null
-- Copyright 2013-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/>. pragma Initialize_Scalars; with Pck; use Pck; procedure Foo is A : Integer; begin Do_Nothing (A'Address); end Foo;
34.875
73
0.735962
0b7422a80c337b8cf48a0fcfb2a2817a22eddcf4
5,354
adb
Ada
src/endianness.adb
AntonMeep/endianness
0fdb81cde626f68c726eaac5c1211a65e6a06a33
[ "0BSD" ]
null
null
null
src/endianness.adb
AntonMeep/endianness
0fdb81cde626f68c726eaac5c1211a65e6a06a33
[ "0BSD" ]
null
null
null
src/endianness.adb
AntonMeep/endianness
0fdb81cde626f68c726eaac5c1211a65e6a06a33
[ "0BSD" ]
null
null
null
pragma Ada_2012; with Ada.Unchecked_Conversion; with GNAT.Byte_Swapping; with System; use System; package body Endianness is pragma Compile_Time_Error (Stream_Element'Modulus /= 2**8, "'Stream_Element' type must be mod 2**8, i.e. represent a byte"); generic type Source is (<>); function Split_Into_Bytes (Value : Source) return Stream_Element_Array with Global => null, Pre => Source'Size = 8 or else Source'Size = 16 or else Source'Size = 32 or else Source'Size = 64, Post => Split_Into_Bytes'Result'Length = Source'Max_Size_In_Storage_Elements; generic type Target is (<>); function Assemble_From_Bytes (Value : Stream_Element_Array) return Target with Global => null, Pre => (Target'Size = 8 or else Target'Size = 16 or else Target'Size = 32 or else Target'Size = 64) and then Value'Length = Target'Max_Size_In_Storage_Elements; function Swap_Endian (Value : Source) return Source is use GNAT.Byte_Swapping; begin pragma Warnings (Off, "types for unchecked conversion have different sizes", Reason => "We are dynamically choosing different SwappedN implementations," & " there is no way to actually perform a conversion on types with" & " different sizes."); case Source'Max_Size_In_Storage_Elements is when 1 => return Value; when 2 => declare function Swap is new Swapped2 (Source); begin return Swap (Value); end; when 4 => declare function Swap is new Swapped4 (Source); begin return Swap (Value); end; when 8 => declare function Swap is new Swapped8 (Source); begin return Swap (Value); end; when others => raise Constraint_Error with "`Source'Max_Size_In_Storage_Elements` is not" & " 1, 2, 4 or 8 bytes."; end case; pragma Warnings (On, "types for unchecked conversion have different sizes"); end Swap_Endian; function Native_To_Big_Endian (Value : Source) return Stream_Element_Array is function Swap is new Swap_Endian (Source); function Split is new Split_Into_Bytes (Source); begin return Split (if Default_Bit_Order /= High_Order_First then Swap (Value) else Value); end Native_To_Big_Endian; function Native_To_Little_Endian (Value : Source) return Stream_Element_Array is function Swap is new Swap_Endian (Source); function Split is new Split_Into_Bytes (Source); begin return Split (if Default_Bit_Order /= Low_Order_First then Swap (Value) else Value); end Native_To_Little_Endian; function Big_Endian_To_Native (Value : Stream_Element_Array) return Target is function Swap is new Swap_Endian (Target); function Assemble is new Assemble_From_Bytes (Target); begin return (if Default_Bit_Order /= High_Order_First then Swap (Assemble (Value)) else Assemble (Value)); end Big_Endian_To_Native; function Little_Endian_To_Native (Value : Stream_Element_Array) return Target is function Swap is new Swap_Endian (Target); function Assemble is new Assemble_From_Bytes (Target); begin return (if Default_Bit_Order /= Low_Order_First then Swap (Assemble (Value)) else Assemble (Value)); end Little_Endian_To_Native; function Split_Into_Bytes (Value : Source) return Stream_Element_Array is subtype Output_Type is Stream_Element_Array (0 .. Source'Max_Size_In_Storage_Elements - 1); function Convert is new Ada.Unchecked_Conversion (Source, Output_Type); pragma Annotate (GNATprove, Intentional, "types used for unchecked conversion do not have the same size", "We correctly define Output_Type"); pragma Annotate (GNATprove, Intentional, "type is unsuitable as a target for unchecked conversion", "ditto"); begin if Source'Size /= 8 and then Source'Size /= 16 and then Source'Size /= 32 and then Source'Size /= 64 then raise Constraint_Error with "Source'Size must be 8, 16, 32, or 64"; end if; return Convert (Value); end Split_Into_Bytes; function Assemble_From_Bytes (Value : Stream_Element_Array) return Target is pragma Assert (Value'Length = Target'Max_Size_In_Storage_Elements); function Convert is new Ada.Unchecked_Conversion (Stream_Element_Array, Target); pragma Annotate (GNATprove, Intentional, "types used for unchecked conversion do not have the same size", "We're checking it with a pragma"); pragma Annotate (GNATProve, Intentional, "type is unsuitable for unchecked conversion", "ditto"); begin if Target'Size /= 8 and then Target'Size /= 16 and then Target'Size /= 32 and then Target'Size /= 64 then raise Constraint_Error with "Target'Size must be 8, 16, 32, or 64"; end if; return Convert (Value); end Assemble_From_Bytes; end Endianness;
34.320513
79
0.643818
12bde3cb32a1e1ac097fa10294d1514da272cb1c
2,941
ads
Ada
arch/ARM/STM32/driver_demos/demo_dma_mem_to_mem/src/stm32f4_dma_interrupts.ads
shakram02/Ada_Drivers_Library
a407ca7ddbc2d9756647016c2f8fd8ef24a239ff
[ "BSD-3-Clause" ]
192
2016-06-01T18:32:04.000Z
2022-03-26T22:52:31.000Z
arch/ARM/STM32/driver_demos/demo_dma_mem_to_mem/src/stm32f4_dma_interrupts.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
239
2016-05-26T20:02:01.000Z
2022-03-31T09:46:56.000Z
arch/ARM/STM32/driver_demos/demo_dma_mem_to_mem/src/stm32f4_dma_interrupts.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
142
2016-06-05T08:12:20.000Z
2022-03-24T17:37:17.000Z
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with Ada.Interrupts; use Ada.Interrupts; with STM32.DMA; use STM32.DMA; package STM32F4_DMA_Interrupts is protected type Handler (Controller : access DMA_Controller; Stream : DMA_Stream_Selector; IRQ : Interrupt_ID) is pragma Interrupt_Priority; entry Await_Event (Occurrence : out DMA_Interrupt); private Event_Occurred : Boolean := False; Event_Kind : DMA_Interrupt; procedure IRQ_Handler; pragma Attach_Handler (IRQ_Handler, IRQ); end Handler; end STM32F4_DMA_Interrupts;
51.596491
78
0.537572
060a5408d6bc7ec6f0d22d48f2cbef6d5116d368
1,229
ada
Ada
Task/Continued-fraction/Ada/continued-fraction-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/Continued-fraction/Ada/continued-fraction-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/Continued-fraction/Ada/continued-fraction-3.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
with Ada.Text_IO; with Continued_Fraction; procedure Test_Continued_Fractions is type Scalar is digits 15; package Square_Root_Of_2 is function A (N : in Natural) return Natural is (if N = 0 then 1 else 2); function B (N : in Positive) return Natural is (1); function Estimate is new Continued_Fraction (Scalar, A, B); end Square_Root_Of_2; package Napiers_Constant is function A (N : in Natural) return Natural is (if N = 0 then 2 else N); function B (N : in Positive) return Natural is (if N = 1 then 1 else N-1); function Estimate is new Continued_Fraction (Scalar, A, B); end Napiers_Constant; package Pi is function A (N : in Natural) return Natural is (if N = 0 then 3 else 6); function B (N : in Positive) return Natural is ((2 * N - 1) ** 2); function Estimate is new Continued_Fraction (Scalar, A, B); end Pi; package Scalar_Text_IO is new Ada.Text_IO.Float_IO (Scalar); use Ada.Text_IO, Scalar_Text_IO; begin Put (Square_Root_Of_2.Estimate (200), Exp => 0); New_Line; Put (Napiers_Constant.Estimate (200), Exp => 0); New_Line; Put (Pi.Estimate (10000), Exp => 0); New_Line; end Test_Continued_Fractions;
34.138889
80
0.673718
a116ededba7f78a257848b6098489f41714d6f8f
8,649
adb
Ada
src/ada/src/uxas-comms-lmcp_net_client-service.adb
pat-rogers/OpenUxAS
2a58d63435d78203ea659198718a5c6c983a1a83
[ "NASA-1.3" ]
null
null
null
src/ada/src/uxas-comms-lmcp_net_client-service.adb
pat-rogers/OpenUxAS
2a58d63435d78203ea659198718a5c6c983a1a83
[ "NASA-1.3" ]
null
null
null
src/ada/src/uxas-comms-lmcp_net_client-service.adb
pat-rogers/OpenUxAS
2a58d63435d78203ea659198718a5c6c983a1a83
[ "NASA-1.3" ]
null
null
null
with Ada.Containers.Formal_Hashed_Maps; with Ada.Strings.Hash; with Ada.Directories; with DOM.Core.Documents; with DOM.Core.Elements; with Input_Sources.Strings; with DOM.Readers; with Sax.Encodings; with UxAS.Common.String_Constant; package body UxAS.Comms.LMCP_Net_Client.Service is function Hashed_Service_Type_Name (Element : Service_Type_Name) return Ada.Containers.Hash_Type is (Ada.Strings.Hash (Value (Element))); package Creation_Function_To_Service_Names is new Ada.Containers.Formal_Hashed_Maps (Element_Type => Service_Creation_Function_Pointer, Key_Type => Service_Type_Name, Hash => Hashed_Service_Type_Name, Equivalent_Keys => "="); Function_Map_Capacity : constant := 100; -- arbitrary subtype Creation_Function_Map is Creation_Function_To_Service_Names.Map (Function_Map_Capacity, Creation_Function_To_Service_Names.Default_Modulus (Function_Map_Capacity)); -------------------------------- -- Creation_Function_Registry -- -------------------------------- -- static -- std::unordered_map<std::string, ServiceBase::serviceCreationFunctionPointer>& -- createFunctionByServiceType() -- We implement createFunctionByServiceType via this simple decl Creation_Function_Registry : Creation_Function_Map; ------------------------------------------------- -- Register_Service_Creation_Function_Pointers -- ------------------------------------------------- procedure Register_Service_Creation_Function_Pointers (Service_Type_Names : Service_Type_Names_List; Associated_Creator : Service_Creation_Function_Pointer) is use Creation_Function_To_Service_Names; C : Cursor; begin for Name of Service_Type_Names loop C := Find (Creation_Function_Registry, Name); if C = No_Element then Insert (Creation_Function_Registry, Name, Associated_Creator); else -- note that the C++ version issues a warning here Replace_Element (Creation_Function_Registry, C, Associated_Creator); end if; end loop; end Register_Service_Creation_Function_Pointers; ----------------------- -- Construct_Service -- ----------------------- procedure Construct_Service (This : in out Service_Base; Service_Type : String; Work_Directory_Name : String) is begin This.Construct_Client; -- ServiceBase::ServiceBase(const std::string& serviceType, const std::string& workDirectoryName) -- : m_serviceType(serviceType), m_workDirectoryName(workDirectoryName) -- { -- m_serviceId = m_networkId; Copy (Service_Type, This.Service_Type); Copy (Work_Directory_Name, This.Work_Directory_Name); This.Service_Id := UInt32'Mod (This.Network_Id); This.Is_Constructed := True; end Construct_Service; ------------------------- -- Instantiate_Service -- ------------------------- function Instantiate_Service (Type_Name : String) return Any_Service is Result : Any_Service; Target : constant Service_Type_Name := Instance (Service_Type_Name_Max_Length, Type_Name); Creator : Service_Creation_Function_Pointer; use Creation_Function_To_Service_Names; C : Cursor; begin -- static -- std::unique_ptr<ServiceBase> -- instantiateService(const std::string& serviceType) -- { -- auto it = createFunctionByServiceType().find(serviceType); -- ServiceBase * newService(it == createFunctionByServiceType().end() ? nullptr : (it->second)()); -- std::unique_ptr<ServiceBase> service(newService); -- return (service); -- }; C := Find (Creation_Function_Registry, Target); if C = No_Element then return null; end if; Creator := Element (Creation_Function_Registry, C); -- get the creator function Result := Creator.all; -- call the function return Result; end Instantiate_Service; ----------------------- -- Configure_Service -- ----------------------- procedure Configure_Service (This : in out Service_Base; Parent_Of_Work_Directory : String; ServiceXml : String; Result : out Boolean) is use DOM.Core; use DOM.Readers; use Input_Sources.Strings; Input : String_Input; Reader : Tree_Reader; Doc : Document; begin Input_Sources.Strings.Open (ServiceXml, Sax.Encodings.Encoding, Input); Reader.Parse (Input); Close (Input); Doc := Get_Tree (Reader); Configure_Service (This, Parent_Of_Work_Directory, Documents.Get_Element (Doc), This.Is_Configured); Result := This.Is_Configured; end Configure_Service; ----------------------- -- Configure_Service -- ----------------------- procedure Configure_Service (This : in out Service_Base; Parent_Of_Work_Directory : String; Service_Xml_Node : DOM.Core.Element; Result : out Boolean) is function Slash_Appended (S : String) return String with Pre => S'Length > 0, Post => Slash_Appended'Result (Slash_Appended'Result'Last) = '/'; function Slash_Appended (S : String) return String is (if S (S'Last) = '/' then S else S & "/"); begin if This.Work_Directory_Name /= "" then Copy (Slash_Appended (Parent_Of_Work_Directory) & Slash_Appended (Value (This.Work_Directory_Name)), To => This.Work_Directory_Path); else Clear (This.Work_Directory_Path); end if; Configure_Network_Client (This, Subclass_Type_Name => Value (This.Service_Type), Processing_Kind => This.Processing_Type, Network_Client_XML_Node => Service_Xml_Node, Result => Result); if Result then declare Group : constant DOM.Core.DOM_String := DOM.Core.Elements.Get_Attribute (Service_Xml_Node, Name => UxAS.Common.String_Constant.MessageGroup); begin if Group /= "" then -- set source group value that will be assigned to source group field of sent messages Copy (Group, To => This.Message_Source_Group); -- subscribe to messages addressed to non-empty source group value This.Add_Subscription_Address (Group, Success => Result); end if; end; end if; This.Is_Configured := Result; end Configure_Service; ---------------------------------- -- Initialize_And_Start_Service -- ---------------------------------- procedure Initialize_And_Start_Service (This : in out Service_Base; Result : out Boolean) is begin Result := False; if This.Is_Configured then if not Empty (This.Work_Directory_Path) then begin Ada.Directories.Create_Path (Value (This.Work_Directory_Path)); exception -- TODO !!!!! when others => return; end; end if; Initialize_And_Start (This, Result); end if; end Initialize_And_Start_Service; --------------------------- -- Get_Unique_Service_Id -- --------------------------- function Get_Unique_Service_Id return Int64 is Result : Int64; begin Get_Unique_Network_Client_Id (Result); return Result; end Get_Unique_Service_Id; -------------------- -- Get_Service_Id -- -------------------- function Get_Service_Id (This : Service_Base) return UInt32 is (This.Service_Id); ---------------------- -- Get_Service_Type -- ---------------------- function Get_Service_Type (This : Service_Base) return String is (Value (This.Service_Type)); ----------------------------- -- Get_Work_Directory_Name -- ----------------------------- function Get_Work_Directory_Name (This : Service_Base) return String is (Value (This.Work_Directory_Name)); ---------------- -- Configured -- ---------------- function Configured (This : Service_Base) return Boolean is (This.Is_Configured); ----------------- -- Constructed -- ----------------- function Constructed (This : Service_Base) return Boolean is (This.Is_Constructed); end UxAS.Comms.LMCP_Net_Client.Service;
31.915129
153
0.591513
31181cf4ff11e01107bea52d1bd561b103d50c84
2,495
ads
Ada
demo/adainclude/gnat.ads
e3l6/SSMDev
2929757aab3842aefd84debb2d7c3e8b28c2b340
[ "MIT" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
demo/adainclude/gnat.ads
e3l6/SSMDev
2929757aab3842aefd84debb2d7c3e8b28c2b340
[ "MIT" ]
null
null
null
demo/adainclude/gnat.ads
e3l6/SSMDev
2929757aab3842aefd84debb2d7c3e8b28c2b340
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005 AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- 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 is the parent package for a library of useful units provided with GNAT package GNAT is pragma Pure; end GNAT;
65.657895
79
0.305812
50ffa6356898838f7a7f427fc7ca0686d7fa444c
6,042
adb
Ada
tests/src/reference_qoi.adb
joffreyhuguet/qoi-ada
84c1cedee2d9de47933e8c637a2b161594c7ff1e
[ "MIT" ]
7
2022-03-01T18:31:08.000Z
2022-03-14T16:11:16.000Z
tests/src/reference_qoi.adb
joffreyhuguet/qoi-ada
84c1cedee2d9de47933e8c637a2b161594c7ff1e
[ "MIT" ]
null
null
null
tests/src/reference_qoi.adb
joffreyhuguet/qoi-ada
84c1cedee2d9de47933e8c637a2b161594c7ff1e
[ "MIT" ]
1
2021-12-03T16:06:04.000Z
2021-12-03T16:06:04.000Z
with System; use System; with Interfaces.C; use Interfaces.C; with Ada.Text_IO; use Ada.Text_IO; package body Reference_QOI is ------------------ -- Check_Encode -- ------------------ function Check_Encode (Pix : Storage_Array; Desc : QOI.QOI_Desc; Output : Storage_Array) return Boolean is Ref_Output_Ptr : System.Address; R_Desc : aliased Ref_Desc; Ref_Out_Len : aliased Interfaces.C.int; begin R_Desc.Width := unsigned (Desc.Width); R_Desc.height := unsigned (Desc.Height); R_Desc.channels := char'Enum_Val (Desc.Channels); R_Desc.colorspace := char'Enum_Val (Desc.Colorspace'Enum_Rep); Ref_Output_Ptr := Encode (Data => Pix'Address, Desc => R_Desc'Unrestricted_Access, Out_Len => Ref_Out_Len'Access); if Ref_Output_Ptr = System.Null_Address then Put_Line ("Ref QOI failed to encode"); return False; end if; declare Ref_Output : Storage_Array (1 .. Storage_Count (Ref_Out_Len)) with Address => Ref_Output_Ptr; To_Compare : Storage_Count := Storage_Count'Min (Ref_Output'Length, Output'Length); begin if Ref_Output /= Output then if Ref_Output'Length > Output'Length then Put_Line ("Ref QOI output bigger (" & Ref_Output'Length'Img & ")" & " than ours (" & Output'Length'Img & ")"); elsif Ref_Output'Length < Output'Length then Put_Line ("Ref QOI output smaller (" & Ref_Output'Length'Img & ")" & " than ours (" & Output'Length'Img & ")"); end if; for Offset in 0 .. To_Compare - 1 loop declare A : constant Storage_Element := Ref_Output (Ref_Output'First + Offset); B : constant Storage_Element := Output (Output'First + Offset); begin if A /= B then Put_Line ("Byte diff" & Offset'Img & " Ref:" & A'Img & " Act:" & B'Img); return False; end if; end; end loop; return False; end if; end; return True; end Check_Encode; ------------------ -- Check_Decode -- ------------------ function Check_Decode (Data : Storage_Array; Out_Desc : QOI.QOI_Desc; Out_Data : Storage_Array) return Boolean is Ref_Output_Ptr : System.Address; R_Desc : aliased Ref_Desc; begin Ref_Output_Ptr := Decode (Data => Data'Address, Size => Data'Length, Desc => R_Desc'Unchecked_Access, Channels => 0); if Ref_Output_Ptr = System.Null_Address then Put_Line ("Ref QOI failed to decode"); return False; end if; if R_Desc.width /= unsigned (Out_Desc.Width) then Put_Line ("Ref width (" & R_Desc.width'Img & ") diff from ours " & "(" & Out_Desc.Width'Img & ")"); return False; end if; if R_Desc.height /= unsigned (Out_Desc.Height) then Put_Line ("Ref height (" & R_Desc.height'Img & ") diff from ours " & "(" & Out_Desc.Height'Img & ")"); return False; end if; if R_Desc.channels /= char'Enum_Val (Out_Desc.Channels) then Put_Line ("Ref channels (" & R_Desc.channels'Enum_Rep'Img & ") diff from ours " & "(" & Out_Desc.Channels'Img & ")"); return False; end if; if R_Desc.colorspace /= char'Enum_Val (Out_Desc.Colorspace'Enum_Rep) then Put_Line ("Ref colorspace (" & R_Desc.colorspace'Enum_Rep'Img & ") diff from ours " & "(" & Out_Desc.Colorspace'Enum_Rep'Img & ")"); return False; end if; declare Ref_Out_Len : constant Storage_Count := Storage_Count (R_Desc.width * R_Desc.height * R_Desc.channels'Enum_Rep); Ref_Output : Storage_Array (1 .. Storage_Count (Ref_Out_Len)) with Address => Ref_Output_Ptr; To_Compare : Storage_Count := Storage_Count'Min (Ref_Output'Length, Out_Data'Length); begin if Ref_Output /= Out_Data then if Ref_Output'Length > Out_Data'Length then Put_Line ("Ref QOI decode output bigger (" & Ref_Output'Length'Img & ")" & " than ours (" & Out_Data'Length'Img & ")"); elsif Ref_Output'Length < Out_Data'Length then Put_Line ("Ref QOI decode output smaller (" & Ref_Output'Length'Img & ")" & " than ours (" & Out_Data'Length'Img & ")"); end if; for Offset in 0 .. To_Compare - 1 loop declare A : constant Storage_Element := Ref_Output (Ref_Output'First + Offset); B : constant Storage_Element := Out_Data (Out_Data'First + Offset); begin if A /= B then Put_Line ("Byte diff" & Offset'Img & " Ref:" & A'Img & " Act:" & B'Img); return False; end if; end; end loop; return False; end if; end; return True; end Check_Decode; end Reference_QOI;
35.333333
77
0.476332
06b45426332dec6c27aef50bb15f81bb3888527f
449
adb
Ada
Assignment/passworddatabase.adb
vivianjia123/Password-Manager
c61523beb327b5a11be7fbdb04bf0d7569c8a1d6
[ "MIT" ]
null
null
null
Assignment/passworddatabase.adb
vivianjia123/Password-Manager
c61523beb327b5a11be7fbdb04bf0d7569c8a1d6
[ "MIT" ]
null
null
null
Assignment/passworddatabase.adb
vivianjia123/Password-Manager
c61523beb327b5a11be7fbdb04bf0d7569c8a1d6
[ "MIT" ]
null
null
null
package body PasswordDatabase is procedure Init(D : out Database) with SPARK_Mode => Off is begin PW_Ordered_Maps.Clear(D.passwords); end Init; procedure Put(D : in out Database; U : in URL; P : in Password) is begin PW_Ordered_Maps.Include(D.passwords,U,P); end Put; procedure Remove(D : in out Database; U : in URL) is begin PW_Ordered_Maps.Delete(D.passwords,U); end Remove; end PasswordDatabase;
23.631579
69
0.683742
12f9ec4f1803310fcd6602c0f9ff7893b75ab3d1
1,476
ads
Ada
g-dirope.ads
ytomino/gnat4drake
945795d8705ba4024b07a41b7efe0a9513b441c1
[ "MIT" ]
null
null
null
g-dirope.ads
ytomino/gnat4drake
945795d8705ba4024b07a41b7efe0a9513b441c1
[ "MIT" ]
null
null
null
g-dirope.ads
ytomino/gnat4drake
945795d8705ba4024b07a41b7efe0a9513b441c1
[ "MIT" ]
null
null
null
pragma License (Unrestricted); with Ada.Directories; with Ada.Hierarchical_File_Names; package GNAT.Directory_Operations is subtype Dir_Name_Str is String; subtype Dir_Type is Ada.Directories.Search_Type; Directory_Error : exception; -- Basic Directory operations procedure Change_Dir (Dir_Name : Dir_Name_Str) renames Ada.Directories.Set_Directory; procedure Make_Dir (Dir_Name : Dir_Name_Str); procedure Remove_Dir ( Dir_Name : Dir_Name_Str; Recursive : Boolean := False); function Get_Current_Dir return Dir_Name_Str renames Ada.Directories.Current_Directory; -- Pathname Operations subtype Path_Name is String; function Dir_Name (Path : Path_Name) return Dir_Name_Str renames Ada.Hierarchical_File_Names.Containing_Directory; function Base_Name (Path : Path_Name; Suffix : String := "") return String; function File_Extension (Path : Path_Name) return String renames Ada.Hierarchical_File_Names.Extension; type Path_Style is (System_Default); function Format_Pathname ( Path : Path_Name; Style : Path_Style := System_Default) return Path_Name; -- Iterators procedure Open (Dir : in out Dir_Type; Dir_Name : Dir_Name_Str); procedure Close (Dir : in out Dir_Type) renames Ada.Directories.End_Search; procedure Read ( Dir : in out Dir_Type; Str : out String; Last : out Natural); end GNAT.Directory_Operations;
25.016949
67
0.723577
a1e8be2d0f10268ab3b3cb611ec436c5737d0250
6,964
ads
Ada
src/util-encoders.ads
Letractively/ada-util
e4c63b93635dc07c46e95f12ba02d18903b307b3
[ "Apache-2.0" ]
null
null
null
src/util-encoders.ads
Letractively/ada-util
e4c63b93635dc07c46e95f12ba02d18903b307b3
[ "Apache-2.0" ]
null
null
null
src/util-encoders.ads
Letractively/ada-util
e4c63b93635dc07c46e95f12ba02d18903b307b3
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- util-encoders -- Encode/Decode streams and strings from one format to another -- Copyright (C) 2009, 2010, 2011, 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Streams; with Ada.Finalization; with Ada.Strings.Unbounded; with Interfaces; -- The <b>Util.Encoders</b> package defines the <b>Encoder</b> object -- which represents a mechanism to transform a stream from one format into -- another format. package Util.Encoders is pragma Preelaborate; Not_Supported : exception; Encoding_Error : exception; -- Encoder/decoder for Base64 (RFC 4648) BASE_64 : constant String := "base64"; -- Encoder/decoder for Base64 (RFC 4648) using the URL alphabet -- (+ and / are replaced by - and _) BASE_64_URL : constant String := "base64url"; -- Encoder/decoder for Base16 (RFC 4648) BASE_16 : constant String := "base16"; HEX : constant String := "hex"; -- Encoder for SHA1 (RFC 3174) HASH_SHA1 : constant String := "sha1"; -- ------------------------------ -- Encoder context object -- ------------------------------ -- The <b>Encoder</b> provides operations to encode and decode -- strings or stream of data from one format to another. -- The <b>Encoded</b> contains two <b>Transformer</b> -- which either <i>encodes</i> or <i>decodes</i> the stream. type Encoder is tagged limited private; -- Encodes the input string <b>Data</b> using the transformation -- rules provided by the <b>E</b> encoder. -- -- Returns the encoded string. -- -- Raises the <b>Encoding_Error</b> exception if the source string -- cannot be encoded. -- Raises the <b>Not_Supported</b> exception if the encoding is not -- supported. function Encode (E : in Encoder; Data : in String) return String; -- Decodes the input string <b>Data</b> using the transformation -- rules provided by the <b>E</b> encoder. -- -- Returns the encoded string. -- -- Raises the <b>Encoding_Error</b> exception if the source string -- cannot be decoded. -- Raises the <b>Not_Supported</b> exception if the decoding is not -- supported. function Decode (E : in Encoder; Data : in String) return String; -- Create the encoder object for the specified encoding format. function Create (Name : String) return Encoder; -- ------------------------------ -- Stream Transformation interface -- ------------------------------ -- The <b>Transformer</b> interface defines the operation to transform -- a stream from one data format to another. type Transformer is limited interface; type Transformer_Access is access all Transformer'Class; -- Transform the input stream represented by <b>Data</b> into -- the output stream <b>Into</b>. The transformation made by -- the object can be of any nature (Hex encoding, Base64 encoding, -- Hex decoding, Base64 decoding, ...). -- -- If the transformer does not have enough room to write the result, -- it must return in <b>Encoded</b> the index of the last encoded -- position in the <b>Data</b> stream. -- -- The transformer returns in <b>Last</b> the last valid position -- in the output stream <b>Into</b>. -- -- The <b>Encoding_Error</b> exception is raised if the input -- stream cannot be transformed. procedure Transform (E : in Transformer; Data : in Ada.Streams.Stream_Element_Array; Into : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset; Encoded : out Ada.Streams.Stream_Element_Offset) is abstract; procedure Transform (E : in Transformer; Data : in String; Result : out Ada.Strings.Unbounded.Unbounded_String) is null; -- Transform the input string <b>Data</b> using the transformation -- rules provided by the <b>E</b> transformer. -- -- Returns the transformed string. -- -- Raises the <b>Encoding_Error</b> exception if the source string -- cannot be transformed function Transform (E : in Transformer'Class; Data : in String) return String; -- Transform the input string <b>Data</b> using the transformation -- rules provided by the <b>E</b> transformer. -- -- Returns the transformed string. -- -- Raises the <b>Encoding_Error</b> exception if the source string -- cannot be transformed function Transform (E : in Transformer'Class; Data : in Ada.Streams.Stream_Element_Array) return String; -- Encode the value represented by <tt>Val</tt> in the stream array <tt>Into</tt> starting -- at position <tt>Pos</tt> in that array. The value is encoded using LEB128 format, 7-bits -- at a time until all non zero bits are written. The <tt>Last</tt> parameter is updated -- to indicate the position of the last valid byte written in <tt>Into</tt>. procedure Encode_LEB128 (Into : in out Ada.Streams.Stream_Element_Array; Pos : in Ada.Streams.Stream_Element_Offset; Val : in Interfaces.Unsigned_64; Last : out Ada.Streams.Stream_Element_Offset); -- Decode from the byte array <tt>From</tt> the value represented as LEB128 format starting -- at position <tt>Pos</tt> in that array. After decoding, the <tt>Last</tt> index is updated -- to indicate the last position in the byte array. procedure Decode_LEB128 (From : in Ada.Streams.Stream_Element_Array; Pos : in Ada.Streams.Stream_Element_Offset; Val : out Interfaces.Unsigned_64; Last : out Ada.Streams.Stream_Element_Offset); private type Encoder is new Ada.Finalization.Limited_Controlled with record Encode : Transformer_Access := null; Decode : Transformer_Access := null; end record; -- Delete the transformers overriding procedure Finalize (E : in out Encoder); end Util.Encoders;
42.463415
98
0.626221
50060e5b63c1cdc04c0261e1309cb3a2ef151bf7
8,413
ads
Ada
source/amf/mofext/amf-internals-tables-mof_string_data_00.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/mofext/amf-internals-tables-mof_string_data_00.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/mofext/amf-internals-tables-mof_string_data_00.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-2017, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with Matreshka.Internals.Strings; package AMF.Internals.Tables.MOF_String_Data_00 is -- "value" MS_0000 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, others => 16#0000#), others => <>); -- "element" MS_0001 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 7, Length => 7, Value => (16#0065#, 16#006C#, 16#0065#, 16#006D#, 16#0065#, 16#006E#, 16#0074#, others => 16#0000#), others => <>); -- "A_element_tag" MS_0002 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 13, Length => 13, Value => (16#0041#, 16#005F#, 16#0065#, 16#006C#, 16#0065#, 16#006D#, 16#0065#, 16#006E#, 16#0074#, 16#005F#, 16#0074#, 16#0061#, 16#0067#, others => 16#0000#), others => <>); -- "http://www.omg.org/spec/MOF/20110701" MS_0003 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 39, Unused => 36, Length => 36, Value => (16#0068#, 16#0074#, 16#0074#, 16#0070#, 16#003A#, 16#002F#, 16#002F#, 16#0077#, 16#0077#, 16#0077#, 16#002E#, 16#006F#, 16#006D#, 16#0067#, 16#002E#, 16#006F#, 16#0072#, 16#0067#, 16#002F#, 16#0073#, 16#0070#, 16#0065#, 16#0063#, 16#002F#, 16#004D#, 16#004F#, 16#0046#, 16#002F#, 16#0032#, 16#0030#, 16#0031#, 16#0031#, 16#0030#, 16#0037#, 16#0030#, 16#0031#, others => 16#0000#), others => <>); -- "mofext" MS_0004 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#006D#, 16#006F#, 16#0066#, 16#0065#, 16#0078#, 16#0074#, others => 16#0000#), others => <>); -- "Tag" MS_0005 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 3, Length => 3, Value => (16#0054#, 16#0061#, 16#0067#, others => 16#0000#), others => <>); -- "MOF" MS_0006 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 3, Length => 3, Value => (16#004D#, 16#004F#, 16#0046#, others => 16#0000#), others => <>); -- "tagOwner" MS_0007 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 8, Length => 8, Value => (16#0074#, 16#0061#, 16#0067#, 16#004F#, 16#0077#, 16#006E#, 16#0065#, 16#0072#, others => 16#0000#), others => <>); -- "name" MS_0008 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 4, Length => 4, Value => (16#006E#, 16#0061#, 16#006D#, 16#0065#, others => 16#0000#), others => <>); -- "tag" MS_0009 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 3, Length => 3, Value => (16#0074#, 16#0061#, 16#0067#, others => 16#0000#), others => <>); -- "A_ownedTag_tagOwner" MS_000A : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 23, Unused => 19, Length => 19, Value => (16#0041#, 16#005F#, 16#006F#, 16#0077#, 16#006E#, 16#0065#, 16#0064#, 16#0054#, 16#0061#, 16#0067#, 16#005F#, 16#0074#, 16#0061#, 16#0067#, 16#004F#, 16#0077#, 16#006E#, 16#0065#, 16#0072#, others => 16#0000#), others => <>); -- "ownedTag" MS_000B : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 8, Length => 8, Value => (16#006F#, 16#0077#, 16#006E#, 16#0065#, 16#0064#, 16#0054#, 16#0061#, 16#0067#, others => 16#0000#), others => <>); -- "org.omg.xmi.nsPrefix" MS_000C : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 23, Unused => 20, Length => 20, Value => (16#006F#, 16#0072#, 16#0067#, 16#002E#, 16#006F#, 16#006D#, 16#0067#, 16#002E#, 16#0078#, 16#006D#, 16#0069#, 16#002E#, 16#006E#, 16#0073#, 16#0050#, 16#0072#, 16#0065#, 16#0066#, 16#0069#, 16#0078#, others => 16#0000#), others => <>); end AMF.Internals.Tables.MOF_String_Data_00;
38.591743
78
0.435516
127d954ca58cac41816070e42f73571ec052c03b
10,924
ads
Ada
src/lzma-streamflags.ads
stcarrez/ada-lzma
51dbf4028ff8944ebb8a7f702b5dcad182fbe6bb
[ "MIT" ]
4
2015-08-03T16:26:56.000Z
2020-05-15T14:46:52.000Z
src/lzma-streamflags.ads
stcarrez/ada-lzma
51dbf4028ff8944ebb8a7f702b5dcad182fbe6bb
[ "MIT" ]
null
null
null
src/lzma-streamflags.ads
stcarrez/ada-lzma
51dbf4028ff8944ebb8a7f702b5dcad182fbe6bb
[ "MIT" ]
null
null
null
pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with Ada.Streams; with Lzma.Vli; with Lzma.Check; with Lzma.Base; package Lzma.StreamFlags is LZMA_STREAM_HEADER_SIZE : constant := 12; -- /usr/include/lzma/stream_flags.h:27 LZMA_BACKWARD_SIZE_MIN : constant := 4; -- /usr/include/lzma/stream_flags.h:70 -- unsupported macro: LZMA_BACKWARD_SIZE_MAX (LZMA_VLI_C(1) << 34) --* -- * \file lzma/stream_flags.h -- * \brief .xz Stream Header and Stream Footer encoder and decoder -- -- * Author: Lasse Collin -- * -- * This file has been put into the public domain. -- * You can do whatever you want with this file. -- * -- * See ../lzma.h for information about liblzma as a whole. -- --* -- * \brief Size of Stream Header and Stream Footer -- * -- * Stream Header and Stream Footer have the same size and they are not -- * going to change even if a newer version of the .xz file format is -- * developed in future. -- --* -- * \brief Options for encoding/decoding Stream Header and Stream Footer -- --* -- * \brief Stream Flags format version -- * -- * To prevent API and ABI breakages if new features are needed in -- * Stream Header or Stream Footer, a version number is used to -- * indicate which fields in this structure are in use. For now, -- * version must always be zero. With non-zero version, the -- * lzma_stream_header_encode() and lzma_stream_footer_encode() -- * will return LZMA_OPTIONS_ERROR. -- * -- * lzma_stream_header_decode() and lzma_stream_footer_decode() -- * will always set this to the lowest value that supports all the -- * features indicated by the Stream Flags field. The application -- * must check that the version number set by the decoding functions -- * is supported by the application. Otherwise it is possible that -- * the application will decode the Stream incorrectly. -- type lzma_stream_flags is record version : aliased Interfaces.C.unsigned; -- /usr/include/lzma/stream_flags.h:51 backward_size : aliased Lzma.Vli.lzma_vli; -- /usr/include/lzma/stream_flags.h:69 check : aliased Lzma.Check.lzma_check; -- /usr/include/lzma/stream_flags.h:79 reserved_enum1 : aliased Lzma.Base.lzma_reserved_enum_type; -- /usr/include/lzma/stream_flags.h:90 reserved_enum2 : aliased Lzma.Base.lzma_reserved_enum_type; -- /usr/include/lzma/stream_flags.h:91 reserved_enum3 : aliased Lzma.Base.lzma_reserved_enum_type; -- /usr/include/lzma/stream_flags.h:92 reserved_enum4 : aliased Lzma.Base.lzma_reserved_enum_type; -- /usr/include/lzma/stream_flags.h:93 reserved_bool1 : aliased Lzma.Base.lzma_bool; -- /usr/include/lzma/stream_flags.h:94 reserved_bool2 : aliased Lzma.Base.lzma_bool; -- /usr/include/lzma/stream_flags.h:95 reserved_bool3 : aliased Lzma.Base.lzma_bool; -- /usr/include/lzma/stream_flags.h:96 reserved_bool4 : aliased Lzma.Base.lzma_bool; -- /usr/include/lzma/stream_flags.h:97 reserved_bool5 : aliased Lzma.Base.lzma_bool; -- /usr/include/lzma/stream_flags.h:98 reserved_bool6 : aliased Lzma.Base.lzma_bool; -- /usr/include/lzma/stream_flags.h:99 reserved_bool7 : aliased Lzma.Base.lzma_bool; -- /usr/include/lzma/stream_flags.h:100 reserved_bool8 : aliased Lzma.Base.lzma_bool; -- /usr/include/lzma/stream_flags.h:101 reserved_int1 : aliased Interfaces.C.unsigned; -- /usr/include/lzma/stream_flags.h:102 reserved_int2 : aliased Interfaces.C.unsigned; -- /usr/include/lzma/stream_flags.h:103 end record; pragma Convention (C_Pass_By_Copy, lzma_stream_flags); -- /usr/include/lzma/stream_flags.h:105 -- skipped anonymous struct anon_14 --* -- * \brief Backward Size -- * -- * Backward Size must be a multiple of four bytes. In this Stream -- * format version, Backward Size is the size of the Index field. -- * -- * Backward Size isn't actually part of the Stream Flags field, but -- * it is convenient to include in this structure anyway. Backward -- * Size is present only in the Stream Footer. There is no need to -- * initialize backward_size when encoding Stream Header. -- * -- * lzma_stream_header_decode() always sets backward_size to -- * LZMA_VLI_UNKNOWN so that it is convenient to use -- * lzma_stream_flags_compare() when both Stream Header and Stream -- * Footer have been decoded. -- --* -- * \brief Check ID -- * -- * This indicates the type of the integrity check calculated from -- * uncompressed data. -- -- * Reserved space to allow possible future extensions without -- * breaking the ABI. You should not touch these, because the -- * names of these variables may change. -- * -- * (We will never be able to use all of these since Stream Flags -- * is just two bytes plus Backward Size of four bytes. But it's -- * nice to have the proper types when they are needed.) -- --* -- * \brief Encode Stream Header -- * -- * \param options Stream Header options to be encoded. -- * options->backward_size is ignored and doesn't -- * need to be initialized. -- * \param out Beginning of the output buffer of -- * LZMA_STREAM_HEADER_SIZE bytes. -- * -- * \return - LZMA_OK: Encoding was successful. -- * - LZMA_OPTIONS_ERROR: options->version is not supported by -- * this liblzma version. -- * - LZMA_PROG_ERROR: Invalid options. -- function lzma_stream_header_encode (options : access constant lzma_stream_flags; c_out : access Ada.Streams.Stream_Element) return Lzma.Base.lzma_ret; -- /usr/include/lzma/stream_flags.h:122 pragma Import (C, lzma_stream_header_encode, "lzma_stream_header_encode"); --* -- * \brief Encode Stream Footer -- * -- * \param options Stream Footer options to be encoded. -- * \param out Beginning of the output buffer of -- * LZMA_STREAM_HEADER_SIZE bytes. -- * -- * \return - LZMA_OK: Encoding was successful. -- * - LZMA_OPTIONS_ERROR: options->version is not supported by -- * this liblzma version. -- * - LZMA_PROG_ERROR: Invalid options. -- function lzma_stream_footer_encode (options : access constant lzma_stream_flags; c_out : access Ada.Streams.Stream_Element) return Lzma.Base.lzma_ret; -- /usr/include/lzma/stream_flags.h:139 pragma Import (C, lzma_stream_footer_encode, "lzma_stream_footer_encode"); --* -- * \brief Decode Stream Header -- * -- * \param options Target for the decoded Stream Header options. -- * \param in Beginning of the input buffer of -- * LZMA_STREAM_HEADER_SIZE bytes. -- * -- * options->backward_size is always set to LZMA_VLI_UNKNOWN. This is to -- * help comparing Stream Flags from Stream Header and Stream Footer with -- * lzma_stream_flags_compare(). -- * -- * \return - LZMA_OK: Decoding was successful. -- * - LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given -- * buffer cannot be Stream Header. -- * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the header -- * is corrupt. -- * - LZMA_OPTIONS_ERROR: Unsupported options are present -- * in the header. -- * -- * \note When decoding .xz files that contain multiple Streams, it may -- * make sense to print "file format not recognized" only if -- * decoding of the Stream Header of the _first_ Stream gives -- * LZMA_FORMAT_ERROR. If non-first Stream Header gives -- * LZMA_FORMAT_ERROR, the message used for LZMA_DATA_ERROR is -- * probably more appropriate. -- * -- * For example, Stream decoder in liblzma uses LZMA_DATA_ERROR if -- * LZMA_FORMAT_ERROR is returned by lzma_stream_header_decode() -- * when decoding non-first Stream. -- function lzma_stream_header_decode (options : access lzma_stream_flags; c_in : access Ada.Streams.Stream_Element) return Lzma.Base.lzma_ret; -- /usr/include/lzma/stream_flags.h:174 pragma Import (C, lzma_stream_header_decode, "lzma_stream_header_decode"); --* -- * \brief Decode Stream Footer -- * -- * \param options Target for the decoded Stream Header options. -- * \param in Beginning of the input buffer of -- * LZMA_STREAM_HEADER_SIZE bytes. -- * -- * \return - LZMA_OK: Decoding was successful. -- * - LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given -- * buffer cannot be Stream Footer. -- * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the Stream Footer -- * is corrupt. -- * - LZMA_OPTIONS_ERROR: Unsupported options are present -- * in Stream Footer. -- * -- * \note If Stream Header was already decoded successfully, but -- * decoding Stream Footer returns LZMA_FORMAT_ERROR, the -- * application should probably report some other error message -- * than "file format not recognized", since the file more likely -- * is corrupt (possibly truncated). Stream decoder in liblzma -- * uses LZMA_DATA_ERROR in this situation. -- function lzma_stream_footer_decode (options : access lzma_stream_flags; c_in : access Ada.Streams.Stream_Element) return Lzma.Base.lzma_ret; -- /usr/include/lzma/stream_flags.h:201 pragma Import (C, lzma_stream_footer_decode, "lzma_stream_footer_decode"); --* -- * \brief Compare two lzma_stream_flags structures -- * -- * backward_size values are compared only if both are not -- * LZMA_VLI_UNKNOWN. -- * -- * \return - LZMA_OK: Both are equal. If either had backward_size set -- * to LZMA_VLI_UNKNOWN, backward_size values were not -- * compared or validated. -- * - LZMA_DATA_ERROR: The structures differ. -- * - LZMA_OPTIONS_ERROR: version in either structure is greater -- * than the maximum supported version (currently zero). -- * - LZMA_PROG_ERROR: Invalid value, e.g. invalid check or -- * backward_size. -- function lzma_stream_flags_compare (a : access constant lzma_stream_flags; b : access constant lzma_stream_flags) return Lzma.Base.lzma_ret; -- /usr/include/lzma/stream_flags.h:221 pragma Import (C, lzma_stream_flags_compare, "lzma_stream_flags_compare"); end Lzma.StreamFlags;
47.495652
194
0.648847
a13bcf2130b36eb2dbfde04c88076e72c462fb5e
14,745
ads
Ada
sources/glew/opengl-programs.ads
godunko/adagl
5b62d3bac6aa4e11084b4b19171dadbf805e95d6
[ "BSD-3-Clause" ]
6
2018-01-18T16:57:21.000Z
2020-01-19T07:40:12.000Z
sources/glew/opengl-programs.ads
godunko/adagl
5b62d3bac6aa4e11084b4b19171dadbf805e95d6
[ "BSD-3-Clause" ]
null
null
null
sources/glew/opengl-programs.ads
godunko/adagl
5b62d3bac6aa4e11084b4b19171dadbf805e95d6
[ "BSD-3-Clause" ]
1
2018-01-20T16:12:26.000Z
2018-01-20T16:12:26.000Z
------------------------------------------------------------------------------ -- -- -- Ada binding for OpenGL/WebGL -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2018, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with System.Storage_Elements; with League.Strings; private with GLFW, GLEW; with OpenGL.Shaders; package OpenGL.Programs is pragma Preelaborate; type OpenGL_Program is tagged limited private; type OpenGL_Program_Access is access all OpenGL_Program'Class; function Add_Shader_From_Source_Code (Self : in out OpenGL_Program'Class; Shader_Type : OpenGL.Shader_Type; Source : League.Strings.Universal_String) return Boolean; -- Compiles source as a shader of the specified type and adds it to this -- shader program. Returns True if compilation was successful, False -- otherwise. The compilation errors and warnings will be made available -- via Log. procedure Add_Shader_From_Source_Code (Self : in out OpenGL_Program'Class; Shader_Type : OpenGL.Shader_Type; Source : League.Strings.Universal_String); -- Compiles source as a shader of the specified type and adds it to this -- shader program. Raise Program_Error if compilation was not successful. -- The compilation errors and warnings will be made available via Log. function Attribute_Location (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String) return OpenGL.Attribute_Location; -- Returns the location of the attribute Name within this shader program's -- parameter list. Returns -1 if name is not a valid attribute for this -- shader program. function Bind (Self : in out OpenGL_Program'Class) return Boolean; -- Binds this shader program to the active OpenGL_Context and makes it the -- current shader program. Any previously bound shader program is released. -- This is equivalent to calling glUseProgram(). procedure Bind (Self : in out OpenGL_Program'Class); -- Binds this shader program to the active OpenGL_Context and makes it the -- current shader program. Any previously bound shader program is released. -- This is equivalent to calling glUseProgram(). function Create (Self : in out OpenGL_Program'Class) return Boolean; -- Requests the shader program's id to be created immediately. Returns true -- if successful; false otherwise. procedure Disable_Attribute_Array (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location); -- Disables the vertex array at Location in this shader program that was -- enabled by a previous call to Enable_Attribute_Array. procedure Disable_Attribute_Array (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String); -- Disables the vertex array called name in this shader program that was -- enabled by a previous call to Enable_Attribute_Array. procedure Enable_Attribute_Array (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location); -- Enables the vertex array at Location in this shader program so that the -- value set by Set_Attribute_Array on Location will be used by the shader -- program. procedure Enable_Attribute_Array (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String); -- Enables the vertex array called Name in this shader program so that the -- value set by Set_Attribute_Array on Name will be used by the shader -- program. function Is_Linked (Self : OpenGL_Program'Class) return Boolean; -- Returns true if this shader program has been linked; false otherwise. not overriding function Link (Self : in out OpenGL_Program) return Boolean; -- Links together the shaders that were added to this program with -- Add_Shader. Returns True if the link was successful or False otherwise. -- If the link failed, the error messages can be retrieved with Log. procedure Release (Self : OpenGL_Program'Class); -- Releases the active shader program from the current OpenGL_Context. This -- is equivalent to calling glUseProgram(0). procedure Set_Attribute_Buffer (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location; Data_Type : OpenGL.GLenum; Tuple_Size : Positive; Offset : System.Storage_Elements.Storage_Count := 0; Stride : System.Storage_Elements.Storage_Count := 0; Normalized : Boolean := True); -- Sets an array of vertex values on the attribute at Location in this -- shader program, starting at a specific Offset in the currently bound -- vertex buffer. The Stride indicates the number of bytes between -- vertices. A default Stride value of zero indicates that the vertices are -- densely packed in the value array. -- -- The Data_Type indicates the type of elements in the vertex value array, -- usually GL_FLOAT, GL_UNSIGNED_BYTE, etc. The Tuple_Size indicates the -- number of components per vertex: 1, 2, 3, or 4. -- -- The array will become active when Enable_Attribute_Array is called on -- the Location. Otherwise the value specified with Set_Attribute_Value for -- Location will be used. procedure Set_Attribute_Buffer (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Data_Type : OpenGL.GLenum; Tuple_Size : Positive; Offset : System.Storage_Elements.Storage_Count := 0; Stride : System.Storage_Elements.Storage_Count := 0; Normalized : Boolean := True); -- Sets an array of vertex values on the attribute called Name in this -- shader program, starting at a specific Offset in the currently bound -- vertex buffer. The Stride indicates the number of bytes between -- vertices. A default stride value of zero indicates that the vertices are -- densely packed in the value array. -- -- The Data_Type indicates the type of elements in the vertex value array, -- usually GL_FLOAT, GL_UNSIGNED_BYTE, etc. The Tuple_Size indicates the -- number of components per vertex: 1, 2, 3, or 4. -- -- The array will become active when Enable_Attribute_Array is called on -- the Name. Otherwise the value specified with Set_Attribute_Value for -- Name will be used. procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location; Value : OpenGL.GLfloat); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location; Value : OpenGL.GLfloat_Vector_2); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location; Value : OpenGL.GLfloat_Vector_3); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location; Value : OpenGL.GLfloat_Vector_4); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location; Value : OpenGL.GLfloat_Matrix_2x2); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location; Value : OpenGL.GLfloat_Matrix_3x3); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Attribute_Location; Value : OpenGL.GLfloat_Matrix_4x4); -- Sets the attribute at Location in the current context to Value. procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.GLfloat); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.GLfloat_Vector_2); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.GLfloat_Vector_3); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.GLfloat_Vector_4); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.GLfloat_Matrix_2x2); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.GLfloat_Matrix_3x3); procedure Set_Attribute_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.GLfloat_Matrix_4x4); -- Sets the attribute called Name in the current context to Value. procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Uniform_Location; Value : OpenGL.GLint); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Uniform_Location; Value : OpenGL.Glfloat); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Uniform_Location; Value : OpenGL.Glfloat_Vector_2); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Uniform_Location; Value : OpenGL.Glfloat_Vector_3); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Uniform_Location; Value : OpenGL.Glfloat_Vector_4); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Uniform_Location; Value : OpenGL.Glfloat_Matrix_2x2); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Uniform_Location; Value : OpenGL.Glfloat_Matrix_3x3); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Location : OpenGL.Uniform_Location; Value : OpenGL.Glfloat_Matrix_4x4); -- Sets the uniform variable at Location in the current context to Value. procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.Glfloat); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.Glfloat_Vector_2); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.Glfloat_Vector_3); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.Glfloat_Vector_4); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.Glfloat_Matrix_2x2); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.Glfloat_Matrix_3x3); procedure Set_Uniform_Value (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String; Value : OpenGL.Glfloat_Matrix_4x4); -- Sets the uniform variable called Name in the current context to Value. function Uniform_Location (Self : in out OpenGL_Program'Class; Name : League.Strings.Universal_String) return OpenGL.Uniform_Location; -- Returns the location of the uniform variable Name within this shader -- program's parameter list. Returns No_Uniform_Location if Name is not a -- valid uniform variable for this shader program. private type OpenGL_Program is tagged limited record Context : GLFW.GLFWwindow_Access; Program : aliased GLEW.GLuint := 0; end record; end OpenGL.Programs;
46.661392
79
0.653306
312c36bfafb5dfd7c20238c8280aabedea9c9104
7,082
adb
Ada
strings_edit-text_edit.adb
jrcarter/Ada_GUI
65a829c55dec91fd48a0b72f88d76137768bf4fb
[ "BSD-3-Clause" ]
19
2018-03-18T18:07:14.000Z
2022-03-30T03:10:12.000Z
strings_edit-text_edit.adb
jrcarter/Ada_GUI
65a829c55dec91fd48a0b72f88d76137768bf4fb
[ "BSD-3-Clause" ]
4
2021-08-23T12:52:06.000Z
2022-03-31T10:48:43.000Z
strings_edit-text_edit.adb
jrcarter/Ada_GUI
65a829c55dec91fd48a0b72f88d76137768bf4fb
[ "BSD-3-Clause" ]
null
null
null
-- -- -- package Strings_Edit Copyright (c) Dmitry A. Kazakov -- -- Implementation Luebeck -- -- Strings_Edit.Text_Edit Spring, 2000 -- -- -- -- Last revision : 18:40 01 Aug 2019 -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public License as -- -- published by the Free Software Foundation; either version 2 of -- -- the License, or (at your option) any later version. This library -- -- is distributed in the hope that it will be useful, but WITHOUT -- -- ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. You should have -- -- received a copy of the GNU General Public License along with -- -- this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from -- -- this unit, or you link this unit with other files to produce an -- -- executable, this unit does not by itself cause the resulting -- -- executable to be covered by the GNU General Public License. This -- -- exception does not however invalidate any other reasons why the -- -- executable file might be covered by the GNU Public License. -- --____________________________________________________________________-- separate (Strings_Edit) package body Text_Edit is function TrimCharacter ( Source : in String; Blank : in Character := ' ' ) return String is First : Integer := Source'First; Last : Integer := Source'Last; begin while First <= Last and then Source (First) = Blank loop First := First + 1; end loop; while First <= Last and then Source (Last) = Blank loop Last := Last - 1; end loop; return Source (First..Last); end TrimCharacter; function TrimSet ( Source : in String; Blanks : in Ada.Strings.Maps.Character_Set ) return String is First : Integer := Source'First; Last : Integer := Source'Last; begin while ( First <= Last and then Ada.Strings.Maps.Is_In (Source (First), Blanks) ) loop First := First + 1; end loop; while ( First <= Last and then Ada.Strings.Maps.Is_In (Source (Last), Blanks) ) loop Last := Last - 1; end loop; return Source (First..Last); end TrimSet; procedure GetCharacter ( Source : in String; Pointer : in out Integer; Blank : in Character := ' ' ) is begin if ( Pointer < Source'First or else ( Pointer > Source'Last and then Pointer - 1 > Source'Last ) ) then raise Layout_Error; end if; for Index in Pointer..Source'Last loop exit when Source (Index) /= Blank; Pointer := Pointer + 1; end loop; end GetCharacter; procedure GetSet ( Source : in String; Pointer : in out Integer; Blanks : in Ada.Strings.Maps.Character_Set ) is begin if ( Pointer < Source'First or else ( Pointer > Source'Last and then Pointer - 1 > Source'Last ) ) then raise Layout_Error; end if; for Index in Pointer..Source'Last loop exit when not Ada.Strings.Maps.Is_In (Source (Index), Blanks); Pointer := Pointer + 1; end loop; end GetSet; procedure PutString ( Destination : in out String; Pointer : in out Integer; Value : in String; Field : in Natural := 0; Justify : in Alignment := Left; Fill : in Character := ' ' ) is OutField : Natural := Field; begin if OutField = 0 then OutField := Value'Length; end if; if ( Pointer < Destination'First or else Pointer + OutField - 1 > Destination'Last or else OutField < Value'Length ) then raise Layout_Error; end if; if OutField /= 0 then if OutField = Value'Length then Destination (Pointer..Pointer + OutField - 1) := Value; else declare First : Integer; Next : Integer; begin case Justify is when Left => First := Pointer; Next := First + Value'Length; for Position in Next..Pointer + OutField - 1 loop Destination (Position) := Fill; end loop; when Center => First := Pointer + (OutField - Value'Length) / 2; Next := First + Value'Length; for Position in Pointer..First - 1 loop Destination (Position) := Fill; end loop; for Position in Next..Pointer + OutField - 1 loop Destination (Position) := Fill; end loop; when Right => Next := Pointer + OutField; First := Next - Value'Length; for Position in Pointer..First - 1 loop Destination (Position) := Fill; end loop; end case; Destination (First..Next - 1) := Value; end; end if; Pointer := Pointer + OutField; end if; end PutString; procedure PutCharacter ( Destination : in out String; Pointer : in out Integer; Value : in Character; Field : in Natural := 0; Justify : in Alignment := Left; Fill : in Character := ' ' ) is Text : constant String (1..1) := (1 => Value); begin Put (Destination, Pointer, Text, Field, Justify, Fill); end PutCharacter; end Text_Edit;
38.075269
73
0.474725
a18235eafe625c233baca3cfcc8d5f3f60519890
9,085
ads
Ada
source/amf/mof/cmof/amf-visitors-cmof_iterators.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/mof/cmof/amf-visitors-cmof_iterators.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/mof/cmof/amf-visitors-cmof_iterators.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.CMOF.Associations; with AMF.CMOF.Classes; with AMF.CMOF.Comments; with AMF.CMOF.Constraints; with AMF.CMOF.Data_Types; with AMF.CMOF.Element_Imports; with AMF.CMOF.Enumeration_Literals; with AMF.CMOF.Enumerations; with AMF.CMOF.Expressions; with AMF.CMOF.Opaque_Expressions; with AMF.CMOF.Operations; with AMF.CMOF.Package_Imports; with AMF.CMOF.Package_Merges; with AMF.CMOF.Packages; with AMF.CMOF.Parameters; with AMF.CMOF.Primitive_Types; with AMF.CMOF.Properties; with AMF.CMOF.Tags; package AMF.Visitors.CMOF_Iterators is pragma Preelaborate; type CMOF_Iterator is limited interface and AMF.Visitors.Abstract_Iterator; not overriding procedure Visit_Association (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Associations.CMOF_Association_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Class (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Classes.CMOF_Class_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Comment (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Comments.CMOF_Comment_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Constraint (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Constraints.CMOF_Constraint_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Data_Type (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Data_Types.CMOF_Data_Type_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Element_Import (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Element_Imports.CMOF_Element_Import_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Enumeration (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Enumerations.CMOF_Enumeration_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Enumeration_Literal (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Enumeration_Literals.CMOF_Enumeration_Literal_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Expression (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Expressions.CMOF_Expression_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Opaque_Expression (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Opaque_Expressions.CMOF_Opaque_Expression_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Operation (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Operations.CMOF_Operation_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Package (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Packages.CMOF_Package_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Package_Import (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Package_Imports.CMOF_Package_Import_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Package_Merge (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Package_Merges.CMOF_Package_Merge_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Parameter (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Parameters.CMOF_Parameter_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Primitive_Type (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Primitive_Types.CMOF_Primitive_Type_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Property (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Properties.CMOF_Property_Access; Control : in out AMF.Visitors.Traverse_Control) is null; not overriding procedure Visit_Tag (Self : in out CMOF_Iterator; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Element : not null AMF.CMOF.Tags.CMOF_Tag_Access; Control : in out AMF.Visitors.Traverse_Control) is null; end AMF.Visitors.CMOF_Iterators;
50.472222
86
0.612438
06fe51d228842d8d97857bfcc621a037185e6485
4,104
adb
Ada
3-mid/impact/source/2d/collision/shapes/impact-d2-shape-circle.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
20
2015-11-04T09:23:59.000Z
2022-01-14T10:21:42.000Z
3-mid/impact/source/2d/collision/shapes/impact-d2-shape-circle.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
2
2015-11-04T17:05:56.000Z
2015-12-08T03:16:13.000Z
3-mid/impact/source/2d/collision/shapes/impact-d2-shape-circle.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
1
2015-12-07T12:53:52.000Z
2015-12-07T12:53:52.000Z
package body impact.d2.Shape.circle is function to_Circle return b2CircleShape is begin return (m_kind => e_circle, m_radius => 0.0, m_p => (0.0, 0.0)); end to_Circle; overriding function Clone (Self : in b2CircleShape) return Shape.view is begin return new b2CircleShape'(Self); end Clone; overriding function TestPoint (Self : in b2CircleShape; transform : in b2Transform; p : in b2Vec2 ) return Boolean is center : constant b2Vec2 := transform.position + b2Mul (transform.R, Self.m_p); d : constant b2Vec2 := p - center; begin return b2Dot (d, d) <= Self.m_radius * Self.m_radius; end TestPoint; -- Collision Detection in Interactive 3D Environments by Gino van den Bergen -- From Section 3.1.2 -- x = s + a * r -- norm(x) = radius -- overriding function RayCast (Self : in b2CircleShape; output : access collision.b2RayCastOutput; input : in collision.b2RayCastInput; transform : in b2Transform ) return Boolean is use float_math.Functions; position : constant b2Vec2 := transform.position + b2Mul (transform.R, Self.m_p); s : constant b2Vec2 := input.p1 - position; b : constant float32 := b2Dot (s, s) - Self.m_radius * Self.m_radius; -- Solve quadratic equation. r : constant b2Vec2 := input.p2 - input.p1; c : constant float32 := b2Dot (s, r); rr : float32 := b2Dot (r, r); sigma : constant float32 := c * c - rr * b; a : float32; begin if sigma < 0.0 or else rr < b2_epsilon then -- Check for negative discriminant and short segment. return False; end if; a := -(c + SqRt (sigma)); -- Find the point of intersection of the line with the circle. if 0.0 <= a and then a <= input.maxFraction * rr then -- Is the intersection point on the segment? a := a / rr; output.fraction := a; output.normal := s + a * r; Normalize (output.normal); return True; end if; return False; end RayCast; overriding procedure ComputeAABB (Self : in b2CircleShape; aabb : access collision.b2AABB; transform : in b2Transform) is p : b2Vec2 := transform.position + b2Mul (transform.R, Self.m_p); begin aabb.lowerBound := (p.x - Self.m_radius, p.y - Self.m_radius); aabb.upperBound := (p.x + Self.m_radius, p.y + Self.m_radius); end ComputeAABB; overriding procedure ComputeMass (Self : in b2CircleShape; massData : access b2MassData; density : in float32) is Radius_squared : constant float32 := Self.m_radius * Self.m_radius; begin massData.mass := density * b2_pi * Radius_squared; massData.center := Self.m_p; -- inertia about the local origin massData.I := massData.mass * (0.5 * Radius_squared + b2Dot (Self.m_p, Self.m_p)); end ComputeMass; function GetSupport (Self : in b2CircleShape; d : in b2Vec2) return int32 is pragma Unreferenced (d, Self); begin return 0; end GetSupport; function GetSupportVertex (Self : in b2CircleShape; d : in b2Vec2) return b2Vec2 is pragma Unreferenced (d); begin return Self.m_p; end GetSupportVertex; function GetVertexCount (Self : in b2CircleShape ) return int32 is pragma Unreferenced (Self); begin return 1; end GetVertexCount; function GetVertex (Self : in b2CircleShape; index : in int32) return b2Vec2 is use type int32; begin pragma Assert (index = 0); return Self.m_p; end GetVertex; end impact.d2.Shape.circle;
26.649351
111
0.56384
4d989630151157f647d66a052e794bf011bf7bad
15,720
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/g-regist.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/g-regist.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/g-regist.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . R E G I S T R Y -- -- -- -- B o d y -- -- -- -- Copyright (C) 2001-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- 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/>. -- -- -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Interfaces.C; with System; with GNAT.Directory_Operations; package body GNAT.Registry is use System; ------------------------------ -- Binding to the Win32 API -- ------------------------------ subtype LONG is Interfaces.C.long; subtype ULONG is Interfaces.C.unsigned_long; subtype DWORD is ULONG; type PULONG is access all ULONG; subtype PDWORD is PULONG; subtype LPDWORD is PDWORD; subtype Error_Code is LONG; subtype REGSAM is LONG; type PHKEY is access all HKEY; ERROR_SUCCESS : constant Error_Code := 0; REG_SZ : constant := 1; REG_EXPAND_SZ : constant := 2; function RegCloseKey (Key : HKEY) return LONG; pragma Import (Stdcall, RegCloseKey, "RegCloseKey"); function RegCreateKeyEx (Key : HKEY; lpSubKey : Address; Reserved : DWORD; lpClass : Address; dwOptions : DWORD; samDesired : REGSAM; lpSecurityAttributes : Address; phkResult : PHKEY; lpdwDisposition : LPDWORD) return LONG; pragma Import (Stdcall, RegCreateKeyEx, "RegCreateKeyExA"); function RegDeleteKey (Key : HKEY; lpSubKey : Address) return LONG; pragma Import (Stdcall, RegDeleteKey, "RegDeleteKeyA"); function RegDeleteValue (Key : HKEY; lpValueName : Address) return LONG; pragma Import (Stdcall, RegDeleteValue, "RegDeleteValueA"); function RegEnumValue (Key : HKEY; dwIndex : DWORD; lpValueName : Address; lpcbValueName : LPDWORD; lpReserved : LPDWORD; lpType : LPDWORD; lpData : Address; lpcbData : LPDWORD) return LONG; pragma Import (Stdcall, RegEnumValue, "RegEnumValueA"); function RegOpenKeyEx (Key : HKEY; lpSubKey : Address; ulOptions : DWORD; samDesired : REGSAM; phkResult : PHKEY) return LONG; pragma Import (Stdcall, RegOpenKeyEx, "RegOpenKeyExA"); function RegQueryValueEx (Key : HKEY; lpValueName : Address; lpReserved : LPDWORD; lpType : LPDWORD; lpData : Address; lpcbData : LPDWORD) return LONG; pragma Import (Stdcall, RegQueryValueEx, "RegQueryValueExA"); function RegSetValueEx (Key : HKEY; lpValueName : Address; Reserved : DWORD; dwType : DWORD; lpData : Address; cbData : DWORD) return LONG; pragma Import (Stdcall, RegSetValueEx, "RegSetValueExA"); function RegEnumKey (Key : HKEY; dwIndex : DWORD; lpName : Address; cchName : DWORD) return LONG; pragma Import (Stdcall, RegEnumKey, "RegEnumKeyA"); --------------------- -- Local Constants -- --------------------- Max_Key_Size : constant := 1_024; -- Maximum number of characters for a registry key Max_Value_Size : constant := 2_048; -- Maximum number of characters for a key's value ----------------------- -- Local Subprograms -- ----------------------- function To_C_Mode (Mode : Key_Mode) return REGSAM; -- Returns the Win32 mode value for the Key_Mode value procedure Check_Result (Result : LONG; Message : String); -- Checks value Result and raise the exception Registry_Error if it is not -- equal to ERROR_SUCCESS. Message and the error value (Result) is added -- to the exception message. ------------------ -- Check_Result -- ------------------ procedure Check_Result (Result : LONG; Message : String) is use type LONG; begin if Result /= ERROR_SUCCESS then raise Registry_Error with Message & " (" & LONG'Image (Result) & ')'; end if; end Check_Result; --------------- -- Close_Key -- --------------- procedure Close_Key (Key : HKEY) is Result : LONG; begin Result := RegCloseKey (Key); Check_Result (Result, "Close_Key"); end Close_Key; ---------------- -- Create_Key -- ---------------- function Create_Key (From_Key : HKEY; Sub_Key : String; Mode : Key_Mode := Read_Write) return HKEY is use type REGSAM; use type DWORD; REG_OPTION_NON_VOLATILE : constant := 16#0#; C_Sub_Key : constant String := Sub_Key & ASCII.NUL; C_Class : constant String := "" & ASCII.NUL; C_Mode : constant REGSAM := To_C_Mode (Mode); New_Key : aliased HKEY; Result : LONG; Dispos : aliased DWORD; begin Result := RegCreateKeyEx (From_Key, C_Sub_Key (C_Sub_Key'First)'Address, 0, C_Class (C_Class'First)'Address, REG_OPTION_NON_VOLATILE, C_Mode, Null_Address, New_Key'Unchecked_Access, Dispos'Unchecked_Access); Check_Result (Result, "Create_Key " & Sub_Key); return New_Key; end Create_Key; ---------------- -- Delete_Key -- ---------------- procedure Delete_Key (From_Key : HKEY; Sub_Key : String) is C_Sub_Key : constant String := Sub_Key & ASCII.NUL; Result : LONG; begin Result := RegDeleteKey (From_Key, C_Sub_Key (C_Sub_Key'First)'Address); Check_Result (Result, "Delete_Key " & Sub_Key); end Delete_Key; ------------------ -- Delete_Value -- ------------------ procedure Delete_Value (From_Key : HKEY; Sub_Key : String) is C_Sub_Key : constant String := Sub_Key & ASCII.NUL; Result : LONG; begin Result := RegDeleteValue (From_Key, C_Sub_Key (C_Sub_Key'First)'Address); Check_Result (Result, "Delete_Value " & Sub_Key); end Delete_Value; ------------------- -- For_Every_Key -- ------------------- procedure For_Every_Key (From_Key : HKEY; Recursive : Boolean := False) is procedure Recursive_For_Every_Key (From_Key : HKEY; Recursive : Boolean := False; Quit : in out Boolean); ----------------------------- -- Recursive_For_Every_Key -- ----------------------------- procedure Recursive_For_Every_Key (From_Key : HKEY; Recursive : Boolean := False; Quit : in out Boolean) is use type LONG; use type ULONG; Index : ULONG := 0; Result : LONG; Sub_Key : Interfaces.C.char_array (1 .. Max_Key_Size); pragma Warnings (Off, Sub_Key); Size_Sub_Key : aliased ULONG; Sub_Hkey : HKEY; function Current_Name return String; ------------------ -- Current_Name -- ------------------ function Current_Name return String is begin return Interfaces.C.To_Ada (Sub_Key); end Current_Name; -- Start of processing for Recursive_For_Every_Key begin loop Size_Sub_Key := Sub_Key'Length; Result := RegEnumKey (From_Key, Index, Sub_Key (1)'Address, Size_Sub_Key); exit when not (Result = ERROR_SUCCESS); Sub_Hkey := Open_Key (From_Key, Interfaces.C.To_Ada (Sub_Key)); Action (Natural (Index) + 1, Sub_Hkey, Current_Name, Quit); if not Quit and then Recursive then Recursive_For_Every_Key (Sub_Hkey, True, Quit); end if; Close_Key (Sub_Hkey); exit when Quit; Index := Index + 1; end loop; end Recursive_For_Every_Key; -- Local Variables Quit : Boolean := False; -- Start of processing for For_Every_Key begin Recursive_For_Every_Key (From_Key, Recursive, Quit); end For_Every_Key; ------------------------- -- For_Every_Key_Value -- ------------------------- procedure For_Every_Key_Value (From_Key : HKEY; Expand : Boolean := False) is use GNAT.Directory_Operations; use type LONG; use type ULONG; Index : ULONG := 0; Result : LONG; Sub_Key : String (1 .. Max_Key_Size); pragma Warnings (Off, Sub_Key); Value : String (1 .. Max_Value_Size); pragma Warnings (Off, Value); Size_Sub_Key : aliased ULONG; Size_Value : aliased ULONG; Type_Sub_Key : aliased DWORD; Quit : Boolean; begin loop Size_Sub_Key := Sub_Key'Length; Size_Value := Value'Length; Result := RegEnumValue (From_Key, Index, Sub_Key (1)'Address, Size_Sub_Key'Unchecked_Access, null, Type_Sub_Key'Unchecked_Access, Value (1)'Address, Size_Value'Unchecked_Access); exit when not (Result = ERROR_SUCCESS); Quit := False; if Type_Sub_Key = REG_EXPAND_SZ and then Expand then Action (Natural (Index) + 1, Sub_Key (1 .. Integer (Size_Sub_Key)), Directory_Operations.Expand_Path (Value (1 .. Integer (Size_Value) - 1), Directory_Operations.DOS), Quit); elsif Type_Sub_Key = REG_SZ or else Type_Sub_Key = REG_EXPAND_SZ then Action (Natural (Index) + 1, Sub_Key (1 .. Integer (Size_Sub_Key)), Value (1 .. Integer (Size_Value) - 1), Quit); end if; exit when Quit; Index := Index + 1; end loop; end For_Every_Key_Value; ---------------- -- Key_Exists -- ---------------- function Key_Exists (From_Key : HKEY; Sub_Key : String) return Boolean is New_Key : HKEY; begin New_Key := Open_Key (From_Key, Sub_Key); Close_Key (New_Key); -- We have been able to open the key so it exists return True; exception when Registry_Error => -- An error occurred, the key was not found return False; end Key_Exists; -------------- -- Open_Key -- -------------- function Open_Key (From_Key : HKEY; Sub_Key : String; Mode : Key_Mode := Read_Only) return HKEY is use type REGSAM; C_Sub_Key : constant String := Sub_Key & ASCII.NUL; C_Mode : constant REGSAM := To_C_Mode (Mode); New_Key : aliased HKEY; Result : LONG; begin Result := RegOpenKeyEx (From_Key, C_Sub_Key (C_Sub_Key'First)'Address, 0, C_Mode, New_Key'Unchecked_Access); Check_Result (Result, "Open_Key " & Sub_Key); return New_Key; end Open_Key; ----------------- -- Query_Value -- ----------------- function Query_Value (From_Key : HKEY; Sub_Key : String; Expand : Boolean := False) return String is use GNAT.Directory_Operations; use type LONG; use type ULONG; Value : String (1 .. Max_Value_Size); pragma Warnings (Off, Value); Size_Value : aliased ULONG; Type_Value : aliased DWORD; C_Sub_Key : constant String := Sub_Key & ASCII.NUL; Result : LONG; begin Size_Value := Value'Length; Result := RegQueryValueEx (From_Key, C_Sub_Key (C_Sub_Key'First)'Address, null, Type_Value'Unchecked_Access, Value (Value'First)'Address, Size_Value'Unchecked_Access); Check_Result (Result, "Query_Value " & Sub_Key & " key"); if Type_Value = REG_EXPAND_SZ and then Expand then return Directory_Operations.Expand_Path (Value (1 .. Integer (Size_Value - 1)), Directory_Operations.DOS); else return Value (1 .. Integer (Size_Value - 1)); end if; end Query_Value; --------------- -- Set_Value -- --------------- procedure Set_Value (From_Key : HKEY; Sub_Key : String; Value : String; Expand : Boolean := False) is C_Sub_Key : constant String := Sub_Key & ASCII.NUL; C_Value : constant String := Value & ASCII.NUL; Value_Type : DWORD; Result : LONG; begin Value_Type := (if Expand then REG_EXPAND_SZ else REG_SZ); Result := RegSetValueEx (From_Key, C_Sub_Key (C_Sub_Key'First)'Address, 0, Value_Type, C_Value (C_Value'First)'Address, C_Value'Length); Check_Result (Result, "Set_Value " & Sub_Key & " key"); end Set_Value; --------------- -- To_C_Mode -- --------------- function To_C_Mode (Mode : Key_Mode) return REGSAM is use type REGSAM; KEY_READ : constant := 16#20019#; KEY_WRITE : constant := 16#20006#; KEY_WOW64_64KEY : constant := 16#00100#; KEY_WOW64_32KEY : constant := 16#00200#; begin case Mode is when Read_Only => return KEY_READ + KEY_WOW64_32KEY; when Read_Write => return KEY_READ + KEY_WRITE + KEY_WOW64_32KEY; when Read_Only_64 => return KEY_READ + KEY_WOW64_64KEY; when Read_Write_64 => return KEY_READ + KEY_WRITE + KEY_WOW64_64KEY; end case; end To_C_Mode; end GNAT.Registry;
28.375451
79
0.51972
fb4d6bab35a0c5bd6ec5d16edb64b63b203163b0
1,085
adb
Ada
examples/usart_interruptive_echo_issue_dbg/src/avr-interrupts.adb
pvrego/adaino
3b160a9006eddc8f25e8e55afea3df6b3cc6d3ca
[ "MIT" ]
8
2015-05-04T20:26:24.000Z
2021-03-09T02:38:57.000Z
examples/usart_interruptive_echo_issue_dbg/src/avr-interrupts.adb
pvrego/adaino
3b160a9006eddc8f25e8e55afea3df6b3cc6d3ca
[ "MIT" ]
null
null
null
examples/usart_interruptive_echo_issue_dbg/src/avr-interrupts.adb
pvrego/adaino
3b160a9006eddc8f25e8e55afea3df6b3cc6d3ca
[ "MIT" ]
1
2015-08-19T14:21:40.000Z
2015-08-19T14:21:40.000Z
with System.Machine_Code; with AVR.USART; with AVR.TWI; -- ============================================================================= -- Package body AVR.INTERRUPTS -- ============================================================================= package body AVR.INTERRUPTS is procedure Enable is begin System.Machine_Code.Asm ("sei", Volatile => True); end Enable; procedure Disable is begin System.Machine_Code.Asm ("cli", Volatile => True); end Disable; procedure Handle_Interrupt_USART0_RX is begin AVR.USART.Handle_ISR_RXC (AVR.USART.USART0); end Handle_Interrupt_USART0_RX; #if MCU="ATMEGA2560" then procedure Handle_Interrupt_USART2_RX is begin AVR.USART.Handle_ISR_RXC (AVR.USART.USART2); end Handle_Interrupt_USART2_RX; procedure Handle_Interrupt_USART3_RX is begin AVR.USART.Handle_ISR_RXC (AVR.USART.USART3); end Handle_Interrupt_USART3_RX; #end if; procedure Handle_Interrupt_TWI is begin AVR.TWI.Handle_Interrupts; end Handle_Interrupt_TWI; end AVR.INTERRUPTS;
24.659091
80
0.620276
a18b90a3b4ee984a23866c5597a0a3d485f22230
5,557
adb
Ada
source/nodes/program-nodes-case_statements.adb
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/nodes/program-nodes-case_statements.adb
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/nodes/program-nodes-case_statements.adb
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
2
2019-09-14T23:18:50.000Z
2019-10-02T10:11:40.000Z
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Program.Nodes.Case_Statements is function Create (Case_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Selecting_Expression : not null Program.Elements.Expressions .Expression_Access; Is_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Paths : not null Program.Elements.Case_Paths .Case_Path_Vector_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Case_Token_2 : not null Program.Lexical_Elements .Lexical_Element_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Case_Statement is begin return Result : Case_Statement := (Case_Token => Case_Token, Selecting_Expression => Selecting_Expression, Is_Token => Is_Token, Paths => Paths, End_Token => End_Token, Case_Token_2 => Case_Token_2, Semicolon_Token => Semicolon_Token, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Selecting_Expression : not null Program.Elements.Expressions .Expression_Access; Paths : not null Program.Elements.Case_Paths .Case_Path_Vector_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Case_Statement is begin return Result : Implicit_Case_Statement := (Selecting_Expression => Selecting_Expression, Paths => Paths, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Selecting_Expression (Self : Base_Case_Statement) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Selecting_Expression; end Selecting_Expression; overriding function Paths (Self : Base_Case_Statement) return not null Program.Elements.Case_Paths.Case_Path_Vector_Access is begin return Self.Paths; end Paths; overriding function Case_Token (Self : Case_Statement) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Case_Token; end Case_Token; overriding function Is_Token (Self : Case_Statement) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Is_Token; end Is_Token; overriding function End_Token (Self : Case_Statement) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.End_Token; end End_Token; overriding function Case_Token_2 (Self : Case_Statement) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Case_Token_2; end Case_Token_2; overriding function Semicolon_Token (Self : Case_Statement) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Semicolon_Token; end Semicolon_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Case_Statement) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Case_Statement) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Case_Statement) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : aliased in out Base_Case_Statement'Class) is begin Set_Enclosing_Element (Self.Selecting_Expression, Self'Unchecked_Access); for Item in Self.Paths.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; null; end Initialize; overriding function Is_Case_Statement_Element (Self : Base_Case_Statement) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Case_Statement_Element; overriding function Is_Statement_Element (Self : Base_Case_Statement) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Statement_Element; overriding procedure Visit (Self : not null access Base_Case_Statement; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Case_Statement (Self); end Visit; overriding function To_Case_Statement_Text (Self : aliased in out Case_Statement) return Program.Elements.Case_Statements.Case_Statement_Text_Access is begin return Self'Unchecked_Access; end To_Case_Statement_Text; overriding function To_Case_Statement_Text (Self : aliased in out Implicit_Case_Statement) return Program.Elements.Case_Statements.Case_Statement_Text_Access is pragma Unreferenced (Self); begin return null; end To_Case_Statement_Text; end Program.Nodes.Case_Statements;
31.936782
79
0.709376
3141ddbdd2e5e8eb26e4400ef2574a394c1a9061
9,140
ads
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-dgmgop.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-dgmgop.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-dgmgop.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . D I M . G E N E R I C _ M K S -- -- . G E N E R I C _ O T H E R _ P R E F I X E S -- -- -- -- S p e c -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- Package that defines some other prefixes for the MKS base unit system. -- These prefixes have been defined in a child package in order to avoid too -- many constant declarations in System.Dim.Generic_Mks. generic package System.Dim.Generic_Mks.Generic_Other_Prefixes is -- SI prefixes for Meter pragma Warnings (Off); -- Turn off the all the dimension warnings ym : constant Length := 1.0E-24; -- yocto zm : constant Length := 1.0E-21; -- zepto am : constant Length := 1.0E-18; -- atto fm : constant Length := 1.0E-15; -- femto pm : constant Length := 1.0E-12; -- pico nm : constant Length := 1.0E-09; -- nano Gm : constant Length := 1.0E+09; -- giga Tm : constant Length := 1.0E+12; -- tera Pem : constant Length := 1.0E+15; -- peta Em : constant Length := 1.0E+18; -- exa Zem : constant Length := 1.0E+21; -- zetta Yom : constant Length := 1.0E+24; -- yotta -- SI prefixes for Kilogram yg : constant Mass := 1.0E-27; -- yocto zg : constant Mass := 1.0E-24; -- zepto ag : constant Mass := 1.0E-21; -- atto fg : constant Mass := 1.0E-18; -- femto pg : constant Mass := 1.0E-15; -- pico ng : constant Mass := 1.0E-12; -- nano Gg : constant Mass := 1.0E+06; -- giga Tg : constant Mass := 1.0E+09; -- tera Peg : constant Mass := 1.0E+13; -- peta Eg : constant Mass := 1.0E+15; -- exa Zeg : constant Mass := 1.0E+18; -- zetta Yog : constant Mass := 1.0E+21; -- yotta -- SI prefixes for Second ys : constant Time := 1.0E-24; -- yocto zs : constant Time := 1.0E-21; -- zepto as : constant Time := 1.0E-18; -- atto fs : constant Time := 1.0E-15; -- femto ps : constant Time := 1.0E-12; -- pico ns : constant Time := 1.0E-09; -- nano Gs : constant Time := 1.0E+09; -- giga Ts : constant Time := 1.0E+12; -- tera Pes : constant Time := 1.0E+15; -- peta Es : constant Time := 1.0E+18; -- exa Zes : constant Time := 1.0E+21; -- zetta Yos : constant Time := 1.0E+24; -- yotta -- SI prefixes for Ampere yA : constant Electric_Current := 1.0E-24; -- yocto zA : constant Electric_Current := 1.0E-21; -- zepto aA : constant Electric_Current := 1.0E-18; -- atto fA : constant Electric_Current := 1.0E-15; -- femto nA : constant Electric_Current := 1.0E-09; -- nano uA : constant Electric_Current := 1.0E-06; -- micro (u) GA : constant Electric_Current := 1.0E+09; -- giga TA : constant Electric_Current := 1.0E+12; -- tera PeA : constant Electric_Current := 1.0E+15; -- peta EA : constant Electric_Current := 1.0E+18; -- exa ZeA : constant Electric_Current := 1.0E+21; -- zetta YoA : constant Electric_Current := 1.0E+24; -- yotta -- SI prefixes for Kelvin yK : constant Thermodynamic_Temperature := 1.0E-24; -- yocto zK : constant Thermodynamic_Temperature := 1.0E-21; -- zepto aK : constant Thermodynamic_Temperature := 1.0E-18; -- atto fK : constant Thermodynamic_Temperature := 1.0E-15; -- femto pK : constant Thermodynamic_Temperature := 1.0E-12; -- pico nK : constant Thermodynamic_Temperature := 1.0E-09; -- nano uK : constant Thermodynamic_Temperature := 1.0E-06; -- micro (u) mK : constant Thermodynamic_Temperature := 1.0E-03; -- milli cK : constant Thermodynamic_Temperature := 1.0E-02; -- centi dK : constant Thermodynamic_Temperature := 1.0E-01; -- deci daK : constant Thermodynamic_Temperature := 1.0E+01; -- deka hK : constant Thermodynamic_Temperature := 1.0E+02; -- hecto kK : constant Thermodynamic_Temperature := 1.0E+03; -- kilo MeK : constant Thermodynamic_Temperature := 1.0E+06; -- mega GK : constant Thermodynamic_Temperature := 1.0E+09; -- giga TK : constant Thermodynamic_Temperature := 1.0E+12; -- tera PeK : constant Thermodynamic_Temperature := 1.0E+15; -- peta EK : constant Thermodynamic_Temperature := 1.0E+18; -- exa ZeK : constant Thermodynamic_Temperature := 1.0E+21; -- zetta YoK : constant Thermodynamic_Temperature := 1.0E+24; -- yotta -- SI prefixes for Mole ymol : constant Amount_Of_Substance := 1.0E-24; -- yocto zmol : constant Amount_Of_Substance := 1.0E-21; -- zepto amol : constant Amount_Of_Substance := 1.0E-18; -- atto fmol : constant Amount_Of_Substance := 1.0E-15; -- femto pmol : constant Amount_Of_Substance := 1.0E-12; -- pico nmol : constant Amount_Of_Substance := 1.0E-09; -- nano umol : constant Amount_Of_Substance := 1.0E-06; -- micro (u) mmol : constant Amount_Of_Substance := 1.0E-03; -- milli cmol : constant Amount_Of_Substance := 1.0E-02; -- centi dmol : constant Amount_Of_Substance := 1.0E-01; -- deci damol : constant Amount_Of_Substance := 1.0E+01; -- deka hmol : constant Amount_Of_Substance := 1.0E+02; -- hecto kmol : constant Amount_Of_Substance := 1.0E+03; -- kilo Memol : constant Amount_Of_Substance := 1.0E+06; -- mega Gmol : constant Amount_Of_Substance := 1.0E+09; -- giga Tmol : constant Amount_Of_Substance := 1.0E+12; -- tera Pemol : constant Amount_Of_Substance := 1.0E+15; -- peta Emol : constant Amount_Of_Substance := 1.0E+18; -- exa Zemol : constant Amount_Of_Substance := 1.0E+21; -- zetta Yomol : constant Amount_Of_Substance := 1.0E+24; -- yotta -- SI prefixes for Candela ycd : constant Luminous_Intensity := 1.0E-24; -- yocto zcd : constant Luminous_Intensity := 1.0E-21; -- zepto acd : constant Luminous_Intensity := 1.0E-18; -- atto fcd : constant Luminous_Intensity := 1.0E-15; -- femto pcd : constant Luminous_Intensity := 1.0E-12; -- pico ncd : constant Luminous_Intensity := 1.0E-09; -- nano ucd : constant Luminous_Intensity := 1.0E-06; -- micro (u) mcd : constant Luminous_Intensity := 1.0E-03; -- milli ccd : constant Luminous_Intensity := 1.0E-02; -- centi dcd : constant Luminous_Intensity := 1.0E-01; -- deci dacd : constant Luminous_Intensity := 1.0E+01; -- deka hcd : constant Luminous_Intensity := 1.0E+02; -- hecto kcd : constant Luminous_Intensity := 1.0E+03; -- kilo Mecd : constant Luminous_Intensity := 1.0E+06; -- mega Gcd : constant Luminous_Intensity := 1.0E+09; -- giga Tcd : constant Luminous_Intensity := 1.0E+12; -- tera Pecd : constant Luminous_Intensity := 1.0E+15; -- peta Ecd : constant Luminous_Intensity := 1.0E+18; -- exa Zecd : constant Luminous_Intensity := 1.0E+21; -- zetta Yocd : constant Luminous_Intensity := 1.0E+24; -- yotta pragma Warnings (On); end System.Dim.Generic_Mks.Generic_Other_Prefixes;
52.228571
78
0.562691
a10cc07f679173121e69eec07147a0e2b60c2a7c
3,557
adb
Ada
src/asf-components-widgets-gravatars.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
12
2015-01-18T23:02:20.000Z
2022-03-25T15:30:30.000Z
src/asf-components-widgets-gravatars.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
3
2021-01-06T09:44:02.000Z
2022-02-04T20:20:53.000Z
src/asf-components-widgets-gravatars.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
4
2016-04-12T05:29:00.000Z
2022-01-24T23:53:59.000Z
----------------------------------------------------------------------- -- components-widgets-gravatars -- Gravatar Components -- Copyright (C) 2013 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Strings.Transforms; with GNAT.MD5; with ASF.Utils; with ASF.Contexts.Writer; package body ASF.Components.Widgets.Gravatars is IMAGE_ATTRIBUTE_NAMES : Util.Strings.String_Set.Set; -- ------------------------------ -- Given an Email address, return the Gravatar link to the user image. -- (See http://en.gravatar.com/site/implement/hash/ and -- http://en.gravatar.com/site/implement/images/) -- ------------------------------ function Get_Link (Email : in String; Secure : in Boolean := False) return String is E : constant String := Util.Strings.Transforms.To_Lower_Case (Email); C : constant GNAT.MD5.Message_Digest := GNAT.MD5.Digest (E); begin if Secure then return "https://secure.gravatar.com/avatar/" & C; else return "http://www.gravatar.com/avatar/" & C; end if; end Get_Link; -- ------------------------------ -- Render an image with the source link created from an email address to the Gravatars service. -- ------------------------------ overriding procedure Encode_Begin (UI : in UIGravatar; Context : in out ASF.Contexts.Faces.Faces_Context'Class) is Writer : constant Contexts.Writer.Response_Writer_Access := Context.Get_Response_Writer; begin if UI.Is_Rendered (Context) then Writer.Start_Element ("img"); UI.Render_Attributes (Context, IMAGE_ATTRIBUTE_NAMES, Writer); declare Email : constant String := UI.Get_Attribute ("email", Context, ""); Size : Integer := UI.Get_Attribute ("size", Context, 80); Default : constant String := UI.Get_Attribute ("default", Context, "identicon"); Secure : constant Boolean := UI.Get_Attribute ("secure", Context, False); D : constant String := Util.Strings.Image (Size); Alt : constant String := UI.Get_Attribute ("alt", Context, ""); begin if Size <= 0 or Size > 2048 then Size := 80; end if; Writer.Write_Attribute ("width", D); Writer.Write_Attribute ("height", D); if Alt'Length > 0 then Writer.Write_Attribute ("alt", Alt); else Writer.Write_Attribute ("alt", Email); end if; Writer.Write_Attribute ("src", Get_Link (Email, Secure) & "?d=" & Default & "&s=" & D); end; Writer.End_Element ("img"); end if; end Encode_Begin; begin Utils.Set_Text_Attributes (IMAGE_ATTRIBUTE_NAMES); end ASF.Components.Widgets.Gravatars;
42.345238
99
0.581108
1c7e0bfd0aa4f70e727b3446ae68a910ad7fed11
5,415
ads
Ada
arch/ARM/NXP/devices/lpc55s69/nxp-device.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
2
2018-05-16T03:56:39.000Z
2019-07-31T13:53:56.000Z
arch/ARM/NXP/devices/lpc55s69/nxp-device.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
arch/ARM/NXP/devices/lpc55s69/nxp-device.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
with NXP.GPIO; use NXP.GPIO; with NXP_SVD; use NXP_SVD; with NXP_SVD.SYSCON; use NXP_SVD.SYSCON; with NXP_SVD.IOCON; use NXP_SVD.IOCON; with System; package NXP.Device is pragma Elaborate_Body; Unknown_Port : exception; procedure Enable_Clock (This : aliased in out GPIO_Port; Port : Ports); procedure Enable_Clock (Point : GPIO_Point); procedure Enable_Clock (Points : GPIO_Points); procedure Disable_Clock (This : aliased in out GPIO_Port; Port : Ports); procedure Disable_Clock (Point : GPIO_Point); procedure Disable_Clock (Points : GPIO_Points); procedure Reset (This : aliased in out GPIO_Port) with Inline; procedure Reset (Point : GPIO_Point) with Inline; procedure Reset (Points : GPIO_Points) with Inline; function S_NS_Periph (Addr : System.Address) return System.Address with Inline; GPIO : aliased GPIO_Port with Import, Volatile, Address => S_NS_Periph (GPIO_Base); SECGPIO : aliased GPIO_Port with Import, Volatile, Address => S_NS_Periph (SECGPIO_Base); SYSCON : aliased SYSCON_Peripheral with Import, Address => S_NS_Periph (SYSCON_Base); P0_0 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_0); P0_1 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_1); P0_2 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_2); P0_3 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_3); P0_4 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_4); P0_5 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_5); P0_6 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_6); P0_7 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_7); P0_8 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_8); P0_9 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_9); P0_10 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_10); P0_11 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_11); P0_12 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_12); P0_13 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_13); P0_14 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_14); P0_15 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_15); P0_16 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_16); P0_17 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_17); P0_18 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_18); P0_19 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_19); P0_20 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_20); P0_21 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_21); P0_22 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_22); P0_23 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_23); P0_24 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_24); P0_25 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_25); P0_26 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_26); P0_27 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_27); P0_28 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_28); P0_29 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_29); P0_30 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_30); P0_31 : aliased GPIO_Point := (GPIO'Access, Port_0, Pin_31); P1_0 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_0); P1_1 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_1); P1_2 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_2); P1_3 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_3); P1_4 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_4); P1_5 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_5); P1_6 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_6); P1_7 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_7); P1_8 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_8); P1_9 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_9); P1_10 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_10); P1_11 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_11); P1_12 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_12); P1_13 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_13); P1_14 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_14); P1_15 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_15); P1_16 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_16); P1_17 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_17); P1_18 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_18); P1_19 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_19); P1_20 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_20); P1_21 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_21); P1_22 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_22); P1_23 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_23); P1_24 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_24); P1_25 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_25); P1_26 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_26); P1_27 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_27); P1_28 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_28); P1_29 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_29); P1_30 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_30); P1_31 : aliased GPIO_Point := (GPIO'Access, Port_1, Pin_31); GPIO_AF_FC0_USART : constant GPIO_Alternate_Function; private GPIO_AF_FC0_USART : constant GPIO_Alternate_Function := 1; end NXP.Device;
50.607477
92
0.688273
068ae88a0eaf155ebfa37104a257880dcee1b5a4
1,925
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca5004b1.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca5004b1.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca5004b1.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- CA5004B1.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: See CA5004B2M.ADA -- -- SPECIAL INSTRUCTIONS: See CA5004B2M.ADA -- -- TEST FILES: -- CA5004B0.ADA -- => CA5004B1.ADA -- CA5004B2M.ADA -- PWN 05/31/96 Split test into files without duplicate unit names. -- RLB 03/11/99 Split test into files so that units that will be replaced -- and units that won't are not in the same source file. ------------------------------------------------------------------ PACKAGE CA5004B0 IS I : INTEGER := 1; FUNCTION F RETURN BOOLEAN; END CA5004B0; PACKAGE BODY CA5004B0 IS FUNCTION F RETURN BOOLEAN IS BEGIN RETURN TRUE; END F; END CA5004B0;
33.77193
79
0.643117
0652b8899177213fbce1d84814666ed2377b4534
28,157
adb
Ada
clients/ada-server/generated/src/-servers.adb
cliffano/pokeapi-clients
92af296c68c3e94afac52642ae22057faaf071ee
[ "MIT" ]
null
null
null
clients/ada-server/generated/src/-servers.adb
cliffano/pokeapi-clients
92af296c68c3e94afac52642ae22057faaf071ee
[ "MIT" ]
null
null
null
clients/ada-server/generated/src/-servers.adb
cliffano/pokeapi-clients
92af296c68c3e94afac52642ae22057faaf071ee
[ "MIT" ]
null
null
null
-- -- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -- ------------ EDIT NOTE ------------ -- This file was generated with openapi-generator. You can modify it to implement -- the server. After you modify this file, you should add the following line -- to the .openapi-generator-ignore file: -- -- src/-servers.adb -- -- Then, you can drop this edit note comment. -- ------------ EDIT NOTE ------------ package body .Servers is -- overriding procedure Ability_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Ability_List; -- overriding procedure Ability_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Ability_Read; -- overriding procedure Berry_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Berry_List; -- overriding procedure Berry_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Berry_Read; -- overriding procedure Berry_Firmness_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Berry_Firmness_List; -- overriding procedure Berry_Firmness_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Berry_Firmness_Read; -- overriding procedure Berry_Flavor_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Berry_Flavor_List; -- overriding procedure Berry_Flavor_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Berry_Flavor_Read; -- overriding procedure Characteristic_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Characteristic_List; -- overriding procedure Characteristic_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Characteristic_Read; -- overriding procedure Contest_Effect_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Contest_Effect_List; -- overriding procedure Contest_Effect_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Contest_Effect_Read; -- overriding procedure Contest_Type_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Contest_Type_List; -- overriding procedure Contest_Type_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Contest_Type_Read; -- overriding procedure Egg_Group_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Egg_Group_List; -- overriding procedure Egg_Group_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Egg_Group_Read; -- overriding procedure Encounter_Condition_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Encounter_Condition_List; -- overriding procedure Encounter_Condition_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Encounter_Condition_Read; -- overriding procedure Encounter_Condition_Value_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Encounter_Condition_Value_List; -- overriding procedure Encounter_Condition_Value_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Encounter_Condition_Value_Read; -- overriding procedure Encounter_Method_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Encounter_Method_List; -- overriding procedure Encounter_Method_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Encounter_Method_Read; -- overriding procedure Evolution_Chain_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Evolution_Chain_List; -- overriding procedure Evolution_Chain_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Evolution_Chain_Read; -- overriding procedure Evolution_Trigger_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Evolution_Trigger_List; -- overriding procedure Evolution_Trigger_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Evolution_Trigger_Read; -- overriding procedure Gender_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Gender_List; -- overriding procedure Gender_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Gender_Read; -- overriding procedure Generation_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Generation_List; -- overriding procedure Generation_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Generation_Read; -- overriding procedure Growth_Rate_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Growth_Rate_List; -- overriding procedure Growth_Rate_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Growth_Rate_Read; -- overriding procedure Item_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_List; -- overriding procedure Item_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Read; -- overriding procedure Item_Attribute_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Attribute_List; -- overriding procedure Item_Attribute_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Attribute_Read; -- overriding procedure Item_Category_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Category_List; -- overriding procedure Item_Category_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Category_Read; -- overriding procedure Item_Fling_Effect_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Fling_Effect_List; -- overriding procedure Item_Fling_Effect_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Fling_Effect_Read; -- overriding procedure Item_Pocket_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Pocket_List; -- overriding procedure Item_Pocket_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Item_Pocket_Read; -- overriding procedure Language_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Language_List; -- overriding procedure Language_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Language_Read; -- overriding procedure Location_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Location_List; -- overriding procedure Location_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Location_Read; -- overriding procedure Location_Area_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Location_Area_List; -- overriding procedure Location_Area_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Location_Area_Read; -- overriding procedure Machine_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Machine_List; -- overriding procedure Machine_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Machine_Read; -- overriding procedure Move_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_List; -- overriding procedure Move_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Read; -- overriding procedure Move_Ailment_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Ailment_List; -- overriding procedure Move_Ailment_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Ailment_Read; -- overriding procedure Move_Battle_Style_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Battle_Style_List; -- overriding procedure Move_Battle_Style_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Battle_Style_Read; -- overriding procedure Move_Category_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Category_List; -- overriding procedure Move_Category_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Category_Read; -- overriding procedure Move_Damage_Class_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Damage_Class_List; -- overriding procedure Move_Damage_Class_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Damage_Class_Read; -- overriding procedure Move_Learn_Method_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Learn_Method_List; -- overriding procedure Move_Learn_Method_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Learn_Method_Read; -- overriding procedure Move_Target_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Target_List; -- overriding procedure Move_Target_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Move_Target_Read; -- overriding procedure Nature_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Nature_List; -- overriding procedure Nature_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Nature_Read; -- overriding procedure Pal_Park_Area_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pal_Park_Area_List; -- overriding procedure Pal_Park_Area_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pal_Park_Area_Read; -- overriding procedure Pokeathlon_Stat_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokeathlon_Stat_List; -- overriding procedure Pokeathlon_Stat_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokeathlon_Stat_Read; -- overriding procedure Pokedex_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokedex_List; -- overriding procedure Pokedex_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokedex_Read; -- overriding procedure Pokemon_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_List; -- overriding procedure Pokemon_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Read; -- overriding procedure Pokemon_Color_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Color_List; -- overriding procedure Pokemon_Color_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Color_Read; -- overriding procedure Pokemon_Form_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Form_List; -- overriding procedure Pokemon_Form_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Form_Read; -- overriding procedure Pokemon_Habitat_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Habitat_List; -- overriding procedure Pokemon_Habitat_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Habitat_Read; -- overriding procedure Pokemon_Shape_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Shape_List; -- overriding procedure Pokemon_Shape_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Shape_Read; -- overriding procedure Pokemon_Species_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Species_List; -- overriding procedure Pokemon_Species_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Pokemon_Species_Read; -- overriding procedure Region_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Region_List; -- overriding procedure Region_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Region_Read; -- overriding procedure Stat_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Stat_List; -- overriding procedure Stat_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Stat_Read; -- overriding procedure Super_Contest_Effect_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Super_Contest_Effect_List; -- overriding procedure Super_Contest_Effect_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Super_Contest_Effect_Read; -- overriding procedure Type_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Type_List; -- overriding procedure Type_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Type_Read; -- overriding procedure Version_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Version_List; -- overriding procedure Version_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Version_Read; -- overriding procedure Version_Group_List (Server : in out Server_Type; Limit : in Swagger.Nullable_Integer; Offset : in Swagger.Nullable_Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Version_Group_List; -- overriding procedure Version_Group_Read (Server : in out Server_Type; Id : in Integer; Result : out Swagger.UString; Context : in out Swagger.Servers.Context_Type) is begin null; end Version_Group_Read; end .Servers;
25.140179
110
0.644138
121c26f5c68e181581f6c5155fdedff0c6c301dc
3,895
ads
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-pack62.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-pack62.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-pack62.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 6 2 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Handling of packed arrays with Component_Size = 62 package System.Pack_62 is pragma Preelaborate; Bits : constant := 62; type Bits_62 is mod 2 ** Bits; for Bits_62'Size use Bits; -- In all subprograms below, Rev_SSO is set True if the array has the -- non-default scalar storage order. function Get_62 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_62 with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. procedure Set_62 (Arr : System.Address; N : Natural; E : Bits_62; Rev_SSO : Boolean) with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. function GetU_62 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_62 with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. This version -- is used when Arr may represent an unaligned address. procedure SetU_62 (Arr : System.Address; N : Natural; E : Bits_62; Rev_SSO : Boolean) with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. This version -- is used when Arr may represent an unaligned address end System.Pack_62;
49.935897
78
0.474711
06fd99bb52844820b204119af1bbbf58be566f49
2,556
ads
Ada
resources/scripts/brute/bruteforcing.ads
Gagan-8/Amass
1be9458b00595d51ab128b4c5763cc7996f4f74a
[ "Apache-2.0" ]
1
2021-11-02T11:14:09.000Z
2021-11-02T11:14:09.000Z
resources/scripts/brute/bruteforcing.ads
abhijitch/Amass
d72dae51ab5baa6bbb24e8c04e5a964d9f4ac06a
[ "Apache-2.0" ]
null
null
null
resources/scripts/brute/bruteforcing.ads
abhijitch/Amass
d72dae51ab5baa6bbb24e8c04e5a964d9f4ac06a
[ "Apache-2.0" ]
null
null
null
-- Copyright 2017-2021 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. name = "Brute Forcing" type = "brute" probes = {"www", "online", "webserver", "ns", "ns1", "mail", "smtp", "webmail", "shop", "dev", "prod", "test", "vpn", "ftp", "ssh", "secure", "whm", "admin", "webdisk", "mobile", "remote", "server", "cpanel", "cloud", "autodiscover", "api", "m", "blog"} function vertical(ctx, domain) local cfg = config(ctx) if (cfg.mode == "passive") then return end if cfg['brute_forcing'].active then make_names(ctx, domain) end end function resolved(ctx, name, domain, records) local cfg = config(ctx) if (cfg.mode == "passive") then return end local nparts = split(name, ".") local dparts = split(domain, ".") -- Do not process resolved root domain names if (#nparts == #dparts) then return end -- Do not generate names from CNAMEs or names without A/AAAA records if (#records == 0 or (has_cname(records) or not has_addr(records))) then return end local bf = cfg['brute_forcing'] if (bf.active and bf.recursive and (bf['min_for_recursive'] == 0)) then make_names(ctx, name) end end function subdomain(ctx, name, domain, times) local cfg = config(ctx) if (cfg.mode == "passive") then return end local bf = cfg['brute_forcing'] if (bf.active and bf.recursive and (bf['min_for_recursive'] == times)) then make_names(ctx, name) end end function make_names(ctx, base) local wordlist = brute_wordlist(ctx) for i, word in pairs(wordlist) do new_name(ctx, word .. "." .. base) end end function has_cname(records) if (#records == 0) then return false end for _, rec in pairs(records) do if rec.rrtype == 5 then return true end end return false end function has_addr(records) if (#records == 0) then return false end for _, rec in pairs(records) do if (rec.rrtype == 1 or rec.rrtype == 28) then return true end end return false end function split(str, delim) local result = {} local pattern = "[^%" .. delim .. "]+" local matches = find(str, pattern) if (matches == nil or #matches == 0) then return result end for _, match in pairs(matches) do table.insert(result, match) end return result end
23.449541
97
0.596635
502a06b3e0f5e029598a518aac5f8d43ec4461cb
2,654
adb
Ada
src/apsepp-calendar.adb
thierr26/ada-apsepp
6eb87079ea57707db4ee1e2215fa170af66b1913
[ "MIT" ]
null
null
null
src/apsepp-calendar.adb
thierr26/ada-apsepp
6eb87079ea57707db4ee1e2215fa170af66b1913
[ "MIT" ]
null
null
null
src/apsepp-calendar.adb
thierr26/ada-apsepp
6eb87079ea57707db4ee1e2215fa170af66b1913
[ "MIT" ]
null
null
null
-- Copyright (C) 2019 Thierry Rascle <[email protected]> -- MIT license. Please refer to the LICENSE file. with Ada.Calendar.Formatting; package body Apsepp.Calendar is ---------------------------------------------------------------------------- Unknown_Time_Zone_Cached_Avail : Boolean := False; Unknown_Time_Zone_Cached : Boolean; function Unknown_Time_zone return Boolean is begin if not Unknown_Time_Zone_Cached_Avail then declare UTC_Time_Offset_Ret : Time_Offset; pragma Unreferenced (UTC_Time_Offset_Ret); begin UTC_Time_Offset_Ret := UTC_Time_Offset; Unknown_Time_Zone_Cached := False; exception when Unknown_Zone_Error => Unknown_Time_Zone_Cached := True; end; Unknown_Time_Zone_Cached_Avail := True; end if; return Unknown_Time_Zone_Cached; end Unknown_Time_zone; ---------------------------------------------------------------------------- function To_ISO_8601 (Date : Time; Time_Zone : Time_Offset := Default_Time_Offset; Include_Time_Fraction : Boolean := False) return String is use Formatting; Negative_Offset : constant Boolean := Time_Zone < 0; Abs_Offset : constant Time_Offset := (if Negative_Offset then -Time_Zone else Time_Zone); ----------------------------------------------------- function Abs_Offset_Image return String is Img : constant String := Image (Duration (Abs_Offset) * 60); Ret : String (1 .. 6) := (1 => (if Negative_Offset then '-' else '+'), others => <>); begin Ret(2 .. 6) := Img(Img'First .. Img'First + 4); return Ret; end Abs_Offset_Image; ----------------------------------------------------- Img : String := Image (Date, Include_Time_Fraction, Time_Zone) & (if Time_Zone = 0 then "Z" else Abs_Offset_Image); begin Img(11) := 'T'; return Img; end To_ISO_8601; ---------------------------------------------------------------------------- end Apsepp.Calendar;
29.820225
79
0.427656
4dc26e6deee36a2b34c3b96fd7c594e6b451a794
3,420
ads
Ada
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-calari.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-calari.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-calari.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . C A L E N D A R . A R I T H M E T I C -- -- -- -- S p e c -- -- -- -- Copyright (C) 2005-2019, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- This package provides arithmetic operations of time values using days -- and leap seconds. Ada.Calendar.Arithmetic is defined in the Ada 2005 -- RM (9.6.1). package Ada.Calendar.Arithmetic is -- Arithmetic on days: -- Rough estimate on the number of days over the range of Ada time type Day_Count is range -(366 * (1 + Year_Number'Last - Year_Number'First)) .. +(366 * (1 + Year_Number'Last - Year_Number'First)); subtype Leap_Seconds_Count is Integer range -2047 .. 2047; -- Count of leap seconds. Negative leap seconds occur whenever the -- astronomical time is faster than the atomic time or as a result of -- Difference when Left < Right. procedure Difference (Left : Time; Right : Time; Days : out Day_Count; Seconds : out Duration; Leap_Seconds : out Leap_Seconds_Count); -- Returns the difference between Left and Right. Days is the number of -- days of difference, Seconds is the remainder seconds of difference -- excluding leap seconds, and Leap_Seconds is the number of leap seconds. -- If Left < Right, then Seconds <= 0.0, Days <= 0, and Leap_Seconds <= 0, -- otherwise all values are nonnegative. The absolute value of Seconds is -- always less than 86_400.0. For the returned values, if Days = 0, then -- Seconds + Duration (Leap_Seconds) = Calendar."-" (Left, Right) function "+" (Left : Time; Right : Day_Count) return Time; function "+" (Left : Day_Count; Right : Time) return Time; -- Adds a number of days to a time value. Time_Error is raised if the -- result is not representable as a value of type Time. function "-" (Left : Time; Right : Day_Count) return Time; -- Subtracts a number of days from a time value. Time_Error is raised if -- the result is not representable as a value of type Time. function "-" (Left : Time; Right : Time) return Day_Count; -- Subtracts two time values, and returns the number of days between them. -- This is the same value that Difference would return in Days. end Ada.Calendar.Arithmetic;
51.818182
78
0.518129
12f249391b02fd19a38e2a706b61f6e3e0e3dc52
234
ads
Ada
src/rosa/rosa-task_manager.ads
kisom/rover-mk1
5d7495893a7305387508755c0d5f2758660f6bf5
[ "MIT" ]
null
null
null
src/rosa/rosa-task_manager.ads
kisom/rover-mk1
5d7495893a7305387508755c0d5f2758660f6bf5
[ "MIT" ]
null
null
null
src/rosa/rosa-task_manager.ads
kisom/rover-mk1
5d7495893a7305387508755c0d5f2758660f6bf5
[ "MIT" ]
null
null
null
with Interfaces; use Interfaces; eackage ROSA.Task_Manager is type Manager_Type is private; private type Manager_Type is record Task_Count : Unsigned_8; end record; Manager : Manager_Type; end ROSA.Task_Manager;
16.714286
32
0.747863
4dc837055b2299179f0a9eec8479b581022cb140
2,277
adb
Ada
src/aco-utils-ds-generic_collection-sorted.adb
jonashaggstrom/ada-canopen
8e0f32323a0f09b41e8b51ef7123738bbf29f194
[ "Apache-2.0" ]
6
2018-05-12T22:08:04.000Z
2021-07-25T20:55:12.000Z
src/aco-utils-ds-generic_collection-sorted.adb
jonashaggstrom/ada-canopen
8e0f32323a0f09b41e8b51ef7123738bbf29f194
[ "Apache-2.0" ]
null
null
null
src/aco-utils-ds-generic_collection-sorted.adb
jonashaggstrom/ada-canopen
8e0f32323a0f09b41e8b51ef7123738bbf29f194
[ "Apache-2.0" ]
2
2021-06-15T11:56:46.000Z
2021-06-21T13:56:01.000Z
package body ACO.Utils.DS.Generic_Collection.Sorted is overriding procedure Insert (C : in out Sorted_Collection; Item : in Item_Type) is P : Collection renames Collection (C); begin for Index in 1 .. Length (P) loop if not (Item_At (P, Index) < Item) then Insert (P, Item, Index); return; end if; end loop; Append (P, Item); end Insert; overriding procedure Insert (C : in out Sorted_Collection; Item : in Item_Type; Before : in Positive) is P : Collection renames Collection (C); Current : constant Item_Type := Item_At (C, Before); begin if Item < Current or else Current < Item then Insert (C, Item); else Insert (P, Before => Before, Item => Item); end if; end Insert; overriding procedure Append (C : in out Sorted_Collection; Item : in Item_Type) is P : Collection renames Collection (C); begin for Index in 1 .. Length (P) loop if Item < Item_At (P, Index) then Insert (P, Item, Index); return; end if; end loop; Append (P, Item); end Append; overriding procedure Append (C : in out Sorted_Collection; Item : in Item_Type; After : in Positive) is P : Collection renames Collection (C); Current : constant Item_Type := Item_At (C, After); begin if Item < Current or else Current < Item then Append (C, Item); else Append (P, After => After, Item => Item); end if; end Append; overriding procedure Replace (C : in out Sorted_Collection; At_Index : in Positive; Item : in Item_Type) is P : Collection renames Collection (C); Current : constant Item_Type := Item_At (C, At_Index); begin if Item < Current then Remove (C, At_Index); Append (C, Item); elsif Current < Item then Remove (C, At_Index); Insert (C, Item); else Replace (P, Index => At_Index, Item => Item); end if; end Replace; end ACO.Utils.DS.Generic_Collection.Sorted;
24.75
60
0.55336
fb389c19e40442cdc81287fdb416e22780b5991e
809
adb
Ada
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/rdv_wait/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
31
2018-08-01T21:25:24.000Z
2022-02-14T07:52:34.000Z
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/rdv_wait/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
40
2018-12-03T19:48:52.000Z
2021-03-10T06:34:26.000Z
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/rdv_wait/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
20
2018-11-16T21:19:22.000Z
2021-10-18T23:08:24.000Z
-- Copyright 2012-2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pck is procedure Break_Me is begin null; end Break_Me; end Pck;
33.708333
73
0.728059
12dee45d050b5e3f1c1f24ecb604d14791111338
2,637
ads
Ada
awa/src/awa-oauth-filters.ads
fuzzysloth/ada-awa
f9b921eeea29841667a028f2fc4528e4385d247a
[ "Apache-2.0" ]
null
null
null
awa/src/awa-oauth-filters.ads
fuzzysloth/ada-awa
f9b921eeea29841667a028f2fc4528e4385d247a
[ "Apache-2.0" ]
null
null
null
awa/src/awa-oauth-filters.ads
fuzzysloth/ada-awa
f9b921eeea29841667a028f2fc4528e4385d247a
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- awa-oauth-filters -- OAuth filter -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with ASF.Requests; with ASF.Responses; with ASF.Sessions; with ASF.Principals; with ASF.Filters; with ASF.Servlets; with ASF.Security.Filters; with AWA.Users.Principals; with AWA.OAuth.Services; package AWA.OAuth.Filters is -- ------------------------------ -- OAuth Authentication filter -- ------------------------------ -- The <b>Auth_Filter</b> verifies that the access token passed for the OAuth -- operation is valid and it extracts the user to configure the request principal. type Auth_Filter is new ASF.Filters.Filter with private; -- Initialize the filter. overriding procedure Initialize (Filter : in out Auth_Filter; Config : in ASF.Servlets.Filter_Config); -- The Do_Filter method of the Filter is called by the container each time -- a request/response pair is passed through the chain due to a client request -- for a resource at the end of the chain. The Filter_Chain passed in to this -- method allows the Filter to pass on the request and response to the next -- entity in the chain. -- -- Before passing the control to the next filter, initialize the service -- context to give access to the current application, current user and -- manage possible transaction rollbacks. overriding procedure Do_Filter (F : in Auth_Filter; Request : in out ASF.Requests.Request'Class; Response : in out ASF.Responses.Response'Class; Chain : in out ASF.Servlets.Filter_Chain); private use Ada.Strings.Unbounded; type Auth_Filter is new ASF.Filters.Filter with record Realm : AWA.OAuth.Services.Auth_Manager_Access; end record; end AWA.OAuth.Filters;
38.217391
86
0.648464
4d8e0b761e5c0241b3cd8083fc79f9c0eb3ba5aa
2,031
adb
Ada
source/vampire-r3-register_page.adb
ytomino/vampire
2ff6c93af53e55c89cab70fedb63accba83bcd92
[ "OpenSSL", "Unlicense" ]
1
2016-12-19T13:25:14.000Z
2016-12-19T13:25:14.000Z
source/vampire-r3-register_page.adb
ytomino/vampire
2ff6c93af53e55c89cab70fedb63accba83bcd92
[ "OpenSSL", "Unlicense" ]
null
null
null
source/vampire-r3-register_page.adb
ytomino/vampire
2ff6c93af53e55c89cab70fedb63accba83bcd92
[ "OpenSSL", "Unlicense" ]
null
null
null
-- The Village of Vampire by YT, このソースコードはNYSLです with Web.HTML; procedure Vampire.R3.Register_Page ( Output : not null access Ada.Streams.Root_Stream_Type'Class; Form : in Forms.Root_Form_Type'Class; Template : in String; Base_Page : in Forms.Base_Page; Village_Id : in Tabula.Villages.Village_Id := Tabula.Villages.Invalid_Village_Id; New_User_Id : in String; New_User_Password : in String) is procedure Handle ( Output : not null access Ada.Streams.Root_Stream_Type'Class; Tag : in String; Contents : in Web.Producers.Template) is begin if Tag = "action_cgi" then Forms.Write_Attribute_Name (Output, "action"); Forms.Write_Link ( Output, Form, Current_Directory => ".", Resource => Forms.Self); elsif Tag = "action_page" then Forms.Write_Attribute_Name (Output, "action"); Forms.Write_Link ( Output, Form, Current_Directory => ".", Resource => Forms.Self, Parameters => Form.Parameters_To_Base_Page ( Base_Page => Base_Page, Village_Id => Village_Id, User_Id => "", User_Password => "")); elsif Tag = "id" then Forms.Write_In_HTML (Output, Form, New_User_Id); elsif Tag = "parameters" then Web.HTML.Write_Query_In_HTML ( Output, Form.HTML_Version, Form.Parameters_To_Base_Page ( Base_Page => Base_Page, Village_Id => Village_Id, User_Id => "", User_Password => "")); elsif Tag = "value_newid" then Forms.Write_Attribute_Name (Output, "value"); Forms.Write_Attribute_Open (Output); Forms.Write_In_Attribute (Output, Form, New_User_Id); Forms.Write_Attribute_Close (Output); elsif Tag = "value_newpassword" then Forms.Write_Attribute_Name (Output, "value"); Forms.Write_Attribute_Open (Output); Forms.Write_In_Attribute (Output, Form, New_User_Password); Forms.Write_Attribute_Close (Output); else Raise_Unknown_Tag (Tag); end if; end Handle; begin Web.Producers.Produce (Output, Read (Template), Handler => Handle'Access); end Vampire.R3.Register_Page;
30.772727
75
0.705564
23cf7b76e6050f7a8d7593dd26e91f2babb8e840
3,667
adb
Ada
Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb
neverware-mirrors/ncurses
931939e0d2765af13962820e59cb6629df3ee638
[ "X11" ]
269
2015-03-01T21:34:42.000Z
2022-03-30T23:07:18.000Z
Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb
neverware-mirrors/ncurses
931939e0d2765af13962820e59cb6629df3ee638
[ "X11" ]
3
2020-10-09T15:00:37.000Z
2020-10-09T15:05:19.000Z
Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb
neverware-mirrors/ncurses
931939e0d2765af13962820e59cb6629df3ee638
[ "X11" ]
97
2016-04-25T06:22:54.000Z
2022-03-30T23:07:19.000Z
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright 2020 Thomas E. Dickey -- -- Copyright 1999-2011,2014 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: -- $Revision: 1.14 $ -- $Date: 2020/02/02 23:34:34 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is procedure Set_Field_Type (Fld : Field; Typ : Alpha_Field) is function Set_Fld_Type (F : Field := Fld; Arg1 : C_Int) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_alpha"); begin Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width))); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
61.116667
78
0.453232
a15bc7089da448224ca10a3966cfe6f8ca42fe3f
5,097
ads
Ada
source/nodes/program-nodes-private_type_definitions.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/nodes/program-nodes-private_type_definitions.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/nodes/program-nodes-private_type_definitions.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
2
2019-09-14T23:18:50.000Z
2019-10-02T10:11:40.000Z
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Elements.Private_Type_Definitions; with Program.Element_Visitors; package Program.Nodes.Private_Type_Definitions is pragma Preelaborate; type Private_Type_Definition is new Program.Nodes.Node and Program.Elements.Private_Type_Definitions.Private_Type_Definition and Program.Elements.Private_Type_Definitions .Private_Type_Definition_Text with private; function Create (Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access; Tagged_Token : Program.Lexical_Elements.Lexical_Element_Access; Limited_Token : Program.Lexical_Elements.Lexical_Element_Access; Private_Token : not null Program.Lexical_Elements.Lexical_Element_Access) return Private_Type_Definition; type Implicit_Private_Type_Definition is new Program.Nodes.Node and Program.Elements.Private_Type_Definitions.Private_Type_Definition with private; function Create (Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Abstract : Boolean := False; Has_Tagged : Boolean := False; Has_Limited : Boolean := False) return Implicit_Private_Type_Definition with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Private_Type_Definition is abstract new Program.Nodes.Node and Program.Elements.Private_Type_Definitions.Private_Type_Definition with null record; procedure Initialize (Self : aliased in out Base_Private_Type_Definition'Class); overriding procedure Visit (Self : not null access Base_Private_Type_Definition; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Is_Private_Type_Definition_Element (Self : Base_Private_Type_Definition) return Boolean; overriding function Is_Definition_Element (Self : Base_Private_Type_Definition) return Boolean; type Private_Type_Definition is new Base_Private_Type_Definition and Program.Elements.Private_Type_Definitions .Private_Type_Definition_Text with record Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access; Tagged_Token : Program.Lexical_Elements.Lexical_Element_Access; Limited_Token : Program.Lexical_Elements.Lexical_Element_Access; Private_Token : not null Program.Lexical_Elements .Lexical_Element_Access; end record; overriding function To_Private_Type_Definition_Text (Self : aliased in out Private_Type_Definition) return Program.Elements.Private_Type_Definitions .Private_Type_Definition_Text_Access; overriding function Abstract_Token (Self : Private_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Tagged_Token (Self : Private_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Limited_Token (Self : Private_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Private_Token (Self : Private_Type_Definition) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Has_Abstract (Self : Private_Type_Definition) return Boolean; overriding function Has_Tagged (Self : Private_Type_Definition) return Boolean; overriding function Has_Limited (Self : Private_Type_Definition) return Boolean; type Implicit_Private_Type_Definition is new Base_Private_Type_Definition with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; Has_Abstract : Boolean; Has_Tagged : Boolean; Has_Limited : Boolean; end record; overriding function To_Private_Type_Definition_Text (Self : aliased in out Implicit_Private_Type_Definition) return Program.Elements.Private_Type_Definitions .Private_Type_Definition_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Private_Type_Definition) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Private_Type_Definition) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Private_Type_Definition) return Boolean; overriding function Has_Abstract (Self : Implicit_Private_Type_Definition) return Boolean; overriding function Has_Tagged (Self : Implicit_Private_Type_Definition) return Boolean; overriding function Has_Limited (Self : Implicit_Private_Type_Definition) return Boolean; end Program.Nodes.Private_Type_Definitions;
33.532895
79
0.744752
06b1c763100a25a15578de10d4b8f4d345f59619
389
ads
Ada
specs/ada/common/tkmrpc-request-ike-isa_auth-convert.ads
DrenfongWong/tkm-rpc
075d22871cf81d497aac656c7f03a513278b641c
[ "BSD-3-Clause" ]
null
null
null
specs/ada/common/tkmrpc-request-ike-isa_auth-convert.ads
DrenfongWong/tkm-rpc
075d22871cf81d497aac656c7f03a513278b641c
[ "BSD-3-Clause" ]
null
null
null
specs/ada/common/tkmrpc-request-ike-isa_auth-convert.ads
DrenfongWong/tkm-rpc
075d22871cf81d497aac656c7f03a513278b641c
[ "BSD-3-Clause" ]
null
null
null
with Ada.Unchecked_Conversion; package Tkmrpc.Request.Ike.Isa_Auth.Convert is function To_Request is new Ada.Unchecked_Conversion ( Source => Isa_Auth.Request_Type, Target => Request.Data_Type); function From_Request is new Ada.Unchecked_Conversion ( Source => Request.Data_Type, Target => Isa_Auth.Request_Type); end Tkmrpc.Request.Ike.Isa_Auth.Convert;
27.785714
58
0.748072
50c61d50318409f4922882edc1e574882276dc3d
436
ads
Ada
courses/fundamentals_of_ada/labs/prompts/135_visibility/types.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
15
2020-10-07T08:56:45.000Z
2022-02-08T23:13:22.000Z
courses/fundamentals_of_ada/labs/prompts/135_visibility/types.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
20
2020-11-05T14:35:20.000Z
2022-01-13T15:59:33.000Z
courses/fundamentals_of_ada/labs/prompts/135_visibility/types.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
6
2020-10-08T15:57:06.000Z
2021-08-31T12:03:08.000Z
--Types package Types is pragma Elaborate_Body; type Miles_T is digits 6; -- Create types for at least two distance measurements (feet, meters, etc) type Hours_T is digits 6; -- Create types for at least two time measurements (seconds, minutes, etc) -- Create "/" operator functions to divide distance by time to return MPH_T -- Create helper functions to convert distance to miles and time to hours end Types;
29.066667
78
0.729358
1076da4dfffe1664505ba8487126d172351dc0b8
833
adb
Ada
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/io_test.adb
LaudateCorpus1/rose-1
5fe906d2a01253130c5de465aded6a917a8476a0
[ "BSD-3-Clause" ]
488
2015-01-09T08:54:48.000Z
2022-03-30T07:15:46.000Z
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/io_test.adb
LaudateCorpus1/rose-1
5fe906d2a01253130c5de465aded6a917a8476a0
[ "BSD-3-Clause" ]
174
2015-01-28T18:41:32.000Z
2022-03-31T16:51:05.000Z
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/io_test.adb
LaudateCorpus1/rose-1
5fe906d2a01253130c5de465aded6a917a8476a0
[ "BSD-3-Clause" ]
146
2015-04-27T02:48:34.000Z
2022-03-04T07:32:53.000Z
----------------------------------------------------------- -- This program asks the user to enter a character, -- preferably a 'c' or a 't'. The resultant behavior -- (conditional or timed) depends on the character entered -- and the time it is entered. -- Taken from http://www.cs.uni.edu//~mccormic/AdaEssentials/select_statement.htm ----------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; procedure IO_Test is Ch : Character; begin -- Caller executable part Put_Line("Enter c or t (Conditional or Timed)"); Get(Ch); if Ch = 'c' then -- Conditional Entry Call null; elsif Ch = 't' then -- Timed Entry Call Put_Line("Timed call withdrawn"); else Put_Line("Invalid Input"); end if; end IO_Test;
32.038462
81
0.541417
fb784c95775cfdea59c10f09ace1c936164fccf1
3,769
adb
Ada
src/common/keccak-generic_parallel_xof.adb
damaki/libkeccak
d06217e525f7927380690d6c37b485bdbe8aa96e
[ "BSD-3-Clause" ]
26
2015-09-20T17:52:38.000Z
2021-07-29T21:47:04.000Z
src/common/keccak-generic_parallel_xof.adb
damaki/libkeccak
d06217e525f7927380690d6c37b485bdbe8aa96e
[ "BSD-3-Clause" ]
3
2019-03-12T16:01:36.000Z
2020-05-23T13:06:43.000Z
src/common/keccak-generic_parallel_xof.adb
damaki/libkeccak
d06217e525f7927380690d6c37b485bdbe8aa96e
[ "BSD-3-Clause" ]
2
2019-04-15T18:02:19.000Z
2020-11-22T11:22:18.000Z
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- package body Keccak.Generic_Parallel_XOF is ------------ -- Init -- ------------ procedure Init (Ctx : out Context) is begin Sponge.Init (Ctx.Sponge_Ctx); end Init; ----------------------- -- Update_Separate -- ----------------------- procedure Update_Separate (Ctx : in out Context; Data : in Types.Byte_Array) is Block_Size : constant Natural := (Data'Length / Num_Parallel_Instances); begin if Block_Size mod (Rate / 8) = 0 then Sponge.Absorb_Bytes_Separate (Ctx.Sponge_Ctx, Data); else Sponge.Absorb_Bytes_Separate_With_Suffix (Ctx => Ctx.Sponge_Ctx, Data => Data, Suffix => Suffix, Suffix_Len => Suffix_Size); end if; end Update_Separate; ------------------ -- Update_All -- ------------------ procedure Update_All (Ctx : in out Context; Data : in Types.Byte_Array) is begin if Data'Length mod (Rate / 8) = 0 then Sponge.Absorb_Bytes_All (Ctx.Sponge_Ctx, Data); else Sponge.Absorb_Bytes_All_With_Suffix (Ctx => Ctx.Sponge_Ctx, Data => Data, Suffix => Suffix, Suffix_Len => Suffix_Size); end if; end Update_All; ------------------------ -- Extract_Separate -- ------------------------ procedure Extract_Separate (Ctx : in out Context; Data : out Types.Byte_Array) is Empty_Array : constant Types.Byte_Array (1 .. 0) := (others => 0); begin if State_Of (Ctx) = Updating then Sponge.Absorb_Bytes_Separate_With_Suffix (Ctx => Ctx.Sponge_Ctx, Data => Empty_Array, Suffix => Suffix, Suffix_Len => Suffix_Size); end if; Sponge.Squeeze_Bytes_Separate (Ctx.Sponge_Ctx, Data); end Extract_Separate; end Keccak.Generic_Parallel_XOF;
36.592233
80
0.58424
06f5da54ebb56a7e024dc223c33091a80be263f9
5,339
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/a-wtcoio.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/a-wtcoio.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/a-wtcoio.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . W I D E _ T E X T _ IO . C O M P L E X _ I O -- -- -- -- B o d y -- -- -- -- 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. -- -- -- -- 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.Wide_Text_IO.Complex_Aux; with System.WCh_Con; use System.WCh_Con; with System.WCh_WtS; use System.WCh_WtS; with Ada.Unchecked_Conversion; package body Ada.Wide_Text_IO.Complex_IO is package Aux renames Ada.Wide_Text_IO.Complex_Aux; subtype LLF is Long_Long_Float; -- Type used for calls to routines in Aux function TFT is new Ada.Unchecked_Conversion (File_Type, Ada.Wide_Text_IO.File_Type); -- This unchecked conversion is to get around a visibility bug in -- GNAT version 2.04w. It should be possible to simply use the -- subtype declared above and do normal checked conversions. --------- -- Get -- --------- procedure Get (File : File_Type; Item : out Complex; Width : Field := 0) is Real_Item : Real'Base; Imag_Item : Real'Base; begin Aux.Get (TFT (File), LLF (Real_Item), LLF (Imag_Item), Width); Item := (Real_Item, Imag_Item); exception when Constraint_Error => raise Data_Error; end Get; --------- -- Get -- --------- procedure Get (Item : out Complex; Width : Field := 0) is begin Get (Current_Input, Item, Width); end Get; --------- -- Get -- --------- procedure Get (From : Wide_String; Item : out Complex; Last : out Positive) is Real_Item : Real'Base; Imag_Item : Real'Base; S : constant String := Wide_String_To_String (From, WCEM_Upper); -- String on which we do the actual conversion. Note that the method -- used for wide character encoding is irrelevant, since if there is -- a character outside the Standard.Character range then the call to -- Aux.Gets will raise Data_Error in any case. begin Aux.Gets (S, LLF (Real_Item), LLF (Imag_Item), Last); Item := (Real_Item, Imag_Item); exception when Data_Error => raise Constraint_Error; end Get; --------- -- Put -- --------- procedure Put (File : File_Type; Item : Complex; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin Aux.Put (TFT (File), LLF (Re (Item)), LLF (Im (Item)), Fore, Aft, Exp); end Put; --------- -- Put -- --------- procedure Put (Item : Complex; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin Put (Current_Output, Item, Fore, Aft, Exp); end Put; --------- -- Put -- --------- procedure Put (To : out Wide_String; Item : Complex; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is S : String (To'First .. To'Last); begin Aux.Puts (S, LLF (Re (Item)), LLF (Im (Item)), Aft, Exp); for J in S'Range loop To (J) := Wide_Character'Val (Character'Pos (S (J))); end loop; end Put; end Ada.Wide_Text_IO.Complex_IO;
33.36875
78
0.488856
5077477f38ee3c93a7e92094d963e9769491b306
6,360
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45532b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45532b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45532b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C45532B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT THE OPERATOR "/" PRODUCES CORRECT RESULTS -- FOR FIXED POINT TYPES USING 3 SUBTESTS. -- THIS TEST REQUIRES MIN_WORD_LENGTH = 12. -- THIS TEST USES VALUES OF DELTA WHICH ARE LESS THAN 0.5. -- -- TEST CASES ARE: -- A) THE OPERATOR /, A, B, AND A / B ALL MODEL NUMBERS. -- B) THE OPERATOR /, A, B MODEL NUMBERS A / B NOT. -- C) THE OPERATOR /, USING NO MODEL NUMBERS. -- -- REPEAT FOR MINIMUM REQUIRED WORD LENGTHS OF 12, 16, 32 AND 48, -- WITH RANGE <, =, AND > THAN 1.0 AND -- WITH DELTA <, =, AND > THAN 1.0. -- HISTORY: -- NTW 09/08/86 CREATED ORIGINAL TEST. -- RJW 11/05/86 REVISED COMMENTS. -- DHH 10/20/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS. -- RDH 04/27/90 REVISED APPLICABILITY CRITERIA. -- BCB 10/03/90 REMOVED APPLICABILITY CRITERIA AND N/A => ERROR -- LINE. CHANGED EXTENSION FROM '.DEP' TO '.ADA'. WITH REPORT; PROCEDURE C45532B IS USE REPORT; MIN_WORD_LENGTH : CONSTANT := 12; -- MUST BE EVEN & >= 6 FULL_SCALE : CONSTANT := 2 ** (MIN_WORD_LENGTH - 1); FORTH : CONSTANT := FULL_SCALE / 4; A_THIRD : CONSTANT := FULL_SCALE / 3; DEL1 : CONSTANT := 0.5 / FULL_SCALE; TYPE FX_0P5 IS DELTA DEL1 * 1 RANGE -0.5 .. 0.5 - DEL1 * 1; TYPE FX_1 IS DELTA DEL1 * 2 RANGE -1.0 .. 1.0 - DEL1 * 2; TYPE FX_2 IS DELTA DEL1 * 4 RANGE -2.0 .. 2.0 - DEL1 * 4; BEGIN TEST ("C45532B", "FIXED POINT OPERATOR ""/"" " & "FOR RANGE <, =, AND > 1.0"); -------------------------------------------------- -- CASE A) THE OPERATOR /, A, B, AND A / B ALL MODEL NUMBERS. A: DECLARE A : FX_0P5 := 0.0; B : FX_1 := 0.0; RESULT_VALUE : FX_2 := 0.0; LOWEST_ACCEPTABLE_VALUE : FX_2 := FX_2 (0.5); HIGHEST_ACCEPTABLE_VALUE : FX_2 := FX_2 (0.5); BEGIN IF EQUAL (3, 3) THEN A := FX_0P5 (0.125); -- A MODEL NUMBER B := FX_1 (0.25); -- A MODEL NUMBER END IF; RESULT_VALUE := FX_2 (A / B); IF (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE) OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN FAILED ("RESULT OF ""/"" OUTSIDE RESULT MODEL INTERVAL " & "WHEN A, B, AND A / B ARE ALL MODEL NUMBERS"); END IF; END A; -------------------------------------------------- -- CASE B) THE OPERATOR /, A, B MODEL NUMBERS A / B NOT. B: DECLARE A : FX_0P5 := 0.0; B : FX_0P5 := 0.0; RESULT_VALUE : FX_1 := 0.0; LOWEST_ACCEPTABLE_VALUE : FX_1 := FX_1 (2 * DEL1 * A_THIRD); HIGHEST_ACCEPTABLE_VALUE : FX_1 := FX_1 (2 * DEL1 * (A_THIRD + 1) ); BEGIN IF EQUAL (3, 3) THEN A := FX_0P5 (DEL1 * 1); -- A MODEL NUMBER B := FX_0P5 (DEL1 * 3); -- A MODEL NUMBER END IF; RESULT_VALUE := FX_1 (A / B); IF (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE) OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN FAILED ("RESULT OF ""/"" OUTSIDE RESULT MODEL INTERVAL " & "WHEN A, B MODEL NUMBERS A / B NOT"); END IF; END B; -------------------------------------------------- -- CASE C) THE OPERATOR /, USING NO MODEL NUMBERS C: DECLARE A : FX_1 := 0.0; B : FX_1 := 0.0; RESULT_VALUE : FX_0P5 := 0.0; LOW_COUNT : CONSTANT := 2 * A_THIRD; -- := (2 * FULL_SCALE * (2 * FORTH + 0)) -- / (6 * FORTH + 2); HIGH_COUNT : CONSTANT := 2 * A_THIRD + 4; -- := (2 * FULL_SCALE * (2 * FORTH + 2)) -- / (6 * FORTH + 0); LOWEST_ACCEPTABLE_VALUE : FX_0P5 := FX_0P5 (DEL1 * LOW_COUNT ); HIGHEST_ACCEPTABLE_VALUE : FX_0P5 := FX_0P5 (DEL1 * HIGH_COUNT ); BEGIN IF EQUAL (3, 3) THEN -- A AND B NOT MODEL NUMBERS A := FX_1 (DEL1 * (2 * FORTH + 1)); B := FX_1 (DEL1 * (6 * FORTH + 1)); END IF; RESULT_VALUE := FX_0P5 (A / B); IF (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE) OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN FAILED ("RESULT OF ""/"" OUTSIDE RESULT MODEL INTERVAL " & "WHEN USING NO MODEL NUMBERS"); END IF; END C; -------------------------------------------------- RESULT; END C45532B;
39.75
79
0.487736
fbe5a51fcfa9616eafa71e66f0a049651593bd53
5,620
ads
Ada
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-shsh32.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-shsh32.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/g-shsh32.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . S E C U R E _ H A S H E S . S H A 2 _ 3 2 -- -- -- -- S p e c -- -- -- -- Copyright (C) 2009-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides support for the 32-bit FIPS PUB 180-3 functions -- SHA-224 and SHA-256. -- This is an internal unit and should not be used directly in applications. -- Use GNAT.SHA224 and GNAT.SHA256 instead. with Interfaces; with GNAT.Byte_Swapping; with GNAT.Secure_Hashes.SHA2_Common; package GNAT.Secure_Hashes.SHA2_32 is subtype Word is Interfaces.Unsigned_32; package Hash_State is new Hash_Function_State (Word => Word, Swap => GNAT.Byte_Swapping.Swap4, Hash_Bit_Order => System.High_Order_First); -- SHA-224 and SHA-256 operate on 32-bit big endian words K : constant Hash_State.State (0 .. 63) := (16#428a2f98#, 16#71374491#, 16#b5c0fbcf#, 16#e9b5dba5#, 16#3956c25b#, 16#59f111f1#, 16#923f82a4#, 16#ab1c5ed5#, 16#d807aa98#, 16#12835b01#, 16#243185be#, 16#550c7dc3#, 16#72be5d74#, 16#80deb1fe#, 16#9bdc06a7#, 16#c19bf174#, 16#e49b69c1#, 16#efbe4786#, 16#0fc19dc6#, 16#240ca1cc#, 16#2de92c6f#, 16#4a7484aa#, 16#5cb0a9dc#, 16#76f988da#, 16#983e5152#, 16#a831c66d#, 16#b00327c8#, 16#bf597fc7#, 16#c6e00bf3#, 16#d5a79147#, 16#06ca6351#, 16#14292967#, 16#27b70a85#, 16#2e1b2138#, 16#4d2c6dfc#, 16#53380d13#, 16#650a7354#, 16#766a0abb#, 16#81c2c92e#, 16#92722c85#, 16#a2bfe8a1#, 16#a81a664b#, 16#c24b8b70#, 16#c76c51a3#, 16#d192e819#, 16#d6990624#, 16#f40e3585#, 16#106aa070#, 16#19a4c116#, 16#1e376c08#, 16#2748774c#, 16#34b0bcb5#, 16#391c0cb3#, 16#4ed8aa4a#, 16#5b9cca4f#, 16#682e6ff3#, 16#748f82ee#, 16#78a5636f#, 16#84c87814#, 16#8cc70208#, 16#90befffa#, 16#a4506ceb#, 16#bef9a3f7#, 16#c67178f2#); -- Constants from FIPS PUB 180-3 function Sigma0 (X : Word) return Word; function Sigma1 (X : Word) return Word; function S0 (X : Word) return Word; function S1 (X : Word) return Word; pragma Inline (Sigma0, Sigma1, S0, S1); -- Elementary functions Sigma^256_0, Sigma^256_1, sigma^256_0, sigma^256_1 -- from FIPS PUB 180-3. procedure Transform is new SHA2_Common.Transform (Hash_State => Hash_State, K => K, Rounds => 64, Sigma0 => Sigma0, Sigma1 => Sigma1, S0 => S0, S1 => S1); SHA224_Init_State : constant Hash_State.State (0 .. 7) := (0 => 16#c1059ed8#, 1 => 16#367cd507#, 2 => 16#3070dd17#, 3 => 16#f70e5939#, 4 => 16#ffc00b31#, 5 => 16#68581511#, 6 => 16#64f98fa7#, 7 => 16#befa4fa4#); SHA256_Init_State : constant Hash_State.State (0 .. 7) := (0 => 16#6a09e667#, 1 => 16#bb67ae85#, 2 => 16#3c6ef372#, 3 => 16#a54ff53a#, 4 => 16#510e527f#, 5 => 16#9b05688c#, 6 => 16#1f83d9ab#, 7 => 16#5be0cd19#); -- Initialization vectors from FIPS PUB 180-3 end GNAT.Secure_Hashes.SHA2_32;
51.559633
78
0.443238
06a5d7532c1342056894e5430caa8aa84364feea
11,542
adb
Ada
src/trendy_test.adb
jquorning/trendy_test
a0e147369f723969740eb25995cf22ba74282127
[ "Apache-2.0" ]
7
2021-08-01T05:43:59.000Z
2021-10-03T09:55:35.000Z
src/trendy_test.adb
jquorning/trendy_test
a0e147369f723969740eb25995cf22ba74282127
[ "Apache-2.0" ]
2
2021-08-07T13:37:45.000Z
2022-03-12T14:47:26.000Z
src/trendy_test.adb
jquorning/trendy_test
a0e147369f723969740eb25995cf22ba74282127
[ "Apache-2.0" ]
1
2022-03-11T18:21:18.000Z
2022-03-11T18:21:18.000Z
with Ada.Containers.Synchronized_Queue_Interfaces; with Ada.Containers.Unbounded_Synchronized_Queues; with Ada.Exceptions; with Ada.Numerics.Discrete_Random; with Ada.Strings.Fixed; with Ada.Strings.Unbounded.Text_IO; with Ada.Text_IO; with System.Multiprocessors; with GNAT.Traceback.Symbolic; package body Trendy_Test is procedure Register (Op : in out Operation'Class; Name : String := Image (Subprogram_Name); Disabled : Boolean := False; Parallelize : Boolean := True) is begin null; end Register; pragma Unreferenced (Register); function Num_Total_Tests (Self : Gather) return Integer is use all type Ada.Containers.Count_Type; begin return Integer(Self.Parallel_Tests.Length + Self.Sequential_Tests.Length); end Num_Total_Tests; overriding procedure Register (Self : in out Gather; Name : String := Image (Subprogram_Name); Disabled : Boolean := False; Parallelize : Boolean := True) is package ASU renames Ada.Strings.Unbounded; begin -- TODO: Test filter to go here. if Disabled then raise Test_Registered; end if; Self.Current_Name := ASU.To_Unbounded_String(Name); if Parallelize then Self.Parallel_Tests.Append(Self.Current_Test); Ada.Text_IO.Put_Line ("// PARALLEL // " & ASU.To_String(Self.Current_Name)); else Self.Sequential_Tests.Append(Self.Current_Test); Ada.Text_IO.Put_Line ("--SEQUENTIAL-- " & ASU.To_String(Self.Current_Name)); end if; raise Test_Registered; end Register; overriding procedure Register (T : in out List; Name : String := Image (Subprogram_Name); Disabled : Boolean := False; Parallelize : Boolean := True) is begin pragma Unreferenced (T, Disabled, Parallelize); Ada.Text_IO.Put_Line (Name); end Register; overriding procedure Register (T : in out Test; Name : String := Image (Subprogram_Name); Disabled : Boolean := False; Parallelize : Boolean := True) is begin pragma Unreferenced(Parallelize); T.Name := Ada.Strings.Unbounded.To_Unbounded_String (Name); if Disabled then raise Test_Disabled; end if; end Register; procedure Report_Failure (Op : in out Operation'Class; Message : String; Loc : Source_Location) is Error : constant String := (if Message /= "" then Message else "Condition false"); begin pragma Unreferenced (Op); raise Test_Failure with "Assertion Failed: (" & Error & ") at " & Image (Loc); end Report_Failure; function "and" (Left, Right: Test_Result) return Test_Result is Either_Failed : constant Boolean := Left = Failed or else Right = Failed; Both_Skipped : constant Boolean := Left = Skipped and then Right = Skipped; begin return (if Either_Failed then Failed else (if Both_Skipped then Skipped else Passed)); end "and"; procedure Register (TG : in Test_Group) is begin All_Test_Groups.Append (TG); end Register; function Run (TG : Test_Group) return Test_Result is Passes : Natural := 0; Fails : Natural := 0; Total : Natural := 0; Instance : Test; use Ada.Text_IO; use Ada.Strings.Unbounded.Text_IO; use type Ada.Strings.Unbounded.Unbounded_String; begin for T of TG loop declare begin T.all (Instance); Put_Line ("[ PASS ] " & Instance.Name); Passes := Passes + 1; exception when Test_Disabled => Put_Line ("[ SKIP ] " & Instance.Name); when Error : Test_Failure => Put_Line ("[ FAIL ] " & Instance.Name); Put_Line (" " & Ada.Exceptions.Exception_Message (Error)); Fails := Fails + 1; end; end loop; Total := Fails + Passes; Put_Line ("Results: Passed: " & Passes'Image & " / " & Total'Image); New_Line; if Fails > 0 then return Failed; else return Passed; end if; end Run; function "<"(Left, Right : Test_Report) return Boolean is use Ada.Strings.Unbounded; begin return Left.Name < Right.Name; end "<"; -- An easy algorithm for parallelism is to throw all of our parallel tests into a huge -- queue and then have every task pick one up as needed, writing our results to a protected -- object. package Test_Queue_Interfaces is new Ada.Containers.Synchronized_Queue_Interfaces (Element_Type => Test_Procedure); package Test_Queues is new Ada.Containers.Unbounded_Synchronized_Queues (Queue_Interfaces => Test_Queue_Interfaces); -- Produces a pseudo-random order of tests. function Shuffle (V : Test_Procedure_Vectors.Vector) return Test_Procedure_Vectors.Vector with Pre => not V.Is_Empty is subtype Random_Range is Positive range 1 .. Positive(V.Length); package Positive_Random is new Ada.Numerics.Discrete_Random(Result_Subtype => Random_Range); Generator : Positive_Random.Generator; Shuffle_Runs : constant Natural := 5; Shuffle_Iterations : constant Natural := Natural(V.Length) * Shuffle_Runs; I, J : Positive; begin Positive_Random.Reset(Generator); if V.Is_Empty then return V; end if; return Result : Test_Procedure_Vectors.Vector := V.Copy do for Iteration in 1 .. Shuffle_Iterations loop I := Positive_Random.Random(Generator); J := Positive_Random.Random(Generator); Result.Swap(I, J); end loop; end return; end Shuffle; -- Accepts test results from parallelized test tasks. protected type Test_Results is procedure Add(T : Test_Report); function Get_Results return Test_Report_Vectors.Vector; private Results : Test_Report_Vectors.Vector; end Test_Results; protected body Test_Results is procedure Add(T : Test_Report) is begin Results.Append(T); end Add; function Get_Results return Test_Report_Vectors.Vector is begin return Results; end Get_Results; end Test_Results; procedure Run_Test (Test_Proc : in Test_Procedure; Results : in out Test_Results) is Instance : Test; Start_Time : constant Ada.Calendar.Time := Ada.Calendar.Clock; End_Time : Ada.Calendar.Time; begin Test_Proc.all (Instance); End_Time := Ada.Calendar.Clock; Results.Add(Test_Report'(Instance.Name, Passed, Start_Time, End_Time, others => <>)); exception when Test_Disabled => End_Time := Ada.Calendar.Clock; Results.Add((Instance.Name, Skipped, Start_Time, End_Time, others => <>)); when Error : Test_Failure => End_Time := Ada.Calendar.Clock; Results.Add(Test_Report'(Instance.Name, Failed, Start_Time, End_Time, Failure => Ada.Strings.Unbounded.To_Unbounded_String( Ada.Exceptions.Exception_Message (Error) & GNAT.Traceback.Symbolic.Symbolic_Traceback (Error)))); when Error : others => End_Time := Ada.Calendar.Clock; Results.Add(Test_Report'(Instance.Name, Failed, Start_Time, End_Time, Failure => Ada.Strings.Unbounded.To_Unbounded_String( Ada.Exceptions.Exception_Message (Error) & GNAT.Traceback.Symbolic.Symbolic_Traceback (Error)))); end Run_Test; function Run return Test_Report_Vectors.Vector is Gather_Op : Gather; Results : Test_Results; Tests : Test_Queues.Queue; Parallel_Tests : Test_Procedure_Vectors.Vector; Sequential_Tests : Test_Procedure_Vectors.Vector; task type Parallel_Test_Task is end Parallel_Test_Task; task body Parallel_Test_Task is Next_Test : Test_Procedure; begin loop select Tests.Dequeue (Next_Test); or delay 0.1; exit; end select; Run_Test (Next_Test, Results); end loop; end Parallel_Test_Task; begin -- Gather all of the possible tests, filtering by only those tests which -- should be used. Tests are split into parallelized tests and -- a sequential test group. for TG of All_Test_Groups loop for T of TG loop declare Previous_Num_Tests : Integer := Gather_Op.Num_Total_Tests; use all type Ada.Containers.Count_Type; begin Gather_Op.Current_Test := T; T(Gather_Op); if Gather_Op.Num_Total_Tests = Previous_Num_Tests then raise Unregistered_Test with "Test procedure did not call register"; end if; if Gather_Op.Num_Total_Tests /= Previous_Num_Tests + 1 then raise Multiply_Registered_Test with "Test procedure called register multiple times"; end if; exception when Test_Registered => null; when Test_Disabled => null; end; end loop; end loop; -- Tests shouldn't produce different results run in different orders. -- Shuffle the tests to check this, and report the random seed used. if not Gather_Op.Sequential_Tests.Is_Empty then Sequential_Tests := Shuffle(Gather_Op.Sequential_Tests); end if; if not Gather_Op.Parallel_Tests.Is_Empty then Parallel_Tests := Shuffle(Gather_Op.Parallel_Tests); end if; ----------------------------------------------------------------------- -- Parallel tests. ----------------------------------------------------------------------- for T of Parallel_Tests loop Tests.Enqueue(T); end loop; -- Dispatch tasks for parallel execution. declare Num_CPUs : constant System.Multiprocessors.CPU := System.Multiprocessors.Number_Of_CPUs; Runners : array (1 .. Num_CPUs) of Parallel_Test_Task; pragma Unreferenced (Runners); begin -- Wait for runners to complete. null; end; ----------------------------------------------------------------------- -- Sequential Tests ----------------------------------------------------------------------- for T of Sequential_Tests loop Run_Test (T, Results); end loop; return Results.Get_Results; end Run; end Trendy_Test;
37.596091
120
0.568446
1c7116e3c5e8f49ecd5e5e6db69747d2a7629ee2
10,002
adb
Ada
source/uaflex/uaflex-run.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
null
null
null
source/uaflex/uaflex-run.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/uaflex/uaflex-run.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Tools Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2017, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Parser; with Ada.Directories; with Ada.Exceptions; with Ada.Streams.Stream_IO; with Ada.Text_IO; with Ada.Wide_Wide_Text_IO; with UAFLEX.Expand; with UAFLEX.Generator.Tables; with UAFLEX.Generator.OOP_Handler; with UAFLEX.Nodes; with League.String_Vectors; with League.Strings; with League.Strings.Internals; with League.Text_Codecs; with Matreshka.Internals.Finite_Automatons; with Matreshka.Internals.Regexps.Compiler; with String_Sources; procedure UAFLEX.Run (Handler : League.Strings.Universal_String; Input : League.Strings.Universal_String; Tokens : League.Strings.Universal_String; Types : League.Strings.Universal_String; Scanner : League.Strings.Universal_String; Success : out Boolean) is procedure Each_Condition (Cursor : Nodes.Start_Condition_Maps.Cursor); procedure Each (Name : League.Strings.Universal_String; Condition : Nodes.Start_Condition); function Read_File (File_Name : String) return League.Strings.Universal_String; function To_String (Item : League.Strings.Universal_String) return String renames League.Text_Codecs.To_Exception_Message; function To_File_Name (Item : League.Strings.Universal_String; Extension : Wide_Wide_String) return String; function "+" (Item : Wide_Wide_String) return League.Strings.Universal_String renames League.Strings.To_Universal_String; DFA : Matreshka.Internals.Finite_Automatons.DFA_Constructor; ---------- -- Each -- ---------- procedure Each (Name : League.Strings.Universal_String; Condition : Nodes.Start_Condition) is Rule : Positive; Actions : Matreshka.Internals.Finite_Automatons.Rule_Index_Array (1 .. Condition.Rules.Last_Index); Reg_Exp_List : Matreshka.Internals.Finite_Automatons.Shared_Pattern_Array (1 .. Condition.Rules.Last_Index); begin for J in Actions'Range loop Rule := Condition.Rules.Element (J); Actions (J) := Rule; Reg_Exp_List (J) := Nodes.Regexp (Rule); end loop; DFA.Compile (Name, Reg_Exp_List, Actions); end Each; -------------------- -- Each_Condition -- -------------------- procedure Each_Condition (Cursor : Nodes.Start_Condition_Maps.Cursor) is begin Nodes.Start_Condition_Maps.Query_Element (Cursor, Each'Access); end Each_Condition; --------------- -- Read_File -- --------------- function Read_File (File_Name : String) return League.Strings.Universal_String is Decoder : constant League.Text_Codecs.Text_Codec := League.Text_Codecs.Codec_For_Application_Locale; Size : constant Ada.Directories.File_Size := Ada.Directories.Size (File_Name); Length : constant Ada.Streams.Stream_Element_Offset := Ada.Streams.Stream_Element_Count (Size); File : Ada.Streams.Stream_IO.File_Type; Data : Ada.Streams.Stream_Element_Array (1 .. Length); Last : Ada.Streams.Stream_Element_Offset; begin Ada.Streams.Stream_IO.Open (File, Ada.Streams.Stream_IO.In_File, File_Name); Ada.Streams.Stream_IO.Read (File, Data, Last); Ada.Streams.Stream_IO.Close (File); return Decoder.Decode (Data (1 .. Last)); end Read_File; ------------------ -- To_File_Name -- ------------------ function To_File_Name (Item : League.Strings.Universal_String; Extension : Wide_Wide_String) return String is List : League.String_Vectors.Universal_String_Vector; Name : League.Strings.Universal_String; begin List := Item.To_Lowercase.Split ('.'); Name := List.Join ("-") & Extension; return Name.To_UTF_8_String; end To_File_Name; Initial : League.String_Vectors.Universal_String_Vector; Source : aliased String_Sources.String_Source; Classes : Matreshka.Internals.Finite_Automatons.Vectors.Vector; begin Source.Create (Read_File (To_String (Input))); Parser.Scanner.Set_Source (Source'Unchecked_Access); Parser.Scanner.Set_Handler (Parser.Handler'Unchecked_Access); Initial.Append (League.Strings.To_Universal_String ("INITIAL")); Nodes.Add_Start_Conditions (Initial, False); Parser.YYParse; if not Nodes.Success then Success := False; return; end if; Expand.RegExps; if not Nodes.Success then Success := False; return; end if; Nodes.Regexp := new Matreshka.Internals.Finite_Automatons.Shared_Pattern_Array (1 .. Nodes.Rules.Length); for J in 1 .. Nodes.Rules.Length loop begin Nodes.Regexp (J) := Matreshka.Internals.Regexps.Compiler.Compile (League.Strings.Internals.Internal (Nodes.Rules.Element (J))); exception when E : Constraint_Error | Program_Error => Ada.Wide_Wide_Text_IO.Put_Line ("Line " & Natural'Wide_Wide_Image (Nodes.Lines.Element (J)) & " error on compile regexp '" & Nodes.Rules.Element (J).To_Wide_Wide_String & "'"); Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Message (E)); Nodes.Success := False; end; end loop; if not Nodes.Success then Success := False; return; end if; Nodes.Conditions.Iterate (Each_Condition'Access); declare X : Matreshka.Internals.Finite_Automatons.DFA; begin DFA.Complete (Output => X); Matreshka.Internals.Finite_Automatons.Minimize (X); Generator.Tables.Split_To_Distinct (X.Edge_Char_Set, Classes); declare Map : Generator.Tables.State_Map (1 .. X.Graph.Node_Count); Dead : Matreshka.Internals.Finite_Automatons.State; Final : Matreshka.Internals.Finite_Automatons.State; begin Generator.Tables.Map_Final_Dead_Ends (X, Dead, Final, Map); Generator.Tables.Types (X, Map, Dead, Final, Types, To_File_Name (Types, ".ads"), Classes); Generator.Tables.Go (X, Map, Dead, Final, +"Tables", To_File_Name (Scanner & ".Tables", ".adb"), Types, Scanner, Classes); end; end; Generator.OOP_Handler.Go (Nodes.Actions, To_File_Name (Handler, ".ads"), Types, Handler, Scanner, Tokens); Generator.OOP_Handler.On_Accept (Nodes.Actions, To_File_Name (Scanner & ".On_Accept", ".adb"), Types, Handler, Scanner, Tokens); Success := True; end UAFLEX.Run;
35.594306
79
0.562887