id
int64 0
30.9k
| extension
stringclasses 1
value | max_stars_count
int64 0
17k
| max_stars_repo_name
stringlengths 7
106
| max_stars_repo_path
stringlengths 5
136
| text
stringlengths 9
1M
|
|---|---|---|---|---|---|
30,200
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/quote.adb
|
-- { dg-do run }
with GNAT.Regpat; use GNAT.Regpat;
procedure Quote is
begin
if Quote (".+") /= "\.\+" then
raise Program_Error;
end if;
end Quote;
|
30,201
|
ada
| 0
|
balintsoos/LearnAda
|
gyak/gyak1-2/csomag/mat.ads
|
package Mat is
function Lnko ( A, B : Positive ) return Positive;
function Faktorialis( N: Natural ) return Positive;
end Mat;
|
30,202
|
ada
| 25
|
My-Colaborations/ada-keystore
|
src/keystore-keys.adb
|
<gh_stars>10-100
-----------------------------------------------------------------------
-- keystore-keys -- Keystore key management
-- Copyright (C) 2019, 2020 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- 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 Util.Log.Loggers;
with Util.Encoders.SHA256;
with Util.Encoders.HMAC.SHA256;
with Util.Encoders.KDF.PBKDF2_HMAC_SHA256;
with Keystore.Logs;
with Keystore.Buffers;
-- === Master keys ===
-- Wallet header encrypted with the parent wallet id
--
-- ```
-- +------------------+
-- | 01 01 | 2b
-- | Encrypt size | 2b
-- | Parent Wallet id | 4b
-- | PAD 0 | 4b
-- | PAD 0 | 4b
-- +------------------+
-- | Wallet magic | 4b
-- | Wallet version | 4b
-- | Wallet lid | 4b
-- | Wallet block ID | 4b
-- +------------------+
-- | Wallet gid | 16b
-- +------------------+
-- | Wallet key count | 4b
-- | PAD 0 | 4b
-- +------------------+
-- | Key type | 4b
-- | Key size | 4b
-- | Counter for key | 4b
-- | Counter for iv | 4b
-- | Salt for key | 32b
-- | Salt for iv | 32b
-- | Key slot sign | 32b
-- | Dir key # 1 | 32b ---
-- | Dir iv # 1 | 16b ^
-- | Dir sign # 1 | 32b |
-- | Data key # 1 | 32b |
-- | Data iv # 1 | 16b | Encrypted by user's password
-- | Data sign #1 | 32b |
-- | Key key # 1 | 32b |
-- | Key iv # 1 | 16b v
-- | Key sign #1 | 32b ---
-- | Slot HMAC-256 | 32b
-- | PAD 0 / Random | 80b
-- +------------------+
-- | Key slot #2 | 512b
-- +------------------+
-- | Key slot #3 | 512b
-- +------------------+
-- | Key slot #4 | 512b
-- +------------------+
-- | Key slot #5 | 512b
-- +------------------+
-- | Key slot #6 | 512b
-- +------------------+
-- | Key slot #7 | 512b
-- +------------------+
-- | PAD 0 / Random |
-- +------------------+
-- | Block HMAC-256 | 32b
-- +------------------+
-- ```
--
package body Keystore.Keys is
use Interfaces;
use Ada.Streams;
use Util.Encoders.KDF;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Keystore.Keys");
procedure Save_Key (Manager : in out Key_Manager;
Buffer : in out Marshallers.Marshaller;
Password : in out Keystore.Passwords.Provider'Class;
Slot : in Key_Slot;
Config : in Wallet_Config;
Stream : in out IO.Wallet_Stream'Class);
procedure Erase_Key (Manager : in out Key_Manager;
Buffer : in out Marshallers.Marshaller;
Slot : in Key_Slot;
Stream : in out IO.Wallet_Stream'Class);
procedure Extract (Buffer : in out Marshallers.Marshaller;
Lock_Key : in Secret_Key;
Lock_IV : in Secret_Key;
Crypt : in out Cryptor;
Hmac : in out Util.Encoders.HMAC.SHA256.Context);
function Verify_GPG (Manager : in Key_Manager;
Buffer : in out Marshallers.Marshaller;
Password : in Passwords.Slot_Provider'Class;
Config : in out Wallet_Config) return Boolean;
function Verify_PBKDF2 (Manager : in Key_Manager;
Buffer : in out Marshallers.Marshaller;
Password : in Passwords.Provider'Class;
Size : in Positive;
Config : in out Wallet_Config) return Boolean;
procedure Generate (Manager : in out Key_Manager;
Crypt : in out Cryptor);
procedure Save (Buffer : in out IO.Marshaller;
Lock_Key : in Secret_Key;
Lock_IV : in Secret_Key;
Crypt : in Cryptor;
Hmac : in out Util.Encoders.HMAC.SHA256.Context);
procedure Load (Manager : in out Key_Manager;
Block : in Keystore.IO.Storage_Block;
Ident : in Wallet_Identifier;
Buffer : in out IO.Marshaller;
Root : out Keystore.IO.Storage_Block;
UUID : out UUID_Type;
Stream : in out IO.Wallet_Stream'Class);
-- ------------------------------
-- Set the IV vector to be used for the encryption and decryption of the given block number.
-- ------------------------------
procedure Set_IV (Into : in out Cryptor;
Block : in IO.Block_Number) is
Block_IV : constant Util.Encoders.AES.Word_Block_Type
:= (others => Interfaces.Unsigned_32 (Block));
begin
Into.Decipher.Set_IV (Into.IV, Block_IV);
Into.Cipher.Set_IV (Into.IV, Block_IV);
end Set_IV;
procedure Set_Key (Into : in out Cryptor;
From : in Cryptor) is
begin
Into.Cipher.Set_Key (From.Key, Util.Encoders.AES.CBC);
Into.Cipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
Into.Decipher.Set_Key (From.Key, Util.Encoders.AES.CBC);
Into.Decipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
end Set_Key;
-- ------------------------------
-- Extract the AES encryption key, the AES IV and the signature key.
-- Update the HMAC with the extracted encryption keys for global verification.
-- ------------------------------
procedure Extract (Buffer : in out Marshallers.Marshaller;
Lock_Key : in Secret_Key;
Lock_IV : in Secret_Key;
Crypt : in out Cryptor;
Hmac : in out Util.Encoders.HMAC.SHA256.Context) is
begin
Marshallers.Get_Secret (Buffer, Crypt.Key, Lock_Key, Lock_IV);
Marshallers.Get_Secret (Buffer, Crypt.IV, Lock_Key, Lock_IV);
Marshallers.Get_Secret (Buffer, Crypt.Sign, Lock_Key, Lock_IV);
Util.Encoders.HMAC.SHA256.Update (Hmac, Crypt.Key);
Util.Encoders.HMAC.SHA256.Update (Hmac, Crypt.IV);
Util.Encoders.HMAC.SHA256.Update (Hmac, Crypt.Sign);
Crypt.Cipher.Set_Key (Crypt.Key, Util.Encoders.AES.CBC);
Crypt.Cipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
Crypt.Decipher.Set_Key (Crypt.Key, Util.Encoders.AES.CBC);
Crypt.Decipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
end Extract;
procedure Generate (Manager : in out Key_Manager;
Crypt : in out Cryptor) is
begin
Manager.Random.Generate (Crypt.Sign);
Manager.Random.Generate (Crypt.Key);
Manager.Random.Generate (Crypt.IV);
Crypt.Cipher.Set_Key (Crypt.Key, Util.Encoders.AES.CBC);
Crypt.Cipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
Crypt.Decipher.Set_Key (Crypt.Key, Util.Encoders.AES.CBC);
Crypt.Decipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
end Generate;
procedure Save (Buffer : in out Marshallers.Marshaller;
Lock_Key : in Secret_Key;
Lock_IV : in Secret_Key;
Crypt : in Cryptor;
Hmac : in out Util.Encoders.HMAC.SHA256.Context) is
begin
Marshallers.Put_Secret (Buffer, Crypt.Key, Lock_Key, Lock_IV);
Marshallers.Put_Secret (Buffer, Crypt.IV, Lock_Key, Lock_IV);
Marshallers.Put_Secret (Buffer, Crypt.Sign, Lock_Key, Lock_IV);
Util.Encoders.HMAC.SHA256.Update (Hmac, Crypt.Key);
Util.Encoders.HMAC.SHA256.Update (Hmac, Crypt.IV);
Util.Encoders.HMAC.SHA256.Update (Hmac, Crypt.Sign);
end Save;
function Verify_GPG (Manager : in Key_Manager;
Buffer : in out Marshallers.Marshaller;
Password : in Passwords.Slot_Provider'Class;
Config : in out Wallet_Config) return Boolean is
procedure Get_Password (Key : in Secret_Key;
IV : in Secret_Key);
Buf : constant Buffers.Buffer_Accessor := Buffer.Buffer.Data.Value;
Sign : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Result : Util.Encoders.SHA256.Hash_Array;
Hmac : Util.Encoders.HMAC.SHA256.Context;
-- Get the directory encryption key and IV.
procedure Get_Password (Key : in Secret_Key;
IV : in Secret_Key) is
begin
Extract (Buffer, Key, IV, Config.Dir, Hmac);
Extract (Buffer, Key, IV, Config.Data, Hmac);
Extract (Buffer, Key, IV, Config.Key, Hmac);
end Get_Password;
begin
Marshallers.Get_Secret (Buffer, Sign, Manager.Crypt.Key, Manager.Crypt.IV);
-- Build a signature from the master key and the wallet salt.
Util.Encoders.HMAC.SHA256.Set_Key (Hmac, Sign);
Password.Get_Key (Get_Password'Access);
Util.Encoders.HMAC.SHA256.Finish (Hmac, Result);
return Result = Buf.Data (Buffer.Pos + 1 .. Buffer.Pos + Result'Length);
end Verify_GPG;
function Verify_PBKDF2 (Manager : in Key_Manager;
Buffer : in out Marshallers.Marshaller;
Password : in Passwords.Provider'Class;
Size : in Positive;
Config : in out Wallet_Config) return Boolean is
procedure Get_Password (Secret : in Secret_Key);
Buf : constant Buffers.Buffer_Accessor := Buffer.Buffer.Data.Value;
Salt_Key : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Salt_IV : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Sign : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Lock_Key : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Lock_IV : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Result : Util.Encoders.SHA256.Hash_Array;
Hmac : Util.Encoders.HMAC.SHA256.Context;
Counter_Key : Interfaces.Unsigned_32;
Counter_IV : Interfaces.Unsigned_32;
-- Generate a derived key from the password, salt, counter.
procedure Get_Password (Secret : in Secret_Key) is
begin
PBKDF2_HMAC_SHA256 (Password => Secret,
Salt => Salt_IV,
Counter => Positive (Counter_IV),
Result => Lock_IV);
end Get_Password;
begin
Counter_Key := Marshallers.Get_Unsigned_32 (Buffer);
Counter_IV := Marshallers.Get_Unsigned_32 (Buffer);
if Counter_Key = 0 or Counter_IV = 0 or Size /= Util.Encoders.AES.AES_256_Length then
return False;
end if;
Marshallers.Get_Secret (Buffer, Salt_Key, Manager.Crypt.Key, Manager.Crypt.IV);
Marshallers.Get_Secret (Buffer, Salt_IV, Manager.Crypt.Key, Manager.Crypt.IV);
Marshallers.Get_Secret (Buffer, Sign, Manager.Crypt.Key, Manager.Crypt.IV);
Password.Get_Password (Get_Password'Access);
PBKDF2_HMAC_SHA256 (Password => <PASSWORD>,
Salt => Salt_Key,
Counter => Positive (Counter_Key),
Result => Lock_Key);
-- Build a signature from the master key and the wallet salt.
Util.Encoders.HMAC.SHA256.Set_Key (Hmac, Sign);
-- Get the directory encryption key and IV.
Extract (Buffer, Lock_Key, Lock_IV, Config.Dir, Hmac);
Extract (Buffer, Lock_Key, Lock_IV, Config.Data, Hmac);
Extract (Buffer, Lock_Key, Lock_IV, Config.Key, Hmac);
Util.Encoders.HMAC.SHA256.Finish (Hmac, Result);
return Result = Buf.Data (Buffer.Pos + 1 .. Buffer.Pos + Result'Length);
end Verify_PBKDF2;
-- ------------------------------
-- Save the wallet config encryption keys in the key slot and protect that
-- key using the user's password. New salts and counters are generated and
-- the user's password is passed through PBKDF2 to get the encryption key
-- that protects the key slot.
-- ------------------------------
procedure Save_Key (Manager : in out Key_Manager;
Buffer : in out Marshallers.Marshaller;
Password : in out Keystore.Passwords.Provider'Class;
Slot : in Key_Slot;
Config : in Wallet_Config;
Stream : in out IO.Wallet_Stream'Class) is
procedure Save_GPG_Key (Password : in out Keystore.Passwords.Slot_Provider'Class);
procedure Save_PBKDF2_Key;
Slot_Sign : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Hmac : Util.Encoders.HMAC.SHA256.Context;
Result : Util.Encoders.SHA256.Hash_Array;
Buf : constant Buffers.Buffer_Accessor := Buffer.Buffer.Data.Value;
procedure Save_PBKDF2_Key is
procedure Get_Password (Secret : in Secret_Key);
Lock_Key : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Lock_IV : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Salt_Key : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Salt_IV : Secret_Key (Length => Util.Encoders.AES.AES_256_Length);
Counter_Key : Positive;
Counter_IV : Positive;
-- Generate a derived key from the password, salt, counter.
procedure Get_Password (Secret : in Secret_Key) is
begin
PBKDF2_HMAC_SHA256 (Password => Secret,
Salt => Salt_IV,
Counter => Counter_IV,
Result => Lock_IV);
end Get_Password;
begin
-- Make a first random counter in range 100_000 .. 1_148_575.
Counter_Key := 1 + Natural (Manager.Random.Generate mod Config.Max_Counter);
if Counter_Key < Positive (Config.Min_Counter) then
Counter_Key := Positive (Config.Min_Counter);
end if;
-- Make a second random counter in range 100_000 .. 372_140.
Counter_IV := 1 + Natural (Manager.Random.Generate mod Config.Max_Counter);
if Counter_IV < Positive (Config.Min_Counter) then
Counter_IV := Positive (Config.Min_Counter);
end if;
Manager.Random.Generate (Salt_Key);
Manager.Random.Generate (Salt_IV);
Marshallers.Put_Unsigned_32 (Buffer, WH_KEY_PBKDF2);
Marshallers.Put_Unsigned_32 (Buffer, Interfaces.Unsigned_32 (Lock_Key.Length));
Marshallers.Put_Unsigned_32 (Buffer, Interfaces.Unsigned_32 (Counter_Key));
Marshallers.Put_Unsigned_32 (Buffer, Interfaces.Unsigned_32 (Counter_IV));
Marshallers.Put_Secret (Buffer, Salt_Key, Manager.Crypt.Key, Manager.Crypt.IV);
Marshallers.Put_Secret (Buffer, Salt_IV, Manager.Crypt.Key, Manager.Crypt.IV);
Marshallers.Put_Secret (Buffer, Slot_Sign, Manager.Crypt.Key, Manager.Crypt.IV);
Password.Get_Password (Get_Password'Access);
PBKDF2_HMAC_SHA256 (Password => Lock_IV,
Salt => Salt_Key,
Counter => Counter_Key,
Result => Lock_Key);
Save (Buffer, Lock_Key, Lock_IV, Config.Dir, Hmac);
Save (Buffer, Lock_Key, Lock_IV, Config.Data, Hmac);
Save (Buffer, Lock_Key, Lock_IV, Config.Key, Hmac);
end Save_PBKDF2_Key;
procedure Save_GPG_Key (Password : in out Keystore.Passwords.Slot_Provider'Class) is
procedure Get_Key (Key : in Secret_Key;
IV : in Secret_Key);
procedure Get_Key (Key : in Secret_Key;
IV : in Secret_Key) is
begin
Marshallers.Put_Unsigned_32 (Buffer, Password.Get_Tag);
Marshallers.Put_Secret (Buffer, Slot_Sign, Manager.Crypt.Key, Manager.Crypt.IV);
Save (Buffer, Key, IV, Config.Dir, Hmac);
Save (Buffer, Key, IV, Config.Data, Hmac);
Save (Buffer, Key, IV, Config.Key, Hmac);
end Get_Key;
begin
Marshallers.Put_Unsigned_32 (Buffer, WH_KEY_GPG2);
Password.Get_Key (Get_Key'Access);
end Save_GPG_Key;
begin
Log.Info ("Saving key for wallet {0}", To_String (Config.UUID));
Manager.Random.Generate (Slot_Sign);
-- Build a signature from the lock key.
Util.Encoders.HMAC.SHA256.Set_Key (Hmac, Slot_Sign);
Buffer.Pos := Key_Position (Slot);
Buf.Data (Buffer.Pos + 1 .. Buffer.Pos + WH_KEY_SIZE) := (others => 0);
if Password in Keystore.Passwords.Slot_Provider'Class then
Save_GPG_Key (Keystore.Passwords.Slot_Provider'Class (Password));
else
Save_PBKDF2_Key;
end if;
Util.Encoders.HMAC.SHA256.Finish (Hmac, Result);
Buf.Data (Buffer.Pos + 1 .. Buffer.Pos + Result'Length) := Result;
Set_IV (Manager.Crypt, Buffer.Buffer.Block.Block);
Stream.Write (Cipher => Manager.Crypt.Cipher,
Sign => Manager.Crypt.Sign,
From => Buffer.Buffer);
end Save_Key;
-- ------------------------------
-- Erase the walley key slot amd save the waller master block.
-- ------------------------------
procedure Erase_Key (Manager : in out Key_Manager;
Buffer : in out Marshallers.Marshaller;
Slot : in Key_Slot;
Stream : in out IO.Wallet_Stream'Class) is
Buf : constant Buffers.Buffer_Accessor := Buffer.Buffer.Data.Value;
begin
Buffer.Pos := Key_Position (Slot);
Buf.Data (Buffer.Pos + 1 .. Buffer.Pos + WH_KEY_SIZE) := (others => 0);
Stream.Write (Cipher => Manager.Crypt.Cipher,
Sign => Manager.Crypt.Sign,
From => Buffer.Buffer);
end Erase_Key;
-- ------------------------------
-- Load the wallet header keys
-- ------------------------------
procedure Load (Manager : in out Key_Manager;
Block : in Keystore.IO.Storage_Block;
Ident : in Wallet_Identifier;
Buffer : in out IO.Marshaller;
Root : out Keystore.IO.Storage_Block;
UUID : out UUID_Type;
Stream : in out IO.Wallet_Stream'Class) is
Value : Interfaces.Unsigned_32;
Size : IO.Block_Index;
begin
Keystore.Logs.Info (Log, "Loading master block{0}", Block);
Set_IV (Manager.Crypt, Block.Block);
Buffer.Buffer := Buffers.Allocate (Block);
Manager.Header_Block := Block;
begin
Stream.Read (Decipher => Manager.Crypt.Decipher,
Sign => Manager.Crypt.Sign,
Decrypt_Size => Size,
Into => Buffer.Buffer);
exception
when Invalid_Signature =>
Keystore.Logs.Warn (Log, "Invalid signature for wallet block{0}," &
" may be an invalid wallet key was used",
Manager.Header_Block);
raise Bad_Password;
end;
if Marshallers.Get_Header_16 (Buffer) /= IO.BT_WALLET_HEADER then
Keystore.Logs.Warn (Log, "Invalid wallet block header BN{0}", Manager.Header_Block);
raise Invalid_Block;
end if;
Marshallers.Skip (Buffer, 2);
Value := Marshallers.Get_Unsigned_32 (Buffer);
Marshallers.Skip (Buffer, 8);
if Marshallers.Get_Unsigned_32 (Buffer) /= WH_MAGIC then
Keystore.Logs.Warn (Log, "Invalid wallet magic in header BN{0}", Manager.Header_Block);
raise Invalid_Block;
end if;
Value := Marshallers.Get_Unsigned_32 (Buffer);
if Value /= 1 then
Log.Warn ("Version{0} not supported in header BN{0}",
Interfaces.Unsigned_32'Image (Value),
IO.Block_Number'Image (Manager.Header_Block.Block));
raise Invalid_Block;
end if;
Value := Marshallers.Get_Unsigned_32 (Buffer);
if Value /= Interfaces.Unsigned_32 (Ident) then
Log.Warn ("Wallet id{0} does not match in header BN{0}",
Interfaces.Unsigned_32'Image (Value),
IO.Block_Number'Image (Manager.Header_Block.Block));
raise Invalid_Block;
end if;
Value := Marshallers.Get_Unsigned_32 (Buffer);
if Value = 0 then
Log.Warn ("Wallet block{0} is invalid in header BN{0}",
Interfaces.Unsigned_32'Image (Value),
IO.Block_Number'Image (Manager.Header_Block.Block));
raise Invalid_Block;
end if;
Root.Storage := Block.Storage;
Root.Block := IO.Block_Number (Value);
-- Extract wallet uuid.
Marshallers.Get_UUID (Buffer, UUID);
end Load;
-- Open the key manager and read the wallet header block. Use the secret key
-- to decrypt/encrypt the wallet header block.
procedure Open (Manager : in out Key_Manager;
Password : in out Keystore.Passwords.Provider'Class;
Ident : in Wallet_Identifier;
Block : in Keystore.IO.Storage_Block;
Root : out Keystore.IO.Storage_Block;
Config : in out Wallet_Config;
Process : access procedure (Buffer : in out Marshallers.Marshaller;
Slot : in Key_Slot);
Stream : in out IO.Wallet_Stream'Class) is
procedure Open (Password : in out Keystore.Passwords.Slot_Provider'Class);
Value : Interfaces.Unsigned_32;
Buffer : Marshallers.Marshaller;
procedure Open (Password : in out Keystore.Passwords.Slot_Provider'Class) is
begin
while Password.Has_Password loop
for Slot in Key_Slot'Range loop
Buffer.Pos := Key_Position (Slot);
Value := Marshallers.Get_Unsigned_32 (Buffer);
if Value = WH_KEY_GPG2 then
Value := Marshallers.Get_Unsigned_32 (Buffer);
if Value = Password.Get_Tag then
if Verify_GPG (Manager, Buffer, Password, Config) then
Config.Slot := Slot;
if Process /= null then
Process (Buffer, Slot);
end if;
return;
end if;
end if;
end if;
end loop;
Password.Next;
end loop;
Keystore.Logs.Info (Log, "No password match for wallet block{0}", Manager.Header_Block);
raise Bad_Password;
end Open;
begin
Load (Manager, Block, Ident, Buffer, Root, Config.UUID, Stream);
-- See which key slot is used.
for Slot in Key_Slot'Range loop
Buffer.Pos := Key_Position (Slot);
Value := Marshallers.Get_Unsigned_32 (Buffer);
Config.Keys (Slot) := Value /= 0;
end loop;
if Password in Keystore.Passwords.Slot_Provider'Class then
Open (Keystore.Passwords.Slot_Provider'Class (Password));
else
for Slot in Key_Slot'Range loop
Buffer.Pos := Key_Position (Slot);
Value := Marshallers.Get_Unsigned_32 (Buffer);
if Value = WH_KEY_PBKDF2 then
Value := Marshallers.Get_Unsigned_32 (Buffer);
if Value > 0 and Value <= WH_KEY_SIZE then
if Verify_PBKDF2 (Manager, Buffer, Password, Positive (Value), Config) then
Config.Slot := Slot;
if Process /= null then
Process (Buffer, Slot);
end if;
return;
end if;
end if;
end if;
end loop;
Keystore.Logs.Info (Log, "No password match for wallet block{0}", Manager.Header_Block);
raise Bad_Password;
end if;
end Open;
procedure Create (Manager : in out Key_Manager;
Password : in out Keystore.Passwords.Provider'Class;
Slot : in Key_Slot;
Ident : in Wallet_Identifier;
Block : in Keystore.IO.Storage_Block;
Root : in Keystore.IO.Storage_Block;
Config : in out Wallet_Config;
Stream : in out IO.Wallet_Stream'Class) is
Buffer : IO.Marshaller;
begin
Buffer.Buffer := Buffers.Allocate (Block);
Generate (Manager, Config.Data);
Generate (Manager, Config.Dir);
Generate (Manager, Config.Key);
Manager.Random.Generate (Config.UUID);
Manager.Header_Block := Block;
-- Build wallet header.
if Config.Randomize then
Manager.Random.Generate (Buffer.Buffer.Data.Value.Data);
else
Buffer.Buffer.Data.Value.Data := (others => 0);
end if;
Marshallers.Set_Header (Into => Buffer,
Tag => IO.BT_WALLET_HEADER,
Id => Ident);
Marshallers.Put_Unsigned_32 (Buffer, WH_MAGIC);
Marshallers.Put_Unsigned_32 (Buffer, 1);
Marshallers.Put_Unsigned_32 (Buffer, Interfaces.Unsigned_32 (Ident));
Marshallers.Put_Unsigned_32 (Buffer, Interfaces.Unsigned_32 (Root.Block));
-- Write wallet uuid.
Marshallers.Put_UUID (Buffer, Config.UUID);
if Config.Randomize then
for Slot in Key_Slot'Range loop
Buffer.Pos := Key_Position (Slot);
Marshallers.Put_Unsigned_32 (Buffer, 0);
end loop;
end if;
Save_Key (Manager, Buffer, Password, Slot, Config, Stream);
end Create;
-- ------------------------------
-- Create a new masker keys for a children wallet and save the new keys in the buffer.
-- ------------------------------
procedure Create_Master_Key (Manager : in out Key_Manager;
Buffer : in out Marshallers.Marshaller;
Crypt : in Cryptor) is
begin
Manager.Random.Generate (Manager.Crypt.Key);
Manager.Random.Generate (Manager.Crypt.IV);
Manager.Crypt.Decipher.Set_Key (Manager.Crypt.Key, Util.Encoders.AES.CBC);
Manager.Crypt.Decipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
Manager.Crypt.Cipher.Set_Key (Manager.Crypt.Key, Util.Encoders.AES.CBC);
Manager.Crypt.Cipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
Marshallers.Put_Secret (Buffer, Manager.Crypt.Key, Crypt.Key, Crypt.IV);
Marshallers.Put_Secret (Buffer, Manager.Crypt.IV, Crypt.Key, Crypt.IV);
end Create_Master_Key;
-- ------------------------------
-- Extract from the buffer the master keys to open the children wallet.
-- ------------------------------
procedure Load_Master_Key (Manager : in out Key_Manager;
Buffer : in out Marshallers.Marshaller;
Crypt : in Cryptor) is
begin
Marshallers.Get_Secret (Buffer, Manager.Crypt.Key, Crypt.Key, Crypt.IV);
Marshallers.Get_Secret (Buffer, Manager.Crypt.IV, Crypt.Key, Crypt.IV);
Manager.Crypt.Decipher.Set_Key (Manager.Crypt.Key, Util.Encoders.AES.CBC);
Manager.Crypt.Decipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
Manager.Crypt.Cipher.Set_Key (Manager.Crypt.Key, Util.Encoders.AES.CBC);
Manager.Crypt.Cipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
end Load_Master_Key;
-- ------------------------------
-- Set the master key by using the password provider.
-- ------------------------------
procedure Set_Master_Key (Manager : in out Key_Manager;
Password : in out Keystore.Passwords.Keys.Key_Provider'Class) is
begin
Password.Get_Keys (Manager.Crypt.Key, Manager.Crypt.IV, Manager.Crypt.Sign);
Manager.Crypt.Decipher.Set_Key (Manager.Crypt.Key, Util.Encoders.AES.CBC);
Manager.Crypt.Decipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
Manager.Crypt.Cipher.Set_Key (Manager.Crypt.Key, Util.Encoders.AES.CBC);
Manager.Crypt.Cipher.Set_Padding (Util.Encoders.AES.NO_PADDING);
end Set_Master_Key;
procedure Set_Key (Manager : in out Key_Manager;
Password : in out Keystore.Passwords.Provider'Class;
New_Password : in out Keystore.Passwords.Provider'Class;
Config : in Keystore.Wallet_Config;
Mode : in Mode_Type;
Ident : in Wallet_Identifier;
Block : in Keystore.IO.Storage_Block;
Stream : in out IO.Wallet_Stream'Class) is
procedure Process (Buffer : in out Marshallers.Marshaller;
Slot : in Key_Slot);
Local_Config : Wallet_Config;
Root : Keystore.IO.Storage_Block;
procedure Process (Buffer : in out Marshallers.Marshaller;
Slot : in Key_Slot) is
function Find_Free_Slot return Key_Slot;
function Find_Free_Slot return Key_Slot is
Value : Interfaces.Unsigned_32;
begin
for Slot in Key_Slot'Range loop
Buffer.Pos := Key_Position (Slot);
Value := Marshallers.Get_Unsigned_32 (Buffer);
if Value = 0 then
return Slot;
end if;
end loop;
Log.Info ("No available free slot to add a new key");
raise No_Key_Slot;
end Find_Free_Slot;
begin
Local_Config.Min_Counter := Unsigned_32 (Config.Min_Counter);
Local_Config.Max_Counter := Unsigned_32 (Config.Max_Counter);
case Mode is
when KEY_ADD =>
Save_Key (Manager, Buffer, New_Password, Find_Free_Slot,
Local_Config, Stream);
when KEY_REPLACE =>
Save_Key (Manager, Buffer, New_Password, Slot, Local_Config, Stream);
when KEY_REMOVE =>
Erase_Key (Manager, Buffer, Slot, Stream);
end case;
end Process;
begin
Open (Manager, Password, Ident, Block, Root, Local_Config,
Process'Access, Stream);
end Set_Key;
-- ------------------------------
-- Remove the key from the key slot identified by `Slot`. The password is necessary to
-- make sure a valid password is available. The `Remove_Current` must be set to remove
-- the slot when it corresponds to the used password.
-- ------------------------------
procedure Remove_Key (Manager : in out Key_Manager;
Password : in out Keystore.Passwords.Provider'Class;
Slot : in Key_Slot;
Remove_Current : in Boolean;
Ident : in Wallet_Identifier;
Block : in Keystore.IO.Storage_Block;
Stream : in out IO.Wallet_Stream'Class) is
procedure Process (Buffer : in out Marshallers.Marshaller;
Password_Slot : in Key_Slot);
procedure Process (Buffer : in out Marshallers.Marshaller;
Password_Slot : in Key_Slot) is
begin
if Slot /= Password_Slot or Remove_Current then
Erase_Key (Manager, Buffer, Slot, Stream);
else
Log.Info ("Refusing to delete key slot used by current password");
raise Used_Key_Slot;
end if;
end Process;
Local_Config : Wallet_Config;
Root : Keystore.IO.Storage_Block;
begin
Open (Manager, Password, Ident, Block, Root, Local_Config,
Process'Access, Stream);
end Remove_Key;
end Keystore.Keys;
|
30,203
|
ada
| 12
|
TUM-EI-RCS/StratoX
|
tests/sparkada/src/main.adb
|
<reponame>TUM-EI-RCS/StratoX
procedure main is
function foo (x : integer) return integer with
Pre => x < Integer'Last
is
begin
return x+1;
end foo;
pragma Precondition (x < Integer'Last);
x, y: integer;
begin
x:= Integer'Last;
y := foo(x);
end main;
|
30,204
|
ada
| 1
|
vidkidz/crossbridge
|
llvm-gcc-4.2-2.9/gcc/ada/exp_code.ads
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ C O D E --
-- --
-- S p e c --
-- --
-- Copyright (C) 1996 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Processing for handling code statements
with Types; use Types;
with System; use System;
package Exp_Code is
procedure Expand_Asm_Call (N : Node_Id);
-- Expands a call to Asm or Asm_Volatile into an equivalent
-- N_Code_Statement node.
-- The following routines provide an abstract interface to analyze
-- code statements, for use by Gigi processing for code statements.
-- Note that the implementations of these routines must not attempt
-- to expand tables that are frozen on entry to Gigi.
function Is_Asm_Volatile (N : Node_Id) return Boolean;
-- Given an N_Code_Statement node N, return True in the Asm_Volatile
-- case and False in the Asm case.
function Asm_Template (N : Node_Id) return Node_Id;
-- Given an N_Code_Statement node N, returns string literal node for
-- template in call
procedure Clobber_Setup (N : Node_Id);
-- Given an N_Code_Statement node N, setup to process the clobber list
-- with subsequent calls to Clobber_Get_Next.
function Clobber_Get_Next return System.Address;
-- Can only be called after a previous call to Clobber_Setup. The
-- returned value is a pointer to a null terminated (C format) string
-- for the next register argument. Null_Address is returned when there
-- are no more arguments.
procedure Setup_Asm_Inputs (N : Node_Id);
-- Given an N_Code_Statement node N, setup to read list of Asm_Input
-- arguments. The protocol is to construct a loop as follows:
--
-- Setup_Asm_Inputs (N);
-- while Present (Asm_Input_Value)
-- body
-- Next_Asm_Input;
-- end loop;
--
-- where the loop body calls Asm_Input_Constraint or Asm_Input_Value to
-- obtain the constraint string or input value expression from the current
-- Asm_Input argument.
function Asm_Input_Constraint return Node_Id;
-- Called within a loop initialized by Setup_Asm_Inputs and controlled
-- by Next_Asm_Input as described above. Returns a string literal node
-- for the constraint component of the current Asm_Input_Parameter, or
-- Empty if there are no more Asm_Input parameters.
function Asm_Input_Value return Node_Id;
-- Called within a loop initialized by Setup_Asm_Inputs and controlled
-- by Next_Asm_Input as described above. Returns the expression node for
-- the value component of the current Asm_Input parameter, or Empty if
-- there are no more Asm_Input parameters.
procedure Next_Asm_Input;
-- Step to next Asm_Input parameter. It is an error to call this procedure
-- if there are no more available parameters (which is impossible if the
-- call appears in a loop as in the above example).
procedure Setup_Asm_Outputs (N : Node_Id);
-- Given an N_Code_Statement node N, setup to read list of Asm_Output
-- arguments. The protocol is to construct a loop as follows:
--
-- Setup_Asm_Outputs (N);
-- while Present (Asm_Output_Value)
-- body
-- Next_Asm_Output;
-- end loop;
--
-- where the loop body calls Asm_Output_Constraint or Asm_Output_Variable
-- to obtain the constraint string or output variable name from the current
-- Asm_Output argument.
function Asm_Output_Constraint return Node_Id;
-- Called within a loop initialized by Setup_Asm_Outputs and controlled
-- by Next_Asm_Output as described above. Returns a string literal node
-- for the constraint component of the current Asm_Output_Parameter, or
-- Empty if there are no more Asm_Output parameters.
function Asm_Output_Variable return Node_Id;
-- Called within a loop initialized by Setup_Asm_Outputs and controlled
-- by Next_Asm_Output as described above. Returns the expression node for
-- the output variable component of the current Asm_Output parameter, or
-- Empty if there are no more Asm_Output parameters.
procedure Next_Asm_Output;
-- Step to next Asm_Output parameter. It is an error to call this procedure
-- if there are no more available parameters (which is impossible if the
-- call appears in a loop as in the above example).
end Exp_Code;
|
30,205
|
ada
| 1
|
LaudateCorpus1/RosettaCodeData
|
Task/Inverted-index/Ada/inverted-index-7.ada
|
package body Generic_Inverted_Index is
-- uses some of the new Ada 2012 syntax
use Source_Vecs;
procedure Store(Storage: in out Storage_Type;
Source: Source_Type;
Item: Item_Type) is
use type Maps.Cursor;
begin
if (Storage.Find(Item) = Maps.No_Element) then
Storage.Insert(Key => Item,
New_Item => Empty_Vector & Source);
else
declare
The_Vector: Vector := Storage.Element(Item);
begin
if The_Vector.Last_Element /= Source then
Storage.Replace
(Key => Item,
New_Item => Storage.Element(Item) & Source);
end if;
end;
end if;
end Store;
function Find(Storage: Storage_Type; Item: Item_Type)
return Vector is
begin
return Storage.Element(Item);
exception
when Constraint_Error => return Empty_Vector; -- found nothing
end Find;
function Is_In(S: Source_Type; V: Vector) return Boolean is
begin
for Some_Element of V loop
if Some_Element = S then
return True;
end if;
end loop;
return False;
end Is_In;
function "and"(Left, Right: Vector) return Vector is
V: Vector := Empty_Vector;
begin
for Some_Element of Left loop
if Is_In(Some_Element, Right) then
V := V & Some_Element;
end if;
end loop;
return V;
end "and";
function "or"(Left, Right: Vector) return Vector is
V: Vector := Left; -- all sources in Left
begin
for Some_Element of Right loop
if not Is_In(Some_Element, Left) then
V := V & Some_Element;
end if;
end loop;
return V;
end "or";
function Empty(Vec: Vector) return Boolean
renames Is_Empty;
procedure Iterate(The_Sources: Vector) is
begin
for Some_Element in The_Sources loop
Do_Something(Element(Some_Element));
end loop;
end Iterate;
function Same_Vector(U,V: Vector) return Boolean is
begin
raise Program_Error with "there is no need to call this function";
return False; -- this avoices a compiler warning
end Same_Vector;
end Generic_Inverted_Index;
|
30,206
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/size_clause2.ads
|
-- { dg-do compile }
-- { dg-options "-gnatws" }
package Size_Clause2 is
-- The alignment of the record is capped to the greatest power of 2
-- factor of the size, so that the real size is 40 too and the size
-- of a component of type R1 in a packed record can be 40.
type R1 is record
I : Integer;
B : aliased Boolean;
end record;
for R1'Size use 40;
type S1 is record
rr : R1; -- size must be 40
end record;
pragma Pack(S1);
-- The record is explicitly given alignment 1 so its real type is 40 too.
-- The size of a component of type R2 in a packed record is naturally 40.
type R2 is record
I : Integer;
B : aliased Boolean;
end record;
for R2'Size use 40;
for R2'Alignment use 1;
type S2 is record
rr : R2; -- size must be 40
end record;
pragma Pack(S2);
-- The record is explicitly given alignment 4 so its real type is 64.
-- That's not OK, because the size of a component of type R3 in a packed
-- record cannot be 40 so the size clause is violated.
type R3 is record
I : Integer;
B : aliased Boolean;
end record;
for R3'Size use 40; -- { dg-error "size for .R3. too small" }
for R3'Alignment use 4;
type S3 is record
rr : R3; -- size must be 40
end record;
pragma Pack(S3);
end Size_Clause2;
|
30,207
|
ada
| 33
|
ytomino/drake
|
source/interfaces/machine-pc-linux-gnu/s-cencod.adb
|
with System.UTF_Conversions;
package body System.C_Encoding is
use type C.size_t;
use type C.wchar_t;
-- implementation of Character (UTF-8) from/to char (UTF-8)
function To_char (
Item : Character;
Substitute : C.char)
return C.char
is
pragma Unreferenced (Substitute);
begin
return C.char (Item);
end To_char;
function To_Character (
Item : C.char;
Substitute : Character)
return Character
is
pragma Unreferenced (Substitute);
begin
return Character (Item);
end To_Character;
procedure To_Non_Nul_Terminated (
Item : String;
Target : out C.char_array;
Count : out C.size_t;
Substitute : C.char_array)
is
pragma Unreferenced (Substitute);
begin
Count := Item'Length;
if Count > 0 then
if Count > Target'Length then
raise Constraint_Error;
end if;
declare
Item_As_C : C.char_array (0 .. Count - 1);
for Item_As_C'Address use Item'Address;
begin
Target (Target'First .. Target'First + (Count - 1)) := Item_As_C;
end;
end if;
end To_Non_Nul_Terminated;
procedure From_Non_Nul_Terminated (
Item : C.char_array;
Target : out String;
Count : out Natural;
Substitute : String)
is
pragma Unreferenced (Substitute);
begin
Count := Item'Length;
if Count > Target'Length then
raise Constraint_Error;
end if;
declare
Item_As_Ada : String (1 .. Count);
for Item_As_Ada'Address use Item'Address;
begin
Target (Target'First .. Target'First + (Count - 1)) := Item_As_Ada;
end;
end From_Non_Nul_Terminated;
-- implementation of Wide_Character (UTF-16) from/to wchar_t (UTF-32)
function To_wchar_t (
Item : Wide_Character;
Substitute : C.wchar_t)
return C.wchar_t is
begin
if Wide_Character'Pos (Item) in 16#d800# .. 16#dfff# then
return Substitute;
else
return C.wchar_t'Val (Wide_Character'Pos (Item));
end if;
end To_wchar_t;
function To_Wide_Character (
Item : C.wchar_t;
Substitute : Wide_Character)
return Wide_Character is
begin
if Item > C.wchar_t'Val (16#ffff#) then
-- a check for detecting illegal sequence are omitted
return Substitute;
else
return Wide_Character'Val (C.wchar_t'Pos (Item));
end if;
end To_Wide_Character;
procedure To_Non_Nul_Terminated (
Item : Wide_String;
Target : out C.wchar_t_array;
Count : out C.size_t;
Substitute : C.wchar_t_array)
is
Item_Index : Positive := Item'First;
begin
Count := 0;
if Item_Index <= Item'Last then
declare
Target_As_Ada : Wide_Wide_String (1 .. Target'Length);
for Target_As_Ada'Address use Target'Address;
Target_Index : C.size_t := Target'First;
begin
loop
declare
Code : UTF_Conversions.UCS_4;
Item_Used : Natural;
From_Status : UTF_Conversions.From_Status_Type;
Target_Ada_Last : Natural;
Target_Last : C.size_t;
To_Status : UTF_Conversions.To_Status_Type;
begin
UTF_Conversions.From_UTF_16 (
Item (Item_Index .. Item'Last),
Item_Used,
Code,
From_Status);
case From_Status is
when UTF_Conversions.Success =>
UTF_Conversions.To_UTF_32 (
Code,
Target_As_Ada (
Target_As_Ada'First
+ Integer (Target_Index - Target'First) ..
Target_As_Ada'Last),
Target_Ada_Last,
To_Status);
Target_Last := Target'First
+ C.size_t (Target_Ada_Last - Target_As_Ada'First);
case To_Status is
when UTF_Conversions.Success =>
null;
when UTF_Conversions.Overflow
| UTF_Conversions.Unmappable =>
-- all values of UTF-16 are mappable to UTF-32
raise Constraint_Error;
end case;
when UTF_Conversions.Illegal_Sequence
| UTF_Conversions.Non_Shortest
| UTF_Conversions.Truncated =>
-- Non_Shortest does not returned in UTF-16.
Target_Last := Target_Index + (Substitute'Length - 1);
if Target_Last > Target'Last then
raise Constraint_Error; -- overflow
end if;
Target (Target_Index .. Target_Last) := Substitute;
end case;
Count := Target_Last - Target'First + 1;
exit when Item_Used >= Item'Last;
Item_Index := Item_Used + 1;
Target_Index := Target_Last + 1;
end;
end loop;
end;
end if;
end To_Non_Nul_Terminated;
procedure From_Non_Nul_Terminated (
Item : C.wchar_t_array;
Target : out Wide_String;
Count : out Natural;
Substitute : Wide_String)
is
Item_Index : C.size_t := Item'First;
begin
Count := 0;
if Item_Index <= Item'Last then
declare
Item_As_Ada : Wide_Wide_String (1 .. Item'Length);
for Item_As_Ada'Address use Item'Address;
Target_Index : Positive := Target'First;
begin
loop
declare
Code : UTF_Conversions.UCS_4;
Item_Ada_Used : Natural;
Item_Used : C.size_t;
From_Status : UTF_Conversions.From_Status_Type;
Target_Last : Natural;
To_Status : UTF_Conversions.To_Status_Type;
Put_Substitute : Boolean;
begin
UTF_Conversions.From_UTF_32 (
Item_As_Ada (
Item_As_Ada'First
+ Integer (Item_Index - Item'First) ..
Item_As_Ada'Last),
Item_Ada_Used,
Code,
From_Status);
Item_Used :=
Item'First + C.size_t (Item_Ada_Used - Item_As_Ada'First);
case From_Status is
when UTF_Conversions.Success =>
UTF_Conversions.To_UTF_16 (
Code,
Target (Target_Index .. Target'Last),
Target_Last,
To_Status);
case To_Status is
when UTF_Conversions.Success =>
Put_Substitute := False;
when UTF_Conversions.Overflow =>
raise Constraint_Error;
when UTF_Conversions.Unmappable =>
Put_Substitute := True;
end case;
when UTF_Conversions.Illegal_Sequence
| UTF_Conversions.Non_Shortest
| UTF_Conversions.Truncated =>
-- Non_Shortest and Truncated do not returned in
-- UTF-32.
Put_Substitute := True;
end case;
if Put_Substitute then
Target_Last := Target_Index + (Substitute'Length - 1);
if Target_Last > Target'Last then
raise Constraint_Error; -- overflow
end if;
Target (Target_Index .. Target_Last) := Substitute;
end if;
Count := Target_Last - Target'First + 1;
exit when Item_Used >= Item'Last;
Item_Index := Item_Used + 1;
Target_Index := Target_Last + 1;
end;
end loop;
end;
end if;
end From_Non_Nul_Terminated;
-- Wide_Wide_Character (UTF-32) from/to wchar_t (UTF-32)
function To_wchar_t (
Item : Wide_Wide_Character;
Substitute : C.wchar_t)
return C.wchar_t
is
pragma Unreferenced (Substitute);
begin
return C.wchar_t'Val (Wide_Wide_Character'Pos (Item));
end To_wchar_t;
function To_Wide_Wide_Character (
Item : C.wchar_t;
Substitute : Wide_Wide_Character)
return Wide_Wide_Character
is
pragma Unreferenced (Substitute);
begin
return Wide_Wide_Character'Val (C.wchar_t'Pos (Item));
end To_Wide_Wide_Character;
procedure To_Non_Nul_Terminated (
Item : Wide_Wide_String;
Target : out C.wchar_t_array;
Count : out C.size_t;
Substitute : C.wchar_t_array)
is
pragma Unreferenced (Substitute);
begin
Count := Item'Length;
if Count > 0 then
if Count > Target'Length then
raise Constraint_Error;
end if;
declare
Item_As_C : C.wchar_t_array (0 .. Count - 1);
for Item_As_C'Address use Item'Address;
begin
Target (Target'First .. Target'First + (Count - 1)) := Item_As_C;
end;
end if;
end To_Non_Nul_Terminated;
procedure From_Non_Nul_Terminated (
Item : C.wchar_t_array;
Target : out Wide_Wide_String;
Count : out Natural;
Substitute : Wide_Wide_String)
is
pragma Unreferenced (Substitute);
begin
Count := Item'Length;
if Count > Target'Length then
raise Constraint_Error;
end if;
declare
Item_As_Ada : Wide_Wide_String (1 .. Count);
for Item_As_Ada'Address use Item'Address;
begin
Target (Target'First .. Target'First + (Count - 1)) := Item_As_Ada;
end;
end From_Non_Nul_Terminated;
end System.C_Encoding;
|
30,208
|
ada
| 488
|
ouankou/rose
|
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/empty_package.ads
|
package Empty_Package is
end Empty_Package;
|
30,209
|
ada
| 52
|
onox/orka
|
orka/src/gl/interface/gl-types-indirect.ads
|
<filename>orka/src/gl/interface/gl-types-indirect.ads
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <<EMAIL>>
--
-- 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 Interfaces.C.Pointers;
with Ada.Unchecked_Deallocation;
package GL.Types.Indirect is
pragma Preelaborate;
type Half_Array_Access is access Half_Array;
type Single_Array_Access is access Single_Array;
type UInt_Array_Access is access UInt_Array;
procedure Free_Array is new Ada.Unchecked_Deallocation
(Object => Half_Array, Name => Half_Array_Access);
procedure Free_Array is new Ada.Unchecked_Deallocation
(Object => Single_Array, Name => Single_Array_Access);
procedure Free_Array is new Ada.Unchecked_Deallocation
(Object => UInt_Array, Name => UInt_Array_Access);
-----------------------------------------------------------------------------
type Arrays_Indirect_Command is record
Count, Instances, First_Vertex, Base_Instance : UInt;
end record;
type Elements_Indirect_Command is record
Count, Instances, First_Index, Base_Vertex, Base_Instance : UInt;
end record;
type Arrays_Indirect_Command_Array is array (Size range <>)
of aliased Arrays_Indirect_Command
with Convention => C;
type Elements_Indirect_Command_Array is array (Size range <>)
of aliased Elements_Indirect_Command
with Convention => C;
package Arrays_Indirect_Command_Pointers is new Interfaces.C.Pointers
(Size, Arrays_Indirect_Command,
Arrays_Indirect_Command_Array, Arrays_Indirect_Command'(others => 0));
package Elements_Indirect_Command_Pointers is new Interfaces.C.Pointers
(Size, Elements_Indirect_Command,
Elements_Indirect_Command_Array, Elements_Indirect_Command'(others => 0));
-----------------------------------------------------------------------------
type Dispatch_Indirect_Command is record
Group_X, Groups_Y, Groups_Z : UInt;
end record;
type Dispatch_Indirect_Command_Array is array (Size range <>)
of aliased Dispatch_Indirect_Command
with Convention => C;
package Dispatch_Indirect_Command_Pointers is new Interfaces.C.Pointers
(Size, Dispatch_Indirect_Command,
Dispatch_Indirect_Command_Array, Dispatch_Indirect_Command'(others => 0));
end GL.Types.Indirect;
|
30,210
|
ada
| 0
|
My-Colaborations/ada-servlet
|
samples/openid.adb
|
-----------------------------------------------------------------------
-- openid -- Example of OpenID 2.0 Authentication
-- Copyright (C) 2011, 2012, 2013, 2015 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Text_IO;
with Ada.Exceptions;
with Ada.IO_Exceptions;
with ASF.Server.Web;
with ASF.Applications;
with ASF.Applications.Main;
with ASF.Servlets.Faces;
with ASF.Servlets.Files;
with ASF.Servlets.Measures;
with ASF.Filters.Dump;
with Util.Beans.Objects;
with Util.Log.Loggers;
with Users;
with AWS.Net.SSL;
with ASF.Security.Servlets;
procedure Openid is
use ASF.Applications;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Openid");
CONTEXT_PATH : constant String := "/openid";
CONFIG_PATH : constant String := "samples.properties";
App : aliased ASF.Applications.Main.Application;
Factory : ASF.Applications.Main.Application_Factory;
C : ASF.Applications.Config;
-- Application servlets.
Faces : aliased ASF.Servlets.Faces.Faces_Servlet;
Files : aliased ASF.Servlets.Files.File_Servlet;
Perf : aliased ASF.Servlets.Measures.Measure_Servlet;
Auth : aliased ASF.Security.Servlets.Request_Auth_Servlet;
Verify_Auth : aliased ASF.Security.Servlets.Verify_Auth_Servlet;
-- Debug filters.
Dump : aliased ASF.Filters.Dump.Dump_Filter;
-- Web application server
WS : ASF.Server.Web.AWS_Container;
begin
if not AWS.Net.SSL.Is_Supported then
Log.Error ("SSL is not supported by AWS.");
Log.Error ("SSL is required for the OpenID connector to connect to OpenID providers.");
Log.Error ("Please, rebuild AWS with SSL support.");
return;
end if;
begin
C.Load_Properties (CONFIG_PATH);
Util.Log.Loggers.Initialize (CONFIG_PATH);
exception
when Ada.IO_Exceptions.Name_Error =>
Log.Error ("Cannot read application configuration file {0}", CONFIG_PATH);
end;
App.Initialize (C, Factory);
App.Register ("samplesMsg", "samples");
App.Set_Global ("contextPath", "/openid");
-- Declare a global bean to identify this sample from within the XHTML files.
App.Set_Global ("sampleName", "openid");
App.Set_Global ("version", "0.1");
App.Set_Global ("user", Util.Beans.Objects.To_Object (Users.User'Access,
Util.Beans.Objects.STATIC));
-- Register the servlets and filters
App.Add_Servlet (Name => "faces", Server => Faces'Unchecked_Access);
App.Add_Servlet (Name => "files", Server => Files'Unchecked_Access);
App.Add_Servlet (Name => "auth", Server => Auth'Unchecked_Access);
App.Add_Servlet (Name => "verify-auth", Server => Verify_Auth'Unchecked_Access);
App.Add_Servlet (Name => "perf", Server => Perf'Unchecked_Access);
-- Register the filters
App.Add_Filter (Name => "perf", Filter => Perf'Unchecked_Access);
App.Add_Filter (Name => "dump", Filter => Dump'Unchecked_Access);
-- Define servlet mappings
App.Add_Mapping (Name => "faces", Pattern => "*.html");
App.Add_Mapping (Name => "files", Pattern => "*.css");
App.Add_Mapping (Name => "files", Pattern => "*.js");
App.Add_Mapping (Name => "files", Pattern => "*.png");
App.Add_Mapping (Name => "files", Pattern => "*.jpg");
App.Add_Mapping (Name => "verify-auth", Pattern => "/auth/verify");
App.Add_Mapping (Name => "auth", Pattern => "/auth/auth/*");
App.Add_Mapping (Name => "perf", Pattern => "/statistics.xml");
-- Install the debug filter.
App.Add_Filter_Mapping (Name => "perf", Pattern => "*.html");
App.Add_Filter_Mapping (Name => "dump", Pattern => "*.html");
App.Add_Filter_Mapping (Name => "perf", Pattern => "*.css");
App.Add_Filter_Mapping (Name => "dump", Pattern => "*.css");
App.Add_Filter_Mapping (Name => "perf", Pattern => "*.png");
App.Add_Filter_Mapping (Name => "dump", Pattern => "*.png");
App.Add_Filter_Mapping (Name => "perf", Pattern => "*.jpg");
App.Add_Filter_Mapping (Name => "dump", Pattern => "*.jpg");
App.Add_Filter_Mapping (Name => "perf", Pattern => "/auth/verify");
App.Add_Filter_Mapping (Name => "dump", Pattern => "/auth/verify");
App.Add_Filter_Mapping (Name => "perf", Pattern => "/auth/auth/*");
App.Add_Filter_Mapping (Name => "dump", Pattern => "/auth/auth/*");
WS.Register_Application (CONTEXT_PATH, App'Unchecked_Access);
Log.Info ("Connect you browser to: http://localhost:8080/openid/auth/login.html");
WS.Start;
delay 600.0;
App.Close;
exception
when E : others =>
Ada.Text_IO.Put_Line ("Exception in server: " &
Ada.Exceptions.Exception_Name (E) & ": " &
Ada.Exceptions.Exception_Message (E));
end Openid;
|
30,211
|
ada
| 0
|
pat-rogers/OpenUxAS
|
src/ada/src/route_aggregator_common.ads
|
<filename>src/ada/src/route_aggregator_common.ads<gh_stars>0
with Ada.Containers.Functional_Vectors;
with Ada.Containers.Functional_Sets;
with Ada.Containers.Functional_Maps;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Interfaces;
package Route_Aggregator_Common with SPARK_Mode is
type UInt32 is new Interfaces.Unsigned_32;
type Int64 is new Integer;
type Real32 is new Interfaces.IEEE_Float_32;
type Real64 is new Interfaces.IEEE_Float_64;
function Int64_Hash (X : Int64) return Ada.Containers.Hash_Type is
(Ada.Containers.Hash_Type'Mod (X));
package Int64_Sequences is new Ada.Containers.Functional_Vectors
(Index_Type => Positive,
Element_Type => Int64);
type Int64_Seq is new Int64_Sequences.Sequence;
package Int64_Sets is new Ada.Containers.Functional_Sets (Int64);
type Int64_Set is new Int64_Sets.Set;
package Int64_Maps is new Ada.Containers.Functional_Maps
(Int64, Int64);
type Int64_Map is new Int64_Maps.Map;
-- Messages are unbounded strings. To avoid having to prove that messages
-- do not overflow Integer'Last, we use a procedure which will truncate
-- the message if it is too long. We can justify that this should not
-- happen in practice.
procedure Append_To_Msg
(Msg : in out Unbounded_String;
Tail : String);
-- Append Tail to Msg if there is enough room in the unbounded string
end Route_Aggregator_Common;
|
30,212
|
ada
| 52
|
onox/orka
|
orka/src/orka/interface/orka-jobs-system.ads
|
<filename>orka/src/orka/interface/orka-jobs-system.ads<gh_stars>10-100
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2017 onox <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with System.Multiprocessors;
with Orka.Jobs.Executors;
with Orka.Jobs.Queues;
with Orka.Jobs.Workers;
generic
Maximum_Queued_Jobs : Positive;
-- Maximum number of jobs that can be enqueued
--
-- Should be no less than the largest width (number of jobs at a
-- particular level) of any job graph.
Maximum_Job_Graphs : Positive;
-- Maximum number of separate job graphs
--
-- For each job graph, a Future object is acquired. The number of
-- concurrent acquired objects is bounded by this number.
package Orka.Jobs.System is
package Queues is new Jobs.Queues
(Maximum_Graphs => Maximum_Job_Graphs,
Capacity => Maximum_Queued_Jobs);
Queue : aliased Queues.Queue;
Number_Of_Workers : constant Standard.System.Multiprocessors.CPU;
procedure Execute_GPU_Jobs;
-- Dequeue and execute GPU jobs in the calling task
procedure Shutdown;
private
package SM renames Standard.System.Multiprocessors;
use type SM.CPU;
Number_Of_Workers : constant SM.CPU := SM.Number_Of_CPUs - 1;
-- For n logical CPU's we spawn n - 1 workers (1 CPU is dedicated
-- to rendering)
package Executors is new Jobs.Executors
(Queues, Maximum_Enqueued_By_Job => Maximum_Queued_Jobs);
package Workers is new Jobs.Workers
(Executors, Queue'Access, "Worker", Number_Of_Workers);
procedure Shutdown renames Workers.Shutdown;
end Orka.Jobs.System;
|
30,213
|
ada
| 0
|
Letractively/ada-gen
|
src/gen-commands-database.adb
|
-----------------------------------------------------------------------
-- gen-commands-database -- Database creation from application model
-- Copyright (C) 2011, 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- 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 GNAT.Command_Line;
with GNAT.Expect;
with GNAT.OS_Lib;
with Ada.Text_IO;
with Ada.Strings.Fixed;
with Ada.IO_Exceptions;
with Ada.Directories;
with Ada.Exceptions;
with Util.Strings;
with Util.Files;
with Util.Log.Loggers;
with ADO.Drivers.Connections;
with ADO.Sessions.Factory;
with ADO.Statements;
with ADO.Queries;
with ADO.Parameters;
with System;
with Gen.Database.Model;
package body Gen.Commands.Database is
use GNAT.Command_Line;
use Util.Log;
Log : constant Loggers.Logger := Loggers.Create ("Gen.Commands.Database");
-- Check if the database with the given name exists.
function Has_Database (DB : in ADO.Sessions.Session'Class;
Name : in String) return Boolean;
-- Check if the database with the given name has some tables.
function Has_Tables (DB : in ADO.Sessions.Session'Class;
Name : in String) return Boolean;
-- Expect filter to print the command output/error
procedure Command_Output (Descriptor : in GNAT.Expect.Process_Descriptor'Class;
Data : in String;
Closure : in System.Address);
-- Execute the external command <b>Name</b> with the arguments in <b>Args</b>
-- and send the content of the file <b>Input</b> to that command.
procedure Execute_Command (Name : in String;
Args : in GNAT.OS_Lib.Argument_List;
Input : in String);
-- Create the MySQL tables in the database. The tables are created by launching
-- the external command 'mysql' and using the create-xxx-mysql.sql generated scripts.
procedure Create_Mysql_Tables (Name : in String;
Model : in String;
Config : in ADO.Drivers.Connections.Configuration;
Generator : in out Gen.Generator.Handler);
-- Create the database identified by the given name.
procedure Create_Database (DB : in ADO.Sessions.Master_Session;
Name : in String);
-- Create the user and grant him access to the database.
procedure Create_User_Grant (DB : in ADO.Sessions.Master_Session;
Name : in String;
User : in String;
Password : in String);
-- ------------------------------
-- Check if the database with the given name exists.
-- ------------------------------
function Has_Database (DB : in ADO.Sessions.Session'Class;
Name : in String) return Boolean is
Query : ADO.Queries.Context;
Stmt : ADO.Statements.Query_Statement;
begin
Query.Set_Query (Gen.Database.Model.Query_Database_List);
Stmt := DB.Create_Statement (Query);
Stmt.Execute;
while Stmt.Has_Elements loop
declare
D : constant String := Stmt.Get_String (0);
begin
if Name = D then
return True;
end if;
end;
Stmt.Next;
end loop;
return False;
end Has_Database;
-- ------------------------------
-- Check if the database with the given name has some tables.
-- ------------------------------
function Has_Tables (DB : in ADO.Sessions.Session'Class;
Name : in String) return Boolean is
Query : ADO.Queries.Context;
Stmt : ADO.Statements.Query_Statement;
begin
Query.Set_Query (Gen.Database.Model.Query_Table_List);
Stmt := DB.Create_Statement (Query);
Stmt.Bind_Param ("name", ADO.Parameters.Token (Name));
Stmt.Execute;
return Stmt.Has_Elements;
end Has_Tables;
-- ------------------------------
-- Create the database identified by the given name.
-- ------------------------------
procedure Create_Database (DB : in ADO.Sessions.Master_Session;
Name : in String) is
use Ada.Strings.Unbounded;
Query : ADO.Queries.Context;
Stmt : ADO.Statements.Query_Statement;
begin
Log.Info ("Creating database '{0}'", Name);
Query.Set_Query (Gen.Database.Model.Query_Create_Database);
Stmt := DB.Create_Statement (Query);
Stmt.Bind_Param ("name", ADO.Parameters.Token (Name));
Stmt.Execute;
end Create_Database;
-- ------------------------------
-- Create the user and grant him access to the database.
-- ------------------------------
procedure Create_User_Grant (DB : in ADO.Sessions.Master_Session;
Name : in String;
User : in String;
Password : in String) is
use Ada.Strings.Unbounded;
Query : ADO.Queries.Context;
Stmt : ADO.Statements.Query_Statement;
begin
Log.Info ("Granting access for user '{0}' to database '{1}'", User, Name);
if Password'Length > 0 then
Query.Set_Query (Gen.Database.Model.Query_Create_User_With_Password);
else
Query.Set_Query (Gen.Database.Model.Query_Create_User_No_Password);
end if;
Stmt := DB.Create_Statement (Query);
Stmt.Bind_Param ("name", ADO.Parameters.Token (Name));
Stmt.Bind_Param ("user", ADO.Parameters.Token (User));
if Password'Length > 0 then
Stmt.Bind_Param ("password", Password);
end if;
Stmt.Execute;
Query.Set_Query (Gen.Database.Model.Query_Flush_Privileges);
Stmt := DB.Create_Statement (Query);
Stmt.Execute;
end Create_User_Grant;
-- ------------------------------
-- Expect filter to print the command output/error
-- ------------------------------
procedure Command_Output (Descriptor : in GNAT.Expect.Process_Descriptor'Class;
Data : in String;
Closure : in System.Address) is
pragma Unreferenced (Descriptor, Closure);
begin
Log.Error ("{0}", Data);
end Command_Output;
-- ------------------------------
-- Execute the external command <b>Name</b> with the arguments in <b>Args</b>
-- and send the content of the file <b>Input</b> to that command.
-- ------------------------------
procedure Execute_Command (Name : in String;
Args : in GNAT.OS_Lib.Argument_List;
Input : in String) is
Proc : GNAT.Expect.Process_Descriptor;
Status : Integer;
Func : constant GNAT.Expect.Filter_Function := Command_Output'Access;
Result : GNAT.Expect.Expect_Match;
Content : Ada.Strings.Unbounded.Unbounded_String;
begin
Util.Files.Read_File (Path => Input, Into => Content);
GNAT.Expect.Non_Blocking_Spawn (Descriptor => Proc,
Command => Name,
Args => Args,
Buffer_Size => 4096,
Err_To_Out => True);
GNAT.Expect.Add_Filter (Descriptor => Proc,
Filter => Func,
Filter_On => GNAT.Expect.Output);
GNAT.Expect.Send (Descriptor => Proc,
Str => Ada.Strings.Unbounded.To_String (Content),
Add_LF => False,
Empty_Buffer => False);
GNAT.Expect.Expect (Proc, Result, ".*");
GNAT.Expect.Close (Descriptor => Proc,
Status => Status);
if Status = 0 then
Log.Info ("Database schema created successfully.");
else
Log.Error ("Error while creating the database schema.");
end if;
exception
when Ada.IO_Exceptions.Name_Error =>
Log.Error ("Cannot read {0}", Input);
end Execute_Command;
-- ------------------------------
-- Create the MySQL tables in the database. The tables are created by launching
-- the external command 'mysql' and using the create-xxx-mysql.sql generated scripts.
-- ------------------------------
procedure Create_Mysql_Tables (Name : in String;
Model : in String;
Config : in ADO.Drivers.Connections.Configuration;
Generator : in out Gen.Generator.Handler) is
Database : constant String := Config.Get_Database;
Username : constant String := Config.Get_Property ("user");
Password : constant String := Config.Get_Property ("password");
Dir : constant String := Util.Files.Compose (Model, "mysql");
File : constant String := Util.Files.Compose (Dir, "create-" & Name & "-mysql.sql");
begin
Log.Info ("Creating database tables using schema '{0}'", File);
if not Ada.Directories.Exists (File) then
Generator.Error ("SQL file '{0}' does not exist.", File);
Generator.Error ("Please, run the following command: dynamo generate db");
return;
end if;
if Password'Length > 0 then
declare
Args : GNAT.OS_Lib.Argument_List (1 .. 3);
begin
Args (1) := new String '("--user=" & Username);
Args (2) := new String '("--password=" & Password);
Args (3) := new String '(Database);
Execute_Command ("mysql", Args, File);
end;
else
declare
Args : GNAT.OS_Lib.Argument_List (1 .. 2);
begin
Args (1) := new String '("--user=" & Username);
Args (2) := new String '(Database);
Execute_Command ("mysql", Args, File);
end;
end if;
end Create_Mysql_Tables;
-- ------------------------------
-- Execute the command with the arguments.
-- ------------------------------
procedure Execute (Cmd : in Command;
Generator : in out Gen.Generator.Handler) is
pragma Unreferenced (Cmd);
use Ada.Strings.Unbounded;
procedure Create_Database (Model : in String;
Database : in String;
Username : in String;
Password : in String);
-- ------------------------------
-- Create the database, the user and the tables.
-- ------------------------------
procedure Create_Database (Model : in String;
Database : in String;
Username : in String;
Password : in String) is
Factory : ADO.Sessions.Factory.Session_Factory;
Config : ADO.Drivers.Connections.Configuration;
Root_Connection : Unbounded_String;
Pos : Natural;
begin
Config.Set_Connection (Database);
if Config.Get_Property ("user") = "" then
Generator.Error ("Invalid database connection: missing user property");
return;
end if;
if Config.Get_Database = "" then
Generator.Error ("Invalid database connection: no database name specified");
return;
end if;
-- Build a connection string to create the database.
Pos := Util.Strings.Index (Database, ':');
Append (Root_Connection, Database (Database'First .. Pos));
Append (Root_Connection, "//");
Append (Root_Connection, Config.Get_Server);
if Config.Get_Port > 0 then
Append (Root_Connection, ':');
Append (Root_Connection, Util.Strings.Image (Config.Get_Port));
end if;
Append (Root_Connection, "/?user=");
Append (Root_Connection, Username);
if Password'Length > 0 then
Append (Root_Connection, "&password=");
Append (Root_Connection, Password);
end if;
Log.Info ("Connecting to {0} for database setup", Root_Connection);
-- Initialize the session factory to connect to the
-- database defined by root connection (which should allow the database creation).
Factory.Create (To_String (Root_Connection));
declare
Name : constant String := Generator.Get_Project_Name;
DB : constant ADO.Sessions.Master_Session := Factory.Get_Master_Session;
begin
-- Create the database only if it does not already exists.
if not Has_Database (DB, Config.Get_Database) then
Create_Database (DB, Config.Get_Database);
end if;
-- If some tables exist, don't try to create tables again.
-- We could improve by reading the current database schema, comparing with our
-- schema and create what is missing (new tables, new columns).
if Has_Tables (DB, Config.Get_Database) then
Generator.Error ("The database {0} exists", Config.Get_Database);
else
-- Create the user grant. On MySQL, it is safe to do this several times.
Create_User_Grant (DB, Config.Get_Database,
Config.Get_Property ("user"),
Config.Get_Property ("password"));
-- And now create the tables by using the SQL script generated by Dyanmo.
Create_Mysql_Tables (Name, Model, Config, Generator);
end if;
-- Remember the database connection string.
Generator.Set_Project_Property ("database", Database);
Generator.Save_Project;
exception
when E : others =>
Generator.Error (Ada.Exceptions.Exception_Message (E));
end;
end Create_Database;
Model : constant String := Get_Argument;
Arg1 : constant String := Get_Argument;
Arg2 : constant String := Get_Argument;
Arg3 : constant String := Get_Argument;
begin
Generator.Read_Project ("dynamo.xml");
-- Initialize the database drivers.
ADO.Drivers.Initialize (Generator.Get_Properties);
-- Check if a database is specified in the command line and use it.
if Ada.Strings.Fixed.Index (Arg1, "://") > 0 or Arg3'Length > 0 then
Create_Database (Model, Arg1, Arg2, Arg3);
else
declare
Database : constant String := Generator.Get_Project_Property ("database");
begin
-- Otherwise, get the database identification from dynamo.xml configuration.
if Ada.Strings.Fixed.Index (Database, "://") = 0 then
Generator.Error ("No database specified.");
return;
end if;
Create_Database (Model, Database, Arg1, Arg2);
end;
end if;
end Execute;
-- ------------------------------
-- Write the help associated with the command.
-- ------------------------------
procedure Help (Cmd : in Command;
Generator : in out Gen.Generator.Handler) is
pragma Unreferenced (Cmd, Generator);
use Ada.Text_IO;
begin
Put_Line ("create-database: Creates the database");
Put_Line ("Usage: create-database MODEL [CONNECTION] ADMIN-USER [ADMIN-PASSWORD]");
New_Line;
Put_Line (" Create the database specified by the connection string.");
Put_Line (" The connection string has the form:");
Put_Line (" driver://host[:port]/database");
New_Line;
Put_Line (" The database must not exist. The user specified in the connection string");
Put_Line (" is granted the access to the new database.");
end Help;
end Gen.Commands.Database;
|
30,214
|
ada
| 0
|
python36/0xfa
|
src/getters/getter-file.ads
|
<filename>src/getters/getter-file.ads<gh_stars>0
with ada.text_io;
with ada.containers.vectors;
with ada.unchecked_deallocation;
with strings; use strings;
package getter.file is
function get return character;
procedure open (path : string);
private
type descriptor_access_t is access ada.text_io.file_type;
type file_t is record
descriptor : descriptor_access_t;
line : pos_count;
end record;
procedure free is new ada.unchecked_deallocation
(object => ada.text_io.file_type, name => descriptor_access_t);
package files_stack_t is new ada.containers.vectors(
element_type => file_t, index_type => natural);
files_stack : files_stack_t.vector;
current_ptr : descriptor_access_t;
current_line : pos_count;
sended_last_lf : boolean := false;
end getter.file;
|
30,215
|
ada
| 19
|
jrcarter/Ada_GUI
|
ada_gui-gnoga-gui-view-console.ads
|
<filename>ada_gui-gnoga-gui-view-console.ads
-- Ada_GUI implementation based on Gnoga. Adapted 2021
-- --
-- GNOGA - The GNU Omnificent GUI for Ada --
-- --
-- G N O G A . G U I . V I E W . C O N S O L E --
-- --
-- S p e c --
-- --
-- --
-- Copyright (C) 2014 <NAME> --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are --
-- granted additional permissions described in the GCC Runtime Library --
-- Exception, version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- For more information please go to http://www.gnoga.com --
------------------------------------------------------------------------------
-- A console view automatically sets padding around view for readability.
-- The view will also auto scrolls down as new items are added in to view.
package Ada_GUI.Gnoga.Gui.View.Console is
-------------------------------------------------------------------------
-- Console_View_Types
-------------------------------------------------------------------------
type Console_View_Type is new View_Type with private;
type Console_View_Access is access all Console_View_Type;
type Pointer_To_Console_View_Class is access all Console_View_Type'Class;
-------------------------------------------------------------------------
-- Console_View_Type - Creation Methods
-------------------------------------------------------------------------
overriding
procedure Create
(View : in out Console_View_Type;
Parent : in out Gnoga.Gui.Base_Type'Class;
ID : in String := "");
-------------------------------------------------------------------------
-- View_Type - Event Methods
-------------------------------------------------------------------------
overriding
procedure On_Child_Added
(View : in out Console_View_Type;
Child : in out Gnoga.Gui.Base_Type'Class);
private
type Console_View_Type is new View_Type with null record;
end Ada_GUI.Gnoga.Gui.View.Console;
|
30,216
|
ada
| 20
|
charlie5/lace
|
3-mid/impact/source/3d/collision/narrowphase/impact-d3-collision-detector-discrete.adb
|
package body impact.d3.collision.Detector.discrete
is
overriding procedure addContactPoint (Self : in out btStorageResult; normalOnBInWorld : in math.Vector_3;
pointInWorld : in math.Vector_3;
depth : in math.Real )
is
begin
if depth < Self.m_distance then
Self.m_normalOnSurfaceB := normalOnBInWorld;
Self.m_closestPointInB := pointInWorld;
Self.m_distance := depth;
end if;
end addContactPoint;
end impact.d3.collision.Detector.discrete;
|
30,217
|
ada
| 0
|
PThierry/ewok-kernel
|
src/ewok-tasks-debug.adb
|
<filename>src/ewok-tasks-debug.adb<gh_stars>0
--
-- Copyright 2018 The wookey project team <<EMAIL>>
-- - <NAME>
-- - Arnauld Michelizza
-- - <NAME>
-- - <NAME>
-- - <NAME>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
with ewok.debug;
with ewok.sched;
with ewok.tasks;
package body ewok.tasks.debug
with spark_mode => off
is
package DBG renames ewok.debug;
procedure crashdump (frame_a : in ewok.t_stack_frame_access)
is
begin
DBG.log (DBG.ERROR, ewok.tasks.tasks_list(ewok.sched.get_current).name);
DBG.alert ("Frame ");
DBG.alert (system_address'image (to_system_address (frame_a)));
DBG.newline;
DBG.alert ("EXC_RETURN ");
DBG.alert (unsigned_32'image (frame_a.all.exc_return));
DBG.newline;
DBG.alert ("R0 "); DBG.alert (unsigned_32'image (frame_a.all.R0)); DBG.newline;
DBG.alert ("R1 "); DBG.alert (unsigned_32'image (frame_a.all.R1)); DBG.newline;
DBG.alert ("R2 "); DBG.alert (unsigned_32'image (frame_a.all.R2)); DBG.newline;
DBG.alert ("R3 "); DBG.alert (unsigned_32'image (frame_a.all.R3)); DBG.newline;
DBG.alert ("R4 "); DBG.alert (unsigned_32'image (frame_a.all.R4)); DBG.newline;
DBG.alert ("R5 "); DBG.alert (unsigned_32'image (frame_a.all.R5)); DBG.newline;
DBG.alert ("R6 "); DBG.alert (unsigned_32'image (frame_a.all.R6)); DBG.newline;
DBG.alert ("R7 "); DBG.alert (unsigned_32'image (frame_a.all.R7)); DBG.newline;
DBG.alert ("R8 "); DBG.alert (unsigned_32'image (frame_a.all.R8)); DBG.newline;
DBG.alert ("R9 "); DBG.alert (unsigned_32'image (frame_a.all.R9)); DBG.newline;
DBG.alert ("R10 "); DBG.alert (unsigned_32'image (frame_a.all.R10)); DBG.newline;
DBG.alert ("R11 "); DBG.alert (unsigned_32'image (frame_a.all.R11)); DBG.newline;
DBG.alert ("R12 "); DBG.alert (unsigned_32'image (frame_a.all.R12)); DBG.newline;
DBG.alert ("PC "); DBG.alert (unsigned_32'image (frame_a.all.PC)); DBG.newline;
DBG.alert ("LR "); DBG.alert (unsigned_32'image (frame_a.all.LR)); DBG.newline;
DBG.alert ("PSR ");
DBG.alert (unsigned_32'image (m4.cpu.to_unsigned_32 (frame_a.all.PSR)));
DBG.newline;
end crashdump;
end ewok.tasks.debug;
|
30,218
|
ada
| 20
|
charlie5/lace
|
2-low/neural/source/neural.ads
|
<reponame>charlie5/lace<filename>2-low/neural/source/neural.ads
with float_Math;
package Neural
--
-- Declares the 'neural' namespace and core types.
--
is
pragma Pure;
package Math renames float_Math;
subtype Signal is math.Real;
type Signals is array (Positive range <>) of neural.Signal;
type Pattern is
record
Inputs : access Signals;
Outputs : access Signals;
end record;
type Patterns is array (Positive range <>) of Pattern;
private
procedure dummy;
end Neural;
|
30,219
|
ada
| 33
|
ytomino/drake
|
source/machine-w64-mingw32/s-widsta.adb
|
<filename>source/machine-w64-mingw32/s-widsta.adb
package body System.Wide_Startup is
pragma Suppress (All_Checks);
-- main generated by gnatbind
function main (argc : Integer; argv : Address; envp : Address)
return Integer
with Import, Convention => C;
-- implementation
function wmain (argc : Integer; argv : Address; envp : Address)
return Integer is
begin
wargc := argc;
wargv := argv;
wenvp := envp;
return main (0, Null_Address, Null_Address);
end wmain;
end System.Wide_Startup;
|
30,220
|
ada
| 1
|
brucegua/moocos
|
tools/scitools/conf/understand/ada/ada95/a-comlin.ads
|
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- A D A . C O M M A N D _ L I N E --
-- --
-- S p e c --
-- --
-- $Revision: 2 $ --
-- --
-- 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.Command_Line is
pragma Preelaborate (Command_Line);
function Argument_Count return Natural;
-- If the external execution environment supports passing arguments to a
-- program, then Argument_Count returns the number of arguments passed to
-- the program invoking the function. Otherwise it return 0.
--
-- In GNAT: Corresponds to (argc - 1) in C.
function Argument (Number : in Positive) return String;
-- If the external execution environment supports passing arguments to
-- a program, then Argument returns an implementation-defined value
-- corresponding to the argument at relative position Number. If Number
-- is outside the range 1 .. Argument_Count, then Constraint_Error is
-- propagated.
--
-- in GNAT: Corresponds to argv [n] (for n > 0) in C.
function Command_Name return String;
-- If the external execution environment supports passing arguments to
-- a program, then Command_Name returns an implementation-defined value
-- corresponding to the name of the command invoking the program.
-- Otherwise Command_Name returns the null string.
--
-- in GNAT: Corresponds to argv [0] in C.
type Exit_Status is new Integer;
Success : constant Exit_Status;
Failure : constant Exit_Status;
procedure Set_Exit_Status (Code : in Exit_Status);
pragma Import (C, Set_Exit_Status, "set_gnat_exit_status");
private
Success : constant Exit_Status := 0;
Failure : constant Exit_Status := 1;
-- ??? Later these will be properly handled through Import variables.
end Ada.Command_Line;
|
30,221
|
ada
| 3
|
stcarrez/ada-stemmer
|
src/lang/stemmer-serbian.adb
|
<reponame>stcarrez/ada-stemmer
-- Generated by Snowball 2.2.0 - https://snowballstem.org/
package body Stemmer.Serbian is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*variable*is never read and never assigned*");
pragma Warnings (Off, "*mode could be*instead of*");
pragma Warnings (Off, "*formal parameter.*is not modified*");
pragma Warnings (Off, "*this line is too long*");
pragma Warnings (Off, "*is not referenced*");
procedure R_Step_3 (Z : in out Context_Type; Result : out Boolean);
procedure R_Step_2 (Z : in out Context_Type; Result : out Boolean);
procedure R_Step_1 (Z : in out Context_Type; Result : out Boolean);
procedure R_R1 (Z : in out Context_Type; Result : out Boolean);
procedure R_Mark_regions (Z : in out Context_Type; Result : out Boolean);
procedure R_Prelude (Z : in out Context_Type; Result : out Boolean);
procedure R_Cyr_to_lat (Z : in out Context_Type; Result : out Boolean);
G_V : constant Grouping_Array (0 .. 23) := (
True, False, False, False, True, False, False, False,
True, False, False, False, False, False, True, False,
False, False, False, False, True, False, False, False
);
G_Sa : constant Grouping_Array (0 .. 119) := (
True, False, False, False, False, False, True, False,
False, False, True, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, True, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, True
);
G_Ca : constant Grouping_Array (0 .. 287) := (
True, True, True, False, True, True, True, False,
True, True, True, True, True, False, True, False,
True, True, True, False, True, False, False, False,
True, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, True, False, False,
False, False, False, True, False, False, False, True,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, True,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False,
False, False, False, False, True, False, False, False
);
G_Rg : constant Grouping_Array (0 .. 7) := (
True, False, False, False, False, False, False, False
);
Among_String : constant String := "а" & "б" & "в" & "г" & "д" & "е"
& "ж" & "з" & "и" & "к" & "л" & "м" & "н" & "о" & "п" & "р" & "с"
& "т" & "у" & "ф" & "х" & "ц" & "ч" & "ш" & "ђ" & "ј" & "љ" & "њ"
& "ћ" & "џ" & "daba" & "ajaca" & "ejaca" & "ljaca" & "njaca" & "ojaca"
& "alaca" & "elaca" & "olaca" & "maca" & "naca" & "raca" & "saca" & "vaca"
& "šaca" & "aoca" & "acaka" & "ajaka" & "ojaka" & "anaka" & "ataka" & "etaka"
& "itaka" & "otaka" & "utaka" & "ačaka" & "esama" & "izama" & "jacima"
& "nicima" & "ticima" & "teticima" & "zicima" & "atcima" & "utcima" & "čcima"
& "pesima" & "inzima" & "lozima" & "metara" & "centara" & "istara" & "ekata"
& "anata" & "nstava" & "kustava" & "ajac" & "ejac" & "ljac" & "njac" & "anjac"
& "ojac" & "alac" & "elac" & "olac" & "mac" & "nac" & "rac" & "sac" & "vac"
& "šac" & "jebe" & "olce" & "kuse" & "rave" & "save" & "šave" & "baci" & "jaci"
& "tvenici" & "snici" & "tetici" & "bojci" & "vojci" & "ojsci" & "atci" & "itci"
& "utci" & "čci" & "pesi" & "inzi" & "lozi" & "acak" & "usak" & "atak" & "etak"
& "itak" & "otak" & "utak" & "ačak" & "ušak" & "izam" & "tican" & "cajan"
& "čajan" & "voljan" & "eskan" & "alan" & "bilan" & "gilan" & "nilan" & "rilan"
& "silan" & "tilan" & "avilan" & "laran" & "eran" & "asan" & "esan" & "dusan"
& "kusan" & "atan" & "pletan" & "tetan" & "antan" & "pravan" & "stavan" & "sivan"
& "tivan" & "ozan" & "tičan" & "ašan" & "dušan" & "metar" & "centar" & "istar"
& "ekat" & "enat" & "oscu" & "ošću" & "aca" & "eca" & "uca" & "ga" & "acega"
& "ecega" & "ucega" & "anjijega" & "enjijega" & "snjijega" & "šnjijega"
& "kijega" & "skijega" & "škijega" & "elijega" & "nijega" & "osijega"
& "atijega" & "evitijega" & "ovitijega" & "astijega" & "avijega" & "evijega"
& "ivijega" & "ovijega" & "ošijega" & "anjega" & "enjega" & "snjega" & "šnjega"
& "kega" & "skega" & "škega" & "elega" & "nega" & "anega" & "enega" & "snega"
& "šnega" & "osega" & "atega" & "evitega" & "ovitega" & "astega" & "avega"
& "evega" & "ivega" & "ovega" & "aćega" & "ećega" & "ućega" & "ošega"
& "acoga" & "ecoga" & "ucoga" & "anjoga" & "enjoga" & "snjoga" & "šnjoga"
& "koga" & "skoga" & "škoga" & "loga" & "eloga" & "noga" & "cinoga" & "činoga"
& "osoga" & "atoga" & "evitoga" & "ovitoga" & "astoga" & "avoga" & "evoga"
& "ivoga" & "ovoga" & "aćoga" & "ećoga" & "ućoga" & "ošoga" & "uga" & "aja"
& "caja" & "laja" & "raja" & "ćaja" & "čaja" & "đaja" & "bija" & "cija"
& "dija" & "fija" & "gija" & "anjija" & "enjija" & "snjija" & "šnjija" & "kija"
& "skija" & "škija" & "lija" & "elija" & "mija" & "nija" & "ganija" & "manija"
& "panija" & "ranija" & "tanija" & "pija" & "rija" & "rarija" & "sija" & "osija"
& "tija" & "atija" & "evitija" & "ovitija" & "otija" & "astija" & "avija"
& "evija" & "ivija" & "ovija" & "zija" & "ošija" & "žija" & "anja" & "enja"
& "snja" & "šnja" & "ka" & "ska" & "ška" & "ala" & "acala" & "astajala"
& "istajala" & "ostajala" & "ijala" & "injala" & "nala" & "irala" & "urala"
& "tala" & "astala" & "istala" & "ostala" & "avala" & "evala" & "ivala" & "ovala"
& "uvala" & "ačala" & "ela" & "ila" & "acila" & "lucila" & "nila" & "astanila"
& "istanila" & "ostanila" & "rosila" & "jetila" & "ozila" & "ačila" & "lučila"
& "rošila" & "ola" & "asla" & "nula" & "gama" & "logama" & "ugama" & "ajama"
& "cajama" & "lajama" & "rajama" & "ćajama" & "čajama" & "đajama" & "bijama"
& "cijama" & "dijama" & "fijama" & "gijama" & "lijama" & "mijama" & "nijama"
& "ganijama" & "manijama" & "panijama" & "ranijama" & "tanijama" & "pijama"
& "rijama" & "sijama" & "tijama" & "zijama" & "žijama" & "alama" & "ijalama"
& "nalama" & "elama" & "ilama" & "ramama" & "lemama" & "inama" & "cinama"
& "činama" & "rama" & "arama" & "drama" & "erama" & "orama" & "basama"
& "gasama" & "jasama" & "kasama" & "nasama" & "tasama" & "vasama" & "esama"
& "isama" & "etama" & "estama" & "istama" & "kstama" & "ostama" & "avama"
& "evama" & "ivama" & "bašama" & "gašama" & "jašama" & "kašama" & "našama"
& "tašama" & "vašama" & "ešama" & "išama" & "lema" & "acima" & "ecima"
& "ucima" & "ajima" & "cajima" & "lajima" & "rajima" & "ćajima" & "čajima"
& "đajima" & "bijima" & "cijima" & "dijima" & "fijima" & "gijima" & "anjijima"
& "enjijima" & "snjijima" & "šnjijima" & "kijima" & "skijima" & "škijima"
& "lijima" & "elijima" & "mijima" & "nijima" & "ganijima" & "manijima"
& "panijima" & "ranijima" & "tanijima" & "pijima" & "rijima" & "sijima"
& "osijima" & "tijima" & "atijima" & "evitijima" & "ovitijima" & "astijima"
& "avijima" & "evijima" & "ivijima" & "ovijima" & "zijima" & "ošijima"
& "žijima" & "anjima" & "enjima" & "snjima" & "šnjima" & "kima" & "skima"
& "škima" & "alima" & "ijalima" & "nalima" & "elima" & "ilima" & "ozilima"
& "olima" & "lemima" & "nima" & "anima" & "inima" & "cinima" & "činima"
& "onima" & "arima" & "drima" & "erima" & "orima" & "basima" & "gasima"
& "jasima" & "kasima" & "nasima" & "tasima" & "vasima" & "esima" & "isima"
& "osima" & "atima" & "ikatima" & "latima" & "etima" & "evitima" & "ovitima"
& "astima" & "estima" & "istima" & "kstima" & "ostima" & "ištima" & "avima"
& "evima" & "ajevima" & "cajevima" & "lajevima" & "rajevima" & "ćajevima"
& "čajevima" & "đajevima" & "ivima" & "ovima" & "govima" & "ugovima" & "lovima"
& "olovima" & "movima" & "onovima" & "stvima" & "štvima" & "aćima" & "ećima"
& "ućima" & "bašima" & "gašima" & "jašima" & "kašima" & "našima"
& "tašima" & "vašima" & "ešima" & "išima" & "ošima" & "na" & "ana" & "acana"
& "urana" & "tana" & "avana" & "evana" & "ivana" & "uvana" & "ačana" & "acena"
& "lucena" & "ačena" & "lučena" & "ina" & "cina" & "anina" & "čina" & "ona"
& "ara" & "dra" & "era" & "ora" & "basa" & "gasa" & "jasa" & "kasa" & "nasa"
& "tasa" & "vasa" & "esa" & "isa" & "osa" & "ata" & "ikata" & "lata" & "eta"
& "evita" & "ovita" & "asta" & "esta" & "ista" & "ksta" & "osta" & "nuta"
& "išta" & "ava" & "eva" & "ajeva" & "cajeva" & "lajeva" & "rajeva" & "ćajeva"
& "čajeva" & "đajeva" & "iva" & "ova" & "gova" & "ugova" & "lova" & "olova"
& "mova" & "onova" & "stva" & "štva" & "aća" & "eća" & "uća" & "baša"
& "gaša" & "jaša" & "kaša" & "naša" & "taša" & "vaša" & "eša" & "iša"
& "oša" & "ace" & "ece" & "uce" & "luce" & "astade" & "istade" & "ostade" & "ge"
& "loge" & "uge" & "aje" & "caje" & "laje" & "raje" & "astaje" & "istaje"
& "ostaje" & "ćaje" & "čaje" & "đaje" & "ije" & "bije" & "cije" & "dije"
& "fije" & "gije" & "anjije" & "enjije" & "snjije" & "šnjije" & "kije" & "skije"
& "škije" & "lije" & "elije" & "mije" & "nije" & "ganije" & "manije" & "panije"
& "ranije" & "tanije" & "pije" & "rije" & "sije" & "osije" & "tije" & "atije"
& "evitije" & "ovitije" & "astije" & "avije" & "evije" & "ivije" & "ovije"
& "zije" & "ošije" & "žije" & "anje" & "enje" & "snje" & "šnje" & "uje"
& "lucuje" & "iruje" & "lučuje" & "ke" & "ske" & "ške" & "ale" & "acale"
& "astajale" & "istajale" & "ostajale" & "ijale" & "injale" & "nale" & "irale"
& "urale" & "tale" & "astale" & "istale" & "ostale" & "avale" & "evale" & "ivale"
& "ovale" & "uvale" & "ačale" & "ele" & "ile" & "acile" & "lucile" & "nile"
& "rosile" & "jetile" & "ozile" & "ačile" & "lučile" & "rošile" & "ole"
& "asle" & "nule" & "rame" & "leme" & "acome" & "ecome" & "ucome" & "anjome"
& "enjome" & "snjome" & "šnjome" & "kome" & "skome" & "škome" & "elome"
& "nome" & "cinome" & "činome" & "osome" & "atome" & "evitome" & "ovitome"
& "astome" & "avome" & "evome" & "ivome" & "ovome" & "aćome" & "ećome"
& "ućome" & "ošome" & "ne" & "ane" & "acane" & "urane" & "tane" & "astane"
& "istane" & "ostane" & "avane" & "evane" & "ivane" & "uvane" & "ačane"
& "acene" & "lucene" & "ačene" & "lučene" & "ine" & "cine" & "anine" & "čine"
& "one" & "are" & "dre" & "ere" & "ore" & "ase" & "base" & "acase" & "gase"
& "jase" & "astajase" & "istajase" & "ostajase" & "injase" & "kase" & "nase"
& "irase" & "urase" & "tase" & "vase" & "avase" & "evase" & "ivase" & "ovase"
& "uvase" & "ese" & "ise" & "acise" & "lucise" & "rosise" & "jetise" & "ose"
& "astadose" & "istadose" & "ostadose" & "ate" & "acate" & "ikate" & "late"
& "irate" & "urate" & "tate" & "avate" & "evate" & "ivate" & "uvate" & "ačate"
& "ete" & "astadete" & "istadete" & "ostadete" & "astajete" & "istajete"
& "ostajete" & "ijete" & "injete" & "ujete" & "lucujete" & "irujete"
& "lučujete" & "nete" & "astanete" & "istanete" & "ostanete" & "astete" & "ite"
& "acite" & "lucite" & "nite" & "astanite" & "istanite" & "ostanite" & "rosite"
& "jetite" & "astite" & "evite" & "ovite" & "ačite" & "lučite" & "rošite"
& "ajte" & "urajte" & "tajte" & "astajte" & "istajte" & "ostajte" & "avajte"
& "evajte" & "ivajte" & "uvajte" & "ijte" & "lucujte" & "irujte" & "lučujte"
& "aste" & "acaste" & "astajaste" & "istajaste" & "ostajaste" & "injaste"
& "iraste" & "uraste" & "taste" & "avaste" & "evaste" & "ivaste" & "ovaste"
& "uvaste" & "ačaste" & "este" & "iste" & "aciste" & "luciste" & "niste"
& "rosiste" & "jetiste" & "ačiste" & "lučiste" & "rošiste" & "kste" & "oste"
& "astadoste" & "istadoste" & "ostadoste" & "nuste" & "ište" & "ave" & "eve"
& "ajeve" & "cajeve" & "lajeve" & "rajeve" & "ćajeve" & "čajeve" & "đajeve"
& "ive" & "ove" & "gove" & "ugove" & "love" & "olove" & "move" & "onove" & "aće"
& "eće" & "uće" & "ače" & "luče" & "aše" & "baše" & "gaše" & "jaše"
& "astajaše" & "istajaše" & "ostajaše" & "injaše" & "kaše" & "naše"
& "iraše" & "uraše" & "taše" & "vaše" & "avaše" & "evaše" & "ivaše"
& "ovaše" & "uvaše" & "ačaše" & "eše" & "iše" & "jetiše" & "ačiše"
& "lučiše" & "rošiše" & "oše" & "astadoše" & "istadoše" & "ostadoše"
& "aceg" & "eceg" & "uceg" & "anjijeg" & "enjijeg" & "snjijeg" & "šnjijeg"
& "kijeg" & "skijeg" & "škijeg" & "elijeg" & "nijeg" & "osijeg" & "atijeg"
& "evitijeg" & "ovitijeg" & "astijeg" & "avijeg" & "evijeg" & "ivijeg" & "ovijeg"
& "ošijeg" & "anjeg" & "enjeg" & "snjeg" & "šnjeg" & "keg" & "eleg" & "neg"
& "aneg" & "eneg" & "sneg" & "šneg" & "oseg" & "ateg" & "aveg" & "eveg" & "iveg"
& "oveg" & "aćeg" & "ećeg" & "ućeg" & "ošeg" & "acog" & "ecog" & "ucog"
& "anjog" & "enjog" & "snjog" & "šnjog" & "kog" & "skog" & "škog" & "elog"
& "nog" & "cinog" & "činog" & "osog" & "atog" & "evitog" & "ovitog" & "astog"
& "avog" & "evog" & "ivog" & "ovog" & "aćog" & "ećog" & "ućog" & "ošog"
& "ah" & "acah" & "astajah" & "istajah" & "ostajah" & "injah" & "irah" & "urah"
& "tah" & "avah" & "evah" & "ivah" & "ovah" & "uvah" & "ačah" & "ih" & "acih"
& "ecih" & "ucih" & "lucih" & "anjijih" & "enjijih" & "snjijih" & "šnjijih"
& "kijih" & "skijih" & "škijih" & "elijih" & "nijih" & "osijih" & "atijih"
& "evitijih" & "ovitijih" & "astijih" & "avijih" & "evijih" & "ivijih" & "ovijih"
& "ošijih" & "anjih" & "enjih" & "snjih" & "šnjih" & "kih" & "skih" & "ških"
& "elih" & "nih" & "cinih" & "činih" & "osih" & "rosih" & "atih" & "jetih"
& "evitih" & "ovitih" & "astih" & "avih" & "evih" & "ivih" & "ovih" & "aćih"
& "ećih" & "ućih" & "ačih" & "lučih" & "oših" & "roših" & "astadoh"
& "istadoh" & "ostadoh" & "acuh" & "ecuh" & "ucuh" & "aćuh" & "ećuh" & "ućuh"
& "aci" & "aceci" & "ieci" & "ajuci" & "irajuci" & "urajuci" & "astajuci"
& "istajuci" & "ostajuci" & "avajuci" & "evajuci" & "ivajuci" & "uvajuci"
& "ujuci" & "lucujuci" & "irujuci" & "luci" & "nuci" & "etuci" & "astuci" & "gi"
& "ugi" & "aji" & "caji" & "laji" & "raji" & "ćaji" & "čaji" & "đaji" & "biji"
& "ciji" & "diji" & "fiji" & "giji" & "anjiji" & "enjiji" & "snjiji" & "šnjiji"
& "kiji" & "skiji" & "škiji" & "liji" & "eliji" & "miji" & "niji" & "ganiji"
& "maniji" & "paniji" & "raniji" & "taniji" & "piji" & "riji" & "siji" & "osiji"
& "tiji" & "atiji" & "evitiji" & "ovitiji" & "astiji" & "aviji" & "eviji"
& "iviji" & "oviji" & "ziji" & "ošiji" & "žiji" & "anji" & "enji" & "snji"
& "šnji" & "ki" & "ski" & "ški" & "ali" & "acali" & "astajali" & "istajali"
& "ostajali" & "ijali" & "injali" & "nali" & "irali" & "urali" & "tali"
& "astali" & "istali" & "ostali" & "avali" & "evali" & "ivali" & "ovali"
& "uvali" & "ačali" & "eli" & "ili" & "acili" & "lucili" & "nili" & "rosili"
& "jetili" & "ozili" & "ačili" & "lučili" & "rošili" & "oli" & "asli" & "nuli"
& "rami" & "lemi" & "ni" & "ani" & "acani" & "urani" & "tani" & "avani" & "evani"
& "ivani" & "uvani" & "ačani" & "aceni" & "luceni" & "ačeni" & "lučeni"
& "ini" & "cini" & "čini" & "oni" & "ari" & "dri" & "eri" & "ori" & "basi"
& "gasi" & "jasi" & "kasi" & "nasi" & "tasi" & "vasi" & "esi" & "isi" & "osi"
& "avsi" & "acavsi" & "iravsi" & "tavsi" & "etavsi" & "astavsi" & "istavsi"
& "ostavsi" & "ivsi" & "nivsi" & "rosivsi" & "nuvsi" & "ati" & "acati"
& "astajati" & "istajati" & "ostajati" & "injati" & "ikati" & "lati" & "irati"
& "urati" & "tati" & "astati" & "istati" & "ostati" & "avati" & "evati" & "ivati"
& "ovati" & "uvati" & "ačati" & "eti" & "iti" & "aciti" & "luciti" & "niti"
& "rositi" & "jetiti" & "eviti" & "oviti" & "ačiti" & "lučiti" & "rošiti"
& "asti" & "esti" & "isti" & "ksti" & "osti" & "nuti" & "avi" & "evi" & "ajevi"
& "cajevi" & "lajevi" & "rajevi" & "ćajevi" & "čajevi" & "đajevi" & "ivi"
& "ovi" & "govi" & "ugovi" & "lovi" & "olovi" & "movi" & "onovi" & "ieći"
& "ačeći" & "ajući" & "irajući" & "urajući" & "astajući" & "istajući"
& "ostajući" & "avajući" & "evajući" & "ivajući" & "uvajući" & "ujući"
& "irujući" & "lučujući" & "nući" & "etući" & "astući" & "ači" & "luči"
& "baši" & "gaši" & "jaši" & "kaši" & "naši" & "taši" & "vaši" & "eši"
& "iši" & "oši" & "avši" & "iravši" & "tavši" & "etavši" & "astavši"
& "istavši" & "ostavši" & "ačavši" & "ivši" & "nivši" & "rošivši"
& "nuvši" & "aj" & "uraj" & "taj" & "avaj" & "evaj" & "ivaj" & "uvaj" & "ij"
& "acoj" & "ecoj" & "ucoj" & "anjijoj" & "enjijoj" & "snjijoj" & "šnjijoj"
& "kijoj" & "skijoj" & "škijoj" & "elijoj" & "nijoj" & "osijoj" & "evitijoj"
& "ovitijoj" & "astijoj" & "avijoj" & "evijoj" & "ivijoj" & "ovijoj" & "ošijoj"
& "anjoj" & "enjoj" & "snjoj" & "šnjoj" & "koj" & "skoj" & "škoj" & "aloj"
& "eloj" & "noj" & "cinoj" & "činoj" & "osoj" & "atoj" & "evitoj" & "ovitoj"
& "astoj" & "avoj" & "evoj" & "ivoj" & "ovoj" & "aćoj" & "ećoj" & "ućoj"
& "ošoj" & "lucuj" & "iruj" & "lučuj" & "al" & "iral" & "ural" & "el" & "il"
& "am" & "acam" & "iram" & "uram" & "tam" & "avam" & "evam" & "ivam" & "uvam"
& "ačam" & "em" & "acem" & "ecem" & "ucem" & "astadem" & "istadem" & "ostadem"
& "ajem" & "cajem" & "lajem" & "rajem" & "astajem" & "istajem" & "ostajem"
& "ćajem" & "čajem" & "đajem" & "ijem" & "anjijem" & "enjijem" & "snjijem"
& "šnjijem" & "kijem" & "skijem" & "škijem" & "lijem" & "elijem" & "nijem"
& "rarijem" & "sijem" & "osijem" & "atijem" & "evitijem" & "ovitijem" & "otijem"
& "astijem" & "avijem" & "evijem" & "ivijem" & "ovijem" & "ošijem" & "anjem"
& "enjem" & "injem" & "snjem" & "šnjem" & "ujem" & "lucujem" & "irujem"
& "lučujem" & "kem" & "skem" & "škem" & "elem" & "nem" & "anem" & "astanem"
& "istanem" & "ostanem" & "enem" & "snem" & "šnem" & "basem" & "gasem" & "jasem"
& "kasem" & "nasem" & "tasem" & "vasem" & "esem" & "isem" & "osem" & "atem"
& "etem" & "evitem" & "ovitem" & "astem" & "istem" & "ištem" & "avem" & "evem"
& "ivem" & "aćem" & "ećem" & "ućem" & "bašem" & "gašem" & "jašem"
& "kašem" & "našem" & "tašem" & "vašem" & "ešem" & "išem" & "ošem" & "im"
& "acim" & "ecim" & "ucim" & "lucim" & "anjijim" & "enjijim" & "snjijim"
& "šnjijim" & "kijim" & "skijim" & "škijim" & "elijim" & "nijim" & "osijim"
& "atijim" & "evitijim" & "ovitijim" & "astijim" & "avijim" & "evijim" & "ivijim"
& "ovijim" & "ošijim" & "anjim" & "enjim" & "snjim" & "šnjim" & "kim" & "skim"
& "škim" & "elim" & "nim" & "cinim" & "činim" & "osim" & "rosim" & "atim"
& "jetim" & "evitim" & "ovitim" & "astim" & "avim" & "evim" & "ivim" & "ovim"
& "aćim" & "ećim" & "ućim" & "ačim" & "lučim" & "ošim" & "rošim" & "acom"
& "ecom" & "ucom" & "gom" & "logom" & "ugom" & "bijom" & "cijom" & "dijom"
& "fijom" & "gijom" & "lijom" & "mijom" & "nijom" & "ganijom" & "manijom"
& "panijom" & "ranijom" & "tanijom" & "pijom" & "rijom" & "sijom" & "tijom"
& "zijom" & "žijom" & "anjom" & "enjom" & "snjom" & "šnjom" & "kom" & "skom"
& "škom" & "alom" & "ijalom" & "nalom" & "elom" & "ilom" & "ozilom" & "olom"
& "ramom" & "lemom" & "nom" & "anom" & "inom" & "cinom" & "aninom" & "činom"
& "onom" & "arom" & "drom" & "erom" & "orom" & "basom" & "gasom" & "jasom"
& "kasom" & "nasom" & "tasom" & "vasom" & "esom" & "isom" & "osom" & "atom"
& "ikatom" & "latom" & "etom" & "evitom" & "ovitom" & "astom" & "estom" & "istom"
& "kstom" & "ostom" & "avom" & "evom" & "ivom" & "ovom" & "lovom" & "movom"
& "stvom" & "štvom" & "aćom" & "ećom" & "ućom" & "bašom" & "gašom"
& "jašom" & "kašom" & "našom" & "tašom" & "vašom" & "ešom" & "išom"
& "ošom" & "an" & "acan" & "iran" & "uran" & "tan" & "avan" & "evan" & "ivan"
& "uvan" & "ačan" & "acen" & "lucen" & "ačen" & "lučen" & "anin" & "ao"
& "acao" & "astajao" & "istajao" & "ostajao" & "injao" & "irao" & "urao" & "tao"
& "astao" & "istao" & "ostao" & "avao" & "evao" & "ivao" & "ovao" & "uvao"
& "ačao" & "go" & "ugo" & "io" & "acio" & "lucio" & "lio" & "nio" & "rario"
& "sio" & "rosio" & "jetio" & "otio" & "ačio" & "lučio" & "rošio" & "bijo"
& "cijo" & "dijo" & "fijo" & "gijo" & "lijo" & "mijo" & "nijo" & "pijo" & "rijo"
& "sijo" & "tijo" & "zijo" & "žijo" & "anjo" & "enjo" & "snjo" & "šnjo" & "ko"
& "sko" & "ško" & "alo" & "acalo" & "astajalo" & "istajalo" & "ostajalo"
& "ijalo" & "injalo" & "nalo" & "iralo" & "uralo" & "talo" & "astalo" & "istalo"
& "ostalo" & "avalo" & "evalo" & "ivalo" & "ovalo" & "uvalo" & "ačalo" & "elo"
& "ilo" & "acilo" & "lucilo" & "nilo" & "rosilo" & "jetilo" & "ačilo"
& "lučilo" & "rošilo" & "aslo" & "nulo" & "amo" & "acamo" & "ramo" & "iramo"
& "uramo" & "tamo" & "avamo" & "evamo" & "ivamo" & "uvamo" & "ačamo" & "emo"
& "astademo" & "istademo" & "ostademo" & "astajemo" & "istajemo" & "ostajemo"
& "ijemo" & "injemo" & "ujemo" & "lucujemo" & "irujemo" & "lučujemo" & "lemo"
& "nemo" & "astanemo" & "istanemo" & "ostanemo" & "etemo" & "astemo" & "imo"
& "acimo" & "lucimo" & "nimo" & "astanimo" & "istanimo" & "ostanimo" & "rosimo"
& "etimo" & "jetimo" & "astimo" & "ačimo" & "lučimo" & "rošimo" & "ajmo"
& "urajmo" & "tajmo" & "astajmo" & "istajmo" & "ostajmo" & "avajmo" & "evajmo"
& "ivajmo" & "uvajmo" & "ijmo" & "ujmo" & "lucujmo" & "irujmo" & "lučujmo"
& "asmo" & "acasmo" & "astajasmo" & "istajasmo" & "ostajasmo" & "injasmo"
& "irasmo" & "urasmo" & "tasmo" & "avasmo" & "evasmo" & "ivasmo" & "ovasmo"
& "uvasmo" & "ačasmo" & "ismo" & "acismo" & "lucismo" & "nismo" & "rosismo"
& "jetismo" & "ačismo" & "lučismo" & "rošismo" & "astadosmo" & "istadosmo"
& "ostadosmo" & "nusmo" & "no" & "ano" & "acano" & "urano" & "tano" & "avano"
& "evano" & "ivano" & "uvano" & "ačano" & "aceno" & "luceno" & "ačeno"
& "lučeno" & "ino" & "cino" & "čino" & "ato" & "ikato" & "lato" & "eto"
& "evito" & "ovito" & "asto" & "esto" & "isto" & "ksto" & "osto" & "nuto" & "nuo"
& "avo" & "evo" & "ivo" & "ovo" & "stvo" & "štvo" & "as" & "acas" & "iras"
& "uras" & "tas" & "avas" & "evas" & "ivas" & "uvas" & "es" & "astades"
& "istades" & "ostades" & "astajes" & "istajes" & "ostajes" & "ijes" & "injes"
& "ujes" & "lucujes" & "irujes" & "nes" & "astanes" & "istanes" & "ostanes"
& "etes" & "astes" & "is" & "acis" & "lucis" & "nis" & "rosis" & "jetis" & "at"
& "acat" & "astajat" & "istajat" & "ostajat" & "injat" & "irat" & "urat" & "tat"
& "astat" & "istat" & "ostat" & "avat" & "evat" & "ivat" & "irivat" & "ovat"
& "uvat" & "ačat" & "it" & "acit" & "lucit" & "rosit" & "jetit" & "ačit"
& "lučit" & "rošit" & "nut" & "astadu" & "istadu" & "ostadu" & "gu" & "logu"
& "ugu" & "ahu" & "acahu" & "astajahu" & "istajahu" & "ostajahu" & "injahu"
& "irahu" & "urahu" & "avahu" & "evahu" & "ivahu" & "ovahu" & "uvahu" & "ačahu"
& "aju" & "caju" & "acaju" & "laju" & "raju" & "iraju" & "uraju" & "taju"
& "astaju" & "istaju" & "ostaju" & "avaju" & "evaju" & "ivaju" & "uvaju"
& "ćaju" & "čaju" & "ačaju" & "đaju" & "iju" & "biju" & "ciju" & "diju"
& "fiju" & "giju" & "anjiju" & "enjiju" & "snjiju" & "šnjiju" & "kiju" & "liju"
& "eliju" & "miju" & "niju" & "ganiju" & "maniju" & "paniju" & "raniju"
& "taniju" & "piju" & "riju" & "rariju" & "siju" & "osiju" & "tiju" & "atiju"
& "otiju" & "aviju" & "eviju" & "iviju" & "oviju" & "ziju" & "ošiju" & "žiju"
& "anju" & "enju" & "snju" & "šnju" & "uju" & "lucuju" & "iruju" & "lučuju"
& "ku" & "sku" & "šku" & "alu" & "ijalu" & "nalu" & "elu" & "ilu" & "ozilu"
& "olu" & "ramu" & "acemu" & "ecemu" & "ucemu" & "anjijemu" & "enjijemu"
& "snjijemu" & "šnjijemu" & "kijemu" & "skijemu" & "škijemu" & "elijemu"
& "nijemu" & "osijemu" & "atijemu" & "evitijemu" & "ovitijemu" & "astijemu"
& "avijemu" & "evijemu" & "ivijemu" & "ovijemu" & "ošijemu" & "anjemu"
& "enjemu" & "snjemu" & "šnjemu" & "kemu" & "skemu" & "škemu" & "lemu"
& "elemu" & "nemu" & "anemu" & "enemu" & "snemu" & "šnemu" & "osemu" & "atemu"
& "evitemu" & "ovitemu" & "astemu" & "avemu" & "evemu" & "ivemu" & "ovemu"
& "aćemu" & "ećemu" & "ućemu" & "ošemu" & "acomu" & "ecomu" & "ucomu"
& "anjomu" & "enjomu" & "snjomu" & "šnjomu" & "komu" & "skomu" & "škomu"
& "elomu" & "nomu" & "cinomu" & "činomu" & "osomu" & "atomu" & "evitomu"
& "ovitomu" & "astomu" & "avomu" & "evomu" & "ivomu" & "ovomu" & "aćomu"
& "ećomu" & "ućomu" & "ošomu" & "nu" & "anu" & "astanu" & "istanu" & "ostanu"
& "inu" & "cinu" & "aninu" & "činu" & "onu" & "aru" & "dru" & "eru" & "oru"
& "basu" & "gasu" & "jasu" & "kasu" & "nasu" & "tasu" & "vasu" & "esu" & "isu"
& "osu" & "atu" & "ikatu" & "latu" & "etu" & "evitu" & "ovitu" & "astu" & "estu"
& "istu" & "kstu" & "ostu" & "ištu" & "avu" & "evu" & "ivu" & "ovu" & "lovu"
& "movu" & "stvu" & "štvu" & "bašu" & "gašu" & "jašu" & "kašu" & "našu"
& "tašu" & "vašu" & "ešu" & "išu" & "ošu" & "avav" & "evav" & "ivav"
& "uvav" & "kov" & "aš" & "iraš" & "uraš" & "taš" & "avaš" & "evaš"
& "ivaš" & "uvaš" & "ačaš" & "eš" & "astadeš" & "istadeš" & "ostadeš"
& "astaješ" & "istaješ" & "ostaješ" & "iješ" & "inješ" & "uješ" & "iruješ"
& "lučuješ" & "neš" & "astaneš" & "istaneš" & "ostaneš" & "eteš"
& "asteš" & "iš" & "niš" & "jetiš" & "ačiš" & "lučiš" & "rošiš" & "a"
& "oga" & "ama" & "ima" & "ena" & "e" & "og" & "anog" & "enog" & "anih" & "enih"
& "i" & "ani" & "eni" & "anoj" & "enoj" & "anim" & "enim" & "om" & "enom" & "o"
& "ano" & "eno" & "ost" & "u" & "enu";
A_0 : constant Among_Array_Type (0 .. 29) := (
(1, 2, -1, 1, 0),
(3, 4, -1, 2, 0),
(5, 6, -1, 3, 0),
(7, 8, -1, 4, 0),
(9, 10, -1, 5, 0),
(11, 12, -1, 7, 0),
(13, 14, -1, 8, 0),
(15, 16, -1, 9, 0),
(17, 18, -1, 10, 0),
(19, 20, -1, 12, 0),
(21, 22, -1, 13, 0),
(23, 24, -1, 15, 0),
(25, 26, -1, 16, 0),
(27, 28, -1, 18, 0),
(29, 30, -1, 19, 0),
(31, 32, -1, 20, 0),
(33, 34, -1, 21, 0),
(35, 36, -1, 22, 0),
(37, 38, -1, 24, 0),
(39, 40, -1, 25, 0),
(41, 42, -1, 26, 0),
(43, 44, -1, 27, 0),
(45, 46, -1, 28, 0),
(47, 48, -1, 30, 0),
(49, 50, -1, 6, 0),
(51, 52, -1, 11, 0),
(53, 54, -1, 14, 0),
(55, 56, -1, 17, 0),
(57, 58, -1, 23, 0),
(59, 60, -1, 29, 0));
A_1 : constant Among_Array_Type (0 .. 129) := (
(61, 64, -1, 73, 0),
(65, 69, -1, 12, 0),
(70, 74, -1, 14, 0),
(75, 79, -1, 13, 0),
(80, 84, -1, 85, 0),
(85, 89, -1, 15, 0),
(90, 94, -1, 82, 0),
(95, 99, -1, 83, 0),
(100, 104, -1, 84, 0),
(105, 108, -1, 75, 0),
(109, 112, -1, 76, 0),
(113, 116, -1, 81, 0),
(117, 120, -1, 80, 0),
(121, 124, -1, 79, 0),
(125, 129, -1, 18, 0),
(130, 133, -1, 82, 0),
(134, 138, -1, 55, 0),
(139, 143, -1, 16, 0),
(144, 148, -1, 17, 0),
(149, 153, -1, 78, 0),
(154, 158, -1, 58, 0),
(159, 163, -1, 59, 0),
(164, 168, -1, 60, 0),
(169, 173, -1, 61, 0),
(174, 178, -1, 62, 0),
(179, 184, -1, 54, 0),
(185, 189, -1, 67, 0),
(190, 194, -1, 87, 0),
(195, 200, -1, 5, 0),
(201, 206, -1, 23, 0),
(207, 212, -1, 24, 0),
(213, 220, 30, 21, 0),
(221, 226, -1, 25, 0),
(227, 232, -1, 58, 0),
(233, 238, -1, 62, 0),
(239, 244, -1, 74, 0),
(245, 250, -1, 2, 0),
(251, 256, -1, 19, 0),
(257, 262, -1, 1, 0),
(263, 268, -1, 68, 0),
(269, 275, -1, 69, 0),
(276, 281, -1, 70, 0),
(282, 286, -1, 86, 0),
(287, 291, -1, 53, 0),
(292, 297, -1, 22, 0),
(298, 304, -1, 29, 0),
(305, 308, -1, 12, 0),
(309, 312, -1, 14, 0),
(313, 316, -1, 13, 0),
(317, 320, -1, 85, 0),
(321, 325, 49, 11, 0),
(326, 329, -1, 15, 0),
(330, 333, -1, 82, 0),
(334, 337, -1, 83, 0),
(338, 341, -1, 84, 0),
(342, 344, -1, 75, 0),
(345, 347, -1, 76, 0),
(348, 350, -1, 81, 0),
(351, 353, -1, 80, 0),
(354, 356, -1, 79, 0),
(357, 360, -1, 18, 0),
(361, 364, -1, 88, 0),
(365, 368, -1, 84, 0),
(369, 372, -1, 27, 0),
(373, 376, -1, 42, 0),
(377, 380, -1, 52, 0),
(381, 385, -1, 51, 0),
(386, 389, -1, 89, 0),
(390, 393, -1, 5, 0),
(394, 400, -1, 20, 0),
(401, 405, -1, 26, 0),
(406, 411, -1, 21, 0),
(412, 416, -1, 4, 0),
(417, 421, -1, 3, 0),
(422, 426, -1, 66, 0),
(427, 430, -1, 58, 0),
(431, 434, -1, 60, 0),
(435, 438, -1, 62, 0),
(439, 442, -1, 74, 0),
(443, 446, -1, 2, 0),
(447, 450, -1, 19, 0),
(451, 454, -1, 1, 0),
(455, 458, -1, 55, 0),
(459, 462, -1, 57, 0),
(463, 466, -1, 58, 0),
(467, 470, -1, 59, 0),
(471, 474, -1, 60, 0),
(475, 478, -1, 61, 0),
(479, 482, -1, 62, 0),
(483, 487, -1, 54, 0),
(488, 492, -1, 56, 0),
(493, 496, -1, 87, 0),
(497, 501, -1, 65, 0),
(502, 506, -1, 7, 0),
(507, 512, -1, 6, 0),
(513, 518, -1, 77, 0),
(519, 523, -1, 63, 0),
(524, 527, -1, 40, 0),
(528, 532, -1, 33, 0),
(533, 537, -1, 37, 0),
(538, 542, -1, 39, 0),
(543, 547, -1, 38, 0),
(548, 552, -1, 36, 0),
(553, 557, -1, 34, 0),
(558, 563, -1, 35, 0),
(564, 568, -1, 9, 0),
(569, 572, -1, 8, 0),
(573, 576, -1, 91, 0),
(577, 580, -1, 10, 0),
(581, 585, -1, 31, 0),
(586, 590, -1, 28, 0),
(591, 594, -1, 47, 0),
(595, 600, -1, 50, 0),
(601, 605, -1, 49, 0),
(606, 610, -1, 32, 0),
(611, 616, -1, 44, 0),
(617, 622, -1, 43, 0),
(623, 627, -1, 46, 0),
(628, 632, -1, 45, 0),
(633, 636, -1, 41, 0),
(637, 642, -1, 64, 0),
(643, 647, -1, 90, 0),
(648, 653, -1, 30, 0),
(654, 658, -1, 68, 0),
(659, 664, -1, 69, 0),
(665, 669, -1, 70, 0),
(670, 673, -1, 86, 0),
(674, 677, -1, 48, 0),
(678, 681, -1, 72, 0),
(682, 687, -1, 71, 0));
A_2 : constant Among_Array_Type (0 .. 2034) := (
(688, 690, -1, 124, 0),
(691, 693, -1, 125, 0),
(694, 696, -1, 126, 0),
(697, 698, -1, 20, 0),
(699, 703, 3, 124, 0),
(704, 708, 3, 125, 0),
(709, 713, 3, 126, 0),
(714, 721, 3, 84, 0),
(722, 729, 3, 85, 0),
(730, 737, 3, 122, 0),
(738, 746, 3, 86, 0),
(747, 752, 3, 95, 0),
(753, 759, 11, 1, 0),
(760, 767, 11, 2, 0),
(768, 774, 3, 83, 0),
(775, 780, 3, 13, 0),
(781, 787, 3, 123, 0),
(788, 794, 3, 120, 0),
(795, 803, 3, 92, 0),
(804, 812, 3, 93, 0),
(813, 820, 3, 94, 0),
(821, 827, 3, 77, 0),
(828, 834, 3, 78, 0),
(835, 841, 3, 79, 0),
(842, 848, 3, 80, 0),
(849, 856, 3, 91, 0),
(857, 862, 3, 84, 0),
(863, 868, 3, 85, 0),
(869, 874, 3, 122, 0),
(875, 881, 3, 86, 0),
(882, 885, 3, 95, 0),
(886, 890, 30, 1, 0),
(891, 896, 30, 2, 0),
(897, 901, 3, 83, 0),
(902, 905, 3, 13, 0),
(906, 910, 34, 10, 0),
(911, 915, 34, 87, 0),
(916, 920, 34, 159, 0),
(921, 926, 34, 88, 0),
(927, 931, 3, 123, 0),
(932, 936, 3, 120, 0),
(937, 943, 3, 92, 0),
(944, 950, 3, 93, 0),
(951, 956, 3, 94, 0),
(957, 961, 3, 77, 0),
(962, 966, 3, 78, 0),
(967, 971, 3, 79, 0),
(972, 976, 3, 80, 0),
(977, 982, 3, 14, 0),
(983, 988, 3, 15, 0),
(989, 994, 3, 16, 0),
(995, 1000, 3, 91, 0),
(1001, 1005, 3, 124, 0),
(1006, 1010, 3, 125, 0),
(1011, 1015, 3, 126, 0),
(1016, 1021, 3, 84, 0),
(1022, 1027, 3, 85, 0),
(1028, 1033, 3, 122, 0),
(1034, 1040, 3, 86, 0),
(1041, 1044, 3, 95, 0),
(1045, 1049, 59, 1, 0),
(1050, 1055, 59, 2, 0),
(1056, 1059, 3, 19, 0),
(1060, 1064, 62, 83, 0),
(1065, 1068, 3, 13, 0),
(1069, 1074, 64, 137, 0),
(1075, 1081, 64, 89, 0),
(1082, 1086, 3, 123, 0),
(1087, 1091, 3, 120, 0),
(1092, 1098, 3, 92, 0),
(1099, 1105, 3, 93, 0),
(1106, 1111, 3, 94, 0),
(1112, 1116, 3, 77, 0),
(1117, 1121, 3, 78, 0),
(1122, 1126, 3, 79, 0),
(1127, 1131, 3, 80, 0),
(1132, 1137, 3, 14, 0),
(1138, 1143, 3, 15, 0),
(1144, 1149, 3, 16, 0),
(1150, 1155, 3, 91, 0),
(1156, 1158, 3, 18, 0),
(1159, 1161, -1, 109, 0),
(1162, 1165, 81, 26, 0),
(1166, 1169, 81, 30, 0),
(1170, 1173, 81, 31, 0),
(1174, 1178, 81, 28, 0),
(1179, 1183, 81, 27, 0),
(1184, 1188, 81, 29, 0),
(1189, 1192, -1, 32, 0),
(1193, 1196, -1, 33, 0),
(1197, 1200, -1, 34, 0),
(1201, 1204, -1, 40, 0),
(1205, 1208, -1, 39, 0),
(1209, 1214, -1, 84, 0),
(1215, 1220, -1, 85, 0),
(1221, 1226, -1, 122, 0),
(1227, 1233, -1, 86, 0),
(1234, 1237, -1, 95, 0),
(1238, 1242, 97, 1, 0),
(1243, 1248, 97, 2, 0),
(1249, 1252, -1, 24, 0),
(1253, 1257, 100, 83, 0),
(1258, 1261, -1, 37, 0),
(1262, 1265, -1, 13, 0),
(1266, 1271, 103, 9, 0),
(1272, 1277, 103, 6, 0),
(1278, 1283, 103, 7, 0),
(1284, 1289, 103, 8, 0),
(1290, 1295, 103, 5, 0),
(1296, 1299, -1, 41, 0),
(1300, 1303, -1, 42, 0),
(1304, 1309, 110, 21, 0),
(1310, 1313, -1, 23, 0),
(1314, 1318, 112, 123, 0),
(1319, 1322, -1, 44, 0),
(1323, 1327, 114, 120, 0),
(1328, 1334, 114, 92, 0),
(1335, 1341, 114, 93, 0),
(1342, 1346, 114, 22, 0),
(1347, 1352, 114, 94, 0),
(1353, 1357, -1, 77, 0),
(1358, 1362, -1, 78, 0),
(1363, 1367, -1, 79, 0),
(1368, 1372, -1, 80, 0),
(1373, 1376, -1, 45, 0),
(1377, 1382, -1, 91, 0),
(1383, 1387, -1, 38, 0),
(1388, 1391, -1, 84, 0),
(1392, 1395, -1, 85, 0),
(1396, 1399, -1, 122, 0),
(1400, 1404, -1, 86, 0),
(1405, 1406, -1, 95, 0),
(1407, 1409, 131, 1, 0),
(1410, 1413, 131, 2, 0),
(1414, 1416, -1, 104, 0),
(1417, 1421, 134, 128, 0),
(1422, 1429, 134, 106, 0),
(1430, 1437, 134, 107, 0),
(1438, 1445, 134, 108, 0),
(1446, 1450, 134, 47, 0),
(1451, 1456, 134, 114, 0),
(1457, 1460, 134, 46, 0),
(1461, 1465, 134, 100, 0),
(1466, 1470, 134, 105, 0),
(1471, 1474, 134, 113, 0),
(1475, 1480, 144, 110, 0),
(1481, 1486, 144, 111, 0),
(1487, 1492, 144, 112, 0),
(1493, 1497, 134, 97, 0),
(1498, 1502, 134, 96, 0),
(1503, 1507, 134, 98, 0),
(1508, 1512, 134, 76, 0),
(1513, 1517, 134, 99, 0),
(1518, 1523, 134, 102, 0),
(1524, 1526, -1, 83, 0),
(1527, 1529, -1, 116, 0),
(1530, 1534, 155, 124, 0),
(1535, 1540, 155, 121, 0),
(1541, 1544, 155, 103, 0),
(1545, 1552, 158, 110, 0),
(1553, 1560, 158, 111, 0),
(1561, 1568, 158, 112, 0),
(1569, 1574, 155, 127, 0),
(1575, 1580, 155, 118, 0),
(1581, 1585, 155, 48, 0),
(1586, 1591, 155, 101, 0),
(1592, 1598, 155, 117, 0),
(1599, 1605, 155, 90, 0),
(1606, 1608, -1, 50, 0),
(1609, 1612, -1, 115, 0),
(1613, 1616, -1, 13, 0),
(1617, 1620, -1, 20, 0),
(1621, 1626, 171, 19, 0),
(1627, 1631, 171, 18, 0),
(1632, 1636, -1, 109, 0),
(1637, 1642, 174, 26, 0),
(1643, 1648, 174, 30, 0),
(1649, 1654, 174, 31, 0),
(1655, 1661, 174, 28, 0),
(1662, 1668, 174, 27, 0),
(1669, 1675, 174, 29, 0),
(1676, 1681, -1, 32, 0),
(1682, 1687, -1, 33, 0),
(1688, 1693, -1, 34, 0),
(1694, 1699, -1, 40, 0),
(1700, 1705, -1, 39, 0),
(1706, 1711, -1, 35, 0),
(1712, 1717, -1, 37, 0),
(1718, 1723, -1, 36, 0),
(1724, 1731, 188, 9, 0),
(1732, 1739, 188, 6, 0),
(1740, 1747, 188, 7, 0),
(1748, 1755, 188, 8, 0),
(1756, 1763, 188, 5, 0),
(1764, 1769, -1, 41, 0),
(1770, 1775, -1, 42, 0),
(1776, 1781, -1, 43, 0),
(1782, 1787, -1, 44, 0),
(1788, 1793, -1, 45, 0),
(1794, 1800, -1, 38, 0),
(1801, 1805, -1, 104, 0),
(1806, 1812, 200, 47, 0),
(1813, 1818, 200, 46, 0),
(1819, 1823, -1, 119, 0),
(1824, 1828, -1, 116, 0),
(1829, 1834, -1, 52, 0),
(1835, 1840, -1, 51, 0),
(1841, 1845, -1, 11, 0),
(1846, 1851, 207, 137, 0),
(1852, 1858, 207, 89, 0),
(1859, 1862, -1, 52, 0),
(1863, 1867, 210, 53, 0),
(1868, 1872, 210, 54, 0),
(1873, 1877, 210, 55, 0),
(1878, 1882, 210, 56, 0),
(1883, 1888, -1, 135, 0),
(1889, 1894, -1, 131, 0),
(1895, 1900, -1, 129, 0),
(1901, 1906, -1, 133, 0),
(1907, 1912, -1, 132, 0),
(1913, 1918, -1, 130, 0),
(1919, 1924, -1, 134, 0),
(1925, 1929, -1, 152, 0),
(1930, 1934, -1, 154, 0),
(1935, 1939, -1, 70, 0),
(1940, 1945, -1, 71, 0),
(1946, 1951, -1, 72, 0),
(1952, 1957, -1, 73, 0),
(1958, 1963, -1, 74, 0),
(1964, 1968, -1, 77, 0),
(1969, 1973, -1, 78, 0),
(1974, 1978, -1, 79, 0),
(1979, 1985, -1, 63, 0),
(1986, 1992, -1, 64, 0),
(1993, 1999, -1, 61, 0),
(2000, 2006, -1, 62, 0),
(2007, 2013, -1, 60, 0),
(2014, 2020, -1, 59, 0),
(2021, 2027, -1, 65, 0),
(2028, 2033, -1, 66, 0),
(2034, 2039, -1, 67, 0),
(2040, 2043, -1, 51, 0),
(2044, 2048, -1, 124, 0),
(2049, 2053, -1, 125, 0),
(2054, 2058, -1, 126, 0),
(2059, 2063, -1, 109, 0),
(2064, 2069, 245, 26, 0),
(2070, 2075, 245, 30, 0),
(2076, 2081, 245, 31, 0),
(2082, 2088, 245, 28, 0),
(2089, 2095, 245, 27, 0),
(2096, 2102, 245, 29, 0),
(2103, 2108, -1, 32, 0),
(2109, 2114, -1, 33, 0),
(2115, 2120, -1, 34, 0),
(2121, 2126, -1, 40, 0),
(2127, 2132, -1, 39, 0),
(2133, 2140, -1, 84, 0),
(2141, 2148, -1, 85, 0),
(2149, 2156, -1, 122, 0),
(2157, 2165, -1, 86, 0),
(2166, 2171, -1, 95, 0),
(2172, 2178, 261, 1, 0),
(2179, 2186, 261, 2, 0),
(2187, 2192, -1, 35, 0),
(2193, 2199, 264, 83, 0),
(2200, 2205, -1, 37, 0),
(2206, 2211, -1, 13, 0),
(2212, 2219, 267, 9, 0),
(2220, 2227, 267, 6, 0),
(2228, 2235, 267, 7, 0),
(2236, 2243, 267, 8, 0),
(2244, 2251, 267, 5, 0),
(2252, 2257, -1, 41, 0),
(2258, 2263, -1, 42, 0),
(2264, 2269, -1, 43, 0),
(2270, 2276, 275, 123, 0),
(2277, 2282, -1, 44, 0),
(2283, 2289, 277, 120, 0),
(2290, 2298, 277, 92, 0),
(2299, 2307, 277, 93, 0),
(2308, 2315, 277, 94, 0),
(2316, 2322, -1, 77, 0),
(2323, 2329, -1, 78, 0),
(2330, 2336, -1, 79, 0),
(2337, 2343, -1, 80, 0),
(2344, 2349, -1, 45, 0),
(2350, 2357, -1, 91, 0),
(2358, 2364, -1, 38, 0),
(2365, 2370, -1, 84, 0),
(2371, 2376, -1, 85, 0),
(2377, 2382, -1, 122, 0),
(2383, 2389, -1, 86, 0),
(2390, 2393, -1, 95, 0),
(2394, 2398, 293, 1, 0),
(2399, 2404, 293, 2, 0),
(2405, 2409, -1, 104, 0),
(2410, 2416, 296, 47, 0),
(2417, 2422, 296, 46, 0),
(2423, 2427, -1, 83, 0),
(2428, 2432, -1, 116, 0),
(2433, 2439, 300, 48, 0),
(2440, 2444, -1, 50, 0),
(2445, 2450, -1, 51, 0),
(2451, 2454, -1, 13, 0),
(2455, 2459, 304, 10, 0),
(2460, 2464, 304, 11, 0),
(2465, 2470, 306, 137, 0),
(2471, 2477, 306, 89, 0),
(2478, 2482, 304, 12, 0),
(2483, 2487, -1, 53, 0),
(2488, 2492, -1, 54, 0),
(2493, 2497, -1, 55, 0),
(2498, 2502, -1, 56, 0),
(2503, 2508, -1, 135, 0),
(2509, 2514, -1, 131, 0),
(2515, 2520, -1, 129, 0),
(2521, 2526, -1, 133, 0),
(2527, 2532, -1, 132, 0),
(2533, 2538, -1, 130, 0),
(2539, 2544, -1, 134, 0),
(2545, 2549, -1, 57, 0),
(2550, 2554, -1, 58, 0),
(2555, 2559, -1, 123, 0),
(2560, 2564, -1, 120, 0),
(2565, 2571, 324, 68, 0),
(2572, 2577, 324, 69, 0),
(2578, 2582, -1, 70, 0),
(2583, 2589, -1, 92, 0),
(2590, 2596, -1, 93, 0),
(2597, 2602, -1, 94, 0),
(2603, 2608, -1, 71, 0),
(2609, 2614, -1, 72, 0),
(2615, 2620, -1, 73, 0),
(2621, 2626, -1, 74, 0),
(2627, 2633, -1, 75, 0),
(2634, 2638, -1, 77, 0),
(2639, 2643, -1, 78, 0),
(2644, 2650, 337, 109, 0),
(2651, 2658, 338, 26, 0),
(2659, 2666, 338, 30, 0),
(2667, 2674, 338, 31, 0),
(2675, 2683, 338, 28, 0),
(2684, 2692, 338, 27, 0),
(2693, 2701, 338, 29, 0),
(2702, 2706, -1, 79, 0),
(2707, 2711, -1, 80, 0),
(2712, 2717, 346, 20, 0),
(2718, 2724, 347, 17, 0),
(2725, 2730, 346, 82, 0),
(2731, 2737, 349, 49, 0),
(2738, 2743, 346, 81, 0),
(2744, 2750, 346, 12, 0),
(2751, 2756, -1, 3, 0),
(2757, 2763, -1, 4, 0),
(2764, 2769, -1, 14, 0),
(2770, 2775, -1, 15, 0),
(2776, 2781, -1, 16, 0),
(2782, 2788, -1, 63, 0),
(2789, 2795, -1, 64, 0),
(2796, 2802, -1, 61, 0),
(2803, 2809, -1, 62, 0),
(2810, 2816, -1, 60, 0),
(2817, 2823, -1, 59, 0),
(2824, 2830, -1, 65, 0),
(2831, 2836, -1, 66, 0),
(2837, 2842, -1, 67, 0),
(2843, 2848, -1, 91, 0),
(2849, 2850, -1, 13, 0),
(2851, 2853, 368, 10, 0),
(2854, 2858, 369, 128, 0),
(2859, 2863, 369, 105, 0),
(2864, 2867, 369, 113, 0),
(2868, 2872, 369, 97, 0),
(2873, 2877, 369, 96, 0),
(2878, 2882, 369, 98, 0),
(2883, 2887, 369, 99, 0),
(2888, 2893, 369, 102, 0),
(2894, 2898, 368, 124, 0),
(2899, 2904, 368, 121, 0),
(2905, 2910, 368, 101, 0),
(2911, 2917, 368, 117, 0),
(2918, 2920, 368, 11, 0),
(2921, 2924, 382, 137, 0),
(2925, 2929, 382, 10, 0),
(2930, 2934, 382, 89, 0),
(2935, 2937, 368, 12, 0),
(2938, 2940, -1, 53, 0),
(2941, 2943, -1, 54, 0),
(2944, 2946, -1, 55, 0),
(2947, 2949, -1, 56, 0),
(2950, 2953, -1, 135, 0),
(2954, 2957, -1, 131, 0),
(2958, 2961, -1, 129, 0),
(2962, 2965, -1, 133, 0),
(2966, 2969, -1, 132, 0),
(2970, 2973, -1, 130, 0),
(2974, 2977, -1, 134, 0),
(2978, 2980, -1, 57, 0),
(2981, 2983, -1, 58, 0),
(2984, 2986, -1, 123, 0),
(2987, 2989, -1, 120, 0),
(2990, 2994, 401, 68, 0),
(2995, 2998, 401, 69, 0),
(2999, 3001, -1, 70, 0),
(3002, 3006, -1, 92, 0),
(3007, 3011, -1, 93, 0),
(3012, 3015, -1, 94, 0),
(3016, 3019, -1, 71, 0),
(3020, 3023, -1, 72, 0),
(3024, 3027, -1, 73, 0),
(3028, 3031, -1, 74, 0),
(3032, 3035, -1, 13, 0),
(3036, 3040, -1, 75, 0),
(3041, 3043, -1, 77, 0),
(3044, 3046, -1, 78, 0),
(3047, 3051, 415, 109, 0),
(3052, 3057, 416, 26, 0),
(3058, 3063, 416, 30, 0),
(3064, 3069, 416, 31, 0),
(3070, 3076, 416, 28, 0),
(3077, 3083, 416, 27, 0),
(3084, 3090, 416, 29, 0),
(3091, 3093, -1, 79, 0),
(3094, 3096, -1, 80, 0),
(3097, 3100, 424, 20, 0),
(3101, 3105, 425, 17, 0),
(3106, 3109, 424, 82, 0),
(3110, 3114, 427, 49, 0),
(3115, 3118, 424, 81, 0),
(3119, 3123, 424, 12, 0),
(3124, 3127, -1, 3, 0),
(3128, 3132, -1, 4, 0),
(3133, 3136, -1, 14, 0),
(3137, 3140, -1, 15, 0),
(3141, 3144, -1, 16, 0),
(3145, 3149, -1, 63, 0),
(3150, 3154, -1, 64, 0),
(3155, 3159, -1, 61, 0),
(3160, 3164, -1, 62, 0),
(3165, 3169, -1, 60, 0),
(3170, 3174, -1, 59, 0),
(3175, 3179, -1, 65, 0),
(3180, 3183, -1, 66, 0),
(3184, 3187, -1, 67, 0),
(3188, 3191, -1, 91, 0),
(3192, 3194, -1, 124, 0),
(3195, 3197, -1, 125, 0),
(3198, 3200, -1, 126, 0),
(3201, 3204, 448, 121, 0),
(3205, 3210, -1, 110, 0),
(3211, 3216, -1, 111, 0),
(3217, 3222, -1, 112, 0),
(3223, 3224, -1, 20, 0),
(3225, 3228, 453, 19, 0),
(3229, 3231, 453, 18, 0),
(3232, 3234, -1, 104, 0),
(3235, 3238, 456, 26, 0),
(3239, 3242, 456, 30, 0),
(3243, 3246, 456, 31, 0),
(3247, 3252, 456, 106, 0),
(3253, 3258, 456, 107, 0),
(3259, 3264, 456, 108, 0),
(3265, 3269, 456, 28, 0),
(3270, 3274, 456, 27, 0),
(3275, 3279, 456, 29, 0),
(3280, 3282, -1, 116, 0),
(3283, 3286, 466, 32, 0),
(3287, 3290, 466, 33, 0),
(3291, 3294, 466, 34, 0),
(3295, 3298, 466, 40, 0),
(3299, 3302, 466, 39, 0),
(3303, 3308, 466, 84, 0),
(3309, 3314, 466, 85, 0),
(3315, 3320, 466, 122, 0),
(3321, 3327, 466, 86, 0),
(3328, 3331, 466, 95, 0),
(3332, 3336, 476, 1, 0),
(3337, 3342, 476, 2, 0),
(3343, 3346, 466, 35, 0),
(3347, 3351, 479, 83, 0),
(3352, 3355, 466, 37, 0),
(3356, 3359, 466, 13, 0),
(3360, 3365, 482, 9, 0),
(3366, 3371, 482, 6, 0),
(3372, 3377, 482, 7, 0),
(3378, 3383, 482, 8, 0),
(3384, 3389, 482, 5, 0),
(3390, 3393, 466, 41, 0),
(3394, 3397, 466, 42, 0),
(3398, 3401, 466, 43, 0),
(3402, 3406, 490, 123, 0),
(3407, 3410, 466, 44, 0),
(3411, 3415, 492, 120, 0),
(3416, 3422, 492, 92, 0),
(3423, 3429, 492, 93, 0),
(3430, 3435, 492, 94, 0),
(3436, 3440, 466, 77, 0),
(3441, 3445, 466, 78, 0),
(3446, 3450, 466, 79, 0),
(3451, 3455, 466, 80, 0),
(3456, 3459, 466, 45, 0),
(3460, 3465, 466, 91, 0),
(3466, 3470, 466, 38, 0),
(3471, 3474, -1, 84, 0),
(3475, 3478, -1, 85, 0),
(3479, 3482, -1, 122, 0),
(3483, 3487, -1, 86, 0),
(3488, 3490, -1, 25, 0),
(3491, 3496, 508, 121, 0),
(3497, 3501, 508, 100, 0),
(3502, 3508, 508, 117, 0),
(3509, 3510, -1, 95, 0),
(3511, 3513, 512, 1, 0),
(3514, 3517, 512, 2, 0),
(3518, 3520, -1, 104, 0),
(3521, 3525, 515, 128, 0),
(3526, 3533, 515, 106, 0),
(3534, 3541, 515, 107, 0),
(3542, 3549, 515, 108, 0),
(3550, 3554, 515, 47, 0),
(3555, 3560, 515, 114, 0),
(3561, 3564, 515, 46, 0),
(3565, 3569, 515, 100, 0),
(3570, 3574, 515, 105, 0),
(3575, 3578, 515, 113, 0),
(3579, 3584, 525, 110, 0),
(3585, 3590, 525, 111, 0),
(3591, 3596, 525, 112, 0),
(3597, 3601, 515, 97, 0),
(3602, 3606, 515, 96, 0),
(3607, 3611, 515, 98, 0),
(3612, 3616, 515, 76, 0),
(3617, 3621, 515, 99, 0),
(3622, 3627, 515, 102, 0),
(3628, 3630, -1, 83, 0),
(3631, 3633, -1, 116, 0),
(3634, 3638, 536, 124, 0),
(3639, 3644, 536, 121, 0),
(3645, 3648, 536, 103, 0),
(3649, 3654, 536, 127, 0),
(3655, 3660, 536, 118, 0),
(3661, 3665, 536, 48, 0),
(3666, 3671, 536, 101, 0),
(3672, 3678, 536, 117, 0),
(3679, 3685, 536, 90, 0),
(3686, 3688, -1, 50, 0),
(3689, 3692, -1, 115, 0),
(3693, 3696, -1, 13, 0),
(3697, 3700, -1, 52, 0),
(3701, 3704, -1, 51, 0),
(3705, 3709, -1, 124, 0),
(3710, 3714, -1, 125, 0),
(3715, 3719, -1, 126, 0),
(3720, 3725, -1, 84, 0),
(3726, 3731, -1, 85, 0),
(3732, 3737, -1, 122, 0),
(3738, 3744, -1, 86, 0),
(3745, 3748, -1, 95, 0),
(3749, 3753, 558, 1, 0),
(3754, 3759, 558, 2, 0),
(3760, 3764, -1, 83, 0),
(3765, 3768, -1, 13, 0),
(3769, 3774, 562, 137, 0),
(3775, 3781, 562, 89, 0),
(3782, 3786, -1, 123, 0),
(3787, 3791, -1, 120, 0),
(3792, 3798, -1, 92, 0),
(3799, 3805, -1, 93, 0),
(3806, 3811, -1, 94, 0),
(3812, 3816, -1, 77, 0),
(3817, 3821, -1, 78, 0),
(3822, 3826, -1, 79, 0),
(3827, 3831, -1, 80, 0),
(3832, 3837, -1, 14, 0),
(3838, 3843, -1, 15, 0),
(3844, 3849, -1, 16, 0),
(3850, 3855, -1, 91, 0),
(3856, 3857, -1, 13, 0),
(3858, 3860, 578, 10, 0),
(3861, 3865, 579, 128, 0),
(3866, 3870, 579, 105, 0),
(3871, 3874, 579, 113, 0),
(3875, 3880, 582, 110, 0),
(3881, 3886, 582, 111, 0),
(3887, 3892, 582, 112, 0),
(3893, 3897, 579, 97, 0),
(3898, 3902, 579, 96, 0),
(3903, 3907, 579, 98, 0),
(3908, 3912, 579, 99, 0),
(3913, 3918, 579, 102, 0),
(3919, 3923, 578, 124, 0),
(3924, 3929, 578, 121, 0),
(3930, 3935, 578, 101, 0),
(3936, 3942, 578, 117, 0),
(3943, 3945, 578, 11, 0),
(3946, 3949, 595, 137, 0),
(3950, 3954, 595, 10, 0),
(3955, 3959, 595, 89, 0),
(3960, 3962, 578, 12, 0),
(3963, 3965, -1, 53, 0),
(3966, 3968, -1, 54, 0),
(3969, 3971, -1, 55, 0),
(3972, 3974, -1, 56, 0),
(3975, 3977, -1, 161, 0),
(3978, 3981, 604, 135, 0),
(3982, 3986, 604, 128, 0),
(3987, 3990, 604, 131, 0),
(3991, 3994, 604, 129, 0),
(3995, 4002, 608, 138, 0),
(4003, 4010, 608, 139, 0),
(4011, 4018, 608, 140, 0),
(4019, 4024, 608, 150, 0),
(4025, 4028, 604, 133, 0),
(4029, 4032, 604, 132, 0),
(4033, 4037, 604, 155, 0),
(4038, 4042, 604, 156, 0),
(4043, 4046, 604, 130, 0),
(4047, 4050, 604, 134, 0),
(4051, 4055, 618, 144, 0),
(4056, 4060, 618, 145, 0),
(4061, 4065, 618, 146, 0),
(4066, 4070, 618, 148, 0),
(4071, 4075, 618, 147, 0),
(4076, 4078, -1, 57, 0),
(4079, 4081, -1, 58, 0),
(4082, 4086, 625, 124, 0),
(4087, 4092, 625, 121, 0),
(4093, 4098, 625, 127, 0),
(4099, 4104, 625, 149, 0),
(4105, 4107, -1, 123, 0),
(4108, 4115, 630, 141, 0),
(4116, 4123, 630, 142, 0),
(4124, 4131, 630, 143, 0),
(4132, 4134, -1, 104, 0),
(4135, 4139, 634, 128, 0),
(4140, 4144, 634, 68, 0),
(4145, 4148, 634, 69, 0),
(4149, 4153, 634, 100, 0),
(4154, 4158, 634, 105, 0),
(4159, 4162, 634, 113, 0),
(4163, 4167, 634, 97, 0),
(4168, 4172, 634, 96, 0),
(4173, 4177, 634, 98, 0),
(4178, 4182, 634, 99, 0),
(4183, 4188, 634, 102, 0),
(4189, 4191, -1, 70, 0),
(4192, 4199, 646, 110, 0),
(4200, 4207, 646, 111, 0),
(4208, 4215, 646, 112, 0),
(4216, 4223, 646, 106, 0),
(4224, 4231, 646, 107, 0),
(4232, 4239, 646, 108, 0),
(4240, 4244, 646, 116, 0),
(4245, 4250, 646, 114, 0),
(4251, 4255, 646, 25, 0),
(4256, 4263, 655, 121, 0),
(4264, 4270, 655, 100, 0),
(4271, 4279, 655, 117, 0),
(4280, 4283, 646, 13, 0),
(4284, 4291, 659, 110, 0),
(4292, 4299, 659, 111, 0),
(4300, 4307, 659, 112, 0),
(4308, 4313, 646, 115, 0),
(4314, 4316, -1, 116, 0),
(4317, 4321, 664, 124, 0),
(4322, 4327, 664, 121, 0),
(4328, 4331, 664, 13, 0),
(4332, 4339, 667, 110, 0),
(4340, 4347, 667, 111, 0),
(4348, 4355, 667, 112, 0),
(4356, 4361, 664, 127, 0),
(4362, 4367, 664, 118, 0),
(4368, 4373, 664, 115, 0),
(4374, 4378, 664, 92, 0),
(4379, 4383, 664, 93, 0),
(4384, 4389, 664, 101, 0),
(4390, 4396, 664, 117, 0),
(4397, 4403, 664, 90, 0),
(4404, 4407, -1, 104, 0),
(4408, 4413, 679, 105, 0),
(4414, 4418, 679, 113, 0),
(4419, 4425, 681, 106, 0),
(4426, 4432, 681, 107, 0),
(4433, 4439, 681, 108, 0),
(4440, 4445, 679, 97, 0),
(4446, 4451, 679, 96, 0),
(4452, 4457, 679, 98, 0),
(4458, 4463, 679, 99, 0),
(4464, 4467, -1, 116, 0),
(4468, 4474, -1, 121, 0),
(4475, 4480, -1, 100, 0),
(4481, 4488, -1, 117, 0),
(4489, 4492, -1, 94, 0),
(4493, 4498, 693, 128, 0),
(4499, 4507, 693, 106, 0),
(4508, 4516, 693, 107, 0),
(4517, 4525, 693, 108, 0),
(4526, 4532, 693, 114, 0),
(4533, 4538, 693, 100, 0),
(4539, 4544, 693, 105, 0),
(4545, 4549, 693, 113, 0),
(4550, 4555, 693, 97, 0),
(4556, 4561, 693, 96, 0),
(4562, 4567, 693, 98, 0),
(4568, 4573, 693, 76, 0),
(4574, 4579, 693, 99, 0),
(4580, 4586, 693, 102, 0),
(4587, 4590, -1, 71, 0),
(4591, 4594, -1, 72, 0),
(4595, 4600, 709, 124, 0),
(4601, 4607, 709, 121, 0),
(4608, 4612, 709, 103, 0),
(4613, 4619, 709, 127, 0),
(4620, 4626, 709, 118, 0),
(4627, 4633, 709, 101, 0),
(4634, 4641, 709, 117, 0),
(4642, 4649, 709, 90, 0),
(4650, 4653, -1, 73, 0),
(4654, 4657, -1, 74, 0),
(4658, 4666, 719, 110, 0),
(4667, 4675, 719, 111, 0),
(4676, 4684, 719, 112, 0),
(4685, 4689, -1, 13, 0),
(4690, 4694, -1, 75, 0),
(4695, 4697, -1, 77, 0),
(4698, 4700, -1, 78, 0),
(4701, 4705, 726, 109, 0),
(4706, 4711, 727, 26, 0),
(4712, 4717, 727, 30, 0),
(4718, 4723, 727, 31, 0),
(4724, 4730, 727, 28, 0),
(4731, 4737, 727, 27, 0),
(4738, 4744, 727, 29, 0),
(4745, 4747, -1, 79, 0),
(4748, 4750, -1, 80, 0),
(4751, 4754, 735, 20, 0),
(4755, 4759, 736, 17, 0),
(4760, 4763, 735, 82, 0),
(4764, 4768, 738, 49, 0),
(4769, 4772, 735, 81, 0),
(4773, 4777, 735, 12, 0),
(4778, 4781, -1, 14, 0),
(4782, 4785, -1, 15, 0),
(4786, 4789, -1, 16, 0),
(4790, 4793, -1, 101, 0),
(4794, 4798, -1, 117, 0),
(4799, 4802, -1, 104, 0),
(4803, 4807, 747, 63, 0),
(4808, 4812, 747, 64, 0),
(4813, 4817, 747, 61, 0),
(4818, 4826, 750, 106, 0),
(4827, 4835, 750, 107, 0),
(4836, 4844, 750, 108, 0),
(4845, 4851, 750, 114, 0),
(4852, 4856, 747, 62, 0),
(4857, 4861, 747, 60, 0),
(4862, 4867, 747, 100, 0),
(4868, 4873, 747, 105, 0),
(4874, 4878, 747, 59, 0),
(4879, 4883, 747, 65, 0),
(4884, 4889, 760, 97, 0),
(4890, 4895, 760, 96, 0),
(4896, 4901, 760, 98, 0),
(4902, 4907, 760, 76, 0),
(4908, 4913, 760, 99, 0),
(4914, 4920, 747, 102, 0),
(4921, 4924, -1, 66, 0),
(4925, 4928, -1, 67, 0),
(4929, 4935, 768, 118, 0),
(4936, 4942, 768, 101, 0),
(4943, 4950, 768, 117, 0),
(4951, 4958, 768, 90, 0),
(4959, 4962, -1, 91, 0),
(4963, 4971, 773, 110, 0),
(4972, 4980, 773, 111, 0),
(4981, 4989, 773, 112, 0),
(4990, 4993, -1, 124, 0),
(4994, 4997, -1, 125, 0),
(4998, 5001, -1, 126, 0),
(5002, 5008, -1, 84, 0),
(5009, 5015, -1, 85, 0),
(5016, 5022, -1, 122, 0),
(5023, 5030, -1, 86, 0),
(5031, 5035, -1, 95, 0),
(5036, 5041, 784, 1, 0),
(5042, 5048, 784, 2, 0),
(5049, 5054, -1, 83, 0),
(5055, 5059, -1, 13, 0),
(5060, 5065, -1, 123, 0),
(5066, 5071, -1, 120, 0),
(5072, 5079, -1, 92, 0),
(5080, 5087, -1, 93, 0),
(5088, 5094, -1, 94, 0),
(5095, 5100, -1, 77, 0),
(5101, 5106, -1, 78, 0),
(5107, 5112, -1, 79, 0),
(5113, 5118, -1, 80, 0),
(5119, 5125, -1, 91, 0),
(5126, 5130, -1, 84, 0),
(5131, 5135, -1, 85, 0),
(5136, 5140, -1, 122, 0),
(5141, 5146, -1, 86, 0),
(5147, 5149, -1, 95, 0),
(5150, 5153, -1, 83, 0),
(5154, 5156, -1, 13, 0),
(5157, 5160, 805, 10, 0),
(5161, 5164, 805, 87, 0),
(5165, 5168, 805, 159, 0),
(5169, 5173, 805, 88, 0),
(5174, 5177, -1, 123, 0),
(5178, 5181, -1, 120, 0),
(5182, 5185, -1, 77, 0),
(5186, 5189, -1, 78, 0),
(5190, 5193, -1, 79, 0),
(5194, 5197, -1, 80, 0),
(5198, 5202, -1, 14, 0),
(5203, 5207, -1, 15, 0),
(5208, 5212, -1, 16, 0),
(5213, 5217, -1, 91, 0),
(5218, 5221, -1, 124, 0),
(5222, 5225, -1, 125, 0),
(5226, 5229, -1, 126, 0),
(5230, 5234, -1, 84, 0),
(5235, 5239, -1, 85, 0),
(5240, 5244, -1, 122, 0),
(5245, 5250, -1, 86, 0),
(5251, 5253, -1, 95, 0),
(5254, 5257, 827, 1, 0),
(5258, 5262, 827, 2, 0),
(5263, 5266, -1, 83, 0),
(5267, 5269, -1, 13, 0),
(5270, 5274, 831, 137, 0),
(5275, 5280, 831, 89, 0),
(5281, 5284, -1, 123, 0),
(5285, 5288, -1, 120, 0),
(5289, 5294, -1, 92, 0),
(5295, 5300, -1, 93, 0),
(5301, 5305, -1, 94, 0),
(5306, 5309, -1, 77, 0),
(5310, 5313, -1, 78, 0),
(5314, 5317, -1, 79, 0),
(5318, 5321, -1, 80, 0),
(5322, 5326, -1, 14, 0),
(5327, 5331, -1, 15, 0),
(5332, 5336, -1, 16, 0),
(5337, 5341, -1, 91, 0),
(5342, 5343, -1, 104, 0),
(5344, 5347, 847, 128, 0),
(5348, 5354, 847, 106, 0),
(5355, 5361, 847, 107, 0),
(5362, 5368, 847, 108, 0),
(5369, 5373, 847, 114, 0),
(5374, 5377, 847, 100, 0),
(5378, 5381, 847, 105, 0),
(5382, 5384, 847, 113, 0),
(5385, 5388, 847, 97, 0),
(5389, 5392, 847, 96, 0),
(5393, 5396, 847, 98, 0),
(5397, 5400, 847, 76, 0),
(5401, 5404, 847, 99, 0),
(5405, 5409, 847, 102, 0),
(5410, 5411, -1, 116, 0),
(5412, 5415, 862, 124, 0),
(5416, 5419, 862, 125, 0),
(5420, 5423, 862, 126, 0),
(5424, 5428, 865, 121, 0),
(5429, 5435, 862, 84, 0),
(5436, 5442, 862, 85, 0),
(5443, 5449, 862, 122, 0),
(5450, 5457, 862, 86, 0),
(5458, 5462, 862, 95, 0),
(5463, 5468, 871, 1, 0),
(5469, 5475, 871, 2, 0),
(5476, 5481, 862, 83, 0),
(5482, 5486, 862, 13, 0),
(5487, 5492, 862, 123, 0),
(5493, 5498, 862, 120, 0),
(5499, 5506, 862, 92, 0),
(5507, 5514, 862, 93, 0),
(5515, 5521, 862, 94, 0),
(5522, 5527, 862, 77, 0),
(5528, 5533, 862, 78, 0),
(5534, 5539, 862, 79, 0),
(5540, 5545, 862, 80, 0),
(5546, 5552, 862, 91, 0),
(5553, 5557, 862, 84, 0),
(5558, 5562, 862, 85, 0),
(5563, 5567, 862, 122, 0),
(5568, 5573, 862, 86, 0),
(5574, 5576, 862, 95, 0),
(5577, 5580, 890, 1, 0),
(5581, 5585, 890, 2, 0),
(5586, 5589, 862, 83, 0),
(5590, 5592, 862, 13, 0),
(5593, 5597, 894, 137, 0),
(5598, 5603, 894, 89, 0),
(5604, 5607, 862, 123, 0),
(5608, 5612, 897, 127, 0),
(5613, 5616, 862, 120, 0),
(5617, 5621, 862, 118, 0),
(5622, 5627, 862, 92, 0),
(5628, 5633, 862, 93, 0),
(5634, 5638, 862, 94, 0),
(5639, 5642, 862, 77, 0),
(5643, 5646, 862, 78, 0),
(5647, 5650, 862, 79, 0),
(5651, 5654, 862, 80, 0),
(5655, 5659, 862, 14, 0),
(5660, 5664, 862, 15, 0),
(5665, 5669, 862, 16, 0),
(5670, 5674, 862, 101, 0),
(5675, 5680, 862, 117, 0),
(5681, 5685, 862, 91, 0),
(5686, 5691, 913, 90, 0),
(5692, 5698, -1, 110, 0),
(5699, 5705, -1, 111, 0),
(5706, 5712, -1, 112, 0),
(5713, 5716, -1, 124, 0),
(5717, 5720, -1, 125, 0),
(5721, 5724, -1, 126, 0),
(5725, 5729, -1, 14, 0),
(5730, 5734, -1, 15, 0),
(5735, 5739, -1, 16, 0),
(5740, 5742, -1, 124, 0),
(5743, 5747, -1, 124, 0),
(5748, 5751, -1, 162, 0),
(5752, 5756, -1, 161, 0),
(5757, 5763, 927, 155, 0),
(5764, 5770, 927, 156, 0),
(5771, 5778, 927, 138, 0),
(5779, 5786, 927, 139, 0),
(5787, 5794, 927, 140, 0),
(5795, 5801, 927, 144, 0),
(5802, 5808, 927, 145, 0),
(5809, 5815, 927, 146, 0),
(5816, 5822, 927, 147, 0),
(5823, 5827, -1, 157, 0),
(5828, 5835, 937, 121, 0),
(5836, 5842, 937, 155, 0),
(5843, 5846, -1, 121, 0),
(5847, 5850, -1, 164, 0),
(5851, 5855, -1, 153, 0),
(5856, 5861, -1, 136, 0),
(5862, 5863, -1, 20, 0),
(5864, 5866, 944, 18, 0),
(5867, 5869, -1, 109, 0),
(5870, 5873, 946, 26, 0),
(5874, 5877, 946, 30, 0),
(5878, 5881, 946, 31, 0),
(5882, 5886, 946, 28, 0),
(5887, 5891, 946, 27, 0),
(5892, 5896, 946, 29, 0),
(5897, 5900, -1, 32, 0),
(5901, 5904, -1, 33, 0),
(5905, 5908, -1, 34, 0),
(5909, 5912, -1, 40, 0),
(5913, 5916, -1, 39, 0),
(5917, 5922, -1, 84, 0),
(5923, 5928, -1, 85, 0),
(5929, 5934, -1, 122, 0),
(5935, 5941, -1, 86, 0),
(5942, 5945, -1, 95, 0),
(5946, 5950, 962, 1, 0),
(5951, 5956, 962, 2, 0),
(5957, 5960, -1, 35, 0),
(5961, 5965, 965, 83, 0),
(5966, 5969, -1, 37, 0),
(5970, 5973, -1, 13, 0),
(5974, 5979, 968, 9, 0),
(5980, 5985, 968, 6, 0),
(5986, 5991, 968, 7, 0),
(5992, 5997, 968, 8, 0),
(5998, 6003, 968, 5, 0),
(6004, 6007, -1, 41, 0),
(6008, 6011, -1, 42, 0),
(6012, 6015, -1, 43, 0),
(6016, 6020, 976, 123, 0),
(6021, 6024, -1, 44, 0),
(6025, 6029, 978, 120, 0),
(6030, 6036, 978, 92, 0),
(6037, 6043, 978, 93, 0),
(6044, 6049, 978, 94, 0),
(6050, 6054, -1, 77, 0),
(6055, 6059, -1, 78, 0),
(6060, 6064, -1, 79, 0),
(6065, 6069, -1, 80, 0),
(6070, 6073, -1, 45, 0),
(6074, 6079, -1, 91, 0),
(6080, 6084, -1, 38, 0),
(6085, 6088, -1, 84, 0),
(6089, 6092, -1, 85, 0),
(6093, 6096, -1, 122, 0),
(6097, 6101, -1, 86, 0),
(6102, 6103, -1, 95, 0),
(6104, 6106, 994, 1, 0),
(6107, 6110, 994, 2, 0),
(6111, 6113, -1, 104, 0),
(6114, 6118, 997, 128, 0),
(6119, 6126, 997, 106, 0),
(6127, 6134, 997, 107, 0),
(6135, 6142, 997, 108, 0),
(6143, 6147, 997, 47, 0),
(6148, 6153, 997, 114, 0),
(6154, 6157, 997, 46, 0),
(6158, 6162, 997, 100, 0),
(6163, 6167, 997, 105, 0),
(6168, 6171, 997, 113, 0),
(6172, 6177, 1007, 110, 0),
(6178, 6183, 1007, 111, 0),
(6184, 6189, 1007, 112, 0),
(6190, 6194, 997, 97, 0),
(6195, 6199, 997, 96, 0),
(6200, 6204, 997, 98, 0),
(6205, 6209, 997, 76, 0),
(6210, 6214, 997, 99, 0),
(6215, 6220, 997, 102, 0),
(6221, 6223, -1, 83, 0),
(6224, 6226, -1, 116, 0),
(6227, 6231, 1018, 124, 0),
(6232, 6237, 1018, 121, 0),
(6238, 6241, 1018, 103, 0),
(6242, 6247, 1018, 127, 0),
(6248, 6253, 1018, 118, 0),
(6254, 6258, 1018, 48, 0),
(6259, 6264, 1018, 101, 0),
(6265, 6271, 1018, 117, 0),
(6272, 6278, 1018, 90, 0),
(6279, 6281, -1, 50, 0),
(6282, 6285, -1, 115, 0),
(6286, 6289, -1, 13, 0),
(6290, 6293, -1, 52, 0),
(6294, 6297, -1, 51, 0),
(6298, 6299, -1, 13, 0),
(6300, 6302, 1033, 10, 0),
(6303, 6307, 1034, 128, 0),
(6308, 6312, 1034, 105, 0),
(6313, 6316, 1034, 113, 0),
(6317, 6321, 1034, 97, 0),
(6322, 6326, 1034, 96, 0),
(6327, 6331, 1034, 98, 0),
(6332, 6336, 1034, 99, 0),
(6337, 6342, 1034, 102, 0),
(6343, 6347, 1033, 124, 0),
(6348, 6353, 1033, 121, 0),
(6354, 6359, 1033, 101, 0),
(6360, 6366, 1033, 117, 0),
(6367, 6369, 1033, 11, 0),
(6370, 6373, 1047, 137, 0),
(6374, 6378, 1047, 89, 0),
(6379, 6381, 1033, 12, 0),
(6382, 6384, -1, 53, 0),
(6385, 6387, -1, 54, 0),
(6388, 6390, -1, 55, 0),
(6391, 6393, -1, 56, 0),
(6394, 6397, -1, 135, 0),
(6398, 6401, -1, 131, 0),
(6402, 6405, -1, 129, 0),
(6406, 6409, -1, 133, 0),
(6410, 6413, -1, 132, 0),
(6414, 6417, -1, 130, 0),
(6418, 6421, -1, 134, 0),
(6422, 6424, -1, 152, 0),
(6425, 6427, -1, 154, 0),
(6428, 6430, -1, 123, 0),
(6431, 6434, -1, 161, 0),
(6435, 6440, 1065, 128, 0),
(6441, 6446, 1065, 155, 0),
(6447, 6451, 1065, 160, 0),
(6452, 6457, 1068, 153, 0),
(6458, 6464, 1068, 141, 0),
(6465, 6471, 1068, 142, 0),
(6472, 6478, 1068, 143, 0),
(6479, 6482, -1, 162, 0),
(6483, 6487, 1073, 158, 0),
(6488, 6494, 1073, 127, 0),
(6495, 6499, -1, 164, 0),
(6500, 6502, -1, 104, 0),
(6503, 6507, 1077, 128, 0),
(6508, 6515, 1077, 106, 0),
(6516, 6523, 1077, 107, 0),
(6524, 6531, 1077, 108, 0),
(6532, 6537, 1077, 114, 0),
(6538, 6542, 1077, 68, 0),
(6543, 6546, 1077, 69, 0),
(6547, 6551, 1077, 100, 0),
(6552, 6556, 1077, 105, 0),
(6557, 6560, 1077, 113, 0),
(6561, 6566, 1087, 110, 0),
(6567, 6572, 1087, 111, 0),
(6573, 6578, 1087, 112, 0),
(6579, 6583, 1077, 97, 0),
(6584, 6588, 1077, 96, 0),
(6589, 6593, 1077, 98, 0),
(6594, 6598, 1077, 76, 0),
(6599, 6603, 1077, 99, 0),
(6604, 6609, 1077, 102, 0),
(6610, 6612, -1, 70, 0),
(6613, 6615, -1, 116, 0),
(6616, 6620, 1098, 124, 0),
(6621, 6626, 1098, 121, 0),
(6627, 6630, 1098, 103, 0),
(6631, 6636, 1098, 127, 0),
(6637, 6642, 1098, 118, 0),
(6643, 6647, 1098, 92, 0),
(6648, 6652, 1098, 93, 0),
(6653, 6658, 1098, 101, 0),
(6659, 6665, 1098, 117, 0),
(6666, 6672, 1098, 90, 0),
(6673, 6676, -1, 94, 0),
(6677, 6680, -1, 71, 0),
(6681, 6684, -1, 72, 0),
(6685, 6688, -1, 73, 0),
(6689, 6692, -1, 74, 0),
(6693, 6696, -1, 13, 0),
(6697, 6699, -1, 77, 0),
(6700, 6702, -1, 78, 0),
(6703, 6707, 1116, 109, 0),
(6708, 6713, 1117, 26, 0),
(6714, 6719, 1117, 30, 0),
(6720, 6725, 1117, 31, 0),
(6726, 6732, 1117, 28, 0),
(6733, 6739, 1117, 27, 0),
(6740, 6746, 1117, 29, 0),
(6747, 6749, -1, 79, 0),
(6750, 6752, -1, 80, 0),
(6753, 6756, 1125, 20, 0),
(6757, 6761, 1126, 17, 0),
(6762, 6765, 1125, 82, 0),
(6766, 6770, 1128, 49, 0),
(6771, 6774, 1125, 81, 0),
(6775, 6779, 1125, 12, 0),
(6780, 6784, -1, 116, 0),
(6785, 6791, -1, 101, 0),
(6792, 6797, -1, 104, 0),
(6798, 6805, 1134, 100, 0),
(6806, 6813, 1134, 105, 0),
(6814, 6822, 1134, 106, 0),
(6823, 6831, 1134, 107, 0),
(6832, 6840, 1134, 108, 0),
(6841, 6848, 1134, 97, 0),
(6849, 6856, 1134, 96, 0),
(6857, 6864, 1134, 98, 0),
(6865, 6872, 1134, 99, 0),
(6873, 6878, -1, 25, 0),
(6879, 6886, 1144, 100, 0),
(6887, 6896, 1144, 117, 0),
(6897, 6901, -1, 13, 0),
(6902, 6907, -1, 70, 0),
(6908, 6914, -1, 115, 0),
(6915, 6918, -1, 101, 0),
(6919, 6923, -1, 117, 0),
(6924, 6928, -1, 63, 0),
(6929, 6933, -1, 64, 0),
(6934, 6938, -1, 61, 0),
(6939, 6943, -1, 62, 0),
(6944, 6948, -1, 60, 0),
(6949, 6953, -1, 59, 0),
(6954, 6958, -1, 65, 0),
(6959, 6962, -1, 66, 0),
(6963, 6966, -1, 67, 0),
(6967, 6970, -1, 91, 0),
(6971, 6975, -1, 104, 0),
(6976, 6982, 1162, 100, 0),
(6983, 6988, 1162, 113, 0),
(6989, 6995, 1164, 70, 0),
(6996, 7003, 1164, 110, 0),
(7004, 7011, 1164, 111, 0),
(7012, 7019, 1164, 112, 0),
(7020, 7027, 1162, 102, 0),
(7028, 7032, -1, 116, 0),
(7033, 7038, 1170, 103, 0),
(7039, 7047, 1170, 90, 0),
(7048, 7053, -1, 13, 0),
(7054, 7055, -1, 104, 0),
(7056, 7059, 1174, 105, 0),
(7060, 7062, 1174, 113, 0),
(7063, 7066, 1174, 97, 0),
(7067, 7070, 1174, 96, 0),
(7071, 7074, 1174, 98, 0),
(7075, 7078, 1174, 99, 0),
(7079, 7080, -1, 116, 0),
(7081, 7084, -1, 124, 0),
(7085, 7088, -1, 125, 0),
(7089, 7092, -1, 126, 0),
(7093, 7099, -1, 84, 0),
(7100, 7106, -1, 85, 0),
(7107, 7113, -1, 122, 0),
(7114, 7121, -1, 86, 0),
(7122, 7126, -1, 95, 0),
(7127, 7132, 1189, 1, 0),
(7133, 7139, 1189, 2, 0),
(7140, 7145, -1, 83, 0),
(7146, 7150, -1, 13, 0),
(7151, 7156, -1, 123, 0),
(7157, 7164, -1, 92, 0),
(7165, 7172, -1, 93, 0),
(7173, 7179, -1, 94, 0),
(7180, 7185, -1, 77, 0),
(7186, 7191, -1, 78, 0),
(7192, 7197, -1, 79, 0),
(7198, 7203, -1, 80, 0),
(7204, 7210, -1, 91, 0),
(7211, 7215, -1, 84, 0),
(7216, 7220, -1, 85, 0),
(7221, 7225, -1, 122, 0),
(7226, 7231, -1, 86, 0),
(7232, 7234, -1, 95, 0),
(7235, 7238, 1207, 1, 0),
(7239, 7243, 1207, 2, 0),
(7244, 7247, -1, 104, 0),
(7248, 7251, -1, 83, 0),
(7252, 7254, -1, 13, 0),
(7255, 7259, 1212, 137, 0),
(7260, 7265, 1212, 89, 0),
(7266, 7269, -1, 123, 0),
(7270, 7273, -1, 120, 0),
(7274, 7279, -1, 92, 0),
(7280, 7285, -1, 93, 0),
(7286, 7290, -1, 94, 0),
(7291, 7294, -1, 77, 0),
(7295, 7298, -1, 78, 0),
(7299, 7302, -1, 79, 0),
(7303, 7306, -1, 80, 0),
(7307, 7311, -1, 14, 0),
(7312, 7316, -1, 15, 0),
(7317, 7321, -1, 16, 0),
(7322, 7326, -1, 91, 0),
(7327, 7331, -1, 121, 0),
(7332, 7335, -1, 100, 0),
(7336, 7341, -1, 117, 0),
(7342, 7343, -1, 104, 0),
(7344, 7347, 1231, 100, 0),
(7348, 7351, 1231, 105, 0),
(7352, 7353, -1, 119, 0),
(7354, 7355, -1, 116, 0),
(7356, 7357, -1, 104, 0),
(7358, 7361, 1236, 128, 0),
(7362, 7365, 1236, 100, 0),
(7366, 7369, 1236, 105, 0),
(7370, 7372, 1236, 113, 0),
(7373, 7376, 1236, 97, 0),
(7377, 7380, 1236, 96, 0),
(7381, 7384, 1236, 98, 0),
(7385, 7388, 1236, 99, 0),
(7389, 7393, 1236, 102, 0),
(7394, 7395, -1, 119, 0),
(7396, 7399, 1246, 124, 0),
(7400, 7403, 1246, 125, 0),
(7404, 7407, 1246, 126, 0),
(7408, 7414, 1246, 110, 0),
(7415, 7421, 1246, 111, 0),
(7422, 7428, 1246, 112, 0),
(7429, 7432, 1246, 104, 0),
(7433, 7437, 1253, 26, 0),
(7438, 7442, 1253, 30, 0),
(7443, 7447, 1253, 31, 0),
(7448, 7454, 1253, 106, 0),
(7455, 7461, 1253, 107, 0),
(7462, 7468, 1253, 108, 0),
(7469, 7474, 1253, 28, 0),
(7475, 7480, 1253, 27, 0),
(7481, 7486, 1253, 29, 0),
(7487, 7490, 1246, 116, 0),
(7491, 7497, 1263, 84, 0),
(7498, 7504, 1263, 85, 0),
(7505, 7511, 1263, 123, 0),
(7512, 7519, 1263, 86, 0),
(7520, 7524, 1263, 95, 0),
(7525, 7530, 1268, 1, 0),
(7531, 7537, 1268, 2, 0),
(7538, 7542, 1263, 24, 0),
(7543, 7548, 1271, 83, 0),
(7549, 7553, 1263, 13, 0),
(7554, 7560, 1263, 21, 0),
(7561, 7565, 1263, 23, 0),
(7566, 7571, 1275, 123, 0),
(7572, 7577, 1263, 120, 0),
(7578, 7585, 1263, 92, 0),
(7586, 7593, 1263, 93, 0),
(7594, 7599, 1263, 22, 0),
(7600, 7606, 1263, 94, 0),
(7607, 7612, 1263, 77, 0),
(7613, 7618, 1263, 78, 0),
(7619, 7624, 1263, 79, 0),
(7625, 7630, 1263, 80, 0),
(7631, 7637, 1263, 91, 0),
(7638, 7642, 1246, 84, 0),
(7643, 7647, 1246, 85, 0),
(7648, 7652, 1246, 114, 0),
(7653, 7657, 1246, 122, 0),
(7658, 7663, 1246, 86, 0),
(7664, 7667, 1246, 25, 0),
(7668, 7674, 1292, 121, 0),
(7675, 7680, 1292, 100, 0),
(7681, 7688, 1292, 117, 0),
(7689, 7691, 1246, 95, 0),
(7692, 7695, 1296, 1, 0),
(7696, 7700, 1296, 2, 0),
(7701, 7704, 1246, 83, 0),
(7705, 7707, 1246, 13, 0),
(7708, 7711, 1300, 10, 0),
(7712, 7718, 1301, 110, 0),
(7719, 7725, 1301, 111, 0),
(7726, 7732, 1301, 112, 0),
(7733, 7736, 1300, 87, 0),
(7737, 7740, 1300, 159, 0),
(7741, 7745, 1300, 88, 0),
(7746, 7750, 1246, 135, 0),
(7751, 7755, 1246, 131, 0),
(7756, 7760, 1246, 129, 0),
(7761, 7765, 1246, 133, 0),
(7766, 7770, 1246, 132, 0),
(7771, 7775, 1246, 130, 0),
(7776, 7780, 1246, 134, 0),
(7781, 7784, 1246, 152, 0),
(7785, 7788, 1246, 154, 0),
(7789, 7792, 1246, 123, 0),
(7793, 7796, 1246, 120, 0),
(7797, 7800, 1246, 70, 0),
(7801, 7806, 1246, 92, 0),
(7807, 7812, 1246, 93, 0),
(7813, 7817, 1246, 94, 0),
(7818, 7822, 1246, 151, 0),
(7823, 7828, 1246, 75, 0),
(7829, 7832, 1246, 77, 0),
(7833, 7836, 1246, 78, 0),
(7837, 7840, 1246, 79, 0),
(7841, 7845, 1246, 14, 0),
(7846, 7850, 1246, 15, 0),
(7851, 7855, 1246, 16, 0),
(7856, 7861, 1246, 63, 0),
(7862, 7867, 1246, 64, 0),
(7868, 7873, 1246, 61, 0),
(7874, 7879, 1246, 62, 0),
(7880, 7885, 1246, 60, 0),
(7886, 7891, 1246, 59, 0),
(7892, 7897, 1246, 65, 0),
(7898, 7902, 1246, 66, 0),
(7903, 7907, 1246, 67, 0),
(7908, 7912, 1246, 91, 0),
(7913, 7914, -1, 116, 0),
(7915, 7918, 1341, 124, 0),
(7919, 7922, 1341, 125, 0),
(7923, 7926, 1341, 126, 0),
(7927, 7931, 1344, 121, 0),
(7932, 7938, 1341, 84, 0),
(7939, 7945, 1341, 85, 0),
(7946, 7952, 1341, 122, 0),
(7953, 7960, 1341, 86, 0),
(7961, 7965, 1341, 95, 0),
(7966, 7971, 1350, 1, 0),
(7972, 7978, 1350, 2, 0),
(7979, 7984, 1341, 83, 0),
(7985, 7989, 1341, 13, 0),
(7990, 7995, 1341, 123, 0),
(7996, 8001, 1341, 120, 0),
(8002, 8009, 1341, 92, 0),
(8010, 8017, 1341, 93, 0),
(8018, 8024, 1341, 94, 0),
(8025, 8030, 1341, 77, 0),
(8031, 8036, 1341, 78, 0),
(8037, 8042, 1341, 79, 0),
(8043, 8048, 1341, 80, 0),
(8049, 8055, 1341, 91, 0),
(8056, 8060, 1341, 84, 0),
(8061, 8065, 1341, 85, 0),
(8066, 8070, 1341, 122, 0),
(8071, 8076, 1341, 86, 0),
(8077, 8079, 1341, 95, 0),
(8080, 8083, 1369, 1, 0),
(8084, 8088, 1369, 2, 0),
(8089, 8092, 1341, 83, 0),
(8093, 8095, 1341, 13, 0),
(8096, 8100, 1373, 137, 0),
(8101, 8106, 1373, 89, 0),
(8107, 8110, 1341, 123, 0),
(8111, 8115, 1376, 127, 0),
(8116, 8119, 1341, 120, 0),
(8120, 8124, 1341, 118, 0),
(8125, 8130, 1341, 92, 0),
(8131, 8136, 1341, 93, 0),
(8137, 8141, 1341, 94, 0),
(8142, 8145, 1341, 77, 0),
(8146, 8149, 1341, 78, 0),
(8150, 8153, 1341, 79, 0),
(8154, 8157, 1341, 80, 0),
(8158, 8162, 1341, 14, 0),
(8163, 8167, 1341, 15, 0),
(8168, 8172, 1341, 16, 0),
(8173, 8177, 1341, 101, 0),
(8178, 8183, 1341, 117, 0),
(8184, 8188, 1341, 91, 0),
(8189, 8194, 1392, 90, 0),
(8195, 8198, -1, 124, 0),
(8199, 8202, -1, 125, 0),
(8203, 8206, -1, 126, 0),
(8207, 8209, -1, 20, 0),
(8210, 8214, 1397, 19, 0),
(8215, 8218, 1397, 18, 0),
(8219, 8223, -1, 32, 0),
(8224, 8228, -1, 33, 0),
(8229, 8233, -1, 34, 0),
(8234, 8238, -1, 40, 0),
(8239, 8243, -1, 39, 0),
(8244, 8248, -1, 35, 0),
(8249, 8253, -1, 37, 0),
(8254, 8258, -1, 36, 0),
(8259, 8265, 1407, 9, 0),
(8266, 8272, 1407, 6, 0),
(8273, 8279, 1407, 7, 0),
(8280, 8286, 1407, 8, 0),
(8287, 8293, 1407, 5, 0),
(8294, 8298, -1, 41, 0),
(8299, 8303, -1, 42, 0),
(8304, 8308, -1, 43, 0),
(8309, 8313, -1, 44, 0),
(8314, 8318, -1, 45, 0),
(8319, 8324, -1, 38, 0),
(8325, 8329, -1, 84, 0),
(8330, 8334, -1, 85, 0),
(8335, 8339, -1, 122, 0),
(8340, 8345, -1, 86, 0),
(8346, 8348, -1, 95, 0),
(8349, 8352, 1423, 1, 0),
(8353, 8357, 1423, 2, 0),
(8358, 8361, -1, 104, 0),
(8362, 8367, 1426, 47, 0),
(8368, 8372, 1426, 46, 0),
(8373, 8376, -1, 83, 0),
(8377, 8380, -1, 116, 0),
(8381, 8386, 1430, 48, 0),
(8387, 8390, -1, 50, 0),
(8391, 8395, -1, 52, 0),
(8396, 8400, -1, 51, 0),
(8401, 8403, -1, 13, 0),
(8404, 8407, 1435, 10, 0),
(8408, 8411, 1435, 11, 0),
(8412, 8416, 1437, 137, 0),
(8417, 8422, 1437, 10, 0),
(8423, 8428, 1437, 89, 0),
(8429, 8432, 1435, 12, 0),
(8433, 8436, -1, 53, 0),
(8437, 8440, -1, 54, 0),
(8441, 8444, -1, 55, 0),
(8445, 8448, -1, 56, 0),
(8449, 8453, -1, 135, 0),
(8454, 8458, -1, 131, 0),
(8459, 8463, -1, 129, 0),
(8464, 8468, -1, 133, 0),
(8469, 8473, -1, 132, 0),
(8474, 8478, -1, 130, 0),
(8479, 8483, -1, 134, 0),
(8484, 8487, -1, 57, 0),
(8488, 8491, -1, 58, 0),
(8492, 8495, -1, 123, 0),
(8496, 8499, -1, 120, 0),
(8500, 8505, 1456, 68, 0),
(8506, 8510, 1456, 69, 0),
(8511, 8514, -1, 70, 0),
(8515, 8520, -1, 92, 0),
(8521, 8526, -1, 93, 0),
(8527, 8531, -1, 94, 0),
(8532, 8536, -1, 71, 0),
(8537, 8541, -1, 72, 0),
(8542, 8546, -1, 73, 0),
(8547, 8551, -1, 74, 0),
(8552, 8555, -1, 77, 0),
(8556, 8559, -1, 78, 0),
(8560, 8563, -1, 79, 0),
(8564, 8567, -1, 80, 0),
(8568, 8572, 1470, 82, 0),
(8573, 8577, 1470, 81, 0),
(8578, 8582, -1, 3, 0),
(8583, 8588, -1, 4, 0),
(8589, 8593, -1, 14, 0),
(8594, 8598, -1, 15, 0),
(8599, 8603, -1, 16, 0),
(8604, 8609, -1, 63, 0),
(8610, 8615, -1, 64, 0),
(8616, 8621, -1, 61, 0),
(8622, 8627, -1, 62, 0),
(8628, 8633, -1, 60, 0),
(8634, 8639, -1, 59, 0),
(8640, 8645, -1, 65, 0),
(8646, 8650, -1, 66, 0),
(8651, 8655, -1, 67, 0),
(8656, 8660, -1, 91, 0),
(8661, 8662, -1, 104, 0),
(8663, 8666, 1488, 128, 0),
(8667, 8670, 1488, 100, 0),
(8671, 8674, 1488, 105, 0),
(8675, 8677, 1488, 113, 0),
(8678, 8681, 1488, 97, 0),
(8682, 8685, 1488, 96, 0),
(8686, 8689, 1488, 98, 0),
(8690, 8693, 1488, 99, 0),
(8694, 8698, 1488, 102, 0),
(8699, 8702, -1, 124, 0),
(8703, 8707, -1, 121, 0),
(8708, 8712, -1, 101, 0),
(8713, 8718, -1, 117, 0),
(8719, 8722, -1, 10, 0),
(8723, 8724, -1, 104, 0),
(8725, 8728, 1503, 128, 0),
(8729, 8735, 1503, 106, 0),
(8736, 8742, 1503, 107, 0),
(8743, 8749, 1503, 108, 0),
(8750, 8754, 1503, 114, 0),
(8755, 8758, 1503, 100, 0),
(8759, 8762, 1503, 105, 0),
(8763, 8765, 1503, 113, 0),
(8766, 8770, 1511, 110, 0),
(8771, 8775, 1511, 111, 0),
(8776, 8780, 1511, 112, 0),
(8781, 8784, 1503, 97, 0),
(8785, 8788, 1503, 96, 0),
(8789, 8792, 1503, 98, 0),
(8793, 8796, 1503, 76, 0),
(8797, 8800, 1503, 99, 0),
(8801, 8805, 1503, 102, 0),
(8806, 8807, -1, 20, 0),
(8808, 8810, 1521, 18, 0),
(8811, 8812, -1, 116, 0),
(8813, 8816, 1523, 124, 0),
(8817, 8821, 1523, 121, 0),
(8822, 8824, 1523, 24, 0),
(8825, 8827, 1523, 103, 0),
(8828, 8832, 1523, 21, 0),
(8833, 8835, 1523, 23, 0),
(8836, 8840, 1529, 127, 0),
(8841, 8845, 1523, 118, 0),
(8846, 8849, 1523, 22, 0),
(8850, 8854, 1523, 101, 0),
(8855, 8860, 1523, 117, 0),
(8861, 8866, 1523, 90, 0),
(8867, 8870, -1, 32, 0),
(8871, 8874, -1, 33, 0),
(8875, 8878, -1, 34, 0),
(8879, 8882, -1, 40, 0),
(8883, 8886, -1, 39, 0),
(8887, 8890, -1, 35, 0),
(8891, 8894, -1, 37, 0),
(8895, 8898, -1, 36, 0),
(8899, 8902, -1, 41, 0),
(8903, 8906, -1, 42, 0),
(8907, 8910, -1, 43, 0),
(8911, 8914, -1, 44, 0),
(8915, 8918, -1, 45, 0),
(8919, 8923, -1, 38, 0),
(8924, 8927, -1, 84, 0),
(8928, 8931, -1, 85, 0),
(8932, 8935, -1, 122, 0),
(8936, 8940, -1, 86, 0),
(8941, 8942, -1, 95, 0),
(8943, 8945, 1554, 1, 0),
(8946, 8949, 1554, 2, 0),
(8950, 8952, -1, 104, 0),
(8953, 8957, 1557, 128, 0),
(8958, 8965, 1557, 106, 0),
(8966, 8973, 1557, 107, 0),
(8974, 8981, 1557, 108, 0),
(8982, 8986, 1557, 47, 0),
(8987, 8992, 1557, 114, 0),
(8993, 8996, 1557, 46, 0),
(8997, 9001, 1557, 100, 0),
(9002, 9006, 1557, 105, 0),
(9007, 9010, 1557, 113, 0),
(9011, 9016, 1567, 110, 0),
(9017, 9022, 1567, 111, 0),
(9023, 9028, 1567, 112, 0),
(9029, 9033, 1557, 97, 0),
(9034, 9038, 1557, 96, 0),
(9039, 9043, 1557, 98, 0),
(9044, 9048, 1557, 76, 0),
(9049, 9053, 1557, 99, 0),
(9054, 9059, 1557, 102, 0),
(9060, 9062, -1, 83, 0),
(9063, 9065, -1, 116, 0),
(9066, 9070, 1578, 124, 0),
(9071, 9076, 1578, 121, 0),
(9077, 9080, 1578, 103, 0),
(9081, 9086, 1578, 127, 0),
(9087, 9092, 1578, 118, 0),
(9093, 9098, 1578, 101, 0),
(9099, 9105, 1578, 117, 0),
(9106, 9112, 1578, 90, 0),
(9113, 9116, -1, 115, 0),
(9117, 9120, -1, 13, 0),
(9121, 9123, -1, 104, 0),
(9124, 9128, 1589, 128, 0),
(9129, 9132, 1589, 52, 0),
(9133, 9137, 1591, 100, 0),
(9138, 9142, 1591, 105, 0),
(9143, 9146, 1589, 113, 0),
(9147, 9151, 1589, 97, 0),
(9152, 9156, 1589, 96, 0),
(9157, 9161, 1589, 98, 0),
(9162, 9166, 1589, 99, 0),
(9167, 9172, 1589, 102, 0),
(9173, 9175, -1, 119, 0),
(9176, 9183, 1600, 110, 0),
(9184, 9191, 1600, 111, 0),
(9192, 9199, 1600, 112, 0),
(9200, 9207, 1600, 106, 0),
(9208, 9215, 1600, 107, 0),
(9216, 9223, 1600, 108, 0),
(9224, 9228, 1600, 116, 0),
(9229, 9234, 1600, 114, 0),
(9235, 9239, 1600, 25, 0),
(9240, 9247, 1609, 121, 0),
(9248, 9254, 1609, 100, 0),
(9255, 9263, 1609, 117, 0),
(9264, 9267, 1600, 51, 0),
(9268, 9271, 1600, 13, 0),
(9272, 9279, 1614, 110, 0),
(9280, 9287, 1614, 111, 0),
(9288, 9295, 1614, 112, 0),
(9296, 9300, 1600, 70, 0),
(9301, 9306, 1600, 115, 0),
(9307, 9309, -1, 116, 0),
(9310, 9314, 1620, 124, 0),
(9315, 9320, 1620, 121, 0),
(9321, 9324, 1620, 13, 0),
(9325, 9332, 1623, 110, 0),
(9333, 9340, 1623, 111, 0),
(9341, 9348, 1623, 112, 0),
(9349, 9354, 1620, 127, 0),
(9355, 9359, 1620, 70, 0),
(9360, 9365, 1628, 118, 0),
(9366, 9371, 1620, 115, 0),
(9372, 9377, 1620, 101, 0),
(9378, 9384, 1620, 117, 0),
(9385, 9391, 1620, 90, 0),
(9392, 9395, -1, 104, 0),
(9396, 9401, 1634, 105, 0),
(9402, 9406, 1634, 113, 0),
(9407, 9413, 1636, 106, 0),
(9414, 9420, 1636, 107, 0),
(9421, 9427, 1636, 108, 0),
(9428, 9433, 1634, 97, 0),
(9434, 9439, 1634, 96, 0),
(9440, 9445, 1634, 98, 0),
(9446, 9451, 1634, 99, 0),
(9452, 9455, -1, 116, 0),
(9456, 9459, -1, 25, 0),
(9460, 9466, 1645, 121, 0),
(9467, 9472, 1645, 100, 0),
(9473, 9480, 1645, 117, 0),
(9481, 9484, -1, 104, 0),
(9485, 9490, 1649, 128, 0),
(9491, 9499, 1649, 106, 0),
(9500, 9508, 1649, 107, 0),
(9509, 9517, 1649, 108, 0),
(9518, 9524, 1649, 114, 0),
(9525, 9530, 1649, 100, 0),
(9531, 9536, 1649, 105, 0),
(9537, 9541, 1649, 113, 0),
(9542, 9547, 1649, 97, 0),
(9548, 9553, 1649, 96, 0),
(9554, 9559, 1649, 98, 0),
(9560, 9565, 1649, 76, 0),
(9566, 9571, 1649, 99, 0),
(9572, 9578, 1649, 102, 0),
(9579, 9582, -1, 116, 0),
(9583, 9588, 1664, 124, 0),
(9589, 9595, 1664, 121, 0),
(9596, 9600, 1664, 103, 0),
(9601, 9607, 1664, 127, 0),
(9608, 9614, 1664, 118, 0),
(9615, 9621, 1664, 101, 0),
(9622, 9629, 1664, 117, 0),
(9630, 9637, 1664, 90, 0),
(9638, 9646, -1, 110, 0),
(9647, 9655, -1, 111, 0),
(9656, 9664, -1, 112, 0),
(9665, 9669, -1, 13, 0),
(9670, 9671, -1, 13, 0),
(9672, 9674, 1677, 104, 0),
(9675, 9679, 1678, 128, 0),
(9680, 9684, 1678, 105, 0),
(9685, 9688, 1678, 113, 0),
(9689, 9693, 1678, 97, 0),
(9694, 9698, 1678, 96, 0),
(9699, 9703, 1678, 98, 0),
(9704, 9708, 1678, 99, 0),
(9709, 9714, 1678, 102, 0),
(9715, 9719, 1677, 124, 0),
(9720, 9725, 1677, 121, 0),
(9726, 9731, 1677, 101, 0),
(9732, 9738, 1677, 117, 0),
(9739, 9741, 1677, 11, 0),
(9742, 9745, 1691, 137, 0),
(9746, 9750, 1691, 89, 0),
(9751, 9753, -1, 120, 0),
(9754, 9758, 1694, 68, 0),
(9759, 9762, 1694, 69, 0),
(9763, 9765, -1, 70, 0),
(9766, 9770, -1, 92, 0),
(9771, 9775, -1, 93, 0),
(9776, 9779, -1, 94, 0),
(9780, 9783, -1, 71, 0),
(9784, 9787, -1, 72, 0),
(9788, 9791, -1, 73, 0),
(9792, 9795, -1, 74, 0),
(9796, 9799, -1, 13, 0),
(9800, 9802, -1, 13, 0),
(9803, 9805, -1, 77, 0),
(9806, 9808, -1, 78, 0),
(9809, 9811, -1, 79, 0),
(9812, 9814, -1, 80, 0),
(9815, 9818, -1, 3, 0),
(9819, 9823, -1, 4, 0),
(9824, 9825, -1, 161, 0),
(9826, 9829, 1713, 128, 0),
(9830, 9833, 1713, 155, 0),
(9834, 9837, 1713, 156, 0),
(9838, 9840, 1713, 160, 0),
(9841, 9844, 1713, 144, 0),
(9845, 9848, 1713, 145, 0),
(9849, 9852, 1713, 146, 0),
(9853, 9856, 1713, 147, 0),
(9857, 9858, -1, 163, 0),
(9859, 9865, 1722, 141, 0),
(9866, 9872, 1722, 142, 0),
(9873, 9879, 1722, 143, 0),
(9880, 9886, 1722, 138, 0),
(9887, 9893, 1722, 139, 0),
(9894, 9900, 1722, 140, 0),
(9901, 9904, 1722, 162, 0),
(9905, 9909, 1722, 150, 0),
(9910, 9913, 1722, 157, 0),
(9914, 9920, 1731, 121, 0),
(9921, 9926, 1731, 155, 0),
(9927, 9929, 1722, 164, 0),
(9930, 9936, 1734, 141, 0),
(9937, 9943, 1734, 142, 0),
(9944, 9950, 1734, 143, 0),
(9951, 9954, 1722, 153, 0),
(9955, 9959, 1722, 136, 0),
(9960, 9961, -1, 162, 0),
(9962, 9965, 1740, 124, 0),
(9966, 9970, 1740, 121, 0),
(9971, 9973, 1740, 158, 0),
(9974, 9978, 1740, 127, 0),
(9979, 9983, 1740, 149, 0),
(9984, 9985, -1, 104, 0),
(9986, 9989, 1746, 128, 0),
(9990, 9996, 1746, 106, 0),
(9997, 10003, 1746, 107, 0),
(10004, 10010, 1746, 108, 0),
(10011, 10015, 1746, 114, 0),
(10016, 10019, 1746, 100, 0),
(10020, 10023, 1746, 105, 0),
(10024, 10026, 1746, 113, 0),
(10027, 10031, 1754, 110, 0),
(10032, 10036, 1754, 111, 0),
(10037, 10041, 1754, 112, 0),
(10042, 10045, 1746, 97, 0),
(10046, 10049, 1746, 96, 0),
(10050, 10053, 1746, 98, 0),
(10054, 10059, 1760, 100, 0),
(10060, 10063, 1746, 76, 0),
(10064, 10067, 1746, 99, 0),
(10068, 10072, 1746, 102, 0),
(10073, 10074, -1, 116, 0),
(10075, 10078, 1765, 124, 0),
(10079, 10083, 1765, 121, 0),
(10084, 10088, 1765, 127, 0),
(10089, 10093, 1765, 118, 0),
(10094, 10098, 1765, 101, 0),
(10099, 10104, 1765, 117, 0),
(10105, 10110, 1765, 90, 0),
(10111, 10113, -1, 13, 0),
(10114, 10119, -1, 110, 0),
(10120, 10125, -1, 111, 0),
(10126, 10131, -1, 112, 0),
(10132, 10133, -1, 20, 0),
(10134, 10137, 1777, 19, 0),
(10138, 10140, 1777, 18, 0),
(10141, 10143, -1, 104, 0),
(10144, 10148, 1780, 128, 0),
(10149, 10156, 1780, 106, 0),
(10157, 10164, 1780, 107, 0),
(10165, 10172, 1780, 108, 0),
(10173, 10178, 1780, 114, 0),
(10179, 10183, 1780, 100, 0),
(10184, 10188, 1780, 105, 0),
(10189, 10193, 1780, 97, 0),
(10194, 10198, 1780, 96, 0),
(10199, 10203, 1780, 98, 0),
(10204, 10208, 1780, 76, 0),
(10209, 10213, 1780, 99, 0),
(10214, 10219, 1780, 102, 0),
(10220, 10222, -1, 104, 0),
(10223, 10226, 1794, 26, 0),
(10227, 10231, 1795, 128, 0),
(10232, 10235, 1794, 30, 0),
(10236, 10239, 1794, 31, 0),
(10240, 10244, 1798, 100, 0),
(10245, 10249, 1798, 105, 0),
(10250, 10253, 1794, 113, 0),
(10254, 10259, 1801, 106, 0),
(10260, 10265, 1801, 107, 0),
(10266, 10271, 1801, 108, 0),
(10272, 10276, 1794, 97, 0),
(10277, 10281, 1794, 96, 0),
(10282, 10286, 1794, 98, 0),
(10287, 10291, 1794, 99, 0),
(10292, 10296, 1794, 28, 0),
(10297, 10301, 1794, 27, 0),
(10302, 10307, 1810, 102, 0),
(10308, 10312, 1794, 29, 0),
(10313, 10315, -1, 116, 0),
(10316, 10319, 1813, 32, 0),
(10320, 10323, 1813, 33, 0),
(10324, 10327, 1813, 34, 0),
(10328, 10331, 1813, 40, 0),
(10332, 10335, 1813, 39, 0),
(10336, 10341, 1813, 84, 0),
(10342, 10347, 1813, 85, 0),
(10348, 10353, 1813, 122, 0),
(10354, 10360, 1813, 86, 0),
(10361, 10364, 1813, 95, 0),
(10365, 10368, 1813, 24, 0),
(10369, 10373, 1824, 83, 0),
(10374, 10377, 1813, 37, 0),
(10378, 10381, 1813, 13, 0),
(10382, 10387, 1827, 9, 0),
(10388, 10393, 1827, 6, 0),
(10394, 10399, 1827, 7, 0),
(10400, 10405, 1827, 8, 0),
(10406, 10411, 1827, 5, 0),
(10412, 10415, 1813, 41, 0),
(10416, 10419, 1813, 42, 0),
(10420, 10425, 1834, 21, 0),
(10426, 10429, 1813, 23, 0),
(10430, 10434, 1836, 123, 0),
(10435, 10438, 1813, 44, 0),
(10439, 10443, 1838, 120, 0),
(10444, 10448, 1838, 22, 0),
(10449, 10453, 1813, 77, 0),
(10454, 10458, 1813, 78, 0),
(10459, 10463, 1813, 79, 0),
(10464, 10468, 1813, 80, 0),
(10469, 10472, 1813, 45, 0),
(10473, 10478, 1813, 91, 0),
(10479, 10483, 1813, 38, 0),
(10484, 10487, -1, 84, 0),
(10488, 10491, -1, 85, 0),
(10492, 10495, -1, 122, 0),
(10496, 10500, -1, 86, 0),
(10501, 10503, -1, 25, 0),
(10504, 10509, 1852, 121, 0),
(10510, 10514, 1852, 100, 0),
(10515, 10521, 1852, 117, 0),
(10522, 10523, -1, 95, 0),
(10524, 10526, 1856, 1, 0),
(10527, 10530, 1856, 2, 0),
(10531, 10533, -1, 104, 0),
(10534, 10538, 1859, 47, 0),
(10539, 10542, 1859, 46, 0),
(10543, 10545, -1, 83, 0),
(10546, 10548, -1, 116, 0),
(10549, 10553, 1863, 48, 0),
(10554, 10556, -1, 50, 0),
(10557, 10560, -1, 52, 0),
(10561, 10565, -1, 124, 0),
(10566, 10570, -1, 125, 0),
(10571, 10575, -1, 126, 0),
(10576, 10583, -1, 84, 0),
(10584, 10591, -1, 85, 0),
(10592, 10599, -1, 122, 0),
(10600, 10608, -1, 86, 0),
(10609, 10614, -1, 95, 0),
(10615, 10621, 1874, 1, 0),
(10622, 10629, 1874, 2, 0),
(10630, 10636, -1, 83, 0),
(10637, 10642, -1, 13, 0),
(10643, 10649, -1, 123, 0),
(10650, 10656, -1, 120, 0),
(10657, 10665, -1, 92, 0),
(10666, 10674, -1, 93, 0),
(10675, 10682, -1, 94, 0),
(10683, 10689, -1, 77, 0),
(10690, 10696, -1, 78, 0),
(10697, 10703, -1, 79, 0),
(10704, 10710, -1, 80, 0),
(10711, 10718, -1, 91, 0),
(10719, 10724, -1, 84, 0),
(10725, 10730, -1, 85, 0),
(10731, 10736, -1, 122, 0),
(10737, 10743, -1, 86, 0),
(10744, 10747, -1, 95, 0),
(10748, 10752, 1893, 1, 0),
(10753, 10758, 1893, 2, 0),
(10759, 10762, -1, 51, 0),
(10763, 10767, 1896, 83, 0),
(10768, 10771, -1, 13, 0),
(10772, 10776, 1898, 10, 0),
(10777, 10781, 1898, 87, 0),
(10782, 10786, 1898, 159, 0),
(10787, 10792, 1898, 88, 0),
(10793, 10797, -1, 123, 0),
(10798, 10802, -1, 120, 0),
(10803, 10809, -1, 92, 0),
(10810, 10816, -1, 93, 0),
(10817, 10822, -1, 94, 0),
(10823, 10827, -1, 77, 0),
(10828, 10832, -1, 78, 0),
(10833, 10837, -1, 79, 0),
(10838, 10842, -1, 80, 0),
(10843, 10848, -1, 14, 0),
(10849, 10854, -1, 15, 0),
(10855, 10860, -1, 16, 0),
(10861, 10866, -1, 91, 0),
(10867, 10871, -1, 124, 0),
(10872, 10876, -1, 125, 0),
(10877, 10881, -1, 126, 0),
(10882, 10887, -1, 84, 0),
(10888, 10893, -1, 85, 0),
(10894, 10899, -1, 122, 0),
(10900, 10906, -1, 86, 0),
(10907, 10910, -1, 95, 0),
(10911, 10915, 1923, 1, 0),
(10916, 10921, 1923, 2, 0),
(10922, 10926, -1, 83, 0),
(10927, 10930, -1, 13, 0),
(10931, 10936, 1927, 137, 0),
(10937, 10943, 1927, 89, 0),
(10944, 10948, -1, 123, 0),
(10949, 10953, -1, 120, 0),
(10954, 10960, -1, 92, 0),
(10961, 10967, -1, 93, 0),
(10968, 10973, -1, 94, 0),
(10974, 10978, -1, 77, 0),
(10979, 10983, -1, 78, 0),
(10984, 10988, -1, 79, 0),
(10989, 10993, -1, 80, 0),
(10994, 10999, -1, 14, 0),
(11000, 11005, -1, 15, 0),
(11006, 11011, -1, 16, 0),
(11012, 11017, -1, 91, 0),
(11018, 11019, -1, 13, 0),
(11020, 11022, 1943, 10, 0),
(11023, 11028, 1944, 110, 0),
(11029, 11034, 1944, 111, 0),
(11035, 11040, 1944, 112, 0),
(11041, 11043, 1943, 11, 0),
(11044, 11047, 1948, 137, 0),
(11048, 11052, 1948, 10, 0),
(11053, 11057, 1948, 89, 0),
(11058, 11060, 1943, 12, 0),
(11061, 11063, -1, 53, 0),
(11064, 11066, -1, 54, 0),
(11067, 11069, -1, 55, 0),
(11070, 11072, -1, 56, 0),
(11073, 11076, -1, 135, 0),
(11077, 11080, -1, 131, 0),
(11081, 11084, -1, 129, 0),
(11085, 11088, -1, 133, 0),
(11089, 11092, -1, 132, 0),
(11093, 11096, -1, 130, 0),
(11097, 11100, -1, 134, 0),
(11101, 11103, -1, 57, 0),
(11104, 11106, -1, 58, 0),
(11107, 11109, -1, 123, 0),
(11110, 11112, -1, 120, 0),
(11113, 11117, 1967, 68, 0),
(11118, 11121, 1967, 69, 0),
(11122, 11124, -1, 70, 0),
(11125, 11129, -1, 92, 0),
(11130, 11134, -1, 93, 0),
(11135, 11138, -1, 94, 0),
(11139, 11142, -1, 71, 0),
(11143, 11146, -1, 72, 0),
(11147, 11150, -1, 73, 0),
(11151, 11154, -1, 74, 0),
(11155, 11159, -1, 75, 0),
(11160, 11162, -1, 77, 0),
(11163, 11165, -1, 78, 0),
(11166, 11168, -1, 79, 0),
(11169, 11171, -1, 80, 0),
(11172, 11175, 1982, 82, 0),
(11176, 11179, 1982, 81, 0),
(11180, 11183, -1, 3, 0),
(11184, 11188, -1, 4, 0),
(11189, 11193, -1, 63, 0),
(11194, 11198, -1, 64, 0),
(11199, 11203, -1, 61, 0),
(11204, 11208, -1, 62, 0),
(11209, 11213, -1, 60, 0),
(11214, 11218, -1, 59, 0),
(11219, 11223, -1, 65, 0),
(11224, 11227, -1, 66, 0),
(11228, 11231, -1, 67, 0),
(11232, 11235, -1, 91, 0),
(11236, 11239, -1, 97, 0),
(11240, 11243, -1, 96, 0),
(11244, 11247, -1, 98, 0),
(11248, 11251, -1, 99, 0),
(11252, 11254, -1, 95, 0),
(11255, 11257, -1, 104, 0),
(11258, 11262, 2002, 100, 0),
(11263, 11267, 2002, 105, 0),
(11268, 11271, 2002, 113, 0),
(11272, 11276, 2002, 97, 0),
(11277, 11281, 2002, 96, 0),
(11282, 11286, 2002, 98, 0),
(11287, 11291, 2002, 99, 0),
(11292, 11297, 2002, 102, 0),
(11298, 11300, -1, 119, 0),
(11301, 11308, 2011, 110, 0),
(11309, 11316, 2011, 111, 0),
(11317, 11324, 2011, 112, 0),
(11325, 11332, 2011, 106, 0),
(11333, 11340, 2011, 107, 0),
(11341, 11348, 2011, 108, 0),
(11349, 11353, 2011, 116, 0),
(11354, 11359, 2011, 114, 0),
(11360, 11364, 2011, 25, 0),
(11365, 11371, 2020, 100, 0),
(11372, 11380, 2020, 117, 0),
(11381, 11384, 2011, 13, 0),
(11385, 11392, 2023, 110, 0),
(11393, 11400, 2023, 111, 0),
(11401, 11408, 2023, 112, 0),
(11409, 11413, 2011, 70, 0),
(11414, 11419, 2011, 115, 0),
(11420, 11422, -1, 116, 0),
(11423, 11426, 2029, 103, 0),
(11427, 11432, 2029, 118, 0),
(11433, 11438, 2029, 101, 0),
(11439, 11445, 2029, 117, 0),
(11446, 11452, 2029, 90, 0));
A_3 : constant Among_Array_Type (0 .. 25) := (
(11453, 11453, -1, 1, 0),
(11454, 11456, 0, 1, 0),
(11457, 11459, 0, 1, 0),
(11460, 11462, 0, 1, 0),
(11463, 11465, 0, 1, 0),
(11466, 11466, -1, 1, 0),
(11467, 11468, -1, 1, 0),
(11469, 11472, 6, 1, 0),
(11473, 11476, 6, 1, 0),
(11477, 11480, -1, 1, 0),
(11481, 11484, -1, 1, 0),
(11485, 11485, -1, 1, 0),
(11486, 11488, 11, 1, 0),
(11489, 11491, 11, 1, 0),
(11492, 11495, -1, 1, 0),
(11496, 11499, -1, 1, 0),
(11500, 11503, -1, 1, 0),
(11504, 11507, -1, 1, 0),
(11508, 11509, -1, 1, 0),
(11510, 11513, 18, 1, 0),
(11514, 11514, -1, 1, 0),
(11515, 11517, 20, 1, 0),
(11518, 11520, 20, 1, 0),
(11521, 11523, -1, 1, 0),
(11524, 11524, -1, 1, 0),
(11525, 11527, 24, 1, 0));
procedure R_Cyr_to_lat (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
v_1 : Char_Index;
v_2 : Char_Index;
v_3 : Char_Index;
begin
-- do, line 82
v_1 := Z.C;
-- repeat, line 82
<<lab1>>
loop
v_2 := Z.C;
-- goto, line 82
loop
v_3 := Z.C;
-- (, line 82
Z.Bra := Z.C; -- [, line 83
-- substring, line 83
Find_Among (Z, A_0, Among_String, null, A);
if A = 0 then
goto lab4;
end if;
Z.Ket := Z.C; -- ], line 83
-- among, line 83
case A is
when 1 =>
-- (, line 84
-- <-, line 84
Slice_From (Z, "a");
when 2 =>
-- (, line 85
-- <-, line 85
Slice_From (Z, "b");
when 3 =>
-- (, line 86
-- <-, line 86
Slice_From (Z, "v");
when 4 =>
-- (, line 87
-- <-, line 87
Slice_From (Z, "g");
when 5 =>
-- (, line 88
-- <-, line 88
Slice_From (Z, "d");
when 6 =>
-- (, line 89
-- <-, line 89
Slice_From (Z, "đ");
when 7 =>
-- (, line 90
-- <-, line 90
Slice_From (Z, "e");
when 8 =>
-- (, line 91
-- <-, line 91
Slice_From (Z, "ž");
when 9 =>
-- (, line 92
-- <-, line 92
Slice_From (Z, "z");
when 10 =>
-- (, line 93
-- <-, line 93
Slice_From (Z, "i");
when 11 =>
-- (, line 94
-- <-, line 94
Slice_From (Z, "j");
when 12 =>
-- (, line 95
-- <-, line 95
Slice_From (Z, "k");
when 13 =>
-- (, line 96
-- <-, line 96
Slice_From (Z, "l");
when 14 =>
-- (, line 97
-- <-, line 97
Slice_From (Z, "lj");
when 15 =>
-- (, line 98
-- <-, line 98
Slice_From (Z, "m");
when 16 =>
-- (, line 99
-- <-, line 99
Slice_From (Z, "n");
when 17 =>
-- (, line 100
-- <-, line 100
Slice_From (Z, "nj");
when 18 =>
-- (, line 101
-- <-, line 101
Slice_From (Z, "o");
when 19 =>
-- (, line 102
-- <-, line 102
Slice_From (Z, "p");
when 20 =>
-- (, line 103
-- <-, line 103
Slice_From (Z, "r");
when 21 =>
-- (, line 104
-- <-, line 104
Slice_From (Z, "s");
when 22 =>
-- (, line 105
-- <-, line 105
Slice_From (Z, "t");
when 23 =>
-- (, line 106
-- <-, line 106
Slice_From (Z, "ć");
when 24 =>
-- (, line 107
-- <-, line 107
Slice_From (Z, "u");
when 25 =>
-- (, line 108
-- <-, line 108
Slice_From (Z, "f");
when 26 =>
-- (, line 109
-- <-, line 109
Slice_From (Z, "h");
when 27 =>
-- (, line 110
-- <-, line 110
Slice_From (Z, "c");
when 28 =>
-- (, line 111
-- <-, line 111
Slice_From (Z, "č");
when 29 =>
-- (, line 112
-- <-, line 112
Slice_From (Z, "dž");
when 30 =>
-- (, line 113
-- <-, line 113
Slice_From (Z, "š");
when others =>
null;
end case;
Z.C := v_3;
exit;
<<lab4>>
Z.C := v_3;
if Z.C >= Z.L then
goto lab2;
end if;
-- goto, line 82
C := Skip_Utf8 (Z);
if C < 0 then
goto lab2;
end if;
Z.C := C;
end loop;
goto lab1;
<<lab2>>
Z.C := v_2;
exit;
end loop;
<<lab0>>
Z.C := v_1;
Result := True;
end R_Cyr_to_lat;
procedure R_Prelude (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
v_1 : Char_Index;
v_2 : Char_Index;
v_3 : Char_Index;
v_4 : Char_Index;
v_5 : Char_Index;
v_6 : Char_Index;
v_7 : Char_Index;
v_8 : Char_Index;
v_9 : Char_Index;
begin
-- (, line 119
-- do, line 121
v_1 := Z.C;
-- repeat, line 121
<<lab1>>
loop
v_2 := Z.C;
-- goto, line 121
loop
v_3 := Z.C;
-- (, line 121
In_Grouping (Z, G_Ca, 98, 382, False, C);
if C /= 0 then
goto lab4;
end if;
Z.Bra := Z.C; -- [, line 122
-- literal, line 122
C := Eq_S (Z, "ije");
if C = 0 then
goto lab4;
end if;
Z.C := Z.C + C;
Z.Ket := Z.C; -- ], line 122
In_Grouping (Z, G_Ca, 98, 382, False, C);
if C /= 0 then
goto lab4;
end if;
-- <-, line 122
Slice_From (Z, "e");
Z.C := v_3;
exit;
<<lab4>>
Z.C := v_3;
if Z.C >= Z.L then
goto lab2;
end if;
-- goto, line 121
C := Skip_Utf8 (Z);
if C < 0 then
goto lab2;
end if;
Z.C := C;
end loop;
goto lab1;
<<lab2>>
Z.C := v_2;
exit;
end loop;
<<lab0>>
Z.C := v_1;
-- do, line 125
v_4 := Z.C;
-- repeat, line 125
<<lab6>>
loop
v_5 := Z.C;
-- goto, line 125
loop
v_6 := Z.C;
-- (, line 125
In_Grouping (Z, G_Ca, 98, 382, False, C);
if C /= 0 then
goto lab9;
end if;
Z.Bra := Z.C; -- [, line 126
-- literal, line 126
C := Eq_S (Z, "je");
if C = 0 then
goto lab9;
end if;
Z.C := Z.C + C;
Z.Ket := Z.C; -- ], line 126
In_Grouping (Z, G_Ca, 98, 382, False, C);
if C /= 0 then
goto lab9;
end if;
-- <-, line 126
Slice_From (Z, "e");
Z.C := v_6;
exit;
<<lab9>>
Z.C := v_6;
if Z.C >= Z.L then
goto lab7;
end if;
-- goto, line 125
C := Skip_Utf8 (Z);
if C < 0 then
goto lab7;
end if;
Z.C := C;
end loop;
goto lab6;
<<lab7>>
Z.C := v_5;
exit;
end loop;
<<lab5>>
Z.C := v_4;
-- do, line 129
v_7 := Z.C;
-- repeat, line 129
<<lab11>>
loop
v_8 := Z.C;
-- goto, line 129
loop
v_9 := Z.C;
-- (, line 129
Z.Bra := Z.C; -- [, line 130
-- literal, line 130
C := Eq_S (Z, "dj");
if C = 0 then
goto lab14;
end if;
Z.C := Z.C + C;
Z.Ket := Z.C; -- ], line 130
-- <-, line 130
Slice_From (Z, "đ");
Z.C := v_9;
exit;
<<lab14>>
Z.C := v_9;
if Z.C >= Z.L then
goto lab12;
end if;
-- goto, line 129
C := Skip_Utf8 (Z);
if C < 0 then
goto lab12;
end if;
Z.C := C;
end loop;
goto lab11;
<<lab12>>
Z.C := v_8;
exit;
end loop;
<<lab10>>
Z.C := v_7;
Result := True;
end R_Prelude;
procedure R_Mark_regions (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
v_1 : Char_Index;
v_2 : Char_Index;
v_3 : Char_Index;
v_4 : Char_Index;
begin
-- (, line 135
-- set no_diacritics, line 137
Z.B_No_diacritics := True;
-- do, line 139
v_1 := Z.C;
-- (, line 139
-- gopast, line 140
-- grouping sa, line 140
Out_Grouping (Z, G_Sa, 263, 382, True, C);
if C < 0 then
goto lab0;
end if;
Z.C := Z.C + C;
-- unset no_diacritics, line 140
Z.B_No_diacritics := False;
<<lab0>>
Z.C := v_1;
Z.I_P1 := Z.L;
-- do, line 145
v_2 := Z.C;
-- (, line 145
-- gopast, line 146
-- grouping v, line 146
Out_Grouping (Z, G_V, 97, 117, True, C);
if C < 0 then
goto lab2;
end if;
Z.C := Z.C + C;
-- setmark p1, line 146
Z.I_P1 := Z.C;
if not (Z.I_P1 < 2) then
goto lab2;
end if;
-- (, line 147
-- gopast, line 148
-- non v, line 148
In_Grouping (Z, G_V, 97, 117, True, C);
if C < 0 then
goto lab2;
end if;
Z.C := Z.C + C;
-- setmark p1, line 149
Z.I_P1 := Z.C;
<<lab2>>
Z.C := v_2;
-- do, line 152
v_3 := Z.C;
-- (, line 152
-- gopast, line 153
loop
-- literal, line 153
C := Eq_S (Z, "r");
if C = 0 then
goto lab7;
end if;
Z.C := Z.C + C;
exit;
<<lab7>>
if Z.C >= Z.L then
goto lab5;
end if;
-- gopast, line 153
C := Skip_Utf8 (Z);
if C < 0 then
goto lab5;
end if;
Z.C := C;
end loop;
-- or, line 154
v_4 := Z.C;
if not (Z.C >= 2) then
goto lab9;
end if;
goto lab8;
<<lab9>>
Z.C := v_4;
-- gopast, line 154
-- non rg, line 154
In_Grouping (Z, G_Rg, 114, 114, True, C);
if C < 0 then
goto lab5;
end if;
Z.C := Z.C + C;
<<lab8>>
if not ((Z.I_P1 - Z.C) > 1) then
goto lab5;
end if;
-- setmark p1, line 155
Z.I_P1 := Z.C;
<<lab5>>
Z.C := v_3;
Result := True;
end R_Mark_regions;
procedure R_R1 (Z : in out Context_Type; Result : out Boolean) is
begin
Result := (Z.I_P1 <= Z.C);
end R_R1;
procedure R_Step_1 (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
begin
-- (, line 164
Z.Ket := Z.C; -- [, line 165
-- substring, line 165
if Z.C - 2 <= Z.Lb or else Check_Among (Z, Z.C - 1, 3, 16#346a2a#) then
Result := False;
return;
-- substring, line 165
end if;
Find_Among_Backward (Z, A_1, Among_String, null, A);
if A = 0 then
Result := False;
return;
end if;
Z.Bra := Z.C; -- ], line 165
-- among, line 165
case A is
when 1 =>
-- (, line 167
-- <-, line 167
Slice_From (Z, "loga");
when 2 =>
-- (, line 169
-- <-, line 169
Slice_From (Z, "peh");
when 3 =>
-- (, line 170
-- <-, line 170
Slice_From (Z, "vojka");
when 4 =>
-- (, line 171
-- <-, line 171
Slice_From (Z, "bojka");
when 5 =>
-- (, line 173
-- <-, line 173
Slice_From (Z, "jak");
when 6 =>
-- (, line 174
-- <-, line 174
Slice_From (Z, "čajni");
when 7 =>
-- (, line 175
-- Boolean test no_diacritics, line 175
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 175
Slice_From (Z, "cajni");
when 8 =>
-- (, line 176
-- <-, line 176
Slice_From (Z, "erni");
when 9 =>
-- (, line 177
-- <-, line 177
Slice_From (Z, "larni");
when 10 =>
-- (, line 178
-- <-, line 178
Slice_From (Z, "esni");
when 11 =>
-- (, line 179
-- <-, line 179
Slice_From (Z, "anjca");
when 12 =>
-- (, line 181
-- <-, line 181
Slice_From (Z, "ajca");
when 13 =>
-- (, line 183
-- <-, line 183
Slice_From (Z, "ljca");
when 14 =>
-- (, line 185
-- <-, line 185
Slice_From (Z, "ejca");
when 15 =>
-- (, line 187
-- <-, line 187
Slice_From (Z, "ojca");
when 16 =>
-- (, line 188
-- <-, line 188
Slice_From (Z, "ajka");
when 17 =>
-- (, line 189
-- <-, line 189
Slice_From (Z, "ojka");
when 18 =>
-- (, line 191
-- <-, line 191
Slice_From (Z, "šca");
when 19 =>
-- (, line 193
-- <-, line 193
Slice_From (Z, "ing");
when 20 =>
-- (, line 194
-- <-, line 194
Slice_From (Z, "tvenik");
when 21 =>
-- (, line 196
-- <-, line 196
Slice_From (Z, "tetika");
when 22 =>
-- (, line 197
-- <-, line 197
Slice_From (Z, "nstva");
when 23 =>
-- (, line 198
-- <-, line 198
Slice_From (Z, "nik");
when 24 =>
-- (, line 199
-- <-, line 199
Slice_From (Z, "tik");
when 25 =>
-- (, line 200
-- <-, line 200
Slice_From (Z, "zik");
when 26 =>
-- (, line 201
-- <-, line 201
Slice_From (Z, "snik");
when 27 =>
-- (, line 202
-- <-, line 202
Slice_From (Z, "kusi");
when 28 =>
-- (, line 203
-- <-, line 203
Slice_From (Z, "kusni");
when 29 =>
-- (, line 204
-- <-, line 204
Slice_From (Z, "kustva");
when 30 =>
-- (, line 205
-- <-, line 205
Slice_From (Z, "dušni");
when 31 =>
-- (, line 206
-- Boolean test no_diacritics, line 206
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 206
Slice_From (Z, "dusni");
when 32 =>
-- (, line 207
-- <-, line 207
Slice_From (Z, "antni");
when 33 =>
-- (, line 208
-- <-, line 208
Slice_From (Z, "bilni");
when 34 =>
-- (, line 209
-- <-, line 209
Slice_From (Z, "tilni");
when 35 =>
-- (, line 210
-- <-, line 210
Slice_From (Z, "avilni");
when 36 =>
-- (, line 211
-- <-, line 211
Slice_From (Z, "silni");
when 37 =>
-- (, line 212
-- <-, line 212
Slice_From (Z, "gilni");
when 38 =>
-- (, line 213
-- <-, line 213
Slice_From (Z, "rilni");
when 39 =>
-- (, line 214
-- <-, line 214
Slice_From (Z, "nilni");
when 40 =>
-- (, line 215
-- <-, line 215
Slice_From (Z, "alni");
when 41 =>
-- (, line 216
-- <-, line 216
Slice_From (Z, "ozni");
when 42 =>
-- (, line 217
-- <-, line 217
Slice_From (Z, "ravi");
when 43 =>
-- (, line 218
-- <-, line 218
Slice_From (Z, "stavni");
when 44 =>
-- (, line 219
-- <-, line 219
Slice_From (Z, "pravni");
when 45 =>
-- (, line 220
-- <-, line 220
Slice_From (Z, "tivni");
when 46 =>
-- (, line 221
-- <-, line 221
Slice_From (Z, "sivni");
when 47 =>
-- (, line 222
-- <-, line 222
Slice_From (Z, "atni");
when 48 =>
-- (, line 223
-- <-, line 223
Slice_From (Z, "enta");
when 49 =>
-- (, line 224
-- <-, line 224
Slice_From (Z, "tetni");
when 50 =>
-- (, line 225
-- <-, line 225
Slice_From (Z, "pletni");
when 51 =>
-- (, line 226
-- <-, line 226
Slice_From (Z, "šavi");
when 52 =>
-- (, line 227
-- Boolean test no_diacritics, line 227
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 227
Slice_From (Z, "savi");
when 53 =>
-- (, line 228
-- <-, line 228
Slice_From (Z, "anta");
when 54 =>
-- (, line 230
-- <-, line 230
Slice_From (Z, "ačka");
when 55 =>
-- (, line 232
-- Boolean test no_diacritics, line 232
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 232
Slice_From (Z, "acka");
when 56 =>
-- (, line 233
-- <-, line 233
Slice_From (Z, "uška");
when 57 =>
-- (, line 234
-- Boolean test no_diacritics, line 234
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 234
Slice_From (Z, "uska");
when 58 =>
-- (, line 238
-- <-, line 238
Slice_From (Z, "atka");
when 59 =>
-- (, line 240
-- <-, line 240
Slice_From (Z, "etka");
when 60 =>
-- (, line 243
-- <-, line 243
Slice_From (Z, "itka");
when 61 =>
-- (, line 245
-- <-, line 245
Slice_From (Z, "otka");
when 62 =>
-- (, line 249
-- <-, line 249
Slice_From (Z, "utka");
when 63 =>
-- (, line 250
-- <-, line 250
Slice_From (Z, "eskna");
when 64 =>
-- (, line 251
-- <-, line 251
Slice_From (Z, "tični");
when 65 =>
-- (, line 252
-- Boolean test no_diacritics, line 252
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 252
Slice_From (Z, "ticni");
when 66 =>
-- (, line 253
-- <-, line 253
Slice_From (Z, "ojska");
when 67 =>
-- (, line 254
-- <-, line 254
Slice_From (Z, "esma");
when 68 =>
-- (, line 256
-- <-, line 256
Slice_From (Z, "metra");
when 69 =>
-- (, line 258
-- <-, line 258
Slice_From (Z, "centra");
when 70 =>
-- (, line 260
-- <-, line 260
Slice_From (Z, "istra");
when 71 =>
-- (, line 261
-- <-, line 261
Slice_From (Z, "osti");
when 72 =>
-- (, line 262
-- Boolean test no_diacritics, line 262
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 262
Slice_From (Z, "osti");
when 73 =>
-- (, line 263
-- <-, line 263
Slice_From (Z, "dba");
when 74 =>
-- (, line 265
-- <-, line 265
Slice_From (Z, "čka");
when 75 =>
-- (, line 267
-- <-, line 267
Slice_From (Z, "mca");
when 76 =>
-- (, line 269
-- <-, line 269
Slice_From (Z, "nca");
when 77 =>
-- (, line 270
-- <-, line 270
Slice_From (Z, "voljni");
when 78 =>
-- (, line 271
-- <-, line 271
Slice_From (Z, "anki");
when 79 =>
-- (, line 273
-- <-, line 273
Slice_From (Z, "vca");
when 80 =>
-- (, line 275
-- <-, line 275
Slice_From (Z, "sca");
when 81 =>
-- (, line 277
-- <-, line 277
Slice_From (Z, "rca");
when 82 =>
-- (, line 280
-- <-, line 280
Slice_From (Z, "alca");
when 83 =>
-- (, line 282
-- <-, line 282
Slice_From (Z, "elca");
when 84 =>
-- (, line 285
-- <-, line 285
Slice_From (Z, "olca");
when 85 =>
-- (, line 287
-- <-, line 287
Slice_From (Z, "njca");
when 86 =>
-- (, line 289
-- <-, line 289
Slice_From (Z, "ekta");
when 87 =>
-- (, line 291
-- <-, line 291
Slice_From (Z, "izma");
when 88 =>
-- (, line 292
-- <-, line 292
Slice_From (Z, "jebi");
when 89 =>
-- (, line 293
-- <-, line 293
Slice_From (Z, "baci");
when 90 =>
-- (, line 294
-- <-, line 294
Slice_From (Z, "ašni");
when 91 =>
-- (, line 295
-- Boolean test no_diacritics, line 295
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 295
Slice_From (Z, "asni");
when others =>
null;
end case;
Result := True;
end R_Step_1;
procedure R_Step_2 (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
begin
-- (, line 299
Z.Ket := Z.C; -- [, line 300
-- substring, line 300
Find_Among_Backward (Z, A_2, Among_String, null, A);
if A = 0 then
Result := False;
return;
end if;
Z.Bra := Z.C; -- ], line 300
-- call R1, line 300
R_R1 (Z, Result);
if not Result then
Result := False;
return;
end if;
-- among, line 300
case A is
when 1 =>
-- (, line 328
-- <-, line 328
Slice_From (Z, "sk");
when 2 =>
-- (, line 356
-- <-, line 356
Slice_From (Z, "šk");
when 3 =>
-- (, line 361
-- <-, line 361
Slice_From (Z, "stv");
when 4 =>
-- (, line 366
-- <-, line 366
Slice_From (Z, "štv");
when 5 =>
-- (, line 373
-- <-, line 373
Slice_From (Z, "tanij");
when 6 =>
-- (, line 380
-- <-, line 380
Slice_From (Z, "manij");
when 7 =>
-- (, line 387
-- <-, line 387
Slice_From (Z, "panij");
when 8 =>
-- (, line 394
-- <-, line 394
Slice_From (Z, "ranij");
when 9 =>
-- (, line 401
-- <-, line 401
Slice_From (Z, "ganij");
when 10 =>
-- (, line 412
-- <-, line 412
Slice_From (Z, "an");
when 11 =>
-- (, line 420
-- <-, line 420
Slice_From (Z, "in");
when 12 =>
-- (, line 430
-- <-, line 430
Slice_From (Z, "on");
when 13 =>
-- (, line 460
-- <-, line 460
Slice_From (Z, "n");
when 14 =>
-- (, line 476
-- <-, line 476
Slice_From (Z, "ać");
when 15 =>
-- (, line 492
-- <-, line 492
Slice_From (Z, "eć");
when 16 =>
-- (, line 508
-- <-, line 508
Slice_From (Z, "uć");
when 17 =>
-- (, line 512
-- <-, line 512
Slice_From (Z, "ugov");
when 18 =>
-- (, line 519
-- <-, line 519
Slice_From (Z, "ug");
when 19 =>
-- (, line 524
-- <-, line 524
Slice_From (Z, "log");
when 20 =>
-- (, line 535
-- <-, line 535
Slice_From (Z, "g");
when 21 =>
-- (, line 539
-- <-, line 539
Slice_From (Z, "rari");
when 22 =>
-- (, line 543
-- <-, line 543
Slice_From (Z, "oti");
when 23 =>
-- (, line 547
-- <-, line 547
Slice_From (Z, "si");
when 24 =>
-- (, line 551
-- <-, line 551
Slice_From (Z, "li");
when 25 =>
-- (, line 559
-- <-, line 559
Slice_From (Z, "uj");
when 26 =>
-- (, line 570
-- <-, line 570
Slice_From (Z, "caj");
when 27 =>
-- (, line 581
-- <-, line 581
Slice_From (Z, "čaj");
when 28 =>
-- (, line 592
-- <-, line 592
Slice_From (Z, "ćaj");
when 29 =>
-- (, line 603
-- <-, line 603
Slice_From (Z, "đaj");
when 30 =>
-- (, line 614
-- <-, line 614
Slice_From (Z, "laj");
when 31 =>
-- (, line 625
-- <-, line 625
Slice_From (Z, "raj");
when 32 =>
-- (, line 633
-- <-, line 633
Slice_From (Z, "bij");
when 33 =>
-- (, line 641
-- <-, line 641
Slice_From (Z, "cij");
when 34 =>
-- (, line 649
-- <-, line 649
Slice_From (Z, "dij");
when 35 =>
-- (, line 655
-- <-, line 655
Slice_From (Z, "lij");
when 36 =>
-- (, line 658
-- <-, line 658
Slice_From (Z, "nij");
when 37 =>
-- (, line 666
-- <-, line 666
Slice_From (Z, "mij");
when 38 =>
-- (, line 674
-- <-, line 674
Slice_From (Z, "žij");
when 39 =>
-- (, line 682
-- <-, line 682
Slice_From (Z, "gij");
when 40 =>
-- (, line 690
-- <-, line 690
Slice_From (Z, "fij");
when 41 =>
-- (, line 698
-- <-, line 698
Slice_From (Z, "pij");
when 42 =>
-- (, line 706
-- <-, line 706
Slice_From (Z, "rij");
when 43 =>
-- (, line 712
-- <-, line 712
Slice_From (Z, "sij");
when 44 =>
-- (, line 720
-- <-, line 720
Slice_From (Z, "tij");
when 45 =>
-- (, line 728
-- <-, line 728
Slice_From (Z, "zij");
when 46 =>
-- (, line 736
-- <-, line 736
Slice_From (Z, "nal");
when 47 =>
-- (, line 744
-- <-, line 744
Slice_From (Z, "ijal");
when 48 =>
-- (, line 750
-- <-, line 750
Slice_From (Z, "ozil");
when 49 =>
-- (, line 754
-- <-, line 754
Slice_From (Z, "olov");
when 50 =>
-- (, line 760
-- <-, line 760
Slice_From (Z, "ol");
when 51 =>
-- (, line 768
-- <-, line 768
Slice_From (Z, "lem");
when 52 =>
-- (, line 775
-- <-, line 775
Slice_From (Z, "ram");
when 53 =>
-- (, line 782
-- <-, line 782
Slice_From (Z, "ar");
when 54 =>
-- (, line 789
-- <-, line 789
Slice_From (Z, "dr");
when 55 =>
-- (, line 796
-- <-, line 796
Slice_From (Z, "er");
when 56 =>
-- (, line 803
-- <-, line 803
Slice_From (Z, "or");
when 57 =>
-- (, line 808
-- <-, line 808
Slice_From (Z, "es");
when 58 =>
-- (, line 813
-- <-, line 813
Slice_From (Z, "is");
when 59 =>
-- (, line 821
-- <-, line 821
Slice_From (Z, "taš");
when 60 =>
-- (, line 829
-- <-, line 829
Slice_From (Z, "naš");
when 61 =>
-- (, line 837
-- <-, line 837
Slice_From (Z, "jaš");
when 62 =>
-- (, line 845
-- <-, line 845
Slice_From (Z, "kaš");
when 63 =>
-- (, line 853
-- <-, line 853
Slice_From (Z, "baš");
when 64 =>
-- (, line 861
-- <-, line 861
Slice_From (Z, "gaš");
when 65 =>
-- (, line 869
-- <-, line 869
Slice_From (Z, "vaš");
when 66 =>
-- (, line 877
-- <-, line 877
Slice_From (Z, "eš");
when 67 =>
-- (, line 885
-- <-, line 885
Slice_From (Z, "iš");
when 68 =>
-- (, line 892
-- <-, line 892
Slice_From (Z, "ikat");
when 69 =>
-- (, line 899
-- <-, line 899
Slice_From (Z, "lat");
when 70 =>
-- (, line 907
-- <-, line 907
Slice_From (Z, "et");
when 71 =>
-- (, line 915
-- <-, line 915
Slice_From (Z, "est");
when 72 =>
-- (, line 923
-- <-, line 923
Slice_From (Z, "ist");
when 73 =>
-- (, line 931
-- <-, line 931
Slice_From (Z, "kst");
when 74 =>
-- (, line 939
-- <-, line 939
Slice_From (Z, "ost");
when 75 =>
-- (, line 944
-- <-, line 944
Slice_From (Z, "išt");
when 76 =>
-- (, line 956
-- <-, line 956
Slice_From (Z, "ova");
when 77 =>
-- (, line 987
-- <-, line 987
Slice_From (Z, "av");
when 78 =>
-- (, line 1018
-- <-, line 1018
Slice_From (Z, "ev");
when 79 =>
-- (, line 1049
-- <-, line 1049
Slice_From (Z, "iv");
when 80 =>
-- (, line 1078
-- <-, line 1078
Slice_From (Z, "ov");
when 81 =>
-- (, line 1084
-- <-, line 1084
Slice_From (Z, "mov");
when 82 =>
-- (, line 1090
-- <-, line 1090
Slice_From (Z, "lov");
when 83 =>
-- (, line 1120
-- <-, line 1120
Slice_From (Z, "el");
when 84 =>
-- (, line 1150
-- <-, line 1150
Slice_From (Z, "anj");
when 85 =>
-- (, line 1180
-- <-, line 1180
Slice_From (Z, "enj");
when 86 =>
-- (, line 1210
-- <-, line 1210
Slice_From (Z, "šnj");
when 87 =>
-- (, line 1218
-- <-, line 1218
Slice_From (Z, "en");
when 88 =>
-- (, line 1222
-- <-, line 1222
Slice_From (Z, "šn");
when 89 =>
-- (, line 1237
-- <-, line 1237
Slice_From (Z, "čin");
when 90 =>
-- (, line 1253
-- <-, line 1253
Slice_From (Z, "roši");
when 91 =>
-- (, line 1282
-- <-, line 1282
Slice_From (Z, "oš");
when 92 =>
-- (, line 1310
-- <-, line 1310
Slice_From (Z, "evit");
when 93 =>
-- (, line 1338
-- <-, line 1338
Slice_From (Z, "ovit");
when 94 =>
-- (, line 1366
-- <-, line 1366
Slice_From (Z, "ast");
when 95 =>
-- (, line 1397
-- <-, line 1397
Slice_From (Z, "k");
when 96 =>
-- (, line 1424
-- <-, line 1424
Slice_From (Z, "eva");
when 97 =>
-- (, line 1451
-- <-, line 1451
Slice_From (Z, "ava");
when 98 =>
-- (, line 1478
-- <-, line 1478
Slice_From (Z, "iva");
when 99 =>
-- (, line 1505
-- <-, line 1505
Slice_From (Z, "uva");
when 100 =>
-- (, line 1537
-- <-, line 1537
Slice_From (Z, "ir");
when 101 =>
-- (, line 1560
-- <-, line 1560
Slice_From (Z, "ač");
when 102 =>
-- (, line 1583
-- <-, line 1583
Slice_From (Z, "ača");
when 103 =>
-- (, line 1611
-- <-, line 1611
Slice_From (Z, "ni");
when 104 =>
-- (, line 1637
-- <-, line 1637
Slice_From (Z, "a");
when 105 =>
-- (, line 1664
-- <-, line 1664
Slice_From (Z, "ur");
when 106 =>
-- (, line 1685
-- <-, line 1685
Slice_From (Z, "astaj");
when 107 =>
-- (, line 1706
-- <-, line 1706
Slice_From (Z, "istaj");
when 108 =>
-- (, line 1727
-- <-, line 1727
Slice_From (Z, "ostaj");
when 109 =>
-- (, line 1740
-- <-, line 1740
Slice_From (Z, "aj");
when 110 =>
-- (, line 1767
-- <-, line 1767
Slice_From (Z, "asta");
when 111 =>
-- (, line 1794
-- <-, line 1794
Slice_From (Z, "ista");
when 112 =>
-- (, line 1821
-- <-, line 1821
Slice_From (Z, "osta");
when 113 =>
-- (, line 1845
-- <-, line 1845
Slice_From (Z, "ta");
when 114 =>
-- (, line 1861
-- <-, line 1861
Slice_From (Z, "inj");
when 115 =>
-- (, line 1871
-- <-, line 1871
Slice_From (Z, "as");
when 116 =>
-- (, line 1886
-- <-, line 1886
Slice_From (Z, "i");
when 117 =>
-- (, line 1928
-- <-, line 1928
Slice_From (Z, "luč");
when 118 =>
-- (, line 1943
-- <-, line 1943
Slice_From (Z, "jeti");
when 119 =>
-- (, line 1948
-- <-, line 1948
Slice_From (Z, "e");
when 120 =>
-- (, line 1979
-- <-, line 1979
Slice_From (Z, "at");
when 121 =>
-- (, line 2017
-- Boolean test no_diacritics, line 2017
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2017
Slice_From (Z, "luc");
when 122 =>
-- (, line 2046
-- Boolean test no_diacritics, line 2046
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2046
Slice_From (Z, "snj");
when 123 =>
-- (, line 2076
-- Boolean test no_diacritics, line 2076
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2076
Slice_From (Z, "os");
when 124 =>
-- (, line 2112
-- Boolean test no_diacritics, line 2112
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2112
Slice_From (Z, "ac");
when 125 =>
-- (, line 2128
-- Boolean test no_diacritics, line 2128
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2128
Slice_From (Z, "ec");
when 126 =>
-- (, line 2144
-- Boolean test no_diacritics, line 2144
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2144
Slice_From (Z, "uc");
when 127 =>
-- (, line 2160
-- Boolean test no_diacritics, line 2160
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2160
Slice_From (Z, "rosi");
when 128 =>
-- (, line 2183
-- Boolean test no_diacritics, line 2183
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2183
Slice_From (Z, "aca");
when 129 =>
-- (, line 2191
-- Boolean test no_diacritics, line 2191
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2191
Slice_From (Z, "jas");
when 130 =>
-- (, line 2199
-- Boolean test no_diacritics, line 2199
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2199
Slice_From (Z, "tas");
when 131 =>
-- (, line 2207
-- Boolean test no_diacritics, line 2207
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2207
Slice_From (Z, "gas");
when 132 =>
-- (, line 2215
-- Boolean test no_diacritics, line 2215
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2215
Slice_From (Z, "nas");
when 133 =>
-- (, line 2223
-- Boolean test no_diacritics, line 2223
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2223
Slice_From (Z, "kas");
when 134 =>
-- (, line 2231
-- Boolean test no_diacritics, line 2231
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2231
Slice_From (Z, "vas");
when 135 =>
-- (, line 2239
-- Boolean test no_diacritics, line 2239
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2239
Slice_From (Z, "bas");
when 136 =>
-- (, line 2241
-- Boolean test no_diacritics, line 2241
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2241
Slice_From (Z, "as");
when 137 =>
-- (, line 2256
-- Boolean test no_diacritics, line 2256
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2256
Slice_From (Z, "cin");
when 138 =>
-- (, line 2259
-- Boolean test no_diacritics, line 2259
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2259
Slice_From (Z, "astaj");
when 139 =>
-- (, line 2262
-- Boolean test no_diacritics, line 2262
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2262
Slice_From (Z, "istaj");
when 140 =>
-- (, line 2265
-- Boolean test no_diacritics, line 2265
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2265
Slice_From (Z, "ostaj");
when 141 =>
-- (, line 2269
-- Boolean test no_diacritics, line 2269
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2269
Slice_From (Z, "asta");
when 142 =>
-- (, line 2273
-- Boolean test no_diacritics, line 2273
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2273
Slice_From (Z, "ista");
when 143 =>
-- (, line 2277
-- Boolean test no_diacritics, line 2277
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2277
Slice_From (Z, "osta");
when 144 =>
-- (, line 2280
-- Boolean test no_diacritics, line 2280
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2280
Slice_From (Z, "ava");
when 145 =>
-- (, line 2283
-- Boolean test no_diacritics, line 2283
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2283
Slice_From (Z, "eva");
when 146 =>
-- (, line 2286
-- Boolean test no_diacritics, line 2286
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2286
Slice_From (Z, "iva");
when 147 =>
-- (, line 2289
-- Boolean test no_diacritics, line 2289
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2289
Slice_From (Z, "uva");
when 148 =>
-- (, line 2290
-- Boolean test no_diacritics, line 2290
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2290
Slice_From (Z, "ova");
when 149 =>
-- (, line 2292
-- Boolean test no_diacritics, line 2292
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2292
Slice_From (Z, "jeti");
when 150 =>
-- (, line 2294
-- Boolean test no_diacritics, line 2294
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2294
Slice_From (Z, "inj");
when 151 =>
-- (, line 2295
-- Boolean test no_diacritics, line 2295
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2295
Slice_From (Z, "ist");
when 152 =>
-- (, line 2298
-- Boolean test no_diacritics, line 2298
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2298
Slice_From (Z, "es");
when 153 =>
-- (, line 2301
-- Boolean test no_diacritics, line 2301
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2301
Slice_From (Z, "et");
when 154 =>
-- (, line 2304
-- Boolean test no_diacritics, line 2304
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2304
Slice_From (Z, "is");
when 155 =>
-- (, line 2310
-- Boolean test no_diacritics, line 2310
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2310
Slice_From (Z, "ir");
when 156 =>
-- (, line 2313
-- Boolean test no_diacritics, line 2313
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2313
Slice_From (Z, "ur");
when 157 =>
-- (, line 2315
-- Boolean test no_diacritics, line 2315
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2315
Slice_From (Z, "uj");
when 158 =>
-- (, line 2317
-- Boolean test no_diacritics, line 2317
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2317
Slice_From (Z, "ni");
when 159 =>
-- (, line 2321
-- Boolean test no_diacritics, line 2321
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2321
Slice_From (Z, "sn");
when 160 =>
-- (, line 2323
-- Boolean test no_diacritics, line 2323
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2323
Slice_From (Z, "ta");
when 161 =>
-- (, line 2327
-- Boolean test no_diacritics, line 2327
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2327
Slice_From (Z, "a");
when 162 =>
-- (, line 2331
-- Boolean test no_diacritics, line 2331
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2331
Slice_From (Z, "i");
when 163 =>
-- (, line 2332
-- Boolean test no_diacritics, line 2332
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2332
Slice_From (Z, "e");
when 164 =>
-- (, line 2335
-- Boolean test no_diacritics, line 2335
if not Z.B_No_diacritics then
Result := False;
return;
end if;
-- <-, line 2335
Slice_From (Z, "n");
when others =>
null;
end case;
Result := True;
end R_Step_2;
procedure R_Step_3 (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
begin
-- (, line 2339
Z.Ket := Z.C; -- [, line 2340
-- substring, line 2340
if Z.C <= Z.Lb or else Check_Among (Z, Z.C - 1, 3, 16#30a7a2#) then
Result := False;
return;
-- substring, line 2340
end if;
Find_Among_Backward (Z, A_3, Among_String, null, A);
if A = 0 then
Result := False;
return;
end if;
Z.Bra := Z.C; -- ], line 2340
-- call R1, line 2340
R_R1 (Z, Result);
if not Result then
Result := False;
return;
end if;
-- (, line 2366
-- <-, line 2366
Slice_From (Z, "");
Result := True;
end R_Step_3;
procedure Stem (Z : in out Context_Type; Result : out Boolean) is
C : Result_Index;
A : Integer;
v_4 : Char_Index;
v_5 : Char_Index;
v_6 : Char_Index;
begin
-- (, line 2371
-- do, line 2372
-- call cyr_to_lat, line 2372
R_Cyr_to_lat (Z, Result);
-- do, line 2373
-- call prelude, line 2373
R_Prelude (Z, Result);
-- do, line 2374
-- call mark_regions, line 2374
R_Mark_regions (Z, Result);
Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 2375
-- (, line 2375
-- do, line 2376
v_4 := Z.L - Z.C;
-- call Step_1, line 2376
R_Step_1 (Z, Result);
Z.C := Z.L - v_4;
-- do, line 2377
v_5 := Z.L - Z.C;
-- or, line 2377
v_6 := Z.L - Z.C;
-- call Step_2, line 2377
R_Step_2 (Z, Result);
if not Result then
goto lab2;
end if;
goto lab1;
<<lab2>>
Z.C := Z.L - v_6;
-- call Step_3, line 2377
R_Step_3 (Z, Result);
if not Result then
goto lab0;
end if;
<<lab1>>
<<lab0>>
Z.C := Z.L - v_5;
Z.C := Z.Lb;
Result := True;
end Stem;
end Stemmer.Serbian;
|
30,222
|
ada
| 0
|
reznikmm/gela
|
source/oasis/program-elements-anonymous_access_definitions.ads
|
<reponame>reznikmm/gela
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Definitions;
package Program.Elements.Anonymous_Access_Definitions is
pragma Pure (Program.Elements.Anonymous_Access_Definitions);
type Anonymous_Access_Definition is
limited interface and Program.Elements.Definitions.Definition;
type Anonymous_Access_Definition_Access is
access all Anonymous_Access_Definition'Class with Storage_Size => 0;
end Program.Elements.Anonymous_Access_Definitions;
|
30,223
|
ada
| 0
|
svn2github/matreshka
|
source/xml/templates/xml-templates-processors-parser.adb
|
<filename>source/xml/templates/xml-templates-processors-parser.adb
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013-2014, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Characters.Latin;
with League.Holders.Booleans;
with League.Holders.JSON_Objects;
with League.JSON.Objects;
with League.JSON.Values;
package body XML.Templates.Processors.Parser is
type Token_Kinds is
(Token_Identifier,
Token_Full_Stop,
Token_Is,
Token_Of,
Token_Not,
Token_Null,
Token_End_Of_Expression);
subtype Keyword_Token is Token_Kinds range Token_Is .. Token_Null;
type Scanner_Type is tagged record
Text : League.Strings.Universal_String;
Current : Positive := 1;
Token : Token_Kinds;
First : Positive;
Last : Natural;
end record;
function Next_Token (Self : in out Scanner_Type'Class) return Token_Kinds;
function Token_Image
(Self : Scanner_Type'Class) return League.Strings.Universal_String;
procedure Evaluate_Simple_Expression
(Scanner : in out Scanner_Type'Class;
Context : String_Holder_Maps.Map;
Value : out League.Holders.Holder;
Success : out Boolean);
Keywords : constant array (Keyword_Token)
of League.Strings.Universal_String
:= (Token_Is => League.Strings.To_Universal_String ("is"),
Token_Of => League.Strings.To_Universal_String ("of"),
Token_Not => League.Strings.To_Universal_String ("not"),
Token_Null => League.Strings.To_Universal_String ("null"));
---------------------------------
-- Evaluate_Boolean_Expression --
---------------------------------
procedure Evaluate_Boolean_Expression
(Text : League.Strings.Universal_String;
Context : String_Holder_Maps.Map;
Value : out Boolean;
Success : out Boolean)
is
Scanner : Scanner_Type;
Holder : League.Holders.Holder;
Invert : Boolean := False;
Save : Positive := 1; -- Position of scanner after last 'not'
begin
Scanner.Text := Text;
-- Process leading 'not' keywords
loop
case Scanner.Next_Token is
when Token_Not =>
Invert := not Invert;
Save := Scanner.Current;
when others =>
-- Rewind scanner to the beginning of text
Scanner.Current := Save;
exit;
end case;
end loop;
Scanner.Evaluate_Simple_Expression (Context, Holder, Success);
if Success then
case Scanner.Token is
when Token_End_Of_Expression =>
if League.Holders.Has_Tag
(Holder, League.Holders.Booleans.Value_Tag)
then
Value := League.Holders.Booleans.Element (Holder);
else
-- Only Boolean result is allowed in boolean expression
Success := False;
end if;
when Token_Is =>
case Scanner.Next_Token is
when Token_Null =>
Value := League.Holders.Is_Empty (Holder);
when Token_Not =>
Value := not League.Holders.Is_Empty (Holder);
if Scanner.Next_Token /= Token_Null then
Success := False;
end if;
when others =>
Success := False;
end case;
if Scanner.Next_Token /= Token_End_Of_Expression then
Success := False;
end if;
when others =>
Success := False;
end case;
Value := Value xor Invert;
end if;
end Evaluate_Boolean_Expression;
-----------------------------
-- Evaluate_For_Expression --
-----------------------------
procedure Evaluate_For_Expression
(Text : League.Strings.Universal_String;
Context : String_Holder_Maps.Map;
Variable : out League.Strings.Universal_String;
Value : out League.Holders.Holder;
Success : out Boolean)
is
Scanner : Scanner_Type;
begin
Scanner.Text := Text;
-- Lookup for identifier.
case Scanner.Next_Token is
when Token_Identifier =>
Variable := Scanner.Token_Image.To_Casefold;
Success := True;
when others =>
League.Holders.Clear (Value);
Success := False;
return;
end case;
-- Lookup for 'Of' keyword.
case Scanner.Next_Token is
when Token_Of =>
null;
when others =>
League.Holders.Clear (Value);
Success := False;
return;
end case;
-- Evaluate rest of expression.
Scanner.Evaluate_Simple_Expression (Context, Value, Success);
Success := Success and then Scanner.Token = Token_End_Of_Expression;
end Evaluate_For_Expression;
--------------------------------
-- Evaluate_Simple_Expression --
--------------------------------
procedure Evaluate_Simple_Expression
(Text : League.Strings.Universal_String;
Context : String_Holder_Maps.Map;
Value : out League.Holders.Holder;
Success : out Boolean)
is
Scanner : Scanner_Type;
begin
Scanner.Text := Text;
Scanner.Evaluate_Simple_Expression (Context, Value, Success);
Success := Success and then Scanner.Token = Token_End_Of_Expression;
end Evaluate_Simple_Expression;
--------------------------------
-- Evaluate_Simple_Expression --
--------------------------------
procedure Evaluate_Simple_Expression
(Scanner : in out Scanner_Type'Class;
Context : String_Holder_Maps.Map;
Value : out League.Holders.Holder;
Success : out Boolean) is
begin
-- Lookup for identifier
loop
case Scanner.Next_Token is
when Token_Identifier =>
Value := Context (Scanner.Token_Image.To_Casefold);
Success := True;
exit;
when others =>
League.Holders.Clear (Value);
Success := False;
return;
end case;
end loop;
loop
-- Lookup for full stop or end of expression.
case Scanner.Next_Token is
when Token_End_Of_Expression =>
exit;
when Token_Full_Stop =>
null;
when others =>
-- Return on end of expression or any other token
return;
end case;
-- Lookup for identifier.
case Scanner.Next_Token is
when Token_Identifier =>
if League.Holders.Has_Tag
(Value, League.Holders.JSON_Objects.Value_Tag)
then
declare
JS_Object : constant League.JSON.Objects.JSON_Object
:= League.Holders.JSON_Objects.Element (Value);
begin
if not JS_Object.Contains (Scanner.Token_Image) then
League.Holders.Clear (Value);
Success := False;
return;
end if;
Value := League.JSON.Values.To_Holder
(JS_Object.Value (Scanner.Token_Image));
end;
else
League.Holders.Component
(Value, Scanner.Token_Image, Value, Success);
if not Success then
return;
end if;
end if;
when others =>
League.Holders.Clear (Value);
Success := False;
return;
end case;
end loop;
end Evaluate_Simple_Expression;
----------------
-- Next_Token --
----------------
function Next_Token (Self : in out Scanner_Type'Class) return Token_Kinds is
use type League.Characters.Universal_Character;
use type League.Strings.Universal_String;
begin
Self.First := Self.Current;
-- Skip white spaces
while Self.Current <= Self.Text.Length loop
exit when not Self.Text (Self.Current).Is_White_Space;
Self.Current := Self.Current + 1;
Self.First := Self.Current;
end loop;
if Self.First > Self.Text.Length then
Self.Token := Token_End_Of_Expression;
-- Extract identifier
elsif Self.Text (Self.First).Is_ID_Start then
Self.Current := Self.Current + 1;
while Self.Current <= Self.Text.Length loop
exit when not Self.Text (Self.Current).Is_ID_Continue;
Self.Current := Self.Current + 1;
end loop;
Self.Last := Self.Current - 1;
Self.Token := Token_Identifier;
for J in Keywords'Range loop
if Self.Last - Self.First + 1 = Keywords (J).Length
and then Self.Token_Image = Keywords (J)
then
Self.Token := J;
exit;
end if;
end loop;
elsif Self.Text (Self.First) = League.Characters.Latin.Full_Stop then
Self.Current := Self.Current + 1;
Self.Token := Token_Full_Stop;
else
raise Constraint_Error with "Syntax error";
end if;
return Self.Token;
end Next_Token;
-----------------
-- Token_Image --
-----------------
function Token_Image
(Self : Scanner_Type'Class) return League.Strings.Universal_String is
begin
return Self.Text.Slice (Self.First, Self.Last);
end Token_Image;
end XML.Templates.Processors.Parser;
|
30,224
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45347a.ada
|
<gh_stars>1-10
-- C45347A.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 CATENATION IS DEFINED FOR RECORD TYPES AS COMPONENT TYPES.
-- JWC 11/15/85
WITH REPORT; USE REPORT;
PROCEDURE C45347A IS
BEGIN
TEST ("C45347A", "CHECK THAT CATENATION IS DEFINED " &
"FOR RECORD TYPES AS COMPONENT TYPES");
DECLARE
TYPE REC IS
RECORD
X : INTEGER;
END RECORD;
SUBTYPE INT IS INTEGER RANGE 1 .. 4;
TYPE A IS ARRAY ( INT RANGE <>) OF REC;
R1 : REC := (X => 4);
R2 : REC := (X => 1);
A1 : A(1 .. 2) := ((X => 1), (X => 2));
A2 : A(1 .. 2) := ((X => 3), (X => 4));
A3 : A(1 .. 4) := ((X => 1), (X => 2), (X => 3), (X => 4));
A4 : A(1 .. 4);
A5 : A(1 .. 4) := ((X => 4), (X => 3), (X => 2), (X => 1));
BEGIN
A4 := A1 & A2;
IF A3 /= A4 THEN
FAILED ("INCORRECT CATENATION FOR TWO ARRAYS OF " &
"RECORDS");
END IF;
A4 := A5;
A4 := A1 & A2(1) & R1;
IF A3 /= A4 THEN
FAILED ("INCORRECT CATENATION FOR ARRAY OF RECORD, " &
"AND RECORDS");
END IF;
A4 := A5;
A4 := R2 & (A1(2) & A2);
IF A3 /= A4 THEN
FAILED ("INCORRECT CATENATION FOR RECORDS, " &
"AND ARRAY OF RECORDS");
END IF;
A4 := A5;
A4 := R2 & A1(2) & (A2(1) & R1);
IF A3 /= A4 THEN
FAILED ("INCORRECT CATENATION FOR RECORDS");
END IF;
END;
RESULT;
END C45347A;
|
30,225
|
ada
| 0
|
corentingay/ada_epita
|
project/ads_files/screen_hpp.ads
|
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
package screen_hpp is
-- Struct used to pass around infos about the buffer used for display
-- We assume that rowstride = 1 (memory is contiguous)
-- We assume that n_channels = 3 (RGB)
package Class_Screen is
type Screen is limited record
pixels : access unsigned_char; -- ./screen.hpp:8
rowstride : aliased unsigned; -- ./screen.hpp:9
n_channels : aliased unsigned; -- ./screen.hpp:10
end record;
pragma Import (CPP, Screen);
end;
use Class_Screen;
end screen_hpp;
|
30,226
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/warn6.ads
|
package Warn6 is
package Q is
type T is private; -- this is the trigger
private
type T is access Integer;
pragma No_Strict_Aliasing (T);
end Q;
subtype Q_T is Q.T;
procedure Dummy;
end Warn6;
|
30,227
|
ada
| 0
|
reznikmm/declarative-regions
|
source/regions/regions-factories.ads
|
<reponame>reznikmm/declarative-regions
-- SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Regions.Contexts;
with Regions.Entities.Packages;
with Regions.Environments;
package Regions.Factories is
pragma Preelaborate;
type Factory is limited interface;
------------------
-- Environment --
------------------
not overriding function Root_Environment (Self : access Factory)
return Regions.Environments.Environment is abstract;
-- Create a root environment that contains an empty standard package
not overriding function Enter_Region
(Self : access Factory;
Environment : Regions.Environments.Environment;
Region : not null Regions.Entities.Packages.Package_Access)
return Regions.Environments.Environment is abstract;
not overriding function Create_Package
(Self : access Factory;
Environment : Regions.Environments.Environment;
Name : Regions.Contexts.Selected_Entity_Name)
return Regions.Entities.Packages.Package_Access is abstract;
not overriding procedure Append_Entity
(Self : access Factory;
Region : in out Regions.Region'Class;
Symbol : Regions.Symbols.Symbol;
Entity : Regions.Entities.Entity_Access) is abstract;
end Regions.Factories;
|
30,228
|
ada
| 20
|
charlie5/lace
|
3-mid/impact/source/3d/math/impact-d3-aabb_util.ads
|
<reponame>charlie5/lace<gh_stars>10-100
with Interfaces;
package impact.d3.aabb_Util
--
--
--
is
use Math;
type Signs is array (1 .. 3) of interfaces.unsigned_32;
subtype Bounds is Vector_3_array (1 .. 2);
procedure Transform_Aabb (halfExtents : in math.Vector_3;
margin : in math.Real;
t : in Transform_3d;
aabbMinOut,
aabbMaxOut : out math.Vector_3);
procedure Transform_Aabb (localAabbMin,
localAabbMax : in math.Vector_3;
margin : in math.Real;
t : in Transform_3d;
aabbMinOut,
aabbMaxOut : out math.Vector_3);
function btRayAabb2 (rayFrom, rayInvDirection : in math.Vector_3;
raySign : in Signs;
bounds : in impact.d3.aabb_Util.Bounds;
tmin : access math.Real;
lambda_min, lambda_max : in math.Real) return Boolean;
function btRayAabb (rayFrom, rayTo : in math.Vector_3;
aabbMin, aabbMax : in math.Vector_3;
param : access math.Real;
normal : access math.Vector_3) return Boolean;
function btOutcode (p, halfExtent : in math.Vector_3) return Interfaces.Unsigned_32;
function TestTriangleAgainstAabb2 (vertices : in math.Matrix_3x3;
aabbMin, aabbMax : in math.Vector_3) return Boolean;
--
-- Conservative test for overlap between triangle and aabb.
end impact.d3.aabb_Util;
-- SIMD_FORCE_INLINE void AabbExpand (impact.d3.Vector& aabbMin,
-- impact.d3.Vector& aabbMax,
-- const impact.d3.Vector& expansionMin,
-- const impact.d3.Vector& expansionMax)
-- {
-- aabbMin = aabbMin + expansionMin;
-- aabbMax = aabbMax + expansionMax;
-- }
-- /// conservative test for overlap between two aabbs
-- SIMD_FORCE_INLINE bool TestPointAgainstAabb2(const impact.d3.Vector &aabbMin1, const impact.d3.Vector &aabbMax1,
-- const impact.d3.Vector &point)
-- {
-- bool overlap = true;
-- overlap = (aabbMin1.getX() > point.getX() || aabbMax1.getX() < point.getX()) ? false : overlap;
-- overlap = (aabbMin1.getZ() > point.getZ() || aabbMax1.getZ() < point.getZ()) ? false : overlap;
-- overlap = (aabbMin1.getY() > point.getY() || aabbMax1.getY() < point.getY()) ? false : overlap;
-- return overlap;
-- }
--
-- /// conservative test for overlap between two aabbs
-- SIMD_FORCE_INLINE bool TestAabbAgainstAabb2(const impact.d3.Vector &aabbMin1, const impact.d3.Vector &aabbMax1,
-- const impact.d3.Vector &aabbMin2, const impact.d3.Vector &aabbMax2)
-- {
-- bool overlap = true;
-- overlap = (aabbMin1.getX() > aabbMax2.getX() || aabbMax1.getX() < aabbMin2.getX()) ? false : overlap;
-- overlap = (aabbMin1.getZ() > aabbMax2.getZ() || aabbMax1.getZ() < aabbMin2.getZ()) ? false : overlap;
-- overlap = (aabbMin1.getY() > aabbMax2.getY() || aabbMax1.getY() < aabbMin2.getY()) ? false : overlap;
-- return overlap;
-- }
-- #define USE_BANCHLESS 1
-- #ifdef USE_BANCHLESS
-- //This block replaces the block below and uses no branches, and replaces the 8 bit return with a 32 bit return for improved performance (~3x on XBox 360)
-- SIMD_FORCE_INLINE unsigned testQuantizedAabbAgainstQuantizedAabb(const unsigned short int* aabbMin1,const unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2)
-- {
-- return static_cast<unsigned int>(btSelect((unsigned)((aabbMin1[0] <= aabbMax2[0]) & (aabbMax1[0] >= aabbMin2[0])
-- & (aabbMin1[2] <= aabbMax2[2]) & (aabbMax1[2] >= aabbMin2[2])
-- & (aabbMin1[1] <= aabbMax2[1]) & (aabbMax1[1] >= aabbMin2[1])),
-- 1, 0));
-- }
-- #else
-- SIMD_FORCE_INLINE bool testQuantizedAabbAgainstQuantizedAabb(const unsigned short int* aabbMin1,const unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2)
-- {
-- bool overlap = true;
-- overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? false : overlap;
-- overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? false : overlap;
-- overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? false : overlap;
-- return overlap;
-- }
-- #endif //USE_BANCHLESS
|
30,229
|
ada
| 1
|
Okasu/Byron
|
src/byron.adb
|
<gh_stars>1-10
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Sockets; use GNAT.Sockets;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Plugin_Management; use Plugin_Management;
with Ada.Command_Line; use Ada.Command_Line;
with Plugin;
with IRC;
with Config;
with Ada.Streams;
use type Ada.Streams.Stream_Element_Count;
procedure Byron is
Invalid_Arguments : exception;
Verbose : Boolean := False;
begin
if Argument_Count < 1 then
raise Invalid_Arguments;
elsif Argument (1) = "-v" then
if Argument_Count < 2 then
raise Invalid_Arguments;
else
Verbose := True;
Config.Parse (Argument (2));
end if;
else
Config.Parse (Argument (1));
end if;
declare
Address : constant Sock_Addr_Type :=
(Addr => Addresses (Get_Host_By_Name (To_String (Config.Server))),
Port => Port_Type (Config.Port),
Family => Family_Inet);
begin
IRC.Connect_To (Address);
IRC.Set_Nick (To_String (Config.Nick));
IRC.Identify (To_String (Config.Password));
for C in Plugin.Vectors.Iterate (Config.Channels) loop
IRC.Join_Channel ('#' & To_String (Plugin.Vectors.Element (C)));
end loop;
loop
declare
Line : constant String := To_String (IRC.Get_Line);
Message : constant IRC.Message := IRC.Get_Message;
begin
if Verbose then
Put_Line (Line);
end if;
IRC.Pong;
if Message.Mode = IRC.Modes (IRC.Privmsg) then
Execute_Commands (Message, Config.Owner, Config.Prefix);
end if;
end;
end loop;
end;
exception
when Invalid_Arguments =>
Put_Line ("Usage: byron [-v] CONFIG_FILE");
Put_Line ("-v verbose mode");
end Byron;
|
30,230
|
ada
| 20
|
HeisenbugLtd/spat
|
src/util/spat-gpr_support.ads
|
<reponame>HeisenbugLtd/spat
------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (<EMAIL>)
--
-- 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);
------------------------------------------------------------------------------
--
-- SPARK Proof Analysis Tool
--
-- S.P.A.T. - GNAT project file (.gpr) support.
--
------------------------------------------------------------------------------
limited with Ada.Containers.Hashed_Maps;
limited with GNATCOLL.VFS;
package SPAT.GPR_Support is
package SPARK_Source_Maps is new
Ada.Containers.Hashed_Maps (Key_Type => SPARK_File_Name,
Element_Type => Source_File_Name,
Hash => SPAT.Hash,
Equivalent_Keys => "=",
"=" => "=");
---------------------------------------------------------------------------
-- Get_SPARK_Files
--
-- Retrieve all (existing) .spark files from the project.
---------------------------------------------------------------------------
function Get_SPARK_Files
(GPR_File : GNATCOLL.VFS.Filesystem_String) return SPARK_Source_Maps.Map;
end SPAT.GPR_Support;
|
30,231
|
ada
| 0
|
orb-zhuchen/Orb
|
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/g-sothco.ads
|
<gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . S O C K E T S . T H I N _ C O M M O N --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2019, 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 is the target-independent part of the thin sockets mapping.
-- This package should not be directly with'ed by an applications program.
with Ada.Unchecked_Conversion;
with Interfaces.C.Strings;
package GNAT.Sockets.Thin_Common is
package C renames Interfaces.C;
package CS renames C.Strings;
Success : constant C.int := 0;
Failure : constant C.int := -1;
type time_t is
range -2 ** (8 * SOSC.SIZEOF_tv_sec - 1)
.. 2 ** (8 * SOSC.SIZEOF_tv_sec - 1) - 1;
for time_t'Size use 8 * SOSC.SIZEOF_tv_sec;
pragma Convention (C, time_t);
type suseconds_t is
range -2 ** (8 * SOSC.SIZEOF_tv_usec - 1)
.. 2 ** (8 * SOSC.SIZEOF_tv_usec - 1) - 1;
for suseconds_t'Size use 8 * SOSC.SIZEOF_tv_usec;
pragma Convention (C, suseconds_t);
type Timeval is record
Tv_Sec : time_t;
Tv_Usec : suseconds_t;
end record;
pragma Convention (C, Timeval);
type Timeval_Access is access all Timeval;
pragma Convention (C, Timeval_Access);
type socklen_t is mod 2 ** (8 * SOSC.SIZEOF_socklen_t);
for socklen_t'Size use (8 * SOSC.SIZEOF_socklen_t);
Immediat : constant Timeval := (0, 0);
-------------------------------------------
-- Mapping tables to low level constants --
-------------------------------------------
Families : constant array (Family_Type) of C.int :=
(Family_Unspec => SOSC.AF_UNSPEC,
Family_Inet => SOSC.AF_INET,
Family_Inet6 => SOSC.AF_INET6);
Lengths : constant array (Family_Type) of C.unsigned_char :=
(Family_Unspec => 0,
Family_Inet => SOSC.SIZEOF_sockaddr_in,
Family_Inet6 => SOSC.SIZEOF_sockaddr_in6);
----------------------------
-- Generic socket address --
----------------------------
-- Common header
-- All socket address types (struct sockaddr, struct sockaddr_storage,
-- and protocol specific address types) start with the same 2-byte header,
-- which is either a length and a family (one byte each) or just a two-byte
-- family. The following unchecked union describes the two possible layouts
-- and is meant to be constrained with SOSC.Have_Sockaddr_Len.
type Sockaddr_Length_And_Family
(Has_Sockaddr_Len : Boolean := False)
is record
case Has_Sockaddr_Len is
when True =>
Length : C.unsigned_char;
Char_Family : C.unsigned_char;
when False =>
Short_Family : C.unsigned_short;
end case;
end record;
pragma Unchecked_Union (Sockaddr_Length_And_Family);
pragma Convention (C, Sockaddr_Length_And_Family);
procedure Set_Family
(Length_And_Family : out Sockaddr_Length_And_Family;
Family : Family_Type);
-- Set the family component to the appropriate value for Family, and also
-- set Length accordingly if applicable on this platform.
----------------------------
-- AF_INET socket address --
----------------------------
type In_Addr is record
S_B1, S_B2, S_B3, S_B4 : C.unsigned_char;
end record;
for In_Addr'Alignment use C.int'Alignment;
pragma Convention (C, In_Addr);
-- IPv4 address, represented as a network-order C.int. Note that the
-- underlying operating system may assume that values of this type have
-- C.int alignment, so we need to provide a suitable alignment clause here.
function To_In_Addr is new Ada.Unchecked_Conversion (C.int, In_Addr);
function To_Int is new Ada.Unchecked_Conversion (In_Addr, C.int);
function To_In_Addr (Addr : Inet_Addr_Type) return In_Addr;
procedure To_Inet_Addr
(Addr : In_Addr;
Result : out Inet_Addr_Type);
-- Conversion functions
type In6_Addr is array (1 .. 16) of C.unsigned_char;
for In6_Addr'Alignment use C.int'Alignment;
pragma Convention (C, In6_Addr);
function To_In6_Addr (Addr : Inet_Addr_Type) return In6_Addr;
procedure To_Inet_Addr
(Addr : In6_Addr;
Result : out Inet_Addr_Type);
-- Conversion functions
type Sockaddr (Family : Family_Type := Family_Inet) is record
Sin_Family : Sockaddr_Length_And_Family;
-- Address family (and address length on some platforms)
Sin_Port : C.unsigned_short;
-- Port in network byte order
case Family is
when Family_Inet =>
Sin_Addr : In_Addr := (others => 0);
-- IPv4 address
Sin_Zero : C.char_array (1 .. 8) := (others => C.nul);
-- Padding
--
-- Note that some platforms require that all unused (reserved) bytes
-- in addresses be initialized to 0 (e.g. VxWorks).
when Family_Inet6 =>
Sin6_FlowInfo : Interfaces.Unsigned_32 := 0;
Sin6_Addr : In6_Addr := (others => 0);
Sin6_Scope_Id : Interfaces.Unsigned_32 := 0;
when Family_Unspec =>
null;
end case;
end record;
pragma Unchecked_Union (Sockaddr);
pragma Convention (C, Sockaddr);
-- Internet socket address
type Sockaddr_Access is access all Sockaddr;
pragma Convention (C, Sockaddr_Access);
-- Access to internet socket address
procedure Set_Address
(Sin : Sockaddr_Access;
Address : Sock_Addr_Type);
-- Initialise all necessary fields in Sin from Address.
-- Set appropriate Family, Port, and either Sin.Sin_Addr or Sin.Sin6_Addr
-- depend on family.
function Get_Address (Sin : Sockaddr) return Sock_Addr_Type;
-- Get Sock_Addr_Type from Sockaddr
------------------
-- Host entries --
------------------
type Hostent is new
System.Storage_Elements.Storage_Array (1 .. SOSC.SIZEOF_struct_hostent);
for Hostent'Alignment use 8;
-- Host entry. This is an opaque type used only via the following
-- accessor functions, because 'struct hostent' has different layouts on
-- different platforms.
type Hostent_Access is access all Hostent;
pragma Convention (C, Hostent_Access);
-- Access to host entry
function Hostent_H_Name
(E : Hostent_Access) return System.Address;
function Hostent_H_Alias
(E : Hostent_Access; I : C.int) return System.Address;
function Hostent_H_Addrtype
(E : Hostent_Access) return C.int;
function Hostent_H_Length
(E : Hostent_Access) return C.int;
function Hostent_H_Addr
(E : Hostent_Access; Index : C.int) return System.Address;
---------------------
-- Service entries --
---------------------
type Servent is new
System.Storage_Elements.Storage_Array (1 .. SOSC.SIZEOF_struct_servent);
for Servent'Alignment use 8;
-- Service entry. This is an opaque type used only via the following
-- accessor functions, because 'struct servent' has different layouts on
-- different platforms.
type Servent_Access is access all Servent;
pragma Convention (C, Servent_Access);
-- Access to service entry
function Servent_S_Name
(E : Servent_Access) return System.Address;
function Servent_S_Alias
(E : Servent_Access; Index : C.int) return System.Address;
function Servent_S_Port
(E : Servent_Access) return C.unsigned_short;
function Servent_S_Proto
(E : Servent_Access) return System.Address;
------------------
-- NetDB access --
------------------
-- There are three possible situations for the following NetDB access
-- functions:
-- - inherently thread safe (case of data returned in a thread specific
-- buffer);
-- - thread safe using user-provided buffer;
-- - thread unsafe.
--
-- In the first and third cases, the Buf and Buflen are ignored. In the
-- second case, the caller must provide a buffer large enough to
-- accommodate the returned data. In the third case, the caller must ensure
-- that these functions are called within a critical section.
function C_Gethostbyname
(Name : C.char_array;
Ret : not null access Hostent;
Buf : System.Address;
Buflen : C.int;
H_Errnop : not null access C.int) return C.int;
function C_Gethostbyaddr
(Addr : System.Address;
Addr_Len : C.int;
Addr_Type : C.int;
Ret : not null access Hostent;
Buf : System.Address;
Buflen : C.int;
H_Errnop : not null access C.int) return C.int;
function C_Getservbyname
(Name : C.char_array;
Proto : C.char_array;
Ret : not null access Servent;
Buf : System.Address;
Buflen : C.int) return C.int;
function C_Getservbyport
(Port : C.int;
Proto : C.char_array;
Ret : not null access Servent;
Buf : System.Address;
Buflen : C.int) return C.int;
Address_Size : constant := Standard'Address_Size;
type Addrinfo;
type Addrinfo_Access is access all Addrinfo;
type Addrinfo is record
ai_flags : C.int;
ai_family : C.int;
ai_socktype : C.int;
ai_protocol : C.int;
ai_addrlen : socklen_t;
ai_addr : Sockaddr_Access;
ai_canonname : CS.char_array_access;
ai_next : Addrinfo_Access;
end record with Convention => C;
for Addrinfo use record
ai_flags at SOSC.AI_FLAGS_OFFSET range 0 .. C.int'Size - 1;
ai_family at SOSC.AI_FAMILY_OFFSET range 0 .. C.int'Size - 1;
ai_socktype at SOSC.AI_SOCKTYPE_OFFSET range 0 .. C.int'Size - 1;
ai_protocol at SOSC.AI_PROTOCOL_OFFSET range 0 .. C.int'Size - 1;
ai_addrlen at SOSC.AI_ADDRLEN_OFFSET range 0 .. socklen_t'Size - 1;
ai_canonname at SOSC.AI_CANONNAME_OFFSET range 0 .. Address_Size - 1;
ai_addr at SOSC.AI_ADDR_OFFSET range 0 .. Address_Size - 1;
ai_next at SOSC.AI_NEXT_OFFSET range 0 .. Address_Size - 1;
end record;
function C_Getaddrinfo
(Node : CS.char_array_access;
Service : CS.char_array_access;
Hints : access constant Addrinfo;
Res : not null access Addrinfo_Access) return C.int;
procedure C_Freeaddrinfo (res : Addrinfo_Access);
function C_Getnameinfo
(sa : Sockaddr_Access;
salen : socklen_t;
host : CS.char_array_access;
hostlen : C.size_t;
serv : CS.char_array_access;
servlen : C.size_t;
flags : C.int) return C.int;
function C_GAI_Strerror (ecode : C.int) return CS.chars_ptr;
------------------------------------
-- Scatter/gather vector handling --
------------------------------------
type Msghdr is record
Msg_Name : System.Address;
Msg_Namelen : C.unsigned;
Msg_Iov : System.Address;
Msg_Iovlen : SOSC.Msg_Iovlen_T;
Msg_Control : System.Address;
Msg_Controllen : C.size_t;
Msg_Flags : C.int;
end record;
pragma Convention (C, Msghdr);
----------------------------
-- Socket sets management --
----------------------------
procedure Get_Socket_From_Set
(Set : access Fd_Set;
Last : access C.int;
Socket : access C.int);
-- Get last socket in Socket and remove it from the socket set. The
-- parameter Last is a maximum value of the largest socket. This hint is
-- used to avoid scanning very large socket sets. After a call to
-- Get_Socket_From_Set, Last is set back to the real largest socket in the
-- socket set.
procedure Insert_Socket_In_Set
(Set : access Fd_Set;
Socket : C.int);
-- Insert socket in the socket set
function Is_Socket_In_Set
(Set : access constant Fd_Set;
Socket : C.int) return C.int;
-- Check whether Socket is in the socket set, return a non-zero
-- value if it is, zero if it is not.
procedure Last_Socket_In_Set
(Set : access Fd_Set;
Last : access C.int);
-- Find the largest socket in the socket set. This is needed for select().
-- When Last_Socket_In_Set is called, parameter Last is a maximum value of
-- the largest socket. This hint is used to avoid scanning very large
-- socket sets. After the call, Last is set back to the real largest socket
-- in the socket set.
procedure Remove_Socket_From_Set (Set : access Fd_Set; Socket : C.int);
-- Remove socket from the socket set
procedure Reset_Socket_Set (Set : access Fd_Set);
-- Make Set empty
------------------------------------------
-- Pairs of signalling file descriptors --
------------------------------------------
type Two_Ints is array (0 .. 1) of C.int;
pragma Convention (C, Two_Ints);
-- Container for two int values
subtype Fd_Pair is Two_Ints;
-- Two_Ints as used for Create_Signalling_Fds: a pair of connected file
-- descriptors, one of which (the "read end" of the connection) being used
-- for reading, the other one (the "write end") being used for writing.
Read_End : constant := 0;
Write_End : constant := 1;
-- Indexes into an Fd_Pair value providing access to each of the connected
-- file descriptors.
function Inet_Pton
(Af : C.int;
Cp : System.Address;
Inp : System.Address) return C.int;
function Inet_Ntop
(Af : C.int;
Src : System.Address;
Dst : CS.char_array_access;
Size : socklen_t) return CS.char_array_access;
function C_Ioctl
(Fd : C.int;
Req : SOSC.IOCTL_Req_T;
Arg : access C.int) return C.int;
function Short_To_Network
(S : C.unsigned_short) return C.unsigned_short;
pragma Inline (Short_To_Network);
-- Convert a port number into a network port number
function Network_To_Short
(S : C.unsigned_short) return C.unsigned_short
renames Short_To_Network;
-- Symmetric operation
private
pragma Import (C, Get_Socket_From_Set, "__gnat_get_socket_from_set");
pragma Import (C, Is_Socket_In_Set, "__gnat_is_socket_in_set");
pragma Import (C, Last_Socket_In_Set, "__gnat_last_socket_in_set");
pragma Import (C, Insert_Socket_In_Set, "__gnat_insert_socket_in_set");
pragma Import (C, Remove_Socket_From_Set, "__gnat_remove_socket_from_set");
pragma Import (C, Reset_Socket_Set, "__gnat_reset_socket_set");
pragma Import (C, C_Ioctl, "__gnat_socket_ioctl");
pragma Import (C, Inet_Pton, SOSC.Inet_Pton_Linkname);
pragma Import (C, Inet_Ntop, SOSC.Inet_Ntop_Linkname);
pragma Import (C, C_Gethostbyname, "__gnat_gethostbyname");
pragma Import (C, C_Gethostbyaddr, "__gnat_gethostbyaddr");
pragma Import (C, C_Getservbyname, "__gnat_getservbyname");
pragma Import (C, C_Getservbyport, "__gnat_getservbyport");
pragma Import (C, C_Getaddrinfo, "__gnat_getaddrinfo");
pragma Import (C, C_Freeaddrinfo, "__gnat_freeaddrinfo");
pragma Import (C, C_Getnameinfo, "__gnat_getnameinfo");
pragma Import (C, C_GAI_Strerror, "__gnat_gai_strerror");
pragma Import (C, Servent_S_Name, "__gnat_servent_s_name");
pragma Import (C, Servent_S_Alias, "__gnat_servent_s_alias");
pragma Import (C, Servent_S_Port, "__gnat_servent_s_port");
pragma Import (C, Servent_S_Proto, "__gnat_servent_s_proto");
pragma Import (C, Hostent_H_Name, "__gnat_hostent_h_name");
pragma Import (C, Hostent_H_Alias, "__gnat_hostent_h_alias");
pragma Import (C, Hostent_H_Addrtype, "__gnat_hostent_h_addrtype");
pragma Import (C, Hostent_H_Length, "__gnat_hostent_h_length");
pragma Import (C, Hostent_H_Addr, "__gnat_hostent_h_addr");
end GNAT.Sockets.Thin_Common;
|
30,232
|
ada
| 0
|
bracke/Meaning
|
source/RASCAL-WimpTask.ads
|
--------------------------------------------------------------------------------
-- --
-- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers. --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU Lesser General Public --
-- License as published by the Free Software Foundation; either --
-- version 2.1 of the License, or (at your option) any later version. --
-- --
-- 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 --
-- Lesser General Public License for more details. --
-- --
-- You should have received a copy of the GNU Lesser 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 --
-- --
--------------------------------------------------------------------------------
-- @brief Wimp Task related types and methods.
-- $Author$
-- $Date$
-- $Revision$
with Interfaces.C; use Interfaces.C;
with System.Storage_Elements; use System.Storage_Elements;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Kernel; use Kernel;
with List; use List;
with HandlerList; use HandlerList;
with RASCAL.OS; use RASCAL.OS;
with RASCAL.Error; use RASCAL.Error;
with RASCAL.Toolbox; use RASCAL.Toolbox;
package RASCAL.WimpTask is
Unable_To_Initialise_WimpTask : Exception;
Unknown_Deleted_Event : Exception;
subtype Poll_Mask_Type is unsigned;
type Task_Status_Type is new boolean;
type Task_Handle_Type is new integer;
type Wimp_Task_Class is tagged private;
type Wimp_Version_Type is new integer;
Unable_Initialise_ToolboxTask : Exception;
Remove_Event_Is_Toolbox_Event : Exception;
No_Toolbox_Res_Path : Exception;
TB_Event_Added_After_Task_Init : Exception;
type ToolBox_Task_Class is new WimpTask.Wimp_Task_Class with private;
--
-- Initialise Wimp task.
--
procedure Initialise (The : in out Wimp_Task_Class);
--
-- Initilise Toolbox task.
--
procedure Initialise (The : in out ToolBox_Task_Class);
--
-- Start multitasking / polling.
--
procedure Poll (The : in out Wimp_Task_Class'Class);
--
-- Make a single poll to ensure multitasking during calculations.
--
procedure Single_Poll (The : in out Wimp_Task_Class'Class;
Mask: in Integer := 0);
--
-- Add event listener.
--
procedure Add_Listener (The : in out Wimp_Task_Class'Class;
Listener : in Event_Pointer);
--
-- Remove event listener, only wimp and message events.
--
procedure Remove_Listener (The : in out Wimp_Task_Class'Class;
Listener : in Event_Pointer);
--
-- Returns Wimp version.
--
function Get_Wimp_Version (The : in Wimp_Task_Class'Class)
return Wimp_Version_Type;
--
-- Returns Task handle.
--
function Get_Task_Handle (The : in Wimp_Task_Class'Class) return Task_Handle_Type;
--
-- Returns task name.
--
function Get_Name (The : in Wimp_Task_Class'Class) return String;
--
-- Returns Wimp block.
--
function Get_Wimp_Block (The : in Wimp_Task_Class'Class)
return Wimp_Block_Pointer;
--
-- Returns task status.
--
function Get_Status (The : in Wimp_Task_Class'Class)
return Task_Status_Type;
--
-- Returns the poll mask.
--
function Get_Poll_Mask (The : in Wimp_Task_Class'Class)
return Poll_Mask_Type;
--
-- Gets the return time for Wimp_Poll_Idle
--
function Get_WakeUp_Time (The : in Wimp_Task_Class'Class) return Integer;
--
-- Returns list of messages.
--
function Get_Messages (The : in Wimp_Task_Class'Class)
return Messages_List_Pointer;
--
-- Returns message block.
--
function Get_Message_Block (The : in Wimp_Task_Class'Class)
return Messages_Handle_Type;
--
-- Returns error block.
--
function Get_Error (The : in Wimp_Task_Class'Class) return Error.Error_Pointer;
--
-- Returns the path of the toolbox resource file.
--
function Get_Resources_Path (The : in ToolBox_Task_Class) return String;
--
--
--
function Get_Self_Id (The : in ToolBox_Task_Class) return Object_ID;
--
--
--
function Get_Self_Component (The : in ToolBox_Task_Class) return Component_ID;
--
--
--
function Get_Parent_Id (The : in ToolBox_Task_Class) return Object_ID;
--
--
--
function Get_Parent_Component (The : in ToolBox_Task_Class) return Component_ID;
--
--
--
function Get_Ancestor_Id (The : in ToolBox_Task_Class) return Object_ID;
--
--
--
function Get_Ancestor_Component (The : in ToolBox_Task_Class) return Component_ID;
--
-- Returns the spritearea of the toolbox task.
--
function Get_Sprite_Area (The : in ToolBox_Task_Class) return System_Sprite_Pointer;
--
-- Sets the required Wimp version.
--
procedure Set_Wimp_Version (The : in out Wimp_Task_Class'Class;
Nr : in Wimp_Version_Type);
--
-- Sets the task handle.
--
procedure Set_Task_Handle (The : in out Wimp_Task_Class'Class;
Handle : in Task_Handle_Type);
--
-- Sets the task name.
--
procedure Set_Name (The : in out Wimp_Task_Class'Class; Name : in String);
--
-- Sets the task status.
--
procedure Set_Status (The : in out Wimp_Task_Class'Class;
Status : in Task_Status_Type);
--
-- Sets the poll mask.
--
procedure Set_Poll_Mask (The : in out Wimp_Task_Class'Class;
Poll_Mask : in Poll_Mask_Type);
--
-- Changes the poll mask.
--
procedure Change_Mask (The : in out Wimp_Task_Class'Class;
Value : in unsigned;
Set : in Boolean := true);
--
-- Sets the return time for Wimp_Poll_Idle
--
procedure Set_WakeUp_Time (The : in out Wimp_Task_Class'Class;
Time : in Integer);
--
-- Sets the error block.
--
procedure Set_Error (The : in out Wimp_Task_Class'Class;
E : in Error_Pointer);
--
-- Defines the path of the toolbox resource file.
--
procedure Set_Resources_Path(The : in out ToolBox_Task_Class;
Path: in String);
--
-- Sets the spritearea for the toolbox task.
--
procedure Set_Sprite_Area (The : in out ToolBox_Task_Class;
Area: in System_Sprite_Pointer);
--
-- Writes the contents of the ID block to 'Reporter'.
--
procedure Report_ID_Block (The : in ToolBox_Task_Class);
subtype Message_Pointer is Event_Pointer;
private
--
-- Remove wimp event listener.
--
procedure Remove_WimpListener (The : in out Wimp_Task_Class'Class;
Listener : in Event_Pointer);
--
-- Removes message event listener.
--
procedure Remove_MessageListener (The : in out Wimp_Task_Class'Class;
Listener : in Event_Pointer);
--
-- Add wimp event listener.
--
procedure Add_WimpListener (The : in out Wimp_Task_Class'Class;
Listener : in Event_Pointer);
--
-- Add a toolbox event listener.
--
procedure Add_ToolboxListener (The : in out ToolBox_Task_Class'Class;
Listener : in Event_Pointer);
--
-- Add message event listener.
--
procedure Add_MessageListener (The : in out Wimp_Task_Class'Class;
Listener : in Event_Pointer);
procedure Dispatch (The : in out Wimp_Task_Class'Class;
Reason_Code : in Reason_Event_Code_Type;
Window : in Wimp_Handle_Type;
Icon : in Icon_Handle_Type);
procedure Dispatch (The : in out Wimp_Task_Class'Class;
Reason_Code : in Message_Event_Code_Type);
procedure Dispatch (The : in out ToolBox_Task_Class;
Reason_Code : in ToolBox_Event_Code_Type);
function Find_Handler (The : in ToolBox_Task_Class;
Reason_Code : in ToolBox_Event_Code_Type) return HandlerList.ListPointer;
function Find_Handler (The : in Wimp_Task_Class'Class;
Reason_Code : in Reason_Event_Code_Type)
return HandlerList.ListPointer;
function Find_Handler (The : in Wimp_Task_Class'Class;
Message_Code : in Message_Event_Code_Type)
return HandlerList.ListPointer;
procedure Delete_Handler (The : in Wimp_Task_Class'Class;
Events : in HandlerList.ListPointer);
type Wimp_Task_Class is tagged
record
WakeUpTime : Integer := 0;
Continue : Task_Status_Type := false;
Task_Handle : Task_Handle_Type := 0;
Task_Name : Unbounded_String := To_Unbounded_String ("Untitled" & ASCII.NUL);
Wimp_Nr : Wimp_Version_Type := 100;
Wimp_Block : Wimp_Block_Pointer := new Wimp_Block_Type;
Messages : Messages_List_Pointer := new Messages_List_Type;
Mask : Poll_Mask_Type := 2#00000000000000000011100101110011#;
Events : List.ListPointer := new List.List;
Msg_Events : List.ListPointer := new List.List;
Msg_Block : Messages_Handle_Type := new Messages_Control_Block_Type;
Error : Error_Pointer := new Error_Type;
Deleted_Events : HandlerList.ListPointer:= new HandlerList.List(-1,-1,-1);
end record;
Number_of_Toolbox_Events : integer := 0;
Max_Number_of_Toolbox_Events : constant := 63;
type ToolBox_Event_List_Type is
array (0..Max_Number_Of_Toolbox_Events) of integer;
type ToolBox_Event_List_Pointer is access ToolBox_Event_List_Type;
type ToolBox_Task_Class is new WimpTask.Wimp_Task_Class with
record
Res_Path : Unbounded_String;
TB_Wanted_Events : ToolBox_Event_List_Pointer
:= new ToolBox_Event_List_Type;
TB_Block : Toolbox_Id_Block_Pointer
:= new ToolBox_Id_Block_Type;
TB_Event_Handlers : List.ListPointer
:= new List.List;
Sprite_Area : System_Sprite_Pointer;
end record;
end RASCAL.WimpTask;
|
30,233
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64109g.ada
|
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64109g.ada
-- C64109G.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 SLICES OF ARRAYS ARE PASSED CORRECTLY TO SUBPROGRAMS.
-- SPECIFICALLY,
-- (A) CHECK ALL PARAMETER MODES.
-- CPP 8/28/84
-- PWN 05/31/96 Corrected spelling problem.
WITH REPORT; USE REPORT;
PROCEDURE C64109G IS
BEGIN
TEST ("C64109G", "CHECK THAT SLICES OF ARRAYS ARE PASSED " &
"CORRECTLY TO SUBPROGRAMS");
--------------------------------------------
DECLARE -- (A)
SUBTYPE SUBINT IS INTEGER RANGE 1..5;
TYPE ARRAY_TYPE IS ARRAY (SUBINT RANGE <>) OF INTEGER;
ARR : ARRAY_TYPE (1..5) := (1..3 => 7, 4..5 => 9);
BOOL : BOOLEAN;
PROCEDURE P1 (S : ARRAY_TYPE) IS
BEGIN
IF S(IDENT_INT(3)) /= 7 THEN
FAILED ("IN PARAMETER NOT PASSED CORRECTLY - (A)");
END IF;
IF S(4) /= 9 THEN
FAILED ("IN PARAMETER NOT PASSED CORRECTLY - (A)2");
END IF;
END P1;
FUNCTION F1 (S : ARRAY_TYPE) RETURN BOOLEAN IS
BEGIN
IF S(3) /= 7 THEN
FAILED ("IN PARAMETER NOT PASSED CORRECTLY - (A)");
END IF;
IF S(IDENT_INT(4)) /= 9 THEN
FAILED ("IN PARAMETER NOT PASSED CORRECTLY - (A)2");
END IF;
RETURN TRUE;
END F1;
PROCEDURE P2 (S : IN OUT ARRAY_TYPE) IS
BEGIN
IF S(3) /= 7 THEN
FAILED ("IN OUT PARAM NOT PASSED CORRECTLY - (A)");
END IF;
IF S(4) /= 9 THEN
FAILED ("IN OUT PARAM NOT PASSED CORRECTLY - (A)2");
END IF;
FOR I IN 3 .. 4 LOOP
S(I) := 5;
END LOOP;
END P2;
PROCEDURE P3 (S : OUT ARRAY_TYPE) IS
BEGIN
FOR I IN 3 .. 4 LOOP
S(I) := 3;
END LOOP;
END P3;
BEGIN -- (A)
P1 (ARR(3..4));
IF ARR(3) /= 7 THEN
FAILED ("IN PARAM CHANGED BY PROCEDURE - (A)");
END IF;
IF ARR(4) /= 9 THEN
FAILED ("IN PARAM CHANGED BY PROCEDURE - (A)2");
END IF;
BOOL := F1 (ARR(IDENT_INT(3)..IDENT_INT(4)));
IF ARR(3) /= 7 THEN
FAILED ("IN PARAM CHANGED BY FUNCTION - (A)");
END IF;
IF ARR(4) /= 9 THEN
FAILED ("IN PARAM CHANGED BY FUNCTION - (A)2");
END IF;
P2 (ARR(3..4));
FOR I IN 3 .. 4 LOOP
IF ARR(I) /= 5 THEN
FAILED ("IN OUT PARAM RETURNED INCORRECTLY - (A)");
END IF;
END LOOP;
P3 (ARR(IDENT_INT(3)..4));
FOR I IN 3 .. 4 LOOP
IF ARR(I) /= 3 THEN
FAILED ("OUT PARAM RETURNED INCORRECTLY - (A)");
END IF;
END LOOP;
END;
RESULT;
END C64109G;
|
30,234
|
ada
| 24
|
svn2github/matreshka
|
source/league/ucd/matreshka-internals-unicode-ucd-core_01d5.ads
|
<reponame>svn2github/matreshka
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_01D5 is
pragma Preelaborate;
Group_01D5 : aliased constant Core_Second_Stage
:= (16#00# .. 16#03# => -- 01D500 .. 01D503
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#06# => -- 01D506
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#0B# .. 16#0C# => -- 01D50B .. 01D50C
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#15# => -- 01D515
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#1D# => -- 01D51D
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#1E# .. 16#25# => -- 01D51E .. 01D525
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#26# .. 16#27# => -- 01D526 .. 01D527
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Soft_Dotted
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#28# .. 16#37# => -- 01D528 .. 01D537
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#3A# => -- 01D53A
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#3F# => -- 01D53F
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#45# => -- 01D545
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#47# .. 16#49# => -- 01D547 .. 01D549
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#51# => -- 01D551
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#52# .. 16#59# => -- 01D552 .. 01D559
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#5A# .. 16#5B# => -- 01D55A .. 01D55B
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Soft_Dotted
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#5C# .. 16#6B# => -- 01D55C .. 01D56B
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#86# .. 16#8D# => -- 01D586 .. 01D58D
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#8E# .. 16#8F# => -- 01D58E .. 01D58F
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Soft_Dotted
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#90# .. 16#9F# => -- 01D590 .. 01D59F
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#BA# .. 16#C1# => -- 01D5BA .. 01D5C1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#C2# .. 16#C3# => -- 01D5C2 .. 01D5C3
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Soft_Dotted
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#C4# .. 16#D3# => -- 01D5C4 .. 01D5D3
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#EE# .. 16#F5# => -- 01D5EE .. 01D5F5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F6# .. 16#F7# => -- 01D5F6 .. 01D5F7
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Soft_Dotted
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F8# .. 16#FF# => -- 01D5F8 .. 01D5FF
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
others =>
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Math
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_01D5;
|
30,235
|
ada
| 0
|
sciencylab/lagrangian-solver
|
drivers/sb_package.ads
|
with Numerics, Chebyshev, Dense_AD, Dense_AD.Integrator;
use Numerics, Chebyshev;
package Sb_Package is
Convergence_Exception : exception;
-----------------------------------------------
N : constant Nat := 2;
K : constant Nat := 12;
α : Real;
-----------------------------------------------
package E_Solver is new Dense_AD (1);
package AD_Package is new Dense_AD (2 * N);
package Integrator is new AD_Package.Integrator (K);
use AD_Package, Integrator;
function Phi (R : in AD_Type) return AD_Type;
function KE (Q : in AD_Vector) return AD_Type;
function PE (Q : in AD_Vector) return AD_Type;
function Lagrangian (T : in Real;
X : in Vector) return AD_Type;
function Hamiltonian (T : in Real;
X : in Vector) return AD_Type;
function Get_IC (X : in Vector;
E : in Real) return Vector;
function X1 (T : in Real) return Real;
function X1 (X : in Vector) return Real;
function Y1 (T : in Real) return Real;
function R13 (X : in Vector) return Real_Vector;
function R13 (X : in Vector) return Real;
function V13 (X : in Vector) return Real_Vector;
function V13_New (X : in Vector) return Real_Vector;
function New_Vel (X : in Vector) return Vector;
function Sgn (X : in Real) return Real;
function Find_State_At_Level (Level : in Real;
A : in Array_Of_Vectors;
T : in Real;
Dt : in Real;
Lower : in out Real;
Upper : in out Real;
Func : not null access function (X : Vector)
return Real) return Variable;
end Sb_Package;
|
30,236
|
ada
| 1
|
msorvig/qt-quick-bindings
|
example_hello_ada/qtquick.adb
|
<reponame>msorvig/qt-quick-bindings
with Interfaces.C.Strings; use Interfaces.C.Strings;
package body QtQuick is
procedure Qt_Main (MainQmlFile : String) is
begin
Qt_Main_Simple(New_String(MainQmlFile));
end Qt_Main;
end QtQuick;
|
30,237
|
ada
| 1
|
vidkidz/crossbridge
|
llvm-gcc-4.2-2.9/gcc/ada/a-widcha.ads
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ C H A R A C T 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. --
-- --
------------------------------------------------------------------------------
-- Note: strictly this is an Ada 2005 package, but we make it freely
-- available in Ada 95 mode, since it deals only with wide characters.
package Ada.Wide_Characters is
pragma Pure;
end Ada.Wide_Characters;
|
30,238
|
ada
| 192
|
rocher/Ada_Drivers_Library
|
components/src/keyboard/bbq10kbd.ads
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2020, 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. --
-- --
------------------------------------------------------------------------------
-- Driver for the Blackberry Q10 Keyboard I2C interface from solder.party
-- https://github.com/arturo182/bbq10kbd_i2c_sw
with HAL;
with HAL.I2C;
package BBQ10KBD is
type BBQ10KBD_Device (Port : not null HAL.I2C.Any_I2C_Port)
is tagged private;
type Key_State_Kind is (Pressed, Held_Pressed, Released, Error);
type Key_State is record
Kind : Key_State_Kind;
Code : HAL.UInt8;
end record;
function Key_FIFO_Pop (This : in out BBQ10KBD_Device) return Key_State;
-- When the FIFO is empty a Key_State with Kind = Error is returned
type KBD_Status is record
Numlock : Boolean;
Capslock : Boolean;
Key_Count : HAL.UInt5;
end record;
function Status (This : in out BBQ10KBD_Device) return KBD_Status;
procedure Set_Backlight (This : in out BBQ10KBD_Device;
Lvl : HAL.UInt8);
function Version (This : in out BBQ10KBD_Device) return HAL.UInt8;
private
type BBQ10KBD_Device (Port : not null HAL.I2C.Any_I2C_Port)
is tagged null record;
procedure Read (This : in out BBQ10KBD_Device;
Reg : HAL.UInt8;
Data : out HAL.I2C.I2C_Data);
procedure Write (This : in out BBQ10KBD_Device;
Reg : HAL.UInt8;
Data : HAL.I2C.I2C_Data);
Device_Addr : constant HAL.I2C.I2C_Address := 16#1F#;
REG_VER : constant := 16#01#;
REG_CFG : constant := 16#02#;
REG_INT : constant := 16#03#;
REG_KEY : constant := 16#04#;
REG_BKL : constant := 16#05#;
REG_DEB : constant := 16#06#;
REG_FRQ : constant := 16#07#;
REG_RST : constant := 16#08#;
REG_FIF : constant := 16#09#;
end BBQ10KBD;
|
30,239
|
ada
| 0
|
persan/a-cups
|
src/gen/cups-bits_uio_h.ads
|
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with System;
with CUPS.sys_types_h;
with CUPS.stdio_h;
with Interfaces.C_Streams;
private package CUPS.bits_uio_h is
UIO_MAXIOV : constant := 1024; -- bits/uio.h:39
-- Copyright (C) 1996-2016 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- The GNU C Library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, see
-- <http://www.gnu.org/licenses/>.
-- We should normally use the Linux kernel header file to define this
-- type and macros but this calls for trouble because of the header
-- includes other kernel headers.
-- Size of object which can be written atomically.
-- This macro has different values in different kernel versions. The
-- latest versions of the kernel use 1024 and this is good choice. Since
-- the C library implementation of readv/writev is able to emulate the
-- functionality even if the currently running kernel does not support
-- this large value the readv/writev call will not fail because of this.
-- Structure for scatter/gather I/O.
-- Pointer to data.
type iovec is record
iov_base : System.Address; -- bits/uio.h:45
iov_len : aliased size_t; -- bits/uio.h:46
end record;
pragma Convention (C_Pass_By_Copy, iovec); -- bits/uio.h:43
-- Length of data.
-- Read from another process' address space.
function process_vm_readv
(uu_pid : CUPS.sys_types_h.pid_t;
uu_lvec : access constant iovec;
uu_liovcnt : unsigned_long;
uu_rvec : access constant iovec;
uu_riovcnt : unsigned_long;
uu_flags : unsigned_long) return size_t; -- bits/uio.h:59
pragma Import (C, process_vm_readv, "process_vm_readv");
-- Write to another process' address space.
function process_vm_writev
(uu_pid : CUPS.sys_types_h.pid_t;
uu_lvec : access constant iovec;
uu_liovcnt : unsigned_long;
uu_rvec : access constant iovec;
uu_riovcnt : unsigned_long;
uu_flags : unsigned_long) return size_t; -- bits/uio.h:67
pragma Import (C, process_vm_writev, "process_vm_writev");
end CUPS.bits_uio_h;
|
30,240
|
ada
| 0
|
JeremyGrosser/synack_misc
|
src/str.ads
|
<reponame>JeremyGrosser/synack_misc
--
-- Copyright (C) 2021 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
package Str is
pragma Pure;
function Find
(S : String;
C : Character)
return Natural;
function Contains
(Haystack, Needle : String)
return Boolean;
function Find_Number
(S : String)
return Natural;
function To_Natural
(S : String;
Base : Positive := 10)
return Natural;
function Split
(S : String;
Delimiter : Character;
Skip : Natural)
return String;
function Strip
(S : String;
C : Character)
return String;
function Strip_Leading
(S : String;
C : Character)
return String;
function Trim
(S : String;
Chars : String)
return String;
function Starts_With
(S : String;
Prefix : String)
return Boolean;
end Str;
|
30,241
|
ada
| 0
|
notdb/LC-Practice
|
136/ada/main.adb
|
<filename>136/ada/main.adb
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
procedure Nested is
begin
Put_Line ("Hello World");
end Nested;
begin
Nested;
end Main;
|
30,242
|
ada
| 0
|
reznikmm/gela
|
source/resolver/program-complete_contexts.adb
|
-- SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Element_Vectors;
with Program.Elements.Discrete_Simple_Expression_Ranges;
with Program.Elements.Function_Calls;
with Program.Elements.Identifiers;
with Program.Elements.Infix_Operators;
with Program.Elements.Numeric_Literals;
with Program.Elements.Operator_Symbols;
with Program.Elements.Parameter_Associations;
with Program.Elements.Record_Component_Associations;
with Program.Elements.Record_Aggregates;
with Program.Elements.String_Literals;
with Program.Interpretations.Expressions;
with Program.Interpretations.Names;
with Program.Node_Symbols;
with Program.Resolvers.Name_In_Region;
with Program.Safe_Element_Visitors;
with Program.Symbols;
with Program.Type_Matchers;
package body Program.Complete_Contexts is
package Up_Visitors is
type Visitor
(Sets : not null Program.Interpretations.Context_Access)
is new
Program.Safe_Element_Visitors.Safe_Element_Visitor
with record
Result : Program.Interpretations.Interpretation_Set;
end record;
procedure Call_Up
(Self : in out Visitor'Class;
Prefix : not null Program.Elements.Element_Access;
Arg : Program.Element_Vectors.Iterators.Forward_Iterator'Class;
Arity : Positive);
-- Common procedure from Infix_Operator and Function_Call
overriding procedure Discrete_Simple_Expression_Range
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access);
overriding procedure Function_Call
(Self : in out Visitor;
Element : not null Program.Elements.Function_Calls
.Function_Call_Access);
overriding procedure Identifier
(Self : in out Visitor;
Element : not null Program.Elements.Identifiers.Identifier_Access);
overriding procedure Infix_Operator
(Self : in out Visitor;
Element : not null Program.Elements.Infix_Operators
.Infix_Operator_Access);
overriding procedure Numeric_Literal
(Self : in out Visitor;
Element : not null Program.Elements.Numeric_Literals
.Numeric_Literal_Access);
overriding procedure Operator_Symbol
(Self : in out Visitor;
Element : not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access);
overriding procedure Parameter_Association
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Associations
.Parameter_Association_Access);
overriding procedure Record_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Record_Aggregates
.Record_Aggregate_Access);
overriding procedure String_Literal
(Self : in out Visitor;
Element : not null Program.Elements.String_Literals
.String_Literal_Access);
end Up_Visitors;
package body Up_Visitors is
procedure Call_Up
(Self : in out Visitor'Class;
Prefix : not null Program.Elements.Element_Access;
Arg : Program.Element_Vectors.Iterators.Forward_Iterator'Class;
Arity : Positive)
is
use type Program.Interpretations.Names.Cursor;
use all type Program.Visibility.View_Kind;
Name : Program.Interpretations.Interpretation_Set;
Args : Program.Interpretations.Interpretation_Set_Array (1 .. Arity);
Down : Program.Interpretations.Solution_Array (0 .. Arity);
begin
Self.Result := Self.Sets.Create_Interpretation_Set;
Name := Up (Prefix, Self.Sets);
for J in Arg loop
Args (J.Index) := Up (J.Element, Self.Sets);
end loop;
for N in Program.Interpretations.Names.Each (Name) loop
declare
View : constant Program.Visibility.View := +N;
procedure Callback (Down : Interpretations.Solution_Array);
procedure Callback (Down : Interpretations.Solution_Array) is
begin
Self.Result.Add_Expression
(Program.Visibility.Result (View), Down);
end Callback;
begin
if View.Kind = Function_View then
Down (0) :=
(Program.Interpretations.Defining_Name_Solution,
View);
Resolve_Parameters
(Arguments => Args,
Parameters => Program.Visibility.Parameters (View),
Callback => Callback'Access,
Down => Down);
end if;
end;
end loop;
end Call_Up;
overriding procedure Discrete_Simple_Expression_Range
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access)
is
use type Program.Interpretations.Expressions.Cursor;
Left : constant Program.Interpretations.Interpretation_Set :=
Up (Element.Lower_Bound, Self.Sets);
Right : constant Program.Interpretations.Interpretation_Set :=
Up (Element.Upper_Bound, Self.Sets);
begin
Self.Result := Self.Sets.Create_Interpretation_Set;
for N in Program.Interpretations.Expressions.Each (Left) loop
for K in Program.Interpretations.Expressions.Each_Of_Type
(Right, +N)
loop
Self.Result.Add_Expression
(+N, -- FIXME: choose between +N, +K to avoid universal_int
(1 => -N, 2 => -K));
end loop;
end loop;
end Discrete_Simple_Expression_Range;
overriding procedure Function_Call
(Self : in out Visitor;
Element : not null Program.Elements.Function_Calls
.Function_Call_Access) is
begin
Self.Call_Up
(Prefix => Element.Prefix.To_Element,
Arg => Element.Parameters.Each_Element,
Arity => Element.Parameters.Length);
null;
end Function_Call;
overriding procedure Identifier
(Self : in out Visitor;
Element : not null Program.Elements.Identifiers.Identifier_Access)
is
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Element);
begin
Self.Result := Self.Sets.Create_Interpretation_Set;
Self.Result.Add_Symbol (Symbol);
end Identifier;
overriding procedure Infix_Operator
(Self : in out Visitor;
Element : not null Program.Elements.Infix_Operators
.Infix_Operator_Access)
is
Arity : constant Positive := 1 + Boolean'Pos (Element.Left.Assigned);
begin
if Arity = 1 then
Self.Call_Up
(Prefix => Element.Operator.To_Element,
Arg => Program.Element_Vectors.Single_Element
(Element.Right.To_Element),
Arity => Arity);
else
Self.Call_Up
(Prefix => Element.Operator.To_Element,
Arg => Program.Element_Vectors.Two_Elements
(Element.Left.To_Element,
Element.Right.To_Element),
Arity => Arity);
end if;
end Infix_Operator;
overriding procedure Numeric_Literal
(Self : in out Visitor;
Element : not null Program.Elements.Numeric_Literals
.Numeric_Literal_Access)
is
pragma Unreferenced (Element);
use type Program.Visibility.View_Cursor;
begin
Self.Result := Self.Sets.Create_Interpretation_Set;
for Std in Self.Sets.Env.Immediate_Visible
(Program.Symbols.Standard)
loop
for Str in Program.Visibility.Immediate_Visible
(+Std, Program.Symbols.Integer)
loop
Self.Result.Add_Expression (+Str);
end loop;
end loop;
end Numeric_Literal;
overriding procedure Operator_Symbol
(Self : in out Visitor;
Element : not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access)
is
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Element);
begin
Self.Result := Self.Sets.Create_Interpretation_Set;
Self.Result.Add_Symbol (Symbol);
end Operator_Symbol;
overriding procedure Parameter_Association
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Associations
.Parameter_Association_Access)
is
begin
Self.Visit (Element.Actual_Parameter);
pragma Assert (not Element.Formal_Parameter.Assigned);
end Parameter_Association;
Only_Records : aliased Program.Type_Matchers.Record_Type_Matcher;
overriding procedure Record_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Record_Aggregates
.Record_Aggregate_Access)
is
pragma Unreferenced (Element);
begin
Self.Result := Self.Sets.Create_Interpretation_Set;
Self.Result.Add_Expression_Category (Only_Records'Access);
end Record_Aggregate;
overriding procedure String_Literal
(Self : in out Visitor;
Element : not null Program.Elements.String_Literals
.String_Literal_Access)
is
pragma Unreferenced (Element);
use type Program.Visibility.View_Cursor;
begin
Self.Result := Self.Sets.Create_Interpretation_Set;
for Std in Self.Sets.Env.Immediate_Visible
(Program.Symbols.Standard)
loop
for Str in Program.Visibility.Immediate_Visible
(+Std, Program.Symbols.String)
loop
Self.Result.Add_Expression (+Str);
end loop;
end loop;
end String_Literal;
end Up_Visitors;
package Down_Visitors is
type Visitor
(Sets : not null Program.Interpretations.Context_Access;
Setter : not null Program.Cross_Reference_Updaters
.Cross_Reference_Updater_Access)
is new
Program.Safe_Element_Visitors.Safe_Element_Visitor
with record
Solution : Program.Interpretations.Solution;
end record;
overriding procedure Discrete_Simple_Expression_Range
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access);
overriding procedure Function_Call
(Self : in out Visitor;
Element : not null Program.Elements.Function_Calls
.Function_Call_Access);
overriding procedure Identifier
(Self : in out Visitor;
Element : not null Program.Elements.Identifiers.Identifier_Access);
overriding procedure Infix_Operator
(Self : in out Visitor;
Element : not null Program.Elements.Infix_Operators
.Infix_Operator_Access);
overriding procedure Numeric_Literal
(Self : in out Visitor;
Element : not null Program.Elements.Numeric_Literals
.Numeric_Literal_Access);
overriding procedure Operator_Symbol
(Self : in out Visitor;
Element : not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access);
overriding procedure Parameter_Association
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Associations
.Parameter_Association_Access);
overriding procedure Record_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Record_Aggregates
.Record_Aggregate_Access);
overriding procedure String_Literal
(Self : in out Visitor;
Element : not null Program.Elements.String_Literals
.String_Literal_Access);
end Down_Visitors;
package body Down_Visitors is
procedure Down
(Self : in out Visitor'Class;
Element : not null access Program.Elements.Element'Class;
Solution : Program.Interpretations.Solution);
procedure Down
(Self : in out Visitor'Class;
Element : not null access Program.Elements.Element'Class;
Solution : Program.Interpretations.Solution) is
begin
Down (Element, Solution, Self.Setter, Self.Sets);
end Down;
overriding procedure Discrete_Simple_Expression_Range
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access) is
begin
Self.Down (Element.Lower_Bound, Self.Solution.Tuple (1));
Self.Down (Element.Upper_Bound, Self.Solution.Tuple (2));
end Discrete_Simple_Expression_Range;
overriding procedure Function_Call
(Self : in out Visitor;
Element : not null Program.Elements.Function_Calls
.Function_Call_Access)
is
begin
Self.Down (Element.Prefix, Self.Solution.Tuple (0));
for J in Element.Parameters.Each_Element loop
Self.Down (J.Element, Self.Solution.Tuple (J.Index));
end loop;
end Function_Call;
----------------
-- Identifier --
----------------
overriding procedure Identifier
(Self : in out Visitor;
Element : not null Program.Elements.Identifiers.Identifier_Access) is
begin
case Self.Solution.Kind is
when Program.Interpretations.Defining_Name_Solution =>
Self.Setter.Set_Corresponding_Defining_Name
(Element.To_Element,
Program.Visibility.Name (Self.Solution.Name_View));
when others =>
raise Program_Error;
end case;
end Identifier;
overriding procedure Infix_Operator
(Self : in out Visitor;
Element : not null Program.Elements.Infix_Operators
.Infix_Operator_Access) is
begin
Self.Down (Element.Operator, Self.Solution.Tuple (0));
Self.Down (Element.Left, Self.Solution.Tuple (1));
Self.Down (Element.Right, Self.Solution.Tuple (2));
end Infix_Operator;
overriding procedure Numeric_Literal
(Self : in out Visitor;
Element : not null Program.Elements.Numeric_Literals
.Numeric_Literal_Access) is
begin
null;
end Numeric_Literal;
overriding procedure Operator_Symbol
(Self : in out Visitor;
Element : not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access) is
begin
case Self.Solution.Kind is
when Program.Interpretations.Defining_Name_Solution =>
Self.Setter.Set_Corresponding_Defining_Name
(Element.To_Element,
Program.Visibility.Name (Self.Solution.Name_View));
when others =>
raise Program_Error;
end case;
end Operator_Symbol;
overriding procedure Parameter_Association
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Associations
.Parameter_Association_Access) is
begin
Self.Visit (Element.Actual_Parameter);
end Parameter_Association;
overriding procedure Record_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Record_Aggregates
.Record_Aggregate_Access)
is
View : constant Program.Visibility.View := Self.Solution.Type_View;
begin
for J in Element.Components.Each_Element loop
declare
Compon : Program.Visibility.View;
Assoc : constant Program.Elements.Record_Component_Associations
.Record_Component_Association_Access :=
J.Element.To_Record_Component_Association;
Choices : constant Program.Element_Vectors
.Element_Vector_Access := Assoc.Choices;
begin
pragma Assert (Choices.Length > 0);
for K in Choices.Each_Element loop
Program.Resolvers.Name_In_Region.Resolve_Name
(Region => View,
Name => K.Element.To_Expression,
Setter => Self.Setter);
Compon := Self.Sets.Env.Get_Name_View (K.Element);
Resolve_To_Expected_Type
(Assoc.Component_Value.To_Element,
Self.Sets,
Self.Setter,
Expect => Program.Visibility.Subtype_Mark (Compon));
end loop;
end;
end loop;
end Record_Aggregate;
overriding procedure String_Literal
(Self : in out Visitor;
Element : not null Program.Elements.String_Literals
.String_Literal_Access) is
begin
null;
end String_Literal;
end Down_Visitors;
----------
-- Down --
----------
procedure Down
(Element : not null access Program.Elements.Element'Class;
Solution : Program.Interpretations.Solution;
Setter : not null Program.Cross_Reference_Updaters
.Cross_Reference_Updater_Access;
Sets : not null Program.Interpretations.Context_Access)
is
Down : Down_Visitors.Visitor := (Sets, Setter, False, Solution);
begin
Down.Visit (Element);
end Down;
------------------------
-- Resolve_Parameters --
------------------------
procedure Resolve_Parameters
(Arguments : Program.Interpretations.Interpretation_Set_Array;
Parameters : Program.Visibility.View_Array;
Callback : access procedure
(Down : Program.Interpretations.Solution_Array);
Down : in out Program.Interpretations.Solution_Array;
Index : Positive := 1)
is
use type Program.Interpretations.Expressions.Cursor;
begin
if Arguments'Length /= Parameters'Length then
return;
elsif Index > Down'Last then
Callback (Down);
return;
end if;
for X in Program.Interpretations.Expressions.Each_Of_Type
(Arguments (Index),
Program.Visibility.Type_Of (Parameters (Index)))
loop
Down (Index) := -X;
Resolve_Parameters
(Arguments, Parameters, Callback, Down, Index + 1);
end loop;
end Resolve_Parameters;
-------------------------
-- Resolve_To_Any_Type --
-------------------------
procedure Resolve_To_Any_Type
(Element : not null Program.Elements.Expressions.Expression_Access;
Sets : not null Program.Interpretations.Context_Access;
Setter : not null Program.Cross_Reference_Updaters
.Cross_Reference_Updater_Access;
Result : out Program.Visibility.View)
is
use type Program.Interpretations.Expressions.Cursor;
Set : constant Program.Interpretations.Interpretation_Set :=
Up (Element.To_Element, Sets);
Found : Program.Interpretations.Solution;
Count : Natural := 0;
begin
for N in Program.Interpretations.Expressions.Each (Set) loop
Count := Count + 1;
Found := -N;
Result := +N;
end loop;
if Count > 0 then
Down (Element.To_Element, Found, Setter, Sets);
end if;
end Resolve_To_Any_Type;
------------------------------
-- Resolve_To_Discrete_Type --
------------------------------
procedure Resolve_To_Discrete_Type
(Element : not null Program.Elements.Expressions.Expression_Access;
Sets : not null Program.Interpretations.Context_Access;
Setter : not null Program.Cross_Reference_Updaters
.Cross_Reference_Updater_Access;
Result : out Program.Visibility.View)
is
use type Program.Interpretations.Expressions.Cursor;
Set : constant Program.Interpretations.Interpretation_Set :=
Up (Element, Sets);
Found : Program.Interpretations.Solution;
Count : Natural := 0;
Matcher : Program.Type_Matchers.Discrete_Type_Matcher;
begin
for N in Program.Interpretations.Expressions.Each (Set) loop
if Matcher.Is_Matched (+N) then
Count := Count + 1;
Found := -N;
Result := +N;
end if;
end loop;
if Count > 0 then
Down (Element.To_Element, Found, Setter, Sets);
end if;
end Resolve_To_Discrete_Type;
------------------------------
-- Resolve_To_Expected_Type --
------------------------------
procedure Resolve_To_Expected_Type
(Element : not null Program.Elements.Element_Access;
Sets : not null Program.Interpretations.Context_Access;
Setter : not null Program.Cross_Reference_Updaters
.Cross_Reference_Updater_Access;
Expect : Program.Visibility.View)
is
use type Program.Interpretations.Expressions.Cursor;
Set : constant Program.Interpretations.Interpretation_Set :=
Up (Element, Sets);
Found : Program.Interpretations.Solution;
Count : Natural := 0;
begin
for N in Program.Interpretations.Expressions.Each_Of_Type
(Set, Expect)
loop
Count := Count + 1;
Found := -N;
end loop;
if Count > 0 then
Down (Element.To_Element, Found, Setter, Sets);
end if;
end Resolve_To_Expected_Type;
--------
-- Up --
--------
function Up
(Element : not null access Program.Elements.Element'Class;
Sets : not null Program.Interpretations.Context_Access)
return Program.Interpretations.Interpretation_Set
is
Up : Up_Visitors.Visitor (Sets);
begin
Up.Visit (Element);
return Up.Result;
end Up;
end Program.Complete_Contexts;
|
30,243
|
ada
| 4
|
MOUDDENEHamza/ENSEEIHT
|
1A/S5/PIM/tps/tp5/test_piles.adb
|
with Piles;
-- Programme de test du module Pile.
procedure Test_Piles is
package Pile_Caractere is
new Piles (Capacite => 3, T_Element => Character);
use Pile_Caractere;
-- Initialiser une pile avec 'O' puis 'K' empilés dans la pile vide.
procedure Initialiser_Avec_OK (Pile : out T_Pile) is
begin
Initialiser (Pile);
Empiler (Pile, 'O');
Empiler (Pile, 'K');
end Initialiser_Avec_OK;
procedure Tester_Est_Vide is
Pile1, Pile2 : T_Pile;
begin
Initialiser (Pile1);
pragma Assert (Est_Vide (Pile1));
Empiler (Pile1, 'A');
pragma Assert (not Est_Vide (Pile1));
Initialiser_Avec_OK (Pile2);
pragma Assert (not Est_Vide (Pile2));
end Tester_Est_Vide;
procedure Tester_Empiler is
Pile1 : T_Pile;
begin
Initialiser_Avec_OK (Pile1);
pragma Assert (not Est_Pleine (Pile1));
Empiler (Pile1, 'N');
pragma Assert ('N' = Sommet (Pile1));
pragma Assert (Est_Pleine (Pile1));
end Tester_Empiler;
procedure Tester_Depiler is
Pile1 : T_Pile;
begin
Initialiser_Avec_OK (Pile1);
Depiler (Pile1);
pragma Assert ('O' = Sommet (Pile1));
Depiler (Pile1);
pragma Assert (Est_Vide (Pile1));
end Tester_Depiler;
begin
Tester_Est_Vide;
Tester_Empiler;
Tester_Depiler;
end Test_Piles;
|
30,244
|
ada
| 1
|
bracke/Meaning
|
source/RASCAL-Time.adb
|
--------------------------------------------------------------------------------
-- --
-- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers. --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU Lesser General Public --
-- License as published by the Free Software Foundation; either --
-- version 2.1 of the License, or (at your option) any later version. --
-- --
-- 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 --
-- Lesser General Public License for more details. --
-- --
-- You should have received a copy of the GNU Lesser 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 --
-- --
--------------------------------------------------------------------------------
-- $Author$
-- $Date$
-- $Revision$
with RASCAL.OS;
with RASCAL.Utility; use RASCAL.Utility;
with RASCAL.Memory; use RASCAL.Memory;
with kernel; use Kernel;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Strings; use Ada.Strings;
with Interfaces.C; use Interfaces.C;
with System.Storage_Elements; use System.Storage_Elements;
with Reporter;
package body RASCAL.Time is
Territory_ConvertDateAndTime : constant := 16#4304B#;
Territory_ConvertTimeToUTCOrdinals : constant := 16#43049#;
OS_Word : constant := 16#07#;
--
function Get_Time (Centi : in boolean := false) return string is
Register : aliased Kernel.swi_regs;
Time : array(0..4) of Character;
blk : array(0..8) of Integer;
hours : String(1..2);
mins : String(1..2);
secs : String(1..2);
centisecs : String(1..2);
begin
Time(0) := Character'Val(3);
Register.R(0) := 14;
Register.R(1) := Adr_To_Int(Time(0)'Address);
Kernel.swi(OS_Word, Register'Access, Register'Access);
Register.R(1) := Adr_To_Int(Time(0)'Address);
Register.R(2) := Adr_To_Int(blk(0)'Address);
Kernel.SWI (Territory_ConvertTimeToUTCOrdinals, Register'Access,
Register'Access);
Ada.Strings.Fixed.Move (Source => intstr(blk(3)),
Target => hours,
Justify => Right,
Pad => Character'Val(48));
Ada.Strings.Fixed.Move (Source => intstr(blk(2)),
Target => mins,
Justify => Right,
Pad => Character'Val(48));
Ada.Strings.Fixed.Move (Source => intstr(blk(1)),
Target => secs,
Justify => Right,
Pad => Character'Val(48));
if centi then
Ada.Strings.Fixed.Move (Source => intstr(blk(0)),
Target => centisecs,
Justify => Right,
Pad => Character'Val(48));
return hours&":"&mins&":"&secs&":"¢isecs;
else
return hours&":"&mins&":"&secs;
end if;
end Get_Time;
--
function Get_Date (Format : in string := "%ce%yr-%mn-%dy") return string is
Register : aliased Kernel.swi_regs;
Time : array(0..4) of Character;
Blk : array(0..100) of Character;
Format_0 : string := Format & ASCII.NUL;
Error : OSError_Access;
begin
Time(0) := Character'Val(3);
Register.R(0) := 14;
Register.R(1) := Adr_To_Int(Time(0)'Address);
Kernel.SWI(OS_Word, Register'Access, Register'Access);
Register.R(0) := -1;
Register.R(1) := Adr_To_Int(Time(0)'Address);
Register.R(2) := Adr_To_Int(Blk(0)'Address);
Register.R(3) := 100;
Register.R(4) := Adr_To_Int(Format_0'Address);
Error := Kernel.SWI (Territory_ConvertDateAndTime, Register'Access, Register'Access);
if Error /= null then
pragma Debug(Reporter.Report("Time.Get_Date: " & To_Ada(Error.ErrMess)));
OS.Raise_Error(Error);
end if;
return MemoryToString(int_To_Adr(Register.R(0)),0);
end Get_Date;
--
function Read_MonotonicTime return Integer is
OS_ReadMonotonicTime : constant := 16#042#;
Register : aliased Kernel.swi_regs;
Error : OSError_Access;
begin
Error := Kernel.SWI (OS_ReadMonotonicTime, Register'Access, Register'Access);
if Error /= null then
pragma Debug(Reporter.Report("Time.Get_MonotonicTime: " & To_Ada(Error.ErrMess)));
OS.Raise_Error(Error);
end if;
return Integer(Register.R(0));
end Read_MonotonicTime;
--
end RASCAL.Time;
|
30,245
|
ada
| 7
|
jwhitham/x86determiniser
|
tests/ada/measure_time.ads
|
generic
type Data ( <> ) is private;
with procedure Procedure_To_Be_Measured (D : in Data);
package Measure_Time is
function Time ( D : Data; Iterations : in Natural) return Natural ;
end Measure_Time ;
|
30,246
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/renaming5.ads
|
package Renaming5 is
procedure Proc;
end Renaming5;
|
30,247
|
ada
| 0
|
strenkml/EE368
|
memsim-master/src/memory-flash.ads
|
<gh_stars>0
package Memory.Flash is
type Flash_Type is new Memory_Type with private;
type Flash_Pointer is access all Flash_Type'Class;
function Create_Flash(word_size : Positive := 8;
block_size : Positive := 256;
read_latency : Time_Type := 10;
write_latency : Time_Type := 1000)
return Flash_Pointer;
overriding
function Clone(mem : Flash_Type) return Memory_Pointer;
overriding
procedure Reset(mem : in out Flash_Type;
context : in Natural);
overriding
procedure Read(mem : in out Flash_Type;
address : in Address_Type;
size : in Positive);
overriding
procedure Write(mem : in out Flash_Type;
address : in Address_Type;
size : in Positive);
overriding
function To_String(mem : Flash_Type) return Unbounded_String;
overriding
function Get_Cost(mem : Flash_Type) return Cost_Type;
overriding
function Get_Writes(mem : Flash_Type) return Long_Integer;
overriding
function Get_Word_Size(mem : Flash_Type) return Positive;
overriding
function Get_Ports(mem : Flash_Type) return Port_Vector_Type;
overriding
procedure Generate(mem : in Flash_Type;
sigs : in out Unbounded_String;
code : in out Unbounded_String);
private
type Flash_Type is new Memory_Type with record
word_size : Positive := 8;
block_size : Positive := 256;
read_latency : Time_Type := 10;
write_latency : Time_Type := 1000;
writes : Long_Integer := 0;
end record;
end Memory.Flash;
|
30,248
|
ada
| 1
|
micahwelf/FLTK-Ada
|
src/fltk-widgets-clocks.ads
|
package FLTK.Widgets.Clocks is
type Clock is new Widget with private;
type Clock_Reference (Data : not null access Clock'Class) is limited null record
with Implicit_Dereference => Data;
subtype Hour is Integer range 0 .. 23;
subtype Minute is Integer range 0 .. 59;
subtype Second is Integer range 0 .. 60;
type Time_Value is mod 2 ** 32;
package Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Clock;
end Forge;
function Get_Hour
(This : in Clock)
return Hour;
function Get_Minute
(This : in Clock)
return Minute;
function Get_Second
(This : in Clock)
return Second;
function Get_Time
(This : in Clock)
return Time_Value;
procedure Set_Time
(This : in out Clock;
To : in Time_Value);
procedure Set_Time
(This : in out Clock;
Hours : in Hour;
Minutes : in Minute;
Seconds : in Second);
procedure Draw
(This : in out Clock);
procedure Draw
(This : in out Clock;
X, Y, W, H : in Integer);
function Handle
(This : in out Clock;
Event : in Event_Kind)
return Event_Outcome;
private
type Clock is new Widget with null record;
overriding procedure Finalize
(This : in out Clock);
pragma Inline (Get_Hour);
pragma Inline (Get_Minute);
pragma Inline (Get_Second);
pragma Inline (Get_Time);
pragma Inline (Set_Time);
pragma Inline (Draw);
pragma Inline (Handle);
end FLTK.Widgets.Clocks;
|
30,249
|
ada
| 0
|
ekoeppen/MSP430_Generic_Ada_Drivers
|
msp430x2/msp430g2553/svd/msp430_svd-timer_1_a3.ads
|
<reponame>ekoeppen/MSP430_Generic_Ada_Drivers
-- This spec has been automatically generated from msp430g2553.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
-- Timer1_A3
package MSP430_SVD.TIMER_1_A3 is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- Timer A mode control 1
type TA1CTL_MC_Field is
(-- Timer A mode control: 0 - Stop
Mc_0,
-- Timer A mode control: 1 - Up to CCR0
Mc_1,
-- Timer A mode control: 2 - Continous up
Mc_2,
-- Timer A mode control: 3 - Up/Down
Mc_3)
with Size => 2;
for TA1CTL_MC_Field use
(Mc_0 => 0,
Mc_1 => 1,
Mc_2 => 2,
Mc_3 => 3);
-- Timer A clock input divider 1
type TA1CTL_ID_Field is
(-- Timer A input divider: 0 - /1
Id_0,
-- Timer A input divider: 1 - /2
Id_1,
-- Timer A input divider: 2 - /4
Id_2,
-- Timer A input divider: 3 - /8
Id_3)
with Size => 2;
for TA1CTL_ID_Field use
(Id_0 => 0,
Id_1 => 1,
Id_2 => 2,
Id_3 => 3);
-- Timer A clock source select 1
type TA1CTL_TASSEL_Field is
(-- Timer A clock source select: 0 - TACLK
Tassel_0,
-- Timer A clock source select: 1 - ACLK
Tassel_1,
-- Timer A clock source select: 2 - SMCLK
Tassel_2,
-- Timer A clock source select: 3 - INCLK
Tassel_3)
with Size => 2;
for TA1CTL_TASSEL_Field use
(Tassel_0 => 0,
Tassel_1 => 1,
Tassel_2 => 2,
Tassel_3 => 3);
-- Timer1_A3 Control
type TA1CTL_Register is record
-- Timer A counter interrupt flag
TAIFG : MSP430_SVD.Bit := 16#0#;
-- Timer A counter interrupt enable
TAIE : MSP430_SVD.Bit := 16#0#;
-- Timer A counter clear
TACLR : MSP430_SVD.Bit := 16#0#;
-- unspecified
Reserved_3_3 : MSP430_SVD.Bit := 16#0#;
-- Timer A mode control 1
MC : TA1CTL_MC_Field := MSP430_SVD.TIMER_1_A3.Mc_0;
-- Timer A clock input divider 1
ID : TA1CTL_ID_Field := MSP430_SVD.TIMER_1_A3.Id_0;
-- Timer A clock source select 1
TASSEL : TA1CTL_TASSEL_Field := MSP430_SVD.TIMER_1_A3.Tassel_0;
-- unspecified
Reserved_10_15 : MSP430_SVD.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 16,
Bit_Order => System.Low_Order_First;
for TA1CTL_Register use record
TAIFG at 0 range 0 .. 0;
TAIE at 0 range 1 .. 1;
TACLR at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
MC at 0 range 4 .. 5;
ID at 0 range 6 .. 7;
TASSEL at 0 range 8 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
end record;
-- Output mode 2
type TA1CCTL0_OUTMOD_Field is
(-- PWM output mode: 0 - output only
Outmod_0,
-- PWM output mode: 1 - set
Outmod_1,
-- PWM output mode: 2 - PWM toggle/reset
Outmod_2,
-- PWM output mode: 3 - PWM set/reset
Outmod_3,
-- PWM output mode: 4 - toggle
Outmod_4,
-- PWM output mode: 5 - Reset
Outmod_5,
-- PWM output mode: 6 - PWM toggle/set
Outmod_6,
-- PWM output mode: 7 - PWM reset/set
Outmod_7)
with Size => 3;
for TA1CCTL0_OUTMOD_Field use
(Outmod_0 => 0,
Outmod_1 => 1,
Outmod_2 => 2,
Outmod_3 => 3,
Outmod_4 => 4,
Outmod_5 => 5,
Outmod_6 => 6,
Outmod_7 => 7);
-- Capture input select 1
type TA1CCTL0_CCIS_Field is
(-- Capture input select: 0 - CCIxA
Ccis_0,
-- Capture input select: 1 - CCIxB
Ccis_1,
-- Capture input select: 2 - GND
Ccis_2,
-- Capture input select: 3 - Vcc
Ccis_3)
with Size => 2;
for TA1CCTL0_CCIS_Field use
(Ccis_0 => 0,
Ccis_1 => 1,
Ccis_2 => 2,
Ccis_3 => 3);
-- Capture mode 1
type TA1CCTL0_CM_Field is
(-- Capture mode: 0 - disabled
Cm_0,
-- Capture mode: 1 - pos. edge
Cm_1,
-- Capture mode: 1 - neg. edge
Cm_2,
-- Capture mode: 1 - both edges
Cm_3)
with Size => 2;
for TA1CCTL0_CM_Field use
(Cm_0 => 0,
Cm_1 => 1,
Cm_2 => 2,
Cm_3 => 3);
-- Timer1_A3 Capture/Compare Control 0
type TA1CCTL_Register is record
-- Capture/compare interrupt flag
CCIFG : MSP430_SVD.Bit := 16#0#;
-- Capture/compare overflow flag
COV : MSP430_SVD.Bit := 16#0#;
-- PWM Output signal if output mode 0
OUT_k : MSP430_SVD.Bit := 16#0#;
-- Capture input signal (read)
CCI : MSP430_SVD.Bit := 16#0#;
-- Capture/compare interrupt enable
CCIE : MSP430_SVD.Bit := 16#0#;
-- Output mode 2
OUTMOD : TA1CCTL0_OUTMOD_Field := MSP430_SVD.TIMER_1_A3.Outmod_0;
-- Capture mode: 1 /Compare mode : 0
CAP : MSP430_SVD.Bit := 16#0#;
-- unspecified
Reserved_9_9 : MSP430_SVD.Bit := 16#0#;
-- Latched capture signal (read)
SCCI : MSP430_SVD.Bit := 16#0#;
-- Capture sychronize
SCS : MSP430_SVD.Bit := 16#0#;
-- Capture input select 1
CCIS : TA1CCTL0_CCIS_Field := MSP430_SVD.TIMER_1_A3.Ccis_0;
-- Capture mode 1
CM : TA1CCTL0_CM_Field := MSP430_SVD.TIMER_1_A3.Cm_0;
end record
with Volatile_Full_Access, Object_Size => 16,
Bit_Order => System.Low_Order_First;
for TA1CCTL_Register use record
CCIFG at 0 range 0 .. 0;
COV at 0 range 1 .. 1;
OUT_k at 0 range 2 .. 2;
CCI at 0 range 3 .. 3;
CCIE at 0 range 4 .. 4;
OUTMOD at 0 range 5 .. 7;
CAP at 0 range 8 .. 8;
Reserved_9_9 at 0 range 9 .. 9;
SCCI at 0 range 10 .. 10;
SCS at 0 range 11 .. 11;
CCIS at 0 range 12 .. 13;
CM at 0 range 14 .. 15;
end record;
-----------------
-- Peripherals --
-----------------
-- Timer1_A3
type TIMER_1_A3_Peripheral is record
-- Timer1_A3 Interrupt Vector Word
TA1IV : aliased MSP430_SVD.UInt16;
-- Timer1_A3 Control
TA1CTL : aliased TA1CTL_Register;
-- Timer1_A3 Capture/Compare Control 0
TA1CCTL0 : aliased TA1CCTL_Register;
-- Timer1_A3 Capture/Compare Control 1
TA1CCTL1 : aliased TA1CCTL_Register;
-- Timer1_A3 Capture/Compare Control 2
TA1CCTL2 : aliased TA1CCTL_Register;
-- Timer1_A3 Counter Register
TA1R : aliased MSP430_SVD.UInt16;
-- Timer1_A3 Capture/Compare 0
TA1CCR0 : aliased MSP430_SVD.UInt16;
-- Timer1_A3 Capture/Compare 1
TA1CCR1 : aliased MSP430_SVD.UInt16;
-- Timer1_A3 Capture/Compare 2
TA1CCR2 : aliased MSP430_SVD.UInt16;
end record
with Volatile;
for TIMER_1_A3_Peripheral use record
TA1IV at 16#0# range 0 .. 15;
TA1CTL at 16#62# range 0 .. 15;
TA1CCTL0 at 16#64# range 0 .. 15;
TA1CCTL1 at 16#66# range 0 .. 15;
TA1CCTL2 at 16#68# range 0 .. 15;
TA1R at 16#72# range 0 .. 15;
TA1CCR0 at 16#74# range 0 .. 15;
TA1CCR1 at 16#76# range 0 .. 15;
TA1CCR2 at 16#78# range 0 .. 15;
end record;
-- Timer1_A3
TIMER_1_A3_Periph : aliased TIMER_1_A3_Peripheral
with Import, Address => TIMER_1_A3_Base;
end MSP430_SVD.TIMER_1_A3;
|
30,250
|
ada
| 0
|
djamal2727/Main-Bearing-Analytical-Model
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/fname.ads
|
<reponame>djamal2727/Main-Bearing-Analytical-Model
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- F N A M E --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package, together with its child package Fname.UF define the
-- association between source file names and unit names as defined
-- (see package Uname for definition of format of unit names).
with Namet; use Namet;
package Fname is
-- Note: this package spec does not depend on the Uname spec in the Ada
-- sense, but the comments and description of the semantics do depend on
-- the conventions established by Uname.
---------------------------
-- File Name Conventions --
---------------------------
-- GNAT requires that there be a one to one correspondence between source
-- file names (as used in the Osint package interface) and unit names as
-- defined by the Uname package. This correspondence is defined by the
-- two subprograms defined here in the Fname package.
-- For full rules of file naming, see GNAT User's Guide. Note that the
-- naming rules are affected by the presence of Source_File_Name pragmas
-- that have been previously processed.
-- Note that the file name does *not* include the directory name. The
-- management of directories is provided by Osint, and full file names
-- are used only for error message purposes within GNAT itself.
-----------------
-- Subprograms --
-----------------
function Is_Predefined_File_Name
(Fname : String;
Renamings_Included : Boolean := True) return Boolean;
function Is_Predefined_File_Name
(Fname : File_Name_Type;
Renamings_Included : Boolean := True) return Boolean;
-- These functions determine if the given file name (which must be a simple
-- file name with no directory information) is the source or ALI file name
-- for one of the predefined library units (i.e. part of the Ada, System,
-- or Interface hierarchies). Note that units in the GNAT hierarchy are not
-- considered predefined (see Is_Internal_File_Name below).
--
-- The Renamings_Included parameter indicates whether annex J renamings
-- such as Text_IO are to be considered as predefined. If
-- Renamings_Included is True, then Text_IO will return True, otherwise
-- only children of Ada, Interfaces and System return True.
function Is_Predefined_Renaming_File_Name
(Fname : String) return Boolean;
function Is_Predefined_Renaming_File_Name
(Fname : File_Name_Type) return Boolean;
-- True if Fname is the file name for a predefined renaming (the same file
-- names that are included if Renamings_Included => True is passed to
-- Is_Predefined_File_Name).
function Is_Internal_File_Name
(Fname : String;
Renamings_Included : Boolean := True) return Boolean;
function Is_Internal_File_Name
(Fname : File_Name_Type;
Renamings_Included : Boolean := True) return Boolean;
-- Same as Is_Predefined_File_Name, except units in the GNAT hierarchy are
-- included.
function Is_GNAT_File_Name (Fname : String) return Boolean;
function Is_GNAT_File_Name (Fname : File_Name_Type) return Boolean;
-- True for units in the GNAT hierarchy
end Fname;
|
30,251
|
ada
| 0
|
Letractively/ada-asf
|
src/asf-server.ads
|
<gh_stars>0
-----------------------------------------------------------------------
-- asf.server -- ASF Server
-- Copyright (C) 2009, 2010, 2011, 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- 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.Finalization;
with ASF.Requests;
with ASF.Responses;
with ASF.Servlets;
package ASF.Server is
type Container is tagged limited private;
-- Register the application to serve requests
procedure Register_Application (Server : in out Container;
URI : in String;
Context : in ASF.Servlets.Servlet_Registry_Access);
-- Start the applications that have been registered.
procedure Start (Server : in out Container);
-- Receives standard HTTP requests from the public service method and dispatches
-- them to the Do_XXX methods defined in this class. This method is an HTTP-specific
-- version of the Servlet.service(Request, Response) method. There's no need
-- to override this method.
procedure Service (Server : in Container;
Request : in out Requests.Request'Class;
Response : in out Responses.Response'Class);
-- Get the current registry associated with the current request being processed
-- by the current thread. Returns null if there is no current request.
function Current return ASF.Servlets.Servlet_Registry_Access;
-- Give access to the current request and response object to the <b>Process</b>
-- procedure. If there is no current request for the thread, do nothing.
procedure Update_Context (Process : not null access
procedure (Request : in out Requests.Request'Class;
Response : in out Responses.Response'Class));
private
-- Binding to record the ASF applications and bind them to URI prefixes.
-- It is expected that the number of ASF applications is small (1-10 per server).
type Binding is record
Context : ASF.Servlets.Servlet_Registry_Access;
Base_URI : access String;
end record;
type Binding_Array is array (Natural range <>) of Binding;
type Binding_Array_Access is access all Binding_Array;
type Container is new Ada.Finalization.Limited_Controlled with record
Nb_Bindings : Natural := 0;
Applications : Binding_Array_Access := null;
Default : ASF.Servlets.Servlet_Registry;
end record;
type Request_Context is record
Application : ASF.Servlets.Servlet_Registry_Access;
Request : ASF.Requests.Request_Access;
Response : ASF.Responses.Response_Access;
end record;
-- Set the current registry. This is called by <b>Service</b> once the
-- registry is identified from the URI.
procedure Set_Context (Context : in Request_Context);
end ASF.Server;
|
30,252
|
ada
| 1
|
Fabien-Chouteau/sdlada
|
src/sdl-video-textures-makers.ads
|
<reponame>Fabien-Chouteau/sdlada
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, <NAME>
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.Video.Surfaces.Textures
--
-- Functions to create Texture objects.
--------------------------------------------------------------------------------------------------------------------
package SDL.Video.Textures.Makers is
procedure Create
(Tex : in out Texture;
Renderer : in SDL.Video.Renderers.Renderer;
Format : in SDL.Video.Pixel_Formats.Pixel_Format_Names;
Kind : in Kinds;
Size : in SDL.Positive_Sizes);
procedure Create
(Tex : in out Texture;
Renderer : in SDL.Video.Renderers.Renderer;
Surface : in SDL.Video.Surfaces.Surface);
end SDL.Video.Textures.Makers;
|
30,253
|
ada
| 0
|
alexcamposruiz/dds-requestreply
|
src/orig/dds-request_reply-connext_c_requester-generic_requester.ads
|
<reponame>alexcamposruiz/dds-requestreply
with DDS.Treats_Generic;
generic
with package TReq is new DDS.Treats_Generic (<>);
with package TRep is new DDS.Treats_Generic (<>);
package DDS.Request_Reply.Connext_C_Requester.Generic_Requester is
pragma Elaborate_Body;
type TRequester is abstract new RTI_Connext_Requester with null record;
-- #define RTI_CONNEXT_REQUESTER_DECL(TReq, TRep, TRequester) \
-- \
-- typedef struct TRequester { \
-- RTI_Connext_Requester parent; \
-- } TRequester; \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- TRequester* TRequester ## _create( \
-- DDS_DomainParticipant * participant, const char* service_name); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- TRequester* TRequester ## _create_w_params( \
-- const RTI_Connext_RequesterParams* params); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _send_request( \
-- TRequester* self, const TReq* request); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _send_request_w_params( \
-- TRequester* self, const TReq* request, \
-- struct DDS_WriteParams_t* request_info); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _receive_reply( \
-- TRequester* self, TRep* reply, \
-- struct DDS_SampleInfo* sample_info, \
-- const struct DDS_Duration_t* timeout); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _receive_replies( \
-- TRequester* self, struct TRep ## Seq* received_data, \
-- struct DDS_SampleInfoSeq* info_seq, DDS_Long min_reply_count, \
-- DDS_Long max_reply_count, const struct DDS_Duration_t* max_wait); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _take_reply( \
-- TRequester* self, TRep* reply, \
-- struct DDS_SampleInfo* sample_info); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _take_replies( \
-- TRequester* self, struct TRep ## Seq* reply_seq, \
-- struct DDS_SampleInfoSeq* sample_info_seq, DDS_Long max_count); \
-- \
-- NDDSUSERDllExport XMQCDllExport DDS_ReturnCode_t \
-- TRequester ## _take_reply_for_related_request( \
-- TRequester* self, TRep* reply, \
-- struct DDS_SampleInfo* sample_info, \
-- const struct DDS_SampleIdentity_t* related_request_info); \
-- \
-- NDDSUSERDllExport XMQCDllExport DDS_ReturnCode_t \
-- TRequester ## _take_replies_for_related_request( \
-- TRequester* self, struct TRep ## Seq* reply_seq, \
-- struct DDS_SampleInfoSeq* sample_info_seq, DDS_Long max_count, \
-- const struct DDS_SampleIdentity_t* related_request_info); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _read_reply( \
-- TRequester* self, TRep* reply, \
-- struct DDS_SampleInfo* sample_info); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _read_replies( \
-- TRequester* self, struct TRep ## Seq* reply_seq, \
-- struct DDS_SampleInfoSeq* sample_info_seq, DDS_Long max_count); \
-- \
-- NDDSUSERDllExport XMQCDllExport DDS_ReturnCode_t \
-- TRequester ## _read_reply_for_related_request( \
-- TRequester* self, TRep* reply, \
-- struct DDS_SampleInfo* sample_info, \
-- const struct DDS_SampleIdentity_t* related_request_info); \
-- \
-- NDDSUSERDllExport XMQCDllExport DDS_ReturnCode_t \
-- TRequester ## _read_replies_for_related_request( \
-- TRequester* self, struct TRep ## Seq* reply_seq, \
-- struct DDS_SampleInfoSeq* sample_info_seq, DDS_Long max_count, \
-- const struct DDS_SampleIdentity_t* related_request_info); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- TReq ## DataWriter* TRequester ## _get_request_datawriter( \
-- TRequester* self); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- TRep ## DataReader* TRequester ## _get_reply_datareader( \
-- TRequester* self); \
-- \
-- NDDSUSERDllExport XMQCDllExport \
-- DDS_ReturnCode_t TRequester ## _return_loan( \
-- TRequester* self, struct TRep ## Seq *received_data, \
-- struct DDS_SampleInfoSeq *info_seq); \
--
--
end DDS.Request_Reply.Connext_C_Requester.Generic_Requester;
|
30,254
|
ada
| 0
|
Fabien-Chouteau/bb_pico_bsp
|
src/ili9341-hack.ads
|
package ILI9341.Hack is
procedure Prepare_For_DMA (This : in out ILI9341_Device;
X1 : Width;
Y1 : Height;
X2 : Width;
Y2 : Height);
procedure End_DMA (This : in out ILI9341_Device);
end ILI9341.Hack;
|
30,255
|
ada
| 2
|
Spohn/LegendOfZelba
|
intro.ads
|
with ada.text_io;
use ada.text_io;
package intro is
-------------------------------
-- Name: <NAME>
-- <NAME>
-- Game Intro Package Specification
-------------------------------
--read in and display title page
procedure title_page(file:in file_type);
end intro;
|
30,256
|
ada
| 3
|
jwarwick/aoc_2020
|
day06/src/day.ads
|
-- AOC 2020, Day 6
package Day is
function anyone_sum(filename : in String) return Natural;
function everyone_sum(filename : in String) return Natural;
end Day;
|
30,257
|
ada
| 0
|
reznikmm/webidl
|
source/context/webidl-interface_members.ads
|
<reponame>reznikmm/webidl
-- SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Ada.Iterator_Interfaces;
package WebIDL.Interface_Members is
pragma Preelaborate;
type Interface_Member is limited interface;
-- Interfaces, interface mixins, and namespaces are specifications of a set
-- of members (respectively matching InterfaceMembers, MixinMembers, and
-- NamespaceMembers), which are the constants, attributes, operations, and
-- other declarations that appear between the braces of their declarations.
function Assigned (Self : access Interface_Member'Class) return Boolean is
(Self /= null);
type Interface_Member_Access is access all Interface_Member'Class
with Storage_Size => 0;
type Cursor is record
Index : Positive;
Member : Interface_Member_Access;
end record;
function Has_Element (Self : Cursor) return Boolean is
(Self.Member.Assigned);
package Iterators is new Ada.Iterator_Interfaces (Cursor, Has_Element);
type Interface_Member_Iterator_Access is access constant
Iterators.Forward_Iterator'Class
with Storage_Size => 0;
end WebIDL.Interface_Members;
|
30,258
|
ada
| 30
|
jscparker/math_packages
|
disorderly/sorted_array.adb
|
--with Text_io; use Text_io;
package body Sorted_Array is
Empty_Slot : constant Item := Item'Last;
-- make type Item bigger if possible than data *set*.
-- eg Item = Parent_Random_Int; or Random_Int'Base.
-- would prefer Empty_Slot is out of range of actual data.
-- not necessary tho.
type Table is array (Table_Index) of Item;
T : Table := (others => Empty_Slot);
Index_of_Next_Item_to_Read : Table_Index := Table_Index'First;
No_More_Items_Remaining : Boolean := False;
-- Routines for reading the array sequentially (from beginning to end):
--------------------------------------
-- Start_Reading_Array_at_Beginning --
--------------------------------------
procedure Start_Reading_Array_at_Beginning is
begin
Index_of_Next_Item_to_Read := Table_Index'First;
end Start_Reading_Array_at_Beginning;
-------------------------------
-- Set_Index_to_Present_Item --
-------------------------------
-- procedure Set_Index_to_Present_Item leaves index alone if it points
-- a readable item, or else goes to next item if it exists, or to end of array
-- if there are no more items. So if after calling Set_Index_to_Next_Item we
-- find that T(Index_of_Next_Item_to_Read) = Empty_Slot then that means we have
-- read every item in array already: set No_More_Items_Remaining := True.
procedure Set_Index_to_Present_Item is
begin
if T(Index_of_Next_Item_to_Read) /= Empty_Slot then
return;
-- Index is set to proper next Item. Leave it here.
end if;
for i in table_Index loop
if Index_of_Next_Item_to_Read < Table_Index'Last then
Index_of_Next_Item_to_Read := Index_of_Next_Item_to_Read + 1;
else
No_More_Items_Remaining := True;
return; -- Index_of_Next_Item_to_Read = Table_Index'Last, and no Item found
end if;
if T(Index_of_Next_Item_to_Read) /= Empty_Slot then
-- Index is set to proper next Item. Leave it here.
return;
end if;
end loop;
end Set_Index_to_Present_Item;
procedure Get_Next_Item
(X : out Item;
Item_is_Invalid : out Boolean)
is
begin
-- init out param:
Item_is_Invalid := False;
Set_Index_to_Present_Item;
-- stay at present index unless empty slot; skip all possible empty slots
if No_More_Items_Remaining then -- go home early.
Item_is_Invalid := True;
X := Empty_Slot;
return;
end if;
X := T(Index_of_Next_Item_to_Read);
-- if we got to Table_Index'Last then Item at Table_Index'Last was valid,
-- but now there may be no Items left:
if Index_of_Next_Item_to_Read = Table_Index'Last then
No_More_Items_Remaining := True; -- the reason we need No_More_Items_Re..
else
-- Set_Index so Next Item is found next time around:
Index_of_Next_Item_to_Read := Index_of_Next_Item_to_Read + 1;
end if;
end Get_Next_Item;
-- Overflow Stacks:
subtype Stack_Index is Table_Index range 0 .. Size_of_Overflow_Stacks - 1;
type Item_Array is array (Stack_Index) of Item;
type Stack is
record
Storage : Item_Array := (others => Empty_Slot);
Next_Free_Slot_id : Stack_Index := Stack_Index'First;
end record;
Collision_Stack : Stack;
type Sorted_Stack is
record
Storage : Item_Array := (others => Empty_Slot);
Next_Free_Slot_id : Stack_Index := Stack_Index'First;
end record;
Low_End_Stack, High_End_Stack : Sorted_Stack;
function No_of_Items_in_Low_Stack return Table_Index is
begin
return Table_Index (Low_End_Stack.Next_Free_Slot_id);
end No_of_Items_in_Low_Stack;
-----------------------------------
-- Initialize_Table_for_Restart --
-----------------------------------
procedure Initialize_Table_for_Restart is
begin
T := (others => Empty_Slot);
Collision_Stack.Storage := (others => Empty_Slot);
Low_End_Stack.Storage := (others => Empty_Slot);
High_End_Stack.Storage := (others => Empty_Slot);
Collision_Stack.Next_Free_Slot_id := Stack_Index'First;
Low_End_Stack.Next_Free_Slot_id := Stack_Index'First;
High_End_Stack.Next_Free_Slot_id := Stack_Index'First;
No_More_Items_Remaining := False;
Index_of_Next_Item_to_Read := Table_Index'First;
end Initialize_Table_for_Restart;
----------
-- Push --
----------
procedure Push
(X : in Item;
Stack_id : in out Stack)
is
pragma Assert (Stack_Index'First = 0);
-- So No of items in stack = Next_Free_Slot_id
S : Item_Array renames Stack_id.Storage;
Next_Free_Slot_id : Stack_Index renames Stack_id.Next_Free_Slot_id;
begin
S (Next_Free_Slot_id) := X;
if Next_Free_Slot_id = Stack_Index'Last then raise Constraint_Error; end if;
Next_Free_Slot_id := Next_Free_Slot_id + 1;
end Push;
-------------------
-- Push_and_Sort --
-------------------
-- only way to update a Sorted_Stack, or sort fails.
procedure Push_and_Sort
(X : in Item;
Stack_id : in out Sorted_Stack)
is
pragma Assert (Stack_Index'First = 0);
X_Item_Size : constant Item := X;
tmp : Item;
S : Item_Array renames Stack_id.Storage;
Next_Free_Slot_id : Stack_Index renames Stack_id.Next_Free_Slot_id;
begin
S (Next_Free_Slot_id) := X;
bubble_sort:
for i in reverse Stack_Index'First+1 .. Next_Free_Slot_id loop
if X_Item_Size < S (i-1) then -- X is now in S(Next_Free_Slot_id)
tmp := S (i-1);
S (i-1) := S (i);
S (i) := tmp;
elsif X_Item_Size = S (i-1) then
Push (X, Collision_Stack);
exit bubble_sort;
else -- X_Item_Size > S (i-1)
exit bubble_sort;
end if;
end loop bubble_sort;
if Next_Free_Slot_id = Stack_Index'Last then raise Constraint_Error; end if;
Next_Free_Slot_id := Next_Free_Slot_id + 1;
end Push_and_Sort;
---------------------
-- Insert_and_Sort --
---------------------
-- X is both the item to be inserted, and the Item_Size
procedure Insert_and_Sort
(X : in Item)
is
X_Item_Size : constant Item := X;
X_index_0 : constant Table_Index
:= Table_Index (X_Item_Size / Items_per_Table_Entry);
Empty_Slot_id : Table_Index;
Empty_Slot_Detected : Boolean := False;
begin
if X = Empty_Slot then
-- value Empty_Slot signifies empty space in array, so is reserved.
Push_and_Sort (X, High_End_Stack);
return;
end if;
if T (X_index_0) = Empty_Slot then
T (X_index_0) := X;
return;
end if;
if X_Item_Size = T(X_index_0) then
Push (X, Collision_Stack);
return;
elsif X_Item_Size < T (X_index_0) then
if X_index_0 = Table_Index'First then
Push_and_Sort (X, Low_End_Stack);
return;
end if;
Empty_Slot_Detected := False;
Find_Empty_Slot_Lower_Down:
for i in reverse Table_Index range Table_Index'First .. X_index_0-1 loop
if T(i) = Empty_Slot then
Empty_Slot_id := i;
Empty_Slot_Detected := True;
exit Find_Empty_Slot_Lower_Down;
end if;
end loop Find_Empty_Slot_Lower_Down;
if Empty_Slot_Detected = False then
Push_and_Sort (X, Low_End_Stack);
return;
end if;
-- shift the empty slot back to the rt place, and fill it with X:
-- common short cut:
if Empty_Slot_id = X_index_0-1 then -- put X into the table
T(Empty_Slot_id) := X;
return;
end if;
Shift_Slot_Up:
for i in Empty_Slot_id+1 .. X_index_0 loop -- i-1 is the empty slot.
if X_Item_Size > T(i) then
T(i-1) := T(i); -- shift T(i) into the Empty Slot (at i-1)
--T(i) := Empty_Slot;-- will fill this below with X
elsif X_Item_Size = T(i) then
Push (X, Collision_Stack);
T(i-1) := X;
return;
else
T(i-1) := X;
return;
end if;
end loop Shift_Slot_Up;
elsif X_Item_Size > T (X_index_0) then
if X_index_0 = Table_Index'Last then
Push_and_Sort (X, High_End_Stack);
return;
end if;
Empty_Slot_Detected := False;
Find_Empty_Slot_Higher_Up:
for i in Table_Index range X_index_0+1 .. Table_Index'Last loop
if T(i) = Empty_Slot then
Empty_Slot_id := i;
Empty_Slot_Detected := True;
exit Find_Empty_Slot_Higher_Up;
end if;
end loop Find_Empty_Slot_Higher_Up;
if Empty_Slot_Detected = False then
Push_and_Sort (X, High_End_Stack);
return;
end if;
-- shift the empty slot back to the rt place, and fill it with X:
-- common short cut:
if Empty_Slot_id = X_index_0+1 then -- put X into the table
T(Empty_Slot_id) := X;
return;
end if;
Shift_Slot_Down:
for i in reverse X_index_0 .. Empty_Slot_id-1 loop -- i+1 is the empty slot.
if X_Item_Size < T(i) then
T(i+1) := T(i); -- put T(i) into the Empty Slot (at i+1)
--T(i) := Empty_Slot;-- will fill this below with X
elsif X_Item_Size = T(i) then
Push (X, Collision_Stack);
T(i+1) := X;
return;
else
T(i+1) := X;
return;
end if;
end loop Shift_Slot_Down;
end if;
end Insert_and_Sort;
---------------------------
-- Array_Sort_Successful --
---------------------------
function Array_Sort_Successful return Boolean is
Hi, Lo : Item;
Non_Empty_Slot_id : Table_Index;
begin
Find_Non_Empty_Slot_Higher_Up:
for i in Table_Index loop
if T(i) /= Empty_Slot then
Non_Empty_Slot_id := i;
Lo := T(i);
exit Find_Non_Empty_Slot_Higher_Up;
end if;
end loop Find_Non_Empty_Slot_Higher_Up;
for i in Non_Empty_Slot_id+1 .. Table_Index'Last loop
if T(i) = Empty_Slot then
null;
else
Hi := T(i);
if Hi < Lo then
return False;
end if;
Hi := Lo;
end if;
end loop;
return True;
end Array_Sort_Successful;
-------------------------------
-- No_of_Collisions_Detected --
-------------------------------
function No_of_Collisions_Detected return Table_Index is
begin
return Collision_Stack.Next_Free_Slot_id - Stack_Index'First;
-- subtype of Table_Index
end No_of_Collisions_Detected;
end Sorted_Array;
|
30,259
|
ada
| 0
|
pat-rogers/OpenUxAS
|
src/ada/src/route_aggregator_common.adb
|
package body Route_Aggregator_Common is
-------------------
-- Append_To_Msg --
-------------------
procedure Append_To_Msg (Msg : in out Unbounded_String; Tail : String) is
begin
Append (Msg, Tail);
end Append_To_Msg;
end Route_Aggregator_Common;
|
30,260
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/ada/exp_ch12.adb
|
<reponame>best08618/asylo<filename>gcc-gcc-7_3_0-release/gcc/ada/exp_ch12.adb
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ C H 1 2 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1997-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Checks; use Checks;
with Einfo; use Einfo;
with Exp_Util; use Exp_Util;
with Nmake; use Nmake;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Tbuild; use Tbuild;
package body Exp_Ch12 is
------------------------------------
-- Expand_N_Generic_Instantiation --
------------------------------------
-- If elaboration entity is defined and this is not an outer level entity,
-- we need to generate a check for it here.
procedure Expand_N_Generic_Instantiation (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Ent : constant Entity_Id := Entity (Name (N));
begin
if Etype (Name (N)) = Any_Type then
return;
end if;
if Present (Elaboration_Entity (Ent))
and then not Is_Compilation_Unit (Ent)
and then not Elaboration_Checks_Suppressed (Ent)
then
Insert_Action (Instance_Spec (N),
Make_Raise_Program_Error (Loc,
Condition =>
Make_Op_Not (Loc,
Right_Opnd =>
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Elaborated,
Prefix => New_Occurrence_Of (Ent, Loc))),
Reason => PE_Access_Before_Elaboration));
end if;
end Expand_N_Generic_Instantiation;
end Exp_Ch12;
|
30,261
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/vfa1_pkg.ads
|
package VFA1_Pkg is
type Int8_t is mod 2**8;
type Int is new Integer;
pragma Volatile_Full_Access (Int);
Counter1 : Int;
Counter2 : Integer;
pragma Volatile_Full_Access (Counter2);
type Arr is array (1 .. 4) of Int8_t;
for Arr'Alignment use 4;
pragma Volatile_Full_Access (Arr);
Timer1 : Arr;
Timer2 : array (1 .. 4) of Int8_t;
for Timer2'Alignment use 4;
pragma Volatile_Full_Access (Timer2);
type Rec is record
A : Short_Integer;
B : Short_Integer;
end record;
type Rec_VFA is new Rec;
pragma Volatile_Full_Access (Rec_VFA);
Buffer1 : Rec_VFA;
Buffer2 : Rec;
pragma Volatile_Full_Access (Buffer2);
type Code is record
R : Int8_t;
I : Int8_t;
end record;
pragma Volatile_Full_Access (Code);
type CArr is array (1 .. 2) of Code;
pragma Volatile_Full_Access (CArr);
Mixer1 : Carr;
Mixer2 : array (1 .. 2) of Code;
pragma Volatile_Full_Access (Mixer2);
end VFA1_Pkg;
|
30,262
|
ada
| 0
|
DrenfongWong/tkm-rpc
|
specs/ada/common/tkmrpc-response-ike-esa_select-convert.ads
|
with Ada.Unchecked_Conversion;
package Tkmrpc.Response.Ike.Esa_Select.Convert is
function To_Response is new Ada.Unchecked_Conversion (
Source => Esa_Select.Response_Type,
Target => Response.Data_Type);
function From_Response is new Ada.Unchecked_Conversion (
Source => Response.Data_Type,
Target => Esa_Select.Response_Type);
end Tkmrpc.Response.Ike.Esa_Select.Convert;
|
30,263
|
ada
| 2
|
thindil/tashy2
|
tests/tk-menu-test_data-tests.ads
|
<gh_stars>1-10
-- This package has been generated automatically by GNATtest.
-- Do not edit any part of it, see GNATtest documentation for more details.
-- begin read only
with Gnattest_Generated;
package Tk.Menu.Test_Data.Tests is
type Test is new GNATtest_Generated.GNATtest_Standard.Tk.Menu.Test_Data
.Test with
null record;
procedure Test_Activate_e310e8_54120b(Gnattest_T: in out Test);
-- tk-menu.ads:336:4:Activate:Test_Activate_Menu
procedure Test_Activate_43ff2b_827a88(Gnattest_T: in out Test);
-- tk-menu.ads:339:4:Activate:Test_Activate_Menu2
procedure Test_Activate_c786dd_e56058(Gnattest_T: in out Test);
-- tk-menu.ads:344:4:Activate:Test_Activate_Menu3
procedure Test_Add_0c595c_5ef6e5(Gnattest_T: in out Test);
-- tk-menu.ads:366:4:Add:Test_Add_Menu
procedure Test_Delete_a9ab1b_9992c1(Gnattest_T: in out Test);
-- tk-menu.ads:443:4:Delete:Test_Delete_Menu
procedure Test_Delete_6e86ea_8b9fc5(Gnattest_T: in out Test);
-- tk-menu.ads:448:4:Delete:Test_Delete_Menu2
procedure Test_Delete_99fa1b_da6433(Gnattest_T: in out Test);
-- tk-menu.ads:453:4:Delete:Test_Delete_Menu3
procedure Test_Entry_Get_Options_ef78cc_729271(Gnattest_T: in out Test);
-- tk-menu.ads:481:4:Entry_Get_Options:Test_Entry_Get_Options_Menu
procedure Test_Entry_Get_Options_0615ce_9f990e(Gnattest_T: in out Test);
-- tk-menu.ads:486:4:Entry_Get_Options:Test_Entry_Get_Options_Menu2
procedure Test_Entry_Get_Options_d1b552_f00eb7(Gnattest_T: in out Test);
-- tk-menu.ads:491:4:Entry_Get_Options:Test_Entry_Get_Options_Menu3
procedure Test_Entry_Configure_1d51e9_fc4fb1(Gnattest_T: in out Test);
-- tk-menu.ads:517:4:Entry_Configure:Test_Entry_Configure_Menu
procedure Test_Entry_Configure_73d2b1_c3ebe5(Gnattest_T: in out Test);
-- tk-menu.ads:522:4:Entry_Configure:Test_Entry_Configure_Menu2
procedure Test_Entry_Configure_138c3b_1d928b(Gnattest_T: in out Test);
-- tk-menu.ads:527:4:Entry_Configure:Test_Entry_Configure_Menu3
procedure Test_Index_d34072_0f3076(Gnattest_T: in out Test);
-- tk-menu.ads:553:4:Index:Test_Index_Menu
procedure Test_Index_032cb4_ad9207(Gnattest_T: in out Test);
-- tk-menu.ads:558:4:Index:Test_Index_Menu2
procedure Test_Index_e3e5f0_c1d386(Gnattest_T: in out Test);
-- tk-menu.ads:562:4:Index:Test_Index_Menu3
procedure Test_Insert_3b526a_33fb34(Gnattest_T: in out Test);
-- tk-menu.ads:591:4:Insert:Test_Insert_Menu
procedure Test_Insert_fde4b6_24d8d2(Gnattest_T: in out Test);
-- tk-menu.ads:596:4:Insert:Test_Insert_Menu2
procedure Test_Insert_3d057c_d006b1(Gnattest_T: in out Test);
-- tk-menu.ads:601:4:Insert:Test_Insert_Menu3
procedure Test_Invoke_49d5a3_7b2d3d(Gnattest_T: in out Test);
-- tk-menu.ads:627:4:Invoke:Test_Invoke_Menu1
procedure Test_Invoke_7593eb_d8311f(Gnattest_T: in out Test);
-- tk-menu.ads:630:4:Invoke:Test_Invoke_Menu3
procedure Test_Invoke_d16f08_c23171(Gnattest_T: in out Test);
-- tk-menu.ads:635:4:Invoke:Test_Invoke_Menu4
procedure Test_Invoke_0a3e65_d5e898(Gnattest_T: in out Test);
-- tk-menu.ads:661:4:Invoke:Test_Invoke_Menu2
procedure Test_Invoke_781f8e_c01adc(Gnattest_T: in out Test);
-- tk-menu.ads:665:4:Invoke:Test_Invoke_Menu5
procedure Test_Invoke_a338ab_66d08a(Gnattest_T: in out Test);
-- tk-menu.ads:670:4:Invoke:Test_Invoke_Menu6
procedure Test_Post_297225_baf848(Gnattest_T: in out Test);
-- tk-menu.ads:695:4:Post:Test_Post_Menu1
procedure Test_Post_311578_f13317(Gnattest_T: in out Test);
-- tk-menu.ads:723:4:Post:Test_Post_Menu2
procedure Test_Post_Cascade_09822b_aeea07(Gnattest_T: in out Test);
-- tk-menu.ads:745:4:Post_Cascade:Test_PostCascade_Menu
procedure Test_Post_Cascade_cc0d55_c83524(Gnattest_T: in out Test);
-- tk-menu.ads:748:4:Post_Cascade:Test_PostCascade_Menu2
procedure Test_Post_Cascade_38af3a_1e3e67(Gnattest_T: in out Test);
-- tk-menu.ads:753:4:Post_Cascade:Test_PostCascade_Menu3
procedure Test_Get_Item_Type_a8752e_8c54de(Gnattest_T: in out Test);
-- tk-menu.ads:777:4:Get_Item_Type:Test_Get_Item_Type_Menu
procedure Test_Get_Item_Type_2b168c_962e70(Gnattest_T: in out Test);
-- tk-menu.ads:781:4:Get_Item_Type:Test_Get_Item_Type_Menu2
procedure Test_Get_Item_Type_8d689d_527e33(Gnattest_T: in out Test);
-- tk-menu.ads:786:4:Get_Item_Type:Test_Get_Item_Type_Menu3
procedure Test_Unpost_74fd1c_cf7a1c(Gnattest_T: in out Test);
-- tk-menu.ads:808:4:Unpost:Test_Unpost_Menu
procedure Test_X_Position_2f4d2c_e9e27f(Gnattest_T: in out Test);
-- tk-menu.ads:835:4:X_Position:Test_X_Position_Menu
procedure Test_X_Position_789329_f6fff3(Gnattest_T: in out Test);
-- tk-menu.ads:839:4:X_Position:Test_X_Position_Menu2
procedure Test_X_Position_a37ded_0ad35d(Gnattest_T: in out Test);
-- tk-menu.ads:844:4:X_Position:Test_X_Position_Menu3
procedure Test_Y_Position_623b60_3f1329(Gnattest_T: in out Test);
-- tk-menu.ads:872:4:Y_Position:Test_Y_Position_Menu
procedure Test_Y_Position_7e1bbe_2e80d9(Gnattest_T: in out Test);
-- tk-menu.ads:876:4:Y_Position:Test_Y_Position_Menu2
procedure Test_Y_Position_9d49dc_1c0642(Gnattest_T: in out Test);
-- tk-menu.ads:881:4:Y_Position:Test_Y_Position_Menu3
end Tk.Menu.Test_Data.Tests;
-- end read only
|
30,264
|
ada
| 8
|
flyx/OpenCLAda
|
src/interface/cl-samplers.ads
|
--------------------------------------------------------------------------------
-- Copyright (c) 2013, <NAME> <<EMAIL>>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
--------------------------------------------------------------------------------
with CL.Contexts;
package CL.Samplers is
type Sampler is new Runtime_Object with null record;
type Addressing_Mode is (None, Clamp_To_Edge, Clamp, Repeat,
Mirrored_Repeat);
type Filter_Mode is (Nearest, Linear);
package Constructors is
function Create (Context : Contexts.Context'Class;
Normalized_Coords : Boolean;
Addressing : Addressing_Mode;
Filter : Filter_Mode) return Sampler;
end Constructors;
overriding procedure Adjust (Object : in out Sampler);
overriding procedure Finalize (Object : in out Sampler);
function Reference_Count (Source : Sampler) return UInt;
function Context (Source : Sampler) return Contexts.Context;
function Addressing (Source : Sampler) return Addressing_Mode;
function Filter (Source : Sampler) return Filter_Mode;
function Are_Coords_Normalized (Source : Sampler) return Boolean;
private
for Addressing_Mode use (None => 16#1130#,
Clamp_To_Edge => 16#1131#,
Clamp => 16#1132#,
Repeat => 16#1133#,
Mirrored_Repeat => 16#1134#);
for Addressing_Mode'Size use UInt'Size;
for Filter_Mode use (Nearest => 16#1140#,
Linear => 16#1141#);
for Filter_Mode'Size use UInt'Size;
end CL.Samplers;
|
30,265
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43214e.ada
|
<reponame>best08618/asylo<gh_stars>1-10
-- C43214E.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT THE LOWER BOUND FOR THE STRING LITERAL IS DETERMINED BY
-- THE APPLICABLE INDEX CONSTRAINT, WHEN ONE EXISTS.
-- EG 02/10/84
WITH REPORT;
PROCEDURE C43214E IS
USE REPORT;
BEGIN
TEST("C43214E", "INITIALIZATION OF CONSTRAINED ARRAY");
BEGIN
CASE_D : BEGIN
-- COMMENT ("CASE D1 : INITIALIZATION OF CONSTRAINED " &
-- "ARRAY CONSTANT");
CASE_D1 : DECLARE
D1 : CONSTANT STRING(11 .. 13) := "ABC";
BEGIN
IF D1'FIRST /= 11 THEN
FAILED ("CASE 1 : LOWER BOUND INCORRECT");
ELSIF D1'LAST /= 13 THEN
FAILED ("CASE 1 : UPPER BOUND INCORRECT");
ELSIF D1 /= "ABC" THEN
FAILED ("CASE 1 : ARRAY DOES NOT " &
"CONTAIN THE CORRECT VALUES");
END IF;
END CASE_D1;
-- COMMENT ("CASE D2 : INITIALIZATION OF CONSTRAINED " &
-- "ARRAY VARIABLE");
CASE_D2 : DECLARE
D2 : STRING(11 .. 13) := "ABC";
BEGIN
IF D2'FIRST /= 11 THEN
FAILED ("CASE 2 : LOWER BOUND INCORRECT");
ELSIF D2'LAST /= 13 THEN
FAILED ("CASE 2 : UPPER BOUND INCORRECT");
ELSIF D2 /= "ABC" THEN
FAILED ("CASE 2 : INCORRECT VALUES");
END IF;
END CASE_D2;
-- COMMENT ("CASE D3 : INITIALIZATION OF CONSTRAINED " &
-- "ARRAY FORMAL PARAMETER OF A SUBPROGRAM");
CASE_D3 : DECLARE
SUBTYPE STD3 IS STRING(IDENT_INT(5) .. 7);
PROCEDURE PROC1 (A : STD3 := "ABC") IS
BEGIN
IF A'FIRST /= 5 THEN
FAILED ("CASE 3 : LOWER BOUND " &
"INCORRECT");
ELSIF A'LAST /= 7 THEN
FAILED ("CASE 3 : UPPER BOUND " &
"INCORRECT");
ELSIF A /= "ABC" THEN
FAILED ("CASE 3 : INCORRECT VALUES");
END IF;
END PROC1;
BEGIN
PROC1;
END CASE_D3;
-- COMMENT ("CASE D4 : INITIALIZATION OF CONSTRAINED " &
-- "ARRAY FORMAL PARAMETER OF A GENERIC UNIT");
CASE_D4 : DECLARE
SUBTYPE STD4 IS STRING(5 .. 8);
GENERIC
D4 : STD4 := "ABCD";
PROCEDURE PROC1;
PROCEDURE PROC1 IS
BEGIN
IF D4'FIRST /= 5 THEN
FAILED ("CASE 4 : LOWER BOUND " &
"INCORRECT");
ELSIF D4'LAST /= 8 THEN
FAILED ("CASE 4 : UPPER BOUND " &
"INCORRECT");
ELSIF D4 /= "ABCD" THEN
FAILED ("CASE 4 : INCORRECT VALUES");
END IF;
END PROC1;
PROCEDURE PROC2 IS NEW PROC1;
BEGIN
PROC2;
END CASE_D4;
END CASE_D;
END;
RESULT;
END C43214E;
|
30,266
|
ada
| 24
|
svn2github/matreshka
|
source/web/tools/a2js/webapi/dom/webapi-dom-parent_nodes.ads
|
<reponame>svn2github/matreshka<filename>source/web/tools/a2js/webapi/dom/webapi-dom-parent_nodes.ads
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Web API Definition --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014-2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This package provides binding to interface ParentNode.
------------------------------------------------------------------------------
limited with WebAPI.DOM.Elements;
with WebAPI.DOM.HTML_Collections;
with WebAPI.DOM.Node_Lists;
package WebAPI.DOM.Parent_Nodes is
pragma Preelaborate;
type Parent_Node is limited interface;
not overriding function Get_Children
(Self : not null access constant Parent_Node)
return WebAPI.DOM.HTML_Collections.HTML_Collection
is abstract
with Import => True,
Convention => JavaScript_Property_Getter,
Link_Name => "children";
-- Returns the child elements.
--
-- The children attribute must return an HTMLCollection collection rooted
-- at the context object matching only element children.
not overriding function Get_First_Element_Child
(Self : not null access constant Parent_Node)
return WebAPI.DOM.Elements.Element_Access is abstract
with Import => True,
Convention => JavaScript_Property_Getter,
Link_Name => "firstElementChild";
-- Returns the first child that is an element, and null otherwise.
--
-- The firstElementChild attribute must return the first child that is an
-- element, and null otherwise.
not overriding function Get_Last_Element_Child
(Self : not null access constant Parent_Node)
return WebAPI.DOM.Elements.Element_Access is abstract
with Import => True,
Convention => JavaScript_Property_Getter,
Link_Name => "lastElementChild";
-- Returns the last child that is an element, and null otherwise.
--
-- The lastElementChild attribute must return the last child that is an
-- element, and null otherwise.
not overriding function Get_Child_Element_Count
(Self : not null access constant Parent_Node)
return Natural is abstract
with Import => True,
Convention => JavaScript_Property_Getter,
Link_Name => "childElementCount";
-- The childElementCount attribute must return the number of children of
-- the context object that are elements.
not overriding function Query_Selector
(Self : not null access constant Parent_Node;
Selectors : WebAPI.DOM_String)
return WebAPI.DOM.Elements.Element_Access is abstract
with Import => True,
Convention => JavaScript_Method,
Link_Name => "querySelector";
-- Returns the first element that is a descendant of node that matches
-- selectors.
--
-- The querySelector(selectors) method must return the first result of
-- running scope-match a selectors string selectors against the context
-- object, and null if the result is an empty list otherwise.
not overriding function Query_Selector_All
(Self : not null access constant Parent_Node;
Selectors : WebAPI.DOM_String)
return WebAPI.DOM.Node_Lists.Node_List is abstract
with Import => True,
Convention => JavaScript_Method,
Link_Name => "querySelectorAll";
-- Returns all element descendants of node that match selectors.
--
-- The querySelectorAll(selectors) method must return the static result of
-- running scope-match a selectors string selectors against the context
-- object.
end WebAPI.DOM.Parent_Nodes;
|
30,267
|
ada
| 1
|
io7m/coreland-openal-ada
|
UNIT_TESTS/alc_001.adb
|
<reponame>io7m/coreland-openal-ada<gh_stars>1-10
with Ada.Containers;
with Ada.IO_Exceptions;
with Ada.Text_IO;
with OpenAL.Context.Error;
with OpenAL.Context;
with OpenAL.List;
with OpenAL.Types;
with Test;
procedure alc_001 is
package ALC renames OpenAL.Context;
package ALC_Error renames OpenAL.Context.Error;
package List renames OpenAL.List;
Device : ALC.Device_t;
No_Device : ALC.Device_t;
Context : ALC.Context_t;
OK : Boolean;
Caught_Error : Boolean;
Handled_Capture : constant Boolean := True;
Devices : List.String_Vector_t;
TC : Test.Context_t;
use type ALC.Device_t;
use type ALC.Context_t;
use type ALC_Error.Error_t;
procedure Finish is
begin
ALC.Destroy_Context (Context);
ALC.Close_Device (Device);
end Finish;
procedure Init is
begin
Device := ALC.Open_Default_Device;
pragma Assert (Device /= ALC.Invalid_Device);
Context := ALC.Create_Context (Device);
pragma Assert (Context /= ALC.Invalid_Context);
OK := ALC.Make_Context_Current (Context);
pragma Assert (OK);
end Init;
begin
Test.Initialize
(Test_Context => TC,
Program => "alc_001",
Test_DB => "TEST_DB",
Test_Results => "TEST_RESULTS");
Init;
Ada.Text_IO.Put_Line
("DEFAULT_DEVICE_SPEC : " & ALC.Get_Default_Device_Specifier);
Ada.Text_IO.Put_Line
("DEVICE_SPEC : " & ALC.Get_Device_Specifier (Device));
begin
Caught_Error := False;
Ada.Text_IO.Put_Line (ALC.Get_Device_Specifier (No_Device));
exception
when Ada.IO_Exceptions.Device_Error => Caught_Error := True;
end;
Test.Check (TC, 20, Caught_Error, "Caught_Error");
Ada.Text_IO.Put_Line
("EXTENSIONS : " & ALC.Get_Extensions (Device));
begin
Caught_Error := False;
Ada.Text_IO.Put_Line (ALC.Get_Extensions (No_Device));
exception
when Ada.IO_Exceptions.Device_Error => Caught_Error := True;
end;
Test.Check (TC, 21, Caught_Error, "Caught_Error");
Ada.Text_IO.Put_Line
("DEFAULT_CAPTURE_DEVICE_SPECIFIER : " & ALC.Get_Default_Capture_Device_Specifier);
Devices := ALC.Get_Available_Capture_Devices;
if List.String_Vectors.Is_Empty (Devices) = False then
Ada.Text_IO.Put_Line
("DEVICE COUNT: " & Ada.Containers.Count_Type'Image (List.String_Vectors.Length (Devices)));
declare
procedure Process_Element (Device : in String) is
begin
Ada.Text_IO.Put_Line ("CAPTURE_DEVICE: " & Device);
end Process_Element;
begin
for Index in
List.String_Vectors.First_Index (Devices) ..
List.String_Vectors.Last_Index (Devices)
loop
List.String_Vectors.Query_Element (Devices, Index, Process_Element'Access);
end loop;
end;
end if;
Test.Check (TC, 22, Handled_Capture, "Handled_Capture");
Ada.Text_IO.Put_Line
("MAJOR_VERSION : " & Natural'Image (ALC.Get_Major_Version (Device)));
Ada.Text_IO.Put_Line
("MINOR_VERSION : " & Natural'Image (ALC.Get_Minor_Version (Device)));
Ada.Text_IO.Put_Line
("FREQUENCY : " & OpenAL.Types.Frequency_t'Image (ALC.Get_Frequency (Device)));
Ada.Text_IO.Put_Line
("REFRESH_RATE : " & Natural'Image (ALC.Get_Refresh (Device)));
Ada.Text_IO.Put_Line
("MONO_SOURCES : " & Natural'Image (ALC.Get_Mono_Sources (Device)));
Ada.Text_IO.Put_Line
("STEREO_SOURCES : " & Natural'Image (ALC.Get_Stereo_Sources (Device)));
Finish;
end alc_001;
|
30,268
|
ada
| 24
|
svn2github/matreshka
|
source/amf/uml/amf-internals-tables-standard_profile_l3_metamodel.adb
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.Standard_Profile_L3_Metamodel is
------------------------------------------------
-- MM_Standard_Profile_L3_Standard_Profile_L3 --
------------------------------------------------
function MM_Standard_Profile_L3_Standard_Profile_L3 return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MM_Standard_Profile_L3_Standard_Profile_L3;
--------------------------------------------
-- MC_Standard_Profile_L3_Build_Component --
--------------------------------------------
function MC_Standard_Profile_L3_Build_Component return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_Standard_Profile_L3_Build_Component;
--------------------------------------
-- MC_Standard_Profile_L3_Metamodel --
--------------------------------------
function MC_Standard_Profile_L3_Metamodel return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MC_Standard_Profile_L3_Metamodel;
-----------------------------------------
-- MC_Standard_Profile_L3_System_Model --
-----------------------------------------
function MC_Standard_Profile_L3_System_Model return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MC_Standard_Profile_L3_System_Model;
---------------------------------------------------------------------------------------
-- MP_Standard_Profile_L3_Build_Component_Base_Component_A_Extension_Build_Component --
---------------------------------------------------------------------------------------
function MP_Standard_Profile_L3_Build_Component_Base_Component_A_Extension_Build_Component return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MP_Standard_Profile_L3_Build_Component_Base_Component_A_Extension_Build_Component;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L3_Metamodel_Base_Model_A_Extension_Metamodel --
-----------------------------------------------------------------------
function MP_Standard_Profile_L3_Metamodel_Base_Model_A_Extension_Metamodel return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MP_Standard_Profile_L3_Metamodel_Base_Model_A_Extension_Metamodel;
-----------------------------------------------------------------------------
-- MP_Standard_Profile_L3_System_Model_Base_Model_A_Extension_System_Model --
-----------------------------------------------------------------------------
function MP_Standard_Profile_L3_System_Model_Base_Model_A_Extension_System_Model return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MP_Standard_Profile_L3_System_Model_Base_Model_A_Extension_System_Model;
-----------------------------------------------------------------------------
-- MP_Standard_Profile_L3_A_Extension_System_Model_System_Model_Base_Model --
-----------------------------------------------------------------------------
function MP_Standard_Profile_L3_A_Extension_System_Model_System_Model_Base_Model return AMF.Internals.CMOF_Element is
begin
return Base + 14;
end MP_Standard_Profile_L3_A_Extension_System_Model_System_Model_Base_Model;
---------------------------------------------------------------------------------------
-- MP_Standard_Profile_L3_A_Extension_Build_Component_Build_Component_Base_Component --
---------------------------------------------------------------------------------------
function MP_Standard_Profile_L3_A_Extension_Build_Component_Build_Component_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 12;
end MP_Standard_Profile_L3_A_Extension_Build_Component_Build_Component_Base_Component;
-----------------------------------------------------------------------
-- MP_Standard_Profile_L3_A_Extension_Metamodel_Metamodel_Base_Model --
-----------------------------------------------------------------------
function MP_Standard_Profile_L3_A_Extension_Metamodel_Metamodel_Base_Model return AMF.Internals.CMOF_Element is
begin
return Base + 13;
end MP_Standard_Profile_L3_A_Extension_Metamodel_Metamodel_Base_Model;
----------------------------------------------------------------
-- MA_Standard_Profile_L3_A_Extension_System_Model_Base_Model --
----------------------------------------------------------------
function MA_Standard_Profile_L3_A_Extension_System_Model_Base_Model return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MA_Standard_Profile_L3_A_Extension_System_Model_Base_Model;
-----------------------------------------------------------------------
-- MA_Standard_Profile_L3_A_Extension_Build_Component_Base_Component --
-----------------------------------------------------------------------
function MA_Standard_Profile_L3_A_Extension_Build_Component_Base_Component return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MA_Standard_Profile_L3_A_Extension_Build_Component_Base_Component;
-------------------------------------------------------------
-- MA_Standard_Profile_L3_A_Extension_Metamodel_Base_Model --
-------------------------------------------------------------
function MA_Standard_Profile_L3_A_Extension_Metamodel_Base_Model return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MA_Standard_Profile_L3_A_Extension_Metamodel_Base_Model;
----------------------------
-- MB_Standard_Profile_L3 --
----------------------------
function MB_Standard_Profile_L3 return AMF.Internals.AMF_Element is
begin
return Base;
end MB_Standard_Profile_L3;
----------------------------
-- MB_Standard_Profile_L3 --
----------------------------
function ML_Standard_Profile_L3 return AMF.Internals.AMF_Element is
begin
return Base + 15;
end ML_Standard_Profile_L3;
end AMF.Internals.Tables.Standard_Profile_L3_Metamodel;
|
30,269
|
ada
| 1
|
GauBen/Arbre-Genealogique
|
src/registre.ads
|
generic
Modulo : Integer;
type T_Element is private;
-- Un registre est une table de hachage.
package Registre is
type T_Registre is limited private;
Cle_Absente_Exception : exception;
-- Renvoie vrai si le registre est entièrement vide.
function Est_Vide (Registre : T_Registre) return Boolean;
-- Initialiser un registre vide.
procedure Initialiser (Registre : out T_Registre) with
Post => Est_Vide (Registre);
-- Renvoie vrai si la clé est presente dans le registre.
function Existe (Registre : T_Registre; Cle : Integer) return Boolean;
-- Insère ou modifie un élément dans le registre.
procedure Attribuer
(Registre : in out T_Registre; Cle : in Integer; Element : in T_Element);
-- Renvoie un élément du registre.
-- Lance Cle_Absente_Exception si la clé n'est pas trouvee.
function Acceder (Registre : T_Registre; Cle : Integer) return T_Element;
-- Applique une procédure P sur tous les éléments du registre.
generic
with procedure P (Cle : in Integer; Element : in T_Element);
procedure Appliquer_Sur_Tous (Registre : in T_Registre);
-- Supprime un élément du registre.
procedure Supprimer (Registre : in out T_Registre; Cle : in Integer);
-- Supprime tous les éléments du registre.
procedure Detruire (Registre : in out T_Registre) with
Post => Est_Vide (Registre);
private
-- On choisit de representer un registre par un tableau de pointeurs.
-- Une case de ce tableau contient une chaîne de tous les elements dont
-- la valeur de la clé par la fonction de hachage est la même.
type T_Maillon;
type T_Pointeur_Sur_Maillon is access T_Maillon;
type T_Maillon is record
Cle : Integer;
Element : T_Element;
Suivant : T_Pointeur_Sur_Maillon;
end record;
type T_Registre is array (1 .. Modulo) of T_Pointeur_Sur_Maillon;
end Registre;
|
30,270
|
ada
| 33
|
ytomino/drake
|
source/numerics/a-nummt1.ads
|
<gh_stars>10-100
pragma License (Unrestricted); -- BSD 3-Clause
-- translated unit from MT19937
--
-- A C-program for MT19937, with initialization improved 2002/1/26.
-- Coded by <NAME> and <NAME>.
--
-- Before using, initialize the state by using init_genrand(seed)
-- or init_by_array(init_key, key_length).
--
-- Copyright (C) 1997 - 2002, <NAME> and <NAME>,
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions
-- are met:
--
-- 1. Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
--
-- 2. Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- 3. The names of its contributors 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 OWNER
-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
--
-- Any feedback is very welcome.
-- http://www.math.keio.ac.jp/matumoto/emt.html
-- email: <EMAIL>
--
-- Ada version: 2010 yt
with Ada.IO_Exceptions;
with Interfaces;
package Ada.Numerics.MT19937 is
-- Mersenne Twister.
pragma Preelaborate;
subtype Unsigned_32 is Interfaces.Unsigned_32;
type Unsigned_32_Array is array (Natural range <>) of Unsigned_32;
type Generator is limited private;
function Random_32 (Gen : aliased in out Generator) return Unsigned_32;
function Initialize return Generator;
function Initialize (Initiator : Unsigned_32) return Generator;
function Initialize (Initiator : Unsigned_32_Array) return Generator;
procedure Reset (Gen : in out Generator);
procedure Reset (Gen : in out Generator; Initiator : Integer);
type State is private;
function Initialize return State;
function Initialize (Initiator : Unsigned_32) return State;
function Initialize (Initiator : Unsigned_32_Array) return State;
procedure Save (Gen : Generator; To_State : out State);
procedure Reset (Gen : in out Generator; From_State : State);
function Reset (From_State : State) return Generator;
Max_Image_Width : constant := (624 + 1) * (32 / 4 + 1) - 1;
function Image (Of_State : State) return String;
function Value (Coded_State : String) return State;
Default_Initiator : constant := 5489;
subtype Uniformly_Distributed is Long_Long_Float range 0.0 .. 1.0;
function Random_0_To_1 (Gen : aliased in out Generator)
return Uniformly_Distributed;
function Random_0_To_Less_Than_1 (Gen : aliased in out Generator)
return Uniformly_Distributed;
function Random_Greater_Than_0_To_Less_Than_1 (
Gen : aliased in out Generator)
return Uniformly_Distributed;
function Random_53_0_To_Less_Than_1 (Gen : aliased in out Generator)
return Uniformly_Distributed;
Use_Error : exception
renames IO_Exceptions.Use_Error;
-- Note: Initialize propagates Use_Error if it failed.
private
N : constant := 624;
M : constant := 397;
subtype Unsigned_32_Array_N is Unsigned_32_Array (0 .. N - 1);
type State is record
Vector : Unsigned_32_Array_N;
Condition : Unsigned_32;
end record;
type Generator is limited record
State : MT19937.State := Initialize (Default_Initiator);
end record;
-- Max_Image_Width : constant Positive := (N + 1) * Image_Column;
end Ada.Numerics.MT19937;
|
30,271
|
ada
| 0
|
alexcamposruiz/dds-requestreply
|
src/orig/dds-request_reply-replieruntypedimpl.ads
|
package DDS.Request_Reply.Replieruntypedimpl is
pragma Elaborate_Body;
-- function RTI_Connext_ReplierUntypedImpl_Send_Sample
-- (Self : not null access RTI_Connext_ReplierUntypedImpl;
-- Data : System.Address;
-- Related_Request_Info : DDS.SampleIdentity_T;
-- WriteParams : in out DDS.WriteParams_T) return DDS.ReturnCode_T;
-- Retcode : DDS.ReturnCode_T;
--
-- function RTI_Connext_ReplierUntypedImpl_Configure_Params_For_Reply
-- (Self : not null access RTI_Connext_ReplierUntypedImpl;
-- Params : in out WriteParams_T;
-- Related_Request_Info : DDS.SampleIdentity_T) return DDS.ReturnCode_T;
--
-- function RTI_Connext_ReplierUntypedImpl_Create_Reader_Topic
-- (Self : not null access RTI_Connext_EntityUntypedImpl;
-- Params : RTI_Connext_EntityParams;
-- Request_Type_Name : DDS.String) return DDS.Topic.Ref_Access;
--
-- function RTI_Connext_ReplierUntypedImpl_Create_Writer_Topic
-- (Self : not null access RTI_Connext_EntityUntypedImpl;
-- Params : RTI_Connext_EntityParams;
-- Reply_Type_Name : DDS.String) return DDS.Topic.Ref_Access;
end DDS.Request_Reply.Replieruntypedimpl;
|
30,272
|
ada
| 1
|
selroc/Renaissance-Ada
|
src/examples/Rejuvenation_Workshop/src/parentpackage.adb
|
with Ada.Containers;
package body ParentPackage is
end ParentPackage;
|
30,273
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt21_pkg.adb
|
<gh_stars>1-10
package body Opt21_Pkg is
function Get_Object (Object : not null access R) return System.Address is
begin
return Object.Ptr;
end;
function Convert (W : Obj) return System.Address is
begin
if W = null then
return System.Null_Address;
else
return Get_Object (W);
end if;
end;
end Opt21_Pkg;
|
30,274
|
ada
| 1
|
procrastiraptor/euler
|
ada/euler14.adb
|
with Ada.Integer_Text_IO;
with Ada.Unchecked_Deallocation;
procedure Euler14 is
Max_Start: constant Positive := 999_999;
subtype Start_Type is Positive range 1 .. Max_Start;
type Memo is array (Start_Type) of Natural;
type Memo_Ptr is access Memo;
procedure Free is new Ada.Unchecked_Deallocation(Memo, Memo_Ptr);
Collatz: Memo_Ptr := new Memo'(1 => 1, others => 0);
type Intermediate is range 1 .. 2 ** 60;
function Chain_Length(Start: Intermediate) return Positive is
Next: constant Intermediate
:= (if Start mod 2 = 0 then Start / 2 else 3 * Start + 1);
begin
if Start <= Intermediate(Start_Type'Last) then
declare
S: constant Start_Type := Start_Type(Start);
begin
if Collatz(S) = 0 then
Collatz(S) := 1 + Chain_Length(Next);
end if;
return Collatz(S);
end;
else
return 1 + Chain_Length(Next);
end if;
end Chain_Length;
Max, Curr: Natural := 0;
Best: Start_Type;
begin
for I in Start_Type'Range loop
Curr := Chain_Length(Intermediate(I));
if Curr > Max then
Max := Curr;
Best := I;
end if;
end loop;
Ada.Integer_Text_IO.Put(Best);
Free(Collatz);
end Euler14;
|
30,275
|
ada
| 12
|
jquorning/ada-asf
|
src/asf-applications-main-configs.adb
|
<filename>src/asf-applications-main-configs.adb
-----------------------------------------------------------------------
-- applications-main-configs -- Configuration support for ASF Applications
-- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2017, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Log.Loggers;
with Util.Serialize.IO.XML;
with EL.Functions.Namespaces;
with ASF.Navigations;
with ASF.Navigations.Mappers;
with Servlet.Core.Mappers;
with ASF.Servlets.Faces.Mappers;
with ASF.Beans.Mappers;
with ASF.Views.Nodes.Core;
package body ASF.Applications.Main.Configs is
use Util.Log;
-- The logger
Log : constant Loggers.Logger := Loggers.Create ("ASF.Applications.Main.Configs");
function Get_Locale (Value : in Util.Beans.Objects.Object) return Util.Locales.Locale;
function Get_Locale (Value : in Util.Beans.Objects.Object) return Util.Locales.Locale is
Name : constant String := Util.Beans.Objects.To_String (Value);
Locale : constant Util.Locales.Locale := Util.Locales.Get_Locale (Name);
begin
return Locale;
end Get_Locale;
-- ------------------------------
-- Save in the application config object the value associated with the given field.
-- When the <b>TAG_MESSAGE_BUNDLE</b> field is reached, insert the new bundle definition
-- in the application.
-- ------------------------------
procedure Set_Member (N : in out Application_Config;
Field : in Application_Fields;
Value : in Util.Beans.Objects.Object) is
begin
case Field is
when TAG_MESSAGE_VAR =>
N.Name := Value;
when TAG_MESSAGE_BUNDLE =>
declare
Bundle : constant String := Util.Beans.Objects.To_String (Value);
begin
if Util.Beans.Objects.Is_Null (N.Name) then
N.App.Register (Name => Bundle & "Msg",
Bundle => Bundle);
else
N.App.Register (Name => Util.Beans.Objects.To_String (N.Name),
Bundle => Bundle);
end if;
N.Name := Util.Beans.Objects.Null_Object;
end;
when TAG_DEFAULT_LOCALE =>
N.App.Set_Default_Locale (Get_Locale (Value));
when TAG_SUPPORTED_LOCALE =>
N.App.Add_Supported_Locale (Get_Locale (Value));
end case;
end Set_Member;
AMapper : aliased Application_Mapper.Mapper;
-- ------------------------------
-- Setup the XML parser to read the managed bean definitions.
-- By instantiating this package, the <b>Reader</b> gets populated with the XML mappings
-- to read the servlet, managed beans and navigation rules.
-- ------------------------------
package body Reader_Config is
procedure Set_Property_Context (Params : in Util.Properties.Manager'Class);
-- Get the navigation handler for the Navigation_Config instantiation
-- GNAT crashes if the call is made in the instantiation part.
Nav : constant ASF.Navigations.Navigation_Handler_Access := App.Get_Navigation_Handler;
package Bean_Config is
new ASF.Beans.Mappers.Reader_Config (Mapper, App.Factory'Access,
Context.all'Access);
package Navigation_Config is
new ASF.Navigations.Mappers.Reader_Config (Mapper, Nav, Context.all'Access);
package Servlet_Config is
new Servlet.Core.Mappers.Reader_Config (Mapper, App.all'Access,
Context.all'Access);
package Faces_Config is
new ASF.Servlets.Faces.Mappers.Reader_Config (Mapper, App.all'Access,
Context.all'Access);
pragma Warnings (Off, Bean_Config);
pragma Warnings (Off, Navigation_Config);
pragma Warnings (Off, Faces_Config);
Config : aliased Application_Config;
NS_Mapper : aliased EL.Functions.Namespaces.NS_Function_Mapper;
procedure Set_Property_Context (Params : in Util.Properties.Manager'Class) is
begin
Prop_Context.Set_Properties (Params);
end Set_Property_Context;
begin
-- Install the property context that gives access
-- to the application configuration properties
App.Get_Init_Parameters (Set_Property_Context'Access);
Context.Set_Resolver (Prop_Context'Unchecked_Access);
-- Setup the function mapper to resolve uses of functions within EL expressions.
NS_Mapper.Set_Namespace (Prefix => "fn",
URI => ASF.Views.Nodes.Core.FN_URI);
NS_Mapper.Set_Function_Mapper (App.Functions'Unchecked_Access);
Context.Set_Function_Mapper (NS_Mapper'Unchecked_Access);
Mapper.Add_Mapping ("faces-config", AMapper'Access);
Mapper.Add_Mapping ("module", AMapper'Access);
Mapper.Add_Mapping ("web-app", AMapper'Access);
Config.App := App;
Servlet_Config.Config.Override_Context := Override_Context;
Application_Mapper.Set_Context (Mapper, Config'Unchecked_Access);
end Reader_Config;
-- ------------------------------
-- Read the configuration file associated with the application. This includes:
-- <ul>
-- <li>The servlet and filter mappings</li>
-- <li>The managed bean definitions</li>
-- <li>The navigation rules</li>
-- </ul>
-- ------------------------------
procedure Read_Configuration (App : in out Application'Class;
File : in String) is
Reader : Util.Serialize.IO.XML.Parser;
Mapper : Util.Serialize.Mappers.Processing;
Context : aliased EL.Contexts.Default.Default_Context;
-- Setup the <b>Reader</b> to parse and build the configuration for managed beans,
-- navigation rules, servlet rules. Each package instantiation creates a local variable
-- used while parsing the XML file.
package Config is
new Reader_Config (Mapper, App'Unchecked_Access, Context'Unchecked_Access);
pragma Warnings (Off, Config);
begin
Log.Info ("Reading module configuration file {0}", File);
-- Util.Serialize.IO.Dump (Reader, AWA.Modules.Log);
-- Read the configuration file and record managed beans, navigation rules.
Reader.Parse (File, Mapper);
end Read_Configuration;
-- ------------------------------
-- Create the configuration parameter definition instance.
-- ------------------------------
package body Parameter is
PARAM_NAME : aliased constant String := Name;
PARAM_VALUE : aliased constant String := Default;
Param : constant Config_Param := ASF.Applications.P '(Name => PARAM_NAME'Access,
Default => PARAM_VALUE'Access);
-- ------------------------------
-- Returns the configuration parameter.
-- ------------------------------
function P return Config_Param is
begin
return Param;
end P;
end Parameter;
begin
AMapper.Add_Mapping ("application/message-bundle/@var", TAG_MESSAGE_VAR);
AMapper.Add_Mapping ("application/message-bundle", TAG_MESSAGE_BUNDLE);
AMapper.Add_Mapping ("application/locale-config/default-locale", TAG_DEFAULT_LOCALE);
AMapper.Add_Mapping ("application/locale-config/supported-locale", TAG_SUPPORTED_LOCALE);
end ASF.Applications.Main.Configs;
|
30,276
|
ada
| 52
|
onox/orka
|
orka/src/orka/interface/orka-rendering-effects-filters.ads
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2020 onox <<EMAIL>>
--
-- 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.
private with GL.Low_Level.Enums;
private with Orka.Rendering.Buffers;
private with Orka.Rendering.Programs.Uniforms;
private with Orka.Rendering.Framebuffers;
private with Orka.Types;
with GL.Objects.Textures;
with GL.Types;
with Orka.Resources.Locations;
package Orka.Rendering.Effects.Filters is
pragma Preelaborate;
use type GL.Types.Size;
function Gaussian_Kernel (Radius : GL.Types.Size) return GL.Types.Single_Array
with Pre => Radius mod 2 = 0;
type Separable_Filter is tagged limited private;
function Create_Filter
(Location : Resources.Locations.Location_Ptr;
Subject : GL.Objects.Textures.Texture;
Kernel : GL.Types.Single_Array) return Separable_Filter
with Pre => Kernel'Length mod 2 = 0;
-- Create a separable filter
--
-- The kernel must consist of a sequence of offsets, followed by a
-- sequence of weights.
procedure Render (Object : in out Separable_Filter; Passes : Positive := 1);
-- Apply the filter to the texture given to the constructor of the filter
-- in one or more passes
--
-- For better performance, it is recommended to first downsample a
-- texture to half the size (with procedure Resolve_To in the package
-- Orka.Rendering.Framebuffers) before applying the filter to it. However,
-- this can visibly reduce the quality of the image for very small kernels.
-----------------------------------------------------------------------------
type Moving_Average_Filter is tagged limited private;
function Create_Filter
(Location : Resources.Locations.Location_Ptr;
Subject : GL.Objects.Textures.Texture;
Radius : GL.Types.Size) return Moving_Average_Filter;
-- Create a filter that computes the moving average per row in a
-- compute shader for a O(1) time complexity, giving a consistent
-- performance independent of the radius
procedure Render (Object : in out Moving_Average_Filter; Passes : Positive := 2);
-- Apply the filter to the texture given to the constructor of the filter
-- in one or more passes
--
-- Passes is 2 by default to get a Gaussian blur instead of a box blur.
--
-- For better performance, it is recommended to first downsample the
-- texture. Due to the O(1) time complexity, for very large kernel this
-- filter should give better performance than the separable filter with
-- a Gaussian kernel.
private
package LE renames GL.Low_Level.Enums;
type Separable_Filter is tagged limited record
Program_Blur : Rendering.Programs.Program;
Uniform_Horizontal : Rendering.Programs.Uniforms.Uniform (LE.Bool_Type);
Buffer_Weights : Rendering.Buffers.Buffer (Types.Single_Type);
Framebuffer_H : Rendering.Framebuffers.Framebuffer (Default => False);
Framebuffer_V : Rendering.Framebuffers.Framebuffer (Default => False);
Texture_H : GL.Objects.Textures.Texture (LE.Texture_Rectangle);
Texture_V : GL.Objects.Textures.Texture (LE.Texture_Rectangle);
end record;
type Moving_Average_Filter is tagged limited record
Program_Blur : Rendering.Programs.Program;
Uniform_Horizontal : Rendering.Programs.Uniforms.Uniform (LE.Bool_Type);
Texture_H : GL.Objects.Textures.Texture (LE.Texture_Rectangle);
Texture_V : GL.Objects.Textures.Texture (LE.Texture_Rectangle);
Columns, Rows : GL.Types.UInt;
end record;
end Orka.Rendering.Effects.Filters;
|
30,277
|
ada
| 2
|
rocher/TTS-Runtime-Ravenscar
|
extensions/xada-dispatching-tts.ads
|
<gh_stars>1-10
------------------------------------------------------------
--
-- GNAT RUN-TIME EXTENSIONS
--
-- XADA . DISPATCHING . TIME-TRIGGERED SCHEDULING
--
-- @file x-distts.ads / xada-dispatching-tts.ads
--
-- @package XAda.Dispatching.TTS (SPEC)
--
-- @author <NAME> <<EMAIL>>
-- @author <NAME> <<EMAIL>>
--
------------------------------------------------------------
pragma Profile (Ravenscar);
with Ada.Real_Time, System;
private with Ada.Real_Time.Timing_Events;
generic
Number_Of_Work_IDs : Positive;
Number_Of_Sync_IDs : Positive := 1;
TT_Priority : System.Priority := System.Priority'Last;
package XAda.Dispatching.TTS is
-- TT tasks use a Work_Id of this type to identify themselves
-- when they call the scheduler
type TT_Work_Id is new Positive range 1 .. Number_Of_Work_IDs;
-- ET tasks use a Sync_Id of this type to identify themselves
-- when they call the scheduler
type TT_Sync_Id is new Positive range 1 .. Number_Of_Sync_IDs;
-- An abstract time slot in the TT plan.
type Time_Slot is abstract tagged record
Slot_Duration : Ada.Real_Time.Time_Span;
end record;
type Time_Slot_Access is access all Time_Slot'Class;
-- An empty time slot
type Empty_Slot is new Time_Slot with null record;
type Empty_Slot_Access is access all Empty_Slot'Class;
-- A mode change time slot
type Mode_Change_Slot is new Time_Slot with null record;
type Mode_Change_Slot_Access is access all Mode_Change_Slot'Class;
-- A sync slot
type Sync_Slot is new Time_Slot with
record
Sync_Id : TT_Sync_Id;
end record;
type Sync_Slot_Access is access all Sync_Slot'Class;
-- A work slot
type Work_Slot is abstract new Time_Slot with
record
Work_Id : TT_Work_Id;
Is_Continuation : Boolean := False;
Padding : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero;
end record;
type Work_Slot_Access is access all Work_Slot'Class;
-- A regular slot
type Regular_Slot is new Work_Slot with null record;
type Regular_Slot_Access is access all Regular_Slot'Class;
-- An optional work slot
type Optional_Slot is new Work_Slot with null record;
type Optional_Slot_Access is access all Optional_Slot'Class;
-- Types representing/accessing TT plans
type Time_Triggered_Plan is array (Natural range <>) of Time_Slot_Access;
type Time_Triggered_Plan_Access is access all Time_Triggered_Plan;
-- Set new TT plan to start at the end of the next mode change slot
procedure Set_Plan
(TTP : Time_Triggered_Plan_Access);
-- TT works use this procedure to wait for their next assigned slot
-- The When_Was_Released result informs caller of slot starting time
procedure Wait_For_Activation
(Work_Id : TT_Work_Id;
When_Was_Released : out Ada.Real_Time.Time);
-- TT works use this procedure to inform that the critical part
-- of the current slot has been finished. It tranforms the current
-- slot in a continuation slot
procedure Continue_Sliced;
-- TT works use this procedure to inform the TT scheduler that
-- there is no more work to do at TT priority level
procedure Leave_TT_Level;
-- Returns the first time the first slot of the current plan was released.
-- It is equivalent to an Epoch for the current plan.
function Get_First_Plan_Release return Ada.Real_Time.Time;
-- Returns the last time the first slot of the plan was released
function Get_Last_Plan_Release return Ada.Real_Time.Time;
-- ET works use this procedure to wait for their next asigned sync slot
procedure Wait_For_Sync
(Sync_Id : TT_Sync_Id;
When_Was_Released : out Ada.Real_Time.Time);
private
protected Time_Triggered_Scheduler
with Priority => System.Interrupt_Priority'Last is
-- Setting a new TT plan
procedure Set_Plan
(TTP : Time_Triggered_Plan_Access);
-- Prepare work to wait for next activation
procedure Prepare_For_Activation
(Work_Id : TT_Work_Id);
-- Transform current slot in a continuation slot
procedure Continue_Sliced;
-- Inform the scheduler that you have no more work as a TT task
procedure Leave_TT_Level;
-- Returns the first time the first slot of the plan was released
function Get_First_Plan_Release return Ada.Real_Time.Time;
-- Returns the last time the first slot of the plan was released
function Get_Last_Plan_Release return Ada.Real_Time.Time;
-- Prepare work to wait for next synchronization point
procedure Prepare_For_Sync
(Sync_Id : TT_Sync_Id);
private
-- New slot timing event
NS_Event : Ada.Real_Time.Timing_Events.Timing_Event;
-- New slot handler procedure
procedure NS_Handler
(Event : in out Ada.Real_Time.Timing_Events.Timing_Event);
-- This access object is the reason why the scheduler is declared
-- in this private part, given that this is a generic package.
-- It should be a constant, but a PO can't have constant components.
NS_Handler_Access : Ada.Real_Time.Timing_Events.Timing_Event_Handler :=
NS_Handler'Access;
-- Hold timing event
Hold_Event : Ada.Real_Time.Timing_Events.Timing_Event;
-- Padding slot handler procedure
procedure Hold_Handler
(Event : in out Ada.Real_Time.Timing_Events.Timing_Event);
-- This access object is the reason why the scheduler is declared
-- in this private part, given that this is a generic package.
-- It should be a constant, but a PO can't have constant components.
Hold_Handler_Access : Ada.Real_Time.Timing_Events.Timing_Event_Handler :=
Hold_Handler'Access;
-- Procedure to enforce plan change
procedure Change_Plan
(At_Time : Ada.Real_Time.Time);
-- Currently running plan and next plan to switch to, if any
Current_Plan : Time_Triggered_Plan_Access := null;
Next_Plan : Time_Triggered_Plan_Access := null;
-- Index numbers of current and next slots in the plan
Current_Slot_Index : Natural := 0;
Next_Slot_Index : Natural := 0;
-- Start time of next slot
Next_Slot_Release : Ada.Real_Time.Time := Ada.Real_Time.Time_Last;
-- Start time of the current plan
Plan_Start_Pending : Boolean := True;
First_Plan_Release : Ada.Real_Time.Time := Ada.Real_Time.Time_First;
-- Start time of the first slot
First_Slot_Release : Ada.Real_Time.Time := Ada.Real_Time.Time_First;
end Time_Triggered_Scheduler;
end XAda.Dispatching.TTS;
|
30,278
|
ada
| 18
|
kraileth/ravenadm
|
src/file_operations.ads
|
<reponame>kraileth/ravenadm
-- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
package File_Operations is
file_handling : exception;
-- Generic function to scan a text file and convert to a string
function get_file_contents (dossier : String) return String;
-- Generic procedure to convert a string to a new text file
-- exception thrown on failures
procedure dump_contents_to_file
(contents : String;
dossier : String);
-- If relative_filename contains no path separator ("/") do nothing
-- Otherwise test the existence of extraction_directory / subdirectory and if it
-- does not exist, create it.
procedure create_subdirectory
(extraction_directory : String;
subdirectory : String);
-- generic function to return first line of file.
function head_n1 (filename : String) return String;
-- Create a pidfile on major actions and remove it when complete.
procedure create_pidfile (pidfile : String);
procedure destroy_pidfile (pidfile : String);
-- Equivalent to "mkdir -p <path/to/final/directory>
-- May throw exeption
procedure mkdirp_from_filename (filename : String);
-- Adds the contents of "another_file" to the existing contents of basefile.
-- If "basefile" does not exist, just copy it (directory must already exist in that case)
procedure concatenate_file (basefile : String; another_file : String);
-- Creates a zero-length file
procedure create_cookie (fullpath : String);
-- Replace pattern-matching files in target directory from the source directory
procedure replace_directory_contents
(source_directory : String;
target_directory : String;
pattern : String);
-- If runpath does not contain the string "$ORIGIN" then runpath is returned
-- Otherwise, the $ORIGIN text is replaced by the base directory of the filename
-- and the resulting text is returned.
function convert_ORIGIN_in_runpath (filename : String; runpath : String) return String;
private
-- helper for create_pidfile
function Get_PID return Integer;
pragma Import (C, Get_PID, "getpid");
end File_Operations;
|
30,279
|
ada
| 4
|
faelys/gela-asis
|
source/asis/asis-gela-visibility-create.adb
|
------------------------------------------------------------------------------
-- G E L A A S I S --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $:
with Asis.Clauses;
with Asis.Elements;
with Asis.Statements;
with Asis.Declarations;
with Asis.Compilation_Units;
with Asis.Gela.Debug;
with Asis.Gela.Utils;
with Asis.Gela.Classes;
with Asis.Gela.Errors;
with Asis.Gela.Element_Utils;
with Asis.Gela.Visibility.Utils;
with Asis.Gela.Private_Operations;
with XASIS.Types;
with XASIS.Utils;
with Ada.Wide_Text_IO;
package body Asis.Gela.Visibility.Create is
procedure Find_Homograph
(Defining_Name : in Asis.Defining_Name;
Point : in Visibility.Point;
Homograph : out Asis.Defining_Name;
Prev : out Region_Item_Access);
procedure Region_Item
(Defining_Name : in Asis.Defining_Name;
Point : in out Visibility.Point;
Tipe : in Asis.Declaration;
Overridden : out Boolean);
function Is_Public_Unit (Element : in Asis.Declaration) return Boolean;
function Is_Overridden
(First, Second : Asis.Defining_Name)
return Boolean;
procedure Is_Character
(Name : in Asis.Defining_Name;
Is_Wide_Wide : out Boolean;
Is_Wide_Char : out Boolean;
Is_Char : out Boolean);
function Is_Library_Unit_Decl
(Element : Asis.Element) return Boolean;
--------------
-- New_Part --
--------------
procedure New_Part
(Region : in Region_Access;
Kind : in Part_Kinds;
Parent_Item : in Region_Item_Access;
Element : in Asis.Element;
Check_Private : in Boolean;
Result : out Part_Access)
is
use Asis.Elements;
--------------------------------
-- Is_Private_Part_Of_Package --
--------------------------------
function Is_Private_Part_Of_Package return Boolean is
Parent : Asis.Element := Enclosing_Element (Element);
begin
if Kind = A_Private_Part and
Declaration_Kind (Parent) = A_Package_Declaration
then
return True;
else
return False;
end if;
end Is_Private_Part_Of_Package;
Part : Part_Access;
Next : Part_Access := Region.Last_Part;
Prev : Part_Access;
Start : Point;
begin
-- Iterate over region parts
-- Invariant: (Prev = null and Next = Region.Last_Part)
-- or (Prev != null and Prev.Next = Next)
while Next /= null loop
if Next.Kind = Kind then
Result := Next;
return;
end if;
exit when Next.Kind < Kind;
Prev := Next;
Next := Prev.Next;
end loop;
if Region.First_Part.Region = null then
Part := Region.First_Part'Access;
else
Part := new Part_Node;
end if;
Part.Dummy_Item.Part := Part;
Part.Region := Region;
Part.Next := Next;
Part.Kind := Kind;
Part.Parent_Item := Parent_Item;
Part.Last_Item := Part.Dummy_Item'Access;
Part.Element := Element;
if Prev = null then
Region.Last_Part := Part;
else
Prev.Next := Part;
end if;
if Check_Private and then Is_Private_Part_Of_Package
and then not Is_Part_Of_Instance (Element)
then
Start := (Item => Part.Last_Item);
-- if not empty private part:
if Element_Kind (Element) /= A_Defining_Name then
Utils.Set_Place (Element, Start);
-- set place to private part to enable visibility check when
-- we call Type_From_Declaration (List (J), Spec_View);
-- where Spec_View is this Element (first in private part).
end if;
Private_Operations.On_Private_Part
(Enclosing_Element (Element), Start);
end if;
Result := Part;
end New_Part;
------------
-- Region --
------------
procedure Region
(Element : in Asis.Element;
Point : in out Visibility.Point)
is
use Asis.Elements;
function Debug_Image return Wide_String is
Spaces : constant Wide_String (1 .. 20) := (others => ' ');
Depth : Natural := 0;
begin
if Point.Item.Part.Region /= null then
Depth := Point.Item.Part.Region.Depth;
end if;
return Spaces (1 .. 2 * Depth) &
Debug_Image (Element) &
" ==> " &
Debug_Image (Point.Item.Part.Region.First_Part.Element);
end Debug_Image;
pragma Assert (Debug.Run (Element, Debug.Create_Region)
or else Debug.Dump (Debug_Image));
Child : Region_Access := new Region_Node;
Part : Part_Access;
Kind : Part_Kinds;
begin
Child.Next := Point.Item.Part.Region.First_Child;
Child.Depth := Point.Item.Part.Region.Depth + 1;
if Is_Part_Of_Implicit (Element) then
Kind := A_Public_Limited_View_Part;
else
Kind := A_Visible_Part;
end if;
if Is_Nil (Enclosing_Element (Element)) then
Child.Library_Unit := True;
Child.Public_Child := Is_Public_Unit (Element);
else
Child.Library_Unit := False;
Child.Public_Child := True;
end if;
New_Part
(Region => Child,
Kind => Kind,
Parent_Item => Point.Item,
Element => Element,
Check_Private => False,
Result => Part);
Point.Item.Part.Region.First_Child := Child;
Point := (Item => Part.Last_Item);
end Region;
-----------------------
-- Completion_Region --
-----------------------
procedure Completion_Region
(Element : in Asis.Element;
Point : in out Visibility.Point;
Is_Instance : in Boolean;
RR_Clause : in Boolean)
is
use Asis.Declarations;
Name : Asis.Expression;
Decl : Asis.Declaration;
Prev : Visibility.Point;
Next : Part_Access;
Kind : Part_Kinds;
begin
if RR_Clause then
Name := Representation_Clause_Name (Element.all);
Decl := Corresponding_Name_Declaration (Name.all);
elsif Is_Instance then
Decl := Asis.Elements.Enclosing_Element (Element);
elsif Is_Subunit (Element) then
Decl := Corresponding_Body_Stub (Element);
if XASIS.Utils.Is_Completion (Decl) then
Decl := XASIS.Utils.Declaration_For_Completion (Decl);
end if;
else
Decl := XASIS.Utils.Declaration_For_Completion (Element);
end if;
if Asis.Elements.Declaration_Kind (Element) = A_Package_Declaration then
Kind := A_Visible_Part;
else
Kind := A_Body_Part;
end if;
Prev := Utils.Find_Region (Decl);
New_Part
(Region => Prev.Item.Part.Region,
Kind => Kind,
Parent_Item => Point.Item,
Element => Element,
Check_Private => False,
Result => Next);
Point.Item := Next.Last_Item;
end Completion_Region;
----------------------
----------------
-- Check_Part --
----------------
procedure Check_Part
(Item : in Region_Item_Access;
Kind : in Part_Kinds;
Element : in Asis.Element)
is
Part : Part_Access;
Next : Region_Item_Access := Item;
begin
if Item.Part.Kind /= Kind then
New_Part
(Region => Item.Part.Region,
Kind => Kind,
Parent_Item => Item.Part.Parent_Item,
Element => Element,
Result => Part,
Check_Private => True);
Item.Part := Part;
else
Part := Item.Part;
end if;
Item.Next := Part.Last_Item;
Part.Last_Item := Item;
end Check_Part;
--------------------
-- Find_Homograph --
--------------------
procedure Find_Homograph
(Defining_Name : in Asis.Defining_Name;
Point : in Visibility.Point;
Homograph : out Asis.Defining_Name;
Prev : out Region_Item_Access)
is
use Asis.Gela.Utils;
Name : constant Asis.Program_Text :=
XASIS.Utils.Direct_Name (Defining_Name);
Decl : constant Asis.Element :=
Asis.Elements.Enclosing_Element (Defining_Name);
begin
Prev := Utils.Find_Name (Name, Point, No_Parent_Region => True);
if Prev = null or else Prev.Count = 0 or else
Asis.Elements.Declaration_Kind (Decl) in
A_Procedure_Instantiation .. A_Function_Instantiation
then
-- Instantiation hasn't expanded at this moment yet, so we can't
-- check it's profile and find homographs
Homograph := Asis.Nil_Element;
return;
end if;
declare
Item : aliased Visibility.Region_Item (Definition);
Index : Asis.ASIS_Natural := 0;
Unit : constant Asis.Compilation_Unit :=
Asis.Elements.Enclosing_Compilation_Unit (Defining_Name);
List : Asis.Defining_Name_List (1 .. Prev.Count + 1);
begin
Item.Part := Point.Item.Part;
Item.Next := Point.Item.Part.Last_Item;
Item.Defining_Name := Defining_Name;
Item.Count := Prev.Count + 1;
Item.Prev := Prev;
Item.Still_Hidden := False;
Utils.Find_All (Item'Unchecked_Access,
Index, List, Unit,
(Item => Item'Unchecked_Access),
True);
for I in 1 .. Index loop
if not Asis.Elements.Is_Equal (Defining_Name, List (I))
and then Are_Homographs (Defining_Name, List (I), Decl)
then
Homograph := List (I);
return;
end if;
end loop;
Homograph := Asis.Nil_Element;
end;
end Find_Homograph;
------------------
-- Is_Character --
------------------
Char : Classes.Type_Info;
Wide : Classes.Type_Info;
Wide_Wide : Classes.Type_Info;
procedure Is_Character
(Name : in Asis.Defining_Name;
Is_Wide_Wide : out Boolean;
Is_Wide_Char : out Boolean;
Is_Char : out Boolean)
is
use Asis.Elements;
Kind : constant Asis.Defining_Name_Kinds := Defining_Name_Kind (Name);
Decl : Asis.Declaration := Enclosing_Element (Name);
Tipe : Classes.Type_Info;
begin
Is_Wide_Wide := False;
Is_Wide_Char := False;
Is_Char := False;
if Kind /= A_Defining_Character_Literal then
return;
end if;
if Classes.Is_Not_Type (Char) then
Char := Classes.Type_From_Declaration (XASIS.Types.Character,
XASIS.Types.Character);
Wide := Classes.Type_From_Declaration (XASIS.Types.Wide_Character,
XASIS.Types.Wide_Character);
Wide_Wide := Classes.Type_From_Declaration
(XASIS.Types.Wide_Wide_Character, XASIS.Types.Wide_Wide_Character);
end if;
Decl := Enclosing_Element (Enclosing_Element (Decl));
Tipe := Classes.Type_From_Declaration (Decl, Decl);
if Classes.Is_Child_Of (Tipe, Char) then
Is_Wide_Wide := True;
Is_Wide_Char := True;
Is_Char := True;
return;
elsif Classes.Is_Child_Of (Tipe, Wide) then
Is_Wide_Wide := True;
Is_Wide_Char := True;
Is_Char := False;
return;
elsif Classes.Is_Child_Of (Tipe, Wide_Wide) then
Is_Wide_Wide := True;
Is_Wide_Char := False;
Is_Char := False;
return;
end if;
end Is_Character;
--------------------------
-- Is_Library_Unit_Decl --
--------------------------
function Is_Library_Unit_Decl
(Element : Asis.Element) return Boolean
is
use Asis.Elements;
use Asis.Compilation_Units;
Class : Unit_Classes;
Enclosing_Unit : constant Compilation_Unit :=
Enclosing_Compilation_Unit (Element);
begin
if Utils.Is_Top_Declaration (Element) then
Class := Unit_Class (Enclosing_Unit);
return Class = A_Public_Declaration or else
Class = A_Public_Declaration_And_Body or else
Class = A_Private_Declaration;
else
return False;
end if;
end Is_Library_Unit_Decl;
-------------------
-- Is_Overridden --
-------------------
function Is_Overridden
(First : Asis.Defining_Name;
Second : Asis.Defining_Name)
return Boolean
is
-- If First Overridden by Second
use Asis.Elements;
begin
if not Is_Part_Of_Implicit (First) then
-- If redeclaration
return False;
elsif not Is_Part_Of_Implicit (Second) then
return True;
elsif Is_Part_Of_Inherited (Second) then
return True;
elsif Operator_Kind (Second) = A_Not_Equal_Operator then
-- This case not in RM, but when user defines "=" there is
-- an implicit declaration of "/=" and it should override
-- predefined "/=".
return True;
else
return False;
end if;
end Is_Overridden;
--------------------
-- Is_Public_Unit --
--------------------
function Is_Public_Unit (Element : in Asis.Declaration) return Boolean is
use Asis.Compilation_Units;
use type Asis.Unit_Classes;
Unit : constant Asis.Compilation_Unit :=
Asis.Elements.Enclosing_Compilation_Unit (Element);
Class : constant Asis.Unit_Classes := Unit_Class (Unit);
begin
if Class = Asis.A_Private_Declaration then
return False;
end if;
return True;
end Is_Public_Unit;
-----------------
-- Region_Item --
-----------------
procedure Region_Item
(Defining_Name : in Asis.Defining_Name;
Point : in out Visibility.Point;
Tipe : in Asis.Declaration;
Overridden : out Boolean)
is
use Asis.Elements;
use type Asis.List_Index;
Item : Region_Item_Access;
Prev : Region_Item_Access;
Homograph : Asis.Defining_Name;
Is_Wide_Wide : Boolean;
Is_Wide_Char : Boolean;
Is_Char : Boolean;
Library_Unit : Boolean := False;
Part_Kind : Part_Kinds;
Decl : constant Asis.Element :=
Enclosing_Element (Defining_Name);
begin
Overridden := False;
if Asis.Declarations.Is_Subunit (Decl) or Utils.Is_Template (Decl) then
return;
end if;
Find_Homograph (Defining_Name, Point, Homograph, Prev);
if Assigned (Homograph) then
Overridden := not Is_Overridden (Homograph, Defining_Name);
if Overridden then
return;
end if;
Element_Utils.Set_Override (Defining_Name, Homograph);
end if;
Is_Character (Defining_Name, Is_Wide_Wide, Is_Wide_Char, Is_Char);
if Is_Wide_Wide then
if Is_Char then
Item := new Visibility.Region_Item (Visibility.Char);
elsif Is_Wide_Char then
Item := new Visibility.Region_Item (Visibility.Wide_Char);
else
Item := new Visibility.Region_Item (Visibility.Wide_Wide_Char);
end if;
else
Item := new Visibility.Region_Item (Definition);
Item.Still_Hidden := Element_Kind (Decl) /= A_Statement;
Item.Library_Unit := Is_Library_Unit_Decl (Decl);
Item.Prev := Prev;
Library_Unit := Item.Library_Unit;
if Prev /= null then
Item.Count := Prev.Count + 1;
else
Item.Count := 0;
end if;
end if;
Item.Defining_Name := Defining_Name;
Item.Part := Point.Item.Part;
Part_Kind := Point.Item.Part.Kind;
if Library_Unit then
if Is_Part_Of_Implicit (Decl) then
if Is_Public_Unit (Decl) then
Part_Kind := A_Public_Limited_View_Part;
else
Part_Kind := A_Private_Limited_View_Part;
end if;
else
if Is_Public_Unit (Decl) then
Part_Kind := A_Public_Children_Part;
else
Part_Kind := A_Private_Children_Part;
end if;
end if;
elsif not Assigned (Tipe) and then
Part_Kind = A_Visible_Part and then
not Gela.Utils.In_Visible_Part (Decl)
then
Part_Kind := A_Private_Part;
end if;
Check_Part (Item, Part_Kind, Decl);
Point.Item := Item;
Utils.Set_Name_Place (Defining_Name, Point);
end Region_Item;
------------------
-- Region_Items --
------------------
procedure Region_Items
(Element : in Asis.Element;
Point : in out Visibility.Point;
Tipe : in Asis.Declaration;
Overridden : out Boolean)
is
use type Asis.Element_Kinds;
begin
Overridden := False;
case Asis.Elements.Element_Kind (Element) is
when Asis.A_Declaration =>
declare
Names : constant Asis.Defining_Name_List :=
Asis.Declarations.Names (Element);
begin
for I in Names'Range loop
Create.Region_Item (Names (I), Point, Tipe, Overridden);
if Overridden then
return;
end if;
end loop;
end;
when A_Statement =>
declare
Names : constant Asis.Defining_Name_List :=
Asis.Statements.Label_Names (Element);
begin
for I in Names'Range loop
Create.Region_Item (Names (I), Point, Tipe, Overridden);
if Overridden then
return;
end if;
end loop;
end;
when others =>
null;
end case;
end Region_Items;
----------------
-- Use_Clause --
----------------
procedure Use_Clause
(Element : in Asis.Element;
Point : in out Visibility.Point)
is
use Asis.Elements;
Kind : Item_Kinds;
begin
case Clause_Kind (Element) is
when A_Use_Package_Clause =>
Kind := Use_Package;
when A_Use_Type_Clause =>
Kind := Use_Type;
when others =>
return;
end case;
declare
use XASIS.Utils;
use Asis.Gela.Utils;
use Asis.Gela.Errors;
Declaration : Asis.Declaration;
Item : Region_Item_Access;
Name_List : constant Asis.Name_List :=
Clauses.Clause_Names (Element);
Visible : constant Boolean :=
In_Visible_Part (Element) or else
In_Context_Clause (Element);
begin
for I in Name_List'Range loop
Declaration := Selected_Name_Declaration
(Name_List (I), True, True);
Item := new Visibility.Region_Item (Kind);
Item.Part := Point.Item.Part;
Point.Item := Item;
if Kind = Use_Package then
Item.Declaration := Declaration;
else
Item.Tipe := Classes.Type_From_Declaration
(Declaration, Element);
end if;
if not Visible and Item.Part.Kind = A_Visible_Part then
Check_Part (Item, A_Private_Part, Element);
else
Item.Next := Item.Part.Last_Item;
Item.Part.Last_Item := Item;
end if;
if not Assigned (Declaration) then
Report (Name_List (I), Error_Unknown_Name);
end if;
end loop;
end;
end Use_Clause;
end Asis.Gela.Visibility.Create;
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, <NAME>
-- 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 <NAME>, IE nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
|
30,280
|
ada
| 80
|
enfoTek/tomato.linksys.e2000.nvram-mod
|
tools-src/gnu/gcc/gcc/ada/xsnames.adb
|
<gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- GNAT SYSTEM UTILITIES --
-- --
-- X S N A M E S --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This utility is used to make a new version of the Snames package when
-- new names are added to the spec, the existing versions of snames.ads and
-- snames.adb are read, and updated to match the set of names in snames.ads.
-- The updated versions are written to snames.ns and snames.nb (new spec/body)
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Unbounded.Text_IO; use Ada.Strings.Unbounded.Text_IO;
with Ada.Strings.Maps; use Ada.Strings.Maps;
with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Spitbol; use GNAT.Spitbol;
with GNAT.Spitbol.Patterns; use GNAT.Spitbol.Patterns;
procedure XSnames is
InB : File_Type;
InS : File_Type;
OutS : File_Type;
OutB : File_Type;
A, B : VString := Nul;
Line : VString := Nul;
Name : VString := Nul;
Name1 : VString := Nul;
Oldrev : VString := Nul;
Oname : VString := Nul;
Oval : VString := Nul;
Restl : VString := Nul;
Specrev : VString := Nul;
Tdigs : Pattern := Any (Decimal_Digit_Set) &
Any (Decimal_Digit_Set) &
Any (Decimal_Digit_Set);
Get_Srev : Pattern := BreakX ('$') & "$Rev" & "ision: "
& Break (' ') * Specrev;
Get_Orev : Pattern := (BreakX ('$') & "$Rev" & "ision: "
& Break ('.') & '.') * A
& Break (' ') * Oldrev & ' ';
Name_Ref : Pattern := Span (' ') * A & Break (' ') * Name
& Span (' ') * B
& ": constant Name_Id := N + " & Tdigs
& ';' & Rest * Restl;
Get_Name : Pattern := "Name_" & Rest * Name1;
Chk_Low : Pattern := Pos (0) & Any (Lower_Set) & Rest & Pos (1);
Findu : Pattern := Span ('u') * A;
Val : Natural;
Xlate_U_Und : Character_Mapping := To_Mapping ("u", "_");
M : Match_Result;
begin
Open (InB, In_File, "snames.adb");
Open (InS, In_File, "snames.ads");
Create (OutS, Out_File, "snames.ns");
Create (OutB, Out_File, "snames.nb");
Anchored_Mode := True;
Oname := Nul;
Val := 0;
loop
Line := Get_Line (InS);
Put_Line (OutS, Line);
exit when not Match (Line, Get_Srev);
end loop;
loop
Line := Get_Line (InB);
exit when Match (Line, Get_Orev);
Put_Line (OutB, Line);
end loop;
Line := A & (Natural'Value (S (Oldrev)) + 1) & " $";
Line := Rpad (Line, 76) & "--";
Put_Line (OutB, Line);
loop
Line := Get_Line (InB);
exit when Match (Line, " Preset_Names");
Put_Line (OutB, Line);
end loop;
Put_Line (OutB, Line);
LoopN : while not End_Of_File (InS) loop
Line := Get_Line (InS);
if not Match (Line, Name_Ref) then
Put_Line (OutS, Line);
else
Oval := Lpad (V (Val), 3, '0');
if Match (Name, "Last_") then
Oval := Lpad (V (Val - 1), 3, '0');
end if;
Put_Line
(OutS, A & Name & B & ": constant Name_Id := N + "
& Oval & ';' & Restl);
if Match (Name, Get_Name) then
Name := Name1;
Val := Val + 1;
if Match (Name, Findu, M) then
Replace (M, Translate (A, Xlate_U_Und));
Translate (Name, Lower_Case_Map);
elsif not Match (Name, "Op_", "") then
Translate (Name, Lower_Case_Map);
else
Name := 'O' & Translate (Name, Lower_Case_Map);
end if;
if Name = "error" then
Name := V ("<error>");
end if;
if not Match (Name, Chk_Low) then
Put_Line (OutB, " """ & Name & "#"" &");
end if;
end if;
end if;
end loop LoopN;
loop
Line := Get_Line (InB);
exit when Match (Line, " ""#"";");
end loop;
Put_Line (OutB, Line);
while not End_Of_File (InB) loop
Put_Line (OutB, Get_Line (InB));
end loop;
Put_Line (OutB, "-- Updated to match snames.ads revision " & Specrev);
end XSnames;
|
30,281
|
ada
| 3
|
reznikmm/coroutines
|
source/coroutines-timeouts.adb
|
-- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Ada.Containers.Ordered_Sets;
with Ada.Containers.Vectors;
package body Coroutines.Timeouts is
type Timeout_Manager;
type Timeout_Manager_Access is access all Timeout_Manager'Class;
type Timeout_Event is new Event_Object with record
Time : Ada.Calendar.Time;
Context : Coroutines.Context;
Manager : Timeout_Manager_Access;
Ready : Boolean := False;
end record;
overriding procedure Activate (Self : in out Timeout_Event);
overriding function Ready (Self : Timeout_Event) return Boolean;
overriding procedure Deactivate (Self : in out Timeout_Event);
type Timeout_Event_Access is access all Timeout_Event;
use type Ada.Calendar.Time;
function Equal (Left, Right : Timeout_Event_Access) return Boolean is
(Left.Context = Right.Context and then Left.Time = Right.Time);
function Less (Left, Right : Timeout_Event_Access) return Boolean;
package Event_Sets is new Ada.Containers.Ordered_Sets
(Element_Type => Timeout_Event_Access,
"<" => Less,
"=" => Equal);
package Event_Vectors is new Ada.Containers.Vectors
(Index_Type => Positive,
Element_Type => Timeout_Event_Access);
type Timeout_Manager is new Coroutine_Manager with record
Active : Event_Sets.Set;
Unused : Event_Vectors.Vector;
Down : Coroutine_Manager_Access;
end record;
overriding procedure Get_Always_Ready_Event
(Self : in out Timeout_Manager;
Result : out Event_Id);
overriding procedure New_Round
(Self : in out Timeout_Manager;
Queue : in out Context_Vectors.Vector;
Timeout : Duration);
Manager : aliased Timeout_Manager;
--------------
-- Activate --
--------------
overriding procedure Activate (Self : in out Timeout_Event) is
begin
if not Self.Manager.Active.Contains (Self'Unchecked_Access) then
Self.Manager.Active.Insert (Self'Unchecked_Access);
end if;
end Activate;
----------------
-- Deactivate --
----------------
overriding procedure Deactivate (Self : in out Timeout_Event) is
begin
if Self.Manager.Active.Contains (Self'Unchecked_Access) then
Self.Manager.Active.Delete (Self'Unchecked_Access);
end if;
Self.Manager.Unused.Append (Self'Unchecked_Access);
end Deactivate;
----------------------------
-- Get_Always_Ready_Event --
----------------------------
procedure Get_Always_Ready_Event
(Self : in out Timeout_Manager;
Result : out Event_Id)
is
pragma Unreferenced (Self);
begin
Result := Timeout (0.0);
end Get_Always_Ready_Event;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
Manager.Down := Coroutines.Manager;
Coroutines.Manager := Manager'Access;
end Initialize;
----------
-- Less --
----------
function Less (Left, Right : Timeout_Event_Access) return Boolean is
function Less_Context return Boolean;
------------------
-- Less_Context --
------------------
function Less_Context return Boolean is
use type System.Storage_Elements.Integer_Address;
L : constant System.Storage_Elements.Integer_Address :=
System.Storage_Elements.To_Integer (System.Address (Left.Context));
R : constant System.Storage_Elements.Integer_Address :=
System.Storage_Elements.To_Integer (System.Address (Right.Context));
begin
return L < R;
end Less_Context;
begin
return Left.Time < Right.Time
or else (Left.Time = Right.Time and then Less_Context);
end Less;
---------------
-- New_Round --
---------------
procedure New_Round
(Self : in out Timeout_Manager;
Queue : in out Context_Vectors.Vector;
Timeout : Duration)
is
Limit : Duration := Timeout;
First : Timeout_Event_Access;
Now : Ada.Calendar.Time;
begin
if not Self.Active.Is_Empty then
Now := Ada.Calendar.Clock;
while not Self.Active.Is_Empty loop
First := Self.Active.First_Element;
if First.Time <= Now then
Queue.Append (First.Context);
Self.Active.Delete_First;
Limit := 0.0;
else
Limit := Duration'Min (Timeout, First.Time - Now);
exit;
end if;
end loop;
end if;
if Self.Down /= null then
Self.Down.New_Round (Queue, Timeout => Limit);
elsif Queue.Is_Empty then
delay Limit;
end if;
end New_Round;
-----------
-- Ready --
-----------
overriding function Ready (Self : Timeout_Event) return Boolean is
begin
return Self.Ready;
end Ready;
-------------
-- Timeout --
-------------
function Timeout (Value : Duration) return Event_Id is
-- use type Ada.Calendar.Time;
begin
return Timeout (Ada.Calendar.Clock + Value);
end Timeout;
-------------
-- Timeout --
-------------
function Timeout (Value : Ada.Calendar.Time) return Event_Id is
Result : Timeout_Event_Access;
begin
if Manager.Unused.Is_Empty then
Result := new Timeout_Event;
else
Result := Manager.Unused.Last_Element;
Manager.Unused.Delete_Last;
end if;
Result.all := (Event_Object with
Time => Value,
Context => Current_Context,
Manager => Manager'Access,
Ready => False);
return Event_Id (Result);
end Timeout;
end Coroutines.Timeouts;
|
30,282
|
ada
| 1
|
micahwelf/FLTK-Ada
|
src/fltk-devices-surfaces-paged.ads
|
with
FLTK.Widgets.Groups.Windows;
package FLTK.Devices.Surfaces.Paged is
type Paged_Surface is new Surface_Device with private;
type Paged_Surface_Reference (Data : not null access Paged_Surface'Class) is
limited null record with Implicit_Dereference => Data;
type Page_Format is
(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9,
B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10,
C5E, DLE, Executive, Folio, Ledger,
Legal, Letter, Tabloid, Envelope);
type Page_Layout is
(Potrait, Landscape, Reversed, Orientation);
Page_Error : exception;
package Forge is
function Create
return Paged_Surface;
end Forge;
procedure Start_Job
(This : in out Paged_Surface;
Count : in Natural);
procedure Start_Job
(This : in out Paged_Surface;
Count : in Natural;
From, To : in Positive);
procedure End_Job
(This : in out Paged_Surface);
procedure Start_Page
(This : in out Paged_Surface);
procedure End_Page
(This : in out Paged_Surface);
procedure Get_Margins
(This : in Paged_Surface;
Left, Top, Right, Bottom : out Integer);
procedure Get_Printable_Rect
(This : in Paged_Surface;
W, H : out Integer);
procedure Get_Origin
(This : in Paged_Surface;
X, Y : out Integer);
procedure Set_Origin
(This : in out Paged_Surface;
X, Y : in Integer);
procedure Rotate
(This : in out Paged_Surface;
Degrees : in Float);
procedure Scale
(This : in out Paged_Surface;
Factor : in Float);
procedure Scale
(This : in out Paged_Surface;
Factor_X, Factor_Y : in Float);
procedure Translate
(This : in out Paged_Surface;
Delta_X, Delta_Y : in Integer);
procedure Untranslate
(This : in out Paged_Surface);
procedure Print_Widget
(This : in out Paged_Surface;
Item : in FLTK.Widgets.Widget'Class;
Offset_X, Offset_Y : in Integer := 0);
procedure Print_Window
(This : in out Paged_Surface;
Item : in FLTK.Widgets.Groups.Windows.Window'Class;
Offset_X, Offset_Y : in Integer := 0);
procedure Print_Window_Part
(This : in out Paged_Surface;
Item : in FLTK.Widgets.Groups.Windows.Window'Class;
X, Y, W, H : in Integer;
Offset_X, Offset_Y : in Integer := 0);
private
type Paged_Surface is new Surface_Device with null record;
overriding procedure Finalize
(This : in out Paged_Surface);
pragma Inline (Start_Job);
pragma Inline (End_Job);
pragma Inline (Start_Page);
pragma Inline (End_Page);
pragma Inline (Get_Margins);
pragma Inline (Get_Printable_Rect);
pragma Inline (Get_Origin);
pragma Inline (Set_Origin);
pragma Inline (Rotate);
pragma Inline (Scale);
pragma Inline (Translate);
pragma Inline (Untranslate);
pragma Inline (Print_Widget);
pragma Inline (Print_Window);
pragma Inline (Print_Window_Part);
end FLTK.Devices.Surfaces.Paged;
|
30,283
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc3019b1.ada
|
-- CC3019B1.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.
--*
-- THIS IS GENERIC PACKAGE WHICH IS USED TO CHECK THE LEVEL OF
-- NESTED GENERICS SUPPORTED BY AN IMPLEMENTATION. IT IS USED
-- BY THE MAIN PROCEDURE, I.E., CC3019B2M.ADA.
--
-- *** THIS FILE MUST BE COMPILED AFTER CC3019B0.ADA HAS BEEN
-- *** COMPILED.
--
-- HISTORY:
-- <NAME>, 31 AUGUST 1990
WITH CC3019B0_LIST_CLASS ;
GENERIC
TYPE ELEMENT IS LIMITED PRIVATE ;
WITH PROCEDURE ASSIGN (SOURCE : IN OUT ELEMENT ;
DESTINATION : IN OUT ELEMENT) ;
WITH FUNCTION "=" (LEFT : IN ELEMENT ;
RIGHT : IN ELEMENT) RETURN BOOLEAN ;
PACKAGE CC3019B1_STACK_CLASS IS
TYPE STACK IS LIMITED PRIVATE ;
OVERFLOW : EXCEPTION ;
UNDERFLOW : EXCEPTION ;
PROCEDURE PUSH (THIS_ELEMENT : IN OUT ELEMENT ;
ON_TO_THIS_STACK : IN OUT STACK) ;
PROCEDURE POP (THIS_ELEMENT : IN OUT ELEMENT ;
OFF_THIS_STACK : IN OUT STACK) ;
PROCEDURE COPY (THIS_STACK : IN OUT STACK ;
TO_THIS_STACK : IN OUT STACK) ;
PROCEDURE CLEAR (THIS_STACK : IN OUT STACK) ;
GENERIC
WITH PROCEDURE PROCESS (THIS_ELEMENT : IN ELEMENT ;
CONTINUE : OUT BOOLEAN) ;
PROCEDURE ITERATE (OVER_THIS_STACK : IN STACK) ;
FUNCTION NUMBER_OF_ELEMENTS (ON_THIS_STACK : IN STACK)
RETURN NATURAL ;
FUNCTION "=" (LEFT : IN STACK ;
RIGHT : IN STACK) RETURN BOOLEAN ;
PRIVATE
PACKAGE NEW_LIST_CLASS IS
NEW CC3019B0_LIST_CLASS (ELEMENT => ELEMENT,
ASSIGN => ASSIGN,
"=" => "=") ;
TYPE STACK IS NEW NEW_LIST_CLASS.LIST ;
END CC3019B1_STACK_CLASS ;
PACKAGE BODY CC3019B1_STACK_CLASS IS
PROCEDURE PUSH (THIS_ELEMENT : IN OUT ELEMENT ;
ON_TO_THIS_STACK : IN OUT STACK) IS
BEGIN -- PUSH
NEW_LIST_CLASS.ADD (
THIS_ELEMENT => THIS_ELEMENT,
TO_THIS_LIST =>
NEW_LIST_CLASS.LIST (ON_TO_THIS_STACK)) ;
EXCEPTION
WHEN NEW_LIST_CLASS.OVERFLOW => RAISE OVERFLOW ;
END PUSH ;
PROCEDURE POP (THIS_ELEMENT : IN OUT ELEMENT ;
OFF_THIS_STACK : IN OUT STACK) IS
BEGIN -- POP
NEW_LIST_CLASS.DELETE (
THIS_ELEMENT => THIS_ELEMENT,
FROM_THIS_LIST =>
NEW_LIST_CLASS.LIST (OFF_THIS_STACK)) ;
EXCEPTION
WHEN NEW_LIST_CLASS.UNDERFLOW => RAISE UNDERFLOW ;
END POP ;
PROCEDURE COPY (THIS_STACK : IN OUT STACK ;
TO_THIS_STACK : IN OUT STACK) IS
BEGIN -- COPY
NEW_LIST_CLASS.COPY (
THIS_LIST => NEW_LIST_CLASS.LIST (THIS_STACK),
TO_THIS_LIST => NEW_LIST_CLASS.LIST (TO_THIS_STACK)) ;
END COPY ;
PROCEDURE CLEAR (THIS_STACK : IN OUT STACK) IS
BEGIN -- CLEAR
NEW_LIST_CLASS.CLEAR (NEW_LIST_CLASS.LIST (THIS_STACK)) ;
END CLEAR ;
PROCEDURE ITERATE (OVER_THIS_STACK : IN STACK) IS
PROCEDURE STACK_ITERATE IS NEW NEW_LIST_CLASS.ITERATE
(PROCESS => PROCESS) ;
BEGIN -- ITERATE
STACK_ITERATE (NEW_LIST_CLASS.LIST (OVER_THIS_STACK)) ;
END ITERATE ;
FUNCTION NUMBER_OF_ELEMENTS (ON_THIS_STACK : IN STACK)
RETURN NATURAL IS
BEGIN -- NUMBER_OF_ELEMENTS
RETURN NEW_LIST_CLASS.NUMBER_OF_ELEMENTS
(IN_THIS_LIST => NEW_LIST_CLASS.LIST (ON_THIS_STACK)) ;
END NUMBER_OF_ELEMENTS ;
FUNCTION "=" (LEFT : IN STACK ;
RIGHT : IN STACK) RETURN BOOLEAN IS
BEGIN -- "="
RETURN NEW_LIST_CLASS."=" (
LEFT => NEW_LIST_CLASS.LIST (LEFT),
RIGHT => NEW_LIST_CLASS.LIST (RIGHT)) ;
END "=" ;
END CC3019B1_STACK_CLASS ;
|
30,284
|
ada
| 1
|
LaudateCorpus1/RosettaCodeData
|
Task/Linear-congruential-generator/Ada/linear-congruential-generator-1.ada
|
generic
type Base_Type is mod <>;
Multiplyer, Adder: Base_Type;
Output_Divisor: Base_Type := 1;
package LCG is
procedure Initialize(Seed: Base_Type);
function Random return Base_Type;
-- changes the state and outputs the result
end LCG;
|
30,285
|
ada
| 0
|
hsgrewal/learning-ada
|
bool.adb
|
<filename>bool.adb
-- bool.adb
with Ada.Text_IO; use Ada.Text_IO;
procedure bool is
BoolVal1 : Boolean := True;
BoolVal2 : Boolean := True;
BoolVal3 : Boolean := False;
begin
Put_Line(" Bool1: " & Boolean'Image(BoolVal1 and BoolVal2));
Put_Line(" Bool2: " & Boolean'Image(BoolVal2 and BoolVal3));
Put_Line(" Bool3: " & Boolean'Image(BoolVal1 or BoolVal2));
Put_Line(" Bool4: " & Boolean'Image(BoolVal1 or BoolVal3));
Put_Line(" Bool5: " & Boolean'Image(not BoolVal1));
Put_Line(" Bool6: " & Boolean'Image(not BoolVal3));
Put_Line(" Bool7: " & Boolean'Image(BoolVal1 xor BoolVal2));
Put_Line(" Bool8: " & Boolean'Image(BoolVal1 xor BoolVal3));
end bool;
|
30,286
|
ada
| 1
|
skill-lang/skillAdaTestSuite
|
benchmark/hashing.ads
|
<reponame>skill-lang/skillAdaTestSuite
-- MURMUR3
--
-- taken from http://commons.ada.cx/Deterministic_Hashing
-- source at http://pastebin.com/ZhgRacMr
--
-- Baldrick on #ada provided an implementation of Murmur3.
-- Generic_Murmur3 is the core logic, the rest are convenience functions.
--
-- license: asked on #ada (Baldrick, 2014-04-07): public domain
with Ada.Containers;
with System.Storage_Elements;
package Hashing is
pragma Pure;
-- Provides a set of easy to use, efficient and well-behaved hash functions.
-- These are not cryptographic (secure) hashes, they are designed for use in
-- hash tables and such like. It is easy to add support for more types (just
-- ask).
-- Storage --
function Hash
(S : System.Storage_Elements.Storage_Array;
Seed : Ada.Containers.Hash_Type)
return Ada.Containers.Hash_Type with Inline;
function Hash (S : System.Storage_Elements.Storage_Array)
return Ada.Containers.Hash_Type is (Hash (S, 0));
-- Discrete types (includes integers) --
generic
type T is (<>);
function Discrete_Hash (
Value : T;
Seed : Ada.Containers.Hash_Type
) return Ada.Containers.Hash_Type with Inline;
-- Pointer types --
function Hash
(A : System.Address;
Seed : Ada.Containers.Hash_Type)
return Ada.Containers.Hash_Type with Inline, Pure_Function;
-- Yes, this is really pure in spite of using System.Address (GNAT disables
-- pureness of functions using System.Address by default because users often
-- turn the address into a pointer and do impure things with it).
function Hash (A : System.Address) return Ada.Containers.Hash_Type
is (Hash (A, 0));
generic
type Any_Type (<>) is limited private;
function Anonymous_Pointer_Hash (
Pointer : access constant Any_Type;
Seed : Ada.Containers.Hash_Type
) return Ada.Containers.Hash_Type with Inline;
generic
type Any_Type (<>) is limited private;
type Any_Access is access all Any_Type;
function All_Pointer_Hash (
Pointer : Any_Access;
Seed : Ada.Containers.Hash_Type
) return Ada.Containers.Hash_Type with Inline;
generic
type Any_Type (<>) is limited private;
type Any_Access is access constant Any_Type;
function Constant_Pointer_Hash (
Pointer : Any_Access;
Seed : Ada.Containers.Hash_Type
) return Ada.Containers.Hash_Type with Inline;
generic
type Any_Type (<>) is limited private;
type Any_Access is access Any_Type;
function Pointer_Hash (
Pointer : Any_Access;
Seed : Ada.Containers.Hash_Type
) return Ada.Containers.Hash_Type with Inline;
end Hashing;
|
30,287
|
ada
| 1
|
vidkidz/crossbridge
|
llvm-gcc-4.2-2.9/gcc/ada/mlib-utl.adb
|
<filename>llvm-gcc-4.2-2.9/gcc/ada/mlib-utl.adb
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- M L I B . U T L --
-- --
-- B o d y --
-- --
-- Copyright (C) 2002-2006, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with MLib.Fil; use MLib.Fil;
with MLib.Tgt; use MLib.Tgt;
with Namet; use Namet;
with Opt;
with Osint;
with Output; use Output;
with GNAT; use GNAT;
package body MLib.Utl is
Initialized : Boolean := False;
Gcc_Name : constant String := Osint.Program_Name ("gcc").all;
Gcc_Exec : OS_Lib.String_Access;
Ar_Name : OS_Lib.String_Access;
Ar_Exec : OS_Lib.String_Access;
Ar_Options : OS_Lib.String_List_Access;
Ranlib_Name : OS_Lib.String_Access;
Ranlib_Exec : OS_Lib.String_Access := null;
Ranlib_Options : OS_Lib.String_List_Access := null;
procedure Initialize;
-- Look for the tools in the path and record the full path for each one
--------
-- Ar --
--------
procedure Ar (Output_File : String; Objects : Argument_List) is
Full_Output_File : constant String :=
Ext_To (Output_File, Archive_Ext);
Arguments : OS_Lib.Argument_List_Access;
Success : Boolean;
Line_Length : Natural := 0;
begin
Utl.Initialize;
Arguments :=
new String_List (1 .. 1 + Ar_Options'Length + Objects'Length);
Arguments (1 .. Ar_Options'Length) := Ar_Options.all; -- "ar cr ..."
Arguments (Ar_Options'Length + 1) := new String'(Full_Output_File);
Arguments (Ar_Options'Length + 2 .. Arguments'Last) := Objects;
Delete_File (Full_Output_File);
if not Opt.Quiet_Output then
Write_Str (Ar_Name.all);
Line_Length := Ar_Name'Length;
for J in Arguments'Range loop
-- Make sure the Output buffer does not overflow
if Line_Length + 1 + Arguments (J)'Length > Buffer_Max then
Write_Eol;
Line_Length := 0;
end if;
Write_Char (' ');
Write_Str (Arguments (J).all);
Line_Length := Line_Length + 1 + Arguments (J)'Length;
end loop;
Write_Eol;
end if;
OS_Lib.Spawn (Ar_Exec.all, Arguments.all, Success);
if not Success then
Fail (Ar_Name.all, " execution error.");
end if;
-- If we have found ranlib, run it over the library
if Ranlib_Exec /= null then
if not Opt.Quiet_Output then
Write_Str (Ranlib_Name.all);
Write_Char (' ');
Write_Line (Arguments (Ar_Options'Length + 1).all);
end if;
OS_Lib.Spawn
(Ranlib_Exec.all,
Ranlib_Options.all & (Arguments (Ar_Options'Length + 1)),
Success);
if not Success then
Fail (Ranlib_Name.all, " execution error.");
end if;
end if;
end Ar;
-----------------
-- Delete_File --
-----------------
procedure Delete_File (Filename : String) is
File : constant String := Filename & ASCII.Nul;
Success : Boolean;
begin
OS_Lib.Delete_File (File'Address, Success);
if Opt.Verbose_Mode then
if Success then
Write_Str ("deleted ");
else
Write_Str ("could not delete ");
end if;
Write_Line (Filename);
end if;
end Delete_File;
---------
-- Gcc --
---------
procedure Gcc
(Output_File : String;
Objects : Argument_List;
Options : Argument_List;
Options_2 : Argument_List;
Driver_Name : Name_Id := No_Name)
is
Arguments :
OS_Lib.Argument_List
(1 .. 7 + Objects'Length + Options'Length + Options_2'Length);
A : Natural := 0;
Success : Boolean;
Out_Opt : constant OS_Lib.String_Access :=
new String'("-o");
Out_V : constant OS_Lib.String_Access :=
new String'(Output_File);
Lib_Dir : constant OS_Lib.String_Access :=
new String'("-L" & Lib_Directory);
Lib_Opt : constant OS_Lib.String_Access :=
new String'(Dynamic_Option);
Driver : String_Access;
begin
Utl.Initialize;
if Driver_Name = No_Name then
Driver := Gcc_Exec;
else
Driver := OS_Lib.Locate_Exec_On_Path (Get_Name_String (Driver_Name));
if Driver = null then
Fail (Get_Name_String (Driver_Name), " not found in path");
end if;
end if;
if Lib_Opt'Length /= 0 then
A := A + 1;
Arguments (A) := Lib_Opt;
end if;
A := A + 1;
Arguments (A) := Out_Opt;
A := A + 1;
Arguments (A) := Out_V;
A := A + 1;
Arguments (A) := Lib_Dir;
A := A + Options'Length;
Arguments (A - Options'Length + 1 .. A) := Options;
A := A + Objects'Length;
Arguments (A - Objects'Length + 1 .. A) := Objects;
A := A + Options_2'Length;
Arguments (A - Options_2'Length + 1 .. A) := Options_2;
if not Opt.Quiet_Output then
Write_Str (Driver.all);
for J in 1 .. A loop
Write_Char (' ');
Write_Str (Arguments (J).all);
end loop;
Write_Eol;
end if;
OS_Lib.Spawn (Driver.all, Arguments (1 .. A), Success);
if not Success then
if Driver_Name = No_Name then
Fail (Gcc_Name, " execution error");
else
Fail (Get_Name_String (Driver_Name), " execution error");
end if;
end if;
end Gcc;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
if not Initialized then
Initialized := True;
-- gcc
Gcc_Exec := OS_Lib.Locate_Exec_On_Path (Gcc_Name);
if Gcc_Exec = null then
Fail (Gcc_Name, " not found in path");
elsif Opt.Verbose_Mode then
Write_Str ("found ");
Write_Line (Gcc_Exec.all);
end if;
-- ar
Ar_Name := Osint.Program_Name (Archive_Builder);
Ar_Exec := OS_Lib.Locate_Exec_On_Path (Ar_Name.all);
if Ar_Exec = null then
Fail (Ar_Name.all, " not found in path");
elsif Opt.Verbose_Mode then
Write_Str ("found ");
Write_Line (Ar_Exec.all);
end if;
Ar_Options := Archive_Builder_Options;
-- ranlib
Ranlib_Name := Osint.Program_Name (Archive_Indexer);
if Ranlib_Name'Length > 0 then
Ranlib_Exec := OS_Lib.Locate_Exec_On_Path (Ranlib_Name.all);
if Ranlib_Exec /= null and then Opt.Verbose_Mode then
Write_Str ("found ");
Write_Line (Ranlib_Exec.all);
end if;
end if;
Ranlib_Options := Archive_Indexer_Options;
end if;
end Initialize;
-------------------
-- Lib_Directory --
-------------------
function Lib_Directory return String is
Libgnat : constant String := Tgt.Libgnat;
begin
Name_Len := Libgnat'Length;
Name_Buffer (1 .. Name_Len) := Libgnat;
Get_Name_String (Osint.Find_File (Name_Enter, Osint.Library));
-- Remove libgnat.a
return Name_Buffer (1 .. Name_Len - Libgnat'Length);
end Lib_Directory;
end MLib.Utl;
|
30,288
|
ada
| 1
|
charlie5/lace-alire
|
1-base/lace/source/events/concrete/lace-subject_and_deferred_observer.adb
|
with
ada.unchecked_Deallocation;
package body lace.Subject_and_deferred_Observer
is
package body Forge
is
function to_Subject_and_Observer (Name : in String) return Item
is
begin
return Self : Item
do
Self.Name := to_unbounded_String (Name);
end return;
end to_Subject_and_Observer;
function new_Subject_and_Observer (Name : in String) return View
is
begin
return new Item' (to_Subject_and_Observer (Name));
end new_Subject_and_Observer;
end Forge;
overriding
procedure destroy (Self : in out Item)
is
begin
Deferred.destroy (Deferred.item (Self)); -- Destroy base classes.
Subject .destroy (Subject .item (Self));
end destroy;
procedure free (Self : in out View)
is
procedure deallocate is new ada.unchecked_Deallocation (Item'Class, View);
begin
Self.destroy;
deallocate (Self);
end free;
overriding
function Name (Self : in Item) return String
is
begin
return to_String (Self.Name);
end Name;
end lace.Subject_and_deferred_Observer;
|
30,289
|
ada
| 0
|
JeremyGrosser/arm_cmsis_dsp
|
src/none_h.ads
|
<reponame>JeremyGrosser/arm_cmsis_dsp
pragma Ada_2012;
pragma Style_Checks (Off);
pragma Warnings ("U");
with Interfaces.C; use Interfaces.C;
with arm_math_types_h;
package none_h is
-- arg-macro: procedure multAcc_32x32_keep32_R (a, x, y)
-- a := (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 16#80000000# ) >> 32)
-- arg-macro: procedure multSub_32x32_keep32_R (a, x, y)
-- a := (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 16#80000000# ) >> 32)
-- arg-macro: procedure mult_32x32_keep32_R (a, x, y)
-- a := (q31_t) (((q63_t) x * y + 16#80000000# ) >> 32)
-- arg-macro: procedure multAcc_32x32_keep32 (a, x, y)
-- a += (q31_t) (((q63_t) x * y) >> 32)
-- arg-macro: procedure multSub_32x32_keep32 (a, x, y)
-- a -= (q31_t) (((q63_t) x * y) >> 32)
-- arg-macro: procedure mult_32x32_keep32 (a, x, y)
-- a := (q31_t) (((q63_t) x * y ) >> 32)
function clip_q63_to_q31 (x : arm_math_types_h.q63_t) return arm_math_types_h.q31_t -- ../CMSIS_5/CMSIS/DSP/Include/dsp/none.h:136
with Import => True,
Convention => C,
External_Name => "clip_q63_to_q31";
function clip_q63_to_q15 (x : arm_math_types_h.q63_t) return arm_math_types_h.q15_t -- ../CMSIS_5/CMSIS/DSP/Include/dsp/none.h:146
with Import => True,
Convention => C,
External_Name => "clip_q63_to_q15";
function clip_q31_to_q7 (x : arm_math_types_h.q31_t) return arm_math_types_h.q7_t -- ../CMSIS_5/CMSIS/DSP/Include/dsp/none.h:156
with Import => True,
Convention => C,
External_Name => "clip_q31_to_q7";
function clip_q31_to_q15 (x : arm_math_types_h.q31_t) return arm_math_types_h.q15_t -- ../CMSIS_5/CMSIS/DSP/Include/dsp/none.h:166
with Import => True,
Convention => C,
External_Name => "clip_q31_to_q15";
function mult32x64 (x : arm_math_types_h.q63_t; y : arm_math_types_h.q31_t) return arm_math_types_h.q63_t -- ../CMSIS_5/CMSIS/DSP/Include/dsp/none.h:176
with Import => True,
Convention => C,
External_Name => "mult32x64";
-- skipped func __QADD8
-- skipped func __QSUB8
-- skipped func __QADD16
-- skipped func __SHADD16
-- skipped func __QSUB16
-- skipped func __SHSUB16
-- skipped func __QASX
-- skipped func __SHASX
-- skipped func __QSAX
-- skipped func __SHSAX
-- skipped func __SMUSDX
-- skipped func __SMUADX
-- skipped func __QADD
-- skipped func __QSUB
-- skipped func __SMLAD
-- skipped func __SMLADX
-- skipped func __SMLSDX
-- skipped func __SMLALD
-- skipped func __SMLALDX
-- skipped func __SMUAD
-- skipped func __SMUSD
-- skipped func __SXTB16
-- skipped func __SMMLA
end none_h;
|
30,290
|
ada
| 9
|
Kidev/AdaPhysics2D
|
materials.adb
|
<reponame>Kidev/AdaPhysics2D<gh_stars>1-10
package body Materials is
function SetStatic(This : Material) return Material is
That : Material := This;
begin
That.Density := 0.0;
return That;
end SetStatic;
function SetFriction(This : Material; FStatic, FDynamic : Float := 0.0) return Material is
That : Material := This;
begin
That.StaticFriction := FStatic;
That.DynamicFriction := FDynamic;
return That;
end SetFriction;
-- Allows you to change restitution for a material
-- Disables it by default
function SetRestitution(This : Material; Rest : Float := 0.0) return Material is
That : Material := This;
begin
That.Restitution := Rest;
return That;
end SetRestitution;
function IsSolidMaterial(This : Material) return Boolean is
begin
return (MaterialType'Pos(This.MType) < MaterialType'Pos(ETVacuum));
end IsSolidMaterial;
end Materials;
|
30,291
|
ada
| 33
|
persan/zeromq-Ada
|
src/gen/zmq-low_level.ads
|
<filename>src/gen/zmq-low_level.ads
-------------------------------------------------------------------------------
-- --
-- 0MQ Ada-binding --
-- --
-- Z M Q . L O W _ L E V E L --
-- --
-- S p e c --
-- --
-- Copyright (C) 2020-2030, <EMAIL> --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files --
-- (the "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, sublicense, and / or sell copies of the Software, and to --
-- permit persons to whom the Software is furnished to do so, subject to --
-- the following conditions : --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, --
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL --
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR --
-- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, --
-- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR --
-- OTHER DEALINGS IN THE SOFTWARE. --
-------------------------------------------------------------------------------
--
-- The contents of this file is derived from zmq.h using the
-- -fdump-ada-spec switch for gcc.
pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings;
with System;
package ZMQ.Low_Level is
pragma Preelaborate;
pragma Warnings (Off);
package Defs is
-- This package is here to give a namespace to constants, since identifiers in Ada are caseinsensetive.
ZMQ_VERSION_MAJOR : constant := 4; -- zmq.h:42
ZMQ_VERSION_MINOR : constant := 3; -- zmq.h:43
ZMQ_VERSION_PATCH : constant := 2; -- zmq.h:44
-- arg-macro: function ZMQ_MAKE_VERSION (major, minor, patch)
-- return (major) *10000 + (minor) *100 + (patch);
-- unsupported macro: ZMQ_VERSION ZMQ_MAKE_VERSION (ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH)
ZMQ_DEFINED_STDINT : constant := 1; -- zmq.h:97
ZMQ_HAUSNUMERO : constant := 156_384_712; -- zmq.h:134
EFSM : constant := ZMQ_HAUSNUMERO + 51;
ENOCOMPATPROTO : constant := ZMQ_HAUSNUMERO + 52;
ETERM : constant := ZMQ_HAUSNUMERO + 53;
EMTHREAD : constant := ZMQ_HAUSNUMERO + 54;
ZMQ_IO_THREADS : constant := 1; -- zmq.h:215
ZMQ_MAX_SOCKETS : constant := 2; -- zmq.h:216
ZMQ_SOCKET_LIMIT : constant := 3; -- zmq.h:217
ZMQ_THREAD_PRIORITY : constant := 3; -- zmq.h:218
ZMQ_THREAD_SCHED_POLICY : constant := 4; -- zmq.h:219
ZMQ_MAX_MSGSZ : constant := 5; -- zmq.h:220
ZMQ_MSG_T_SIZE : constant := 6; -- zmq.h:221
ZMQ_THREAD_AFFINITY_CPU_ADD : constant := 7; -- zmq.h:222
ZMQ_THREAD_AFFINITY_CPU_REMOVE : constant := 8; -- zmq.h:223
ZMQ_THREAD_NAME_PREFIX : constant := 9; -- zmq.h:224
ZMQ_IO_THREADS_DFLT : constant := 1; -- zmq.h:227
ZMQ_MAX_SOCKETS_DFLT : constant := 1_023; -- zmq.h:228
ZMQ_THREAD_PRIORITY_DFLT : constant := -1; -- zmq.h:229
ZMQ_THREAD_SCHED_POLICY_DFLT : constant := -1; -- zmq.h:230
ZMQ_PAIR : constant := 0; -- zmq.h:291
ZMQ_PUB : constant := 1; -- zmq.h:292
ZMQ_SUB : constant := 2; -- zmq.h:293
ZMQ_REQ : constant := 3; -- zmq.h:294
ZMQ_REP : constant := 4; -- zmq.h:295
ZMQ_DEALER : constant := 5; -- zmq.h:296
ZMQ_ROUTER : constant := 6; -- zmq.h:297
ZMQ_PULL : constant := 7; -- zmq.h:298
ZMQ_PUSH : constant := 8; -- zmq.h:299
ZMQ_XPUB : constant := 9; -- zmq.h:300
ZMQ_XSUB : constant := 10; -- zmq.h:301
ZMQ_STREAM : constant := 11; -- zmq.h:302
ZMQ_XREQ : constant := ZMQ_DEALER;
ZMQ_XREP : constant := ZMQ_ROUTER;
ZMQ_AFFINITY : constant := 4; -- zmq.h:309
ZMQ_ROUTING_ID : constant := 5; -- zmq.h:310
ZMQ_SUBSCRIBE : constant := 6; -- zmq.h:311
ZMQ_UNSUBSCRIBE : constant := 7; -- zmq.h:312
ZMQ_RATE : constant := 8; -- zmq.h:313
ZMQ_RECOVERY_IVL : constant := 9; -- zmq.h:314
ZMQ_SNDBUF : constant := 11; -- zmq.h:315
ZMQ_RCVBUF : constant := 12; -- zmq.h:316
ZMQ_RCVMORE : constant := 13; -- zmq.h:317
ZMQ_FD : constant := 14; -- zmq.h:318
ZMQ_EVENTS : constant := 15; -- zmq.h:319
ZMQ_TYPE : constant := 16; -- zmq.h:320
ZMQ_LINGER : constant := 17; -- zmq.h:321
ZMQ_RECONNECT_IVL : constant := 18; -- zmq.h:322
ZMQ_BACKLOG : constant := 19; -- zmq.h:323
ZMQ_RECONNECT_IVL_MAX : constant := 21; -- zmq.h:324
ZMQ_MAXMSGSIZE : constant := 22; -- zmq.h:325
ZMQ_SNDHWM : constant := 23; -- zmq.h:326
ZMQ_RCVHWM : constant := 24; -- zmq.h:327
ZMQ_MULTICAST_HOPS : constant := 25; -- zmq.h:328
ZMQ_RCVTIMEO : constant := 27; -- zmq.h:329
ZMQ_SNDTIMEO : constant := 28; -- zmq.h:330
ZMQ_LAST_ENDPOINT : constant := 32; -- zmq.h:331
ZMQ_ROUTER_MANDATORY : constant := 33; -- zmq.h:332
ZMQ_TCP_KEEPALIVE : constant := 34; -- zmq.h:333
ZMQ_TCP_KEEPALIVE_CNT : constant := 35; -- zmq.h:334
ZMQ_TCP_KEEPALIVE_IDLE : constant := 36; -- zmq.h:335
ZMQ_TCP_KEEPALIVE_INTVL : constant := 37; -- zmq.h:336
ZMQ_IMMEDIATE : constant := 39; -- zmq.h:337
ZMQ_XPUB_VERBOSE : constant := 40; -- zmq.h:338
ZMQ_ROUTER_RAW : constant := 41; -- zmq.h:339
ZMQ_IPV6 : constant := 42; -- zmq.h:340
ZMQ_MECHANISM : constant := 43; -- zmq.h:341
ZMQ_PLAIN_SERVER : constant := 44; -- zmq.h:342
ZMQ_PLAIN_USERNAME : constant := 45; -- zmq.h:343
ZMQ_PLAIN_PASSWORD : constant := 46; -- zmq.h:344
ZMQ_CURVE_SERVER : constant := 47; -- zmq.h:345
ZMQ_CURVE_PUBLICKEY : constant := 48; -- zmq.h:346
ZMQ_CURVE_SECRETKEY : constant := 49; -- zmq.h:347
ZMQ_CURVE_SERVERKEY : constant := 50; -- zmq.h:348
ZMQ_PROBE_ROUTER : constant := 51; -- zmq.h:349
ZMQ_REQ_CORRELATE : constant := 52; -- zmq.h:350
ZMQ_REQ_RELAXED : constant := 53; -- zmq.h:351
ZMQ_CONFLATE : constant := 54; -- zmq.h:352
ZMQ_ZAP_DOMAIN : constant := 55; -- zmq.h:353
ZMQ_ROUTER_HANDOVER : constant := 56; -- zmq.h:354
ZMQ_TOS : constant := 57; -- zmq.h:355
ZMQ_CONNECT_ROUTING_ID : constant := 61; -- zmq.h:356
ZMQ_GSSAPI_SERVER : constant := 62; -- zmq.h:357
ZMQ_GSSAPI_PRINCIPAL : constant := 63; -- zmq.h:358
ZMQ_GSSAPI_SERVICE_PRINCIPAL : constant := 64; -- zmq.h:359
ZMQ_GSSAPI_PLAINTEXT : constant := 65; -- zmq.h:360
ZMQ_HANDSHAKE_IVL : constant := 66; -- zmq.h:361
ZMQ_SOCKS_PROXY : constant := 68; -- zmq.h:362
ZMQ_XPUB_NODROP : constant := 69; -- zmq.h:363
ZMQ_BLOCKY : constant := 70; -- zmq.h:364
ZMQ_XPUB_MANUAL : constant := 71; -- zmq.h:365
ZMQ_XPUB_WELCOME_MSG : constant := 72; -- zmq.h:366
ZMQ_STREAM_NOTIFY : constant := 73; -- zmq.h:367
ZMQ_INVERT_MATCHING : constant := 74; -- zmq.h:368
ZMQ_HEARTBEAT_IVL : constant := 75; -- zmq.h:369
ZMQ_HEARTBEAT_TTL : constant := 76; -- zmq.h:370
ZMQ_HEARTBEAT_TIMEOUT : constant := 77; -- zmq.h:371
ZMQ_XPUB_VERBOSER : constant := 78; -- zmq.h:372
ZMQ_CONNECT_TIMEOUT : constant := 79; -- zmq.h:373
ZMQ_TCP_MAXRT : constant := 80; -- zmq.h:374
ZMQ_THREAD_SAFE : constant := 81; -- zmq.h:375
ZMQ_MULTICAST_MAXTPDU : constant := 84; -- zmq.h:376
ZMQ_VMCI_BUFFER_SIZE : constant := 85; -- zmq.h:377
ZMQ_VMCI_BUFFER_MIN_SIZE : constant := 86; -- zmq.h:378
ZMQ_VMCI_BUFFER_MAX_SIZE : constant := 87; -- zmq.h:379
ZMQ_VMCI_CONNECT_TIMEOUT : constant := 88; -- zmq.h:380
ZMQ_USE_FD : constant := 89; -- zmq.h:381
ZMQ_GSSAPI_PRINCIPAL_NAMETYPE : constant := 90; -- zmq.h:382
ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE : constant := 91; -- zmq.h:383
ZMQ_BINDTODEVICE : constant := 92; -- zmq.h:384
ZMQ_MORE : constant := 1; -- zmq.h:387
ZMQ_SHARED : constant := 3; -- zmq.h:388
ZMQ_DONTWAIT : constant := 1; -- zmq.h:391
ZMQ_SNDMORE : constant := 2; -- zmq.h:392
ZMQ_NULL : constant := 0; -- zmq.h:395
ZMQ_PLAIN : constant := 1; -- zmq.h:396
ZMQ_CURVE : constant := 2; -- zmq.h:397
ZMQ_GSSAPI : constant := 3; -- zmq.h:398
ZMQ_GROUP_MAX_LENGTH : constant := 15; -- zmq.h:401
ZMQ_IDENTITY : constant := ZMQ_ROUTING_ID;
ZMQ_CONNECT_RID : constant := ZMQ_CONNECT_ROUTING_ID;
ZMQ_TCP_ACCEPT_FILTER : constant := 38; -- zmq.h:406
ZMQ_IPC_FILTER_PID : constant := 58; -- zmq.h:407
ZMQ_IPC_FILTER_UID : constant := 59; -- zmq.h:408
ZMQ_IPC_FILTER_GID : constant := 60; -- zmq.h:409
ZMQ_IPV4ONLY : constant := 31; -- zmq.h:410
ZMQ_DELAY_ATTACH_ON_CONNECT : constant := ZMQ_IMMEDIATE;
ZMQ_NOBLOCK : constant := ZMQ_DONTWAIT;
ZMQ_FAIL_UNROUTABLE : constant := ZMQ_ROUTER_MANDATORY;
ZMQ_ROUTER_BEHAVIOR : constant := ZMQ_ROUTER_MANDATORY;
ZMQ_SRCFD : constant := 2; -- zmq.h:417
ZMQ_GSSAPI_NT_HOSTBASED : constant := 0; -- zmq.h:424
ZMQ_GSSAPI_NT_USER_NAME : constant := 1; -- zmq.h:425
ZMQ_GSSAPI_NT_KRB5_PRINCIPAL : constant := 2; -- zmq.h:426
ZMQ_EVENT_CONNECTED : constant := 16#0001#; -- zmq.h:434
ZMQ_EVENT_CONNECT_DELAYED : constant := 16#0002#; -- zmq.h:435
ZMQ_EVENT_CONNECT_RETRIED : constant := 16#0004#; -- zmq.h:436
ZMQ_EVENT_LISTENING : constant := 16#0008#; -- zmq.h:437
ZMQ_EVENT_BIND_FAILED : constant := 16#0010#; -- zmq.h:438
ZMQ_EVENT_ACCEPTED : constant := 16#0020#; -- zmq.h:439
ZMQ_EVENT_ACCEPT_FAILED : constant := 16#0040#; -- zmq.h:440
ZMQ_EVENT_CLOSED : constant := 16#0080#; -- zmq.h:441
ZMQ_EVENT_CLOSE_FAILED : constant := 16#0100#; -- zmq.h:442
ZMQ_EVENT_DISCONNECTED : constant := 16#0200#; -- zmq.h:443
ZMQ_EVENT_MONITOR_STOPPED : constant := 16#0400#; -- zmq.h:444
ZMQ_EVENT_ALL : constant := 16#FFFF#; -- zmq.h:445
ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL : constant := 16#0800#; -- zmq.h:447
ZMQ_EVENT_HANDSHAKE_SUCCEEDED : constant := 16#1000#; -- zmq.h:450
ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL : constant := 16#2000#; -- zmq.h:453
ZMQ_EVENT_HANDSHAKE_FAILED_AUTH : constant := 16#4000#; -- zmq.h:456
ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED : constant := 16#1000_0000#; -- zmq.h:457
ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND : constant := 16#1000_0001#; -- zmq.h:458
ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE : constant := 16#1000_0002#; -- zmq.h:459
ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE : constant := 16#1000_0003#; -- zmq.h:460
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED : constant := 16#1000_0011#; -- zmq.h:461
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE : constant := 16#1000_0012#; -- zmq.h:462
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO : constant := 16#1000_0013#; -- zmq.h:463
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE : constant := 16#1000_0014#; -- zmq.h:464
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR : constant := 16#1000_0015#; -- zmq.h:465
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY : constant := 16#1000_0016#; -- zmq.h:466
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME : constant := 16#1000_0017#; -- zmq.h:467
ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA : constant := 16#1000_0018#; -- zmq.h:468
ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC : constant := 16#1100_0001#; -- zmq.h:470
ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH : constant := 16#1100_0002#; -- zmq.h:471
ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED : constant := 16#2000_0000#; -- zmq.h:472
ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY : constant := 16#2000_0001#; -- zmq.h:473
ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID : constant := 16#2000_0002#; -- zmq.h:474
ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION : constant := 16#2000_0003#; -- zmq.h:475
ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE : constant := 16#2000_0004#; -- zmq.h:476
ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA : constant := 16#2000_0005#; -- zmq.h:477
ZMQ_POLLIN : constant := 1; -- zmq.h:500
ZMQ_POLLOUT : constant := 2; -- zmq.h:501
ZMQ_POLLERR : constant := 4; -- zmq.h:502
ZMQ_POLLPRI : constant := 8; -- zmq.h:503
ZMQ_POLLITEMS_DFLT : constant := 16; -- zmq.h:517
ZMQ_HAS_CAPABILITIES : constant := 1; -- zmq.h:535
ZMQ_STREAMER : constant := 1; -- zmq.h:539
ZMQ_FORWARDER : constant := 2; -- zmq.h:540
ZMQ_QUEUE : constant := 3; -- zmq.h:541
-- Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
-- This file is part of libzmq, the ZeroMQ core engine in C++.
-- libzmq is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License (LGPL) as published
-- by the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
-- As a special exception, the Contributors give you permission to link
-- this library with independent modules to produce an executable,
-- regardless of the license terms of these independent modules, and to
-- copy and distribute the resulting executable under terms of your choice,
-- provided that you also meet, for each linked independent module, the
-- terms and conditions of the license of that module. An independent
-- module is a module which is not derived from or based on this library.
-- If you modify this library, you must extend this exception to your
-- version of the library.
-- libzmq is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-- License for more details.
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
-- *************************************************************************
-- NOTE to contributors. This file comprises the principal public contract
-- for ZeroMQ API users. Any change to this file supplied in a stable
-- release SHOULD not break existing applications.
-- In practice this means that the value of constants must not change, and
-- that old values may not be reused for new constants.
-- *************************************************************************
--
-- Version macros for compile-time API version detection Set target version to Windows Server 2008, Windows Vista or
-- higher. Windows XP (0x0501) is supported but without client & server socket types. Require Windows XP or higher
-- with MinGW for getaddrinfo(). Handle DSO symbol visibility Define integer types needed for event interface
-- 32-bit AIX's pollfd struct members are called reqevents and rtnevents so it defines compatibility macros for
-- them. Need to include that header first to stop build failures since zmq_pollset_t defines them as events
-- and revents. **************************************************************************** 0MQ errors.
-- **************************************************************************** A number random enough not to collide
-- with different errno ranges on different OSes. The assumption is that error_t is at least 32-bit type. On Windows
-- platform some of the standard POSIX errnos are not defined. Native 0MQ error codes. This function retrieves the
-- errno as it is known to 0MQ library. The goal of this function is to make the code 100% portable, including where
-- 0MQ compiled with certain CRT library (on Windows) is linked to an application that uses different CRT library.
end Defs;
function zmq_errno
return int -- zmq.h:202
with
Import => True,
Convention => C,
External_Name => "zmq_errno";
-- Resolves system errors and 0MQ errors to human-readable string.
function zmq_strerror
(errnum_u : int) return Interfaces.C.Strings
.chars_ptr -- zmq.h:205
with
Import => True,
Convention => C,
External_Name => "zmq_strerror";
-- Run-time API version detection
procedure zmq_version
(major_u : access int;
minor_u : access int;
patch_u : access int) -- zmq.h:208
with
Import => True,
Convention => C,
External_Name => "zmq_version";
-- **************************************************************************** 0MQ infrastructure (a.k.a. context)
-- initialisation & termination. **************************************************************************** Context
-- options Default for new contexts
function zmq_ctx_new return System
.Address -- zmq.h:232
with
Import => True,
Convention => C,
External_Name => "zmq_ctx_new";
function zmq_ctx_term
(context_u : System.Address)
return int -- zmq.h:233
with
Import => True,
Convention => C,
External_Name => "zmq_ctx_term";
function zmq_ctx_shutdown
(context_u : System.Address)
return int -- zmq.h:234
with
Import => True,
Convention => C,
External_Name => "zmq_ctx_shutdown";
function zmq_ctx_set
(context_u : System.Address;
option_u : int;
optval_u : int)
return int -- zmq.h:235
with
Import => True,
Convention => C,
External_Name => "zmq_ctx_set";
function zmq_ctx_get
(context_u : System.Address;
option_u : int)
return int -- zmq.h:236
with
Import => True,
Convention => C,
External_Name => "zmq_ctx_get";
-- Old (legacy) API
function zmq_init
(io_threads_u : int) return System
.Address -- zmq.h:239
with
Import => True,
Convention => C,
External_Name => "zmq_init";
function zmq_term
(context_u : System.Address)
return int -- zmq.h:240
with
Import => True,
Convention => C,
External_Name => "zmq_term";
function zmq_ctx_destroy
(context_u : System.Address)
return int -- zmq.h:241
with
Import => True,
Convention => C,
External_Name => "zmq_ctx_destroy";
-- **************************************************************************** 0MQ message definition.
-- ****************************************************************************
-- Some architectures, like sparc64 and some variants of aarch64, enforce pointer * alignment and raise sigbus on
-- violations. Make sure applications allocate * zmq_msg_t on addresses aligned on a pointer-size boundary to avoid
-- this issue.
--
type zmq_msg_t_array1158 is array (0 .. 63) of aliased unsigned_char;
type zmq_msg_t is record
u_u : aliased zmq_msg_t_array1158; -- zmq.h:261
end record with
Convention => C_Pass_By_Copy; -- zmq.h:252
-- skipped function type zmq_free_fn
function zmq_msg_init
(msg_u : access zmq_msg_t)
return int -- zmq.h:269
with
Import => True,
Convention => C,
External_Name => "zmq_msg_init";
function zmq_msg_init_size
(msg_u : access zmq_msg_t;
size_u : size_t)
return int -- zmq.h:270
with
Import => True,
Convention => C,
External_Name => "zmq_msg_init_size";
function zmq_msg_init_data
(msg_u : access zmq_msg_t; data_u : System.Address; size_u : size_t;
ffn_u : access procedure (arg1 : System.Address; arg2 : System.Address);
hint_u : System.Address)
return int -- zmq.h:271
with
Import => True,
Convention => C,
External_Name => "zmq_msg_init_data";
function zmq_msg_send
(msg_u : access zmq_msg_t;
s_u : System.Address;
flags_u : int)
return int -- zmq.h:273
with
Import => True,
Convention => C,
External_Name => "zmq_msg_send";
function zmq_msg_recv
(msg_u : access zmq_msg_t;
s_u : System.Address;
flags_u : int)
return int -- zmq.h:274
with
Import => True,
Convention => C,
External_Name => "zmq_msg_recv";
function zmq_msg_close
(msg_u : access zmq_msg_t)
return int -- zmq.h:275
with
Import => True,
Convention => C,
External_Name => "zmq_msg_close";
function zmq_msg_move
(dest_u : access zmq_msg_t;
src_u : access zmq_msg_t)
return int -- zmq.h:276
with
Import => True,
Convention => C,
External_Name => "zmq_msg_move";
function zmq_msg_copy
(dest_u : access zmq_msg_t;
src_u : access zmq_msg_t)
return int -- zmq.h:277
with
Import => True,
Convention => C,
External_Name => "zmq_msg_copy";
function zmq_msg_data
(msg_u : access zmq_msg_t) return System
.Address -- zmq.h:278
with
Import => True,
Convention => C,
External_Name => "zmq_msg_data";
function zmq_msg_size
(msg_u : access constant zmq_msg_t)
return size_t -- zmq.h:279
with
Import => True,
Convention => C,
External_Name => "zmq_msg_size";
function zmq_msg_more
(msg_u : access constant zmq_msg_t)
return int -- zmq.h:280
with
Import => True,
Convention => C,
External_Name => "zmq_msg_more";
function zmq_msg_get
(msg_u : access constant zmq_msg_t;
property_u : int)
return int -- zmq.h:281
with
Import => True,
Convention => C,
External_Name => "zmq_msg_get";
function zmq_msg_set
(msg_u : access zmq_msg_t;
property_u : int;
optval_u : int)
return int -- zmq.h:282
with
Import => True,
Convention => C,
External_Name => "zmq_msg_set";
function zmq_msg_gets
(msg_u : access constant zmq_msg_t; property_u : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings
.chars_ptr -- zmq.h:283
with
Import => True,
Convention => C,
External_Name => "zmq_msg_gets";
-- **************************************************************************** 0MQ socket definition.
-- **************************************************************************** Socket types. Deprecated aliases Socket
-- options. Message options Send/recv options. Security mechanisms RADIO-DISH protocol Deprecated options and aliases
-- Deprecated Message options **************************************************************************** GSSAPI
-- definitions **************************************************************************** GSSAPI principal name
-- types **************************************************************************** 0MQ socket events and monitoring
-- **************************************************************************** Socket transport events (TCP, IPC and
-- TIPC only) Unspecified system errors during handshake. Event value is an errno. Handshake complete successfully with
-- successful authentication (if *
-- * enabled). Event value is unused.
-- Protocol errors between ZMTP peers or between server and ZAP handler. *
-- * Event value is one of ZMQ_PROTOCOL_ERROR_*
-- Failed authentication requests. Event value is the numeric ZAP status *
-- * code, i.e. 300, 400 or 500.
-- the following two may be due to erroneous configuration of a peer
function zmq_socket
(arg1 : System.Address; type_u : int) return System
.Address -- zmq.h:479
with
Import => True,
Convention => C,
External_Name => "zmq_socket";
function zmq_close
(s_u : System.Address)
return int -- zmq.h:480
with
Import => True,
Convention => C,
External_Name => "zmq_close";
function zmq_setsockopt
(s_u : System.Address;
option_u : int;
optval_u : System.Address;
optvallen_u : size_t)
return int -- zmq.h:482
with
Import => True,
Convention => C,
External_Name => "zmq_setsockopt";
function zmq_getsockopt
(s_u : System.Address;
option_u : int;
optval_u : System.Address;
optvallen_u : access size_t)
return int -- zmq.h:484
with
Import => True,
Convention => C,
External_Name => "zmq_getsockopt";
function zmq_bind
(s_u : System.Address;
addr_u : Interfaces.C.Strings.chars_ptr)
return int -- zmq.h:485
with
Import => True,
Convention => C,
External_Name => "zmq_bind";
function zmq_connect
(s_u : System.Address;
addr_u : Interfaces.C.Strings.chars_ptr)
return int -- zmq.h:486
with
Import => True,
Convention => C,
External_Name => "zmq_connect";
function zmq_unbind
(s_u : System.Address;
addr_u : Interfaces.C.Strings.chars_ptr)
return int -- zmq.h:487
with
Import => True,
Convention => C,
External_Name => "zmq_unbind";
function zmq_disconnect
(s_u : System.Address;
addr_u : Interfaces.C.Strings.chars_ptr)
return int -- zmq.h:488
with
Import => True,
Convention => C,
External_Name => "zmq_disconnect";
function zmq_send
(s_u : System.Address;
buf_u : System.Address;
len_u : size_t;
flags_u : int)
return int -- zmq.h:489
with
Import => True,
Convention => C,
External_Name => "zmq_send";
function zmq_send_const
(s_u : System.Address;
buf_u : System.Address;
len_u : size_t;
flags_u : int)
return int -- zmq.h:491
with
Import => True,
Convention => C,
External_Name => "zmq_send_const";
function zmq_recv
(s_u : System.Address;
buf_u : System.Address;
len_u : size_t;
flags_u : int)
return int -- zmq.h:492
with
Import => True,
Convention => C,
External_Name => "zmq_recv";
function zmq_socket_monitor
(s_u : System.Address;
addr_u : Interfaces.C.Strings.chars_ptr;
events_u : int)
return int -- zmq.h:493
with
Import => True,
Convention => C,
External_Name => "zmq_socket_monitor";
-- **************************************************************************** Deprecated I/O multiplexing. Prefer using
-- zmq_poller API ****************************************************************************
type zmq_pollitem_t is record
socket : System.Address; -- zmq.h:507
fd : aliased int; -- zmq.h:511
events : aliased short; -- zmq.h:513
revents : aliased short; -- zmq.h:514
end record with
Convention => C_Pass_By_Copy; -- zmq.h:505
function zmq_poll
(items_u : access zmq_pollitem_t;
nitems_u : int;
timeout_u : long)
return int -- zmq.h:519
with
Import => True,
Convention => C,
External_Name => "zmq_poll";
-- **************************************************************************** Message proxying
-- ****************************************************************************
function zmq_proxy
(frontend_u : System.Address;
backend_u : System.Address;
capture_u : System.Address)
return int -- zmq.h:525
with
Import => True,
Convention => C,
External_Name => "zmq_proxy";
function zmq_proxy_steerable
(frontend_u : System.Address; backend_u : System.Address; capture_u : System.Address; control_u : System.Address)
return int -- zmq.h:526
with
Import => True,
Convention => C,
External_Name => "zmq_proxy_steerable";
-- **************************************************************************** Probe library capabilities
-- ****************************************************************************
function zmq_has
(capability_u : Interfaces.C.Strings.chars_ptr)
return int -- zmq.h:536
with
Import => True,
Convention => C,
External_Name => "zmq_has";
-- Deprecated aliases
-- Deprecated methods
function zmq_device
(type_u : int;
frontend_u : System.Address;
backend_u : System.Address)
return int -- zmq.h:544
with
Import => True,
Convention => C,
External_Name => "zmq_device";
function zmq_sendmsg
(s_u : System.Address;
msg_u : access zmq_msg_t;
flags_u : int)
return int -- zmq.h:545
with
Import => True,
Convention => C,
External_Name => "zmq_sendmsg";
function zmq_recvmsg
(s_u : System.Address;
msg_u : access zmq_msg_t;
flags_u : int)
return int -- zmq.h:546
with
Import => True,
Convention => C,
External_Name => "zmq_recvmsg";
type iovec is null record; -- incomplete struct
function zmq_sendiov
(s_u : System.Address;
iov_u : access iovec;
count_u : size_t;
flags_u : int)
return int -- zmq.h:549
with
Import => True,
Convention => C,
External_Name => "zmq_sendiov";
function zmq_recviov
(s_u : System.Address;
iov_u : access iovec;
count_u : access size_t;
flags_u : int)
return int -- zmq.h:551
with
Import => True,
Convention => C,
External_Name => "zmq_recviov";
-- **************************************************************************** Encryption functions
-- **************************************************************************** Encode data with Z85 encoding.
-- Returns encoded data
function zmq_z85_encode
(dest_u : Interfaces.C.Strings.chars_ptr; data_u : access Interfaces.Unsigned_8; size_u : size_t)
return Interfaces.C.Strings
.chars_ptr -- zmq.h:559
with
Import => True,
Convention => C,
External_Name => "zmq_z85_encode";
-- Decode data with Z85 encoding. Returns decoded data
function zmq_z85_decode
(dest_u : access Interfaces.Unsigned_8; string_u : Interfaces.C.Strings
.chars_ptr) return access Interfaces
.Unsigned_8 -- zmq.h:562
with
Import => True,
Convention => C,
External_Name => "zmq_z85_decode";
-- Generate z85-encoded public and private keypair with tweetnacl/libsodium. Returns 0 on success.
function zmq_curve_keypair
(z85_public_key_u : Interfaces.C.Strings.chars_ptr;
z85_secret_key_u : Interfaces.C.Strings.chars_ptr)
return int -- zmq.h:566
with
Import => True,
Convention => C,
External_Name => "zmq_curve_keypair";
-- Derive the z85-encoded public key from the z85-encoded secret key. Returns 0 on success.
function zmq_curve_public
(z85_public_key_u : Interfaces.C.Strings.chars_ptr;
z85_secret_key_u : Interfaces.C.Strings.chars_ptr)
return int -- zmq.h:570
with
Import => True,
Convention => C,
External_Name => "zmq_curve_public";
-- **************************************************************************** Atomic utility methods
-- ****************************************************************************
function zmq_atomic_counter_new return System
.Address -- zmq.h:577
with
Import => True,
Convention => C,
External_Name => "zmq_atomic_counter_new";
procedure zmq_atomic_counter_set
(counter_u : System.Address;
value_u : int) -- zmq.h:578
with
Import => True,
Convention => C,
External_Name => "zmq_atomic_counter_set";
function zmq_atomic_counter_inc
(counter_u : System.Address)
return int -- zmq.h:579
with
Import => True,
Convention => C,
External_Name => "zmq_atomic_counter_inc";
function zmq_atomic_counter_dec
(counter_u : System.Address)
return int -- zmq.h:580
with
Import => True,
Convention => C,
External_Name => "zmq_atomic_counter_dec";
function zmq_atomic_counter_value
(counter_u : System.Address)
return int -- zmq.h:581
with
Import => True,
Convention => C,
External_Name => "zmq_atomic_counter_value";
procedure zmq_atomic_counter_destroy
(counter_p_u : System
.Address) -- zmq.h:582
with
Import => True,
Convention => C,
External_Name => "zmq_atomic_counter_destroy";
-- **************************************************************************** Scheduling timers
-- ****************************************************************************
-- skipped function type zmq_timer_fn
function zmq_timers_new return System
.Address -- zmq.h:592
with
Import => True,
Convention => C,
External_Name => "zmq_timers_new";
function zmq_timers_destroy
(timers_p : System.Address)
return int -- zmq.h:593
with
Import => True,
Convention => C,
External_Name => "zmq_timers_destroy";
function zmq_timers_add
(timers : System.Address; interval : size_t; handler : access procedure (arg1 : int; arg2 : System.Address);
arg : System.Address)
return int -- zmq.h:595
with
Import => True,
Convention => C,
External_Name => "zmq_timers_add";
function zmq_timers_cancel
(timers : System.Address;
timer_id : int)
return int -- zmq.h:596
with
Import => True,
Convention => C,
External_Name => "zmq_timers_cancel";
function zmq_timers_set_interval
(timers : System.Address;
timer_id : int;
interval : size_t)
return int -- zmq.h:598
with
Import => True,
Convention => C,
External_Name => "zmq_timers_set_interval";
function zmq_timers_reset
(timers : System.Address;
timer_id : int)
return int -- zmq.h:599
with
Import => True,
Convention => C,
External_Name => "zmq_timers_reset";
function zmq_timers_timeout
(timers : System.Address)
return long -- zmq.h:600
with
Import => True,
Convention => C,
External_Name => "zmq_timers_timeout";
function zmq_timers_execute
(timers : System.Address)
return int -- zmq.h:601
with
Import => True,
Convention => C,
External_Name => "zmq_timers_execute";
-- **************************************************************************** These functions are not documented by
-- man pages -- use at your own risk. If you need these to be part of the formal ZMQ API, then (a) write a man page, and
-- (b) write a test case in tests. **************************************************************************** Helper
-- functions are used by perf tests so that they don't have to care about minutiae of time-related functions on different
-- OS platforms. Starts the stopwatch. Returns the handle to the watch.
function zmq_stopwatch_start return System
.Address -- zmq.h:614
with
Import => True,
Convention => C,
External_Name => "zmq_stopwatch_start";
-- Returns the number of microseconds elapsed since the stopwatch was started, but does not stop or deallocate the
-- stopwatch.
function zmq_stopwatch_intermediate
(watch_u : System.Address)
return unsigned_long -- zmq.h:618
with
Import => True,
Convention => C,
External_Name => "zmq_stopwatch_intermediate";
-- Stops the stopwatch. Returns the number of microseconds elapsed since the stopwatch was started, and deallocates that
-- watch.
function zmq_stopwatch_stop
(watch_u : System.Address)
return unsigned_long -- zmq.h:622
with
Import => True,
Convention => C,
External_Name => "zmq_stopwatch_stop";
-- Sleeps for specified number of seconds.
procedure zmq_sleep
(seconds_u : int) -- zmq.h:625
with
Import => True,
Convention => C,
External_Name => "zmq_sleep";
-- skipped function type zmq_thread_fn
-- Start a thread. Returns a handle to the thread.
function zmq_threadstart
(func_u : access procedure (arg1 : System.Address); arg_u : System.Address) return System
.Address -- zmq.h:630
with
Import => True,
Convention => C,
External_Name => "zmq_threadstart";
-- Wait for thread to complete then free up resources.
procedure zmq_threadclose
(thread_u : System
.Address) -- zmq.h:633
with
Import => True,
Convention => C,
External_Name => "zmq_threadclose";
-- **************************************************************************** These functions are
-- DRAFT and disabled in stable releases, and subject to change at ANY time until declared stable.
-- **************************************************************************** DRAFT Socket types. DRAFT Socket options.
-- DRAFT Context options DRAFT Socket methods. DRAFT Msg methods. DRAFT Msg property names. Router notify options
-- **************************************************************************** Poller polling on sockets,fd and
-- thread-safe sockets **************************************************************************** DRAFT Socket
-- monitoring events
end ZMQ.Low_Level;
|
30,292
|
ada
| 24
|
svn2github/matreshka
|
source/amf/uml/amf-internals-uml_classifiers.ads
|
<reponame>svn2github/matreshka
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Packageable_Elements;
with AMF.UML.Classifiers.Collections;
package AMF.Internals.UML_Classifiers is
type UML_Classifier_Proxy is
abstract new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy
and AMF.UML.Classifiers.UML_Classifier
with null record;
overriding function All_Parents
(Self : not null access constant UML_Classifier_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Operation Classifier::allParents.
--
-- The query allParents() gives all of the direct and indirect ancestors
-- of a generalized Classifier.
overriding function Parents
(Self : not null access constant UML_Classifier_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Operation Classifier::parents.
--
-- The query parents() gives all of the immediate ancestors of a
-- generalized Classifier.
overriding procedure Set_Is_Abstract
(Self : not null access UML_Classifier_Proxy;
To : Boolean);
-- Setter of Classifier::isAbstract.
--
-- If true, the Classifier does not provide a complete declaration and can
-- typically not be instantiated. An abstract classifier is intended to be
-- used by other classifiers e.g. as the target of general
-- metarelationships or generalization relationships.
end AMF.Internals.UML_Classifiers;
|
30,293
|
ada
| 9
|
alkhimey/Ada_Joystick
|
src/linux_joystick.adb
|
<filename>src/linux_joystick.adb
-- The MIT License (MIT)
--
-- Copyright (c) 2016 <EMAIL>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
--
--
with Ada.Sequential_IO;
with Ada.Directories;
package body Linux_Joystick is
type Axis_Button_Number_Type is range 0..(2**8)-1;
for Axis_Button_Number_Type'Size use 8;
type Raw_Js_Event_Type is
record
Time : Milliseconds_Type;
Value : Value_Type;
Is_Init_Event : Boolean;
Event_Type : Event_Type_Type;
Axis_Button_Number : Axis_Button_Number_Type;
end record;
for Raw_Js_Event_Type use
record
Time at 0 range 0..31;
Value at 4 range 0..15;
Is_Init_Event at 6 range 0..0;
Event_Type at 6 range 1..7;
Axis_Button_Number at 7 range 0..7;
end record;
for Raw_Js_Event_Type'Bit_Order use System.High_Order_First; -- TODO: veriy that this is enough
package SIO is new Ada.Sequential_IO(Raw_Js_Event_Type);
Input_File : SIO.File_Type;
procedure Open(Name : String) is
begin
SIO.Open (File => Input_File,
Mode => SIO.IN_FILE,
Name => Name);
end;
function Open return String is
Search : Ada.Directories.Search_Type;
Dir_Ent : Ada.Directories.Directory_Entry_Type;
begin
Ada.Directories.Start_Search (Search, "/dev/input/", "js*");
if not Ada.Directories.More_Entries (Search) then
Ada.Directories.End_Search (Search);
raise No_Joystick_Device_Found;
end if;
Ada.Directories.Get_Next_Entry (Search, Dir_Ent);
declare
Device_Path : String := Ada.Directories.Full_Name (Dir_Ent);
begin
Ada.Directories.End_Search (Search);
Open(Device_Path);
return Device_Path;
end;
end;
function Read return Js_Event_Type is
Raw_Js_Event : Raw_Js_Event_Type;
begin
SIO.Read(File => Input_File,
Item => Raw_Js_Event);
case Raw_Js_Event.Event_Type is
when JS_EVENT_BUTTON =>
return (Event_Type => JS_EVENT_BUTTON,
Time => Raw_Js_Event.Time,
Is_Init_Event => Raw_Js_Event.Is_Init_Event,
Button => Button_Type'Val(Raw_Js_Event.Axis_Button_Number),
Button_Action => Button_Action_Type'Val(Raw_Js_Event.Value) );
when JS_EVENT_AXIS =>
return (Event_Type => JS_EVENT_AXIS,
Time => Raw_Js_Event.Time,
Is_Init_Event => Raw_Js_Event.Is_Init_Event,
Axis => Axis_Type'Val(Raw_Js_Event.Axis_Button_Number),
Value => Raw_Js_Event.Value );
end case;
end;
procedure Close is
begin
SIO.Close(Input_File);
end;
end Linux_Joystick;
|
30,294
|
ada
| 286
|
auzkok/libagar
|
ada/original_2008/ada-gui/agar-gui-widget-ucombo.adb
|
package body agar.gui.widget.ucombo is
package cbinds is
function allocate_polled
(parent : widget_access_t;
flags : flags_t;
callback : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return ucombo_access_t;
pragma import (c, allocate_polled, "AG_UComboNewPolled");
procedure size_hint
(ucombo : ucombo_access_t;
text : cs.chars_ptr;
items : c.int);
pragma import (c, size_hint, "AG_UComboSizeHint");
procedure size_hint_pixels
(ucombo : ucombo_access_t;
width : c.int;
height : c.int);
pragma import (c, size_hint_pixels, "AG_UComboSizeHintPixels");
end cbinds;
function allocate_polled
(parent : widget_access_t;
flags : flags_t;
callback : agar.core.event.callback_t) return ucombo_access_t is
begin
return cbinds.allocate_polled
(parent => parent,
flags => flags,
callback => callback,
fmt => agar.core.types.null_ptr);
end allocate_polled;
procedure size_hint
(ucombo : ucombo_access_t;
text : string;
items : natural)
is
c_text : aliased c.char_array := c.to_c (text);
begin
cbinds.size_hint
(ucombo => ucombo,
text => cs.to_chars_ptr (c_text'unchecked_access),
items => c.int (items));
end size_hint;
procedure size_hint_pixels
(ucombo : ucombo_access_t;
width : natural;
height : natural) is
begin
cbinds.size_hint_pixels
(ucombo => ucombo,
width => c.int (width),
height => c.int (height));
end size_hint_pixels;
--
function widget (ucombo : ucombo_access_t) return widget_access_t is
begin
return ucombo.widget'access;
end widget;
end agar.gui.widget.ucombo;
|
30,295
|
ada
| 7
|
best08618/asylo
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/lto6_pkg.ads
|
with Ada.Finalization; use Ada.Finalization;
package Lto6_Pkg is
type F_String is new Controlled with record
Data : access String;
end record;
Null_String : constant F_String := (Controlled with Data => null);
end Lto6_Pkg;
|
30,296
|
ada
| 15
|
My-Colaborations/dynamo
|
src/asis/a4g-a_opt.ads
|
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . A _ O P T --
-- --
-- S p e c --
-- --
-- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adacore.com). --
-- --
------------------------------------------------------------------------------
-- This package contains global switches set by the
-- Asis_Environment.Initialize routine from the Parameters siting and
-- referenced throughout the ASIS-for-GNAT
--
-- This package may be considered as an ASIS analog of the GNAT Opt
-- package
package A4G.A_Opt is
Is_Initialized : Boolean := False;
-- flag indicating if the environment has already been initialized.
Was_Initialized_At_Least_Once : Boolean := False;
-- flag indicating if the environment was initialized at least
-- once during the current launch of an ASIS application
type ASIS_Warning_Mode_Type is (Suppress, Normal, Treat_As_Error);
ASIS_Warning_Mode : ASIS_Warning_Mode_Type := Normal;
-- Controls treatment of warning messages. If set to Suppress, warning
-- messages are not generated at all. In Normal mode, they are generated
-- but do not count as errors. In Treat_As_Error mode, a warning is
-- treated as an error: ASIS_Failed is raised and the warning message is
-- sent to an ASIS Diagnosis string.
Strong_Version_Check : Boolean := True;
-- Strong version check means that version strings read from the tree and
-- stored in Gnatvsn are compared. Weak check means comparing ASIS version
-- numbers. See BA23-002
Generate_Bug_Box : Boolean := True;
-- Flag indicating if the ASIS bug box should be generated into Stderr
-- when an ASIS implementation bug is detected.
Keep_Going : Boolean := False;
-- Flag indicating if the exit to OS should NOT be generated in case if
-- ASIS internal implementation error. Set ON by Initialize '-k' parameter.
ASIS_2005_Mode_Internal : Boolean := True;
-- If this switch is ON, ASIS detects as predefined units also units listed
-- as predefined in the 2005 revision of the Ada Standard. Now this flag is
-- always ON, and we do not have any parameter to tell ASIS that only
-- Ada 95 predefined units should be classified as predefined Compilation
-- Units in ASIS.
procedure Process_Initialization_Parameters (Parameters : String);
-- Processes a Parameters string passed to the
-- Asis.Implementation.Initialize query: check parameters and makes the
-- corresponding settings for ASIS global switches and flags.
procedure Process_Finalization_Parameters (Parameters : String);
-- Processes a Parameters string passed to the
-- Asis.Implementation.Finalize query.
procedure Set_Off;
-- Sets Is_Initialized flag OFF and then sets all the global switches
-- except Was_Initialized_At_Least_Once in the initial (default) position.
-- Is to be called by Asis_Environment.Finalize
-- the type declarations below should probably be moved into A_Types???
type Context_Mode is
-- different ways to define an ASIS Context:
(One_Tree,
-- a Context is made up by only one tree file
N_Trees,
-- a Context is made up by N tree files
Partition,
-- a partition Context
All_Trees);
-- all the tree files in tree search path are considered as making up a
-- given Context
type Tree_Mode is
-- how ASIS deals with tree files
(On_The_Fly,
-- trees are created on the fly, created trees are reused as long as a
-- Context remains opened
Pre_Created,
-- only those trees which have been created before a Context is opened
-- are used
Mixed,
-- mixed approach - if ASIS cannot find a needed tree, it tries to
-- create it on the fly
Incremental,
-- Similar to Mixed, but these mode goes beyond the ASIS standard and
-- allows to change the environment when the Context remains open:
-- - when the Context is opened, all the existing trees are processed;
-- - if ASIS can not find a needed tree, it tries to create it on the
-- fly, and it refreshes the information in the Context unit table
-- using the data from this newly created tree;
-- - any access to a unit or to an element checks that a tree to be
-- accessed is consistent with the sources
-- ???? This documentation definitely needs revising???
GNSA
-- Any tree is created on the fly by calling GNSA. It is not written
-- in a tree file and then read back by ASIS, but it is left in the
-- same data structures where it has been created, and after that ASIS
-- works on the same data structures.
);
type Source_Mode is
-- how ASIS takes into account source files when checking the consistency
(All_Sources,
-- sources of all the units from a given Context (except the predefined
-- Standard package) should be around, and they should be the same as
-- the sources from which tree files making up the Context were created
Existing_Sources,
-- If for a given unit from the Context the corresponding source file
-- exists, it should be the same as those used to create tree files
-- making up the Context
No_Sources);
-- Existing source files are not taken into account when checking the
-- consistency of tree files
end A4G.A_Opt;
|
30,297
|
ada
| 73
|
deboradeben/numerical-veliz
|
src/rootfinding/NewtSafe.adb
|
<reponame>deboradeben/numerical-veliz
-----------------------------------------
-- Example Newton-Bisection Hybrid
-- Root-Finding Method created by
-- <NAME> based off of NewtSafe from
-- https://www.ldeo.columbia.edu/~mspieg/e4300/BlankPDFs/Lecture06_blank.pdf
-- and rtsafe from Numerical Recipies in C p.366-367 and
-- Numerical Methods That Work by Acton p.51-52
-- www.youtube.com/OscarVeliz
-----------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Float_Text_IO; use Ada.Float_Text_IO;
with Ada.Task_Identification; use Ada.Task_Identification;
with Ada.Numerics.Generic_Elementary_Functions;
procedure NewtSafe is
---------------------
-- f(x) = x^3 - x^2 - x - 1
---------------------
function f (x: Float) return Float is
begin
return x**3 - x**2 - x - 1.0;
end;
-------------------
-- f'(x) = 3x^2 - 2x - 1
-------------------
function fp (x: Float) return Float is
begin
return 3.0*x*x - 2.0*x - 1.0;
end;
----------
-- Regular Newton's Method (unsafe)
----------
function newt (xinit: Float) return Float is
x: Float := xinit;
eps: Float := 10.0**(-6);
begin
while abs(f(x)) > eps loop
put(x,2,6,0);put_line("");
x := x - f(x) / fp(x);
end loop;
return x;
end;
-- header so forceBis can call hybrid
function hybrid (inita, initb: Float) return Float;
----------
-- Bisection between a and b then restart Hybrid
----------
function forceBis(a, b: Float) return Float is
c: Float := (a + b) / 2.0;
begin
--put_line("forced bisection");
if f(a) * f(c) < 0.0 then -- fa & fc have different signs
return hybrid(a, c);
else
return hybrid(c, b);
end if;
end;
----------
-- Newton-Bisection Hybrid, inita and initb specify interval
----------
function hybrid (inita, initb: Float) return Float is
x, fa, fb, fx, fpx, oldx, lastStep: Float;
a: Float := inita;
b: Float := initb;
eps: Float := 10.0**(-6);
begin
if(a > b) then --ensure a is on left, swap
a := initb;
b := inita;
end if;
if a = b then
return a;
end if;
-- check interval points
fa := f(a);
fb := f(b);
if fa = 0.0 then
return a;
end if;
if fb = 0.0 then
return b;
end if;
if fa * fb > 0.0 then -- invalid interval
put_line("error: interval must contain root.");
Abort_Task (Current_Task);
end if;
lastStep := b - a;
oldx := b; -- intitial oldx is on boundary
x := (a + b) / 2.0; -- start from midpoint
fx := f(x);
while abs(fx) > eps loop
put(x,2,6,0);put_line("");
fpx := fp(x);
if fpx = 0.0 then -- avoid divide by zero
return forceBis(a,b);
end if;
lastStep := abs(x - oldx);
if abs(fx * 2.0) > abs(lastStep * fpx) then -- decreasing slowly
--put_line("too slow");
return forceBis(a,b);
end if;
oldx := x;
x := x - fx / fpx;
if x = oldx then -- converged
return x;
end if;
if x <= a or else x >= b then -- avoid going outside interval
--put_line("outside interval");
return forceBis(a,b);
end if;
--shrink interval
fx := f(x);
if fx * fa < 0.0 then
b:= x;
fb:= fx;
else
a:= x;
fa:= fx;
end if;
end loop;
return x;
end;
begin --main--
put_line("Newton's Method");
put(newt(1.5),2,6,0); put_line("");
put_line("Newt-Safe");
put(hybrid(1.0,2.0),2,6,0); put_line("");
end NewtSafe;
|
30,298
|
ada
| 0
|
hgrodriguez/eeprom_i2c
|
src/eeprom_i2c.ads
|
-----------------------------------------------------------------------------
-- Base class for the implementation of EEPROM memory connected via
-- I2C bus.
--
-- Copyright 2022 (C) <NAME>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
with HAL;
with HAL.I2C;
package EEPROM_I2C is
-----------------------------------------------------------------------------
-- List of all implemented/supported chips
-- The data sheets will be added into this repository
type EEPROM_Chip is (EEC_MC24XX01, -- MicroChip 24XX01/24LC01B
EEC_MC24XX02, -- MicroChip 24XX02/24LC02B
EEC_MC24XX16 -- MicroChip 24LC16B
);
-----------------------------------------------------------------------------
-- Some EEPROMs have a so called t_WC time, which requires a break
-- between writes in batches.
-- This can be byte or page write cycles.
-- As this library should not be tied to any platform,
-- The user of the library has to provide the delay procedure
type Proc_Delay_Callback_MS is not null access procedure (MS : Integer);
-----------------------------------------------------------------------------
-- This is the EEPROM definition.
type EEPROM is interface;
type Any_EEPROM is access all EEPROM'Class;
type EEPROM_Memory (-- which chip is it
C_Type_of_Chip : EEPROM_Chip;
-- the size of addressing the EEPROM
C_Memory_Address_Size : HAL.I2C.I2C_Memory_Address_Size;
C_Size_In_Bytes : HAL.UInt32;
C_Size_In_Bits : HAL.UInt32;
C_Number_Of_Blocks : HAL.UInt16;
C_Bytes_Per_Block : HAL.UInt16;
C_Number_Of_Pages : HAL.UInt16;
C_Bytes_Per_Page : HAL.UInt16;
C_Max_Byte_Address : HAL.UInt16;
C_Write_Delay_MS : Integer;
C_Delay_Callback : Proc_Delay_Callback_MS;
-- the address of the EEPROM on the bus
I2C_Addr : HAL.I2C.I2C_Address;
-- the port where the EEPROM is connected to
I2C_Port : not null HAL.I2C.Any_I2C_Port
)
is new EEPROM with null record;
type Any_EEPROM_Memory is access all EEPROM_Memory'Class;
-----------------------------------------------------------------------------
-- EEPROM status of last operation.
type EEPROM_Status is (
-- all operations were successful
Ok,
-- returned, if the requested memory address of
-- the EEPROM is out of range:
-- Mem_Addr > Mem_Addr_Size
-- In this case, no I2C operation is started
Address_Out_Of_Range,
-- returned, if the requested data to write is
-- too big.
-- This means, that the relation:
-- Mem_Addr + Data'Size > Size_In_Bytes
Data_Too_Big,
-- Is set,
-- if anything is not OK with the I2C operation
I2C_Not_Ok
);
-----------------------------------------------------------------------------
-- Aggregation of the status of last operation.
-- Always check this, before assuming, that it worked.
type EEPROM_Operation_Result is record
E_Status : EEPROM_Status;
-- Carries the last status of the I2C operation executed
I2C_Status : HAL.I2C.I2C_Status;
end record;
-----------------------------------------------------------------------------
-- Returns the type of chip of this specific EEPROM.
function Type_of_Chip (This : in out EEPROM_Memory) return EEPROM_Chip;
-----------------------------------------------------------------------------
-- As there are different sizes for EEPROMs, this function checks
-- the memory address for being valid or out of range.
function Is_Valid_Memory_Address (This : in out EEPROM_Memory;
Mem_Addr : HAL.UInt16)
return Boolean;
-----------------------------------------------------------------------------
-- Returns the address size of this specific EEPROM.
function Mem_Addr_Size (This : in out EEPROM_Memory)
return HAL.I2C.I2C_Memory_Address_Size;
-----------------------------------------------------------------------------
-- Returns the size in bytes of this specific EEPROM.
function Size_In_Bytes (This : in out EEPROM_Memory)
return HAL.UInt32;
-----------------------------------------------------------------------------
-- Returns the size in bits of this specific EEPROM.
function Size_In_Bits (This : in out EEPROM_Memory)
return HAL.UInt32;
-----------------------------------------------------------------------------
-- Returns the number of blocks of this specific EEPROM.
function Number_Of_Blocks (This : in out EEPROM_Memory)
return HAL.UInt16;
-----------------------------------------------------------------------------
-- Returns the number of blocks of this specific EEPROM.
function Bytes_Per_Block (This : in out EEPROM_Memory)
return HAL.UInt16;
-----------------------------------------------------------------------------
-- Returns the number of pages of this specific EEPROM.
function Number_Of_Pages (This : in out EEPROM_Memory)
return HAL.UInt16;
-----------------------------------------------------------------------------
-- Returns the number of bytes per page for this specific EEPROM.
function Bytes_Per_Page (This : in out EEPROM_Memory)
return HAL.UInt16;
type EEPROM_Effective_Address is record
I2C_Address : HAL.I2C.I2C_Address;
Mem_Addr : HAL.UInt16;
end record;
-----------------------------------------------------------------------------
-- Reads from the EEPROM memory.
-- Mem_Addr : address to start the reading from
-- Data : storage to put the read data into
-- the size of this array implies the number of bytes read
-- Status : status of the operation -> see above for details
-- Timeout_MS : time out in milliseconds can be specified.
-- If the operation is not finished inside the
-- time frame given, the operation will fail.
procedure Read (This : in out EEPROM_Memory'Class;
Mem_Addr : HAL.UInt16;
Data : out HAL.I2C.I2C_Data;
Status : out EEPROM_Operation_Result;
Timeout_MS : Natural := 1000);
-----------------------------------------------------------------------------
-- Writes from the EEPROM memory.
-- Mem_Addr : address to start the writing from
-- Data : storage to pull the write data from
-- the size of this array implies the number of bytes written
-- Status : status of the operation -> see above for details
-- Timeout_MS : time out in milliseconds can be specified.
-- If the operation is not finished inside the
-- time frame given, the operation will fail.
procedure Write (This : in out EEPROM_Memory'Class;
Mem_Addr : HAL.UInt16;
Data : HAL.I2C.I2C_Data;
Status : out EEPROM_Operation_Result;
Timeout_MS : Natural := 1000);
-----------------------------------------------------------------------------
-- Wipes the EEPROM memory.
-- Status : status of the operation -> see above for details
procedure Wipe (This : in out EEPROM_Memory'Class;
Status : out EEPROM_Operation_Result);
private
-----------------------------------------------------------------------------
-- Constructs the final I2C address.
-- Some EEPROMs have not only addresses, but blocks,
-- which are encoded into the I2C address.
function Construct_I2C_Address (This : in out EEPROM_Memory'Class;
Mem_Addr : HAL.UInt16)
return EEPROM_Effective_Address;
end EEPROM_I2C;
|
30,299
|
ada
| 22
|
FardaleM/metalang
|
out/rot13.adb
|
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 rot13 is
type stringptr is access all char_array;
procedure PChar(c : in Character) is
begin
Character'Write (Text_Streams.Stream (Current_Output), c);
end;
procedure SkipSpaces is
C : Character;
Eol : Boolean;
begin
loop
Look_Ahead(C, Eol);
exit when Eol or C /= ' ';
Get(C);
end loop;
end;
--
--Ce test effectue un rot13 sur une chaine lue en entrée
--
type a is Array (Integer range <>) of Character;
type a_PTR is access a;
tmpc : Character;
tab4 : a_PTR;
strlen : Integer;
c : Integer;
begin
Get(strlen);
SkipSpaces;
tab4 := new a (0..strlen - 1);
for toto in integer range 0..strlen - 1 loop
Get(tmpc);
c := Character'Pos(tmpc);
if tmpc /= ' '
then
c := (c - Character'Pos('a') + 13) rem 26 + Character'Pos('a');
end if;
tab4(toto) := Character'Val(c);
end loop;
for j in integer range 0..strlen - 1 loop
PChar(tab4(j));
end loop;
end;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.