repo_name
stringlengths
9
74
language
stringclasses
1 value
length_bytes
int64
11
9.34M
extension
stringclasses
2 values
content
stringlengths
11
9.34M
lyarbean/xxhash-ada
Ada
2,692
adb
package body xxhash is function rotate_left (value : word; amount : natural) return word; pragma import (intrinsic, rotate_left); function shift_right (value : word; amount : natural) return word; pragma import (intrinsic, shift_right); type quat is array (1 .. 4) of word; prime : constant array (1 .. 5) of word := (2654435761, 2246822519, 3266489917, 668265263, 374761393); function xxh32 (data : bytes; seed : word) return word is r : integer := data'length / 16; -- quat groups s : integer := 0; h32 : word := 0; begin if r = 0 then h32 := seed + prime (5); else declare v : quat := (seed + prime (1) + prime (2), seed + prime (2), seed, seed - prime (1)); data_1 : array (1 .. r) of quat; for data_1'address use data (data'first .. data'first + 16 * r - 1)'address; begin for q of data_1 loop -- TODO : BSWAP (q) if BE -- Unrolled v(1) := v(1) + q(1) * prime(2); v(1) := rotate_left(v(1), 13) * prime(1); v(2) := v(2) + q(2) * prime(2); v(2) := rotate_left(v(2), 13) * prime(1); v(3) := v(3) + q(3) * prime(2); v(3) := rotate_left(v(3), 13) * prime(1); v(4) := v(4) + q(4) * prime(2); v(4) := rotate_left(v(4), 13) * prime(1); end loop; v(1) := rotate_left(v(1), 1) + rotate_left(v(2), 7); v(3) := rotate_left(v(3), 12) + rotate_left(v(4), 18); h32 := v(1) + v(3); end; end if; h32 := h32 + word(data'length); r := r * 16; s := data'length - r; if s >= 4 then s := s / 4; declare data_2 : array (1..s) of word; for data_2'address use data(r+data'first..r+data'first+s-1)'address; begin for q of data_2 loop h32 := h32 + q * prime(3); h32 := rotate_left(h32, 17) * prime(4); end loop; r := r + s * 4; end; end if; if data'length - r > 0 then r := r + data'first; for q of data(r .. data'last) loop h32 := h32 + word(q) * prime(5); h32 := rotate_left(h32,11) * prime(1); end loop; end if; h32 := h32 xor shift_right(h32,15); h32 := h32 * prime(2); h32 := h32 xor shift_right(h32,13); h32 := h32 * prime(3); h32 := h32 xor shift_right(h32,16); return h32; end xxh32; end xxhash;
zhmu/ananas
Ada
564
adb
-- { dg-do run } pragma Restrictions (No_Finalization); procedure no_final is package P is type T is tagged null record; type T1 is new T with record A : String (1..80); end record; function F return T'Class; end P; Str : String (1..80) := (1..80=>'x'); package body P is function F return T'Class is X : T1 := T1'(A => Str); begin return X; end F; end P; Obj : P.T'class := P.F; begin if P.T1 (Obj).A /= Str then raise Constraint_Error; end if; end;
reznikmm/matreshka
Ada
3,410
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package FastCGI.Handlers is pragma Pure; end FastCGI.Handlers;
reznikmm/matreshka
Ada
14,344
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.Internals.Calendars.Gregorian; package body Matreshka.Internals.Calendars.Formatting.ISO_8601 is procedure Append (Result : in out League.Strings.Universal_String; Value : Natural; Padding : Positive); ------------ -- Append -- ------------ procedure Append (Result : in out League.Strings.Universal_String; Value : Natural; Padding : Positive) is Image : constant Wide_Wide_String := Integer'Wide_Wide_Image (Value); begin for J in 1 .. Padding - Image'Length + 1 loop Result.Append ('0'); end loop; Result.Append (Image (Image'First + 1 .. Image'Last)); end Append; ---------------------------- -- Append_Abbreviated_Era -- ---------------------------- overriding procedure Append_Abbreviated_Era (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Era_Padding) is begin -- XXX Not yet implemented. null; end Append_Abbreviated_Era; ------------------------------ -- Append_Abbreviated_Month -- ------------------------------ overriding procedure Append_Abbreviated_Month (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Is_Stand_Alone : Boolean) is pragma Unreferenced (Self, Is_Stand_Alone); Index : constant Gregorian.Month_Number := Calendars.Gregorian.Month (Date); Names : constant array (Gregorian.Month_Number) of Wide_Wide_String (1 .. 3) := ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); begin -- XXX Is_Stand_Alone Not yet implemented. Output.Append (Names (Index)); end Append_Abbreviated_Month; -------------------------------- -- Append_Abbreviated_Quarter -- -------------------------------- overriding procedure Append_Abbreviated_Quarter (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Is_Stand_Alone : Boolean) is begin -- XXX Not yet implemented. null; end Append_Abbreviated_Quarter; ------------------------------- -- Append_Chinese_Leap_Month -- ------------------------------- overriding procedure Append_Chinese_Leap_Month (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number) is begin -- XXX Not yet implemented. null; end Append_Chinese_Leap_Month; ------------------------- -- Append_Day_Of_Month -- ------------------------- overriding procedure Append_Day_Of_Month (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive) is begin Append (Output, Matreshka.Internals.Calendars.Gregorian.Day (Date), Padding); end Append_Day_Of_Month; --------------------------------- -- Append_Day_Of_Week_In_Month -- --------------------------------- overriding procedure Append_Day_Of_Week_In_Month (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number) is begin -- XXX Not yet implemented. null; end Append_Day_Of_Week_In_Month; ------------------------ -- Append_Day_Of_Year -- ------------------------ overriding procedure Append_Day_Of_Year (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive) is begin -- XXX Not yet implemented. null; end Append_Day_Of_Year; -------------------------- -- Append_Extended_Year -- -------------------------- overriding procedure Append_Extended_Year (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive) is begin -- XXX Not yet implemented. null; end Append_Extended_Year; ----------------------------- -- Append_Full_Day_Of_Week -- ----------------------------- overriding procedure Append_Full_Day_Of_Week (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Is_Stand_Alone : Boolean) is begin -- XXX Not yet implemented. null; end Append_Full_Day_Of_Week; ----------------------- -- Append_Full_Month -- ----------------------- overriding procedure Append_Full_Month (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Is_Stand_Alone : Boolean) is begin -- XXX Not yet implemented. null; end Append_Full_Month; ------------------------- -- Append_Full_Quarter -- ------------------------- overriding procedure Append_Full_Quarter (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Is_Stand_Alone : Boolean) is begin -- XXX Not yet implemented. null; end Append_Full_Quarter; ----------------------- -- Append_Julian_Day -- ----------------------- overriding procedure Append_Julian_Day (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive) is begin -- XXX Not yet implemented. null; end Append_Julian_Day; --------------------- -- Append_Long_Era -- --------------------- overriding procedure Append_Long_Era (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number) is begin -- XXX Not yet implemented. null; end Append_Long_Era; ------------------------------- -- Append_Narrow_Day_Of_Week -- ------------------------------- overriding procedure Append_Narrow_Day_Of_Week (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Is_Stand_Alone : Boolean) is begin -- XXX Not yet implemented. null; end Append_Narrow_Day_Of_Week; ----------------------- -- Append_Narrow_Era -- ----------------------- overriding procedure Append_Narrow_Era (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number) is begin -- XXX Not yet implemented. null; end Append_Narrow_Era; ------------------------- -- Append_Narrow_Month -- ------------------------- overriding procedure Append_Narrow_Month (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Is_Stand_Alone : Boolean) is begin -- XXX Not yet implemented. null; end Append_Narrow_Month; ---------------------------------- -- Append_Numerical_Day_Of_Week -- ---------------------------------- overriding procedure Append_Numerical_Day_Of_Week (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive; Is_Stand_Alone : Boolean) is begin -- XXX Not yet implemented. null; end Append_Numerical_Day_Of_Week; ---------------------------- -- Append_Numerical_Month -- ---------------------------- overriding procedure Append_Numerical_Month (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive; Is_Stand_Alone : Boolean) is begin Append (Output, Matreshka.Internals.Calendars.Gregorian.Month (Date), Padding); end Append_Numerical_Month; ------------------------------ -- Append_Numerical_Quarter -- ------------------------------ overriding procedure Append_Numerical_Quarter (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive; Is_Stand_Alone : Boolean) is begin -- XXX Not yet implemented. null; end Append_Numerical_Quarter; ------------------------------ -- Append_Short_Day_Of_Week -- ------------------------------ overriding procedure Append_Short_Day_Of_Week (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive; Is_Stand_Alone : Boolean) is pragma Unreferenced (Self, Padding, Is_Stand_Alone); Index : constant Gregorian.Day_Of_Week_Number := Calendars.Gregorian.Day_Of_Week (Date); Names : constant array (Gregorian.Day_Of_Week_Number) of Wide_Wide_String (1 .. 3) := ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); begin -- XXX Is_Stand_Alone Not yet implemented. Output.Append (Names (Index)); end Append_Short_Day_Of_Week; -------------------------- -- Append_Week_Of_Month -- -------------------------- overriding procedure Append_Week_Of_Month (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number) is begin -- XXX Not yet implemented. null; end Append_Week_Of_Month; ------------------------- -- Append_Week_Of_Year -- ------------------------- overriding procedure Append_Week_Of_Year (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive) is begin -- XXX Not yet implemented. null; end Append_Week_Of_Year; ----------------- -- Append_Year -- ----------------- overriding procedure Append_Year (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive) is begin Append (Output, Matreshka.Internals.Calendars.Gregorian.Year (Date), Padding); end Append_Year; ---------------------- -- Append_Year_Week -- ---------------------- overriding procedure Append_Year_Week (Self : ISO_8601_Printer; Output : in out League.Strings.Universal_String; Date : Julian_Day_Number; Padding : Positive) is begin -- XXX Not yet implemented. null; end Append_Year_Week; end Matreshka.Internals.Calendars.Formatting.ISO_8601;
io7m/coreland-posix-ada
Ada
17,512
adb
with C_String; with Interfaces.C; package body POSIX.File is -- -- Functions to map between flag sets and discrete types. -- function Open_Access_Mode_To_Integer (Access_Mode : in Open_Access_Mode_t) return Open_Flag_Integer_t is begin return Open_Access_Mode_Map (Access_Mode); end Open_Access_Mode_To_Integer; function Open_Options_To_Integer (Options : in Open_Options_t) return Open_Flag_Integer_t is Return_Options : Open_Flag_Integer_t := 0; begin for Option in Open_Option_t range Open_Option_t'First .. Open_Option_t'Last loop --# assert Option <= Open_Option_t'Last --# and Option >= Open_Option_t'First --# and Open_Option_Map (Option) <= Open_Flag_Integer_t'Last --# and Open_Option_Map (Option) >= Open_Flag_Integer_t'First; if Options (Option) then Return_Options := Return_Options or Open_Option_Map (Option); end if; end loop; return Return_Options; end Open_Options_To_Integer; -- -- Return True if the selected access mode is valid on the current platform. -- function Check_Access_Mode (Access_Mode : in Open_Access_Mode_t) return Boolean is begin return Open_Access_Mode_Map (Access_Mode) /= Unsupported; end Check_Access_Mode; -- -- Return True if all of the selected options are valid on the current platform. -- function Check_Options (Options : in Open_Options_t) return Boolean is Supported : Boolean := True; begin for Option in Open_Option_t range Open_Option_t'First .. Open_Option_t'Last loop if Options (Option) then if Open_Option_Map (Option) = Unsupported then Supported := False; end if; end if; --# assert Option <= Open_Option_t'Last --# and Option >= Open_Option_t'First; end loop; return Supported; end Check_Options; -- -- Return False if any of the selected flags have been defined as invalid -- on the current platform. -- function Check_Support (Access_Mode : in Open_Access_Mode_t; Options : in Open_Options_t) return Boolean is begin return Check_Access_Mode (Access_Mode) and Check_Options (Options); end Check_Support; -- -- File opening/creation. -- procedure C_Open_Boundary (File_Name : in String; Flags : in Open_Flag_Integer_t; Mode : in Permissions.Mode_Integer_t; Descriptor : out Descriptor_t) --# global in Errno.Errno_Value; --# derives Descriptor from File_Name, Flags, Mode, Errno.Errno_Value; --# post ((Descriptor = -1) and (Error.Get_Error (Errno.Errno_Value) /= Error.Error_None)) or --# ((Descriptor /= -1) and (Error.Get_Error (Errno.Errno_Value) = Error.Error_None)); is --# hide C_Open_Boundary function C_Open (File_Name : in C_String.String_Not_Null_Ptr_t; Flags : in Open_Flag_Integer_t; Mode : in Permissions.Mode_Integer_t) return Descriptor_t; pragma Import (C, C_Open, "open"); begin declare C_File_Name_Buffer : aliased Interfaces.C.char_array := Interfaces.C.To_C (File_Name, Append_Nul => True); begin Descriptor := C_Open (File_Name => C_String.To_C_String (C_File_Name_Buffer'Unchecked_Access), Flags => Flags, Mode => Mode); end; exception -- Do not propagate exceptions. when Storage_Error => Error.Set_Error (Error.Error_Out_Of_Memory); Descriptor := -1; when others => Error.Set_Error (Error.Error_Unknown); Descriptor := -1; end C_Open_Boundary; procedure Open (File_Name : in String; Access_Mode : in Open_Access_Mode_t; Options : in Open_Options_t; Non_Blocking : in Boolean; Mode : in Permissions.Mode_t; Descriptor : out Descriptor_t; Error_Value : out Error.Error_t) is C_Flags : Open_Flag_Integer_t; Supported : Boolean; begin Supported := Check_Support (Access_Mode => Access_Mode, Options => Options); -- Access mode and all options supported? if Supported then C_Flags := Open_Access_Mode_To_Integer (Access_Mode) or Open_Options_To_Integer (Options); -- Reject long filename. if File_Name'Last > File_Name_t'Last then Descriptor := -1; Error_Value := Error.Error_Name_Too_Long; else -- Set flags for non-blocking. if Non_Blocking then C_Flags := C_Flags or O_NONBLOCK; end if; -- Call system open() procedure. C_Open_Boundary (File_Name => File_Name, Flags => C_Flags, Mode => Permissions.Mode_To_Integer (Mode), Descriptor => Descriptor); case Descriptor is when -1 => Error_Value := Error.Get_Error; when others => Error_Value := Error.Error_None; end case; end if; else -- Unsupported options/access mode. Error_Value := Error.Error_Invalid_Argument; Descriptor := -1; end if; end Open; procedure Open_Read_Only (File_Name : in String; Non_Blocking : in Boolean; Descriptor : out Descriptor_t; Error_Value : out Error.Error_t) is Open_Options : constant Open_Options_t := Open_Options_t'(others => False); begin Open (File_Name => File_Name, Access_Mode => Read_Only, Non_Blocking => Non_Blocking, Options => Open_Options, Mode => Permissions.None, Descriptor => Descriptor, Error_Value => Error_Value); end Open_Read_Only; procedure Open_Write_Only (File_Name : in String; Non_Blocking : in Boolean; Descriptor : out Descriptor_t; Error_Value : out Error.Error_t) is Open_Options : constant Open_Options_t := Open_Options_t'(others => False); begin Open (File_Name => File_Name, Access_Mode => Write_Only, Non_Blocking => Non_Blocking, Options => Open_Options, Mode => Permissions.None, Descriptor => Descriptor, Error_Value => Error_Value); end Open_Write_Only; procedure Open_Exclusive (File_Name : in String; Non_Blocking : in Boolean; Mode : in Permissions.Mode_t; Descriptor : out Descriptor_t; Error_Value : out Error.Error_t) is Open_Options : constant Open_Options_t := Open_Options_t'(Create => True, Exclusive => True, others => False); begin Open (File_Name => File_Name, Access_Mode => Write_Only, Non_Blocking => Non_Blocking, Options => Open_Options, Mode => Mode, Descriptor => Descriptor, Error_Value => Error_Value); end Open_Exclusive; procedure Open_Append (File_Name : in String; Non_Blocking : in Boolean; Descriptor : out Descriptor_t; Error_Value : out Error.Error_t) is Open_Options : constant Open_Options_t := Open_Options_t'(Append => True, Create => True, others => False); begin Open (File_Name => File_Name, Access_Mode => Write_Only, Non_Blocking => Non_Blocking, Options => Open_Options, Mode => Permissions.None, Descriptor => Descriptor, Error_Value => Error_Value); end Open_Append; procedure Open_Truncate (File_Name : in String; Non_Blocking : in Boolean; Mode : in Permissions.Mode_t; Descriptor : out Descriptor_t; Error_Value : out Error.Error_t) is Open_Options : constant Open_Options_t := Open_Options_t'(Create => True, Truncate => True, others => False); begin Open (File_Name => File_Name, Access_Mode => Write_Only, Non_Blocking => Non_Blocking, Options => Open_Options, Mode => Mode, Descriptor => Descriptor, Error_Value => Error_Value); end Open_Truncate; procedure Open_Read_Write (File_Name : in String; Non_Blocking : in Boolean; Descriptor : out Descriptor_t; Error_Value : out Error.Error_t) is Open_Options : constant Open_Options_t := Open_Options_t'(others => False); begin Open (File_Name => File_Name, Access_Mode => Read_Write, Non_Blocking => Non_Blocking, Options => Open_Options, Mode => Permissions.None, Descriptor => Descriptor, Error_Value => Error_Value); end Open_Read_Write; procedure Open_Create (File_Name : in String; Non_Blocking : in Boolean; Mode : in Permissions.Mode_t; Descriptor : out Descriptor_t; Error_Value : out Error.Error_t) is Open_Options : constant Open_Options_t := Open_Options_t'(Create => True, others => False); begin Open (File_Name => File_Name, Access_Mode => Write_Only, Non_Blocking => Non_Blocking, Options => Open_Options, Mode => Mode, Descriptor => Descriptor, Error_Value => Error_Value); end Open_Create; -- -- File permissions. -- procedure Change_Descriptor_Mode (Descriptor : in Valid_Descriptor_t; Mode : in Permissions.Mode_t; Error_Value : out Error.Error_t) is Return_Value : Error.Return_Value_t; function C_fchmod (Descriptor : in Valid_Descriptor_t; Mode : in Permissions.Mode_t) return Error.Return_Value_t; pragma Import (C, C_fchmod, "fchmod"); begin Return_Value := C_fchmod (Descriptor => Descriptor, Mode => Mode); case Return_Value is when -1 => Error_Value := Error.Get_Error; when 0 => Error_Value := Error.Error_None; end case; end Change_Descriptor_Mode; procedure Change_Mode (File_Name : in String; Mode : in Permissions.Mode_t; Error_Value : out Error.Error_t) is Descriptor : Descriptor_t; begin Open_Read_Only (File_Name => File_Name, Non_Blocking => False, Descriptor => Descriptor, Error_Value => Error_Value); if Error_Value = Error.Error_None then Change_Descriptor_Mode (Descriptor => Descriptor, Mode => Mode, Error_Value => Error_Value); end if; end Change_Mode; -- -- File ownership. -- procedure Change_Descriptor_Ownership (Descriptor : in Valid_Descriptor_t; Owner : in User_DB.User_ID_t; Group : in User_DB.Group_ID_t; Error_Value : out Error.Error_t) is Return_Value : Error.Return_Value_t; function C_fchown (Descriptor : in Valid_Descriptor_t; Owner : in User_DB.User_ID_t; Group : in User_DB.Group_ID_t) return Error.Return_Value_t; pragma Import (C, C_fchown, "fchown"); begin Return_Value := C_fchown (Descriptor => Descriptor, Owner => Owner, Group => Group); case Return_Value is when -1 => Error_Value := Error.Get_Error; when 0 => Error_Value := Error.Error_None; end case; end Change_Descriptor_Ownership; procedure Change_Ownership (File_Name : in String; Owner : in User_DB.User_ID_t; Group : in User_DB.Group_ID_t; Error_Value : out Error.Error_t) is Descriptor : Descriptor_t; begin Open_Read_Only (File_Name => File_Name, Non_Blocking => False, Descriptor => Descriptor, Error_Value => Error_Value); if Error_Value = Error.Error_None then Change_Descriptor_Ownership (Descriptor => Descriptor, Owner => Owner, Group => Group, Error_Value => Error_Value); end if; end Change_Ownership; -- -- File removal. -- function Unlink_Boundary (File_Name : in String) return Error.Return_Value_t is --# hide Unlink_Boundary function C_Unlink (File_Name : in C_String.String_Not_Null_Ptr_t) return Error.Return_Value_t; pragma Import (C, C_Unlink, "unlink"); begin declare C_File_Name_Buffer : aliased Interfaces.C.char_array := Interfaces.C.To_C (File_Name, Append_Nul => True); begin return C_Unlink (C_String.To_C_String (C_File_Name_Buffer'Unchecked_Access)); end; exception -- Do not propagate exceptions. when Storage_Error => Error.Set_Error (Error.Error_Out_Of_Memory); return -1; when others => Error.Set_Error (Error.Error_Unknown); return -1; end Unlink_Boundary; procedure Unlink (File_Name : in String; Error_Value : out Error.Error_t) is begin case Unlink_Boundary (File_Name) is when 0 => Error_Value := Error.Error_None; when -1 => Error_Value := Error.Get_Error; end case; end Unlink; -- -- File closing. -- procedure Close (Descriptor : in Valid_Descriptor_t; Error_Value : out Error.Error_t) is function C_Close (Descriptor : in Valid_Descriptor_t) return Error.Return_Value_t; pragma Import (C, C_Close, "close"); begin case C_Close (Descriptor) is when 0 => Error_Value := Error.Error_None; when -1 => Error_Value := Error.Get_Error; end case; end Close; -- -- File seeking. -- function C_Seek (Descriptor : in Valid_Descriptor_t; Offset : in Offset_t; Whence : in Seek_Whence_t) return Offset_t; pragma Import (C, C_Seek, "lseek"); procedure Seek_Relative (Descriptor : in Valid_Descriptor_t; Offset : in Offset_t; Error_Value : out Error.Error_t) is Result_Value : Offset_t; begin Result_Value := C_Seek (Descriptor => Descriptor, Offset => Offset, Whence => Seek_Cur); if Result_Value = -1 then Error_Value := Error.Get_Error; else Error_Value := Error.Error_None; end if; end Seek_Relative; procedure Seek_Absolute (Descriptor : in Valid_Descriptor_t; Offset : in Offset_t; Error_Value : out Error.Error_t) is Result_Value : Offset_t; begin Result_Value := C_Seek (Descriptor => Descriptor, Offset => Offset, Whence => Seek_Set); if Result_Value = -1 then Error_Value := Error.Get_Error; else Error_Value := Error.Error_None; end if; end Seek_Absolute; procedure Seek_To_Start (Descriptor : in Valid_Descriptor_t; Offset : in Offset_t; Error_Value : out Error.Error_t) is Result_Value : Offset_t; begin Result_Value := C_Seek (Descriptor => Descriptor, Offset => Offset, Whence => Seek_Set); if Result_Value = -1 then Error_Value := Error.Get_Error; else Error_Value := Error.Error_None; end if; end Seek_To_Start; procedure Seek_To_End (Descriptor : in Valid_Descriptor_t; Offset : in Offset_t; Error_Value : out Error.Error_t) is Result_Value : Offset_t; begin Result_Value := C_Seek (Descriptor => Descriptor, Offset => Offset, Whence => Seek_End); if Result_Value = -1 then Error_Value := Error.Get_Error; else Error_Value := Error.Error_None; end if; end Seek_To_End; -- -- Renaming. -- procedure Rename_Boundary (Old_Name : in String; New_Name : in String; Return_Value : out Error.Return_Value_t) --# global in Errno.Errno_Value; --# derives Return_Value from Old_Name, New_Name, Errno.Errno_Value; --# post ((Return_Value = -1) -> (Error.Get_Error (Errno.Errno_Value) /= Error.Error_None)) --# or ((Return_Value = 0) -> (Error.Get_Error (Errno.Errno_Value) = Error.Error_None)); is --# hide Rename_Boundary C_Old_Name : aliased Interfaces.C.char_array := Interfaces.C.To_C (Old_Name); C_New_Name : aliased Interfaces.C.char_array := Interfaces.C.To_C (New_Name); function C_Rename (Old_Name : in C_String.String_Not_Null_Ptr_t; New_Name : in C_String.String_Not_Null_Ptr_t) return Error.Return_Value_t; pragma Import (C, C_Rename, "rename"); begin Return_Value := C_Rename (Old_Name => C_String.To_C_String (C_Old_Name'Unchecked_Access), New_Name => C_String.To_C_String (C_New_Name'Unchecked_Access)); exception -- Do not propagate exceptions. when Storage_Error => Error.Set_Error (Error.Error_Out_Of_Memory); Return_Value := -1; when others => Error.Set_Error (Error.Error_Unknown); Return_Value := -1; end Rename_Boundary; procedure Rename (Old_Name : in String; New_Name : in String; Error_Value : out Error.Error_t) is Return_Value : Error.Return_Value_t; begin Rename_Boundary (Old_Name => Old_Name, New_Name => New_Name, Return_Value => Return_Value); case Return_Value is when -1 => Error_Value := Error.Get_Error; when 0 => Error_Value := Error.Error_None; end case; end Rename; end POSIX.File;
jwarwick/aoc_2020
Ada
3,305
adb
-- AoC 2020, Day 13 with Ada.Text_IO; with GNAT.String_Split; use GNAT; package body Day is package TIO renames Ada.Text_IO; function load_file(filename : in String) return Schedule is file : TIO.File_Type; earliest : Long_Long_Integer; departs : Depart_Vectors.Vector := Empty_Vector; offsets : Depart_Vectors.Vector := Empty_Vector; subs : String_Split.Slice_Set; seps : constant String := ","; begin TIO.open(File => file, Mode => TIO.In_File, Name => filename); earliest := Long_Long_Integer'Value(TIO.get_line(file)); String_Split.Create (S => subs, From => TIO.get_line(file), Separators => seps, Mode => String_Split.Multiple); TIO.close(file); for i in 1 .. String_Split.Slice_Count(subs) loop declare sub : constant String := String_Split.Slice(subs, i); begin if sub /= "x" then departs.append(Long_Long_Integer'Value(sub)); offsets.append(Long_Long_Integer(i) - 1); end if; end; end loop; return Schedule'(earliest => earliest, departures => departs, offsets => offsets); end load_file; function bus_mult(s : in Schedule) return Long_Long_Integer is offset : Long_Long_Integer := 0; begin loop declare leave : constant Long_Long_Integer := s.earliest + offset; begin for d of s.departures loop if (leave mod d) = 0 then return offset * d; end if; end loop; offset := offset + 1; end; end loop; end bus_mult; function earliest_matching_iterative(s : in Schedule) return Long_Long_Integer is t : Long_Long_Integer := 1; begin main_loop: loop declare match : Boolean := true; base : constant Long_Long_Integer := Long_Long_Integer(s.departures.first_element) * t; begin for i in s.departures.first_index+1 .. s.departures.last_index loop declare long_offset : constant Long_Long_Integer := s.offsets(i); long_depart : constant Long_Long_Integer := s.departures(i); offset : constant Long_Long_Integer := base + long_offset; begin if (offset mod long_depart) /= 0 then match := false; exit; end if; end; end loop; if match then return base; end if; t := t+1; end; end loop main_loop; end earliest_matching_iterative; function bus_intersect(start : in Long_Long_Integer; step : in Long_Long_Integer; bus : in Long_Long_Integer; offset : in Long_Long_Integer) return Long_Long_Integer is t : Long_Long_Integer := start; offset_t : Long_Long_Integer; begin loop offset_t := t + offset; if offset_t mod bus = 0 then exit; end if; t := t + step; end loop; return t; end bus_intersect; function earliest_matching(s : in Schedule) return Long_Long_Integer is t : Long_Long_Integer := 0; step : Long_Long_Integer := s.departures.first_element; begin for i in s.departures.first_index+1 .. s.departures.last_index loop t := bus_intersect(t, step, s.departures(i), s.offsets(i)); step := step * s.departures(i); end loop; return t; end earliest_matching; end Day;
MinimSecure/unum-sdk
Ada
853
adb
-- Copyright 2015-2016 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Bar is function F (R : out Rec_Type) return Enum_Type is begin R.Cur := 0; return A; end F; end Bar;
reznikmm/matreshka
Ada
5,588
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2017, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with League.Strings; with League.String_Vectors; package WebDriver.Elements is type Element is limited interface; type Element_Access is access all Element'Class with Storage_Size => 0; not overriding function Is_Selected (Self : access Element) return Boolean is abstract; -- Determines if the referenced element is selected or not. not overriding function Is_Enabled (Self : access Element) return Boolean is abstract; -- Determines if the referenced element is enabled or not. not overriding function Get_Attribute (Self : access Element; Name : League.Strings.Universal_String) return League.Strings.Universal_String is abstract; -- Returns the attribute of a web element. not overriding function Get_Property (Self : access Element; Name : League.Strings.Universal_String) return League.Strings.Universal_String is abstract; -- Returns the result of getting a property of an element. not overriding function Get_CSS_Value (Self : access Element; Name : League.Strings.Universal_String) return League.Strings.Universal_String is abstract; -- Retrieves the computed value of the given CSS property of the given -- web element. not overriding function Get_Text (Self : access Element) return League.Strings.Universal_String is abstract; -- Returns an element’s text "as rendered". not overriding function Get_Tag_Name (Self : access Element) return League.Strings.Universal_String is abstract; -- Returns the qualified element name of the given web element. not overriding procedure Click (Self : access Element) is abstract; -- Scrolls into view the element if it is not already pointer-interactable, -- and clicks its in-view center point. not overriding procedure Clear (Self : access Element) is abstract; -- Scrolls into view an editable or resettable element and then attempts -- to clear its selected files or text content. not overriding procedure Send_Keys (Self : access Element; Text : League.String_Vectors.Universal_String_Vector) is abstract; -- Scrolls into view the form control element and then sends the provided -- keys to the element. procedure Send_Keys (Self : access Element'Class; Text : League.Strings.Universal_String); end WebDriver.Elements;
reznikmm/matreshka
Ada
64,536
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-2017, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with Matreshka.Internals.Strings; package AMF.Internals.Tables.DC_String_Data_00 is -- "http://www.w3.org/2001/XMLSchema#integer" MS_0000 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 47, Unused => 40, Length => 40, Value => (16#0068#, 16#0074#, 16#0074#, 16#0070#, 16#003A#, 16#002F#, 16#002F#, 16#0077#, 16#0077#, 16#0077#, 16#002E#, 16#0077#, 16#0033#, 16#002E#, 16#006F#, 16#0072#, 16#0067#, 16#002F#, 16#0032#, 16#0030#, 16#0030#, 16#0031#, 16#002F#, 16#0058#, 16#004D#, 16#004C#, 16#0053#, 16#0063#, 16#0068#, 16#0065#, 16#006D#, 16#0061#, 16#0023#, 16#0069#, 16#006E#, 16#0074#, 16#0065#, 16#0067#, 16#0065#, 16#0072#, others => 16#0000#), others => <>); -- "Boolean is a primitive data type having one of two values: <i>true</i> or <i>false</i>, intended to represent the truth value of logical expressions." MS_0001 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 159, Unused => 149, Length => 149, Value => (16#0042#, 16#006F#, 16#006F#, 16#006C#, 16#0065#, 16#0061#, 16#006E#, 16#0020#, 16#0069#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#0070#, 16#0072#, 16#0069#, 16#006D#, 16#0069#, 16#0074#, 16#0069#, 16#0076#, 16#0065#, 16#0020#, 16#0064#, 16#0061#, 16#0074#, 16#0061#, 16#0020#, 16#0074#, 16#0079#, 16#0070#, 16#0065#, 16#0020#, 16#0068#, 16#0061#, 16#0076#, 16#0069#, 16#006E#, 16#0067#, 16#0020#, 16#006F#, 16#006E#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0077#, 16#006F#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0073#, 16#003A#, 16#0020#, 16#003C#, 16#0069#, 16#003E#, 16#0074#, 16#0072#, 16#0075#, 16#0065#, 16#003C#, 16#002F#, 16#0069#, 16#003E#, 16#0020#, 16#006F#, 16#0072#, 16#0020#, 16#003C#, 16#0069#, 16#003E#, 16#0066#, 16#0061#, 16#006C#, 16#0073#, 16#0065#, 16#003C#, 16#002F#, 16#0069#, 16#003E#, 16#002C#, 16#0020#, 16#0069#, 16#006E#, 16#0074#, 16#0065#, 16#006E#, 16#0064#, 16#0065#, 16#0064#, 16#0020#, 16#0074#, 16#006F#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0074#, 16#0072#, 16#0075#, 16#0074#, 16#0068#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#006C#, 16#006F#, 16#0067#, 16#0069#, 16#0063#, 16#0061#, 16#006C#, 16#0020#, 16#0065#, 16#0078#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0073#, 16#0069#, 16#006F#, 16#006E#, 16#0073#, 16#002E#, others => 16#0000#), others => <>); -- "y" MS_0002 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 1, Length => 1, Value => (16#0079#, others => 16#0000#), others => <>); -- "Real" MS_0003 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 4, Length => 4, Value => (16#0052#, 16#0065#, 16#0061#, 16#006C#, others => 16#0000#), others => <>); -- "yellow" MS_0004 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#0079#, 16#0065#, 16#006C#, 16#006C#, 16#006F#, 16#0077#, others => 16#0000#), others => <>); -- "a color with a value of #008000" MS_0005 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0030#, 16#0030#, 16#0038#, 16#0030#, 16#0030#, 16#0030#, others => 16#0000#), others => <>); -- "start" MS_0006 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#0073#, 16#0074#, 16#0061#, 16#0072#, 16#0074#, others => 16#0000#), others => <>); -- "olive" MS_0007 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#006F#, 16#006C#, 16#0069#, 16#0076#, 16#0065#, others => 16#0000#), others => <>); -- "0" MS_0008 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 1, Length => 1, Value => (16#0030#, others => 16#0000#), others => <>); -- "a color with a value of #008080" MS_0009 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0030#, 16#0030#, 16#0038#, 16#0030#, 16#0038#, 16#0030#, others => 16#0000#), others => <>); -- "a color with a value of #00FFFF" MS_000A : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0030#, 16#0030#, 16#0046#, 16#0046#, 16#0046#, 16#0046#, others => 16#0000#), others => <>); -- "Integer is a primitive data type used to represent the mathematical concept of integer." MS_000B : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 95, Unused => 87, Length => 87, Value => (16#0049#, 16#006E#, 16#0074#, 16#0065#, 16#0067#, 16#0065#, 16#0072#, 16#0020#, 16#0069#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#0070#, 16#0072#, 16#0069#, 16#006D#, 16#0069#, 16#0074#, 16#0069#, 16#0076#, 16#0065#, 16#0020#, 16#0064#, 16#0061#, 16#0074#, 16#0061#, 16#0020#, 16#0074#, 16#0079#, 16#0070#, 16#0065#, 16#0020#, 16#0075#, 16#0073#, 16#0065#, 16#0064#, 16#0020#, 16#0074#, 16#006F#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#006D#, 16#0061#, 16#0074#, 16#0068#, 16#0065#, 16#006D#, 16#0061#, 16#0074#, 16#0069#, 16#0063#, 16#0061#, 16#006C#, 16#0020#, 16#0063#, 16#006F#, 16#006E#, 16#0063#, 16#0065#, 16#0070#, 16#0074#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0069#, 16#006E#, 16#0074#, 16#0065#, 16#0067#, 16#0065#, 16#0072#, 16#002E#, others => 16#0000#), others => <>); -- "valid_rgb" MS_000C : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 9, Length => 9, Value => (16#0076#, 16#0061#, 16#006C#, 16#0069#, 16#0064#, 16#005F#, 16#0072#, 16#0067#, 16#0062#, others => 16#0000#), others => <>); -- "String" MS_000D : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#0053#, 16#0074#, 16#0072#, 16#0069#, 16#006E#, 16#0067#, others => 16#0000#), others => <>); -- "navy" MS_000E : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 4, Length => 4, Value => (16#006E#, 16#0061#, 16#0076#, 16#0079#, others => 16#0000#), others => <>); -- "a color with a value of #800080" MS_000F : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0038#, 16#0030#, 16#0030#, 16#0030#, 16#0038#, 16#0030#, others => 16#0000#), others => <>); -- "a real number (>=0) that represents the height of the bounds" MS_0010 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 63, Unused => 60, Length => 60, Value => (16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#006E#, 16#0075#, 16#006D#, 16#0062#, 16#0065#, 16#0072#, 16#0020#, 16#0028#, 16#003E#, 16#003D#, 16#0030#, 16#0029#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0068#, 16#0065#, 16#0069#, 16#0067#, 16#0068#, 16#0074#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0062#, 16#006F#, 16#0075#, 16#006E#, 16#0064#, 16#0073#, others => 16#0000#), others => <>); -- "Point" MS_0011 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#0050#, 16#006F#, 16#0069#, 16#006E#, 16#0074#, others => 16#0000#), others => <>); -- "teal" MS_0012 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 4, Length => 4, Value => (16#0074#, 16#0065#, 16#0061#, 16#006C#, others => 16#0000#), others => <>); -- "the width and height of a dimension cannot be negative" MS_0013 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 55, Unused => 54, Length => 54, Value => (16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0077#, 16#0069#, 16#0064#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0068#, 16#0065#, 16#0069#, 16#0067#, 16#0068#, 16#0074#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0061#, 16#0020#, 16#0064#, 16#0069#, 16#006D#, 16#0065#, 16#006E#, 16#0073#, 16#0069#, 16#006F#, 16#006E#, 16#0020#, 16#0063#, 16#0061#, 16#006E#, 16#006E#, 16#006F#, 16#0074#, 16#0020#, 16#0062#, 16#0065#, 16#0020#, 16#006E#, 16#0065#, 16#0067#, 16#0061#, 16#0074#, 16#0069#, 16#0076#, 16#0065#, others => 16#0000#), others => <>); -- "aqua" MS_0014 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 4, Length => 4, Value => (16#0061#, 16#0071#, 16#0075#, 16#0061#, others => 16#0000#), others => <>); -- "Integer" MS_0015 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 7, Length => 7, Value => (16#0049#, 16#006E#, 16#0074#, 16#0065#, 16#0067#, 16#0065#, 16#0072#, others => 16#0000#), others => <>); -- "fuchsia" MS_0016 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 7, Length => 7, Value => (16#0066#, 16#0075#, 16#0063#, 16#0068#, 16#0073#, 16#0069#, 16#0061#, others => 16#0000#), others => <>); -- "lime" MS_0017 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 4, Length => 4, Value => (16#006C#, 16#0069#, 16#006D#, 16#0065#, others => 16#0000#), others => <>); -- "a color with a value of #C0C0C0" MS_0018 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0043#, 16#0030#, 16#0043#, 16#0030#, 16#0043#, 16#0030#, others => 16#0000#), others => <>); -- "orange" MS_0019 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#006F#, 16#0072#, 16#0061#, 16#006E#, 16#0067#, 16#0065#, others => 16#0000#), others => <>); -- "KnownColor" MS_001A : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 10, Length => 10, Value => (16#004B#, 16#006E#, 16#006F#, 16#0077#, 16#006E#, 16#0043#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, others => 16#0000#), others => <>); -- "org.omg.xmi.nsPrefix" MS_001B : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 23, Unused => 20, Length => 20, Value => (16#006F#, 16#0072#, 16#0067#, 16#002E#, 16#006F#, 16#006D#, 16#0067#, 16#002E#, 16#0078#, 16#006D#, 16#0069#, 16#002E#, 16#006E#, 16#0073#, 16#0050#, 16#0072#, 16#0065#, 16#0066#, 16#0069#, 16#0078#, others => 16#0000#), others => <>); -- "a color with a value of #000000" MS_001C : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0030#, 16#0030#, 16#0030#, 16#0030#, 16#0030#, 16#0030#, others => 16#0000#), others => <>); -- "a color with a value of #FFFFFF" MS_001D : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0046#, 16#0046#, 16#0046#, 16#0046#, 16#0046#, 16#0046#, others => 16#0000#), others => <>); -- "A Point specifies an location in some x-y coordinate system." MS_001E : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 63, Unused => 60, Length => 60, Value => (16#0041#, 16#0020#, 16#0050#, 16#006F#, 16#0069#, 16#006E#, 16#0074#, 16#0020#, 16#0073#, 16#0070#, 16#0065#, 16#0063#, 16#0069#, 16#0066#, 16#0069#, 16#0065#, 16#0073#, 16#0020#, 16#0061#, 16#006E#, 16#0020#, 16#006C#, 16#006F#, 16#0063#, 16#0061#, 16#0074#, 16#0069#, 16#006F#, 16#006E#, 16#0020#, 16#0069#, 16#006E#, 16#0020#, 16#0073#, 16#006F#, 16#006D#, 16#0065#, 16#0020#, 16#0078#, 16#002D#, 16#0079#, 16#0020#, 16#0063#, 16#006F#, 16#006F#, 16#0072#, 16#0064#, 16#0069#, 16#006E#, 16#0061#, 16#0074#, 16#0065#, 16#0020#, 16#0073#, 16#0079#, 16#0073#, 16#0074#, 16#0065#, 16#006D#, 16#002E#, others => 16#0000#), others => <>); -- "a color with a value of #808000" MS_001F : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0038#, 16#0030#, 16#0038#, 16#0030#, 16#0030#, 16#0030#, others => 16#0000#), others => <>); -- "a real number (<= 0 or >= 0) that represents the x-coordinate of the point." MS_0020 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 79, Unused => 75, Length => 75, Value => (16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#006E#, 16#0075#, 16#006D#, 16#0062#, 16#0065#, 16#0072#, 16#0020#, 16#0028#, 16#003C#, 16#003D#, 16#0020#, 16#0030#, 16#0020#, 16#006F#, 16#0072#, 16#0020#, 16#003E#, 16#003D#, 16#0020#, 16#0030#, 16#0029#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0078#, 16#002D#, 16#0063#, 16#006F#, 16#006F#, 16#0072#, 16#0064#, 16#0069#, 16#006E#, 16#0061#, 16#0074#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0070#, 16#006F#, 16#0069#, 16#006E#, 16#0074#, 16#002E#, others => 16#0000#), others => <>); -- "a real number (>=0 or <=0) that represents the x-coordinate of the bounds" MS_0021 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 79, Unused => 73, Length => 73, Value => (16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#006E#, 16#0075#, 16#006D#, 16#0062#, 16#0065#, 16#0072#, 16#0020#, 16#0028#, 16#003E#, 16#003D#, 16#0030#, 16#0020#, 16#006F#, 16#0072#, 16#0020#, 16#003C#, 16#003D#, 16#0030#, 16#0029#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0078#, 16#002D#, 16#0063#, 16#006F#, 16#006F#, 16#0072#, 16#0064#, 16#0069#, 16#006E#, 16#0061#, 16#0074#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0062#, 16#006F#, 16#0075#, 16#006E#, 16#0064#, 16#0073#, others => 16#0000#), others => <>); -- "an alignment to the center of a given length" MS_0022 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 47, Unused => 44, Length => 44, Value => (16#0061#, 16#006E#, 16#0020#, 16#0061#, 16#006C#, 16#0069#, 16#0067#, 16#006E#, 16#006D#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#0074#, 16#006F#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0063#, 16#0065#, 16#006E#, 16#0074#, 16#0065#, 16#0072#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0061#, 16#0020#, 16#0067#, 16#0069#, 16#0076#, 16#0065#, 16#006E#, 16#0020#, 16#006C#, 16#0065#, 16#006E#, 16#0067#, 16#0074#, 16#0068#, others => 16#0000#), others => <>); -- "the width and height of bounds cannot be negative" MS_0023 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 55, Unused => 49, Length => 49, Value => (16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0077#, 16#0069#, 16#0064#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0068#, 16#0065#, 16#0069#, 16#0067#, 16#0068#, 16#0074#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0062#, 16#006F#, 16#0075#, 16#006E#, 16#0064#, 16#0073#, 16#0020#, 16#0063#, 16#0061#, 16#006E#, 16#006E#, 16#006F#, 16#0074#, 16#0020#, 16#0062#, 16#0065#, 16#0020#, 16#006E#, 16#0065#, 16#0067#, 16#0061#, 16#0074#, 16#0069#, 16#0076#, 16#0065#, others => 16#0000#), others => <>); -- "KnownColor is an enumeration of 17 known colors." MS_0024 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 55, Unused => 48, Length => 48, Value => (16#004B#, 16#006E#, 16#006F#, 16#0077#, 16#006E#, 16#0043#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0069#, 16#0073#, 16#0020#, 16#0061#, 16#006E#, 16#0020#, 16#0065#, 16#006E#, 16#0075#, 16#006D#, 16#0065#, 16#0072#, 16#0061#, 16#0074#, 16#0069#, 16#006F#, 16#006E#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0031#, 16#0037#, 16#0020#, 16#006B#, 16#006E#, 16#006F#, 16#0077#, 16#006E#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0073#, 16#002E#, others => 16#0000#), others => <>); -- "silver" MS_0025 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#0073#, 16#0069#, 16#006C#, 16#0076#, 16#0065#, 16#0072#, others => 16#0000#), others => <>); -- "http://www.w3.org/2001/XMLSchema#boolean" MS_0026 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 47, Unused => 40, Length => 40, Value => (16#0068#, 16#0074#, 16#0074#, 16#0070#, 16#003A#, 16#002F#, 16#002F#, 16#0077#, 16#0077#, 16#0077#, 16#002E#, 16#0077#, 16#0033#, 16#002E#, 16#006F#, 16#0072#, 16#0067#, 16#002F#, 16#0032#, 16#0030#, 16#0030#, 16#0031#, 16#002F#, 16#0058#, 16#004D#, 16#004C#, 16#0053#, 16#0063#, 16#0068#, 16#0065#, 16#006D#, 16#0061#, 16#0023#, 16#0062#, 16#006F#, 16#006F#, 16#006C#, 16#0065#, 16#0061#, 16#006E#, others => 16#0000#), others => <>); -- "org.omg.xmi.schemaType" MS_0027 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 23, Unused => 22, Length => 22, Value => (16#006F#, 16#0072#, 16#0067#, 16#002E#, 16#006F#, 16#006D#, 16#0067#, 16#002E#, 16#0078#, 16#006D#, 16#0069#, 16#002E#, 16#0073#, 16#0063#, 16#0068#, 16#0065#, 16#006D#, 16#0061#, 16#0054#, 16#0079#, 16#0070#, 16#0065#, others => 16#0000#), others => <>); -- "an alignment to the end of a given length" MS_0028 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 47, Unused => 41, Length => 41, Value => (16#0061#, 16#006E#, 16#0020#, 16#0061#, 16#006C#, 16#0069#, 16#0067#, 16#006E#, 16#006D#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#0074#, 16#006F#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0065#, 16#006E#, 16#0064#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0061#, 16#0020#, 16#0067#, 16#0069#, 16#0076#, 16#0065#, 16#006E#, 16#0020#, 16#006C#, 16#0065#, 16#006E#, 16#0067#, 16#0074#, 16#0068#, others => 16#0000#), others => <>); -- "a real number (>=0) that represents a length along the y-axis." MS_0029 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 63, Unused => 62, Length => 62, Value => (16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#006E#, 16#0075#, 16#006D#, 16#0062#, 16#0065#, 16#0072#, 16#0020#, 16#0028#, 16#003E#, 16#003D#, 16#0030#, 16#0029#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#006C#, 16#0065#, 16#006E#, 16#0067#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#006C#, 16#006F#, 16#006E#, 16#0067#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0079#, 16#002D#, 16#0061#, 16#0078#, 16#0069#, 16#0073#, 16#002E#, others => 16#0000#), others => <>); -- "The Diagram Common (DC) package contains abstractions shared by the Diagram Interchange and the Diagram Graphics packages." MS_002A : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 127, Unused => 122, Length => 122, Value => (16#0054#, 16#0068#, 16#0065#, 16#0020#, 16#0044#, 16#0069#, 16#0061#, 16#0067#, 16#0072#, 16#0061#, 16#006D#, 16#0020#, 16#0043#, 16#006F#, 16#006D#, 16#006D#, 16#006F#, 16#006E#, 16#0020#, 16#0028#, 16#0044#, 16#0043#, 16#0029#, 16#0020#, 16#0070#, 16#0061#, 16#0063#, 16#006B#, 16#0061#, 16#0067#, 16#0065#, 16#0020#, 16#0063#, 16#006F#, 16#006E#, 16#0074#, 16#0061#, 16#0069#, 16#006E#, 16#0073#, 16#0020#, 16#0061#, 16#0062#, 16#0073#, 16#0074#, 16#0072#, 16#0061#, 16#0063#, 16#0074#, 16#0069#, 16#006F#, 16#006E#, 16#0073#, 16#0020#, 16#0073#, 16#0068#, 16#0061#, 16#0072#, 16#0065#, 16#0064#, 16#0020#, 16#0062#, 16#0079#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0044#, 16#0069#, 16#0061#, 16#0067#, 16#0072#, 16#0061#, 16#006D#, 16#0020#, 16#0049#, 16#006E#, 16#0074#, 16#0065#, 16#0072#, 16#0063#, 16#0068#, 16#0061#, 16#006E#, 16#0067#, 16#0065#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0044#, 16#0069#, 16#0061#, 16#0067#, 16#0072#, 16#0061#, 16#006D#, 16#0020#, 16#0047#, 16#0072#, 16#0061#, 16#0070#, 16#0068#, 16#0069#, 16#0063#, 16#0073#, 16#0020#, 16#0070#, 16#0061#, 16#0063#, 16#006B#, 16#0061#, 16#0067#, 16#0065#, 16#0073#, 16#002E#, others => 16#0000#), others => <>); -- "center" MS_002B : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#0063#, 16#0065#, 16#006E#, 16#0074#, 16#0065#, 16#0072#, others => 16#0000#), others => <>); -- "blue" MS_002C : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 4, Length => 4, Value => (16#0062#, 16#006C#, 16#0075#, 16#0065#, others => 16#0000#), others => <>); -- "a color with a value of #800000" MS_002D : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0038#, 16#0030#, 16#0030#, 16#0030#, 16#0030#, 16#0030#, others => 16#0000#), others => <>); -- "green" MS_002E : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#0067#, 16#0072#, 16#0065#, 16#0065#, 16#006E#, others => 16#0000#), others => <>); -- "red" MS_002F : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 3, Length => 3, Value => (16#0072#, 16#0065#, 16#0064#, others => 16#0000#), others => <>); -- "a color with a value of #FF0000" MS_0030 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0046#, 16#0046#, 16#0030#, 16#0030#, 16#0030#, 16#0030#, others => 16#0000#), others => <>); -- "an alignment to the start of a given length." MS_0031 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 47, Unused => 44, Length => 44, Value => (16#0061#, 16#006E#, 16#0020#, 16#0061#, 16#006C#, 16#0069#, 16#0067#, 16#006E#, 16#006D#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#0074#, 16#006F#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0073#, 16#0074#, 16#0061#, 16#0072#, 16#0074#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0061#, 16#0020#, 16#0067#, 16#0069#, 16#0076#, 16#0065#, 16#006E#, 16#0020#, 16#006C#, 16#0065#, 16#006E#, 16#0067#, 16#0074#, 16#0068#, 16#002E#, others => 16#0000#), others => <>); -- "a real number (>=0) that represents the width of the bounds" MS_0032 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 63, Unused => 59, Length => 59, Value => (16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#006E#, 16#0075#, 16#006D#, 16#0062#, 16#0065#, 16#0072#, 16#0020#, 16#0028#, 16#003E#, 16#003D#, 16#0030#, 16#0029#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0077#, 16#0069#, 16#0064#, 16#0074#, 16#0068#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0062#, 16#006F#, 16#0075#, 16#006E#, 16#0064#, 16#0073#, others => 16#0000#), others => <>); -- "DC" MS_0033 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 2, Length => 2, Value => (16#0044#, 16#0043#, others => 16#0000#), others => <>); -- "AlignmentKind enumerates the possible options for alignment for layout purposes." MS_0034 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 87, Unused => 80, Length => 80, Value => (16#0041#, 16#006C#, 16#0069#, 16#0067#, 16#006E#, 16#006D#, 16#0065#, 16#006E#, 16#0074#, 16#004B#, 16#0069#, 16#006E#, 16#0064#, 16#0020#, 16#0065#, 16#006E#, 16#0075#, 16#006D#, 16#0065#, 16#0072#, 16#0061#, 16#0074#, 16#0065#, 16#0073#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0070#, 16#006F#, 16#0073#, 16#0073#, 16#0069#, 16#0062#, 16#006C#, 16#0065#, 16#0020#, 16#006F#, 16#0070#, 16#0074#, 16#0069#, 16#006F#, 16#006E#, 16#0073#, 16#0020#, 16#0066#, 16#006F#, 16#0072#, 16#0020#, 16#0061#, 16#006C#, 16#0069#, 16#0067#, 16#006E#, 16#006D#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#0066#, 16#006F#, 16#0072#, 16#0020#, 16#006C#, 16#0061#, 16#0079#, 16#006F#, 16#0075#, 16#0074#, 16#0020#, 16#0070#, 16#0075#, 16#0072#, 16#0070#, 16#006F#, 16#0073#, 16#0065#, 16#0073#, 16#002E#, others => 16#0000#), others => <>); -- "a color with a value of #FF00FF" MS_0035 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0046#, 16#0046#, 16#0030#, 16#0030#, 16#0046#, 16#0046#, others => 16#0000#), others => <>); -- "a color with a value of #FFFF00" MS_0036 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0046#, 16#0046#, 16#0046#, 16#0046#, 16#0030#, 16#0030#, others => 16#0000#), others => <>); -- "gray" MS_0037 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 4, Length => 4, Value => (16#0067#, 16#0072#, 16#0061#, 16#0079#, others => 16#0000#), others => <>); -- "end" MS_0038 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 3, Length => 3, Value => (16#0065#, 16#006E#, 16#0064#, others => 16#0000#), others => <>); -- "AlignmentKind" MS_0039 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 13, Length => 13, Value => (16#0041#, 16#006C#, 16#0069#, 16#0067#, 16#006E#, 16#006D#, 16#0065#, 16#006E#, 16#0074#, 16#004B#, 16#0069#, 16#006E#, 16#0064#, others => 16#0000#), others => <>); -- "dc" MS_003A : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 2, Length => 2, Value => (16#0064#, 16#0063#, others => 16#0000#), others => <>); -- "a real number (>=0) that represents a length along the x-axis." MS_003B : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 63, Unused => 62, Length => 62, Value => (16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#006E#, 16#0075#, 16#006D#, 16#0062#, 16#0065#, 16#0072#, 16#0020#, 16#0028#, 16#003E#, 16#003D#, 16#0030#, 16#0029#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#006C#, 16#0065#, 16#006E#, 16#0067#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#006C#, 16#006F#, 16#006E#, 16#0067#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0078#, 16#002D#, 16#0061#, 16#0078#, 16#0069#, 16#0073#, 16#002E#, others => 16#0000#), others => <>); -- "a real number (>=0 or <=0) that represents the y-coordinate of the bounds" MS_003C : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 79, Unused => 73, Length => 73, Value => (16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#006E#, 16#0075#, 16#006D#, 16#0062#, 16#0065#, 16#0072#, 16#0020#, 16#0028#, 16#003E#, 16#003D#, 16#0030#, 16#0020#, 16#006F#, 16#0072#, 16#0020#, 16#003C#, 16#003D#, 16#0030#, 16#0029#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0079#, 16#002D#, 16#0063#, 16#006F#, 16#006F#, 16#0072#, 16#0064#, 16#0069#, 16#006E#, 16#0061#, 16#0074#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0062#, 16#006F#, 16#0075#, 16#006E#, 16#0064#, 16#0073#, others => 16#0000#), others => <>); -- "x" MS_003D : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 1, Length => 1, Value => (16#0078#, others => 16#0000#), others => <>); -- "a color with a value of #FFA500" MS_003E : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0046#, 16#0046#, 16#0041#, 16#0035#, 16#0030#, 16#0030#, others => 16#0000#), others => <>); -- "Boolean" MS_003F : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 7, Length => 7, Value => (16#0042#, 16#006F#, 16#006F#, 16#006C#, 16#0065#, 16#0061#, 16#006E#, others => 16#0000#), others => <>); -- "http://www.omg.org/spec/DD/20110901/DC" MS_0040 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 47, Unused => 38, Length => 38, Value => (16#0068#, 16#0074#, 16#0074#, 16#0070#, 16#003A#, 16#002F#, 16#002F#, 16#0077#, 16#0077#, 16#0077#, 16#002E#, 16#006F#, 16#006D#, 16#0067#, 16#002E#, 16#006F#, 16#0072#, 16#0067#, 16#002F#, 16#0073#, 16#0070#, 16#0065#, 16#0063#, 16#002F#, 16#0044#, 16#0044#, 16#002F#, 16#0032#, 16#0030#, 16#0031#, 16#0031#, 16#0030#, 16#0039#, 16#0030#, 16#0031#, 16#002F#, 16#0044#, 16#0043#, others => 16#0000#), others => <>); -- "Bounds" MS_0041 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#0042#, 16#006F#, 16#0075#, 16#006E#, 16#0064#, 16#0073#, others => 16#0000#), others => <>); -- "a color with a value of #000080" MS_0042 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0030#, 16#0030#, 16#0030#, 16#0030#, 16#0038#, 16#0030#, others => 16#0000#), others => <>); -- "a color with a value of #00FF00" MS_0043 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0030#, 16#0030#, 16#0046#, 16#0046#, 16#0030#, 16#0030#, others => 16#0000#), others => <>); -- "height" MS_0044 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#0068#, 16#0065#, 16#0069#, 16#0067#, 16#0068#, 16#0074#, others => 16#0000#), others => <>); -- "Color is a data type that represents a color value in the RGB format." MS_0045 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 71, Unused => 69, Length => 69, Value => (16#0043#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0069#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#0064#, 16#0061#, 16#0074#, 16#0061#, 16#0020#, 16#0074#, 16#0079#, 16#0070#, 16#0065#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#0069#, 16#006E#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0052#, 16#0047#, 16#0042#, 16#0020#, 16#0066#, 16#006F#, 16#0072#, 16#006D#, 16#0061#, 16#0074#, 16#002E#, others => 16#0000#), others => <>); -- "org.omg.xmi.nsURI" MS_0046 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 23, Unused => 17, Length => 17, Value => (16#006F#, 16#0072#, 16#0067#, 16#002E#, 16#006F#, 16#006D#, 16#0067#, 16#002E#, 16#0078#, 16#006D#, 16#0069#, 16#002E#, 16#006E#, 16#0073#, 16#0055#, 16#0052#, 16#0049#, others => 16#0000#), others => <>); -- "the red component of the color in the range (0..255)." MS_0047 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 55, Unused => 53, Length => 53, Value => (16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0072#, 16#0065#, 16#0064#, 16#0020#, 16#0063#, 16#006F#, 16#006D#, 16#0070#, 16#006F#, 16#006E#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0069#, 16#006E#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0072#, 16#0061#, 16#006E#, 16#0067#, 16#0065#, 16#0020#, 16#0028#, 16#0030#, 16#002E#, 16#002E#, 16#0032#, 16#0035#, 16#0035#, 16#0029#, 16#002E#, others => 16#0000#), others => <>); -- "Bounds specifies a rectangular area in some x-y coordinate system that is defined by a location (x and y) and a size (width and height)." MS_0048 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 143, Unused => 136, Length => 136, Value => (16#0042#, 16#006F#, 16#0075#, 16#006E#, 16#0064#, 16#0073#, 16#0020#, 16#0073#, 16#0070#, 16#0065#, 16#0063#, 16#0069#, 16#0066#, 16#0069#, 16#0065#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0063#, 16#0074#, 16#0061#, 16#006E#, 16#0067#, 16#0075#, 16#006C#, 16#0061#, 16#0072#, 16#0020#, 16#0061#, 16#0072#, 16#0065#, 16#0061#, 16#0020#, 16#0069#, 16#006E#, 16#0020#, 16#0073#, 16#006F#, 16#006D#, 16#0065#, 16#0020#, 16#0078#, 16#002D#, 16#0079#, 16#0020#, 16#0063#, 16#006F#, 16#006F#, 16#0072#, 16#0064#, 16#0069#, 16#006E#, 16#0061#, 16#0074#, 16#0065#, 16#0020#, 16#0073#, 16#0079#, 16#0073#, 16#0074#, 16#0065#, 16#006D#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0069#, 16#0073#, 16#0020#, 16#0064#, 16#0065#, 16#0066#, 16#0069#, 16#006E#, 16#0065#, 16#0064#, 16#0020#, 16#0062#, 16#0079#, 16#0020#, 16#0061#, 16#0020#, 16#006C#, 16#006F#, 16#0063#, 16#0061#, 16#0074#, 16#0069#, 16#006F#, 16#006E#, 16#0020#, 16#0028#, 16#0078#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0079#, 16#0029#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0061#, 16#0020#, 16#0073#, 16#0069#, 16#007A#, 16#0065#, 16#0020#, 16#0028#, 16#0077#, 16#0069#, 16#0064#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0068#, 16#0065#, 16#0069#, 16#0067#, 16#0068#, 16#0074#, 16#0029#, 16#002E#, others => 16#0000#), others => <>); -- "a real number (<= 0 or >= 0) that represents the y-coordinate of the point." MS_0049 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 79, Unused => 76, Length => 76, Value => (16#0061#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#006E#, 16#0075#, 16#006D#, 16#0062#, 16#0065#, 16#0072#, 16#0020#, 16#0028#, 16#003C#, 16#003D#, 16#0020#, 16#0030#, 16#0020#, 16#006F#, 16#0072#, 16#0020#, 16#003E#, 16#003D#, 16#0020#, 16#0030#, 16#0029#, 16#0020#, 16#0020#, 16#0074#, 16#0068#, 16#0061#, 16#0074#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0079#, 16#002D#, 16#0063#, 16#006F#, 16#006F#, 16#0072#, 16#0064#, 16#0069#, 16#006E#, 16#0061#, 16#0074#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0070#, 16#006F#, 16#0069#, 16#006E#, 16#0074#, 16#002E#, others => 16#0000#), others => <>); -- "the red, green and blue components of the color must be in the range (0...255)." MS_004A : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 87, Unused => 79, Length => 79, Value => (16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0072#, 16#0065#, 16#0064#, 16#002C#, 16#0020#, 16#0067#, 16#0072#, 16#0065#, 16#0065#, 16#006E#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0062#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#0063#, 16#006F#, 16#006D#, 16#0070#, 16#006F#, 16#006E#, 16#0065#, 16#006E#, 16#0074#, 16#0073#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#006D#, 16#0075#, 16#0073#, 16#0074#, 16#0020#, 16#0062#, 16#0065#, 16#0020#, 16#0069#, 16#006E#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0072#, 16#0061#, 16#006E#, 16#0067#, 16#0065#, 16#0020#, 16#0028#, 16#0030#, 16#002E#, 16#002E#, 16#002E#, 16#0032#, 16#0035#, 16#0035#, 16#0029#, 16#002E#, others => 16#0000#), others => <>); -- "non_negative_dimension" MS_004B : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 23, Unused => 22, Length => 22, Value => (16#006E#, 16#006F#, 16#006E#, 16#005F#, 16#006E#, 16#0065#, 16#0067#, 16#0061#, 16#0074#, 16#0069#, 16#0076#, 16#0065#, 16#005F#, 16#0064#, 16#0069#, 16#006D#, 16#0065#, 16#006E#, 16#0073#, 16#0069#, 16#006F#, 16#006E#, others => 16#0000#), others => <>); -- "String is a primitive data type used to represent a sequence of characters in some suitable character set." MS_004C : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 111, Unused => 106, Length => 106, Value => (16#0053#, 16#0074#, 16#0072#, 16#0069#, 16#006E#, 16#0067#, 16#0020#, 16#0069#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#0070#, 16#0072#, 16#0069#, 16#006D#, 16#0069#, 16#0074#, 16#0069#, 16#0076#, 16#0065#, 16#0020#, 16#0064#, 16#0061#, 16#0074#, 16#0061#, 16#0020#, 16#0074#, 16#0079#, 16#0070#, 16#0065#, 16#0020#, 16#0075#, 16#0073#, 16#0065#, 16#0064#, 16#0020#, 16#0074#, 16#006F#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#0061#, 16#0020#, 16#0073#, 16#0065#, 16#0071#, 16#0075#, 16#0065#, 16#006E#, 16#0063#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0063#, 16#0068#, 16#0061#, 16#0072#, 16#0061#, 16#0063#, 16#0074#, 16#0065#, 16#0072#, 16#0073#, 16#0020#, 16#0069#, 16#006E#, 16#0020#, 16#0073#, 16#006F#, 16#006D#, 16#0065#, 16#0020#, 16#0073#, 16#0075#, 16#0069#, 16#0074#, 16#0061#, 16#0062#, 16#006C#, 16#0065#, 16#0020#, 16#0063#, 16#0068#, 16#0061#, 16#0072#, 16#0061#, 16#0063#, 16#0074#, 16#0065#, 16#0072#, 16#0020#, 16#0073#, 16#0065#, 16#0074#, 16#002E#, others => 16#0000#), others => <>); -- "a color with a value of #0000FF" MS_004D : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0030#, 16#0030#, 16#0030#, 16#0030#, 16#0046#, 16#0046#, others => 16#0000#), others => <>); -- "Dimension specifies two lengths (width and height) along the x and y axes in some x-y coordinate system." MS_004E : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 111, Unused => 104, Length => 104, Value => (16#0044#, 16#0069#, 16#006D#, 16#0065#, 16#006E#, 16#0073#, 16#0069#, 16#006F#, 16#006E#, 16#0020#, 16#0073#, 16#0070#, 16#0065#, 16#0063#, 16#0069#, 16#0066#, 16#0069#, 16#0065#, 16#0073#, 16#0020#, 16#0074#, 16#0077#, 16#006F#, 16#0020#, 16#006C#, 16#0065#, 16#006E#, 16#0067#, 16#0074#, 16#0068#, 16#0073#, 16#0020#, 16#0028#, 16#0077#, 16#0069#, 16#0064#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0068#, 16#0065#, 16#0069#, 16#0067#, 16#0068#, 16#0074#, 16#0029#, 16#0020#, 16#0061#, 16#006C#, 16#006F#, 16#006E#, 16#0067#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#0078#, 16#0020#, 16#0061#, 16#006E#, 16#0064#, 16#0020#, 16#0079#, 16#0020#, 16#0061#, 16#0078#, 16#0065#, 16#0073#, 16#0020#, 16#0069#, 16#006E#, 16#0020#, 16#0073#, 16#006F#, 16#006D#, 16#0065#, 16#0020#, 16#0078#, 16#002D#, 16#0079#, 16#0020#, 16#0063#, 16#006F#, 16#006F#, 16#0072#, 16#0064#, 16#0069#, 16#006E#, 16#0061#, 16#0074#, 16#0065#, 16#0020#, 16#0073#, 16#0079#, 16#0073#, 16#0074#, 16#0065#, 16#006D#, 16#002E#, others => 16#0000#), others => <>); -- "non_negative_size" MS_004F : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 23, Unused => 17, Length => 17, Value => (16#006E#, 16#006F#, 16#006E#, 16#005F#, 16#006E#, 16#0065#, 16#0067#, 16#0061#, 16#0074#, 16#0069#, 16#0076#, 16#0065#, 16#005F#, 16#0073#, 16#0069#, 16#007A#, 16#0065#, others => 16#0000#), others => <>); -- "width" MS_0050 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#0077#, 16#0069#, 16#0064#, 16#0074#, 16#0068#, others => 16#0000#), others => <>); -- "purple" MS_0051 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#0070#, 16#0075#, 16#0072#, 16#0070#, 16#006C#, 16#0065#, others => 16#0000#), others => <>); -- "http://www.w3.org/2001/XMLSchema#double" MS_0052 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 47, Unused => 39, Length => 39, Value => (16#0068#, 16#0074#, 16#0074#, 16#0070#, 16#003A#, 16#002F#, 16#002F#, 16#0077#, 16#0077#, 16#0077#, 16#002E#, 16#0077#, 16#0033#, 16#002E#, 16#006F#, 16#0072#, 16#0067#, 16#002F#, 16#0032#, 16#0030#, 16#0030#, 16#0031#, 16#002F#, 16#0058#, 16#004D#, 16#004C#, 16#0053#, 16#0063#, 16#0068#, 16#0065#, 16#006D#, 16#0061#, 16#0023#, 16#0064#, 16#006F#, 16#0075#, 16#0062#, 16#006C#, 16#0065#, others => 16#0000#), others => <>); -- "Real is a primitive data type used to represent the mathematical concept of real." MS_0053 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 87, Unused => 81, Length => 81, Value => (16#0052#, 16#0065#, 16#0061#, 16#006C#, 16#0020#, 16#0069#, 16#0073#, 16#0020#, 16#0061#, 16#0020#, 16#0070#, 16#0072#, 16#0069#, 16#006D#, 16#0069#, 16#0074#, 16#0069#, 16#0076#, 16#0065#, 16#0020#, 16#0064#, 16#0061#, 16#0074#, 16#0061#, 16#0020#, 16#0074#, 16#0079#, 16#0070#, 16#0065#, 16#0020#, 16#0075#, 16#0073#, 16#0065#, 16#0064#, 16#0020#, 16#0074#, 16#006F#, 16#0020#, 16#0072#, 16#0065#, 16#0070#, 16#0072#, 16#0065#, 16#0073#, 16#0065#, 16#006E#, 16#0074#, 16#0020#, 16#0074#, 16#0068#, 16#0065#, 16#0020#, 16#006D#, 16#0061#, 16#0074#, 16#0068#, 16#0065#, 16#006D#, 16#0061#, 16#0074#, 16#0069#, 16#0063#, 16#0061#, 16#006C#, 16#0020#, 16#0063#, 16#006F#, 16#006E#, 16#0063#, 16#0065#, 16#0070#, 16#0074#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0072#, 16#0065#, 16#0061#, 16#006C#, 16#002E#, others => 16#0000#), others => <>); -- "Dimension" MS_0054 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 15, Unused => 9, Length => 9, Value => (16#0044#, 16#0069#, 16#006D#, 16#0065#, 16#006E#, 16#0073#, 16#0069#, 16#006F#, 16#006E#, others => 16#0000#), others => <>); -- "a color with a value of #808080" MS_0055 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 31, Unused => 31, Length => 31, Value => (16#0061#, 16#0020#, 16#0063#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, 16#0020#, 16#0077#, 16#0069#, 16#0074#, 16#0068#, 16#0020#, 16#0061#, 16#0020#, 16#0076#, 16#0061#, 16#006C#, 16#0075#, 16#0065#, 16#0020#, 16#006F#, 16#0066#, 16#0020#, 16#0023#, 16#0038#, 16#0030#, 16#0038#, 16#0030#, 16#0038#, 16#0030#, others => 16#0000#), others => <>); -- "maroon" MS_0056 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 6, Length => 6, Value => (16#006D#, 16#0061#, 16#0072#, 16#006F#, 16#006F#, 16#006E#, others => 16#0000#), others => <>); -- "white" MS_0057 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#0077#, 16#0068#, 16#0069#, 16#0074#, 16#0065#, others => 16#0000#), others => <>); -- "black" MS_0058 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#0062#, 16#006C#, 16#0061#, 16#0063#, 16#006B#, others => 16#0000#), others => <>); -- "Color" MS_0059 : aliased Matreshka.Internals.Strings.Shared_String := (Capacity => 7, Unused => 5, Length => 5, Value => (16#0043#, 16#006F#, 16#006C#, 16#006F#, 16#0072#, others => 16#0000#), others => <>); end AMF.Internals.Tables.DC_String_Data_00;
zhmu/ananas
Ada
3,098
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T . S I G N A L S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2003-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides operations for querying and setting the blocked -- status of signals. -- This package is supported only on targets where Ada.Interrupts.Interrupt_ID -- corresponds to software signals on the target, and where System.Interrupts -- provides the ability to block and unblock signals. with Ada.Interrupts; package GNAT.Signals is procedure Block_Signal (Signal : Ada.Interrupts.Interrupt_ID); -- Block "Signal" at the process level procedure Unblock_Signal (Signal : Ada.Interrupts.Interrupt_ID); -- Unblock "Signal" at the process level function Is_Blocked (Signal : Ada.Interrupts.Interrupt_ID) return Boolean; -- "Signal" blocked at the process level? end GNAT.Signals;
reznikmm/matreshka
Ada
4,144
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2015-2016, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package body Matreshka.Servlet_Defaults is ---------------------- -- Get_Servlet_Info -- ---------------------- overriding function Get_Servlet_Info (Self : Default_Servlet) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return League.Strings.To_Universal_String ("Matreshka's Default Servlet"); end Get_Servlet_Info; ----------------- -- Instantiate -- ----------------- overriding function Instantiate (Parameters : not null access Servlet.Generic_Servlets.Instantiation_Parameters'Class) return Default_Servlet is pragma Unreferenced (Parameters); begin return (Servlet.HTTP_Servlets.HTTP_Servlet with null record); end Instantiate; end Matreshka.Servlet_Defaults;
AdaCore/libadalang
Ada
1,044
adb
procedure Test is package P is type T is tagged null record; function F (X : T) return T is (X); function F return T is (null record); procedure G (X : T) is null; end P; package Q is type U is new P.T with null record; end Q; package R is type U is new Q.U with null record; overriding function F (X : U) return U is (X); end R; package I is type T is interface; procedure A (X : T) is abstract; type V is interface; procedure B (X : V) is null; type W is interface and T and V; end I; package S is type U is new R.U with null record; end S; package T is type U is new S.U and I.W with null record; overriding function F (X : U) return U is (X); overriding function F return U is (null record); overriding procedure A (X : U); overriding procedure B (X : U) is null; overriding procedure A (X : U) is null; end T; begin null; end Test; pragma Find_All_References (Overrides);
annexi-strayline/AURA
Ada
16,334
adb
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- ANNEXI-STRAYLINE Reference Implementation -- -- -- -- Core -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ separate (Registrar.Executive.Unit_Entry.Execute) package body Process_Pack is use Parse_Pack; use Ada_Lexical_Parser; ------------------ -- Process_With -- ------------------ -- Parser_Pack is pointing at a "with" reserved word. Our job is to extract -- the subsequent library unit names, including the implicitly withed -- parent units, if any. -- -- The only legal presentation is a.b.c, d.e.f, ... x.y.z; As in we expect -- to find a number of Identifier elements, separated by '.' Delimiters, -- for the construction of a full library unit name, or ',' to delimit the -- end of a particular name, finally with a ';' to delimit the end of the -- with statement. Anything else is illegal. -- -- Note that there are some language-defined or compiler-defined -- "subsystems" such as Ada, Interfaces, and GNAT that should not be -- included as dependencies. These are stipped when requestiong library -- units - see the sibling package Executive.Library_Units_Request procedure Process_With is New_Depend : Library_Unit; Name_Pass : Positive := 1; -- Represents the depth of prefixes in the name currently being built-up begin New_Depend.State := Requested; New_Depend.Kind := Unknown; Next_Element; loop case Category is when Delimiter => if Content in "." | "," | ";" and then New_Depend.Name.Empty then -- We should only be seeing this after an identifier, -- which would have been added to the name of the new -- dependency Abort_Parse; end if; if Content = "." then -- Each implicitly with'ed parent should be included -- in the dependency set. Every-time we get to a period, -- we should add that current name separately, to account -- for that "parent" unit implicitly withed Dependencies.Include (New_Depend); New_Depend.Name.Append (Content); Name_Pass := Name_Pass + 1; -- An identifier _must_ follow Next_Element; if Category /= Identifier then Abort_Parse; end if; elsif Content = "," then -- End of a name, so we need to do add it to the set Dependencies.Include (New_Depend); New_Depend.Name.Set_Name (""); Name_Pass := 1; Next_Element; if Category /= Identifier then Abort_Parse; end if; elsif Content = ";" then -- Last item to add to the set Dependencies.Include (New_Depend); exit; else -- No other delimiter would be acceptible Abort_Parse; end if; when Identifier => -- Prohibit any configuration manifest withs. This means -- that any pattern of Subsystem.AURA or children is prohibited -- by AURA Assert (Check => (if Name_Pass = 2 then Content /= "aura"), Message => "AURA Configuration manifests may not be " & "withed. No subsystem may have a child unit " & "named AURA in an AURA project."); New_Depend.Name.Append (Content); Next_Element; when others => Abort_Parse; end case; end loop; end Process_With; --------------------------- -- Process_External_With -- --------------------------- Staged_Externals: Library_Unit_Sets.Set; -- All External_With units that have not yet had their subsystem name -- prepended, or included in the Dependencies set procedure Process_External_With is New_Depend: Library_Unit; begin New_Depend.State := Requested; New_Depend.Kind := External_Unit; Next_Element; -- We expect to see ("abc.c","def.c", ... "xyz.c"); if not (Category = Delimiter and then Content = "(") then Abort_Parse; end if; Next_Element; if Category /= String_Literal then Abort_Parse; end if; loop -- We only have the file-name at this stage, which gets a '%' -- prepended. The actual subsystem -- name will get prepended once we know what it is -- (via Process_Staged_Externals) -- We need to check if this name is hypothentically valid (after it -- gets the subsystem name prepended in case the actual external -- unit withed includes '%', which we don't allow Assert (Check => Unit_Names.Valid_Unit_Name ("standard%" & Content), Message => "External unit file names cannot contain '%'."); New_Depend.Name.Set_Name ('%' & Content); Staged_Externals.Include (New_Depend); Next_Element; if Category = Delimiter then if Content = "," then Next_Element; if Category /= String_Literal then Abort_Parse; end if; -- And around again elsif Content = ")" then Next_Element; if not (Category = Delimiter and then Content = ";") then Abort_Parse; end if; -- All done exit; else -- Unexpected Abort_Parse; end if; else Abort_Parse; end if; end loop; end Process_External_With; ------------------------- -- Process_Declaration -- ------------------------- procedure Process_Declaration is use type Source_Pack.Source_File_Type; begin -- First check for "separate", in which case we are really -- not interested in the name of the separate unit (the subunit), but -- rather the parent unit - mainly so that we can associate the correct -- subsystem name with any External_With pragmas in this unit. -- The main body of execute invokes Process_Delaration when we are at -- one of the relevent reserved words if Content = "separate" then New_Unit.Kind := Subunit; Next_Element; if not (Category = Delimiter and then Content = "(") then -- syntax error Abort_Parse; end if; Next_Element; if Category /= Identifier then -- Syntax error Abort_Parse; end if; -- Identify the complete name New_Unit.Name.Set_Name (""); loop New_Unit.Name.Append (Content); Next_Element; if Category /= Delimiter then Abort_Parse; end if; if Content = "." then New_Unit.Name.Append (Content); Next_Element; -- What follows this must either be a continuation of the -- name. if Category /= Identifier then Abort_Parse; end if; elsif Content = ")" then exit; else Abort_Parse; end if; end loop; -- That's all we process for this unit, since we are really -- dealing with the parent subunit. In the body of execute, -- the file access will be assigned as appropriate prior to -- submission return; elsif Content = "package" then New_Unit.Kind := Package_Unit; elsif Content in "procedure" | "function" then New_Unit.Kind := Subprogram_Unit; else raise Ada.Assertions.Assertion_Error with "Expected separate, package, procedure, or function"; end if; -- For all non-subunits, we want to get the name of the unit up until -- "is" -- First check and skip the "body" reserved word if we find it Next_Element; if Category = Reserved_Word and then Content = "body" then Assert (Check => not New_Unit.Is_Generic, Message => "Only specifications can be generic."); Assert (Check => Source_Pack.Unit_Source_Type = Source_Pack.Ada_Body, Message => "Specification sources shall not contain bodies."); Next_Element; end if; -- Names should always begin with a valid Identifier if Category /= Identifier then Abort_Parse; end if; New_Unit.Name.Set_Name (""); loop if Category = Identifier then New_Unit.Name.Append (Content); Next_Element; if Category not in Reserved_Word | Delimiter then Abort_Parse; end if; elsif Category = Delimiter and then Content = "." then New_Unit.Name.Append (Content); Next_Element; if Category /= Identifier then Abort_Parse; end if; elsif (Category = Delimiter and then Content in "(" | ";") or else (Category = Reserved_Word and then Content in "is" | "with" | "renames") then -- Note this does not catch certain incorrect cases such as -- package Thing;, but that is really a problem for the compiler -- to deal with exit; else Abort_Parse; end if; end loop; end Process_Declaration; ----------------------------- -- Filter_Standard_Library -- ----------------------------- procedure Filter_Standard_Library is use Library_Unit_Sets; Itr: Cursor := Dependencies.First; Del: Cursor; begin while Has_Element (Itr) loop Del := Itr; Itr := Next (Itr); if Dependencies(Del).Name.Subsystem_Name.To_String in "ada" | "interfaces" | "system" | "gnat" then Dependencies.Delete (Del); end if; end loop; end Filter_Standard_Library; --------------------------------- -- Process_Parent_Dependencies -- --------------------------------- procedure Process_Parent_Dependencies is Parent_Name: Unit_Names.Unit_Name := New_Unit.Name.Parent_Name; Parent_Depend: Library_Unit; begin Parent_Depend.State := Requested; Parent_Depend.Kind := Unknown; while not Parent_Name.Empty loop Parent_Depend.Name := Parent_Name; Dependencies.Include (Parent_Depend); Parent_Name := Unit_Names.Unit_Name (Parent_Name.Parent_Name); end loop; end Process_Parent_Dependencies; ------------------------------ -- Process_Staged_Externals -- ------------------------------ procedure Process_Staged_Externals is procedure Append_Subsystem (Position: in Library_Unit_Sets.Cursor) is begin -- For non-aura units, the external dependency file is expected to be -- in the project root directory, and when entered, gets associated -- with the root subsystem "standard". -- -- This works well because standard can't be an actual included -- subsystem anyways Staged_Externals(Position).Name.Prepend ((if Order.AURA then Wide_Wide_String'(New_Unit.Name.Subsystem_Name.To_String) else Wide_Wide_String'("standard"))); end Append_Subsystem; begin Staged_Externals.Iterate (Append_Subsystem'Access); Dependencies.Union (Staged_Externals); end Process_Staged_Externals; end Process_Pack;
AdaCore/libadalang
Ada
180
adb
procedure Testexc is A, B : exception; pragma Test_Statement; C : exception renames A; pragma Test_Statement; begin raise A; pragma Test_Statement; end Testexc;
VitalijBondarenko/adanls
Ada
3,827
ads
------------------------------------------------------------------------------ -- -- -- Copyright (c) 2014-2022 Vitalii Bondarenko <[email protected]> -- -- -- ------------------------------------------------------------------------------ -- -- -- The MIT License (MIT) -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, sublicense, and/or sell copies of the Software, and to -- -- permit persons to whom the Software is furnished to do so, subject to -- -- the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -- -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -- -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- ------------------------------------------------------------------------------ -- The functions to setup locale. package L10n is pragma Preelaborate; type Locale_Category is new Integer; -- The table of locale categories. -- The categories after LC_ALL in the table are GNU extensions. LC_CTYPE : constant Locale_Category := 0; LC_NUMERIC : constant Locale_Category := 1; LC_TIME : constant Locale_Category := 2; LC_COLLATE : constant Locale_Category := 3; LC_MONETARY : constant Locale_Category := 4; LC_MESSAGES : constant Locale_Category := 5; LC_ALL : constant Locale_Category := 6; LC_PAPER : constant Locale_Category := 7; LC_NAME : constant Locale_Category := 8; LC_ADDRESS : constant Locale_Category := 9; LC_TELEPHONE : constant Locale_Category := 10; LC_MEASUREMENT : constant Locale_Category := 11; LC_IDENTIFICATION : constant Locale_Category := 12; procedure Set_Locale (Category : Locale_Category := LC_ALL; Locale : String := ""); -- Sets the current locale for category Category to Locale. -- If you specify an empty string for Locale, this means to read the -- appropriate environment variable and use its value to select the locale -- for Category. -- If you specify an invalid locale name, Set_Locale leaves the current -- locale unchanged. -- -- This procedure without parameters must be called before any other -- subprogram in this package. It will initialize internal variables based -- on the environment variables. function Get_Locale (Category : Locale_Category := LC_ALL) return String; -- Returns the name of the current locale. end L10n;
rguilloteau/pok
Ada
771
adb
-- POK header -- -- The following file is a part of the POK project. Any modification should -- be made according to the POK licence. You CANNOT use this file or a part -- of a file for your own project. -- -- For more information on the POK licence, please see our LICENCE FILE -- -- Please follow the coding guidelines described in doc/CODING_GUIDELINES -- -- Copyright (c) 2007-2020 POK team package body Activity is procedure Printf (String : in Interfaces.C.char_array); pragma Import (C, Printf, "printf"); procedure Thr1_Job is Ret : Return_Code_Type; begin loop Printf ("beep "); Timed_Wait (1000, Ret); end loop; end Thr1_Job; end Activity;
docandrew/sdlada
Ada
3,450
adb
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- with SDL.Error; package body SDL.RWops.Streams is use type Interfaces.C.unsigned_long; function Open (Op : in RWops) return RWops_Stream is begin return (Ada.Streams.Root_Stream_Type with Context => Op); end Open; procedure Open (Op : in RWops; Stream : out RWops_Stream) is begin Stream.Context := Op; end Open; procedure Close (Stream : in RWops_Stream) is begin Close (Stream.Context); end Close; overriding procedure Read (Stream : in out RWops_Stream; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) is Objects_Read : Interfaces.C.unsigned_long := 0; begin -- Re-implemented c-macro: -- #define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) -- Read : access function -- (context : RWops_Pointer; -- ptr : System.Address; -- size : Interfaces.C.unsigned_long; -- maxnum : Interfaces.C.unsigned_long) return Interfaces.C.unsigned_long; Objects_Read := Stream.Context.Read (Context => RWops_Pointer (Stream.Context), Ptr => Item'Address, Size => Item'Length, Max_Num => 1); if Objects_Read = 0 then raise RWops_Error with SDL.Error.Get; end if; Last := Item'Length; end Read; overriding procedure Write (Stream : in out RWops_Stream; Item : Ada.Streams.Stream_Element_Array) is Objects_Written : Interfaces.C.unsigned_long := 0; begin -- Re-implemented c-macro: -- #define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) -- Write : access function -- (Context : RWops_Pointer; -- Ptr : System.Address; -- Size : Interfaces.C.unsigned_long; -- Num : Interfaces.C.unsigned_long) return Interfaces.C.unsigned_long; Objects_Written := Stream.Context.Write (Context => RWops_Pointer (Stream.Context), Ptr => Item'Address, Size => Item'Length, Num => 1); if Objects_Written = 0 then raise RWops_Error with SDL.Error.Get; end if; end Write; end SDL.RWops.Streams;
reznikmm/matreshka
Ada
6,981
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Chart.Error_Indicator_Elements is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Chart_Error_Indicator_Element_Node is begin return Self : Chart_Error_Indicator_Element_Node do Matreshka.ODF_Chart.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Chart_Prefix); end return; end Create; ---------------- -- Enter_Node -- ---------------- overriding procedure Enter_Node (Self : not null access Chart_Error_Indicator_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Enter_Chart_Error_Indicator (ODF.DOM.Chart_Error_Indicator_Elements.ODF_Chart_Error_Indicator_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Enter_Node (Visitor, Control); end if; end Enter_Node; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Chart_Error_Indicator_Element_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Error_Indicator_Element; end Get_Local_Name; ---------------- -- Leave_Node -- ---------------- overriding procedure Leave_Node (Self : not null access Chart_Error_Indicator_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Leave_Chart_Error_Indicator (ODF.DOM.Chart_Error_Indicator_Elements.ODF_Chart_Error_Indicator_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Leave_Node (Visitor, Control); end if; end Leave_Node; ---------------- -- Visit_Node -- ---------------- overriding procedure Visit_Node (Self : not null access Chart_Error_Indicator_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then ODF.DOM.Iterators.Abstract_ODF_Iterator'Class (Iterator).Visit_Chart_Error_Indicator (Visitor, ODF.DOM.Chart_Error_Indicator_Elements.ODF_Chart_Error_Indicator_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Visit_Node (Iterator, Visitor, Control); end if; end Visit_Node; begin Matreshka.DOM_Documents.Register_Element (Matreshka.ODF_String_Constants.Chart_URI, Matreshka.ODF_String_Constants.Error_Indicator_Element, Chart_Error_Indicator_Element_Node'Tag); end Matreshka.ODF_Chart.Error_Indicator_Elements;
stcarrez/ada-servlet
Ada
3,260
ads
----------------------------------------------------------------------- -- servlet-resolvers -- Resolver to create and give access to managed beans -- Copyright (C) 2013, 2015, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Finalization; with Ada.Strings.Unbounded; with Util.Beans.Basic; with Util.Beans.Objects; with EL.Contexts; with Servlet.Core; with Servlet.Requests; package Servlet.Resolvers is -- ------------------------------ -- Bean Resolver -- ------------------------------ type ELResolver is limited new EL.Contexts.ELResolver with private; -- Initialize the EL resolver to use the application bean factory and the given request. procedure Initialize (Resolver : in out ELResolver; App : in Servlet.Core.Servlet_Registry_Access; Request : in Servlet.Requests.Request_Access); -- Resolve the name represented by <tt>Name</tt> according to a base object <tt>Base</tt>. -- The resolver tries to look first in pre-defined objects (params, flash, headers, initParam). -- It then looks in the request and session attributes for the value. If the value was -- not in the request or session, it uses the application bean factory to create the -- new managed bean and adds it to the request or session. overriding function Get_Value (Resolver : in ELResolver; Context : in EL.Contexts.ELContext'Class; Base : access Util.Beans.Basic.Readonly_Bean'Class; Name : in Ada.Strings.Unbounded.Unbounded_String) return Util.Beans.Objects.Object; -- Sets the value represented by the <tt>Name</tt> in the base object <tt>Base</tt>. -- If there is no <tt>Base</tt> object, the request attribute with the given name is -- updated to the given value. overriding procedure Set_Value (Resolver : in out ELResolver; Context : in EL.Contexts.ELContext'Class; Base : access Util.Beans.Basic.Bean'Class; Name : in Ada.Strings.Unbounded.Unbounded_String; Value : in Util.Beans.Objects.Object); private type ELResolver is limited new Ada.Finalization.Limited_Controlled and EL.Contexts.ELResolver with record -- The current request. Request : Servlet.Requests.Request_Access; -- The current servlet registry. Application : Servlet.Core.Servlet_Registry_Access; end record; end Servlet.Resolvers;
onox/sdlada
Ada
12,528
adb
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2018 Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- with Interfaces.C.Strings; with SDL.Error; with SDL.RWops; package body SDL.Inputs.Joysticks.Game_Controllers is package C renames Interfaces.C; use type C.int; use type C.Strings.chars_ptr; procedure Add_Mapping (Data : in String; Updated_Existing : out Boolean) is function SDL_Game_Controller_Add_Mapping (Buffer : in C.char_array) return C.int with Convention => C, Import => True, External_Name => "SDL_GameControllerAddMapping"; Result : C.int := SDL_Game_Controller_Add_Mapping (C.To_C (Data)); begin if Result = -1 then raise Mapping_Error with SDL.Error.Get; end if; Updated_Existing := (Result = 0); end Add_Mapping; procedure Add_Mappings_From_File (Database_Filename : in String; Number_Added : out Natural) is function SDL_Game_Controller_Add_Mappings_From_RW (RW : SDL.RWops.RWops; FreeRW : C.int) return C.int with Convention => C, Import => True, External_Name => "SDL_GameControllerAddMappingsFromRW"; RW : SDL.RWops.RWops := SDL.RWops.From_File (Database_Filename, Mode => SDL.RWops.Read); Result : constant Integer := Integer (SDL_Game_Controller_Add_Mappings_From_RW (RW, FreeRW => 1)); begin if Result < 0 then raise Mapping_Error with SDL.Error.Get; end if; Number_Added := Result; end Add_Mappings_From_File; function Axis_Value (Self : in Game_Controller; Axis : in SDL.Events.Joysticks.Game_Controllers.LR_Axes) return SDL.Events.Joysticks.Game_Controllers.LR_Axes_Values is function SDL_Game_Controller_Get_Axis (Controller : in SDL.C_Pointers.Game_Controller_Pointer; Axis : in SDL.Events.Joysticks.Game_Controllers.LR_Axes) return SDL.Events.Joysticks.Game_Controllers.LR_Axes_Values with Import => True, Convention => C, External_Name => "SDL_GameControllerGetAxis"; begin return SDL_Game_Controller_Get_Axis (Self.Internal, Axis); end Axis_Value; function Axis_Value (Self : in Game_Controller; Axis : in SDL.Events.Joysticks.Game_Controllers.Trigger_Axes) return SDL.Events.Joysticks.Game_Controllers.Trigger_Axes_Values is function SDL_Game_Controller_Get_Axis (Controller : in SDL.C_Pointers.Game_Controller_Pointer; Axis : in SDL.Events.Joysticks.Game_Controllers.Trigger_Axes) return SDL.Events.Joysticks.Game_Controllers.Trigger_Axes_Values with Import => True, Convention => C, External_Name => "SDL_GameControllerGetAxis"; begin return SDL_Game_Controller_Get_Axis (Self.Internal, Axis); end Axis_Value; procedure Close (Self : in out Game_Controller) is procedure SDL_Game_Controller_Close (Controller : in SDL.C_Pointers.Game_Controller_Pointer) with Import => True, Convention => C, External_Name => "SDL_GameControllerClose"; begin SDL_Game_Controller_Close (Self.Internal); -- Reinitialise the object so it's actually a Null_Game_Controller. Self.Internal := null; Self.Owns := True; end Close; function Get_Axis (Axis : in String) return SDL.Events.Joysticks.Game_Controllers.Axes is function SDL_Game_Controller_Get_Axis_From_String (Axis : in C.char_array) return SDL.Events.Joysticks.Game_Controllers.Axes with Import => True, Convention => C, External_Name => "SDL_GameControllerGetAxisFromString"; begin return SDL_Game_Controller_Get_Axis_From_String (C.To_C (Axis)); end Get_Axis; function Get_Binding (Self : in Game_Controller; Axis : in SDL.Events.Joysticks.Game_Controllers.Axes) return Bindings is function SDL_Game_Controller_Get_Bind_For_Axis (Controller : in SDL.C_Pointers.Game_Controller_Pointer; Axis : in SDL.Events.Joysticks.Game_Controllers.Axes) return Bindings with Import => True, Convention => C, External_Name => "SDL_GameControllerGetBindForAxis"; begin return SDL_Game_Controller_Get_Bind_For_Axis (Self.Internal, Axis); end Get_Binding; function Get_Binding (Self : in Game_Controller; Button : in SDL.Events.Joysticks.Game_Controllers.Buttons) return Bindings is function SDL_Game_Controller_Get_Bind_For_Button (Controller : in SDL.C_Pointers.Game_Controller_Pointer; Button : in SDL.Events.Joysticks.Game_Controllers.Buttons) return Bindings with Import => True, Convention => C, External_Name => "SDL_GameControllerGetBindForButton"; begin return SDL_Game_Controller_Get_Bind_For_Button (Self.Internal, Button); end Get_Binding; function Get_Button (Button_Name : in String) return SDL.Events.Joysticks.Game_Controllers.Buttons is function SDL_Game_Controller_Get_Button_From_String (Buffer : in C.char_array) return SDL.Events.Joysticks.Game_Controllers.Buttons with Convention => C, Import => True, External_Name => "SDL_GameControllerGetButtonFromString"; begin return SDL.Events.Joysticks.Game_Controllers.Buttons (SDL_Game_Controller_Get_Button_From_String (C.To_C (Button_Name))); end Get_Button; function Get_Joystick (Self : in Game_Controller) return Joystick is function SDL_Game_Controller_Get_Joystick (Controller : in SDL.C_Pointers.Game_Controller_Pointer) return SDL.C_Pointers.Joystick_Pointer with Convention => C, Import => True, External_Name => "SDL_GameControllerGetJoystick"; begin return J : Joystick := (Ada.Finalization.Limited_Controlled with Internal => SDL_Game_Controller_Get_Joystick (Self.Internal), Owns => False) do null; end return; end Get_Joystick; function Get_Mapping (Self : in Game_Controller) return String is function SDL_Game_Controller_Mapping (Controller : in SDL.C_Pointers.Game_Controller_Pointer) return C.Strings.chars_ptr with Convention => C, Import => True, External_Name => "SDL_GameControllerMapping"; Result : C.Strings.chars_ptr := SDL_Game_Controller_Mapping (Self.Internal); begin if Result = C.Strings.Null_Ptr then return ""; end if; return C.Strings.Value (Result); end Get_Mapping; function Get_Mapping (Controller : in GUIDs) return String is function SDL_Game_Controller_Mapping_For_GUID (Controller : in GUIDs) return C.Strings.chars_ptr with Convention => C, Import => True, External_Name => "SDL_GameControllerMappingForGUID"; Result : C.Strings.chars_ptr := SDL_Game_Controller_Mapping_For_GUID (Controller); begin if Result = C.Strings.Null_Ptr then return ""; end if; return C.Strings.Value (Result); end Get_Mapping; function Get_Name (Self : in Game_Controller) return String is function SDL_Game_Controller_Name (Controller : in SDL.C_Pointers.Game_Controller_Pointer) return C.Strings.chars_ptr with Convention => C, Import => True, External_Name => "SDL_GameControllerName"; Result : C.Strings.chars_ptr := SDL_Game_Controller_Name (Self.Internal); begin if Result = C.Strings.Null_Ptr then return ""; end if; return C.Strings.Value (Result); end Get_Name; function Get_Name (Device : in Devices) return String is function SDL_Game_Controller_Name_For_Index (Index : in C.int) return C.Strings.chars_ptr with Convention => C, Import => True, External_Name => "SDL_GameControllerNameForIndex"; Result : C.Strings.chars_ptr := SDL_Game_Controller_Name_For_Index (C.int (Device) - 1); begin if Result = C.Strings.Null_Ptr then return ""; end if; return C.Strings.Value (Result); end Get_Name; function Image (Axis : in SDL.Events.Joysticks.Game_Controllers.Axes) return String is function SDL_Game_Controller_Get_String_For_Axis (Axis : in SDL.Events.Joysticks.Game_Controllers.Axes) return C.Strings.chars_ptr with Convention => C, Import => True, External_Name => "SDL_GameControllerGetStringForAxis"; Result : C.Strings.chars_ptr := SDL_Game_Controller_Get_String_For_Axis (Axis); begin if Result = C.Strings.Null_Ptr then return ""; end if; return C.Strings.Value (Result); end Image; function Image (Button : in SDL.Events.Joysticks.Game_Controllers.Buttons) return String is function SDL_Game_Controller_Get_String_For_Button (Button : in SDL.Events.Joysticks.Game_Controllers.Buttons) return C.Strings.chars_ptr with Convention => C, Import => True, External_Name => "SDL_GameControllerGetStringForButton"; Result : C.Strings.chars_ptr := SDL_Game_Controller_Get_String_For_Button (Button); begin if Result = C.Strings.Null_Ptr then return ""; end if; return C.Strings.Value (Result); end Image; function Is_Attached (Self : in Game_Controller) return Boolean is function SDL_Game_Controller_Is_Attached (Controller : in SDL.C_Pointers.Game_Controller_Pointer) return SDL_Bool with Import => True, Convention => C, External_Name => "SDL_GameControllerGetAttached"; begin if SDL_Game_Controller_Is_Attached (Self.Internal) = SDL_True then return True; end if; return False; end Is_Attached; function Is_Button_Pressed (Self : in Game_Controller; Button : in SDL.Events.Joysticks.Buttons) return SDL.Events.Button_State is function SDL_Game_Controller_Get_Button (Controller : in SDL.C_Pointers.Game_Controller_Pointer; Button : in SDL.Events.Joysticks.Buttons) return SDL.Events.Button_State with Import => True, Convention => C, External_Name => "SDL_GameControllerGetButton"; begin return SDL_Game_Controller_Get_Button (Self.Internal, Button); end Is_Button_Pressed; function Is_Game_Controller (Device : in Devices) return Boolean is function SDL_Is_Game_Controller (Device : in C.int) return SDL_Bool with Import => True, Convention => C, External_Name => "SDL_IsGameController"; begin if SDL_Is_Game_Controller (C.int (Device) - 1) = SDL_True then return True; end if; return False; end Is_Game_Controller; end SDL.Inputs.Joysticks.Game_Controllers;
pdaxrom/Kino2
Ada
3,947
adb
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Float_IO -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: -- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; with Terminal_Interface.Curses.Text_IO.Aux; package body Terminal_Interface.Curses.Text_IO.Float_IO is package Aux renames Terminal_Interface.Curses.Text_IO.Aux; package FIO is new Ada.Text_IO.Float_IO (Num); procedure Put (Win : in Window; Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp) is Buf : String (1 .. Field'Last); Len : Field := Fore + 1 + Aft; begin if Exp > 0 then Len := Len + 1 + Exp; end if; FIO.Put (Buf, Item, Aft, Exp); Aux.Put_Buf (Win, Buf, Len, False); end Put; procedure Put (Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp) is begin Put (Get_Window, Item, Fore, Aft, Exp); end Put; end Terminal_Interface.Curses.Text_IO.Float_IO;
ekoeppen/STM32_Generic_Ada_Drivers
Ada
2,605
ads
with STM32_SVD; use STM32_SVD; with STM32_SVD.GPIO; package STM32GD.GPIO is pragma Preelaborate; type GPIO_Port is (Port_A, Port_B, Port_C, Port_D, Port_E, Port_H); for GPIO_Port use (Port_A => 0, Port_B => 1, Port_C => 2, Port_D => 3, Port_E => 4, Port_H => 7); type GPIO_Pin is (Pin_0, Pin_1, Pin_2, Pin_3, Pin_4, Pin_5, Pin_6, Pin_7, Pin_8, Pin_9, Pin_10, Pin_11, Pin_12, Pin_13, Pin_14, Pin_15); for GPIO_Pin use (Pin_0 => 16#0001#, Pin_1 => 16#0002#, Pin_2 => 16#0004#, Pin_3 => 16#0008#, Pin_4 => 16#0010#, Pin_5 => 16#0020#, Pin_6 => 16#0040#, Pin_7 => 16#0080#, Pin_8 => 16#0100#, Pin_9 => 16#0200#, Pin_10 => 16#0400#, Pin_11 => 16#0800#, Pin_12 => 16#1000#, Pin_13 => 16#2000#, Pin_14 => 16#4000#, Pin_15 => 16#8000#); for GPIO_Pin'Size use 16; -- for compatibility with hardware registers type GPIO_Pins is array (Positive range <>) of GPIO_Pin; -- Note that, in addition to aggregates, the language-defined catenation -- operator "&" is available for types GPIO_Pin and GPIO_Pins, allowing one -- to construct GPIO_Pins values conveniently All_Pins : constant GPIO_Pins := (Pin_0, Pin_1, Pin_2, Pin_3, Pin_4, Pin_5, Pin_6, Pin_7, Pin_8, Pin_9, Pin_10, Pin_11, Pin_12, Pin_13, Pin_14, Pin_15); type Pin_IO_Modes is (Mode_In, Mode_Out, Mode_AF, Mode_Analog) with Size => 2; for Pin_IO_Modes use (Mode_In => 0, Mode_Out => 1, Mode_AF => 2, Mode_Analog => 3); type Pin_Output_Types is (Push_Pull, Open_Drain) with Size => 1; for Pin_Output_Types use (Push_Pull => 0, Open_Drain => 1); type Pin_Output_Speeds is (Speed_2MHz, Speed_25MHz, Speed_50MHz, Speed_100MHz) with Size => 2; for Pin_Output_Speeds use (Speed_2MHz => 0, -- low Speed_25MHz => 1, -- medium Speed_50MHz => 2, -- high Speed_100MHz => 3); -- very high Speed_Low : Pin_Output_Speeds renames Speed_2MHz; Speed_Medium : Pin_Output_Speeds renames Speed_25MHz; Speed_High : Pin_Output_Speeds renames Speed_50MHz; Speed_Very_High : Pin_Output_Speeds renames Speed_100MHz; type Internal_Pin_Resistors is (Floating, Pull_Up, Pull_Down) with Size => 2; for Internal_Pin_Resistors use (Floating => 0, Pull_Up => 1, Pull_Down => 2); type GPIO_Alternate_Function is new UInt4; end STM32GD.GPIO;
ytomino/vampire
Ada
676
ads
-- The Village of Vampire by YT, このソースコードはNYSLです with Tabula.Villages.Lists; private with Vampire.Villages.Village_IO; package Vampire.Log is Type_Code : aliased constant String; function Load_Summary ( List : Tabula.Villages.Lists.Village_List; Id : Tabula.Villages.Village_Id) return Tabula.Villages.Lists.Village_Summary; procedure Create_Log ( List : Tabula.Villages.Lists.Village_List; Id : in Tabula.Villages.Village_Id); procedure Create_Index ( Summaries : in Tabula.Villages.Lists.Summary_Maps.Map; Update : in Boolean); private Type_Code : aliased constant String := Villages.Village_IO.Yaml_Type; end Vampire.Log;
stcarrez/dynamo
Ada
5,162
ads
------------------------------------------------------------------------------ -- -- -- ASIS-for-GNAT IMPLEMENTATION COMPONENTS -- -- -- -- A 4 G . T R E E _ R E C -- -- -- -- S p e c -- -- -- -- Copyright (c) 1995-2005, 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, 59 Temple Place -- -- - Suite 330, Boston, MA 02111-1307, 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 Ada Core Technologies Inc -- -- (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This package defines the Tree_Rec type, which is used as an actual for -- the instantiation of the GANT Table creating the type for the Context tree -- table. This table stores information about trees (tree output files) -- cerating the Ada environment processed by a given Context with A4G.A_Types; use A4G.A_Types; with Types; use Types; package A4G.Tree_Rec is -- See the A4G.Contt.TT package for the details of maintaining -- the tree tables ------------------------------ -- Tree_Rec type definition -- ------------------------------ -- Similar to the Contexts' Unit tabl‚es and Source File tables, -- Tree tables are organised as Name tables (for the names of the -- tree files), and each entry in such a Name table has additional -- fields for information related to tree files handling in ASIS. type Tree_Record is record -------------------------------- -- Fields for Tree Name Table -- -------------------------------- Tree_Name_Chars_Index : Int; -- Starting locations of characters in the Name_Chars table minus -- one (i.e. pointer to character just before first character). The -- reason for the bias of one is that indexes in Name_Buffer are -- one's origin, so this avoids unnecessary adds and subtracts of 1. Tree_Name_Len : Short; -- Lengths of the names in characters Int_Info : Int; -- Int Value associated with this tree --------------------- -- Tree attributes -- --------------------- Main_Unit : Unit_Id; -- The ASIS Compilation Unit, correspondig to the main unit in -- the tree Main_Top : Node_Id; -- The top node (having N_Compilation_Unit Node Kind) of Main_Unit -- DO WE REALLY NEED IT? Units : Elist_Id; -- The list of all the Units (or all the Units except Main_Unit?) -- which may be processed on the base of this tree, [each Unit -- is accompanied by its top node, which it has in the given tree -- ??? Not implemented for now!] end record; end A4G.Tree_Rec;
docandrew/YOTROC
Ada
7,819
adb
with Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Interfaces; use Interfaces; with Glib; with Glib.Error; use Glib.Error; with Glib.Object; with Gdk.Cursor; with Gtk; with Gtk.Application_Window; with Gtk.Box; with Gtk.Editable; with Gtk.GEntry; with Gtk.Handlers; with Gtk.List_Store; with Gtk.Tree_Model; with Gtk.Widget; use Gtk.Widget; with Gtk.Main; with Gtk.Status_Bar; with Gtk.Text_View; with Gtk.Text_Buffer; with Gtk.Window; with Gtkada.Builder; use Gtkada.Builder; with Pango.Font; with callbacks; with util; with vm; package body gui is --use ASCII; error : aliased Glib.Error.GError; returnCode : Glib.Guint; contextDescription : String := "normal"; procedure registerHandlers is begin builder.Register_Handler(Handler_Name => "try_quit_cb", Handler => callbacks.tryQuit'Access); builder.Register_Handler(Handler_Name => "Main_Quit", Handler => callbacks.quit'Access); builder.Register_Handler(Handler_Name => "assembleButton1_clicked_cb", Handler => callbacks.assembleCB'Access); builder.Register_Handler(Handler_Name => "stepButton1_clicked_cb", Handler => callbacks.stepCB'Access); --builder.Register_Handler(Handler_Name => "runButton1_clicked_cb", Handler => callbacks.runCB'Access); --builder.Register_Handler(Handler_Name => "stopButton_clicked_cb", Handler => callbacks.stopCB'Access); builder.Register_Handler(Handler_Name => "newMenuItem_activate_cb", Handler => callbacks.newCB'Access); builder.Register_Handler(Handler_Name => "openMenuItem_activate_cb", Handler => callbacks.openCB'Access); builder.Register_Handler(Handler_Name => "saveMenuItem_activate_cb", Handler => callbacks.saveCB'Access); builder.Register_Handler(Handler_Name => "saveAsMenuItem_activate_cb", Handler => callbacks.saveAsCB'Access); builder.Register_Handler(Handler_Name => "aboutMenu_activate_cb", Handler => callbacks.aboutCB'Access); -- the normal register handler function doesn't work here textbuf := Gtk.Text_View.Gtk_Text_View(Gtkada.Builder.Get_Object(builder, "textview1")).Get_Buffer; callbacks.text.Connect(Widget => textbuf, Name => Gtk.Text_Buffer.Signal_Changed, Cb => callbacks.editCB'Access); --builder.Register_Handler(Handler_Name => "textview1_key_release_event_cb", Handler => callbacks.keypressCB'Access); end registerHandlers; -- Load our GUI description from the XML file and display it. procedure load is use Gtk.Box; use Gtk.List_Store; use Gtk.Status_Bar; -- font for the GtkTextView font : Pango.Font.Pango_Font_Description; textbufObj : Glib.Object.GObject; textbufWidget : Gtk_Widget; vbox : Gtk.Box.Gtk_Vbox; begin Gtk.Main.Init; Gtkada.Builder.Gtk_New (builder); returnCode := Gtkada.Builder.Add_From_File(builder, "../yotroc_gui.xml", error'Access); if error /= null then Ada.Text_IO.Put_Line("Error: " & Get_Message(error)); Error_Free(error); return; end if; registerHandlers; Gtkada.Builder.Do_Connect (builder); -- pull references to the various GTK widgets we defined in the GUI .xml file. topLevelWindow := Gtk_Widget(Gtkada.Builder.Get_Object(builder, "applicationwindow1")); machinecodeList := Gtk_List_Store(Gtkada.Builder.Get_Object(gui.builder, "machinecodeList")); memoryList := Gtk_List_Store(Gtkada.Builder.Get_Object(gui.builder, "memoryList")); registerList := Gtk_List_Store(Gtkada.Builder.Get_Object(gui.builder, "registerList")); vbox := Gtk_VBox(Gtkada.Builder.Get_Object(gui.builder, "vbox")); -- we add the status bar manually because for whatever reason Glade didn't like our status bar Gtk.Status_Bar.Gtk_New(statusBar); Pack_End(vbox, statusBar, False, False, 0); --statusBar := Gtk_Status_Bar(Gtkada.Builder.Get_Object(gui.builder, "statusBar1")); if statusBar = null then Ada.Text_IO.Put_Line("status bar null"); end if; font := Pango.Font.To_Font_Description(Family_Name => "Monospace", Size => Glib.Gint(11)); textbufObj := Gtkada.Builder.Get_Object(builder, "textview1"); textbuf := Gtk.Text_View.Gtk_Text_View(textbufObj).Get_Buffer; textbufWidget := Gtk_Widget(textbufObj); textbufWidget.Modify_Font(font); Gtk.Widget.Show_All(topLevelWindow); -- Start the Gtk+ main loop (blocked until Gtk.Main.Quit called in callbacks) Gtk.Main.Main; Unref(Builder); end; -- set the application window title procedure setTitle(newTitle : String) is use Gtk.Application_Window; appWindow : Gtk_Application_Window; begin appWindow := Gtk_Application_Window(Gtkada.Builder.Get_Object(builder, "applicationwindow1")); appWindow.Set_Title(Title => newTitle); end setTitle; ----------------------------------------------------------------------------- -- updateGUI_VM -- poll the VM and update the register and memory contents on the GUI with -- what the VM is showing. ----------------------------------------------------------------------------- procedure updateGUI_VM is use Gtk.List_Store; use Gtk.Tree_Model; use vm; listIter : Gtk_Tree_Iter; --memListIter : Gtk_Tree_Iter; status : Unbounded_String; ret : Gtk.Status_Bar.Message_Id; begin -- for now, just blow away and reload the list each time. We'll figure out -- how to do updates later. registerList.Clear; listIter := registerList.Get_Iter_First; --Ada.Text_IO.Put_Line(" adding " & Integer(machinecode.Length)'Image & " instructions to liststore"); for i in vm.regs'Range loop --Ada.Text_IO.Put_Line(" adding element to registerList " & i'Image); registerList.Append(Iter => listIter); registerList.Set(Iter => listIter, Column => 0, Value => Register'Image(i)); -- display floating-point values natively if i in vm.FloatRegister then registerList.Set(Iter => listIter, Column => 1, Value => util.toDouble(vm.regs(i))'Image); else registerList.Set(Iter => listIter, Column => 1, Value => util.toHexString(vm.regs(i))); end if; end loop; memoryList.Clear; listIter := memoryList.Get_Iter_First; for i in vm.memory'Range loop --Ada.Text_IO.Put_Line(" adding element to memoryList " & i'Image); memoryList.Append(Iter => listIter); memoryList.Set(Iter => listIter, Column => 0, Value => util.toHexString(Unsigned_64(Natural(i)))); memoryList.Set(Iter => listIter, Column => 1, Value => util.toHexString(vm.memory(Natural(i)))); end loop; status := To_Unbounded_String("PC: " & util.toHexString(vm.regs(pc)) & " Z: " & vm.flags.zero'Image & " OF: " & vm.flags.overflow'Image & " EQ: " & vm.flags.eq'Image); --statusBarContext := Get_Context_Id(Context_Description => contextDescription); --statusBar.Remove_All(Context => statusBarContext); ret := Gtk.Status_Bar.Push(statusBar, 1, To_String(status)); end updateGUI_VM; end gui;
Lyanf/pok
Ada
2,884
ads
-- --------------------------------------------------------------------------- -- -- -- QUEUING PORT constant and type definitions and management services -- -- -- -- --------------------------------------------------------------------------- with APEX.Processes; package APEX.Queuing_Ports is Max_Number_Of_Queuing_Ports : constant := System_Limit_Number_Of_Queuing_Ports; subtype Queuing_Port_Name_Type is Name_Type; type Queuing_Port_Id_Type is private; Null_Queuing_Port_Id : constant Queuing_Port_Id_Type; type Queuing_Port_Status_Type is record Nb_Message : Message_Range_Type; Max_Nb_Message : Message_Range_Type; Max_Message_Size : Message_Size_Type; Port_Direction : Port_Direction_Type; Waiting_Processes : APEX.Processes.Waiting_Range_Type; end record; procedure Create_Queuing_Port (Queuing_Port_Name : in Queuing_Port_Name_Type; Max_Message_Size : in Message_Size_Type; Max_Nb_Message : in Message_Range_Type; Port_Direction : in Port_Direction_Type; Queuing_Discipline : in Queuing_Discipline_Type; Queuing_Port_Id : out Queuing_Port_Id_Type; Return_Code : out Return_Code_Type); procedure Send_Queuing_Message (Queuing_Port_Id : in Queuing_Port_Id_Type; Message_Addr : in Message_Addr_Type; Length : in Message_Size_Type; Time_Out : in System_Time_Type; Return_Code : out Return_Code_Type); procedure Receive_Queuing_Message (Queuing_Port_Id : in Queuing_Port_Id_Type; Time_Out : in System_Time_Type; Message_Addr : in Message_Addr_Type; -- The message address is passed IN, although the respective message is -- passed OUT Length : out Message_Size_Type; Return_Code : out Return_Code_Type); procedure Get_Queuing_Port_Id (Queuing_Port_Name : in Queuing_Port_Name_Type; Queuing_Port_Id : out Queuing_Port_Id_Type; Return_Code : out Return_Code_Type); procedure Get_Queuing_Port_Status (Queuing_Port_Id : in Queuing_Port_Id_Type; Queuing_Port_Status : out Queuing_Port_Status_Type; Return_Code : out Return_Code_Type); private type Queuing_Port_Id_Type is new APEX_Integer; Null_Queuing_Port_Id : constant Queuing_Port_Id_Type := 0; pragma Convention (C, Queuing_Port_Status_Type); -- POK BINDINGS pragma Import (C, Create_Queuing_Port, "CREATE_QUEUING_PORT"); pragma Import (C, Send_Queuing_Message, "SEND_QUEUING_PORT_MESSAGE"); pragma Import (C, Receive_Queuing_Message, "RECEIVE_QUEUING_MESSAGE"); pragma Import (C, Get_Queuing_Port_Id, "GET_QUEUING_PORT_ID"); pragma Import (C, Get_Queuing_Port_Status, "GET_QUEUING_PORT_STATUS"); -- END OF POK BINDINGS end APEX.Queuing_Ports;
AdaCore/gpr
Ada
2,901
adb
-- -- Copyright (C) 2019-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 -- with Ada.Text_IO; with Ada.Strings.Fixed; with GPR2.Context; with GPR2.Project.Attribute.Set; with GPR2.Project.Tree; with GPR2.Project.Variable.Set; with GPR2.Project.View; procedure Main is use Ada; use GPR2; use GPR2.Project; procedure Display (Prj : Project.View.Object); procedure Display (Att : Project.Attribute.Object); procedure Load (Filename : Filename_Type); ------------- -- Display -- ------------- procedure Display (Att : Project.Attribute.Object) is begin Text_IO.Put (" " & Image (Att.Name.Id.Attr)); if Att.Has_Index then Text_IO.Put (" (" & Att.Index.Text & ")"); end if; Text_IO.Put (" ->"); for V of Att.Values loop Text_IO.Put (" " & V.Text); end loop; Text_IO.New_Line; end Display; procedure Display (Prj : Project.View.Object) is use GPR2.Project.Attribute.Set; use GPR2.Project.Variable.Set.Set; begin Text_IO.Put (String (Prj.Name) & " "); Text_IO.Set_Col (10); Text_IO.Put_Line (Prj.Qualifier'Img); for A of Prj.Attributes (With_Defaults => False) loop Display (A); end loop; if Prj.Has_Variables then for V in Prj.Variables.Iterate loop Text_IO.Put ("V: " & String (Key (V))); Text_IO.Put (" -> "); Text_IO.Put (Element (V).Value.Text); Text_IO.New_Line; end loop; end if; for Pck of Prj.Packages (With_Defaults => False) loop Text_IO.Put_Line (" " & Image (Pck)); for A of Prj.Attributes (Pack => Pck, With_Defaults => False) loop Display (A); end loop; end loop; Text_IO.New_Line; end Display; ---------- -- Load -- ---------- procedure Load (Filename : Filename_Type) is Prj : Project.Tree.Object; Ctx : Context.Object; begin Project.Tree.Load (Prj, Create (Filename), Ctx); Display (Prj.Root_Project); exception when GPR2.Project_Error => if Prj.Has_Messages then Text_IO.Put_Line ("Messages found for " & String (Filename)); for M of Prj.Log_Messages.all loop declare Mes : constant String := M.Format; L : constant Natural := Strings.Fixed.Index (Mes, "aggregate-dup"); begin if L /= 0 then Text_IO.Put_Line (Mes (L - 1 .. Mes'Last)); else Text_IO.Put_Line (Mes); end if; end; end loop; Text_IO.New_Line; end if; end Load; Prj : Project.Tree.Object; Ctx : Context.Object; begin Load ("demo.gpr"); Load ("demo1.gpr"); end Main;
reznikmm/matreshka
Ada
4,255
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- Abstract interface of SOAP fault encoder. Application specific encoders -- must be derived from this interface type. ------------------------------------------------------------------------------ with XML.SAX.Writers; package Web_Services.SOAP.Payloads.Faults.Encoders is -- pragma Preelaborate; type SOAP_Fault_Encoder is limited interface; type SOAP_Fault_Encoder_Access is access all SOAP_Fault_Encoder'Class; not overriding function Create (Dummy : not null access Boolean) return SOAP_Fault_Encoder is abstract; -- This subprogram is used by dispatching constructor to create instance of -- the encoder. not overriding procedure Encode (Self : SOAP_Fault_Encoder; Message : Web_Services.SOAP.Payloads.Faults.Abstract_SOAP_Fault'Class; Writer : in out XML.SAX.Writers.SAX_Writer'Class) is abstract; end Web_Services.SOAP.Payloads.Faults.Encoders;
reznikmm/matreshka
Ada
3,588
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements.Generic_Hash; function AMF.UML.Gates.Hash is new AMF.Elements.Generic_Hash (UML_Gate, UML_Gate_Access);
stcarrez/ada-util
Ada
3,012
ads
----------------------------------------------------------------------- -- util-beans-basic-ranges -- Range of values with helper for list iteration -- Copyright (C) 2011, 2022 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Beans.Objects; -- The <b>Util.Beans.Basic.Ranges</b> generic package defines an object that holds -- a range definition. It implements the <b>List_Bean</b> interface which allows to -- iterate over the values of the defined range. generic type T is (<>); with function To_Object (From : in T) return Util.Beans.Objects.Object is <>; package Util.Beans.Basic.Ranges is -- ------------------------------ -- Range of discrete values -- ------------------------------ -- The <b>Range_Bean</b> defines a discrete range. It holds a lower and upper bound. -- A current value is also used for the <b>List_Bean</b> interface to iterate over the range. type Range_Bean is new Util.Beans.Basic.List_Bean with private; type Range_Bean_Access is access all Range_Bean'Class; -- Create a range definition. function Create (First, Last : in T) return Range_Bean; -- Get the range lower bound. function Get_First (From : in Range_Bean) return T; -- Get the range upper bound. function Get_Last (From : in Range_Bean) return T; -- Get the current value within the first/last bounds. function Get_Current (From : in Range_Bean) return T; -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. overriding function Get_Value (From : in Range_Bean; Name : in String) return Util.Beans.Objects.Object; -- Get the number of elements in the list. overriding function Get_Count (From : in Range_Bean) return Natural; -- Set the current row index. Valid row indexes start at 1. overriding procedure Set_Row_Index (From : in out Range_Bean; Index : in Natural); -- Get the element at the current row index. overriding function Get_Row (From : in Range_Bean) return Util.Beans.Objects.Object; private type Range_Bean is new Util.Beans.Basic.List_Bean with record First : T := T'First; Last : T := T'First; Current : T := T'First; end record; end Util.Beans.Basic.Ranges;
AdaCore/gpr
Ada
3,318
adb
-- -- Copyright (C) 2019-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 -- with Ada.Directories; with Ada.Text_IO; with GPR2.Project.View; with GPR2.Project.Tree; with GPR2.Project.Attribute.Set; with GPR2.Project.Name_Values; with GPR2.Project.Registry.Attribute; with GPR2.Project.Variable.Set; with GPR2.Context; procedure Main is use Ada; use GPR2; use GPR2.Project; use GPR2.Project.Registry.Attribute; use all type GPR2.Project.Name_Values.Value_Kind; procedure Display (Prj : Project.View.Object; Full : Boolean := True); ------------- -- Display -- ------------- procedure Display (Prj : Project.View.Object; Full : Boolean := True) is use GPR2.Project.Attribute.Set; use GPR2.Project.Variable.Set.Set; begin Text_IO.Put (String (Prj.Name) & " "); Text_IO.Set_Col (10); Text_IO.Put_Line (Prj.Qualifier'Img); if Full then for A in Prj.Attributes (With_Defaults => False).Iterate loop Text_IO.Put ("A: " & Image (Attribute.Set.Element (A).Name.Id.Attr)); Text_IO.Put (" ->"); for V of Attribute.Set.Element (A).Values loop Text_IO.Put (" " & V.Text); end loop; Text_IO.New_Line; end loop; for A in Prj.Attributes.Filter (Object_Dir.Attr).Iterate loop Text_IO.Put ("A2: " & Image (Attribute.Set.Element (A).Name.Id.Attr)); Text_IO.Put (" ->"); for V of Attribute.Set.Element (A).Values loop Text_IO.Put (" " & V.Text); end loop; Text_IO.New_Line; end loop; for A of Prj.Attributes.Filter (Object_Dir.Attr) loop Text_IO.Put_Line ("A3: " & Image (A.Name.Id.Attr) & " -> " & A.Value.Text); end loop; if Prj.Has_Variables then for V in Prj.Variables.Iterate loop Text_IO.Put ("V: " & String (Key (V))); Text_IO.Put (" ->"); if Element (V).Kind = Single then declare Value : constant Value_Type := Element (V).Value.Text; function No_Last_Slash (Dir : String) return String is (if Dir'Length > 0 and then Dir (Dir'Last) in '\' | '/' then Dir (Dir'First .. Dir'Last - 1) else Dir); begin Text_IO.Put (" " & (if No_Last_Slash (Value) = No_Last_Slash (Directories.Current_Directory) then "{Current_Directory}" else Value)); end; else for Val of Element (V).Values loop Text_IO.Put (" " & Val.Text); end loop; end if; Text_IO.New_Line; end loop; end if; end if; end Display; Prj : Project.Tree.Object; Ctx : Context.Object; begin Ctx.Include ("OS", "Linux"); Project.Tree.Load (Prj, Create ("demo.gpr"), Ctx); Display (Prj.Root_Project); exception when Project_Error => for M of Prj.Log_Messages.all loop Text_IO.Put_Line (M.Format); end loop; end Main;
charlie5/aShell
Ada
773
adb
with Shell.Commands.Safe, Ada.Text_IO; procedure Test_Safe_Pipeline_Output is use Ada.Text_IO; begin Put_Line ("Begin 'Pipeline_Output' test."); New_Line (2); for i in 1 .. 10 loop declare use Shell, Shell.Commands, Shell.Commands.Safe, Shell.Commands.Safe.Forge; -- Commands : Command_Array := To_Commands ("ps -A | grep bash | wc"); Commands : Command_Array := To_Commands ("ps -A | grep bash"); Output : constant String := +Output_Of (Run (Commands)); begin Put_Line ("'" & Output & "'"); end; end loop; New_Line (2); Put_Line ("End 'Pipeline_Output' test."); delay 5 * 60.0; Shell.Commands.Safe.Stop_Spawn_Client; end Test_Safe_Pipeline_Output;
AdaCore/gpr
Ada
73
ads
package Q is function F return Boolean; pragma Inline (F); end Q;
docandrew/troodon
Ada
31,169
ads
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; -- Troodon: renamed this to X11 to deconflict with the use of 'x' as coordinate package X11 is X_PROTOCOL : constant := 11; -- /usr/include/X11/X.h:53 X_PROTOCOL_REVISION : constant := 0; -- /usr/include/X11/X.h:54 None : constant := 0; -- /usr/include/X11/X.h:115 ParentRelative : constant := 1; -- /usr/include/X11/X.h:118 CopyFromParent : constant := 0; -- /usr/include/X11/X.h:121 PointerWindow : constant := 0; -- /usr/include/X11/X.h:126 InputFocus : constant := 1; -- /usr/include/X11/X.h:127 PointerRoot : constant := 1; -- /usr/include/X11/X.h:129 AnyPropertyType : constant := 0; -- /usr/include/X11/X.h:131 AnyKey : constant := 0; -- /usr/include/X11/X.h:133 AnyButton : constant := 0; -- /usr/include/X11/X.h:135 AllTemporary : constant := 0; -- /usr/include/X11/X.h:137 CurrentTime : constant := 0; -- /usr/include/X11/X.h:139 NoSymbol : constant := 0; -- /usr/include/X11/X.h:141 NoEventMask : constant := 0; -- /usr/include/X11/X.h:150 KeyPressMask : constant := (2**0); -- /usr/include/X11/X.h:151 KeyReleaseMask : constant := (2**1); -- /usr/include/X11/X.h:152 ButtonPressMask : constant := (2**2); -- /usr/include/X11/X.h:153 ButtonReleaseMask : constant := (2**3); -- /usr/include/X11/X.h:154 EnterWindowMask : constant := (2**4); -- /usr/include/X11/X.h:155 LeaveWindowMask : constant := (2**5); -- /usr/include/X11/X.h:156 PointerMotionMask : constant := (2**6); -- /usr/include/X11/X.h:157 PointerMotionHintMask : constant := (2**7); -- /usr/include/X11/X.h:158 Button1MotionMask : constant := (2**8); -- /usr/include/X11/X.h:159 Button2MotionMask : constant := (2**9); -- /usr/include/X11/X.h:160 Button3MotionMask : constant := (2**10); -- /usr/include/X11/X.h:161 Button4MotionMask : constant := (2**11); -- /usr/include/X11/X.h:162 Button5MotionMask : constant := (2**12); -- /usr/include/X11/X.h:163 ButtonMotionMask : constant := (2**13); -- /usr/include/X11/X.h:164 KeymapStateMask : constant := (2**14); -- /usr/include/X11/X.h:165 ExposureMask : constant := (2**15); -- /usr/include/X11/X.h:166 VisibilityChangeMask : constant := (2**16); -- /usr/include/X11/X.h:167 StructureNotifyMask : constant := (2**17); -- /usr/include/X11/X.h:168 ResizeRedirectMask : constant := (2**18); -- /usr/include/X11/X.h:169 SubstructureNotifyMask : constant := (2**19); -- /usr/include/X11/X.h:170 SubstructureRedirectMask : constant := (2**20); -- /usr/include/X11/X.h:171 FocusChangeMask : constant := (2**21); -- /usr/include/X11/X.h:172 PropertyChangeMask : constant := (2**22); -- /usr/include/X11/X.h:173 ColormapChangeMask : constant := (2**23); -- /usr/include/X11/X.h:174 OwnerGrabButtonMask : constant := (2**24); -- /usr/include/X11/X.h:175 KeyPress : constant := 2; -- /usr/include/X11/X.h:181 KeyRelease : constant := 3; -- /usr/include/X11/X.h:182 ButtonPress : constant := 4; -- /usr/include/X11/X.h:183 ButtonRelease : constant := 5; -- /usr/include/X11/X.h:184 MotionNotify : constant := 6; -- /usr/include/X11/X.h:185 EnterNotify : constant := 7; -- /usr/include/X11/X.h:186 LeaveNotify : constant := 8; -- /usr/include/X11/X.h:187 FocusIn : constant := 9; -- /usr/include/X11/X.h:188 FocusOut : constant := 10; -- /usr/include/X11/X.h:189 KeymapNotify : constant := 11; -- /usr/include/X11/X.h:190 Expose : constant := 12; -- /usr/include/X11/X.h:191 GraphicsExpose : constant := 13; -- /usr/include/X11/X.h:192 NoExpose : constant := 14; -- /usr/include/X11/X.h:193 VisibilityNotify : constant := 15; -- /usr/include/X11/X.h:194 CreateNotify : constant := 16; -- /usr/include/X11/X.h:195 DestroyNotify : constant := 17; -- /usr/include/X11/X.h:196 UnmapNotify : constant := 18; -- /usr/include/X11/X.h:197 MapNotify : constant := 19; -- /usr/include/X11/X.h:198 MapRequest : constant := 20; -- /usr/include/X11/X.h:199 ReparentNotify : constant := 21; -- /usr/include/X11/X.h:200 ConfigureNotify : constant := 22; -- /usr/include/X11/X.h:201 ConfigureRequest : constant := 23; -- /usr/include/X11/X.h:202 GravityNotify : constant := 24; -- /usr/include/X11/X.h:203 ResizeRequest : constant := 25; -- /usr/include/X11/X.h:204 CirculateNotify : constant := 26; -- /usr/include/X11/X.h:205 CirculateRequest : constant := 27; -- /usr/include/X11/X.h:206 PropertyNotify : constant := 28; -- /usr/include/X11/X.h:207 SelectionClear : constant := 29; -- /usr/include/X11/X.h:208 SelectionRequest : constant := 30; -- /usr/include/X11/X.h:209 SelectionNotify : constant := 31; -- /usr/include/X11/X.h:210 ColormapNotify : constant := 32; -- /usr/include/X11/X.h:211 ClientMessage : constant := 33; -- /usr/include/X11/X.h:212 MappingNotify : constant := 34; -- /usr/include/X11/X.h:213 GenericEvent : constant := 35; -- /usr/include/X11/X.h:214 LASTEvent : constant := 36; -- /usr/include/X11/X.h:215 ShiftMask : constant := (2**0); -- /usr/include/X11/X.h:221 LockMask : constant := (2**1); -- /usr/include/X11/X.h:222 ControlMask : constant := (2**2); -- /usr/include/X11/X.h:223 Mod1Mask : constant := (2**3); -- /usr/include/X11/X.h:224 Mod2Mask : constant := (2**4); -- /usr/include/X11/X.h:225 Mod3Mask : constant := (2**5); -- /usr/include/X11/X.h:226 Mod4Mask : constant := (2**6); -- /usr/include/X11/X.h:227 Mod5Mask : constant := (2**7); -- /usr/include/X11/X.h:228 ShiftMapIndex : constant := 0; -- /usr/include/X11/X.h:233 LockMapIndex : constant := 1; -- /usr/include/X11/X.h:234 ControlMapIndex : constant := 2; -- /usr/include/X11/X.h:235 Mod1MapIndex : constant := 3; -- /usr/include/X11/X.h:236 Mod2MapIndex : constant := 4; -- /usr/include/X11/X.h:237 Mod3MapIndex : constant := 5; -- /usr/include/X11/X.h:238 Mod4MapIndex : constant := 6; -- /usr/include/X11/X.h:239 Mod5MapIndex : constant := 7; -- /usr/include/X11/X.h:240 Button1Mask : constant := (2**8); -- /usr/include/X11/X.h:246 Button2Mask : constant := (2**9); -- /usr/include/X11/X.h:247 Button3Mask : constant := (2**10); -- /usr/include/X11/X.h:248 Button4Mask : constant := (2**11); -- /usr/include/X11/X.h:249 Button5Mask : constant := (2**12); -- /usr/include/X11/X.h:250 AnyModifier : constant := (2**15); -- /usr/include/X11/X.h:252 Button1 : constant := 1; -- /usr/include/X11/X.h:259 Button2 : constant := 2; -- /usr/include/X11/X.h:260 Button3 : constant := 3; -- /usr/include/X11/X.h:261 Button4 : constant := 4; -- /usr/include/X11/X.h:262 Button5 : constant := 5; -- /usr/include/X11/X.h:263 NotifyNormal : constant := 0; -- /usr/include/X11/X.h:267 NotifyGrab : constant := 1; -- /usr/include/X11/X.h:268 NotifyUngrab : constant := 2; -- /usr/include/X11/X.h:269 NotifyWhileGrabbed : constant := 3; -- /usr/include/X11/X.h:270 NotifyHint : constant := 1; -- /usr/include/X11/X.h:272 NotifyAncestor : constant := 0; -- /usr/include/X11/X.h:276 NotifyVirtual : constant := 1; -- /usr/include/X11/X.h:277 NotifyInferior : constant := 2; -- /usr/include/X11/X.h:278 NotifyNonlinear : constant := 3; -- /usr/include/X11/X.h:279 NotifyNonlinearVirtual : constant := 4; -- /usr/include/X11/X.h:280 NotifyPointer : constant := 5; -- /usr/include/X11/X.h:281 NotifyPointerRoot : constant := 6; -- /usr/include/X11/X.h:282 NotifyDetailNone : constant := 7; -- /usr/include/X11/X.h:283 VisibilityUnobscured : constant := 0; -- /usr/include/X11/X.h:287 VisibilityPartiallyObscured : constant := 1; -- /usr/include/X11/X.h:288 VisibilityFullyObscured : constant := 2; -- /usr/include/X11/X.h:289 PlaceOnTop : constant := 0; -- /usr/include/X11/X.h:293 PlaceOnBottom : constant := 1; -- /usr/include/X11/X.h:294 FamilyInternet : constant := 0; -- /usr/include/X11/X.h:298 FamilyDECnet : constant := 1; -- /usr/include/X11/X.h:299 FamilyChaos : constant := 2; -- /usr/include/X11/X.h:300 FamilyInternet6 : constant := 6; -- /usr/include/X11/X.h:301 FamilyServerInterpreted : constant := 5; -- /usr/include/X11/X.h:304 PropertyNewValue : constant := 0; -- /usr/include/X11/X.h:308 PropertyDelete : constant := 1; -- /usr/include/X11/X.h:309 ColormapUninstalled : constant := 0; -- /usr/include/X11/X.h:313 ColormapInstalled : constant := 1; -- /usr/include/X11/X.h:314 GrabModeSync : constant := 0; -- /usr/include/X11/X.h:318 GrabModeAsync : constant := 1; -- /usr/include/X11/X.h:319 GrabSuccess : constant := 0; -- /usr/include/X11/X.h:323 AlreadyGrabbed : constant := 1; -- /usr/include/X11/X.h:324 GrabInvalidTime : constant := 2; -- /usr/include/X11/X.h:325 GrabNotViewable : constant := 3; -- /usr/include/X11/X.h:326 GrabFrozen : constant := 4; -- /usr/include/X11/X.h:327 AsyncPointer : constant := 0; -- /usr/include/X11/X.h:331 SyncPointer : constant := 1; -- /usr/include/X11/X.h:332 ReplayPointer : constant := 2; -- /usr/include/X11/X.h:333 AsyncKeyboard : constant := 3; -- /usr/include/X11/X.h:334 SyncKeyboard : constant := 4; -- /usr/include/X11/X.h:335 ReplayKeyboard : constant := 5; -- /usr/include/X11/X.h:336 AsyncBoth : constant := 6; -- /usr/include/X11/X.h:337 SyncBoth : constant := 7; -- /usr/include/X11/X.h:338 -- unsupported macro: RevertToNone (int)None -- unsupported macro: RevertToPointerRoot (int)PointerRoot RevertToParent : constant := 2; -- /usr/include/X11/X.h:344 Success : constant := 0; -- /usr/include/X11/X.h:350 BadRequest : constant := 1; -- /usr/include/X11/X.h:351 BadValue : constant := 2; -- /usr/include/X11/X.h:352 BadWindow : constant := 3; -- /usr/include/X11/X.h:353 BadPixmap : constant := 4; -- /usr/include/X11/X.h:354 BadAtom : constant := 5; -- /usr/include/X11/X.h:355 BadCursor : constant := 6; -- /usr/include/X11/X.h:356 BadFont : constant := 7; -- /usr/include/X11/X.h:357 BadMatch : constant := 8; -- /usr/include/X11/X.h:358 BadDrawable : constant := 9; -- /usr/include/X11/X.h:359 BadAccess : constant := 10; -- /usr/include/X11/X.h:360 BadAlloc : constant := 11; -- /usr/include/X11/X.h:369 BadColor : constant := 12; -- /usr/include/X11/X.h:370 BadGC : constant := 13; -- /usr/include/X11/X.h:371 BadIDChoice : constant := 14; -- /usr/include/X11/X.h:372 BadName : constant := 15; -- /usr/include/X11/X.h:373 BadLength : constant := 16; -- /usr/include/X11/X.h:374 BadImplementation : constant := 17; -- /usr/include/X11/X.h:375 FirstExtensionError : constant := 128; -- /usr/include/X11/X.h:377 LastExtensionError : constant := 255; -- /usr/include/X11/X.h:378 InputOutput : constant := 1; -- /usr/include/X11/X.h:387 InputOnly : constant := 2; -- /usr/include/X11/X.h:388 CWBackPixmap : constant := (2**0); -- /usr/include/X11/X.h:392 CWBackPixel : constant := (2**1); -- /usr/include/X11/X.h:393 CWBorderPixmap : constant := (2**2); -- /usr/include/X11/X.h:394 CWBorderPixel : constant := (2**3); -- /usr/include/X11/X.h:395 CWBitGravity : constant := (2**4); -- /usr/include/X11/X.h:396 CWWinGravity : constant := (2**5); -- /usr/include/X11/X.h:397 CWBackingStore : constant := (2**6); -- /usr/include/X11/X.h:398 CWBackingPlanes : constant := (2**7); -- /usr/include/X11/X.h:399 CWBackingPixel : constant := (2**8); -- /usr/include/X11/X.h:400 CWOverrideRedirect : constant := (2**9); -- /usr/include/X11/X.h:401 CWSaveUnder : constant := (2**10); -- /usr/include/X11/X.h:402 CWEventMask : constant := (2**11); -- /usr/include/X11/X.h:403 CWDontPropagate : constant := (2**12); -- /usr/include/X11/X.h:404 CWColormap : constant := (2**13); -- /usr/include/X11/X.h:405 CWCursor : constant := (2**14); -- /usr/include/X11/X.h:406 CWX : constant := (2**0); -- /usr/include/X11/X.h:410 CWY : constant := (2**1); -- /usr/include/X11/X.h:411 CWWidth : constant := (2**2); -- /usr/include/X11/X.h:412 CWHeight : constant := (2**3); -- /usr/include/X11/X.h:413 CWBorderWidth : constant := (2**4); -- /usr/include/X11/X.h:414 CWSibling : constant := (2**5); -- /usr/include/X11/X.h:415 CWStackMode : constant := (2**6); -- /usr/include/X11/X.h:416 ForgetGravity : constant := 0; -- /usr/include/X11/X.h:421 NorthWestGravity : constant := 1; -- /usr/include/X11/X.h:422 NorthGravity : constant := 2; -- /usr/include/X11/X.h:423 NorthEastGravity : constant := 3; -- /usr/include/X11/X.h:424 WestGravity : constant := 4; -- /usr/include/X11/X.h:425 CenterGravity : constant := 5; -- /usr/include/X11/X.h:426 EastGravity : constant := 6; -- /usr/include/X11/X.h:427 SouthWestGravity : constant := 7; -- /usr/include/X11/X.h:428 SouthGravity : constant := 8; -- /usr/include/X11/X.h:429 SouthEastGravity : constant := 9; -- /usr/include/X11/X.h:430 StaticGravity : constant := 10; -- /usr/include/X11/X.h:431 UnmapGravity : constant := 0; -- /usr/include/X11/X.h:435 NotUseful : constant := 0; -- /usr/include/X11/X.h:439 WhenMapped : constant := 1; -- /usr/include/X11/X.h:440 Always : constant := 2; -- /usr/include/X11/X.h:441 IsUnmapped : constant := 0; -- /usr/include/X11/X.h:445 IsUnviewable : constant := 1; -- /usr/include/X11/X.h:446 IsViewable : constant := 2; -- /usr/include/X11/X.h:447 SetModeInsert : constant := 0; -- /usr/include/X11/X.h:451 SetModeDelete : constant := 1; -- /usr/include/X11/X.h:452 DestroyAll : constant := 0; -- /usr/include/X11/X.h:456 RetainPermanent : constant := 1; -- /usr/include/X11/X.h:457 RetainTemporary : constant := 2; -- /usr/include/X11/X.h:458 Above : constant := 0; -- /usr/include/X11/X.h:462 Below : constant := 1; -- /usr/include/X11/X.h:463 TopIf : constant := 2; -- /usr/include/X11/X.h:464 BottomIf : constant := 3; -- /usr/include/X11/X.h:465 Opposite : constant := 4; -- /usr/include/X11/X.h:466 RaiseLowest : constant := 0; -- /usr/include/X11/X.h:470 LowerHighest : constant := 1; -- /usr/include/X11/X.h:471 PropModeReplace : constant := 0; -- /usr/include/X11/X.h:475 PropModePrepend : constant := 1; -- /usr/include/X11/X.h:476 PropModeAppend : constant := 2; -- /usr/include/X11/X.h:477 GXclear : constant := 16#0#; -- /usr/include/X11/X.h:485 GXand : constant := 16#1#; -- /usr/include/X11/X.h:486 GXandReverse : constant := 16#2#; -- /usr/include/X11/X.h:487 GXcopy : constant := 16#3#; -- /usr/include/X11/X.h:488 GXandInverted : constant := 16#4#; -- /usr/include/X11/X.h:489 GXnoop : constant := 16#5#; -- /usr/include/X11/X.h:490 GXxor : constant := 16#6#; -- /usr/include/X11/X.h:491 GXor : constant := 16#7#; -- /usr/include/X11/X.h:492 GXnor : constant := 16#8#; -- /usr/include/X11/X.h:493 GXequiv : constant := 16#9#; -- /usr/include/X11/X.h:494 GXinvert : constant := 16#a#; -- /usr/include/X11/X.h:495 GXorReverse : constant := 16#b#; -- /usr/include/X11/X.h:496 GXcopyInverted : constant := 16#c#; -- /usr/include/X11/X.h:497 GXorInverted : constant := 16#d#; -- /usr/include/X11/X.h:498 GXnand : constant := 16#e#; -- /usr/include/X11/X.h:499 GXset : constant := 16#f#; -- /usr/include/X11/X.h:500 LineSolid : constant := 0; -- /usr/include/X11/X.h:504 LineOnOffDash : constant := 1; -- /usr/include/X11/X.h:505 LineDoubleDash : constant := 2; -- /usr/include/X11/X.h:506 CapNotLast : constant := 0; -- /usr/include/X11/X.h:510 CapButt : constant := 1; -- /usr/include/X11/X.h:511 CapRound : constant := 2; -- /usr/include/X11/X.h:512 CapProjecting : constant := 3; -- /usr/include/X11/X.h:513 JoinMiter : constant := 0; -- /usr/include/X11/X.h:517 JoinRound : constant := 1; -- /usr/include/X11/X.h:518 JoinBevel : constant := 2; -- /usr/include/X11/X.h:519 FillSolid : constant := 0; -- /usr/include/X11/X.h:523 FillTiled : constant := 1; -- /usr/include/X11/X.h:524 FillStippled : constant := 2; -- /usr/include/X11/X.h:525 FillOpaqueStippled : constant := 3; -- /usr/include/X11/X.h:526 EvenOddRule : constant := 0; -- /usr/include/X11/X.h:530 WindingRule : constant := 1; -- /usr/include/X11/X.h:531 ClipByChildren : constant := 0; -- /usr/include/X11/X.h:535 IncludeInferiors : constant := 1; -- /usr/include/X11/X.h:536 Unsorted : constant := 0; -- /usr/include/X11/X.h:540 YSorted : constant := 1; -- /usr/include/X11/X.h:541 YXSorted : constant := 2; -- /usr/include/X11/X.h:542 YXBanded : constant := 3; -- /usr/include/X11/X.h:543 CoordModeOrigin : constant := 0; -- /usr/include/X11/X.h:547 CoordModePrevious : constant := 1; -- /usr/include/X11/X.h:548 Complex : constant := 0; -- /usr/include/X11/X.h:552 Nonconvex : constant := 1; -- /usr/include/X11/X.h:553 Convex : constant := 2; -- /usr/include/X11/X.h:554 ArcChord : constant := 0; -- /usr/include/X11/X.h:558 ArcPieSlice : constant := 1; -- /usr/include/X11/X.h:559 GCFunction : constant := (2**0); -- /usr/include/X11/X.h:564 GCPlaneMask : constant := (2**1); -- /usr/include/X11/X.h:565 GCForeground : constant := (2**2); -- /usr/include/X11/X.h:566 GCBackground : constant := (2**3); -- /usr/include/X11/X.h:567 GCLineWidth : constant := (2**4); -- /usr/include/X11/X.h:568 GCLineStyle : constant := (2**5); -- /usr/include/X11/X.h:569 GCCapStyle : constant := (2**6); -- /usr/include/X11/X.h:570 GCJoinStyle : constant := (2**7); -- /usr/include/X11/X.h:571 GCFillStyle : constant := (2**8); -- /usr/include/X11/X.h:572 GCFillRule : constant := (2**9); -- /usr/include/X11/X.h:573 GCTile : constant := (2**10); -- /usr/include/X11/X.h:574 GCStipple : constant := (2**11); -- /usr/include/X11/X.h:575 GCTileStipXOrigin : constant := (2**12); -- /usr/include/X11/X.h:576 GCTileStipYOrigin : constant := (2**13); -- /usr/include/X11/X.h:577 GCFont : constant := (2**14); -- /usr/include/X11/X.h:578 GCSubwindowMode : constant := (2**15); -- /usr/include/X11/X.h:579 GCGraphicsExposures : constant := (2**16); -- /usr/include/X11/X.h:580 GCClipXOrigin : constant := (2**17); -- /usr/include/X11/X.h:581 GCClipYOrigin : constant := (2**18); -- /usr/include/X11/X.h:582 GCClipMask : constant := (2**19); -- /usr/include/X11/X.h:583 GCDashOffset : constant := (2**20); -- /usr/include/X11/X.h:584 GCDashList : constant := (2**21); -- /usr/include/X11/X.h:585 GCArcMode : constant := (2**22); -- /usr/include/X11/X.h:586 GCLastBit : constant := 22; -- /usr/include/X11/X.h:588 FontLeftToRight : constant := 0; -- /usr/include/X11/X.h:595 FontRightToLeft : constant := 1; -- /usr/include/X11/X.h:596 FontChange : constant := 255; -- /usr/include/X11/X.h:598 XYBitmap : constant := 0; -- /usr/include/X11/X.h:606 XYPixmap : constant := 1; -- /usr/include/X11/X.h:607 ZPixmap : constant := 2; -- /usr/include/X11/X.h:608 AllocNone : constant := 0; -- /usr/include/X11/X.h:616 AllocAll : constant := 1; -- /usr/include/X11/X.h:617 DoRed : constant := (2**0); -- /usr/include/X11/X.h:622 DoGreen : constant := (2**1); -- /usr/include/X11/X.h:623 DoBlue : constant := (2**2); -- /usr/include/X11/X.h:624 CursorShape : constant := 0; -- /usr/include/X11/X.h:632 TileShape : constant := 1; -- /usr/include/X11/X.h:633 StippleShape : constant := 2; -- /usr/include/X11/X.h:634 AutoRepeatModeOff : constant := 0; -- /usr/include/X11/X.h:640 AutoRepeatModeOn : constant := 1; -- /usr/include/X11/X.h:641 AutoRepeatModeDefault : constant := 2; -- /usr/include/X11/X.h:642 LedModeOff : constant := 0; -- /usr/include/X11/X.h:644 LedModeOn : constant := 1; -- /usr/include/X11/X.h:645 KBKeyClickPercent : constant := (2**0); -- /usr/include/X11/X.h:649 KBBellPercent : constant := (2**1); -- /usr/include/X11/X.h:650 KBBellPitch : constant := (2**2); -- /usr/include/X11/X.h:651 KBBellDuration : constant := (2**3); -- /usr/include/X11/X.h:652 KBLed : constant := (2**4); -- /usr/include/X11/X.h:653 KBLedMode : constant := (2**5); -- /usr/include/X11/X.h:654 KBKey : constant := (2**6); -- /usr/include/X11/X.h:655 KBAutoRepeatMode : constant := (2**7); -- /usr/include/X11/X.h:656 MappingSuccess : constant := 0; -- /usr/include/X11/X.h:658 MappingBusy : constant := 1; -- /usr/include/X11/X.h:659 MappingFailed : constant := 2; -- /usr/include/X11/X.h:660 MappingModifier : constant := 0; -- /usr/include/X11/X.h:662 MappingKeyboard : constant := 1; -- /usr/include/X11/X.h:663 MappingPointer : constant := 2; -- /usr/include/X11/X.h:664 DontPreferBlanking : constant := 0; -- /usr/include/X11/X.h:670 PreferBlanking : constant := 1; -- /usr/include/X11/X.h:671 DefaultBlanking : constant := 2; -- /usr/include/X11/X.h:672 DisableScreenSaver : constant := 0; -- /usr/include/X11/X.h:674 DisableScreenInterval : constant := 0; -- /usr/include/X11/X.h:675 DontAllowExposures : constant := 0; -- /usr/include/X11/X.h:677 AllowExposures : constant := 1; -- /usr/include/X11/X.h:678 DefaultExposures : constant := 2; -- /usr/include/X11/X.h:679 ScreenSaverReset : constant := 0; -- /usr/include/X11/X.h:683 ScreenSaverActive : constant := 1; -- /usr/include/X11/X.h:684 HostInsert : constant := 0; -- /usr/include/X11/X.h:692 HostDelete : constant := 1; -- /usr/include/X11/X.h:693 EnableAccess : constant := 1; -- /usr/include/X11/X.h:697 DisableAccess : constant := 0; -- /usr/include/X11/X.h:698 StaticGray : constant := 0; -- /usr/include/X11/X.h:704 GrayScale : constant := 1; -- /usr/include/X11/X.h:705 StaticColor : constant := 2; -- /usr/include/X11/X.h:706 PseudoColor : constant := 3; -- /usr/include/X11/X.h:707 TrueColor : constant := 4; -- /usr/include/X11/X.h:708 DirectColor : constant := 5; -- /usr/include/X11/X.h:709 LSBFirst : constant := 0; -- /usr/include/X11/X.h:714 MSBFirst : constant := 1; -- /usr/include/X11/X.h:715 -- Definitions for the X window system likely to be used by applications --********************************************************** --Copyright 1987, 1998 The Open Group --Permission to use, copy, modify, distribute, and sell this software and its --documentation for any purpose is hereby granted without fee, provided that --the above copyright notice appear in all copies and that both that --copyright notice and this permission notice appear in supporting --documentation. --The above copyright notice and this permission notice shall be included in --all copies or substantial portions of the Software. --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN --AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN --CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --Except as contained in this notice, the name of The Open Group shall not be --used in advertising or otherwise to promote the sale, use or other dealings --in this Software without prior written authorization from The Open Group. --Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. -- All Rights Reserved --Permission to use, copy, modify, and distribute this software and its --documentation for any purpose and without fee is hereby granted, --provided that the above copyright notice appear in all copies and that --both that copyright notice and this permission notice appear in --supporting documentation, and that the name of Digital not be --used in advertising or publicity pertaining to distribution of the --software without specific, written prior permission. --DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING --ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL --DIGITAL BE LIABLE FOR ANY SPECIAL, 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. --***************************************************************** -- Resources -- * _XSERVER64 must ONLY be defined when compiling X server sources on -- * systems where unsigned long is not 32 bits, must NOT be used in -- * client or library code. -- subtype XID is unsigned_long; -- /usr/include/X11/X.h:66 subtype Mask is unsigned_long; -- /usr/include/X11/X.h:70 -- Also in Xdefs.h subtype Atom is unsigned_long; -- /usr/include/X11/X.h:74 subtype VisualID is unsigned_long; -- /usr/include/X11/X.h:76 subtype Time is unsigned_long; -- /usr/include/X11/X.h:77 subtype Window is XID; -- /usr/include/X11/X.h:96 subtype Drawable is XID; -- /usr/include/X11/X.h:97 subtype Font is XID; -- /usr/include/X11/X.h:100 subtype Pixmap is XID; -- /usr/include/X11/X.h:102 subtype Cursor is XID; -- /usr/include/X11/X.h:103 subtype Colormap is XID; -- /usr/include/X11/X.h:104 subtype GContext is XID; -- /usr/include/X11/X.h:105 subtype KeySym is XID; -- /usr/include/X11/X.h:106 subtype KeyCode is unsigned_char; -- /usr/include/X11/X.h:108 --**************************************************************** -- * RESERVED RESOURCE AND CONSTANT DEFINITIONS -- **************************************************************** --**************************************************************** -- * EVENT DEFINITIONS -- **************************************************************** -- Input Event Masks. Used as event-mask window attribute and as arguments -- to Grab requests. Not to be confused with event names. -- Event names. Used in "type" field in XEvent structures. Not to be --confused with event masks above. They start from 2 because 0 and 1 --are reserved in the protocol for errors and replies. -- Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, -- state in various key-, mouse-, and button-related events. -- modifier names. Used to build a SetModifierMapping request or -- to read a GetModifierMapping request. These correspond to the -- masks defined above. -- button masks. Used in same manner as Key masks above. Not to be confused -- with button names below. -- button names. Used as arguments to GrabButton and as detail in ButtonPress -- and ButtonRelease events. Not to be confused with button masks above. -- Note that 0 is already defined above as "AnyButton". -- Notify modes -- Notify detail -- Visibility notify -- Circulation request -- protocol families -- authentication families not tied to a specific protocol -- Property notification -- Color Map notification -- GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes -- GrabPointer, GrabKeyboard reply status -- AllowEvents modes -- Used in SetInputFocus, GetInputFocus --**************************************************************** -- * ERROR CODES -- **************************************************************** --**************************************************************** -- * WINDOW DEFINITIONS -- **************************************************************** -- Window classes used by CreateWindow -- Note that CopyFromParent is already defined as 0 above -- Window attributes for CreateWindow and ChangeWindowAttributes -- ConfigureWindow structure -- Bit Gravity -- Window gravity + bit gravity above -- Used in CreateWindow for backing-store hint -- Used in GetWindowAttributes reply -- Used in ChangeSaveSet -- Used in ChangeCloseDownMode -- Window stacking method (in configureWindow) -- Circulation direction -- Property modes --**************************************************************** -- * GRAPHICS DEFINITIONS -- **************************************************************** -- graphics functions, as in GC.alu -- LineStyle -- capStyle -- joinStyle -- fillStyle -- fillRule -- subwindow mode -- SetClipRectangles ordering -- CoordinateMode for drawing routines -- Polygon shapes -- Arc modes for PolyFillArc -- GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into -- GC.stateChanges --**************************************************************** -- * FONTS -- **************************************************************** -- used in QueryFont -- draw direction --**************************************************************** -- * IMAGING -- **************************************************************** -- ImageFormat -- PutImage, GetImage --**************************************************************** -- * COLOR MAP STUFF -- **************************************************************** -- For CreateColormap -- Flags used in StoreNamedColor, StoreColors --**************************************************************** -- * CURSOR STUFF -- **************************************************************** -- QueryBestSize Class --**************************************************************** -- * KEYBOARD/POINTER STUFF -- **************************************************************** -- masks for ChangeKeyboardControl --**************************************************************** -- * SCREEN SAVER STUFF -- **************************************************************** -- for ForceScreenSaver --**************************************************************** -- * HOSTS AND CONNECTIONS -- **************************************************************** -- for ChangeHosts -- for ChangeAccessControl -- Display classes used in opening the connection -- * Note that the statically allocated ones are even numbered and the -- * dynamically changeable ones are odd numbered -- Byte order used in imageByteOrder and bitmapBitOrder end X11;
zhmu/ananas
Ada
3,132
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . V E R S I O N _ C O N T R O L -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This module contains the runtime routine for implementation of the -- Version and Body_Version attributes, as well as the string type that -- is returned as a result of using these attributes. with System.Unsigned_Types; package System.Version_Control is pragma Pure; subtype Version_String is String (1 .. 8); -- Eight character string returned by Get_version_String function Get_Version_String (V : System.Unsigned_Types.Unsigned) return Version_String; -- The version information in the executable file is stored as unsigned -- integers. This routine converts the unsigned integer into an eight -- character string containing its hexadecimal digits (with lower case -- letters). end System.Version_Control;
AdaCore/langkit
Ada
1,039
ads
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Langkit_Support.Text; use Langkit_Support.Text; with Libfoolang.Analysis; use Libfoolang.Analysis; package Support is type Event_Handler is new Libfoolang.Analysis.Event_Handler_Interface with record Label : Unbounded_String; end record; overriding procedure Unit_Requested_Callback (Self : in out Event_Handler; Context : Analysis_Context'Class; Name : Text_Type; From : Analysis_Unit'Class; Found : Boolean; Is_Not_Found_Error : Boolean); overriding procedure Unit_Parsed_Callback (Self : in out Event_Handler; Context : Analysis_Context'Class; Unit : Analysis_Unit'Class; Reparsed : Boolean); overriding procedure Release (Self : in out Event_Handler); function Create_Event_Handler (Label : String) return Event_Handler_Reference; procedure Log (Self : Event_Handler; Subp : String); end Support;
onox/sdlada
Ada
33,704
ads
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2018 Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- -- SDL.Video.Pixel_Formats -- -- Description of various pixel formats. -------------------------------------------------------------------------------------------------------------------- with Ada.Characters.Latin_1; with Ada.Unchecked_Conversion; with Interfaces; with Interfaces.C; with SDL.Video.Palettes; package SDL.Video.Pixel_Formats is package C renames Interfaces.C; type Pixel_Types is (Unknown, Index_1, Index_4, Index_8, Packed_8, Packed_16, Packed_32, Array_U8, Array_U16, Array_U32, Array_F16, Array_F32) with Convention => C; -- Bitmap pixel order, high bit -> low bit. type Bitmap_Pixel_Order is (None, Little_Endian, Big_Endian) with Convention => C; -- Packed component order, high bit -> low bit. type Packed_Component_Order is (None, XRGB, RGBX, ARGB, RGBA, XBGR, BGRX, ABGR, BGRA) with Convention => C; -- Array component order, low byte -> high byte. type Array_Component_Order is (None, RGB, RGBA, ARGB, BGR, BGRA, ABGR); -- Describe how the components are laid out in bit form. type Packed_Component_Layout is (None, Bits_332, Bits_4444, Bits_1555, Bits_5551, Bits_565, Bits_8888, Bits_2101010, Bits_1010102) with Convention => C; type Bits_Per_Pixels is range 0 .. 32 with Static_Predicate => Bits_Per_Pixels in 0 | 1 | 4 | 8 | 12 | 15 | 16 | 24 | 32, Convention => C; Bits_Per_Pixel_Error : constant Bits_Per_Pixels := 0; type Bytes_Per_Pixels is range 0 .. 4 with Convention => C; Bytes_Per_Pixel_Error : constant Bytes_Per_Pixels := Bytes_Per_Pixels'First; -- 29 28 24 20 16 8 0 -- 000 1 ptpt popo llll bibibibi bybybyby -- -- or -- -- 24 16 8 0 -- DDDDDDDD CCCCCCCC BBBBBBBB AAAAAAAA type Index_Order_Padding is range 0 .. 1 with Convention => C; type Pixel_Orders (Pixel_Type : Pixel_Types := Unknown) is record case Pixel_Type is when Index_1 | Index_4 | Index_8 => Indexed_Order : Bitmap_Pixel_Order; Indexed_Pad : Index_Order_Padding; when Packed_8 | Packed_16 | Packed_32 => Packed_Order : Packed_Component_Order; when Array_U8 | Array_U16 | Array_U32 | Array_F16 | Array_F32 => Array_Order : Array_Component_Order; when others => null; end case; end record with Unchecked_Union => True, Convention => C, Size => 4; for Pixel_Orders use record Indexed_Order at 0 range 0 .. 2; -- This was 2 as that is the max size required but it causes a bit set bug! Indexed_Pad at 0 range 3 .. 3; Packed_Order at 0 range 0 .. 3; Array_Order at 0 range 0 .. 3; end record; type Planar_Pixels is record A : Character; B : Character; C : Character; D : Character; end record with Size => 32, Convention => C; for Planar_Pixels use record A at 0 range 0 .. 7; B at 0 range 8 .. 15; C at 0 range 16 .. 23; D at 0 range 24 .. 31; end record; type Non_Planar_Pixel_Padding is range 0 .. 7 with Convention => C; type Non_Planar_Pixels is record Bytes_Per_Pixel : Bytes_Per_Pixels; Bits_Per_Pixel : Bits_Per_Pixels; Layout : Packed_Component_Layout; Pixel_Order : Pixel_Orders; Pixel_Type : Pixel_Types; Flag : Boolean; Padding : Non_Planar_Pixel_Padding; end record with Size => 32, Convention => C; for Non_Planar_Pixels use record Bytes_Per_Pixel at 0 range 0 .. 7; Bits_Per_Pixel at 0 range 8 .. 15; Layout at 0 range 16 .. 19; Pixel_Order at 0 range 20 .. 23; Pixel_Type at 0 range 24 .. 27; Flag at 0 range 28 .. 28; Padding at 0 range 29 .. 31; end record; type Pixel_Format_Names (Planar : Boolean := False) is record case Planar is when True => Planar_Format : Planar_Pixels; when False => Non_Planar_Format : Non_Planar_Pixels; end case; end record with Unchecked_Union => True, Size => 32, Convention => C; Pixel_Format_Unknown : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => True, Planar_Format => Planar_Pixels' (others => Ada.Characters.Latin_1.NUL)); Pixel_Format_Index_1_LSB : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Index_1, Pixel_Order => Pixel_Orders' (Pixel_Type => Index_1, Indexed_Order => Little_Endian, Indexed_Pad => Index_Order_Padding'First), Layout => None, Bits_Per_Pixel => 1, Bytes_Per_Pixel => 0)); Pixel_Format_Index_1_MSB : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Index_1, Pixel_Order => Pixel_Orders' (Pixel_Type => Index_1, Indexed_Order => Big_Endian, Indexed_Pad => Index_Order_Padding'First), Layout => None, Bits_Per_Pixel => 1, Bytes_Per_Pixel => 0)); Pixel_Format_Index_4_LSB : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Index_4, Pixel_Order => Pixel_Orders' (Pixel_Type => Index_4, Indexed_Order => Little_Endian, Indexed_Pad => Index_Order_Padding'First), Layout => None, Bits_Per_Pixel => 4, Bytes_Per_Pixel => 0)); Pixel_Format_Index_4_MSB : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Index_4, Pixel_Order => Pixel_Orders' (Pixel_Type => Index_4, Indexed_Order => Big_Endian, Indexed_Pad => Index_Order_Padding'First), Layout => None, Bits_Per_Pixel => 4, Bytes_Per_Pixel => 0)); Pixel_Format_Index_8 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Index_8, Pixel_Order => Pixel_Orders' (Pixel_Type => Index_8, Indexed_Order => None, Indexed_Pad => Index_Order_Padding'First), Layout => None, Bits_Per_Pixel => 8, Bytes_Per_Pixel => 1)); Pixel_Format_RGB_332 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_8, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_8, Packed_Order => XRGB), Layout => Bits_332, Bits_Per_Pixel => 8, Bytes_Per_Pixel => 1)); Pixel_Format_RGB_444 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => XRGB), Layout => Bits_4444, Bits_Per_Pixel => 12, Bytes_Per_Pixel => 2)); Pixel_Format_RGB_555 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => XRGB), Layout => Bits_1555, Bits_Per_Pixel => 15, Bytes_Per_Pixel => 2)); Pixel_Format_BGR_555 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => XBGR), Layout => Bits_1555, Bits_Per_Pixel => 15, Bytes_Per_Pixel => 2)); Pixel_Format_ARGB_4444 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => ARGB), Layout => Bits_4444, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_RGBA_4444 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => RGBA), Layout => Bits_4444, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_ABGR_4444 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => ABGR), Layout => Bits_4444, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_BGRA_4444 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => BGRA), Layout => Bits_4444, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_ARGB_1555 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => ARGB), Layout => Bits_1555, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_RGBA_5551 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => RGBA), Layout => Bits_5551, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_ABGR_1555 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => ABGR), Layout => Bits_1555, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_BGRA_5551 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => BGRA), Layout => Bits_5551, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_RGB_565 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => XRGB), Layout => Bits_565, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_BGR_565 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_16, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_16, Packed_Order => XBGR), Layout => Bits_565, Bits_Per_Pixel => 16, Bytes_Per_Pixel => 2)); Pixel_Format_RGB_24 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Array_U8, Pixel_Order => Pixel_Orders' (Pixel_Type => Array_U8, Array_Order => RGB), Layout => None, Bits_Per_Pixel => 24, Bytes_Per_Pixel => 3)); Pixel_Format_BGR_24 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Array_U8, Pixel_Order => Pixel_Orders' (Pixel_Type => Array_U8, Array_Order => BGR), Layout => None, Bits_Per_Pixel => 24, Bytes_Per_Pixel => 3)); Pixel_Format_RGB_888 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => XRGB), Layout => Bits_8888, Bits_Per_Pixel => 24, Bytes_Per_Pixel => 4)); Pixel_Format_RGBX_8888 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => RGBX), Layout => Bits_8888, Bits_Per_Pixel => 24, Bytes_Per_Pixel => 4)); Pixel_Format_BGR_888 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => XBGR), Layout => Bits_8888, Bits_Per_Pixel => 24, Bytes_Per_Pixel => 4)); Pixel_Format_BGRX_8888 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => BGRX), Layout => Bits_8888, Bits_Per_Pixel => 24, Bytes_Per_Pixel => 4)); Pixel_Format_ARGB_8888 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => ARGB), Layout => Bits_8888, Bits_Per_Pixel => 32, Bytes_Per_Pixel => 4)); Pixel_Format_RGBA_8888 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => RGBA), Layout => Bits_8888, Bits_Per_Pixel => 32, Bytes_Per_Pixel => 4)); Pixel_Format_ABGR_8888 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => ABGR), Layout => Bits_8888, Bits_Per_Pixel => 32, Bytes_Per_Pixel => 4)); Pixel_Format_BGRA_8888 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => BGRA), Layout => Bits_8888, Bits_Per_Pixel => 32, Bytes_Per_Pixel => 4)); Pixel_Format_ARGB_2101010 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => False, Non_Planar_Format => Non_Planar_Pixels' (Padding => Non_Planar_Pixel_Padding'First, Flag => True, Pixel_Type => Packed_32, Pixel_Order => Pixel_Orders' (Pixel_Type => Packed_32, Packed_Order => ARGB), Layout => Bits_2101010, Bits_Per_Pixel => 32, Bytes_Per_Pixel => 4)); Pixel_Format_YV_12 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => True, Planar_Format => Planar_Pixels' (A => 'Y', B => 'V', C => '1', D => '2')); Pixel_Format_IYUV : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => True, Planar_Format => Planar_Pixels' (A => 'I', B => 'Y', C => 'U', D => 'V')); Pixel_Format_YUY_2 : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => True, Planar_Format => Planar_Pixels' (A => 'Y', B => 'U', C => 'Y', D => '2')); Pixel_Format_UYVY : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => True, Planar_Format => Planar_Pixels' (A => 'U', B => 'Y', C => 'V', D => 'Y')); Pixel_Format_YVYU : constant Pixel_Format_Names := Pixel_Format_Names'(Planar => True, Planar_Format => Planar_Pixels' (A => 'Y', B => 'V', C => 'Y', D => 'U')); type Colour_Mask is mod 2 ** 32 with Convention => C; type Private_Pixel_Format is private; type Pixel_Format is record Format : Pixel_Format_Names; Palette : Palettes.Palette_Access; Bits : Bits_Per_Pixels; Bytes : Bytes_Per_Pixels; Padding : Interfaces.Unsigned_16; Red_Mask : Colour_Mask; Green_Mask : Colour_Mask; Blue_Mask : Colour_Mask; Alpha_Mask : Colour_Mask; -- This is mainly padding to make sure the record size matches what is expected from C. Private_Part : Private_Pixel_Format; end record with Convention => C; -- TODO: Possibly change this to a controlled type. type Pixel_Format_Access is access all Pixel_Format with Convention => C; function Create (Format : in Pixel_Format_Names) return Pixel_Format_Access with Import => True, Convention => C, External_Name => "SDL_AllocFormat"; procedure Free (Format : in Pixel_Format_Access) with Import => True, Convention => C, External_Name => "SDL_FreeFormat"; function Image (Format : in Pixel_Format_Names) return String; -- Import => True, -- Convention => C, -- External_Name => "SDL_GetPixelFormatName"; procedure To_Components (Pixel : in Interfaces.Unsigned_32; Format : in Pixel_Format_Access; Red : out Palettes.Colour_Component; Green : out Palettes.Colour_Component; Blue : out Palettes.Colour_Component) with Import => True, Convention => C, External_Name => "SDL_GetRGB"; procedure To_Components (Pixel : in Interfaces.Unsigned_32; Format : in Pixel_Format_Access; Red : out Palettes.Colour_Component; Green : out Palettes.Colour_Component; Blue : out Palettes.Colour_Component; Alpha : out Palettes.Colour_Component) with Import => True, Convention => C, External_Name => "SDL_GetRGBA"; function To_Pixel (Format : in Pixel_Format_Access; Red : in Palettes.Colour_Component; Green : in Palettes.Colour_Component; Blue : in Palettes.Colour_Component) return Interfaces.Unsigned_32 with Import => True, Convention => C, External_Name => "SDL_MapRGB"; function To_Pixel (Format : in Pixel_Format_Access; Red : in Palettes.Colour_Component; Green : in Palettes.Colour_Component; Blue : in Palettes.Colour_Component; Alpha : in Palettes.Colour_Component) return Interfaces.Unsigned_32 with Import => True, Convention => C, External_Name => "SDL_MapRGBA"; function To_Colour (Pixel : in Interfaces.Unsigned_32; Format : in Pixel_Format_Access) return Palettes.Colour with Inline => True; function To_Pixel (Colour : in Palettes.Colour; Format : in Pixel_Format_Access) return Interfaces.Unsigned_32 with Inline => True; function To_Name (Bits : in Bits_Per_Pixels; Red_Mask : in Colour_Mask; Green_Mask : in Colour_Mask; Blue_Mask : in Colour_Mask; Alpha_Mask : in Colour_Mask) return Pixel_Format_Names with Import => True, Convention => C, External_Name => "SDL_MasksToPixelFormatEnum"; function To_Masks (Format : in Pixel_Format_Names; Bits : out Bits_Per_Pixels; Red_Mask : out Colour_Mask; Green_Mask : out Colour_Mask; Blue_Mask : out Colour_Mask; Alpha_Mask : out Colour_Mask) return Boolean with Inline => True; -- Gamma type Gamma_Value is mod 2 ** 16 with Convention => C; type Gamma_Ramp is array (Integer range 1 .. 256) of Gamma_Value with Convention => C; procedure Calculate (Gamma : in Float; Ramp : out Gamma_Ramp) with Import => True, Convention => C, External_Name => "SDL_CalculateGammaRamp"; private -- The following fields are defined as "internal use" in the SDL docs. type Private_Pixel_Format is record Rred_Loss : Interfaces.Unsigned_8; Green_Loss : Interfaces.Unsigned_8; Blue_Loss : Interfaces.Unsigned_8; Alpha_Loss : Interfaces.Unsigned_8; Red_Shift : Interfaces.Unsigned_8; Green_Shift : Interfaces.Unsigned_8; Blue_Shift : Interfaces.Unsigned_8; Alpha_Shift : Interfaces.Unsigned_8; Ref_Count : C.int; Next : Pixel_Format_Access; end record with Convention => C; end SDL.Video.Pixel_Formats;
Fabien-Chouteau/AGATE
Ada
3,690
adb
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2018, Fabien Chouteau -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with FE310_SVD.GPIO; use FE310_SVD.GPIO; with FE310_SVD.UART; use FE310_SVD.UART; with AGATE.Arch.RISCV; use AGATE.Arch.RISCV; package body AGATE.Console is procedure Initialize; ---------------- -- Initialize -- ---------------- procedure Initialize is begin GPIO0_Periph.IO_FUNC_SEL.Arr (17) := False; GPIO0_Periph.IO_FUNC_SEL.Arr (18) := False; GPIO0_Periph.IO_FUNC_EN.Arr (18) := True; GPIO0_Periph.IO_FUNC_EN.Arr (17) := True; UART0_Periph.DIV.DIV := UInt16 ((CPU_Frequency / 115200)) - 1; UART0_Periph.TXCTRL.ENABLE := True; for I in 1 .. 1_000 loop null; end loop; end Initialize; ----------- -- Print -- ----------- procedure Print (C : Character) is begin while UART0_Periph.TXDATA.FULL loop null; end loop; UART0_Periph.TXDATA.DATA := Character'Pos (C); end Print; ----------- -- Print -- ----------- procedure Print (Str : String) is begin for C of Str loop Print (C); end loop; end Print; ---------------- -- Print_Line -- ---------------- procedure Print_Line (Str : String) is begin Print (Str); Print (ASCII.CR); Print (ASCII.LF); end Print_Line; begin Initialize; end AGATE.Console;
io7m/coreland-posix-ada
Ada
621
adb
with POSIX.Error; use type POSIX.Error.Error_t; with POSIX.User_DB; use type POSIX.User_DB.User_ID_t; with Test; procedure T_UDB_GE2 is Error_Value : POSIX.Error.Error_t; Database_Entry : POSIX.User_DB.Database_Entry_t; Found_Entry : Boolean; begin POSIX.User_DB.Get_Entry_By_Name (User_Name => "nonexistent", Database_Entry => Database_Entry, Found_Entry => Found_Entry, Error_Value => Error_Value); Test.Assert (Found_Entry = False); Test.Assert (Error_Value = POSIX.Error.Error_None); Test.Assert (POSIX.User_DB.Is_Valid (Database_Entry) = False); end T_UDB_GE2;
sungyeon/drake
Ada
26
ads
../../generic/a-nudsge.ads
reznikmm/matreshka
Ada
6,900
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Text.Toc_Mark_End_Elements is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Text_Toc_Mark_End_Element_Node is begin return Self : Text_Toc_Mark_End_Element_Node do Matreshka.ODF_Text.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Text_Prefix); end return; end Create; ---------------- -- Enter_Node -- ---------------- overriding procedure Enter_Node (Self : not null access Text_Toc_Mark_End_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Enter_Text_Toc_Mark_End (ODF.DOM.Text_Toc_Mark_End_Elements.ODF_Text_Toc_Mark_End_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Enter_Node (Visitor, Control); end if; end Enter_Node; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Text_Toc_Mark_End_Element_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Toc_Mark_End_Element; end Get_Local_Name; ---------------- -- Leave_Node -- ---------------- overriding procedure Leave_Node (Self : not null access Text_Toc_Mark_End_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Leave_Text_Toc_Mark_End (ODF.DOM.Text_Toc_Mark_End_Elements.ODF_Text_Toc_Mark_End_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Leave_Node (Visitor, Control); end if; end Leave_Node; ---------------- -- Visit_Node -- ---------------- overriding procedure Visit_Node (Self : not null access Text_Toc_Mark_End_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then ODF.DOM.Iterators.Abstract_ODF_Iterator'Class (Iterator).Visit_Text_Toc_Mark_End (Visitor, ODF.DOM.Text_Toc_Mark_End_Elements.ODF_Text_Toc_Mark_End_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Visit_Node (Iterator, Visitor, Control); end if; end Visit_Node; begin Matreshka.DOM_Documents.Register_Element (Matreshka.ODF_String_Constants.Text_URI, Matreshka.ODF_String_Constants.Toc_Mark_End_Element, Text_Toc_Mark_End_Element_Node'Tag); end Matreshka.ODF_Text.Toc_Mark_End_Elements;
reznikmm/matreshka
Ada
6,960
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Text.Tracked_Changes_Elements is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Text_Tracked_Changes_Element_Node is begin return Self : Text_Tracked_Changes_Element_Node do Matreshka.ODF_Text.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Text_Prefix); end return; end Create; ---------------- -- Enter_Node -- ---------------- overriding procedure Enter_Node (Self : not null access Text_Tracked_Changes_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Enter_Text_Tracked_Changes (ODF.DOM.Text_Tracked_Changes_Elements.ODF_Text_Tracked_Changes_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Enter_Node (Visitor, Control); end if; end Enter_Node; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Text_Tracked_Changes_Element_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Tracked_Changes_Element; end Get_Local_Name; ---------------- -- Leave_Node -- ---------------- overriding procedure Leave_Node (Self : not null access Text_Tracked_Changes_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Leave_Text_Tracked_Changes (ODF.DOM.Text_Tracked_Changes_Elements.ODF_Text_Tracked_Changes_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Leave_Node (Visitor, Control); end if; end Leave_Node; ---------------- -- Visit_Node -- ---------------- overriding procedure Visit_Node (Self : not null access Text_Tracked_Changes_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then ODF.DOM.Iterators.Abstract_ODF_Iterator'Class (Iterator).Visit_Text_Tracked_Changes (Visitor, ODF.DOM.Text_Tracked_Changes_Elements.ODF_Text_Tracked_Changes_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Visit_Node (Iterator, Visitor, Control); end if; end Visit_Node; begin Matreshka.DOM_Documents.Register_Element (Matreshka.ODF_String_Constants.Text_URI, Matreshka.ODF_String_Constants.Tracked_Changes_Element, Text_Tracked_Changes_Element_Node'Tag); end Matreshka.ODF_Text.Tracked_Changes_Elements;
vpodzime/ada-util
Ada
4,722
adb
----------------------------------------------------------------------- -- util-streams-sockets-tests -- Unit tests for socket streams -- Copyright (C) 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with Ada.IO_Exceptions; with Util.Test_Caller; with Util.Streams.Texts; with Util.Tests.Servers; package body Util.Streams.Sockets.Tests is use Util.Tests; package Caller is new Util.Test_Caller (Test, "Streams.Sockets"); type Test_Server is new Util.Tests.Servers.Server with record Count : Natural := 0; end record; -- Process the line received by the server. overriding procedure Process_Line (Into : in out Test_Server; Line : in Ada.Strings.Unbounded.Unbounded_String; Stream : in out Util.Streams.Texts.Reader_Stream'Class; Client : in out Util.Streams.Sockets.Socket_Stream'Class); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Streams.Initialize,Connect", Test_Socket_Init'Access); Caller.Add_Test (Suite, "Test Util.Streams.Connect,Read,Write", Test_Socket_Read'Access); end Add_Tests; -- ------------------------------ -- Process the line received by the server. -- ------------------------------ overriding procedure Process_Line (Into : in out Test_Server; Line : in Ada.Strings.Unbounded.Unbounded_String; Stream : in out Util.Streams.Texts.Reader_Stream'Class; Client : in out Util.Streams.Sockets.Socket_Stream'Class) is pragma Unreferenced (Stream, Client); begin if Ada.Strings.Unbounded.Index (Line, "test-" & Natural'Image (Into.Count + 1)) > 0 then Into.Count := Into.Count + 1; end if; end Process_Line; -- ------------------------------ -- Test reading and writing on a socket stream. -- ------------------------------ procedure Test_Socket_Read (T : in out Test) is Stream : aliased Sockets.Socket_Stream; Writer : Util.Streams.Texts.Print_Stream; Server : Test_Server; Addr : GNAT.Sockets.Sock_Addr_Type; begin Server.Start; T.Assert (Server.Get_Port > 0, "The server was not started"); Addr := (GNAT.Sockets.Family_Inet, GNAT.Sockets.Addresses (GNAT.Sockets.Get_Host_By_Name (GNAT.Sockets.Host_Name), 1), GNAT.Sockets.Port_Type (Server.Get_Port)); -- Let the server start. delay 0.1; -- Get a connection and write 10 lines. Stream.Connect (Server => Addr); Writer.Initialize (Output => Stream'Unchecked_Access, Input => null, Size => 1024); for I in 1 .. 10 loop Writer.Write ("Sending a line on the socket test-" & Natural'Image (I) & ASCII.CR & ASCII.LF); Writer.Flush; end loop; Writer.Close; -- Stop the server and verify that 10 lines were received. Server.Stop; Util.Tests.Assert_Equals (T, 10, Server.Count, "Invalid number of lines received"); end Test_Socket_Read; -- ------------------------------ -- Test socket initialization. -- ------------------------------ procedure Test_Socket_Init (T : in out Test) is Stream : aliased Sockets.Socket_Stream; Fd : GNAT.Sockets.Socket_Type; Addr : GNAT.Sockets.Sock_Addr_Type; begin Addr := (GNAT.Sockets.Family_Inet, GNAT.Sockets.Addresses (GNAT.Sockets.Get_Host_By_Name (GNAT.Sockets.Host_Name), 1), 80); GNAT.Sockets.Create_Socket (Fd); Stream.Open (Fd); begin Stream.Connect (Addr); T.Assert (False, "No exception was raised"); exception when Ada.IO_Exceptions.Use_Error => null; end; end Test_Socket_Init; end Util.Streams.Sockets.Tests;
charlie5/lace
Ada
898
ads
private package GID.Buffering is -- Attach a buffer to a stream. procedure Attach_Stream( b : out Input_buffer; stm : in Stream_Access ); function Is_stream_attached(b: Input_buffer) return Boolean; -- From the first call to Get_Byte, subsequent bytes must be read -- through Get_Byte as well since the stream is partly read in advance procedure Get_Byte(b: in out Input_buffer; byte: out U8); pragma Inline(Get_Byte); private subtype Size_test_a is Byte_Array(1..19); subtype Size_test_b is Ada.Streams.Stream_Element_Array(1..19); -- is_mapping_possible: Compile-time test for checking if -- a Byte_Array is equivalemnt to a Ada.Streams.Stream_Element_Array. -- is_mapping_possible: constant Boolean:= Size_test_a'Size = Size_test_b'Size and Size_test_a'Alignment = Size_test_b'Alignment; end GID.Buffering;
stcarrez/mat
Ada
3,309
ads
----------------------------------------------------------------------- -- mat-targets-gtkmat - Gtk target management -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Gtk.Widget; with Gtkada.Builder; with Util.Log.Loggers; with MAT.Events.Gtkmat; with MAT.Consoles.Gtkmat; package MAT.Targets.Gtkmat is Initialize_Error : exception; -- The logger Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("MAT.Events.Gtkmat"); type Target_Type is new MAT.Targets.Target_Type with private; type Target_Type_Access is access all Target_Type'Class; -- Initialize the target instance. overriding procedure Initialize (Target : in out Target_Type); -- Release the storage. overriding procedure Finalize (Target : in out Target_Type); -- Initialize the widgets and create the Gtk gui. procedure Initialize_Widget (Target : in out Target_Type; Widget : out Gtk.Widget.Gtk_Widget); -- Create a process instance to hold and keep track of memory and other information about -- the given process ID. overriding procedure Create_Process (Target : in out Target_Type; Pid : in MAT.Types.Target_Process_Ref; Path : in Ada.Strings.Unbounded.Unbounded_String; Process : out Target_Process_Type_Access); -- Enter in the interactive loop reading the commands from the standard input -- and executing the commands. overriding procedure Interactive (Target : in out Target_Type); -- Set the UI label with the given value. procedure Set_Label (Target : in Target_Type; Name : in String; Value : in String); -- Refresh the information about the current process. procedure Refresh_Process (Target : in out Target_Type); private -- Load the glade XML definition. procedure Load_UI (Target : in out Target_Type); task type Gtk_Loop is entry Start (Target : in Target_Type_Access); end Gtk_Loop; type Target_Type is new MAT.Targets.Target_Type with record Builder : Gtkada.Builder.Gtkada_Builder; Gui_Task : Gtk_Loop; Previous_Event_Counter : Integer := 0; Gtk_Console : MAT.Consoles.Gtkmat.Console_Type_Access; Main : Gtk.Widget.Gtk_Widget; About : Gtk.Widget.Gtk_Widget; Chooser : Gtk.Widget.Gtk_Widget; Events : MAT.Events.Gtkmat.Event_Drawing_Type; end record; procedure Refresh_Events (Target : in out Target_Type); end MAT.Targets.Gtkmat;
AdaCore/libadalang
Ada
79
ads
generic type T is private; package P is procedure Foo (Self : T); end P;
MinimSecure/unum-sdk
Ada
1,117
adb
-- Copyright 2014-2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. procedure Foo is function Range_Count (L, U : Integer) return Natural is type Array_Type is array (L .. U) of Natural; A : Array_Type := (others => 1); Result : Natural := 0; begin for I of A loop -- START Result := Result + I; end loop; return Result; end Range_Count; R2 : constant Natural := Range_Count (5, 10); begin null; end Foo;
stcarrez/ada-wiki
Ada
2,881
ads
----------------------------------------------------------------------- -- wiki-render-links -- Wiki links renderering -- Copyright (C) 2015, 2016 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Wiki.Strings; -- === Link Renderer === -- The <tt>Wiki.Render.Links</tt> package defines the <tt>Link_Renderer</tt> interface used -- for the rendering of links and images. The interface allows to customize the generated -- links and image source for the final HTML. -- package Wiki.Render.Links is pragma Preelaborate; type Link_Renderer is limited interface; type Link_Renderer_Access is access all Link_Renderer'Class; -- Get the image link that must be rendered from the wiki image link. procedure Make_Image_Link (Renderer : in out Link_Renderer; Link : in Wiki.Strings.WString; URI : out Wiki.Strings.UString; Width : in out Natural; Height : in out Natural) is abstract; -- Get the page link that must be rendered from the wiki page link. procedure Make_Page_Link (Renderer : in out Link_Renderer; Link : in Wiki.Strings.WString; URI : out Wiki.Strings.UString; Exists : out Boolean) is abstract; type Default_Link_Renderer is new Link_Renderer with null record; -- Get the image link that must be rendered from the wiki image link. overriding procedure Make_Image_Link (Renderer : in out Default_Link_Renderer; Link : in Wiki.Strings.WString; URI : out Wiki.Strings.UString; Width : in out Natural; Height : in out Natural); -- Get the page link that must be rendered from the wiki page link. overriding procedure Make_Page_Link (Renderer : in out Default_Link_Renderer; Link : in Wiki.Strings.WString; URI : out Wiki.Strings.UString; Exists : out Boolean); end Wiki.Render.Links;
MEDiCODEDEV/coinapi-sdk
Ada
34,516
adb
-- OMS _ REST API -- OMS Project -- -- The version of the OpenAPI document: v1 -- -- -- NOTE: This package is auto generated by OpenAPI-Generator 4.3.1. -- https://openapi-generator.tech -- Do not edit the class manually. package body .Models is use Swagger.Streams; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Messages_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("exchange_id", Value.Exchange_Id); Into.Write_Entity ("message", Value.Message); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Messages_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Messages_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "exchange_id", Value.Exchange_Id); Swagger.Streams.Deserialize (Object, "message", Value.Message); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Messages_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Messages_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in MessagesInfo_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("exchange_id", Value.Exchange_Id); Into.Write_Entity ("error_message", Value.Error_Message); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in MessagesInfo_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out MessagesInfo_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "exchange_id", Value.Exchange_Id); Swagger.Streams.Deserialize (Object, "error_message", Value.Error_Message); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out MessagesInfo_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : MessagesInfo_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in TimeInForce_Type) is begin Into.Start_Entity (Name); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in TimeInForce_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out TimeInForce_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out TimeInForce_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : TimeInForce_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in CancelOrder_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("exchange_id", Value.Exchange_Id); Into.Write_Entity ("exchange_order_id", Value.Exchange_Order_Id); Into.Write_Entity ("client_order_id", Value.Client_Order_Id); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in CancelOrder_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out CancelOrder_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "exchange_id", Value.Exchange_Id); Swagger.Streams.Deserialize (Object, "exchange_order_id", Value.Exchange_Order_Id); Swagger.Streams.Deserialize (Object, "client_order_id", Value.Client_Order_Id); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out CancelOrder_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : CancelOrder_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in CancelAllOrder_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("exchange_id", Value.Exchange_Id); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in CancelAllOrder_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out CancelAllOrder_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "exchange_id", Value.Exchange_Id); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out CancelAllOrder_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : CancelAllOrder_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in MessagesOk_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("exchange_id", Value.Exchange_Id); Into.Write_Entity ("message", Value.Message); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in MessagesOk_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out MessagesOk_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "exchange_id", Value.Exchange_Id); Swagger.Streams.Deserialize (Object, "message", Value.Message); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out MessagesOk_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : MessagesOk_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderStatus_Type) is begin Into.Start_Entity (Name); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderStatus_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderStatus_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderStatus_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : OrderStatus_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BalanceData_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("id", Value.Id); Into.Write_Entity ("symbol_exchange", Value.Symbol_Exchange); Into.Write_Entity ("symbol_coinapi", Value.Symbol_Coinapi); Into.Write_Entity ("balance", Value.Balance); Into.Write_Entity ("available", Value.Available); Into.Write_Entity ("locked", Value.Locked); Into.Write_Entity ("update_origin", Value.Update_Origin); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in BalanceData_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BalanceData_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "symbol_exchange", Value.Symbol_Exchange); Swagger.Streams.Deserialize (Object, "symbol_coinapi", Value.Symbol_Coinapi); Swagger.Streams.Deserialize (Object, "balance", Value.Balance); Swagger.Streams.Deserialize (Object, "available", Value.Available); Swagger.Streams.Deserialize (Object, "locked", Value.Locked); Swagger.Streams.Deserialize (Object, "update_origin", Value.Update_Origin); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out BalanceData_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : BalanceData_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Balance_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("exchange_name", Value.Exchange_Name); Serialize (Into, "data", Value.Data); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Balance_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Balance_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "exchange_name", Value.Exchange_Name); Deserialize (Object, "data", Value.Data); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Balance_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Balance_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Order_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("exchange_name", Value.Exchange_Name); Serialize (Into, "data", Value.Data); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Order_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Order_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "exchange_name", Value.Exchange_Name); Deserialize (Object, "data", Value.Data); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Order_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Order_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in NewOrder_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("exchange_id", Value.Exchange_Id); Into.Write_Entity ("client_order_id", Value.Client_Order_Id); Into.Write_Entity ("symbol_exchange", Value.Symbol_Exchange); Into.Write_Entity ("symbol_coinapi", Value.Symbol_Coinapi); Serialize (Into, "amount_order", Value.Amount_Order); Serialize (Into, "price", Value.Price); Into.Write_Entity ("side", Value.Side); Into.Write_Entity ("order_type", Value.Order_Type); Serialize (Into, "time_in_force", Value.Time_In_Force); Serialize (Into, "expire_time", Value.Expire_Time); Serialize (Into, "exec_inst", Value.Exec_Inst); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in NewOrder_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out NewOrder_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "exchange_id", Value.Exchange_Id); Swagger.Streams.Deserialize (Object, "client_order_id", Value.Client_Order_Id); Swagger.Streams.Deserialize (Object, "symbol_exchange", Value.Symbol_Exchange); Swagger.Streams.Deserialize (Object, "symbol_coinapi", Value.Symbol_Coinapi); Deserialize (Object, "amount_order", Value.Amount_Order); Deserialize (Object, "price", Value.Price); Swagger.Streams.Deserialize (Object, "side", Value.Side); Swagger.Streams.Deserialize (Object, "order_type", Value.Order_Type); Deserialize (Object, "time_in_force", Value.Time_In_Force); Deserialize (Object, "expire_time", Value.Expire_Time); Swagger.Streams.Deserialize (Object, "exec_inst", Value.Exec_Inst); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out NewOrder_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : NewOrder_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderLive_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("exchange_id", Value.Exchange_Id); Into.Write_Entity ("id", Value.Id); Into.Write_Entity ("client_order_id_format_exchange", Value.Client_Order_Id_Format_Exchange); Into.Write_Entity ("exchange_order_id", Value.Exchange_Order_Id); Serialize (Into, "amount_open", Value.Amount_Open); Serialize (Into, "amount_filled", Value.Amount_Filled); Serialize (Into, "status", Value.Status); Serialize (Into, "time_order", Value.Time_Order); Into.Write_Entity ("error_message", Value.Error_Message); Into.Write_Entity ("client_order_id", Value.Client_Order_Id); Into.Write_Entity ("symbol_exchange", Value.Symbol_Exchange); Into.Write_Entity ("symbol_coinapi", Value.Symbol_Coinapi); Serialize (Into, "amount_order", Value.Amount_Order); Serialize (Into, "price", Value.Price); Into.Write_Entity ("side", Value.Side); Into.Write_Entity ("order_type", Value.Order_Type); Serialize (Into, "time_in_force", Value.Time_In_Force); Serialize (Into, "expire_time", Value.Expire_Time); Serialize (Into, "exec_inst", Value.Exec_Inst); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderLive_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderLive_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "exchange_id", Value.Exchange_Id); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "client_order_id_format_exchange", Value.Client_Order_Id_Format_Exchange); Swagger.Streams.Deserialize (Object, "exchange_order_id", Value.Exchange_Order_Id); Deserialize (Object, "amount_open", Value.Amount_Open); Deserialize (Object, "amount_filled", Value.Amount_Filled); Deserialize (Object, "status", Value.Status); Swagger.Streams.Deserialize (Object, "time_order", Value.Time_Order); Swagger.Streams.Deserialize (Object, "error_message", Value.Error_Message); Swagger.Streams.Deserialize (Object, "client_order_id", Value.Client_Order_Id); Swagger.Streams.Deserialize (Object, "symbol_exchange", Value.Symbol_Exchange); Swagger.Streams.Deserialize (Object, "symbol_coinapi", Value.Symbol_Coinapi); Deserialize (Object, "amount_order", Value.Amount_Order); Deserialize (Object, "price", Value.Price); Swagger.Streams.Deserialize (Object, "side", Value.Side); Swagger.Streams.Deserialize (Object, "order_type", Value.Order_Type); Deserialize (Object, "time_in_force", Value.Time_In_Force); Deserialize (Object, "expire_time", Value.Expire_Time); Swagger.Streams.Deserialize (Object, "exec_inst", Value.Exec_Inst); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderLive_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : OrderLive_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Position_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("exchange_name", Value.Exchange_Name); Serialize (Into, "data", Value.Data); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Position_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Position_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "exchange_name", Value.Exchange_Name); Deserialize (Object, "data", Value.Data); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Position_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Position_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in CreateOrder400_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("title", Value.Title); Serialize (Into, "status", Value.Status); Into.Write_Entity ("traceId", Value.Trace_Id); Into.Write_Entity ("errors", Value.Errors); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in CreateOrder400_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out CreateOrder400_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "title", Value.Title); Deserialize (Object, "status", Value.Status); Swagger.Streams.Deserialize (Object, "traceId", Value.Trace_Id); Swagger.Streams.Deserialize (Object, "errors", Value.Errors); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out CreateOrder400_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : CreateOrder400_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderData_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("exchange_id", Value.Exchange_Id); Into.Write_Entity ("id", Value.Id); Into.Write_Entity ("client_order_id_format_exchange", Value.Client_Order_Id_Format_Exchange); Into.Write_Entity ("exchange_order_id", Value.Exchange_Order_Id); Serialize (Into, "amount_open", Value.Amount_Open); Serialize (Into, "amount_filled", Value.Amount_Filled); Serialize (Into, "status", Value.Status); Serialize (Into, "time_order", Value.Time_Order); Into.Write_Entity ("error_message", Value.Error_Message); Into.Write_Entity ("client_order_id", Value.Client_Order_Id); Into.Write_Entity ("symbol_exchange", Value.Symbol_Exchange); Into.Write_Entity ("symbol_coinapi", Value.Symbol_Coinapi); Serialize (Into, "amount_order", Value.Amount_Order); Serialize (Into, "price", Value.Price); Into.Write_Entity ("side", Value.Side); Into.Write_Entity ("order_type", Value.Order_Type); Serialize (Into, "time_in_force", Value.Time_In_Force); Serialize (Into, "expire_time", Value.Expire_Time); Serialize (Into, "exec_inst", Value.Exec_Inst); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderData_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderData_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "exchange_id", Value.Exchange_Id); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "client_order_id_format_exchange", Value.Client_Order_Id_Format_Exchange); Swagger.Streams.Deserialize (Object, "exchange_order_id", Value.Exchange_Order_Id); Deserialize (Object, "amount_open", Value.Amount_Open); Deserialize (Object, "amount_filled", Value.Amount_Filled); Deserialize (Object, "status", Value.Status); Swagger.Streams.Deserialize (Object, "time_order", Value.Time_Order); Swagger.Streams.Deserialize (Object, "error_message", Value.Error_Message); Swagger.Streams.Deserialize (Object, "client_order_id", Value.Client_Order_Id); Swagger.Streams.Deserialize (Object, "symbol_exchange", Value.Symbol_Exchange); Swagger.Streams.Deserialize (Object, "symbol_coinapi", Value.Symbol_Coinapi); Deserialize (Object, "amount_order", Value.Amount_Order); Deserialize (Object, "price", Value.Price); Swagger.Streams.Deserialize (Object, "side", Value.Side); Swagger.Streams.Deserialize (Object, "order_type", Value.Order_Type); Deserialize (Object, "time_in_force", Value.Time_In_Force); Deserialize (Object, "expire_time", Value.Expire_Time); Swagger.Streams.Deserialize (Object, "exec_inst", Value.Exec_Inst); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderData_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : OrderData_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in PositionData_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("id", Value.Id); Into.Write_Entity ("symbol_exchange", Value.Symbol_Exchange); Into.Write_Entity ("symbol_coinapi", Value.Symbol_Coinapi); Serialize (Into, "avg_entry_price", Value.Avg_Entry_Price); Serialize (Into, "quantity", Value.Quantity); Into.Write_Entity ("is_buy", Value.Is_Buy); Serialize (Into, "unrealised_pn_l", Value.Unrealised_Pn_L); Serialize (Into, "leverage", Value.Leverage); Into.Write_Entity ("cross_margin", Value.Cross_Margin); Serialize (Into, "liquidation_price", Value.Liquidation_Price); Into.Write_Entity ("raw_data", Value.Raw_Data); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in PositionData_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out PositionData_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "symbol_exchange", Value.Symbol_Exchange); Swagger.Streams.Deserialize (Object, "symbol_coinapi", Value.Symbol_Coinapi); Deserialize (Object, "avg_entry_price", Value.Avg_Entry_Price); Deserialize (Object, "quantity", Value.Quantity); Swagger.Streams.Deserialize (Object, "is_buy", Value.Is_Buy); Deserialize (Object, "unrealised_pn_l", Value.Unrealised_Pn_L); Deserialize (Object, "leverage", Value.Leverage); Swagger.Streams.Deserialize (Object, "cross_margin", Value.Cross_Margin); Deserialize (Object, "liquidation_price", Value.Liquidation_Price); Swagger.Streams.Deserialize (Object, "raw_data", Value.Raw_Data); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out PositionData_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : PositionData_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; end .Models;
reznikmm/matreshka
Ada
4,573
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Fo.Language_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Fo_Language_Attribute_Node is begin return Self : Fo_Language_Attribute_Node do Matreshka.ODF_Fo.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Fo_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Fo_Language_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Language_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Fo_URI, Matreshka.ODF_String_Constants.Language_Attribute, Fo_Language_Attribute_Node'Tag); end Matreshka.ODF_Fo.Language_Attributes;
RREE/ada-util
Ada
4,226
ads
----------------------------------------------------------------------- -- util-commands-consoles -- Console interface -- Copyright (C) 2014, 2015, 2017, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; generic type Field_Type is (<>); type Notice_Type is (<>); package Util.Commands.Consoles is type Justify_Type is (J_LEFT, -- Justify left |item | J_RIGHT, -- Justify right | item| J_CENTER, -- Justify center | item | J_RIGHT_NO_FILL -- Justify right |item| ); type Console_Type is abstract tagged limited private; type Console_Access is access all Console_Type'Class; -- Report an error message. procedure Error (Console : in out Console_Type; Message : in String) is abstract; -- Report a notice message. procedure Notice (Console : in out Console_Type; Kind : in Notice_Type; Message : in String) is abstract; -- Print the field value for the given field. procedure Print_Field (Console : in out Console_Type; Field : in Field_Type; Value : in String; Justify : in Justify_Type := J_LEFT) is abstract; -- Print the title for the given field. procedure Print_Title (Console : in out Console_Type; Field : in Field_Type; Title : in String) is abstract; -- Start a new title in a report. procedure Start_Title (Console : in out Console_Type) is abstract; -- Finish a new title in a report. procedure End_Title (Console : in out Console_Type) is abstract; -- Start a new row in a report. procedure Start_Row (Console : in out Console_Type) is abstract; -- Finish a new row in a report. procedure End_Row (Console : in out Console_Type) is abstract; -- Print the title for the given field and setup the associated field size. procedure Print_Title (Console : in out Console_Type; Field : in Field_Type; Title : in String; Length : in Positive); -- Format the integer and print it for the given field. procedure Print_Field (Console : in out Console_Type; Field : in Field_Type; Value : in Integer; Justify : in Justify_Type := J_LEFT); -- Format the integer and print it for the given field. procedure Print_Field (Console : in out Console_Type; Field : in Field_Type; Value : in Ada.Strings.Unbounded.Unbounded_String; Justify : in Justify_Type := J_LEFT); -- Get the field count that was setup through the Print_Title calls. function Get_Field_Count (Console : in Console_Type) return Natural; -- Reset the field count. procedure Clear_Fields (Console : in out Console_Type); private type Field_Size_Array is array (Field_Type) of Natural; type Field_List_Array is array (1 .. Field_Size_Array'Length) of Field_Type; type Console_Type is abstract tagged limited record Sizes : Field_Size_Array := (others => 0); Cols : Field_Size_Array := (others => 1); Fields : Field_List_Array; Field_Count : Natural := 0; end record; end Util.Commands.Consoles;
reznikmm/matreshka
Ada
3,826
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package Matreshka.ODF_Attributes.Style.Distance_After_Sep is type Style_Distance_After_Sep_Node is new Matreshka.ODF_Attributes.Style.Style_Node_Base with null record; type Style_Distance_After_Sep_Access is access all Style_Distance_After_Sep_Node'Class; overriding function Get_Local_Name (Self : not null access constant Style_Distance_After_Sep_Node) return League.Strings.Universal_String; end Matreshka.ODF_Attributes.Style.Distance_After_Sep;
reznikmm/matreshka
Ada
3,646
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements.Generic_Hash; function AMF.Standard_Profile_L2.Utilities.Hash is new AMF.Elements.Generic_Hash (Standard_Profile_L2_Utility, Standard_Profile_L2_Utility_Access);
stcarrez/babel
Ada
1,602
adb
----------------------------------------------------------------------- -- babel-Streams -- Stream management -- Copyright (C) 2014, 2015 Stephane.Carrez -- Written by Stephane.Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body Babel.Streams is -- ------------------------------ -- Set the internal buffer that the stream can use. -- ------------------------------ procedure Set_Buffer (Stream : in out Stream_Type; Buffer : in Babel.Files.Buffers.Buffer_Access) is begin Stream.Buffer := Buffer; end Set_Buffer; -- ------------------------------ -- Release the stream buffer if there is one. -- ------------------------------ overriding procedure Finalize (Stream : in out Stream_Type) is use type Babel.Files.Buffers.Buffer_Access; begin if Stream.Buffer /= null then Babel.Files.Buffers.Release (Stream.Buffer); end if; end Finalize; end Babel.Streams;
reznikmm/matreshka
Ada
5,928
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_0016 is pragma Preelaborate; Group_0016 : aliased constant Core_Second_Stage := (16#6D# => -- 166D (Other_Punctuation, Neutral, Other, Other, Other, Alphabetic, (Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#6E# => -- 166E (Other_Punctuation, Neutral, Other, Other, S_Term, Alphabetic, (STerm | Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#80# => -- 1680 (Space_Separator, Neutral, Other, Other, Sp, Break_After, (White_Space | Grapheme_Base => True, others => False)), 16#9B# => -- 169B (Open_Punctuation, Neutral, Other, Other, Close, Open_Punctuation, (Grapheme_Base => True, others => False)), 16#9C# => -- 169C (Close_Punctuation, Neutral, Other, Other, Close, Close_Punctuation, (Grapheme_Base => True, others => False)), 16#9D# .. 16#9F# => -- 169D .. 169F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#EB# .. 16#ED# => -- 16EB .. 16ED (Other_Punctuation, Neutral, Other, Other, Other, Break_After, (Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#EE# .. 16#F0# => -- 16EE .. 16F0 (Letter_Number, Neutral, Other, A_Letter, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False)), 16#F9# .. 16#FF# => -- 16F9 .. 16FF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), others => (Other_Letter, Neutral, Other, A_Letter, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_0016;
charlie5/lace
Ada
230
ads
package openGL.Renderer.lean.forge -- -- Provides constructors for the lean renderer. -- is function to_Renderer return Renderer.lean.item; function new_Renderer return Renderer.lean.view; end openGL.Renderer.lean.forge;
sbksba/Concurrence-LI330
Ada
1,534
adb
with graphique, ada.text_io; use graphique, ada.text_io; package body ppp is procedure pointparpoint(x0,y0,x1,y1 : natural;color : string) is x : natural := x0; y : natural :=y0; dx : natural := abs(x1-x0); dy : natural := abs(y1-y0); -- abs(YMAX/2+1 - YMAX/2) dpr : natural := dy*2; dpru : integer := dpr-(dx*2); p : integer := dpr -dx; xincr : integer; yincr : integer; begin if x0 > x1 then xincr:=-1; else xincr:=1; end if; if y0 > y1 then yincr := -1; else yincr := 1; end if; if dx>dy then dpr := dy*2; dpru := dpr-(dx*2); p := dpr-dx; for i in reverse 0..dx loop delay 0.1; afficher_point(x,y,color); if p>0 then x:=x+xincr; y:=y+yincr; p:=p+dpru; else x:=x+xincr; p:=p+dpr; end if; end loop; else dpr := dx*2; dpru := dpr-(dy*2); p := dpr-dy; for i in reverse 0..dy loop delay 0.1; afficher_point(x,y,color); if p>0 then x:=x+xincr; y:=y+yincr; p:=p+dpru; else y:=y+yincr; p:=p+dpr; end if; end loop; end if; end pointparpoint; end ppp;
francesco-bongiovanni/ewok-kernel
Ada
4,477
adb
-- -- Copyright 2018 The wookey project team <[email protected]> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- with system.machine_code; package body m4.cpu with spark_mode => off is procedure enable_irq is begin system.machine_code.asm ("cpsie i; isb", clobber => "memory", volatile => true); end enable_irq; procedure disable_irq is begin system.machine_code.asm ("cpsid i", clobber => "memory", volatile => true); end disable_irq; function get_control_register return t_control_register is cr : t_control_register; begin system.machine_code.asm ("mrs %0, control", outputs => t_control_register'asm_output ("=r", cr), volatile => true); return cr; end get_control_register; procedure set_control_register (cr : t_control_register) is begin system.machine_code.asm ("msr control, %0", inputs => t_control_register'asm_input ("r", cr), volatile => true); end set_control_register; function get_ipsr_register return t_ipsr_register is ipsr : t_ipsr_register; begin system.machine_code.asm ("mrs %0, ipsr", outputs => t_ipsr_register'asm_output ("=r", ipsr), volatile => true); return ipsr; end get_ipsr_register; function get_apsr_register return t_apsr_register is apsr : t_apsr_register; begin system.machine_code.asm ("mrs %0, apsr", outputs => t_apsr_register'asm_output ("=r", apsr), volatile => true); return apsr; end get_apsr_register; function get_epsr_register return t_epsr_register is epsr : t_epsr_register; begin system.machine_code.asm ("mrs %0, epsr", outputs => t_epsr_register'asm_output ("=r", epsr), volatile => true); return epsr; end get_epsr_register; function get_lr_register return unsigned_32 is val : unsigned_32; begin system.machine_code.asm ("mov %0, lr", outputs => unsigned_32'asm_output ("=r", val), volatile => true); return val; end get_lr_register; function get_psp_register return system_address is addr : system_address; begin system.machine_code.asm ("mrs %0, psp", outputs => system_address'asm_output ("=r", addr), volatile => true); return addr; end get_psp_register; procedure set_psp_register (addr : system_address) is begin system.machine_code.asm ("msr psp, %0", inputs => system_address'asm_input ("r", addr), volatile => true); end set_psp_register; function get_msp_register return system_address is addr : system_address; begin system.machine_code.asm ("mrs %0, msp", outputs => system_address'asm_output ("=r", addr), volatile => true); return addr; end get_msp_register; procedure set_msp_register (addr : system_address) is begin system.machine_code.asm ("msr msp, %0", inputs => system_address'asm_input ("r", addr), volatile => true); end set_msp_register; function get_primask_register return unsigned_32 is mask : unsigned_32; begin system.machine_code.asm ("mrs %0, primask", outputs => unsigned_32'asm_output ("=r", mask), volatile => true); return mask; end get_primask_register; procedure set_primask_register (mask : unsigned_32) is begin system.machine_code.asm ("msr primask, %0", inputs => unsigned_32'asm_input ("r", mask), volatile => true); end set_primask_register; end m4.cpu;
charlie5/lace
Ada
2,832
adb
with openGL.Geometry.lit_textured, openGL.Primitive.indexed; package body openGL.Model.hexagon.lit_textured is --------- --- Forge -- function new_Hexagon (Radius : in Real; Face : in lit_textured.Face) return View is Self : constant View := new Item; begin Self.Radius := Radius; Self.Face := Face; return Self; end new_Hexagon; -------------- --- Attributes -- overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in Font.font_id_Map_of_font) return Geometry.views is pragma unreferenced (Textures, Fonts); use Geometry.lit_textured, Texture; the_Sites : constant hexagon.Sites := vertex_Sites (Self.Radius); the_Indices : aliased constant Indices := (1, 2, 3, 4, 5, 6, 7, 2); function new_Face (Vertices : in geometry.lit_textured.Vertex_array) return Geometry.lit_textured.view is use Primitive; the_Geometry : constant Geometry.lit_textured.view := Geometry.lit_textured.new_Geometry; the_Primitive : constant Primitive.indexed.view := Primitive.indexed.new_Primitive (triangle_Fan, the_Indices); begin the_Geometry.Vertices_are (Vertices); the_Geometry.add (Primitive.view (the_Primitive)); return the_Geometry; end new_Face; upper_Face : Geometry.lit_textured.view; begin -- Upper Face -- declare the_Vertices : constant Geometry.lit_textured.Vertex_array := (1 => (Site => (0.0, 0.0, 0.0), Normal => Normal, Coords => (0.0, 0.0), Shine => default_Shine), 2 => (Site => the_Sites (1), Normal => Normal, Coords => (0.0, 0.0), Shine => default_Shine), 3 => (Site => the_Sites (2), Normal => Normal, Coords => (1.0, 0.0), Shine => default_Shine), 4 => (Site => the_Sites (3), Normal => Normal, Coords => (1.0, 1.0), Shine => default_Shine), 5 => (Site => the_Sites (4), Normal => Normal, Coords => (0.0, 1.0), Shine => default_Shine), 6 => (Site => the_Sites (5), Normal => Normal, Coords => (0.0, 1.0), Shine => default_Shine), 7 => (Site => the_Sites (6), Normal => Normal, Coords => (0.0, 1.0), Shine => default_Shine)); begin upper_Face := new_Face (Vertices => the_Vertices); if Self.Face.Texture /= null_Object then upper_Face.Texture_is (Self.Face.Texture); end if; end; return (1 => upper_Face.all'Access); end to_GL_Geometries; end openGL.Model.hexagon.lit_textured;
persan/A-gst
Ada
1,283
ads
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_pbutils_pbutils_h is -- GStreamer base utils library -- * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net> -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- procedure gst_pb_utils_init; -- gst/pbutils/pbutils.h:37 pragma Import (C, gst_pb_utils_init, "gst_pb_utils_init"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_pbutils_pbutils_h;
reznikmm/matreshka
Ada
3,794
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Style_Layout_Grid_Standard_Mode_Attributes is pragma Preelaborate; type ODF_Style_Layout_Grid_Standard_Mode_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Style_Layout_Grid_Standard_Mode_Attribute_Access is access all ODF_Style_Layout_Grid_Standard_Mode_Attribute'Class with Storage_Size => 0; end ODF.DOM.Style_Layout_Grid_Standard_Mode_Attributes;
reznikmm/slimp
Ada
1,064
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Slim.Messages.DSCO; with Slim.Messages.META; with Slim.Messages.RESP; with Slim.Messages.STAT; with Slim.Players.Common_Play_Visiters; package Slim.Players.Play_Radio_Visiters is type Visiter (Player : not null access Players.Player) is new Slim.Players.Common_Play_Visiters.Visiter (Player) with null record; overriding procedure DSCO (Self : in out Visiter; Message : not null access Slim.Messages.DSCO.DSCO_Message); overriding procedure META (Self : in out Visiter; Message : not null access Slim.Messages.META.META_Message); overriding procedure RESP (Self : in out Visiter; Message : not null access Slim.Messages.RESP.RESP_Message); overriding procedure STAT (Self : in out Visiter; Message : not null access Slim.Messages.STAT.STAT_Message); end Slim.Players.Play_Radio_Visiters;
reznikmm/matreshka
Ada
4,107
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Table_Number_Columns_Spanned_Attributes; package Matreshka.ODF_Table.Number_Columns_Spanned_Attributes is type Table_Number_Columns_Spanned_Attribute_Node is new Matreshka.ODF_Table.Abstract_Table_Attribute_Node and ODF.DOM.Table_Number_Columns_Spanned_Attributes.ODF_Table_Number_Columns_Spanned_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Table_Number_Columns_Spanned_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Table_Number_Columns_Spanned_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Table.Number_Columns_Spanned_Attributes;
Skyfold/aws_sorter
Ada
149
ads
with Ada.Strings.Bounded; package common_types is package Bounded_300 is new Ada.Strings.Bounded.Generic_Bounded_Length (300); end common_types;
esbullington/aflex
Ada
17,910
adb
-- Copyright (c) 1990 Regents of the University of California. -- All rights reserved. -- -- This software was developed by John Self of the Arcadia project -- at the University of California, Irvine. -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms and that any documentation, -- advertising materials, and other materials related to such -- distribution and use acknowledge that the software was developed -- by the University of California, Irvine. The name of the -- University may not be used to endorse or promote products derived -- from this software without specific prior written permission. -- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -- TITLE miscellaneous aflex routines -- AUTHOR: John Self (UCI) -- DESCRIPTION -- NOTES contains functions used in various places throughout aflex. -- $Header: /dc/uc/self/tmp/gnat_aflex/orig/RCS/misc.adb,v 1.1 1995/02/19 01:38:51 self Exp self $ -- -- 2004/10/16 Thierry Bernier -- + Add support for Ada95 parent/child units -- + Less GNAT warnings with MISC, MAIN_BODY, INT_IO, CALENDAR; package body MISC is -- action_out - write the actions from the temporary file to lex.yy.c UNITNAME_DEFINED : Boolean := False; UNITNAME_VALUE : VSTRING; LEX_FILENAME : VSTRING; procedure ACTION_OUT is BUF : VSTRING; begin while not TEXT_IO.END_OF_FILE(TEMP_ACTION_FILE) loop TSTRING.GET_LINE(TEMP_ACTION_FILE, BUF); if ((TSTRING.LEN(BUF) >= 2) and then ((CHAR(BUF, 1) = '%') and (CHAR(BUF, 2) = '%'))) then exit; else TSTRING.PUT_LINE(BUF); end if; end loop; end ACTION_OUT; -- bubble - bubble sort an integer array in increasing order -- -- description -- sorts the first n elements of array v and replaces them in -- increasing order. -- -- passed -- v - the array to be sorted -- n - the number of elements of 'v' to be sorted procedure BUBBLE(V : in INT_PTR; N : in INTEGER) is K : INTEGER; begin for I in reverse 2 .. N loop for J in 1 .. I - 1 loop if V(J) > V(J + 1) then -- compare K := V(J); -- exchange V(J) := V(J + 1); V(J + 1) := K; end if; end loop; end loop; end BUBBLE; -- clower - replace upper-case letter to lower-case function CLOWER(C : in INTEGER) return INTEGER is begin if ISUPPER(CHARACTER'VAL(C)) then return TOLOWER(C); else return C; end if; end CLOWER; -- cshell - shell sort a character array in increasing order -- -- description -- does a shell sort of the first n elements of array v. -- -- passed -- v - array to be sorted -- n - number of elements of v to be sorted procedure CSHELL(V : in out CHAR_ARRAY; N : in INTEGER) is GAP, J, JG : INTEGER; K : CHARACTER; LOWER_BOUND : constant INTEGER := V'FIRST; begin GAP := N/2; while GAP > 0 loop for I in GAP .. N - 1 loop J := I - GAP; while (J >= 0) loop JG := J + GAP; if V(J + LOWER_BOUND) <= V(JG + LOWER_BOUND) then exit; end if; K := V(J + LOWER_BOUND); V(J + LOWER_BOUND) := V(JG + LOWER_BOUND); V(JG + LOWER_BOUND) := K; J := J - GAP; end loop; end loop; GAP := GAP/2; end loop; end CSHELL; -- dataend - finish up a block of data declarations procedure DATAEND is begin if DATAPOS > 0 then DATAFLUSH; -- add terminator for initialization TEXT_IO.PUT_LINE(" );"); TEXT_IO.NEW_LINE; DATALINE := 0; end if; end DATAEND; -- dataflush - flush generated data statements procedure DATAFLUSH(FILE : in FILE_TYPE) is begin TEXT_IO.NEW_LINE(FILE); DATALINE := DATALINE + 1; if DATALINE >= NUMDATALINES then -- put out a blank line so that the table is grouped into -- large blocks that enable the user to find elements easily TEXT_IO.NEW_LINE(FILE); DATALINE := 0; end if; -- reset the number of characters written on the current line DATAPOS := 0; end DATAFLUSH; procedure DATAFLUSH is begin DATAFLUSH(CURRENT_OUTPUT); end DATAFLUSH; -- aflex_gettime - return current time function AFLEX_GETTIME return VSTRING is use CALENDAR; CURRENT_TIME : TIME; CURRENT_YEAR : YEAR_NUMBER; CURRENT_MONTH : MONTH_NUMBER; CURRENT_DAY : DAY_NUMBER; CURRENT_SECONDS : DAY_DURATION; MONTH_STRING, HOUR_STRING, MINUTE_STRING, SECOND_STRING : VSTRING; HOUR, MINUTE, SECOND : INTEGER; SECONDS_PER_HOUR : constant DAY_DURATION := 3600.0; begin CURRENT_TIME := CLOCK; SPLIT(CURRENT_TIME, CURRENT_YEAR, CURRENT_MONTH, CURRENT_DAY, CURRENT_SECONDS); case CURRENT_MONTH is when 1 => MONTH_STRING := VSTR("Jan"); when 2 => MONTH_STRING := VSTR("Feb"); when 3 => MONTH_STRING := VSTR("Mar"); when 4 => MONTH_STRING := VSTR("Apr"); when 5 => MONTH_STRING := VSTR("May"); when 6 => MONTH_STRING := VSTR("Jun"); when 7 => MONTH_STRING := VSTR("Jul"); when 8 => MONTH_STRING := VSTR("Aug"); when 9 => MONTH_STRING := VSTR("Sep"); when 10 => MONTH_STRING := VSTR("Oct"); when 11 => MONTH_STRING := VSTR("Nov"); when 12 => MONTH_STRING := VSTR("Dec"); end case; HOUR := INTEGER(CURRENT_SECONDS)/INTEGER(SECONDS_PER_HOUR); MINUTE := INTEGER((CURRENT_SECONDS - (HOUR*SECONDS_PER_HOUR))/60); SECOND := INTEGER(CURRENT_SECONDS - HOUR*SECONDS_PER_HOUR - MINUTE*60.0); if HOUR >= 10 then HOUR_STRING := VSTR(INTEGER'IMAGE(HOUR)); else HOUR_STRING := VSTR("0" & INTEGER'IMAGE(HOUR)); end if; if MINUTE >= 10 then MINUTE_STRING := VSTR(INTEGER'IMAGE(MINUTE)(2 .. INTEGER'IMAGE(MINUTE)' LENGTH)); else MINUTE_STRING := VSTR("0" & INTEGER'IMAGE(MINUTE)(2 .. INTEGER'IMAGE( MINUTE)'LENGTH)); end if; if SECOND >= 10 then SECOND_STRING := VSTR(INTEGER'IMAGE(SECOND)(2 .. INTEGER'IMAGE(SECOND)' LENGTH)); else SECOND_STRING := VSTR("0" & INTEGER'IMAGE(SECOND)(2 .. INTEGER'IMAGE( SECOND)'LENGTH)); end if; return MONTH_STRING & VSTR(INTEGER'IMAGE(CURRENT_DAY)) & HOUR_STRING & ":" & MINUTE_STRING & ":" & SECOND_STRING & INTEGER'IMAGE(CURRENT_YEAR); end AFLEX_GETTIME; -- aflexerror - report an error message and terminate -- overloaded function, one for vstring, one for string. procedure AFLEXERROR(MSG : in VSTRING) is begin TSTRING.PUT(STANDARD_ERROR, "aflex: " & MSG); TEXT_IO.NEW_LINE(STANDARD_ERROR); MAIN_BODY.AFLEXEND(1); end AFLEXERROR; procedure AFLEXERROR(MSG : in STRING) is begin TEXT_IO.PUT(STANDARD_ERROR, "aflex: " & MSG); TEXT_IO.NEW_LINE(STANDARD_ERROR); MAIN_BODY.AFLEXEND(1); end AFLEXERROR; -- aflexfatal - report a fatal error message and terminate -- overloaded function, one for vstring, one for string. procedure AFLEXFATAL(MSG : in VSTRING) is begin TSTRING.PUT(STANDARD_ERROR, "aflex: fatal internal error " & MSG); TEXT_IO.NEW_LINE(STANDARD_ERROR); MAIN_BODY.AFLEXEND(1); end AFLEXFATAL; procedure AFLEXFATAL(MSG : in STRING) is begin TEXT_IO.PUT(STANDARD_ERROR, "aflex: fatal internal error " & MSG); TEXT_IO.NEW_LINE(STANDARD_ERROR); MAIN_BODY.AFLEXEND(1); end AFLEXFATAL; -- basename - find the basename of a file function BASENAME return VSTRING is END_CHAR_POS : INTEGER := LEN(INFILENAME); START_CHAR_POS : INTEGER; begin if END_CHAR_POS = 0 then -- if reading standard input give everything this name return VSTR("aflex_yy"); end if; -- find out where the end of the basename is while ((END_CHAR_POS >= 1) and then (CHAR(INFILENAME, END_CHAR_POS) /= '.')) loop END_CHAR_POS := END_CHAR_POS - 1; end loop; -- find out where the beginning of the basename is START_CHAR_POS := END_CHAR_POS; -- start at the end of the basename while ((START_CHAR_POS > 1) and then (CHAR(INFILENAME, START_CHAR_POS) /= '/')) loop START_CHAR_POS := START_CHAR_POS - 1; end loop; if CHAR(INFILENAME, START_CHAR_POS) = '/' then START_CHAR_POS := START_CHAR_POS + 1; end if; if END_CHAR_POS >= 1 then return SLICE(INFILENAME, START_CHAR_POS, END_CHAR_POS - 1); else return INFILENAME; end if; end BASENAME; procedure SET_UNITNAME (STR : in VSTRING) is begin UNITNAME_VALUE := STR; UNITNAME_DEFINED := True; end SET_UNITNAME; -- unitname - finds the parent unit name of the parser function UNITNAME return VSTRING is begin -- if no unitname is defined, use the file name if not UNITNAME_DEFINED then return BASENAME & "_"; else return UNITNAME_VALUE; end if; end UNITNAME; -- basename - find the basename of a file function PACKAGE_NAME return STRING is Name : String := STR(BASENAME); begin if UNITNAME_DEFINED then return TSTRING.STR (UNITNAME_VALUE); end if; for I in Name'Range loop if Name (I) = '-' then Name (I) := '.'; end if; end loop; return Name; end PACKAGE_NAME; -- line_directive_out - spit out a "# line" statement procedure LINE_DIRECTIVE_OUT(OUTPUT_FILE_NAME : in FILE_TYPE) is begin if GEN_LINE_DIRS then TEXT_IO.PUT(OUTPUT_FILE_NAME, "--# line "); INT_IO.PUT(OUTPUT_FILE_NAME, LINENUM, 1); TEXT_IO.PUT(OUTPUT_FILE_NAME, " """); TSTRING.PUT(OUTPUT_FILE_NAME, INFILENAME); TEXT_IO.PUT_LINE(OUTPUT_FILE_NAME, """"); end if; end LINE_DIRECTIVE_OUT; procedure LINE_DIRECTIVE_OUT is begin if GEN_LINE_DIRS then TEXT_IO.PUT("--# line "); INT_IO.PUT(LINENUM, 1); TEXT_IO.PUT(" """); TSTRING.PUT(INFILENAME); TEXT_IO.PUT_LINE(""""); end if; end LINE_DIRECTIVE_OUT; -- all_upper - returns true if a string is all upper-case function ALL_UPPER(STR : in VSTRING) return BOOLEAN is begin for I in 1 .. LEN(STR) loop if (not ((CHAR(STR, I) >= 'A') and (CHAR(STR, I) <= 'Z'))) then return FALSE; end if; end loop; return TRUE; end ALL_UPPER; -- all_lower - returns true if a string is all lower-case function ALL_LOWER(STR : in VSTRING) return BOOLEAN is begin for I in 1 .. LEN(STR) loop if (not ((CHAR(STR, I) >= 'a') and (CHAR(STR, I) <= 'z'))) then return FALSE; end if; end loop; return TRUE; end ALL_LOWER; -- mk2data - generate a data statement for a two-dimensional array -- -- generates a data statement initializing the current 2-D array to "value" procedure MK2DATA(FILE : in FILE_TYPE; VALUE : in INTEGER) is begin if DATAPOS >= NUMDATAITEMS then TEXT_IO.PUT(FILE, ','); DATAFLUSH(FILE); end if; if DATAPOS = 0 then -- indent TEXT_IO.PUT(FILE, " "); else TEXT_IO.PUT(FILE, ','); end if; DATAPOS := DATAPOS + 1; INT_IO.PUT(FILE, VALUE, 5); end MK2DATA; procedure MK2DATA(VALUE : in INTEGER) is begin MK2DATA(CURRENT_OUTPUT, VALUE); end MK2DATA; -- -- generates a data statement initializing the current array element to -- "value" procedure MKDATA(VALUE : in INTEGER) is begin if DATAPOS >= NUMDATAITEMS then TEXT_IO.PUT(','); DATAFLUSH; end if; if DATAPOS = 0 then -- indent TEXT_IO.PUT(" "); else TEXT_IO.PUT(','); end if; DATAPOS := DATAPOS + 1; INT_IO.PUT(VALUE, 5); end MKDATA; -- myctoi - return the integer represented by a string of digits function MYCTOI(NUM_ARRAY : in VSTRING) return INTEGER is TOTAL : INTEGER := 0; CNT : INTEGER := TSTRING.FIRST; begin while (CNT <= TSTRING.LEN(NUM_ARRAY)) loop TOTAL := TOTAL*10; TOTAL := TOTAL + CHARACTER'POS(CHAR(NUM_ARRAY, CNT)) - CHARACTER'POS('0') ; CNT := CNT + 1; end loop; return TOTAL; end MYCTOI; -- myesc - return character corresponding to escape sequence function MYESC(ARR : in VSTRING) return CHARACTER is begin case (CHAR(ARR, TSTRING.FIRST + 1)) is when 'a' => return ASCII.BEL; when 'b' => return ASCII.BS; when 'f' => return ASCII.FF; when 'n' => return ASCII.LF; when 'r' => return ASCII.CR; when 't' => return ASCII.HT; when 'v' => return ASCII.VT; when '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' => -- \<octal> declare ESC_CHAR : CHARACTER; -- SPTR : INTEGER := TSTRING.FIRST + 1; begin ESC_CHAR := OTOI(TSTRING.SLICE(ARR, TSTRING.FIRST + 1, TSTRING.LEN(ARR ))); if ESC_CHAR = ASCII.NUL then MISC.SYNERR("escape sequence for null not allowed"); return ASCII.SOH; end if; return ESC_CHAR; end; when others => return CHAR(ARR, TSTRING.FIRST + 1); end case; end MYESC; -- otoi - convert an octal digit string to an integer value function OTOI(STR : in VSTRING) return CHARACTER is TOTAL : INTEGER := 0; CNT : INTEGER := TSTRING.FIRST; begin while (CNT <= TSTRING.LEN(STR)) loop TOTAL := TOTAL*8; TOTAL := TOTAL + CHARACTER'POS(CHAR(STR, CNT)) - CHARACTER'POS('0'); CNT := CNT + 1; end loop; return CHARACTER'VAL(TOTAL); end OTOI; -- readable_form - return the the human-readable form of a character -- -- The returned string is in static storage. function READABLE_FORM(C : in CHARACTER) return VSTRING is begin if ((CHARACTER'POS(C) >= 0 and CHARACTER'POS(C) < 32) or (C = ASCII.DEL)) then case C is when ASCII.LF => return (VSTR("\n")); -- Newline when ASCII.HT => return (VSTR("\t")); -- Horizontal Tab when ASCII.FF => return (VSTR("\f")); -- Form Feed when ASCII.CR => return (VSTR("\r")); -- Carriage Return when ASCII.BS => return (VSTR("\b")); -- Backspace when others => return VSTR("\" & INTEGER'IMAGE(CHARACTER'POS(C))); end case; elsif C = ' ' then return VSTR("' '"); else return VSTR(C); end if; end READABLE_FORM; -- transition_struct_out - output a yy_trans_info structure -- -- outputs the yy_trans_info structure with the two elements, element_v and -- element_n. Formats the output with spaces and carriage returns. procedure TRANSITION_STRUCT_OUT(ELEMENT_V, ELEMENT_N : in INTEGER) is begin INT_IO.PUT(ELEMENT_V, 7); TEXT_IO.PUT(", "); INT_IO.PUT(ELEMENT_N, 5); TEXT_IO.PUT(","); DATAPOS := DATAPOS + TRANS_STRUCT_PRINT_LENGTH; if DATAPOS >= 75 then TEXT_IO.NEW_LINE; DATALINE := DATALINE + 1; if DATALINE mod 10 = 0 then TEXT_IO.NEW_LINE; end if; DATAPOS := 0; end if; end TRANSITION_STRUCT_OUT; function SET_YY_TRAILING_HEAD_MASK(SRC : in INTEGER) return INTEGER is begin if CHECK_YY_TRAILING_HEAD_MASK(SRC) = 0 then return SRC + YY_TRAILING_HEAD_MASK; else return SRC; end if; end SET_YY_TRAILING_HEAD_MASK; function CHECK_YY_TRAILING_HEAD_MASK(SRC : in INTEGER) return INTEGER is begin if SRC >= YY_TRAILING_HEAD_MASK then return YY_TRAILING_HEAD_MASK; else return 0; end if; end CHECK_YY_TRAILING_HEAD_MASK; function SET_YY_TRAILING_MASK(SRC : in INTEGER) return INTEGER is begin if CHECK_YY_TRAILING_MASK(SRC) = 0 then return SRC + YY_TRAILING_MASK; else return SRC; end if; end SET_YY_TRAILING_MASK; function CHECK_YY_TRAILING_MASK(SRC : in INTEGER) return INTEGER is begin -- this test is whether both bits are on, or whether onlyy TRAIL_MASK is set if ((SRC >= YY_TRAILING_HEAD_MASK + YY_TRAILING_MASK) or (( CHECK_YY_TRAILING_HEAD_MASK(SRC) = 0) and (SRC >= YY_TRAILING_MASK))) then return YY_TRAILING_MASK; else return 0; end if; end CHECK_YY_TRAILING_MASK; function ISLOWER(C : in CHARACTER) return BOOLEAN is begin return C in 'a' .. 'z'; end ISLOWER; function ISUPPER(C : in CHARACTER) return BOOLEAN is begin return C in 'A' .. 'Z'; end ISUPPER; function ISDIGIT(C : in CHARACTER) return BOOLEAN is begin return C in '0' .. '9'; end ISDIGIT; function TOLOWER(C : in INTEGER) return INTEGER is begin return C - CHARACTER'POS('A') + CHARACTER'POS('a'); end TOLOWER; procedure SYNERR(STR : in STRING) is begin SYNTAXERROR := TRUE; PUT(STANDARD_ERROR, LEX_FILENAME); Text_IO.PUT(STANDARD_ERROR, ":"); PUT(STANDARD_ERROR, Integer'Image (LINENUM)); TEXT_IO.PUT(STANDARD_ERROR, ": syntax error: "); TEXT_IO.PUT(STANDARD_ERROR, STR); TEXT_IO.NEW_LINE(STANDARD_ERROR); end SYNERR; procedure SET_FILENAME (STR : in VSTRING) is begin LEX_FILENAME := STR; end SET_FILENAME; end MISC;
zhmu/ananas
Ada
582
ads
-- { dg-do compile } -- { dg-options "-O2 -gnata -gnatVa" } with Opt5_Pkg; package Opt5 is type Object is new Opt5_Pkg.Object with private; Undefined : constant Object; overriding function Is_Defined (Self : Object) return Boolean; function Create (Sloc : Opt5_Pkg.Object) return Integer is (0) with Pre => Sloc.Is_Defined; private type Object is new Opt5_Pkg.Object with null record; Undefined : constant Object := (Opt5_Pkg.Undefined with others => <>); overriding function Is_Defined (Self : Object) return Boolean is (Self /= Undefined); end Opt5;
apple-oss-distributions/old_ncurses
Ada
3,006
ads
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses2.trace_set -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno <[email protected]> 2000 -- Version Control -- $Revision: 1.1.1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure ncurses2.trace_set;
rveenker/sdlada
Ada
2,397
ads
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- -- SDL.Inputs.Keyboards -------------------------------------------------------------------------------------------------------------------- with SDL.Events.Keyboards; with SDL.Video.Rectangles; with SDL.Video.Windows; package SDL.Inputs.Keyboards is function Get_Focus return SDL.Video.Windows.ID with Inline => True; -- TODO: -- type Key_State_Array is array () of SDL.Video.Windows.Scan_Codes; -- function Keys return function Get_Modifiers return SDL.Events.Keyboards.Key_Modifiers with Inline => True; procedure Set_Modifiers (Modifiers : in SDL.Events.Keyboards.Key_Modifiers) with Inline => True; -- Screen keyboard. function Supports_Screen_Keyboard return Boolean with Inline => True; function Is_Screen_Keyboard_Visible (Window : in SDL.Video.Windows.Window) return Boolean with Inline => True; -- Text input. function Is_Text_Input_Enabled return Boolean with Inline => True; procedure Set_Text_Input_Rectangle (Rectangle : in SDL.Video.Rectangles.Rectangle) with Inline => True; procedure Start_Text_Input with Inline => True; procedure Stop_Text_Input with Inline => True; end SDL.Inputs.Keyboards;
reznikmm/matreshka
Ada
3,669
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Tools Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2015, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Asis; with Engines.Contexts; with League.Strings; package Properties.Expressions.If_Expression is function Code (Engine : access Engines.Contexts.Context; Element : Asis.Expression; Name : Engines.Text_Property) return League.Strings.Universal_String; end Properties.Expressions.If_Expression;
godunko/cga
Ada
6,192
adb
-- -- Copyright (C) 2023, Vadim Godunko <[email protected]> -- -- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -- with Interfaces; with CGK.Internals.Shewchuk_Arithmetic; package body CGK.Internals.Shewchuk is use type CGK.Reals.Real; Epsilon : constant CGK.Reals.Real := CGK.Reals.Real'Model_Epsilon * 0.5; Result_Error_Bound : constant CGK.Reals.Real := (3.0 + 8.0 * Epsilon) * Epsilon; CCW_Error_Bound_A : constant CGK.Reals.Real := (3.0 + 16.0 * Epsilon) * Epsilon; CCW_Error_Bound_B : constant CGK.Reals.Real := (2.0 + 12.0 * Epsilon) * Epsilon; CCW_Error_Bound_C : constant CGK.Reals.Real := (9.0 + 64.0 * Epsilon) * Epsilon * Epsilon; function Orientation_Adaptive (PA : CGK.Mathematics.Vectors_2.Vector_2; PB : CGK.Mathematics.Vectors_2.Vector_2; PC : CGK.Mathematics.Vectors_2.Vector_2; Det_Sum : CGK.Reals.Real) return CGK.Reals.Real; ----------------- -- Orientation -- ----------------- function Orientation (PA : CGK.Mathematics.Vectors_2.Vector_2; PB : CGK.Mathematics.Vectors_2.Vector_2; PC : CGK.Mathematics.Vectors_2.Vector_2) return CGK.Reals.Real is Det_Left : constant CGK.Reals.Real := (PA (0) - PC (0)) * (PB (1) - PC (1)); Det_Right : constant CGK.Reals.Real := (PA (1) - PC (1)) * (PB (0) - PC (0)); Det : constant CGK.Reals.Real := Det_Left - Det_Right; Det_Sum : CGK.Reals.Real; Error_Bound : CGK.Reals.Real; begin if Det_Left > 0.0 then if Det_Right <= 0.0 then return Det; else Det_Sum := Det_Left + Det_Right; end if; elsif Det_Left < 0.0 then if Det_Right >= 0.0 then return Det; else Det_Sum := -Det_Left - Det_Right; end if; else return Det; end if; Error_Bound := CCW_Error_Bound_A * Det_Sum; if abs Det >= Error_Bound then return Det; end if; return Orientation_Adaptive (PA, PB, PC, Det_Sum); end Orientation; -------------------------- -- Orientation_Adaptive -- -------------------------- function Orientation_Adaptive (PA : CGK.Mathematics.Vectors_2.Vector_2; PB : CGK.Mathematics.Vectors_2.Vector_2; PC : CGK.Mathematics.Vectors_2.Vector_2; Det_Sum : CGK.Reals.Real) return CGK.Reals.Real is ACX : constant CGK.Reals.Real := PA (0) - PC (0); BCX : constant CGK.Reals.Real := PB (0) - PC (0); ACY : constant CGK.Reals.Real := PA (1) - PC (1); BCY : constant CGK.Reals.Real := PB (1) - PC (1); ACX_Tail : CGk.Reals.Real; BCX_Tail : CGk.Reals.Real; ACY_Tail : CGk.Reals.Real; BCY_Tail : CGk.Reals.Real; Det_Left : CGk.Reals.Real; Det_Left_Tail : CGk.Reals.Real; Det_Right : CGk.Reals.Real; Det_Right_Tail : CGk.Reals.Real; Det : CGk.Reals.Real; Error_Bound : CGk.Reals.Real; B : CGK.Internals.Shewchuk_Arithmetic.Real_Array (0 .. 3); U : CGK.Internals.Shewchuk_Arithmetic.Real_Array (0 .. 3); C1 : CGK.Internals.Shewchuk_Arithmetic.Real_Array (0 .. 7); C1L : Interfaces.Unsigned_32; C2 : CGK.Internals.Shewchuk_Arithmetic.Real_Array (0 .. 11); C2L : Interfaces.Unsigned_32; D : CGK.Internals.Shewchuk_Arithmetic.Real_Array (0 .. 15); DL : Interfaces.Unsigned_32; S0 : CGK.Reals.Real; S1 : CGK.Reals.Real; T0 : CGK.Reals.Real; T1 : CGK.Reals.Real; begin CGK.Internals.Shewchuk_Arithmetic.Two_Product (ACX, BCY, Det_Left, Det_Left_Tail); CGK.Internals.Shewchuk_Arithmetic.Two_Product (ACY, BCX, Det_Right, Det_Right_Tail); CGK.Internals.Shewchuk_Arithmetic.Two_Two_Diff (Det_Left, Det_Left_Tail, Det_Right, Det_Right_Tail, B (3), B(2), B (1), B (0)); Det := CGK.Internals.Shewchuk_Arithmetic.Estimate (B); Error_Bound := CCW_Error_Bound_B * Det_Sum; if abs Det >= Error_Bound then return Det; end if; CGK.Internals.Shewchuk_Arithmetic.Two_Diff_Tail (PA (0), PC (0), ACX, ACX_Tail); CGK.Internals.Shewchuk_Arithmetic.Two_Diff_Tail (PB (0), PC (0), BCX, BCX_Tail); CGK.Internals.Shewchuk_Arithmetic.Two_Diff_Tail (PA (1), PC (1), ACY, ACY_Tail); CGK.Internals.Shewchuk_Arithmetic.Two_Diff_Tail (PB (1), PC (1), BCY, BCY_Tail); if ACX_Tail = 0.0 and ACY_Tail = 0.0 and BCX_Tail = 0.0 and BCY_Tail = 0.0 then return Det; end if; Error_Bound := CCW_Error_Bound_C * Det_Sum + Result_Error_Bound * abs Det; Det := @ + (ACX * BCY_Tail + BCY * ACX_Tail) - (ACY * BCX_Tail + BCX * ACY_Tail); if abs Det >= Error_Bound then return Det; end if; CGK.Internals.Shewchuk_Arithmetic.Two_Product (ACX_Tail, BCY, S1, S0); CGK.Internals.Shewchuk_Arithmetic.Two_Product (ACY_Tail, BCX, T1, T0); CGK.Internals.Shewchuk_Arithmetic.Two_Two_Diff (S1, S0, T1, T0, U (3), U (2), U (1), U (0)); CGK.Internals.Shewchuk_Arithmetic.Fast_Expansion_Sum_Zero_Elim (B, U, C1, C1L); CGK.Internals.Shewchuk_Arithmetic.Two_Product (ACX, BCY_Tail, S1, S0); CGK.Internals.Shewchuk_Arithmetic.Two_Product (ACY, BCX_Tail, T1, T0); CGK.Internals.Shewchuk_Arithmetic.Two_Two_Diff (S1, S0, T1, T0, U (3), U (2), U (1), U (0)); CGK.Internals.Shewchuk_Arithmetic.Fast_Expansion_Sum_Zero_Elim (C1 (C1'First .. C1L), U, C2, C2L); CGK.Internals.Shewchuk_Arithmetic.Two_Product (ACX_Tail, BCY_Tail, S1, S0); CGK.Internals.Shewchuk_Arithmetic.Two_Product (ACY_Tail, BCX_Tail, T1, T0); CGK.Internals.Shewchuk_Arithmetic.Two_Two_Diff (S1, S0, T1, T0, U (3), U (2), U (1), U (0)); CGK.Internals.Shewchuk_Arithmetic.Fast_Expansion_Sum_Zero_Elim (C2 (C2'First .. C2L), U, D, DL); return D (DL); end Orientation_Adaptive; end CGK.Internals.Shewchuk;
sungyeon/drake
Ada
978
ads
pragma License (Unrestricted); -- implementation unit specialized for Windows with Ada.Colors; package System.Native_Text_IO.Terminal_Colors is pragma Preelaborate; type Color is mod 16; -- Note: Color represents a combination of BLUE(1), GREEN(2), RED(4), -- and INTENSITY(8). function RGB_To_Color (Item : Ada.Colors.RGB) return Color; function Brightness_To_Grayscale_Color (Item : Ada.Colors.Brightness) return Color; procedure Set ( Handle : Handle_Type; Reset : Boolean; Bold_Changing : Boolean; Bold : Boolean; Underline_Changing : Boolean; Underline : Boolean; Blink_Changing : Boolean; Blink : Boolean; Reversed_Changing : Boolean; Reversed : Boolean; Foreground_Changing : Boolean; Foreground : Color; Background_Changing : Boolean; Background : Color); procedure Reset ( Handle : Handle_Type); end System.Native_Text_IO.Terminal_Colors;
jwarwick/aoc_2019_ada
Ada
4,373
adb
-- AoC 2019, Day 6 with Ada.Text_IO; with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Containers.Ordered_Sets; with Ada.Strings.Hash; with Ada.Strings.Fixed; use Ada.Strings.Fixed; -- with GNAT.String_Split; -- with Ada.Characters.Latin_1; package body Day is package TIO renames Ada.Text_IO; package Orbit_Element_Set is new Ada.Containers.Ordered_Sets (Element_Type => Unbounded_String); type Orbit is record Name : Unbounded_String := Null_Unbounded_String; Parent : Unbounded_String := Null_Unbounded_String; Children : Orbit_Element_Set.Set := Orbit_Element_Set.Empty_Set; Depth : Natural := 0; end record; pragma Warnings (Off, "procedure ""Put"" is not referenced"); procedure Put(value : in Orbit) is pragma Warnings (On, "procedure ""Put"" is not referenced"); begin TIO.Put("Orbit: " & to_string(value.Name) & ", Parent: " & to_string(value.Parent) & ", Depth: " & Natural'IMAGE(value.Depth)); TIO.New_Line; TIO.Put(" Children: "); for c of value.Children loop TIO.Put(to_string(c) & " "); end loop; end Put; package Orbit_Hashed_Maps is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => Orbit, Hash => Ada.Strings.Hash, Equivalent_Keys => "="); procedure parse_line(line : in String; orbits : in out Orbit_List.Vector) is idx : constant Natural := index(line, ")"); left : constant String := line(line'first .. idx-1); right : constant String := line(idx+1 .. line'last); curr : constant Orbit_Entry := Orbit_Entry'(left => to_unbounded_string(left), right => to_unbounded_string(right)); begin orbits.append(curr); end parse_line; function load_orbits(filename : in String) return Orbit_List.Vector is file : TIO.File_Type; orbits : Orbit_List.Vector; begin TIO.open(File => file, Mode => TIO.In_File, Name => filename); while not TIO.end_of_file(file) loop parse_line(TIO.get_line(file), orbits); end loop; TIO.close(file); return orbits; end load_orbits; -- function load_orbits_from_string(str : in String) return Orbit_List.Vector is -- use GNAT; -- use Ada.Characters; -- orbits : Orbit_List.Vector := Orbit_List.Empty_Vector; -- subs : String_Split.Slice_Set; -- seps : constant String := Latin_1.LF & Latin_1.CR; -- begin -- String_Split.Create(S => subs, From => str, Separators => seps, Mode => String_Split.Multiple); -- for i in 1 .. String_Split.Slice_Count(subs) loop -- declare -- line : constant String := String_Split.Slice(subs, i); -- begin -- parse_line(line, orbits); -- end; -- end loop; -- return orbits; -- end load_orbits_from_string; procedure add_orbit(name : in Unbounded_String; parent : in Unbounded_String; orbits : in out Orbit_Hashed_Maps.Map) is begin orbits.include(to_string(name), Orbit'( Name => name, Parent => parent, Children => Orbit_Element_Set.Empty_Set, Depth => 0)); end add_orbit; procedure propogate_depth(name : in String; depth : in Integer; orbits : in out Orbit_Hashed_Maps.Map) is curr : Orbit := orbits(name); begin curr.Depth := depth; orbits(name) := curr; for c of curr.Children loop propogate_depth(to_string(c), depth + 1, orbits); end loop; end propogate_depth; function build_map(ol : in Orbit_List.Vector) return Orbit_Hashed_Maps.Map is orbits : Orbit_Hashed_Maps.Map := Orbit_Hashed_Maps.Empty_Map; begin for curr of ol loop if not orbits.contains(to_string(curr.left)) then add_orbit(curr.left, Null_Unbounded_String, orbits); end if; if not orbits.contains(to_string(curr.right)) then add_orbit(curr.right, curr.left, orbits); end if; orbits(to_string(curr.left)).Children.insert(curr.right); end loop; propogate_depth("COM", 0, orbits); return orbits; end build_map; function orbit_count_checksum(ol : in Orbit_List.Vector) return Orbit_Checksum is orbits : constant Orbit_Hashed_Maps.Map := build_map(ol); total : Natural := 0; begin for c in orbits.Iterate loop total := total + orbits(c).Depth; -- Put(orbits(c)); -- TIO.New_Line; end loop; return Orbit_Checksum(total); end orbit_count_checksum; end Day;
AdaCore/libadalang
Ada
294
adb
procedure Testcw is package Tag is type A is tagged record A : Integer; end record; procedure Foo (Self : A) is null; end Tag; use Tag; begin declare CW : A'Class := A'(A => 12); begin CW.Foo; end; pragma Test_Block; end Testcw;
reznikmm/matreshka
Ada
6,339
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.Constants; with ODF.DOM.Elements.Style.Paragraph_Properties.Internals; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Elements.Style.Paragraph_Properties is ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access Style_Paragraph_Properties_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.ODF_Visitor'Class then ODF.DOM.Visitors.ODF_Visitor'Class (Visitor).Enter_Style_Paragraph_Properties (ODF.DOM.Elements.Style.Paragraph_Properties.Internals.Create (Style_Paragraph_Properties_Access (Self)), Control); else Matreshka.DOM_Nodes.Elements.Abstract_Element (Self.all).Enter_Element (Visitor, Control); end if; end Enter_Element; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Style_Paragraph_Properties_Node) return League.Strings.Universal_String is begin return ODF.Constants.Paragraph_Properties_Name; end Get_Local_Name; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access Style_Paragraph_Properties_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.ODF_Visitor'Class then ODF.DOM.Visitors.ODF_Visitor'Class (Visitor).Leave_Style_Paragraph_Properties (ODF.DOM.Elements.Style.Paragraph_Properties.Internals.Create (Style_Paragraph_Properties_Access (Self)), Control); else Matreshka.DOM_Nodes.Elements.Abstract_Element (Self.all).Leave_Element (Visitor, Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access Style_Paragraph_Properties_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Iterator in ODF.DOM.Iterators.ODF_Iterator'Class then ODF.DOM.Iterators.ODF_Iterator'Class (Iterator).Visit_Style_Paragraph_Properties (Visitor, ODF.DOM.Elements.Style.Paragraph_Properties.Internals.Create (Style_Paragraph_Properties_Access (Self)), Control); else Matreshka.DOM_Nodes.Elements.Abstract_Element (Self.all).Visit_Element (Iterator, Visitor, Control); end if; end Visit_Element; end Matreshka.ODF_Elements.Style.Paragraph_Properties;
Holt59/Ada-SDL
Ada
2,910
ads
-------------------------------------------- -- -- -- PACKAGE GAME - PARTIE ADA -- -- -- -- GAME.ADS -- -- -- -- Gestion des outils de base -- -- -- -- Créateur : CAPELLE Mikaël -- -- Adresse : [email protected] -- -- -- -- Dernière modification : 14 / 06 / 2011 -- -- -- -------------------------------------------- with Interfaces.C; use Interfaces.C; with Ada.Finalization; package Game is -- Les différentes erreurs pouvant être levé par la librairie -- Elles sont en générales accompagnés d'une instruction détaillé (pour plus d'info, voir -- le package Ada.Exceptions) -- La fonction error est (en général) appelé directement lorsque ces exceptions sont levées, -- mais vous pouvez l'utilisez vous même si vous en avez besoin Init_Error : exception; Video_Error : exception; Surface_Error : exception; Audio_Error : exception; Font_Error : exception; Draw_Error : exception; -- Type servant à stocker des surfaces graphique -- ne peut être utilisé directement, vous devez passer par les fonctions type Surface is private; Null_Surface : constant Surface; -- Initialise la librairie -- Sans argument la fonction initialise tout -- Lève l'exception Init_Error si une erreur survient procedure Init(Timer : in Boolean := True; Video : in Boolean := True; Audio : in Boolean := True; Font : in Boolean := True; Frequency : in Positive := 44100); -- Ferme la librairie (à utiliser à la fin du programme) procedure Quit; -- Change le titre ou l'icone de la fenêtre procedure Change_Title (Name : in String); procedure Change_Icon (Name : in String); procedure Change_Icon (Surf : in Surface); -- Retourne une indication sur la dernière erreur survenue function Error return String; private package AF renames Ada.Finalization; type SDL_Surface is access all Int; Null_SDL_Surface : constant SDL_Surface := null; C_Screen : SDL_Surface := Null_SDL_Surface; -- Ecran principale (pour faciliter Get_Screen) -- Libère la mémoire alloué par une surface procedure Free_Surface (S : in out Surface); type Surface is new AF.Controlled with record Surf : SDL_Surface; end record; procedure Initialize (S : in out Surface); procedure Adjust (S : in out Surface); procedure Finalize (S : in out Surface); Null_Surface : constant Surface := (AF.Controlled with Null_SDL_Surface); end Game;
optikos/oasis
Ada
4,395
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Elements.Expressions; with Program.Lexical_Elements; with Program.Elements.Simple_Expression_Ranges; with Program.Element_Visitors; package Program.Nodes.Simple_Expression_Ranges is pragma Preelaborate; type Simple_Expression_Range is new Program.Nodes.Node and Program.Elements.Simple_Expression_Ranges.Simple_Expression_Range and Program.Elements.Simple_Expression_Ranges .Simple_Expression_Range_Text with private; function Create (Lower_Bound : not null Program.Elements.Expressions .Expression_Access; Double_Dot_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Upper_Bound : not null Program.Elements.Expressions .Expression_Access) return Simple_Expression_Range; type Implicit_Simple_Expression_Range is new Program.Nodes.Node and Program.Elements.Simple_Expression_Ranges.Simple_Expression_Range with private; function Create (Lower_Bound : not null Program.Elements.Expressions .Expression_Access; Upper_Bound : not null Program.Elements.Expressions .Expression_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Simple_Expression_Range with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Simple_Expression_Range is abstract new Program.Nodes.Node and Program.Elements.Simple_Expression_Ranges.Simple_Expression_Range with record Lower_Bound : not null Program.Elements.Expressions.Expression_Access; Upper_Bound : not null Program.Elements.Expressions.Expression_Access; end record; procedure Initialize (Self : aliased in out Base_Simple_Expression_Range'Class); overriding procedure Visit (Self : not null access Base_Simple_Expression_Range; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Lower_Bound (Self : Base_Simple_Expression_Range) return not null Program.Elements.Expressions.Expression_Access; overriding function Upper_Bound (Self : Base_Simple_Expression_Range) return not null Program.Elements.Expressions.Expression_Access; overriding function Is_Simple_Expression_Range_Element (Self : Base_Simple_Expression_Range) return Boolean; overriding function Is_Constraint_Element (Self : Base_Simple_Expression_Range) return Boolean; overriding function Is_Definition_Element (Self : Base_Simple_Expression_Range) return Boolean; type Simple_Expression_Range is new Base_Simple_Expression_Range and Program.Elements.Simple_Expression_Ranges .Simple_Expression_Range_Text with record Double_Dot_Token : not null Program.Lexical_Elements .Lexical_Element_Access; end record; overriding function To_Simple_Expression_Range_Text (Self : aliased in out Simple_Expression_Range) return Program.Elements.Simple_Expression_Ranges .Simple_Expression_Range_Text_Access; overriding function Double_Dot_Token (Self : Simple_Expression_Range) return not null Program.Lexical_Elements.Lexical_Element_Access; type Implicit_Simple_Expression_Range is new Base_Simple_Expression_Range with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; end record; overriding function To_Simple_Expression_Range_Text (Self : aliased in out Implicit_Simple_Expression_Range) return Program.Elements.Simple_Expression_Ranges .Simple_Expression_Range_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Simple_Expression_Range) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Simple_Expression_Range) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Simple_Expression_Range) return Boolean; end Program.Nodes.Simple_Expression_Ranges;
VitalijBondarenko/adanls
Ada
3,071
adb
------------------------------------------------------------------------------ -- -- -- Copyright (c) 2014-2022 Vitalii Bondarenko <[email protected]> -- -- -- ------------------------------------------------------------------------------ -- -- -- The MIT License (MIT) -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, sublicense, and/or sell copies of the Software, and to -- -- permit persons to whom the Software is furnished to do so, subject to -- -- the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -- -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -- -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- ------------------------------------------------------------------------------ with Interfaces.C.Strings; use Interfaces.C.Strings; package body L10n is pragma Warnings (Off); ---------------- -- Set_Locale -- ---------------- procedure Set_Locale (Category : Locale_Category := LC_ALL; Locale : String := "") is procedure Internal (Category : Locale_Category; Locale : String); pragma Import (C, Internal, "setlocale"); begin Internal (Category, Locale & ASCII.NUL); end Set_Locale; ---------------- -- Get_Locale -- ---------------- function Get_Locale (Category : Locale_Category := LC_ALL) return String is function Internal (Category : Locale_Category; Locale : chars_ptr) return chars_ptr; pragma Import (C, Internal, "setlocale"); L : chars_ptr := Internal (Category, Null_Ptr); begin if L = Null_Ptr then return ""; else return Value (L); end if; end Get_Locale; end L10n;
RREE/ada-util
Ada
11,563
adb
----------------------------------------------------------------------- -- util-commands-drivers -- Support to make command line tools -- Copyright (C) 2017, 2018, 2019, 2021 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Log.Loggers; with Util.Strings.Formats; with Ada.Text_IO; use Ada.Text_IO; package body Util.Commands.Drivers is use Ada.Strings.Unbounded; -- The logger Logs : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create (Driver_Name); function "-" (Message : in String) return String is (Translate (Message)) with Inline; -- ------------------------------ -- Get the description associated with the command. -- ------------------------------ function Get_Description (Command : in Command_Type) return String is begin return To_String (Command.Description); end Get_Description; -- ------------------------------ -- Get the name used to register the command. -- ------------------------------ function Get_Name (Command : in Command_Type) return String is begin return To_String (Command.Name); end Get_Name; -- ------------------------------ -- Write the command usage. -- ------------------------------ procedure Usage (Command : in out Command_Type; Name : in String; Context : in out Context_Type) is Config : Config_Type; begin Command_Type'Class (Command).Setup (Config, Context); Config_Parser.Usage (Name, Config); end Usage; -- ------------------------------ -- Print a message for the command. The level indicates whether the message is an error, -- warning or informational. The command name can be used to known the originator. -- The <tt>Log</tt> operation is redirected to the driver's <tt>Log</tt> procedure. -- ------------------------------ procedure Log (Command : in Command_Type; Level : in Util.Log.Level_Type; Name : in String; Message : in String) is begin Command.Driver.Log (Level, Name, Message); end Log; -- ------------------------------ -- Execute the help command with the arguments. -- Print the help for every registered command. -- ------------------------------ overriding procedure Execute (Command : in out Help_Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type) is procedure Compute_Size (Position : in Command_Sets.Cursor); procedure Print (Position : in Command_Sets.Cursor); Column : Ada.Text_IO.Positive_Count := 1; procedure Compute_Size (Position : in Command_Sets.Cursor) is Cmd : constant Command_Access := Command_Sets.Element (Position); Len : constant Natural := Length (Cmd.Name); begin if Natural (Column) < Len then Column := Ada.Text_IO.Positive_Count (Len); end if; end Compute_Size; procedure Print (Position : in Command_Sets.Cursor) is Cmd : constant Command_Access := Command_Sets.Element (Position); begin Put (" "); Put (To_String (Cmd.Name)); if Length (Cmd.Description) > 0 then Set_Col (Column + 7); Put (To_String (Cmd.Description)); end if; New_Line; end Print; begin Logs.Debug ("Execute command {0}", Name); if Args.Get_Count = 0 then Usage (Command.Driver.all, Args, Context); New_Line; Put_Line (Strings.Formats.Format (-("Type '{0} help {command}' for help " & "on a specific command."), Driver_Name)); Put_Line (-("Available subcommands:")); Command.Driver.List.Iterate (Process => Compute_Size'Access); Command.Driver.List.Iterate (Process => Print'Access); else declare Cmd_Name : constant String := Args.Get_Argument (1); Target_Cmd : constant Command_Access := Command.Driver.Find_Command (Cmd_Name); begin if Target_Cmd = null then Logs.Error (-("unknown command '{0}'"), Cmd_Name); raise Not_Found; else Target_Cmd.Help (Cmd_Name, Context); end if; end; end if; end Execute; -- ------------------------------ -- Write the help associated with the command. -- ------------------------------ procedure Help (Command : in out Help_Command_Type; Name : in String; Context : in out Context_Type) is begin null; end Help; -- ------------------------------ -- Report the command usage. -- ------------------------------ procedure Usage (Driver : in Driver_Type; Args : in Argument_List'Class; Context : in out Context_Type; Name : in String := "") is begin Put_Line (To_String (Driver.Desc)); New_Line; if Name'Length > 0 then declare Command : constant Command_Access := Driver.Find_Command (Name); begin if Command /= null then Command.Usage (Name, Context); else Put (-("Invalid command")); end if; end; else Put (-("Usage: ")); Put (Args.Get_Command_Name); Put (" "); Put_Line (To_String (Driver.Usage)); end if; end Usage; -- ------------------------------ -- Set the driver description printed in the usage. -- ------------------------------ procedure Set_Description (Driver : in out Driver_Type; Description : in String) is begin Driver.Desc := Ada.Strings.Unbounded.To_Unbounded_String (Description); end Set_Description; -- ------------------------------ -- Set the driver usage printed in the usage. -- ------------------------------ procedure Set_Usage (Driver : in out Driver_Type; Usage : in String) is begin Driver.Usage := Ada.Strings.Unbounded.To_Unbounded_String (Usage); end Set_Usage; -- ------------------------------ -- Register the command under the given name. -- ------------------------------ procedure Add_Command (Driver : in out Driver_Type; Name : in String; Command : in Command_Access) is begin Command.Name := To_Unbounded_String (Name); Command.Driver := Driver'Unchecked_Access; Driver.List.Include (Command); end Add_Command; procedure Add_Command (Driver : in out Driver_Type; Name : in String; Description : in String; Command : in Command_Access) is begin Command.Name := To_Unbounded_String (Name); Command.Description := To_Unbounded_String (Description); Add_Command (Driver, Name, Command); end Add_Command; -- ------------------------------ -- Register the command under the given name. -- ------------------------------ procedure Add_Command (Driver : in out Driver_Type; Name : in String; Description : in String; Handler : in Command_Handler) is Command : constant Command_Access := new Handler_Command_Type '(Driver => Driver'Unchecked_Access, Description => To_Unbounded_String (Description), Name => To_Unbounded_String (Name), Handler => Handler); begin Driver.List.Include (Command); end Add_Command; -- ------------------------------ -- Find the command having the given name. -- Returns null if the command was not found. -- ------------------------------ function Find_Command (Driver : in Driver_Type; Name : in String) return Command_Access is Cmd : aliased Help_Command_Type; Pos : Command_Sets.Cursor; begin Cmd.Name := To_Unbounded_String (Name); Pos := Driver.List.Find (Cmd'Unchecked_Access); if Command_Sets.Has_Element (Pos) then return Command_Sets.Element (Pos); else return null; end if; end Find_Command; -- ------------------------------ -- Execute the command registered under the given name. -- ------------------------------ procedure Execute (Driver : in Driver_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type) is procedure Execute (Cmd_Args : in Argument_List'Class); Command : constant Command_Access := Driver.Find_Command (Name); procedure Execute (Cmd_Args : in Argument_List'Class) is begin Command.Execute (Name, Cmd_Args, Context); end Execute; begin if Command /= null then declare Config : Config_Type; begin Command.Setup (Config, Context); Config_Parser.Execute (Config, Args, Execute'Access); end; else Logs.Error (-("unknown command '{0}'"), Name); raise Not_Found; end if; end Execute; -- ------------------------------ -- Print a message for the command. The level indicates whether the message is an error, -- warning or informational. The command name can be used to known the originator. -- ------------------------------ procedure Log (Driver : in Driver_Type; Level : in Util.Log.Level_Type; Name : in String; Message : in String) is pragma Unreferenced (Driver); begin Logs.Print (Level, "{0}: {1}", Name, Message); end Log; -- ------------------------------ -- Execute the command with the arguments. -- ------------------------------ overriding procedure Execute (Command : in out Handler_Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type) is begin Command.Handler (Name, Args, Context); end Execute; -- ------------------------------ -- Write the help associated with the command. -- ------------------------------ overriding procedure Help (Command : in out Handler_Command_Type; Name : in String; Context : in out Context_Type) is begin null; end Help; end Util.Commands.Drivers;
faelys/natools
Ada
1,662
ads
------------------------------------------------------------------------------ -- Copyright (c) 2011, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Natools.Chunked_Strings.Tests.CXA4030 is the transcription to -- -- Chunked_String of ACATS test CXA4030 for Unbounded_String. -- ------------------------------------------------------------------------------ with Natools.Tests; generic procedure Natools.Chunked_Strings.Tests.CXA4030 (Report : in out Natools.Tests.Reporter'Class); pragma Preelaborate (CXA4030);
BrickBot/Bound-T-H8-300
Ada
5,642
adb
-- Calling.Stacked (body) -- -- A component of the Bound-T Worst-Case Execution Time Tool. -- ------------------------------------------------------------------------------- -- Copyright (c) 1999 .. 2015 Tidorum Ltd -- 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. -- -- 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. -- -- Other modules (files) of this software composition should contain their -- own copyright statements, which may have different copyright and usage -- conditions. The above conditions apply to this file. ------------------------------------------------------------------------------- -- -- $Revision: 1.3 $ -- $Date: 2015/10/24 20:05:47 $ -- -- $Log: calling-stacked.adb,v $ -- Revision 1.3 2015/10/24 20:05:47 niklas -- Moved to free licence. -- -- Revision 1.2 2007-12-17 13:54:35 niklas -- BT-CH-0098: Assertions on stack usage and final stack height, etc. -- -- Revision 1.1 2005/02/23 09:05:17 niklas -- BT-CH-0005. -- with Ada.Strings.Unbounded; with Flow; with Output; package body Calling.Stacked is function Static (Item : Protocol_T) return Boolean is begin for I in Item.Intervals'Range loop if not Storage.Bounds.Singular (Item.Intervals(I)) then return False; end if; end loop; return True; end Static; function Basis (Item : Protocol_T) return Storage.Cell_List_T is Result : Storage.Cell_List_T (1 .. Item.Intervals'Length); Last : Natural := 0; -- The result will be Result(1 .. Last). begin for I in Item.Intervals'Range loop if not Storage.Bounds.Singular (Item.Intervals(I)) then -- This stack-height cell is not yet fully bounded. Last := Last + 1; Result(Last) := Programs.Stack_Height (I, Item.Program); end if; end loop; return Result(1 .. Last); end Basis; function Image (Item : Protocol_T) return String is use Ada.Strings.Unbounded; Result : Unbounded_String; -- The result. Height : Storage.Cell_T; -- A stack-height cell. begin Result := To_Unbounded_String ("Stack"); for I in Item.Intervals'Range loop Height := Programs.Stack_Height (I, Item.Program); Append (Result, ", "); Append ( Result, Storage.Bounds.Image ( Item => Item.Intervals(I), Name => Storage.Image (Height))); end loop; return To_String (Result); end Image; procedure Apply ( Bounds : in Storage.Bounds.Bounds_T'Class; Upon : in Protocol_T; Giving : out Calling.Protocol_Ref) is use type Storage.Bounds.Interval_T; Height : Storage.Cell_T; -- A stack-height cell. New_Bounds : Storage.Bounds.Interval_T; -- The range of values for a stack-height cell under the Bounds. Result : Protocol_Ref := null; -- The new Stacked Protocol, if one is created. -- Initially we have not yet created one. begin for I in Upon.Intervals'Range loop Height := Programs.Stack_Height ( Index => I, Within => Upon.Program); New_Bounds := Storage.Bounds.Interval ( Cell => Height, Under => Bounds); if Upon.Intervals(I) <= New_Bounds then -- The new bounds are no better than the old ones. null; else -- The new bounds are sharper than the old ones at -- least at one end (min or max). if Result = null then -- This was the first stack with better bounds. -- Create a new protocol: Result := new Protocol_T'Class'(Protocol_T'Class (Upon)); end if; Result.Intervals(I) := Upon.Intervals(I) and New_Bounds; if Storage.Bounds.Void (Result.Intervals(I)) then Output.Warning ( "Conflicting stack-height bounds" & Output.Field_Separator & Programs.Stack_Name (Index => I, Within => Upon.Program)); -- TBA discard Result. raise Flow.False_Path; end if; end if; end loop; Giving := Calling.Protocol_Ref (Result); -- Null if no better bounds were found. end Apply; end Calling.Stacked;
AdaCore/libadalang
Ada
95
adb
separate (a) procedure pa is begin null; end pa; --% node.parent.f_name.p_referenced_decl()
zhmu/ananas
Ada
4,773
ads
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . B O U N D E D _ M A I L B O X E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2003-2022, 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. -- -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This package provides a thread-safe asynchronous communication facility -- in the form of mailboxes. Individual mailbox objects are bounded in size -- to a value specified by their Capacity discriminants. -- Mailboxes actually hold references to messages, not the message values -- themselves. -- Type Mailbox is defined explicitly as a protected type (via derivation -- from a protected type) so that clients may treat them accordingly (for -- example, by making conditional/timed entry calls). with System; with GNAT.Bounded_Buffers; generic type Message (<>) is limited private; type Message_Reference is access all Message; -- Mailboxes hold references to Message values, of this type package GNAT.Bounded_Mailboxes is pragma Preelaborate; package Message_Refs is new GNAT.Bounded_Buffers (Message_Reference); type Mailbox is new Message_Refs.Bounded_Buffer; -- Type Mailbox has two inherited discriminants: -- Capacity : Positive; -- Capacity is the maximum number of Message references -- possibly contained at any given instant. -- Ceiling : System.Priority; -- Users must specify the ceiling priority for the object. -- If the Real-Time Systems Annex is not in use this value -- is not important. -- Protected type Mailbox has the following inherited interface: -- entry Insert (Item : Message_Reference); -- Insert Item into the Mailbox. Blocks caller -- until space is available. -- entry Remove (Item : out Message_Reference); -- Remove next available Message_Reference from Mailbox. -- Blocks caller until a Message_Reference is available. -- function Empty return Boolean; -- Returns whether the Mailbox contains any Message_References. -- Note: State may change immediately after call returns. -- function Full return Boolean; -- Returns whether any space remains within the Mailbox. -- Note: State may change immediately after call returns. -- function Extent return Natural; -- Returns the number of Message_Reference values currently held -- within the Mailbox. -- Note: State may change immediately after call returns. Default_Ceiling : constant System.Priority := Message_Refs.Default_Ceiling; -- A convenience value for the Ceiling discriminant end GNAT.Bounded_Mailboxes;
reznikmm/matreshka
Ada
4,081
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Text_String_Value_If_True_Attributes; package Matreshka.ODF_Text.String_Value_If_True_Attributes is type Text_String_Value_If_True_Attribute_Node is new Matreshka.ODF_Text.Abstract_Text_Attribute_Node and ODF.DOM.Text_String_Value_If_True_Attributes.ODF_Text_String_Value_If_True_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Text_String_Value_If_True_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Text_String_Value_If_True_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Text.String_Value_If_True_Attributes;
MinimSecure/unum-sdk
Ada
834
ads
-- Copyright 2018-2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with System; package Pck is procedure Do_Nothing (A : System.Address); function Get_Name return String; end Pck;
reznikmm/matreshka
Ada
4,870
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Tools Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2015, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This test detects parameters to link with OCI (Oracle Call Interface) -- library. -- -- It sets following substitution variables: -- - HAS_OCI -- - OCI_LIBRARY_OPTIONS ------------------------------------------------------------------------------ with Configure.Abstract_Tests; private with Configure.Component_Switches; with Configure.Tests.Operating_System; package Configure.Tests.OCI is type OCI_Test (Operating_System_Test : not null access Configure.Tests.Operating_System.Operating_System_Test'Class) is new Configure.Abstract_Tests.Abstract_Test with private; overriding function Name (Self : OCI_Test) return String; -- Returns name of the test to be used in reports. overriding function Help (Self : OCI_Test) return Unbounded_String_Vector; -- Returns help information for test. overriding procedure Execute (Self : in out OCI_Test; Arguments : in out Unbounded_String_Vector); -- Executes test's actions. All used arguments must be removed from -- Arguments. private type OCI_Test (Operating_System_Test : not null access Configure.Tests.Operating_System.Operating_System_Test'Class) is new Configure.Abstract_Tests.Abstract_Test with record Switches : Configure.Component_Switches.Component_Switches := Configure.Component_Switches.Create (Name => "oracle", Description => "Oracle support", Libdir_Enabled => True); end record; end Configure.Tests.OCI;
stcarrez/dynamo
Ada
926
ads
----------------------------------------------------------------------- -- Test -- Test the code generation -- Copyright (C) 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Tests is type Millisecond_Type is new Integer; end Gen.Tests;
reznikmm/matreshka
Ada
3,984
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_00A1 is pragma Preelaborate; Group_00A1 : aliased constant Core_Second_Stage := (others => (Other_Letter, Wide, Other, A_Letter, O_Letter, Ideographic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_00A1;
reznikmm/gela
Ada
941
ads
with Gela.Lexical_Types; with Gela.Types; package Gela.Int.Attr_Functions is pragma Preelaborate; type Attr_Function is new Interpretation with private; function Create (Down : Gela.Interpretations.Interpretation_Index_Array; Tipe : Gela.Types.Type_View_Access; Kind : Gela.Lexical_Types.Predefined_Symbols.Attribute) return Attr_Function; not overriding function Kind (Self : Attr_Function) return Gela.Lexical_Types.Predefined_Symbols.Attribute; not overriding function Tipe (Self : Attr_Function) return Gela.Types.Type_View_Access; private type Attr_Function is new Interpretation with record Tipe : Gela.Types.Type_View_Access; Kind : Gela.Lexical_Types.Predefined_Symbols.Attribute; end record; overriding procedure Visit (Self : Attr_Function; Visiter : access Gela.Int.Visiters.Visiter'Class); end Gela.Int.Attr_Functions;
zhmu/ananas
Ada
201
ads
with Generic_Inst6_G1; generic with package G2 is new Generic_Inst6_G1 (<>); with package G3 is new Generic_Inst6_G1 (<>); package Generic_Inst6_X is Result : Integer := G2.Val * G3.Val; end;
reznikmm/matreshka
Ada
4,686
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Visitors; with ODF.DOM.Chart_Footer_Elements; package Matreshka.ODF_Chart.Footer_Elements is type Chart_Footer_Element_Node is new Matreshka.ODF_Chart.Abstract_Chart_Element_Node and ODF.DOM.Chart_Footer_Elements.ODF_Chart_Footer with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Chart_Footer_Element_Node; overriding function Get_Local_Name (Self : not null access constant Chart_Footer_Element_Node) return League.Strings.Universal_String; overriding procedure Enter_Node (Self : not null access Chart_Footer_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Leave_Node (Self : not null access Chart_Footer_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Visit_Node (Self : not null access Chart_Footer_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); end Matreshka.ODF_Chart.Footer_Elements;
Spohn/LegendOfZelba
Ada
303
ads
with ada.text_io; use ada.text_io; package intro is ------------------------------- -- Name: Jon Spohn -- David Rogina -- Game Intro Package Specification ------------------------------- --read in and display title page procedure title_page(file:in file_type); end intro;
Sandbergo/distributed-elevator-controller
Ada
3,907
adb
with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Numerics.Float_Random; use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Numerics.Float_Random; procedure exercise7 is Count_Failed : exception; -- Exception to be raised when counting fails Gen : Generator; -- Random number generator protected type Transaction_Manager (N : Positive) is entry Finished; function Commit return Boolean; procedure Signal_Abort; private Finished_Gate_Open : Boolean := False; Aborted : Boolean := False; Should_Commit : Boolean := True; end Transaction_Manager; protected body Transaction_Manager is entry Finished when Finished_Gate_Open or Finished'Count = N is begin ------------------------------------------ -- PART 3: Complete the exit protocol here if Aborted then Should_Commit := False; else Should_Commit := True; end if; if Finished'Count = N-1 then Finished_Gate_Open := True; elsif Finished'Count = 0 then Aborted := False; Finished_Gate_Open := False; end if; ------------------------------------------ end Finished; procedure Signal_Abort is begin Aborted := True; end Signal_Abort; function Commit return Boolean is begin return Should_Commit; end Commit; end Transaction_Manager; function Unreliable_Slow_Add (x : Integer) return Integer is Error_Rate : Constant := 0.15; -- (between 0 and 1) begin ------------------------------------------- -- PART 1: Create the transaction work here if (Random(Gen)) > Error_Rate then delay Duration(3.5 + Random(Gen)); return x + 10; else delay Duration(0.5 * Random(Gen)); raise Count_Failed; end if; ------------------------------------------- end Unreliable_Slow_Add; task type Transaction_Worker (Initial : Integer; Manager : access Transaction_Manager); task body Transaction_Worker is Num : Integer := Initial; Prev : Integer := Num; Round_Num : Integer := 0; begin Put_Line ("Worker" & Integer'Image(Initial) & " started"); loop Put_Line ("Worker" & Integer'Image(Initial) & " started round" & Integer'Image(Round_Num)); Round_Num := Round_Num + 1; --------------------------------------- -- PART 2: Do the transaction work here begin Num := Unreliable_Slow_Add(Num); exception when Count_Failed => Put_Line ("Oh no! Worker" & Integer'Image(Initial) & " failed! Oh no! "); Manager.Signal_Abort; end; Manager.Finished; --------------------------------------- if Manager.Commit = True then Put_Line (" Worker" & Integer'Image(Initial) & " comitting" & Integer'Image(Num)); else Put_Line (" Worker" & Integer'Image(Initial) & " reverting from" & Integer'Image(Num) & " to" & Integer'Image(Prev)); ------------------------------------------- -- PART 2: Roll back to previous value here Num := Prev; ------------------------------------------- end if; Prev := Num; delay 0.5; end loop; end Transaction_Worker; Manager : aliased Transaction_Manager (3); Worker_1 : Transaction_Worker (0, Manager'Access); Worker_2 : Transaction_Worker (1, Manager'Access); Worker_3 : Transaction_Worker (2, Manager'Access); begin Reset(Gen); -- Seed the random number generator end exercise7;
stcarrez/ada-servlet
Ada
3,731
adb
----------------------------------------------------------------------- -- servlet-security-tests - Unit tests for Servlet.Security -- Copyright (C) 2013, 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Test_Caller; with Security.Policies; use Security; with Security.Policies.URLs; with Servlet.Core; with Servlet.Core.Tests; with Servlet.Security.Filters; with Servlet.Requests.Mockup; with Servlet.Responses.Mockup; package body Servlet.Security.Tests is use Util.Tests; -- ------------------------------ -- Check that the given URI reports the HTTP status. -- ------------------------------ procedure Check_Security (T : in out Test; URI : in String; Result : in Natural) is Ctx : Servlet.Core.Servlet_Registry; S1 : aliased Servlet.Core.Tests.Test_Servlet1; F1 : aliased Servlet.Security.Filters.Auth_Filter; Sec : aliased Policies.Policy_Manager (Max_Policies => 10); begin F1.Set_Permission_Manager (Sec'Unchecked_Access); Ctx.Add_Servlet ("Faces", S1'Unchecked_Access); Ctx.Add_Filter ("Security", F1'Unchecked_Access); Sec.Add_Policy (new Policies.URLs.URL_Policy); Sec.Read_Policy (Util.Tests.Get_Path ("regtests/files/permissions/simple-policy.xml")); Ctx.Add_Mapping (Pattern => "*.jsf", Name => "Faces"); Ctx.Add_Filter_Mapping (Pattern => "*.jsf", Name => "Security"); Ctx.Start; declare Dispatcher : constant Servlet.Core.Request_Dispatcher := Ctx.Get_Request_Dispatcher (Path => URI & ".jsf"); Req : Servlet.Requests.Mockup.Request; Resp : Servlet.Responses.Mockup.Response; begin Req.Set_Request_URI ("/admin/test"); Req.Set_Method ("GET"); Servlet.Core.Forward (Dispatcher, Req, Resp); Assert_Equals (T, Result, Resp.Get_Status, "Invalid status"); end; end Check_Security; -- ------------------------------ -- Test the security filter granting permission for a given URI. -- ------------------------------ procedure Test_Security_Filter (T : in out Test) is begin T.Check_Security ("/admin/test", Servlet.Responses.SC_UNAUTHORIZED); end Test_Security_Filter; -- ------------------------------ -- Test the security filter grants access to anonymous allowed pages. -- ------------------------------ procedure Test_Anonymous_Access (T : in out Test) is begin T.Check_Security ("/view", Servlet.Responses.SC_OK); end Test_Anonymous_Access; package Caller is new Util.Test_Caller (Test, "Security"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Servlet.Security.Filters.Auth_Filter (deny)", Test_Security_Filter'Access); Caller.Add_Test (Suite, "Test Servlet.Security.Filters.Auth_Filter (grant)", Test_Anonymous_Access'Access); end Add_Tests; end Servlet.Security.Tests;
persan/protobuf-ada
Ada
9,238
ads
pragma Ada_2012; with Google.Protobuf.Wire_Format; with Ada.Streams; with System; limited with Google.Protobuf.Message; -- limited with Google.Protobuf.Message; is a trick to avoid a circular unit -- dependency caused by with-ing Google.Protobuf.IO.Coded_Output_Stream from -- Google.Protobuf.Message. with Google.Protobuf.Message is used in body -- since the incomplete view provided by limited with is not sufficient. package Google.Protobuf.IO.Coded_Output_Stream is type Root_Stream_Access is access all Ada.Streams.Root_Stream_Type'Class; type Instance (Output_Stream : Root_Stream_Access) is tagged private; TMP_LITTLE_ENDIAN_32_SIZE : constant := 4; TMP_LITTLE_ENDIAN_64_SIZE : constant := 8; Big_Endian : constant Boolean := System. "=" (System.Default_Bit_Order, System.High_Order_First); --Big_Endian_Not_Implemented : exception; -- Consider replacing this use clause??? use Google.Protobuf.Wire_Format; function Encode_Zig_Zag_32 (Value : in PB_Int32) return PB_UInt32; function Encode_Zig_Zag_64 (Value : in PB_Int64) return PB_UInt64; function Compute_Raw_Varint_32_Size (Value : in PB_UInt32) return PB_Object_Size; function Compute_Raw_Varint_64_Size (Value : in PB_UInt64) return PB_Object_Size; function Compute_Boolean_Size (Field_Number : in PB_Field_Type; Value : in PB_Bool) return PB_Object_Size; function Compute_Double_Size (Field_Number : in PB_Field_Type; Value : in PB_Double) return PB_Object_Size; function Compute_Enumeration_Size (Field_Number : in PB_Field_Type; Value : in PB_Int32) return PB_Object_Size; function Compute_Fixed_32_Size (Field_Number : in PB_Field_Type; Value : in PB_UInt32) return PB_Object_Size; function Compute_Fixed_64_Size (Field_Number : in PB_Field_Type; Value : in PB_UInt64) return PB_Object_Size; function Compute_Float_Size (Field_Number : in PB_Field_Type; Value : in PB_Float) return PB_Object_Size; function Compute_Integer_32_Size (Field_Number : in PB_Field_Type; Value : in PB_Int32) return PB_Object_Size; function Compute_Integer_64_Size (Field_Number : in PB_Field_Type; Value : in PB_Int64) return PB_Object_Size; function Compute_Signed_Fixed_32_Size (Field_Number : in PB_Field_Type; Value : in PB_Int32) return PB_Object_Size; function Compute_Signed_Fixed_64_Size (Field_Number : in PB_Field_Type; Value : in PB_Int64) return PB_Object_Size; function Compute_Signed_Integer_32_Size (Field_Number : in PB_Field_Type; Value : in PB_Int32) return PB_Object_Size; function Compute_Signed_Integer_64_Size (Field_Number : in PB_Field_Type; Value : in PB_Int64) return PB_Object_Size; function Compute_String_Size (Field_Number : in PB_Field_Type; Value : in PB_String) return PB_Object_Size; function Compute_Tag_Size (Field_Number : PB_Field_Type) return PB_Object_Size; function Compute_Unsigned_Integer_32_Size (Field_Number : in PB_Field_Type; Value : in PB_UInt32) return PB_Object_Size; function Compute_Unsigned_Integer_64_Size (Field_Number : in PB_Field_Type; Value : in PB_UInt64) return PB_Object_Size; function Compute_Boolean_Size_No_Tag (Value : in PB_Bool) return PB_Object_Size; function Compute_Double_Size_No_Tag (Value : in PB_Double) return PB_Object_Size; function Compute_Enumeration_Size_No_Tag (Value : in PB_Int32) return PB_Object_Size; function Compute_Fixed_32_Size_No_Tag (Value : in PB_UInt32) return PB_Object_Size; function Compute_Fixed_64_Size_No_Tag (Value : in PB_UInt64) return PB_Object_Size; function Compute_Float_Size_No_Tag (Value : in PB_Float) return PB_Object_Size; function Compute_Integer_32_Size_No_Tag (Value : in PB_Int32) return PB_Object_Size; function Compute_Integer_64_Size_No_Tag (Value : in PB_Int64) return PB_Object_Size; function Compute_Signed_Fixed_32_Size_No_Tag (Value : in PB_Int32) return PB_Object_Size; function Compute_Signed_Fixed_64_Size_No_Tag (Value : in PB_Int64) return PB_Object_Size; function Compute_Signed_Integer_32_Size_No_Tag (Value : in PB_Int32) return PB_Object_Size; function Compute_Signed_Integer_64_Size_No_Tag (Value : in PB_Int64) return PB_Object_Size; function Compute_String_Size_No_Tag (Value : in PB_String) return PB_Object_Size; function Compute_Unsigned_Integer_32_Size_No_Tag (Value : in PB_UInt32) return PB_Object_Size; function Compute_Unsigned_Integer_64_Size_No_Tag (Value : in PB_UInt64) return PB_Object_Size; function Compute_Message_Size (Field_Number : in PB_Field_Type; Value : in out Google.Protobuf.Message.Instance'Class) return PB_Object_Size; function Compute_Message_Size_No_Tag (Value : in out Google.Protobuf.Message.Instance'Class) return PB_Object_Size; procedure Write_Boolean (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Bool); procedure Write_Double (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Double); procedure Write_Enumeration (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Int32); procedure Write_Fixed_32 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_UInt32); procedure Write_Fixed_64 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_UInt64); procedure Write_Float (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Float); procedure Write_Integer_32 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Int32); procedure Write_Integer_64 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Int64); procedure Write_Signed_Fixed_32 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Int32); procedure Write_Signed_Fixed_64 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Int64); procedure Write_Signed_Integer_32 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Int32); procedure Write_Signed_Integer_64 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_Int64); procedure Write_String (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_String); procedure Write_Unsigned_Integer_32 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_UInt32); procedure Write_Unsigned_Integer_64 (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in PB_UInt64); procedure Write_Boolean_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Bool); procedure Write_Double_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Double); procedure Write_Enumeration_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Int32); procedure Write_Fixed_32_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_UInt32); procedure Write_Fixed_64_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_UInt64); procedure Write_Float_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Float); procedure Write_Integer_32_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Int32); procedure Write_Integer_64_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Int64); procedure Write_Signed_Fixed_32_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Int32); procedure Write_Signed_Fixed_64_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Int64); procedure Write_Signed_Integer_32_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Int32); procedure Write_Signed_Integer_64_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_Int64); procedure Write_String_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_String); procedure Write_Unsigned_Integer_32_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_UInt32); procedure Write_Unsigned_Integer_64_No_Tag (This : in Coded_Output_Stream.Instance; Value : in PB_UInt64); procedure Write_Tag (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Wire_Type : in PB_Wire_Type); procedure Write_Raw_Little_Endian_32 (This : in Coded_Output_Stream.Instance; Value : in PB_UInt32); procedure Write_Raw_Little_Endian_64 (This : in Coded_Output_Stream.Instance; Value : in PB_UInt64); procedure Write_Raw_Varint_32 (This : in Coded_Output_Stream.Instance; Value : in PB_UInt32); procedure Write_Raw_Varint_64 (This : in Coded_Output_Stream.Instance; Value : in PB_UInt64); procedure Write_Raw_Byte (This : in Coded_Output_Stream.Instance; Value : in PB_Byte); procedure Write_Message (This : in Coded_Output_Stream.Instance; Field_Number : in PB_Field_Type; Value : in Google.Protobuf.Message.Instance'Class); procedure Write_Message_No_Tag (This : in Coded_Output_Stream.Instance; Value : in Google.Protobuf.Message.Instance'Class); private type Instance (Output_Stream : Root_Stream_Access) is tagged null record; end Google.Protobuf.IO.Coded_Output_Stream;
persan/a-cups
Ada
7,530
ads
pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; private package CUPS.stdint_h is INT8_MIN : constant := (-128); -- stdint.h:155 INT16_MIN : constant := (-32767-1); -- stdint.h:156 INT32_MIN : constant := (-2147483647-1); -- stdint.h:157 -- unsupported macro: INT64_MIN (-__INT64_C(9223372036854775807)-1) INT8_MAX : constant := (127); -- stdint.h:160 INT16_MAX : constant := (32767); -- stdint.h:161 INT32_MAX : constant := (2147483647); -- stdint.h:162 -- unsupported macro: INT64_MAX (__INT64_C(9223372036854775807)) UINT8_MAX : constant := (255); -- stdint.h:166 UINT16_MAX : constant := (65535); -- stdint.h:167 UINT32_MAX : constant := (4294967295); -- stdint.h:168 -- unsupported macro: UINT64_MAX (__UINT64_C(18446744073709551615)) INT_LEAST8_MIN : constant := (-128); -- stdint.h:173 INT_LEAST16_MIN : constant := (-32767-1); -- stdint.h:174 INT_LEAST32_MIN : constant := (-2147483647-1); -- stdint.h:175 -- unsupported macro: INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) INT_LEAST8_MAX : constant := (127); -- stdint.h:178 INT_LEAST16_MAX : constant := (32767); -- stdint.h:179 INT_LEAST32_MAX : constant := (2147483647); -- stdint.h:180 -- unsupported macro: INT_LEAST64_MAX (__INT64_C(9223372036854775807)) UINT_LEAST8_MAX : constant := (255); -- stdint.h:184 UINT_LEAST16_MAX : constant := (65535); -- stdint.h:185 UINT_LEAST32_MAX : constant := (4294967295); -- stdint.h:186 -- unsupported macro: UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) INT_FAST8_MIN : constant := (-128); -- stdint.h:191 INT_FAST16_MIN : constant := (-9223372036854775807-1); -- stdint.h:193 INT_FAST32_MIN : constant := (-9223372036854775807-1); -- stdint.h:194 -- unsupported macro: INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) INT_FAST8_MAX : constant := (127); -- stdint.h:201 INT_FAST16_MAX : constant := (9223372036854775807); -- stdint.h:203 INT_FAST32_MAX : constant := (9223372036854775807); -- stdint.h:204 -- unsupported macro: INT_FAST64_MAX (__INT64_C(9223372036854775807)) UINT_FAST8_MAX : constant := (255); -- stdint.h:212 UINT_FAST16_MAX : constant := (18446744073709551615); -- stdint.h:214 UINT_FAST32_MAX : constant := (18446744073709551615); -- stdint.h:215 -- unsupported macro: UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) INTPTR_MIN : constant := (-9223372036854775807-1); -- stdint.h:225 INTPTR_MAX : constant := (9223372036854775807); -- stdint.h:226 UINTPTR_MAX : constant := (18446744073709551615); -- stdint.h:227 -- unsupported macro: INTMAX_MIN (-__INT64_C(9223372036854775807)-1) -- unsupported macro: INTMAX_MAX (__INT64_C(9223372036854775807)) -- unsupported macro: UINTMAX_MAX (__UINT64_C(18446744073709551615)) PTRDIFF_MIN : constant := (-9223372036854775807-1); -- stdint.h:248 PTRDIFF_MAX : constant := (9223372036854775807); -- stdint.h:249 SIG_ATOMIC_MIN : constant := (-2147483647-1); -- stdint.h:256 SIG_ATOMIC_MAX : constant := (2147483647); -- stdint.h:257 SIZE_MAX : constant := (18446744073709551615); -- stdint.h:261 -- unsupported macro: WCHAR_MIN __WCHAR_MIN -- unsupported macro: WCHAR_MAX __WCHAR_MAX WINT_MIN : constant := (0); -- stdint.h:278 WINT_MAX : constant := (4294967295); -- stdint.h:279 -- arg-macro: procedure INT8_C c -- c -- arg-macro: procedure INT16_C c -- c -- arg-macro: procedure INT32_C c -- c -- unsupported macro: INT64_C(c) c ## L -- arg-macro: procedure UINT8_C c -- c -- arg-macro: procedure UINT16_C c -- c -- unsupported macro: UINT32_C(c) c ## U -- unsupported macro: UINT64_C(c) c ## UL -- unsupported macro: INTMAX_C(c) c ## L -- unsupported macro: UINTMAX_C(c) c ## UL -- Copyright (C) 1997-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/>. -- * ISO C99: 7.18 Integer types <stdint.h> -- -- Exact integral types. -- Signed. -- There is some amount of overlap with <sys/types.h> as known by inet code -- Unsigned. subtype uint8_t is unsigned_char; -- stdint.h:48 subtype uint16_t is unsigned_short; -- stdint.h:49 subtype uint32_t is unsigned; -- stdint.h:51 subtype uint64_t is unsigned_long; -- stdint.h:55 -- Small types. -- Signed. subtype int_least8_t is signed_char; -- stdint.h:65 subtype int_least16_t is short; -- stdint.h:66 subtype int_least32_t is int; -- stdint.h:67 subtype int_least64_t is long; -- stdint.h:69 -- Unsigned. subtype uint_least8_t is unsigned_char; -- stdint.h:76 subtype uint_least16_t is unsigned_short; -- stdint.h:77 subtype uint_least32_t is unsigned; -- stdint.h:78 subtype uint_least64_t is unsigned_long; -- stdint.h:80 -- Fast types. -- Signed. subtype int_fast8_t is signed_char; -- stdint.h:90 subtype int_fast16_t is long; -- stdint.h:92 subtype int_fast32_t is long; -- stdint.h:93 subtype int_fast64_t is long; -- stdint.h:94 -- Unsigned. subtype uint_fast8_t is unsigned_char; -- stdint.h:103 subtype uint_fast16_t is unsigned_long; -- stdint.h:105 subtype uint_fast32_t is unsigned_long; -- stdint.h:106 subtype uint_fast64_t is unsigned_long; -- stdint.h:107 -- Types for `void *' pointers. subtype uintptr_t is unsigned_long; -- stdint.h:122 -- Largest integral types. subtype intmax_t is long; -- stdint.h:134 subtype uintmax_t is unsigned_long; -- stdint.h:135 -- Limits of integral types. -- Minimum of signed integral types. -- Maximum of signed integral types. -- Maximum of unsigned integral types. -- Minimum of signed integral types having a minimum size. -- Maximum of signed integral types having a minimum size. -- Maximum of unsigned integral types having a minimum size. -- Minimum of fast signed integral types having a minimum size. -- Maximum of fast signed integral types having a minimum size. -- Maximum of fast unsigned integral types having a minimum size. -- Values to test for integral types holding `void *' pointer. -- Minimum for largest signed integral type. -- Maximum for largest signed integral type. -- Maximum for largest unsigned integral type. -- Limits of other integer types. -- Limits of `ptrdiff_t' type. -- Limits of `sig_atomic_t'. -- Limit of `size_t' type. -- Limits of `wchar_t'. -- These constants might also be defined in <wchar.h>. -- Limits of `wint_t'. -- Signed. -- Unsigned. -- Maximal type. end CUPS.stdint_h;
reznikmm/matreshka
Ada
4,105
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Draw_Frame_Margin_Horizontal_Attributes; package Matreshka.ODF_Draw.Frame_Margin_Horizontal_Attributes is type Draw_Frame_Margin_Horizontal_Attribute_Node is new Matreshka.ODF_Draw.Abstract_Draw_Attribute_Node and ODF.DOM.Draw_Frame_Margin_Horizontal_Attributes.ODF_Draw_Frame_Margin_Horizontal_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Draw_Frame_Margin_Horizontal_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Draw_Frame_Margin_Horizontal_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Draw.Frame_Margin_Horizontal_Attributes;
google-code/ada-util
Ada
1,761
ads
----------------------------------------------------------------------- -- util-dates-formats-tests - Test for date formats -- Copyright (C) 2011, 2013, 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package Util.Dates.Formats.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; procedure Test_Format (T : in out Test); -- Test the Get_Day_Start operation. procedure Test_Get_Day_Start (T : in out Test); -- Test the Get_Week_Start operation. procedure Test_Get_Week_Start (T : in out Test); -- Test the Get_Month_Start operation. procedure Test_Get_Month_Start (T : in out Test); -- Test the Get_Day_End operation. procedure Test_Get_Day_End (T : in out Test); -- Test the Get_Week_End operation. procedure Test_Get_Week_End (T : in out Test); -- Test the Get_Month_End operation. procedure Test_Get_Month_End (T : in out Test); -- Test the Split operation. procedure Test_Split (T : in out Test); end Util.Dates.Formats.Tests;
reznikmm/matreshka
Ada
4,733
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with League.Strings; with Matreshka.DOM_Attributes; with Matreshka.DOM_Elements; with Matreshka.DOM_Nodes; package Matreshka.ODF_Style is type Abstract_Style_Attribute_Node is abstract new Matreshka.DOM_Attributes.Abstract_Attribute_L2_Node with record Prefix : League.Strings.Universal_String; end record; overriding function Get_Namespace_URI (Self : not null access constant Abstract_Style_Attribute_Node) return League.Strings.Universal_String; type Abstract_Style_Element_Node is abstract new Matreshka.DOM_Elements.Abstract_Element_Node with record Prefix : League.Strings.Universal_String; end record; overriding function Get_Namespace_URI (Self : not null access constant Abstract_Style_Element_Node) return League.Strings.Universal_String; package Constructors is procedure Initialize (Self : not null access Abstract_Style_Attribute_Node'Class; Document : not null Matreshka.DOM_Nodes.Document_Access; Prefix : League.Strings.Universal_String) with Inline => True; procedure Initialize (Self : not null access Abstract_Style_Element_Node'Class; Document : not null Matreshka.DOM_Nodes.Document_Access; Prefix : League.Strings.Universal_String) with Inline => True; end Constructors; end Matreshka.ODF_Style;
charlie5/lace
Ada
1,833
ads
with openGL.Texture, openGL.GlyphImpl.texture; package openGL.Font.texture -- -- A texture font is a specialisation of the font class for handling texture mapped fonts. -- is type Item is new Font.item with private; type View is access all Item'Class; --------- -- Forge -- function to_Font_texture (fontFilePath : in String) return Font.texture.item; -- -- -- Open and read a font file. Sets Error flag. function new_Font_texture (fontFilePath : in String) return Font.texture.view; function to_Font_texture (pBufferBytes : in FontImpl.unsigned_char_Pointer; bufferSizeInBytes : in Natural) return Font.texture.item; -- -- Open and read a font from a buffer in memory. Sets Error flag. -- -- The buffer is owned by the client and is NOT copied by FTGL. The -- pointer must be valid while using FTGL. -- -- pBufferBytes: The in-memory buffer. -- bufferSizeInBytes: The length of the buffer in bytes. overriding procedure destruct (Self : in out Item); procedure free (Self : in out View); -------------- -- Attributes -- function gl_Texture (Self : in Item) return openGL.Texture.texture_Name; function Quad (Self : in Item; for_Character : in Character) return GlyphImpl.Texture.Quad_t; private type Item is new Font.item with null record; overriding function MakeGlyph (Self : access Item; Slot : in freetype_c.FT_GlyphSlot.item) return glyph.Container.Glyph_view; -- -- Construct a glyph of the correct type. -- -- Clients must override the function and return their specialised FTGlyph. -- Returns an FTGlyph or null on failure. -- -- Slot: A FreeType glyph slot. end openGL.Font.texture;
reznikmm/gela
Ada
14,606
adb
with System.Storage_Elements; package body Gela.Nodes is --------------------------- -- Enclosing_Compilation -- --------------------------- overriding function Enclosing_Compilation (Self : Node) return Gela.Compilations.Compilation_Access is begin return Self.Enclosing_Compilation; end Enclosing_Compilation; -------------------------------- -- Enclosing_Compilation_Unit -- -------------------------------- overriding function Enclosing_Compilation_Unit (Self : Node) return Gela.Compilation_Units.Compilation_Unit_Access is pragma Unreferenced (Self); begin return null; end Enclosing_Compilation_Unit; ----------------------- -- Enclosing_Element -- ----------------------- overriding function Enclosing_Element (Self : Node) return Gela.Elements.Element_Access is begin return Self.Enclosing_Element; end Enclosing_Element; ----------------- -- First_Token -- ----------------- overriding function First_Token (Self : Node) return Gela.Lexical_Types.Token_Count is use Gela.LARL_Parsers_Nodes; use type Gela.Lexical_Types.Token_Count; use type Gela.Elements.Element_Access; Nested : constant Nested_Kind_Array := Node'Class (Self).Nested; Result : Gela.Lexical_Types.Token_Count; Element : Gela.Elements.Element_Access; Sequence : Gela.Elements.Element_Sequence_Access; begin for J in Nested'Range loop case Nested (J) is when Gela.Elements.Nested_Token => Result := -Self.Children (J); if Result /= 0 then return Result; end if; when Gela.Elements.Nested_Element => Element := -Self.Children (J); if Element /= null then Result := Element.First_Token; if Result /= 0 then return Result; end if; end if; when Gela.Elements.Nested_Sequence => Sequence := -Self.Children (J); declare Cursor : Gela.Elements.Element_Sequence_Cursor := Sequence.First; begin while Cursor.Has_Element loop Element := Cursor.Element; if Element /= null then Result := Element.First_Token; if Result /= 0 then return Result; end if; end if; Cursor.Next; end loop; end; end case; end loop; return 0; end First_Token; ---------- -- Hash -- ---------- overriding function Hash (Self : Node) return Ada.Containers.Hash_Type is subtype Integer_Address is System.Storage_Elements.Integer_Address; use type Integer_Address; X : Integer_Address; begin X := System.Storage_Elements.To_Integer (Self'Address); return Ada.Containers.Hash_Type (X mod Ada.Containers.Hash_Type'Modulus); end Hash; ------------------------- -- Is_Part_Of_Implicit -- ------------------------- overriding function Is_Part_Of_Implicit (Self : Node) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; -------------------------- -- Is_Part_Of_Inherited -- -------------------------- overriding function Is_Part_Of_Inherited (Self : Node) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; ------------------------- -- Is_Part_Of_Instance -- ------------------------- overriding function Is_Part_Of_Instance (Self : Node) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; ---------------- -- Last_Token -- ---------------- overriding function Last_Token (Self : Node) return Gela.Lexical_Types.Token_Count is use Gela.LARL_Parsers_Nodes; use type Gela.Lexical_Types.Token_Count; use type Gela.Elements.Element_Access; Nested : constant Nested_Kind_Array := Node'Class (Self).Nested; Result : Gela.Lexical_Types.Token_Count; Element : Gela.Elements.Element_Access; Sequence : Gela.Elements.Element_Sequence_Access; begin for J in reverse Nested'Range loop case Nested (J) is when Gela.Elements.Nested_Token => Result := -Self.Children (J); if Result /= 0 then return Result; end if; when Gela.Elements.Nested_Element => Element := -Self.Children (J); if Element /= null then Result := Element.Last_Token; if Result /= 0 then return Result; end if; end if; when Gela.Elements.Nested_Sequence => Sequence := -Self.Children (J); declare Cursor : Gela.Elements.Element_Sequence_Cursor := Sequence.First; List : array (1 .. Sequence.Length) of Gela.Elements.Element_Access; Index : Positive := 1; begin while Cursor.Has_Element loop List (Index) := Cursor.Element; Index := Index + 1; Cursor.Next; end loop; for J in reverse List'Range loop Element := List (J); if Element /= null then Result := Element.Last_Token; if Result /= 0 then return Result; end if; end if; end loop; end; end case; end loop; return 0; end Last_Token; ------------------ -- Nested_Items -- ------------------ overriding function Nested_Items (Self : Node) return Gela.Elements.Nested_Array is use Gela.LARL_Parsers_Nodes; Kinds : constant Nested_Kind_Array := Node'Class (Self).Nested; Result : Gela.Elements.Nested_Array (Kinds'Range); begin for J in Result'Range loop case Kinds (J) is when Gela.Elements.Nested_Token => Result (J) := (Gela.Elements.Nested_Token, -Self.Children (J)); when Gela.Elements.Nested_Element => Result (J) := (Gela.Elements.Nested_Element, -Self.Children (J)); when Gela.Elements.Nested_Sequence => Result (J) := (Gela.Elements.Nested_Sequence, -Self.Children (J)); end case; end loop; return Result; end Nested_Items; -------------------- -- Node_Sequences -- -------------------- package body Node_Sequences is type Forward_Iterator is new Gela.Elements.Element_Sequences.Iterators.Forward_Iterator and Generic_Element_Sequences.Iterators.Forward_Iterator with record First : Sequence_Cursor; end record; overriding function First (Object : Forward_Iterator) return Gela.Elements.Element_Sequences.Sequence_Cursor'Class; overriding function Next (Object : Forward_Iterator; Position : Gela.Elements.Element_Sequences.Sequence_Cursor'Class) return Gela.Elements.Element_Sequences.Sequence_Cursor'Class; overriding function First (Object : Forward_Iterator) return Generic_Element_Sequences.Sequence_Cursor'Class; overriding function Next (Object : Forward_Iterator; Position : Generic_Element_Sequences.Sequence_Cursor'Class) return Generic_Element_Sequences.Sequence_Cursor'Class; ------------ -- Append -- ------------ overriding procedure Append (Self : in out Sequence; Item : Generic_Element_Sequences.Item_Access) is X : constant Node_Access := Node_Access (Item); Y : constant Generic_Element_Sequences.Item_Access := Generic_Element_Sequences.Item_Access (X); begin Self.List.Append (Y); end Append; ------------------ -- Each_Element -- ------------------ overriding function Each_Element (Self : Sequence) return Gela.Elements.Element_Sequences.Iterators.Forward_Iterator'Class is begin return Forward_Iterator'(First => (Data => Self.List.First)); end Each_Element; ------------- -- Element -- ------------- overriding function Element (Self : Sequence_Cursor) return Generic_Element_Sequences.Item_Access is begin return Lists.Element (Self.Data); end Element; ------------- -- Element -- ------------- overriding function Element (Self : Sequence_Cursor) return Gela.Elements.Element_Access is Result : constant Generic_Element_Sequences.Item_Access := Self.Element; begin return Gela.Elements.Element_Access (Result); end Element; ----------- -- First -- ----------- overriding function First (Object : Forward_Iterator) return Gela.Elements.Element_Sequences.Sequence_Cursor'Class is begin return Object.First; end First; ----------- -- First -- ----------- overriding function First (Object : Forward_Iterator) return Generic_Element_Sequences.Sequence_Cursor'Class is begin return Object.First; end First; ----------- -- First -- ----------- overriding function First (Self : Sequence) return Generic_Element_Sequences.Sequence_Cursor'Class is begin return Sequence_Cursor'(Data => Self.List.First); end First; ----------- -- First -- ----------- overriding function First (Self : Sequence) return Gela.Elements.Element_Sequences.Sequence_Cursor'Class is begin return Sequence_Cursor'(Data => Self.List.First); end First; ----------------- -- Has_Element -- ----------------- overriding function Has_Element (Self : Sequence_Cursor) return Boolean is begin return Lists.Has_Element (Self.Data); end Has_Element; -------------- -- Is_Empty -- -------------- overriding function Is_Empty (Self : Sequence) return Boolean is begin return Self.List.Is_Empty; end Is_Empty; ------------- -- Iterate -- ------------- overriding function Iterate (Self : Sequence) return Generic_Element_Sequences.Iterators.Forward_Iterator'Class is begin return Forward_Iterator'(First => (Data => Self.List.First)); end Iterate; ------------ -- Length -- ------------ overriding function Length (Self : Sequence) return Natural is begin return Natural (Self.List.Length); end Length; ---------- -- Next -- ---------- overriding function Next (Object : Forward_Iterator; Position : Gela.Elements.Element_Sequences.Sequence_Cursor'Class) return Gela.Elements.Element_Sequences.Sequence_Cursor'Class is pragma Unreferenced (Object); begin return Result : Sequence_Cursor := Sequence_Cursor (Position) do Result.Next; end return; end Next; ---------- -- Next -- ---------- overriding function Next (Object : Forward_Iterator; Position : Generic_Element_Sequences.Sequence_Cursor'Class) return Generic_Element_Sequences.Sequence_Cursor'Class is pragma Unreferenced (Object); begin return Result : Sequence_Cursor := Sequence_Cursor (Position) do Result.Next; end return; end Next; ---------- -- Next -- ---------- overriding procedure Next (Self : in out Sequence_Cursor) is begin Lists.Next (Self.Data); end Next; ------------- -- Prepend -- ------------- overriding procedure Prepend (Self : in out Sequence; Item : Generic_Element_Sequences.Item_Access) is X : constant Node_Access := Node_Access (Item); Y : constant Generic_Element_Sequences.Item_Access := Generic_Element_Sequences.Item_Access (X); begin Self.List.Prepend (Y); end Prepend; --------------------------- -- Set_Enclosing_Element -- --------------------------- overriding procedure Set_Enclosing_Element (Self : in out Sequence; Value : Gela.Elements.Element_Access) is Pos : Gela.Elements.Element_Sequences.Sequence_Cursor'Class := Self.First; Item : Gela.Elements.Set_Enclosing.Element_Access; begin while Pos.Has_Element loop Item := Gela.Elements.Set_Enclosing.Element_Access (Pos.Element); Item.Set_Enclosing_Element (Value); Pos.Next; end loop; end Set_Enclosing_Element; end Node_Sequences; --------------------------- -- Set_Enclosing_Element -- --------------------------- overriding procedure Set_Enclosing_Element (Self : in out Node; Value : Gela.Elements.Element_Access) is begin Self.Enclosing_Element := Value; end Set_Enclosing_Element; -------------------------- -- Set_Part_Of_Implicit -- -------------------------- overriding procedure Set_Part_Of_Implicit (Self : in out Node) is begin Self.Is_Part_Of_Implicit := True; end Set_Part_Of_Implicit; --------------------------- -- Set_Part_Of_Inherited -- --------------------------- overriding procedure Set_Part_Of_Inherited (Self : in out Node) is begin Self.Is_Part_Of_Inherited := True; end Set_Part_Of_Inherited; -------------------------- -- Set_Part_Of_Instance -- -------------------------- overriding procedure Set_Part_Of_Instance (Self : in out Node) is begin Self.Is_Part_Of_Instance := True; end Set_Part_Of_Instance; end Gela.Nodes;