Commit a2cb348e by Robert Dewar Committed by Arnaud Charlet

a-dirval-mingw.adb, [...]: Minor reformatting

2005-09-01  Robert Dewar  <dewar@adacore.com>

	* a-dirval-mingw.adb, a-direct.adb, a-coinve.adb,
	g-dynhta.adb, g-dynhta.ads, cstand.adb, exp_smem.adb, g-debuti.ads,
	g-dirope.adb, g-table.adb, lib-sort.adb, sem_maps.adb,
	exp_fixd.adb, exp_aggr.adb, a-intnam-mingw.ads, a-intnam-vxworks.ads,
	g-arrspl.adb, g-arrspl.ads, g-awk.adb, g-awk.ads, g-boubuf.ads,
	g-boubuf.ads, g-boubuf.ads, g-bubsor.ads, g-bubsor.adb, g-busora.adb,
	g-busora.ads, g-busorg.adb, g-busorg.ads, g-calend.adb, g-calend.ads,
	g-casuti.adb, g-casuti.ads, g-catiio.adb, g-catiio.ads, g-cgi.adb,
	g-cgi.ads, g-cgicoo.adb, g-cgicoo.ads, g-cgideb.adb, g-cgideb.ads,
	g-comlin.adb, g-comver.ads, g-semaph.ads, g-socthi.ads,
	sem_ch7.adb, a-direio.adb, a-caldel.ads, i-cstrea-vms.adb,
	a-ztedit.adb, a-ztenau.adb, g-socthi-vms.adb, g-socthi-vms.ads,
	g-socthi-mingw.adb, g-socthi-mingw.ads, g-socthi-vxworks.ads,
	a-intnam-irix.ads, a-intnam-irix.ads, a-intnam-hpux.ads,
	a-intnam-os2.ads, a-intnam-os2.ads, a-caldel-vms.adb, a-calend-vms.adb,
	a-calend-vms.ads, g-heasor.adb, g-heasor.ads, g-hesora.adb,
	g-hesora.ads, g-hesorg.adb, g-hesorg.ads, g-htable.adb, g-htable.ads,
	g-io.adb, g-io.ads, g-io_aux.adb, g-io_aux.ads, g-locfil.ads,
	g-memdum.adb, g-memdum.ads, g-traceb.adb, g-traceb.ads, i-cobol.adb,
	i-cobol.ads, i-cstrea.ads, i-cstrin.adb, a-wtedit.adb, a-tifiio.adb,
	a-wtenau.adb, a-wtenau.adb, a-teioed.adb: Minor reformatting

From-SVN: r103894
parent f67b3771
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This is the Alpha/VMS version. -- This is the Alpha/VMS version
with System.OS_Primitives; with System.OS_Primitives;
-- Used for Max_Sensible_Delay -- Used for Max_Sensible_Delay
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This package implements Calendar.Time delays using protected objects. -- This package implements Calendar.Time delays using protected objects
-- Note: the compiler generates direct calls to this interface, in the -- Note: the compiler generates direct calls to this interface, in the
-- processing of time types. -- processing of time types.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This is the Alpha/VMS version. -- This is the Alpha/VMS version
with System.Aux_DEC; use System.Aux_DEC; with System.Aux_DEC; use System.Aux_DEC;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This is the Alpha/VMS version. -- This is the Alpha/VMS version
with System.OS_Primitives; with System.OS_Primitives;
package Ada.Calendar is package Ada.Calendar is
......
...@@ -592,7 +592,7 @@ package body Ada.Containers.Indefinite_Vectors is ...@@ -592,7 +592,7 @@ package body Ada.Containers.Indefinite_Vectors is
Index_As_Int : constant Int := Int (Index); Index_As_Int : constant Int := Int (Index);
Old_Last_As_Int : constant Int := Int (Container.Last); Old_Last_As_Int : constant Int := Int (Container.Last);
-- TODO: somewhat vestigial...fix. -- TODO: somewhat vestigial...fix ???
Count1 : constant Int'Base := Int (Count); Count1 : constant Int'Base := Int (Count);
Count2 : constant Int'Base := Old_Last_As_Int - Index_As_Int + 1; Count2 : constant Int'Base := Old_Last_As_Int - Index_As_Int + 1;
N : constant Int'Base := Int'Min (Count1, Count2); N : constant Int'Base := Int'Min (Count1, Count2);
......
...@@ -62,7 +62,7 @@ package body Ada.Directories is ...@@ -62,7 +62,7 @@ package body Ada.Directories is
procedure Free is new Ada.Unchecked_Deallocation (Search_Data, Search_Ptr); procedure Free is new Ada.Unchecked_Deallocation (Search_Data, Search_Ptr);
function File_Exists (Name : String) return Boolean; function File_Exists (Name : String) return Boolean;
-- Returns True if the named file exists. -- Returns True if the named file exists
procedure Fetch_Next_Entry (Search : Search_Type); procedure Fetch_Next_Entry (Search : Search_Type);
-- Get the next entry in a directory, setting Entry_Fetched if successful -- Get the next entry in a directory, setting Entry_Fetched if successful
...@@ -126,7 +126,7 @@ package body Ada.Directories is ...@@ -126,7 +126,7 @@ package body Ada.Directories is
then then
raise Name_Error; raise Name_Error;
-- This is not an invalid case. Build the path name. -- This is not an invalid case so build the path name
else else
Last := Containing_Directory'Length; Last := Containing_Directory'Length;
......
...@@ -51,7 +51,7 @@ package body Ada.Direct_IO is ...@@ -51,7 +51,7 @@ package body Ada.Direct_IO is
Zeroes : constant System.Storage_Elements.Storage_Array := Zeroes : constant System.Storage_Elements.Storage_Array :=
(1 .. System.Storage_Elements.Storage_Offset (Bytes) => 0); (1 .. System.Storage_Elements.Storage_Offset (Bytes) => 0);
-- Buffer used to fill out partial records. -- Buffer used to fill out partial records
package FCB renames System.File_Control_Block; package FCB renames System.File_Control_Block;
package FIO renames System.File_IO; package FIO renames System.File_IO;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- B o d y -- -- B o d y --
-- (Windows Version) -- -- (Windows Version) --
-- -- -- --
-- Copyright (C) 2004 Free Software Foundation, Inc. -- -- Copyright (C) 2004-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -147,7 +147,7 @@ package body Ada.Directories.Validity is ...@@ -147,7 +147,7 @@ package body Ada.Directories.Validity is
end if; end if;
end loop; end loop;
-- If no invalid chars, and not all spaces, file name is valid. -- If no invalid chars, and not all spaces, file name is valid
return not Only_Spaces; return not Only_Spaces;
end if; end if;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This is a HP-UX version of this package. -- This is a HP-UX version of this package
-- The following signals are reserved by the run time: -- The following signals are reserved by the run time:
......
...@@ -177,7 +177,7 @@ package Ada.Interrupts.Names is ...@@ -177,7 +177,7 @@ package Ada.Interrupts.Names is
SIGUME : constant Interrupt_ID := SIGUME : constant Interrupt_ID :=
System.OS_Interface.SIGUME; -- Uncorrectable memory error System.OS_Interface.SIGUME; -- Uncorrectable memory error
-- Signals defined for Posix 1003.1c. -- Signals defined for Posix 1003.1c
SIGPTINTR : constant Interrupt_ID := SIGPTINTR : constant Interrupt_ID :=
System.OS_Interface.SIGPTINTR; -- Pthread Interrupt Signal System.OS_Interface.SIGPTINTR; -- Pthread Interrupt Signal
......
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This is a NT (native) version of this package. -- This is a NT (native) version of this package
-- This target-dependent package spec contains names of interrupts -- This target-dependent package spec contains names of interrupts supported
-- supported by the local system. -- by the local system.
with System.OS_Interface; with System.OS_Interface;
-- used for names of interrupts -- used for names of interrupts
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This is an OS/2 version of this package. -- This is an OS/2 version of this package
-- This target-dependent package spec contains names of interrupts -- This target-dependent package spec contains names of interrupts
-- supported by the local system. -- supported by the local system.
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This is the VxWorks version of this package. -- This is the VxWorks version of this package
with System.OS_Interface; with System.OS_Interface;
...@@ -39,6 +39,6 @@ package Ada.Interrupts.Names is ...@@ -39,6 +39,6 @@ package Ada.Interrupts.Names is
subtype Hardware_Interrupts is Interrupt_ID subtype Hardware_Interrupts is Interrupt_ID
range Interrupt_ID'First .. System.OS_Interface.Max_HW_Interrupt; range Interrupt_ID'First .. System.OS_Interface.Max_HW_Interrupt;
-- Range of values that can be used for hardware interrupts. -- Range of values that can be used for hardware interrupts
end Ada.Interrupts.Names; end Ada.Interrupts.Names;
...@@ -90,7 +90,7 @@ package body Ada.Text_IO.Editing is ...@@ -90,7 +90,7 @@ package body Ada.Text_IO.Editing is
Result_Index := Result_Index + Count - 1; Result_Index := Result_Index + Count - 1;
-- Last + 1 was a ')' throw it away too. -- Last + 1 was a ')' throw it away too
Picture_Index := Last + 2; Picture_Index := Last + 2;
...@@ -139,10 +139,10 @@ package body Ada.Text_IO.Editing is ...@@ -139,10 +139,10 @@ package body Ada.Text_IO.Editing is
In_Currency : Boolean := False; In_Currency : Boolean := False;
Dollar : Boolean := False; Dollar : Boolean := False;
-- Overridden immediately if necessary. -- Overridden immediately if necessary
Zero : Boolean := True; Zero : Boolean := True;
-- Set to False when a non-zero digit is output. -- Set to False when a non-zero digit is output
begin begin
...@@ -236,7 +236,7 @@ package body Ada.Text_IO.Editing is ...@@ -236,7 +236,7 @@ package body Ada.Text_IO.Editing is
for J in reverse Last .. Answer'Last loop for J in reverse Last .. Answer'Last loop
exit when J = Pic.Radix_Position; exit when J = Pic.Radix_Position;
-- Do this test First, Separator_Character can equal Pic.Floater. -- Do this test First, Separator_Character can equal Pic.Floater
if Answer (J) = Pic.Floater then if Answer (J) = Pic.Floater then
exit; exit;
...@@ -692,11 +692,11 @@ package body Ada.Text_IO.Editing is ...@@ -692,11 +692,11 @@ package body Ada.Text_IO.Editing is
end case; end case;
end loop; end loop;
-- Now get rid of Blank_when_Zero and complete Star fill. -- Now get rid of Blank_when_Zero and complete Star fill
if Zero and Pic.Blank_When_Zero then if Zero and Pic.Blank_When_Zero then
-- Value is zero, and blank it. -- Value is zero, and blank it
Last := Answer'Last; Last := Answer'Last;
...@@ -897,7 +897,7 @@ package body Ada.Text_IO.Editing is ...@@ -897,7 +897,7 @@ package body Ada.Text_IO.Editing is
raise Picture_Error; raise Picture_Error;
end if; end if;
-- Two decimal points is a no-no. -- Two decimal points is a no-no
Answer.Has_Fraction := True; Answer.Has_Fraction := True;
Answer.End_Of_Fraction := J; Answer.End_Of_Fraction := J;
...@@ -917,7 +917,7 @@ package body Ada.Text_IO.Editing is ...@@ -917,7 +917,7 @@ package body Ada.Text_IO.Editing is
Answer.Start_Of_Int := Answer.End_Of_Int + 1; Answer.Start_Of_Int := Answer.End_Of_Int + 1;
end if; end if;
-- No significant (intger) digits needs a null range. -- No significant (integer) digits needs a null range
return Answer; return Answer;
end Parse_Number_String; end Parse_Number_String;
...@@ -953,7 +953,7 @@ package body Ada.Text_IO.Editing is ...@@ -953,7 +953,7 @@ package body Ada.Text_IO.Editing is
type Legality is (Okay, Reject); type Legality is (Okay, Reject);
State : Legality := Reject; State : Legality := Reject;
-- Start in reject, which will reject null strings. -- Start in reject, which will reject null strings
Index : Pic_Index := Pic.Picture.Expanded'First; Index : Pic_Index := Pic.Picture.Expanded'First;
...@@ -1067,7 +1067,7 @@ package body Ada.Text_IO.Editing is ...@@ -1067,7 +1067,7 @@ package body Ada.Text_IO.Editing is
begin begin
Debug_Start ("Floating_Bracket"); Debug_Start ("Floating_Bracket");
-- Two different floats not allowed. -- Two different floats not allowed
if Pic.Floater /= '!' and then Pic.Floater /= '<' then if Pic.Floater /= '!' and then Pic.Floater /= '<' then
raise Picture_Error; raise Picture_Error;
...@@ -1393,6 +1393,7 @@ package body Ada.Text_IO.Editing is ...@@ -1393,6 +1393,7 @@ package body Ada.Text_IO.Editing is
raise Picture_Error; raise Picture_Error;
else else
-- Overwrite Floater and Start_Float -- Overwrite Floater and Start_Float
Pic.Floater := '*'; Pic.Floater := '*';
Pic.Start_Float := Index; Pic.Start_Float := Index;
Star_Suppression; Star_Suppression;
...@@ -1411,7 +1412,7 @@ package body Ada.Text_IO.Editing is ...@@ -1411,7 +1412,7 @@ package body Ada.Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- A single dollar does not a floating make. -- A single dollar does not a floating make
Number_Completion; Number_Completion;
return; return;
...@@ -1423,8 +1424,8 @@ package body Ada.Text_IO.Editing is ...@@ -1423,8 +1424,8 @@ package body Ada.Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Only one dollar before the sign is okay, -- Only one dollar before the sign is okay, but doesn't
-- but doesn't float. -- float.
Pic.Radix_Position := Index; Pic.Radix_Position := Index;
Skip; Skip;
...@@ -1459,7 +1460,7 @@ package body Ada.Text_IO.Editing is ...@@ -1459,7 +1460,7 @@ package body Ada.Text_IO.Editing is
-- Set to True if a '_', '0', '/', 'B', or 'b' is encountered -- Set to True if a '_', '0', '/', 'B', or 'b' is encountered
Must_Float : Boolean := False; Must_Float : Boolean := False;
-- Set to true if a '#' occurs after an insert. -- Set to true if a '#' occurs after an insert
begin begin
Debug_Start ("Leading_Pound"); Debug_Start ("Leading_Pound");
...@@ -1548,7 +1549,7 @@ package body Ada.Text_IO.Editing is ...@@ -1548,7 +1549,7 @@ package body Ada.Text_IO.Editing is
when '9' => when '9' =>
if State /= Okay then if State /= Okay then
-- A single '#' doesn't float. -- A single '#' doesn't float
Pic.Floater := '!'; Pic.Floater := '!';
Pic.Start_Float := Invalid_Position; Pic.Start_Float := Invalid_Position;
...@@ -1565,8 +1566,8 @@ package body Ada.Text_IO.Editing is ...@@ -1565,8 +1566,8 @@ package body Ada.Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Only one pound before the sign is okay, -- Only one pound before the sign is okay, but doesn't
-- but doesn't float. -- float.
Pic.Radix_Position := Index; Pic.Radix_Position := Index;
Skip; Skip;
...@@ -1631,7 +1632,7 @@ package body Ada.Text_IO.Editing is ...@@ -1631,7 +1632,7 @@ package body Ada.Text_IO.Editing is
return; return;
end if; end if;
-- Will return in Okay state if a '9' was seen. -- Will return in Okay state if a '9' was seen
end loop; end loop;
end Number; end Number;
...@@ -2075,7 +2076,7 @@ package body Ada.Text_IO.Editing is ...@@ -2075,7 +2076,7 @@ package body Ada.Text_IO.Editing is
-- Picture -- -- Picture --
------------- -------------
-- Note that Picture can be called in either State. -- Note that Picture can be called in either State
-- It will set state to Valid only if a 9 is encountered or floating -- It will set state to Valid only if a 9 is encountered or floating
-- currency is called. -- currency is called.
...@@ -2136,7 +2137,7 @@ package body Ada.Text_IO.Editing is ...@@ -2136,7 +2137,7 @@ package body Ada.Text_IO.Editing is
Debug_Start ("Picture_Bracket"); Debug_Start ("Picture_Bracket");
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '<'; Pic.Floater := '<';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2208,7 +2209,7 @@ package body Ada.Text_IO.Editing is ...@@ -2208,7 +2209,7 @@ package body Ada.Text_IO.Editing is
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '-'; Pic.Floater := '-';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2253,7 +2254,7 @@ package body Ada.Text_IO.Editing is ...@@ -2253,7 +2254,7 @@ package body Ada.Text_IO.Editing is
when 'Z' | 'z' => when 'Z' | 'z' =>
-- Can't have Z and a floating sign. -- Can't have Z and a floating sign
if State = Okay then if State = Okay then
Set_State (Reject); Set_State (Reject);
...@@ -2272,7 +2273,7 @@ package body Ada.Text_IO.Editing is ...@@ -2272,7 +2273,7 @@ package body Ada.Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Don't assume that state is okay, haven't seen a digit. -- Don't assume that state is okay, haven't seen a digit
Picture; Picture;
return; return;
...@@ -2293,7 +2294,7 @@ package body Ada.Text_IO.Editing is ...@@ -2293,7 +2294,7 @@ package body Ada.Text_IO.Editing is
Debug_Start ("Picture_Plus"); Debug_Start ("Picture_Plus");
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '+'; Pic.Floater := '+';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2320,7 +2321,7 @@ package body Ada.Text_IO.Editing is ...@@ -2320,7 +2321,7 @@ package body Ada.Text_IO.Editing is
Pic.Max_Leading_Digits := Pic.Max_Leading_Digits + 1; Pic.Max_Leading_Digits := Pic.Max_Leading_Digits + 1;
Pic.End_Float := Index; Pic.End_Float := Index;
Skip; Skip;
Set_State (Okay); -- "++" is enough. Set_State (Okay); -- "++" is enough
Floating_Plus; Floating_Plus;
Trailing_Currency; Trailing_Currency;
return; return;
...@@ -2341,7 +2342,7 @@ package body Ada.Text_IO.Editing is ...@@ -2341,7 +2342,7 @@ package body Ada.Text_IO.Editing is
Set_State (Reject); Set_State (Reject);
end if; end if;
-- Can't have Z and a floating sign. -- Can't have Z and a floating sign
Pic.Picture.Expanded (Index) := 'Z'; -- consistency Pic.Picture.Expanded (Index) := 'Z'; -- consistency
...@@ -2366,7 +2367,7 @@ package body Ada.Text_IO.Editing is ...@@ -2366,7 +2367,7 @@ package body Ada.Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Don't assume that state is okay, haven't seen a digit. -- Don't assume that state is okay, haven't seen a digit
Picture; Picture;
return; return;
...@@ -2427,12 +2428,12 @@ package body Ada.Text_IO.Editing is ...@@ -2427,12 +2428,12 @@ package body Ada.Text_IO.Editing is
end case; end case;
-- Blank when zero either if the PIC does not contain a '9' or if -- Blank when zero either if the PIC does not contain a '9' or if
-- requested by the user and no '*' -- requested by the user and no '*'.
Pic.Blank_When_Zero := Pic.Blank_When_Zero :=
(Computed_BWZ or Pic.Blank_When_Zero) and not Pic.Star_Fill; (Computed_BWZ or Pic.Blank_When_Zero) and not Pic.Star_Fill;
-- Star fill if '*' and no '9'. -- Star fill if '*' and no '9'
Pic.Star_Fill := Pic.Star_Fill and Computed_BWZ; Pic.Star_Fill := Pic.Star_Fill and Computed_BWZ;
...@@ -2706,7 +2707,7 @@ package body Ada.Text_IO.Editing is ...@@ -2706,7 +2707,7 @@ package body Ada.Text_IO.Editing is
when Constraint_Error => when Constraint_Error =>
-- To deal with special cases like null strings. -- To deal with special cases like null strings
raise Picture_Error; raise Picture_Error;
end Precalculate; end Precalculate;
......
...@@ -183,7 +183,7 @@ package body Ada.Text_IO.Fixed_IO is ...@@ -183,7 +183,7 @@ package body Ada.Text_IO.Fixed_IO is
-- Fore + Aft + Exp + Extra_Layout_Space -- Fore + Aft + Exp + Extra_Layout_Space
-- is always long enough for formatting any fixed point number. -- is always long enough for formatting any fixed point number
-- Implementation of Put routines -- Implementation of Put routines
...@@ -247,7 +247,7 @@ package body Ada.Text_IO.Fixed_IO is ...@@ -247,7 +247,7 @@ package body Ada.Text_IO.Fixed_IO is
-- least 20 in order to print T'First, which is at most -2.0**63. -- least 20 in order to print T'First, which is at most -2.0**63.
-- This means D < 0, so use -- This means D < 0, so use
-- (1) Y = -S and Z = -10**(-D). -- (1) Y = -S and Z = -10**(-D)
-- If 1.0 / S is an integer greater than one, use -- If 1.0 / S is an integer greater than one, use
......
...@@ -266,7 +266,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -266,7 +266,7 @@ package body Ada.Wide_Text_IO.Editing is
Result_Index := Result_Index + Count - 1; Result_Index := Result_Index + Count - 1;
-- Last was a ')' throw it away too. -- Last was a ')' throw it away too
Picture_Index := Last + 1; Picture_Index := Last + 1;
...@@ -313,10 +313,10 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -313,10 +313,10 @@ package body Ada.Wide_Text_IO.Editing is
Currency_Pos : Integer := Pic.Start_Currency; Currency_Pos : Integer := Pic.Start_Currency;
Dollar : Boolean := False; Dollar : Boolean := False;
-- Overridden immediately if necessary. -- Overridden immediately if necessary
Zero : Boolean := True; Zero : Boolean := True;
-- Set to False when a non-zero digit is output. -- Set to False when a non-zero digit is output
begin begin
...@@ -856,11 +856,11 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -856,11 +856,11 @@ package body Ada.Wide_Text_IO.Editing is
end case; end case;
end loop; end loop;
-- Now get rid of Blank_when_Zero and complete Star fill. -- Now get rid of Blank_when_Zero and complete Star fill
if Zero and Pic.Blank_When_Zero then if Zero and Pic.Blank_When_Zero then
-- Value is zero, and blank it. -- Value is zero, and blank it
Last := Answer'Last; Last := Answer'Last;
...@@ -1063,7 +1063,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1063,7 +1063,7 @@ package body Ada.Wide_Text_IO.Editing is
raise Picture_Error; raise Picture_Error;
end if; end if;
-- Two decimal points is a no-no. -- Two decimal points is a no-no
Answer.Has_Fraction := True; Answer.Has_Fraction := True;
Answer.End_Of_Fraction := J; Answer.End_Of_Fraction := J;
...@@ -1083,7 +1083,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1083,7 +1083,7 @@ package body Ada.Wide_Text_IO.Editing is
Answer.Start_Of_Int := Answer.End_Of_Int + 1; Answer.Start_Of_Int := Answer.End_Of_Int + 1;
end if; end if;
-- No significant (intger) digits needs a null range. -- No significant (intger) digits needs a null range
return Answer; return Answer;
end Parse_Number_String; end Parse_Number_String;
...@@ -1116,7 +1116,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1116,7 +1116,7 @@ package body Ada.Wide_Text_IO.Editing is
type Legality is (Okay, Reject); type Legality is (Okay, Reject);
State : Legality := Reject; State : Legality := Reject;
-- Start in reject, which will reject null strings. -- Start in reject, which will reject null strings
Index : Pic_Index := Pic.Picture.Expanded'First; Index : Pic_Index := Pic.Picture.Expanded'First;
...@@ -1426,7 +1426,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1426,7 +1426,7 @@ package body Ada.Wide_Text_IO.Editing is
procedure Leading_Dollar is procedure Leading_Dollar is
begin begin
-- Treat as a floating dollar, and unwind otherwise. -- Treat as a floating dollar, and unwind otherwise
Pic.Floater := '$'; Pic.Floater := '$';
Pic.Start_Currency := Index; Pic.Start_Currency := Index;
...@@ -1495,7 +1495,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1495,7 +1495,7 @@ package body Ada.Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- A single dollar does not a floating make. -- A single dollar does not a floating make
Number_Completion; Number_Completion;
return; return;
...@@ -1507,8 +1507,8 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1507,8 +1507,8 @@ package body Ada.Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Only one dollar before the sign is okay, -- Only one dollar before the sign is okay, but doesn't
-- but doesn't float. -- float.
Pic.Radix_Position := Index; Pic.Radix_Position := Index;
Skip; Skip;
...@@ -1543,7 +1543,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1543,7 +1543,7 @@ package body Ada.Wide_Text_IO.Editing is
-- Set to True if a '_', '0', '/', 'B', or 'b' is encountered -- Set to True if a '_', '0', '/', 'B', or 'b' is encountered
Must_Float : Boolean := False; Must_Float : Boolean := False;
-- Set to true if a '#' occurs after an insert. -- Set to true if a '#' occurs after an insert
begin begin
-- Treat as a floating currency. If it isn't, this will be -- Treat as a floating currency. If it isn't, this will be
...@@ -1619,7 +1619,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1619,7 +1619,7 @@ package body Ada.Wide_Text_IO.Editing is
when '9' => when '9' =>
if State /= Okay then if State /= Okay then
-- A single '#' doesn't float. -- A single '#' doesn't float
Pic.Floater := '!'; Pic.Floater := '!';
Pic.Start_Float := Invalid_Position; Pic.Start_Float := Invalid_Position;
...@@ -1636,8 +1636,8 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1636,8 +1636,8 @@ package body Ada.Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Only one pound before the sign is okay, -- Only one pound before the sign is okay, but doesn't
-- but doesn't float. -- float.
Pic.Radix_Position := Index; Pic.Radix_Position := Index;
Skip; Skip;
...@@ -1700,7 +1700,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -1700,7 +1700,7 @@ package body Ada.Wide_Text_IO.Editing is
return; return;
end if; end if;
-- Will return in Okay state if a '9' was seen. -- Will return in Okay state if a '9' was seen
end loop; end loop;
end Number; end Number;
...@@ -2130,7 +2130,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2130,7 +2130,7 @@ package body Ada.Wide_Text_IO.Editing is
-- Picture -- -- Picture --
------------- -------------
-- Note that Picture can be called in either State. -- Note that Picture can be called in either State
-- It will set state to Valid only if a 9 is encountered or floating -- It will set state to Valid only if a 9 is encountered or floating
-- currency is called. -- currency is called.
...@@ -2188,7 +2188,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2188,7 +2188,7 @@ package body Ada.Wide_Text_IO.Editing is
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '<'; Pic.Floater := '<';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2258,7 +2258,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2258,7 +2258,7 @@ package body Ada.Wide_Text_IO.Editing is
begin begin
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '-'; Pic.Floater := '-';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2285,7 +2285,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2285,7 +2285,7 @@ package body Ada.Wide_Text_IO.Editing is
Pic.Max_Leading_Digits := Pic.Max_Leading_Digits + 1; Pic.Max_Leading_Digits := Pic.Max_Leading_Digits + 1;
Pic.End_Float := Index; Pic.End_Float := Index;
Skip; Skip;
Set_State (Okay); -- "-- " is enough. Set_State (Okay); -- "-- " is enough
Floating_Minus; Floating_Minus;
Trailing_Currency; Trailing_Currency;
return; return;
...@@ -2303,7 +2303,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2303,7 +2303,7 @@ package body Ada.Wide_Text_IO.Editing is
when 'Z' | 'z' => when 'Z' | 'z' =>
-- Can't have Z and a floating sign. -- Can't have Z and a floating sign
if State = Okay then if State = Okay then
Set_State (Reject); Set_State (Reject);
...@@ -2322,7 +2322,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2322,7 +2322,7 @@ package body Ada.Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Don't assume that state is okay, haven't seen a digit. -- Don't assume that state is okay, haven't seen a digit
Picture; Picture;
return; return;
...@@ -2342,7 +2342,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2342,7 +2342,7 @@ package body Ada.Wide_Text_IO.Editing is
begin begin
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '+'; Pic.Floater := '+';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2369,7 +2369,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2369,7 +2369,7 @@ package body Ada.Wide_Text_IO.Editing is
Pic.Max_Leading_Digits := Pic.Max_Leading_Digits + 1; Pic.Max_Leading_Digits := Pic.Max_Leading_Digits + 1;
Pic.End_Float := Index; Pic.End_Float := Index;
Skip; Skip;
Set_State (Okay); -- "++" is enough. Set_State (Okay); -- "++" is enough
Floating_Plus; Floating_Plus;
Trailing_Currency; Trailing_Currency;
return; return;
...@@ -2390,7 +2390,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2390,7 +2390,7 @@ package body Ada.Wide_Text_IO.Editing is
Set_State (Reject); Set_State (Reject);
end if; end if;
-- Can't have Z and a floating sign. -- Can't have Z and a floating sign
Pic.Picture.Expanded (Index) := 'Z'; -- consistency Pic.Picture.Expanded (Index) := 'Z'; -- consistency
...@@ -2410,7 +2410,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2410,7 +2410,7 @@ package body Ada.Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Don't assume that state is okay, haven't seen a digit. -- Don't assume that state is okay, haven't seen a digit
Picture; Picture;
return; return;
...@@ -2474,7 +2474,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2474,7 +2474,7 @@ package body Ada.Wide_Text_IO.Editing is
Pic.Blank_When_Zero := Pic.Blank_When_Zero :=
(Computed_BWZ or Pic.Blank_When_Zero) and not Pic.Star_Fill; (Computed_BWZ or Pic.Blank_When_Zero) and not Pic.Star_Fill;
-- Star fill if '*' and no '9'. -- Star fill if '*' and no '9'
Pic.Star_Fill := Pic.Star_Fill and Computed_BWZ; Pic.Star_Fill := Pic.Star_Fill and Computed_BWZ;
...@@ -2693,7 +2693,7 @@ package body Ada.Wide_Text_IO.Editing is ...@@ -2693,7 +2693,7 @@ package body Ada.Wide_Text_IO.Editing is
when Constraint_Error => when Constraint_Error =>
-- To deal with special cases like null strings. -- To deal with special cases like null strings
raise Picture_Error; raise Picture_Error;
......
...@@ -46,10 +46,10 @@ package body Ada.Wide_Text_IO.Enumeration_Aux is ...@@ -46,10 +46,10 @@ package body Ada.Wide_Text_IO.Enumeration_Aux is
----------------------- -----------------------
procedure Store_Char procedure Store_Char
(WC : Wide_Character; (WC : Wide_Character;
Buf : out Wide_String; Buf : out Wide_String;
Ptr : in out Integer); Ptr : in out Integer);
-- Store a single character in buffer, checking for overflow. -- Store a single character in buffer, checking for overflow
-- These definitions replace the ones in Ada.Characters.Handling, which -- These definitions replace the ones in Ada.Characters.Handling, which
-- do not seem to work for some strange not understood reason ??? at -- do not seem to work for some strange not understood reason ??? at
...@@ -324,9 +324,9 @@ package body Ada.Wide_Text_IO.Enumeration_Aux is ...@@ -324,9 +324,9 @@ package body Ada.Wide_Text_IO.Enumeration_Aux is
---------------- ----------------
procedure Store_Char procedure Store_Char
(WC : Wide_Character; (WC : Wide_Character;
Buf : out Wide_String; Buf : out Wide_String;
Ptr : in out Integer) Ptr : in out Integer)
is is
begin begin
if Ptr = Buf'Last then if Ptr = Buf'Last then
......
...@@ -267,7 +267,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -267,7 +267,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Result_Index := Result_Index + Count - 1; Result_Index := Result_Index + Count - 1;
-- Last was a ')' throw it away too. -- Last was a ')' throw it away too
Picture_Index := Last + 1; Picture_Index := Last + 1;
...@@ -314,10 +314,10 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -314,10 +314,10 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Currency_Pos : Integer := Pic.Start_Currency; Currency_Pos : Integer := Pic.Start_Currency;
Dollar : Boolean := False; Dollar : Boolean := False;
-- Overridden immediately if necessary. -- Overridden immediately if necessary
Zero : Boolean := True; Zero : Boolean := True;
-- Set to False when a non-zero digit is output. -- Set to False when a non-zero digit is output
begin begin
...@@ -857,11 +857,11 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -857,11 +857,11 @@ package body Ada.Wide_Wide_Text_IO.Editing is
end case; end case;
end loop; end loop;
-- Now get rid of Blank_when_Zero and complete Star fill. -- Now get rid of Blank_when_Zero and complete Star fill
if Zero and Pic.Blank_When_Zero then if Zero and Pic.Blank_When_Zero then
-- Value is zero, and blank it. -- Value is zero, and blank it
Last := Answer'Last; Last := Answer'Last;
...@@ -1065,7 +1065,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1065,7 +1065,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
raise Picture_Error; raise Picture_Error;
end if; end if;
-- Two decimal points is a no-no. -- Two decimal points is a no-no
Answer.Has_Fraction := True; Answer.Has_Fraction := True;
Answer.End_Of_Fraction := J; Answer.End_Of_Fraction := J;
...@@ -1085,7 +1085,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1085,7 +1085,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Answer.Start_Of_Int := Answer.End_Of_Int + 1; Answer.Start_Of_Int := Answer.End_Of_Int + 1;
end if; end if;
-- No significant (intger) digits needs a null range. -- No significant (intger) digits needs a null range
return Answer; return Answer;
end Parse_Number_String; end Parse_Number_String;
...@@ -1118,7 +1118,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1118,7 +1118,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
type Legality is (Okay, Reject); type Legality is (Okay, Reject);
State : Legality := Reject; State : Legality := Reject;
-- Start in reject, which will reject null strings. -- Start in reject, which will reject null strings
Index : Pic_Index := Pic.Picture.Expanded'First; Index : Pic_Index := Pic.Picture.Expanded'First;
...@@ -1418,9 +1418,8 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1418,9 +1418,8 @@ package body Ada.Wide_Wide_Text_IO.Editing is
-- Leading_Dollar -- -- Leading_Dollar --
-------------------- --------------------
-- Note that Leading_Dollar can be called in either State. -- Note that Leading_Dollar can be called in either State. It will set
-- It will set state to Okay only if a 9 or (second) $ -- state to Okay only if a 9 or (second) is encountered.
-- is encountered.
-- Also notice the tricky bit with State and Zero_Suppression. -- Also notice the tricky bit with State and Zero_Suppression.
-- Zero_Suppression is Picture_Error if a '$' or a '9' has been -- Zero_Suppression is Picture_Error if a '$' or a '9' has been
...@@ -1428,7 +1427,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1428,7 +1427,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
procedure Leading_Dollar is procedure Leading_Dollar is
begin begin
-- Treat as a floating dollar, and unwind otherwise. -- Treat as a floating dollar, and unwind otherwise
Pic.Floater := '$'; Pic.Floater := '$';
Pic.Start_Currency := Index; Pic.Start_Currency := Index;
...@@ -1497,7 +1496,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1497,7 +1496,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- A single dollar does not a floating make. -- A single dollar does not a floating make
Number_Completion; Number_Completion;
return; return;
...@@ -1509,8 +1508,8 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1509,8 +1508,8 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Only one dollar before the sign is okay, -- Only one dollar before the sign is okay, but doesn't
-- but doesn't float. -- float.
Pic.Radix_Position := Index; Pic.Radix_Position := Index;
Skip; Skip;
...@@ -1533,8 +1532,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1533,8 +1532,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
-- this procedure. Also note that Leading_Pound can be called in -- this procedure. Also note that Leading_Pound can be called in
-- either State. -- either State.
-- It will set state to Okay only if a 9 or (second) # is -- It will set state to Okay only if a 9 or (second) # is encountered
-- encountered.
-- One Last note: In ambiguous cases, the currency is treated as -- One Last note: In ambiguous cases, the currency is treated as
-- floating unless there is only one '#'. -- floating unless there is only one '#'.
...@@ -1545,7 +1543,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1545,7 +1543,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
-- Set to True if a '_', '0', '/', 'B', or 'b' is encountered -- Set to True if a '_', '0', '/', 'B', or 'b' is encountered
Must_Float : Boolean := False; Must_Float : Boolean := False;
-- Set to true if a '#' occurs after an insert. -- Set to true if a '#' occurs after an insert
begin begin
-- Treat as a floating currency. If it isn't, this will be -- Treat as a floating currency. If it isn't, this will be
...@@ -1621,7 +1619,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1621,7 +1619,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when '9' => when '9' =>
if State /= Okay then if State /= Okay then
-- A single '#' doesn't float. -- A single '#' doesn't float
Pic.Floater := '!'; Pic.Floater := '!';
Pic.Start_Float := Invalid_Position; Pic.Start_Float := Invalid_Position;
...@@ -1638,8 +1636,8 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1638,8 +1636,8 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Only one pound before the sign is okay, -- Only one pound before the sign is okay, but doesn't
-- but doesn't float. -- float.
Pic.Radix_Position := Index; Pic.Radix_Position := Index;
Skip; Skip;
...@@ -1702,7 +1700,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -1702,7 +1700,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
return; return;
end if; end if;
-- Will return in Okay state if a '9' was seen. -- Will return in Okay state if a '9' was seen
end loop; end loop;
end Number; end Number;
...@@ -2132,7 +2130,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2132,7 +2130,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
-- Picture -- -- Picture --
------------- -------------
-- Note that Picture can be called in either State. -- Note that Picture can be called in either State
-- It will set state to Valid only if a 9 is encountered or floating -- It will set state to Valid only if a 9 is encountered or floating
-- currency is called. -- currency is called.
...@@ -2190,7 +2188,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2190,7 +2188,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '<'; Pic.Floater := '<';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2260,7 +2258,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2260,7 +2258,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
begin begin
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '-'; Pic.Floater := '-';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2305,7 +2303,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2305,7 +2303,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when 'Z' | 'z' => when 'Z' | 'z' =>
-- Can't have Z and a floating sign. -- Can't have Z and a floating sign
if State = Okay then if State = Okay then
Set_State (Reject); Set_State (Reject);
...@@ -2324,7 +2322,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2324,7 +2322,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Don't assume that state is okay, haven't seen a digit. -- Don't assume that state is okay, haven't seen a digit
Picture; Picture;
return; return;
...@@ -2344,7 +2342,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2344,7 +2342,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
begin begin
Pic.Sign_Position := Index; Pic.Sign_Position := Index;
-- Treat as a floating sign, and unwind otherwise. -- Treat as a floating sign, and unwind otherwise
Pic.Floater := '+'; Pic.Floater := '+';
Pic.Start_Float := Index; Pic.Start_Float := Index;
...@@ -2371,7 +2369,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2371,7 +2369,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Pic.Max_Leading_Digits := Pic.Max_Leading_Digits + 1; Pic.Max_Leading_Digits := Pic.Max_Leading_Digits + 1;
Pic.End_Float := Index; Pic.End_Float := Index;
Skip; Skip;
Set_State (Okay); -- "++" is enough. Set_State (Okay); -- "++" is enough
Floating_Plus; Floating_Plus;
Trailing_Currency; Trailing_Currency;
return; return;
...@@ -2392,7 +2390,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2392,7 +2390,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Set_State (Reject); Set_State (Reject);
end if; end if;
-- Can't have Z and a floating sign. -- Can't have Z and a floating sign
Pic.Picture.Expanded (Index) := 'Z'; -- consistency Pic.Picture.Expanded (Index) := 'Z'; -- consistency
...@@ -2412,7 +2410,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2412,7 +2410,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Pic.End_Float := Invalid_Position; Pic.End_Float := Invalid_Position;
end if; end if;
-- Don't assume that state is okay, haven't seen a digit. -- Don't assume that state is okay, haven't seen a digit
Picture; Picture;
return; return;
...@@ -2476,7 +2474,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2476,7 +2474,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
Pic.Blank_When_Zero := Pic.Blank_When_Zero :=
(Computed_BWZ or Pic.Blank_When_Zero) and not Pic.Star_Fill; (Computed_BWZ or Pic.Blank_When_Zero) and not Pic.Star_Fill;
-- Star fill if '*' and no '9'. -- Star fill if '*' and no '9'
Pic.Star_Fill := Pic.Star_Fill and Computed_BWZ; Pic.Star_Fill := Pic.Star_Fill and Computed_BWZ;
...@@ -2695,7 +2693,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is ...@@ -2695,7 +2693,7 @@ package body Ada.Wide_Wide_Text_IO.Editing is
when Constraint_Error => when Constraint_Error =>
-- To deal with special cases like null strings. -- To deal with special cases like null strings
raise Picture_Error; raise Picture_Error;
......
...@@ -47,10 +47,10 @@ package body Ada.Wide_Wide_Text_IO.Enumeration_Aux is ...@@ -47,10 +47,10 @@ package body Ada.Wide_Wide_Text_IO.Enumeration_Aux is
----------------------- -----------------------
procedure Store_Char procedure Store_Char
(WC : Wide_Wide_Character; (WC : Wide_Wide_Character;
Buf : out Wide_Wide_String; Buf : out Wide_Wide_String;
Ptr : in out Integer); Ptr : in out Integer);
-- Store a single character in buffer, checking for overflow. -- Store a single character in buffer, checking for overflow
-- These definitions replace the ones in Ada.Characters.Handling, which -- These definitions replace the ones in Ada.Characters.Handling, which
-- do not seem to work for some strange not understood reason ??? at -- do not seem to work for some strange not understood reason ??? at
...@@ -326,9 +326,9 @@ package body Ada.Wide_Wide_Text_IO.Enumeration_Aux is ...@@ -326,9 +326,9 @@ package body Ada.Wide_Wide_Text_IO.Enumeration_Aux is
---------------- ----------------
procedure Store_Char procedure Store_Char
(WC : Wide_Wide_Character; (WC : Wide_Wide_Character;
Buf : out Wide_Wide_String; Buf : out Wide_Wide_String;
Ptr : in out Integer) Ptr : in out Integer)
is is
begin begin
if Ptr = Buf'Last then if Ptr = Buf'Last then
......
...@@ -114,7 +114,7 @@ package body CStand is ...@@ -114,7 +114,7 @@ package body CStand is
-- Make an entry in the names table for Nam, and set as Chars field of Id -- Make an entry in the names table for Nam, and set as Chars field of Id
function New_Operator (Op : Name_Id; Typ : Entity_Id) return Entity_Id; function New_Operator (Op : Name_Id; Typ : Entity_Id) return Entity_Id;
-- Build entity for standard operator with given name and type. -- Build entity for standard operator with given name and type
function New_Standard_Entity function New_Standard_Entity
(New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id; (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id;
...@@ -537,7 +537,7 @@ package body CStand is ...@@ -537,7 +537,7 @@ package body CStand is
Set_Is_Known_Valid (Standard_Character); Set_Is_Known_Valid (Standard_Character);
Set_Size_Known_At_Compile_Time (Standard_Character); Set_Size_Known_At_Compile_Time (Standard_Character);
-- Create the bounds for type Character. -- Create the bounds for type Character
R_Node := New_Node (N_Range, Stloc); R_Node := New_Node (N_Range, Stloc);
...@@ -582,7 +582,7 @@ package body CStand is ...@@ -582,7 +582,7 @@ package body CStand is
Set_Is_Known_Valid (Standard_Wide_Character); Set_Is_Known_Valid (Standard_Wide_Character);
Set_Size_Known_At_Compile_Time (Standard_Wide_Character); Set_Size_Known_At_Compile_Time (Standard_Wide_Character);
-- Create the bounds for type Wide_Character. -- Create the bounds for type Wide_Character
R_Node := New_Node (N_Range, Stloc); R_Node := New_Node (N_Range, Stloc);
...@@ -1259,20 +1259,22 @@ package body CStand is ...@@ -1259,20 +1259,22 @@ package body CStand is
(Standard_Exception_Type, True); (Standard_Exception_Type, True);
Make_Name (Standard_Exception_Type, "exception"); Make_Name (Standard_Exception_Type, "exception");
Make_Component (Standard_Exception_Type, Standard_Boolean, Make_Component
"Not_Handled_By_Others"); (Standard_Exception_Type, Standard_Boolean, "Not_Handled_By_Others");
Make_Component (Standard_Exception_Type, Standard_Character, "Lang"); Make_Component
Make_Component (Standard_Exception_Type, Standard_Natural, (Standard_Exception_Type, Standard_Character, "Lang");
"Name_Length"); Make_Component
Make_Component (Standard_Exception_Type, Standard_A_Char, (Standard_Exception_Type, Standard_Natural, "Name_Length");
"Full_Name"); Make_Component
Make_Component (Standard_Exception_Type, Standard_A_Char, (Standard_Exception_Type, Standard_A_Char, "Full_Name");
"HTable_Ptr"); Make_Component
Make_Component (Standard_Exception_Type, Standard_Unsigned, (Standard_Exception_Type, Standard_A_Char, "HTable_Ptr");
"Import_Code"); Make_Component
Make_Component (Standard_Exception_Type, Standard_A_Char, (Standard_Exception_Type, Standard_Unsigned, "Import_Code");
"Raise_Hook"); Make_Component
-- Build tree for record declaration, for use by the back-end. (Standard_Exception_Type, Standard_A_Char, "Raise_Hook");
-- Build tree for record declaration, for use by the back-end
declare declare
Comp_List : List_Id; Comp_List : List_Id;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -965,7 +965,7 @@ package body Exp_Fixd is ...@@ -965,7 +965,7 @@ package body Exp_Fixd is
New_Occurrence_Of (Rnd, Loc)))); New_Occurrence_Of (Rnd, Loc))));
end if; end if;
-- Set type of result, for use in caller. -- Set type of result, for use in caller
Set_Etype (Qnn, QR_Typ); Set_Etype (Qnn, QR_Typ);
end Build_Scaled_Divide_Code; end Build_Scaled_Divide_Code;
...@@ -1095,7 +1095,7 @@ package body Exp_Fixd is ...@@ -1095,7 +1095,7 @@ package body Exp_Fixd is
-- is an integer or the reciprocal of an integer, and for -- is an integer or the reciprocal of an integer, and for
-- implementation efficiency we need the smallest such K. -- implementation efficiency we need the smallest such K.
-- First we reduce the left fraction to lowest terms. -- First we reduce the left fraction to lowest terms
-- If numerator = 1, then for K = 1, the small ratio is the reciprocal -- If numerator = 1, then for K = 1, the small ratio is the reciprocal
-- of an integer, and this is clearly the minimum K case, so set K = 1, -- of an integer, and this is clearly the minimum K case, so set K = 1,
...@@ -1213,7 +1213,7 @@ package body Exp_Fixd is ...@@ -1213,7 +1213,7 @@ package body Exp_Fixd is
-- is an integer or the reciprocal of an integer, and for -- is an integer or the reciprocal of an integer, and for
-- implementation efficiency we need the smallest such K. -- implementation efficiency we need the smallest such K.
-- First we reduce the left fraction to lowest terms. -- First we reduce the left fraction to lowest terms
-- If denominator = 1, then for K = 1, the small ratio is an integer -- If denominator = 1, then for K = 1, the small ratio is an integer
-- (the numerator) and this is clearly the minimum K case, so set K = 1, -- (the numerator) and this is clearly the minimum K case, so set K = 1,
...@@ -1415,15 +1415,16 @@ package body Exp_Fixd is ...@@ -1415,15 +1415,16 @@ package body Exp_Fixd is
-- is an integer or the reciprocal of an integer, and for -- is an integer or the reciprocal of an integer, and for
-- implementation efficiency we need the smallest such K. -- implementation efficiency we need the smallest such K.
-- First we reduce the left fraction to lowest terms. -- First we reduce the left fraction to lowest terms
-- If denominator = 1, then for K = 1, the small ratio is an -- If denominator = 1, then for K = 1, the small ratio is an integer, and
-- integer, and this is clearly the minimum K case, so set -- this is clearly the minimum K case, so set
-- K = 1, Right_Small = Lit_Value.
-- If denominator > 1, then set K to the numerator of the -- K = 1, Right_Small = Lit_Value.
-- fraction, so that the resulting small ratio is the
-- reciprocal of the integer (the denominator value). -- If denominator > 1, then set K to the numerator of the fraction, so
-- that the resulting small ratio is the reciprocal of the integer (the
-- denominator value).
procedure Do_Multiply_Fixed_Universal procedure Do_Multiply_Fixed_Universal
(N : Node_Id; (N : Node_Id;
......
...@@ -60,7 +60,7 @@ package body Exp_Smem is ...@@ -60,7 +60,7 @@ package body Exp_Smem is
procedure Build_Full_Name procedure Build_Full_Name
(E : in Entity_Id; (E : in Entity_Id;
N : out String_Id); N : out String_Id);
-- Build the fully qualified string name of a shared variable. -- Build the fully qualified string name of a shared variable
function On_Lhs_Of_Assignment (N : Node_Id) return Boolean; function On_Lhs_Of_Assignment (N : Node_Id) return Boolean;
-- Determines if N is on the left hand of the assignment. This means -- Determines if N is on the left hand of the assignment. This means
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2002-2003 Free Software Foundation, Inc. -- -- Copyright (C) 2002-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -43,8 +43,7 @@ package body GNAT.Array_Split is ...@@ -43,8 +43,7 @@ package body GNAT.Array_Split is
function Count function Count
(Source : Element_Sequence; (Source : Element_Sequence;
Pattern : Element_Set) Pattern : Element_Set) return Natural;
return Natural;
-- Returns the number of occurences of Pattern elements in Source, 0 is -- Returns the number of occurences of Pattern elements in Source, 0 is
-- returned if no occurence is found in Source. -- returned if no occurence is found in Source.
...@@ -92,8 +91,7 @@ package body GNAT.Array_Split is ...@@ -92,8 +91,7 @@ package body GNAT.Array_Split is
function Count function Count
(Source : Element_Sequence; (Source : Element_Sequence;
Pattern : Element_Set) Pattern : Element_Set) return Natural
return Natural
is is
C : Natural := 0; C : Natural := 0;
begin begin
...@@ -144,8 +142,7 @@ package body GNAT.Array_Split is ...@@ -144,8 +142,7 @@ package body GNAT.Array_Split is
function Separators function Separators
(S : Slice_Set; (S : Slice_Set;
Index : Slice_Number) Index : Slice_Number) return Slice_Separators
return Slice_Separators
is is
begin begin
if Index > S.N_Slice then if Index > S.N_Slice then
...@@ -154,7 +151,7 @@ package body GNAT.Array_Split is ...@@ -154,7 +151,7 @@ package body GNAT.Array_Split is
elsif Index = 0 elsif Index = 0
or else (Index = 1 and then S.N_Slice = 1) or else (Index = 1 and then S.N_Slice = 1)
then then
-- Whole string, or no separator used. -- Whole string, or no separator used
return (Before => Array_End, return (Before => Array_End,
After => Array_End); After => Array_End);
...@@ -238,8 +235,10 @@ package body GNAT.Array_Split is ...@@ -238,8 +235,10 @@ package body GNAT.Array_Split is
loop loop
if K > Count_Sep then if K > Count_Sep then
-- No more separator, last slice end at the end of the source
-- No more separators, last slice ends at the end of the source
-- string. -- string.
Stop := S.Source'Last; Stop := S.Source'Last;
else else
Stop := S.Indexes (K) - 1; Stop := S.Indexes (K) - 1;
...@@ -255,13 +254,17 @@ package body GNAT.Array_Split is ...@@ -255,13 +254,17 @@ package body GNAT.Array_Split is
case Mode is case Mode is
when Single => when Single =>
-- In this mode just set start to character next to the -- In this mode just set start to character next to the
-- current separator, advance the separator index. -- current separator, advance the separator index.
Start := S.Indexes (K) + 1; Start := S.Indexes (K) + 1;
K := K + 1; K := K + 1;
when Multiple => when Multiple =>
-- In this mode skip separators following each others
-- In this mode skip separators following each other
loop loop
Start := S.Indexes (K) + 1; Start := S.Indexes (K) + 1;
K := K + 1; K := K + 1;
...@@ -282,8 +285,7 @@ package body GNAT.Array_Split is ...@@ -282,8 +285,7 @@ package body GNAT.Array_Split is
function Slice function Slice
(S : Slice_Set; (S : Slice_Set;
Index : Slice_Number) Index : Slice_Number) return Element_Sequence
return Element_Sequence
is is
begin begin
if Index = 0 then if Index = 0 then
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2002-2003 Free Software Foundation, Inc. -- -- Copyright (C) 2002-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -42,7 +42,7 @@ generic ...@@ -42,7 +42,7 @@ generic
-- Element of the array, this must be a discrete type -- Element of the array, this must be a discrete type
type Element_Sequence is array (Positive range <>) of Element; type Element_Sequence is array (Positive range <>) of Element;
-- The array which is a sequence of element. -- The array which is a sequence of element
type Element_Set is private; type Element_Set is private;
-- This type represent a set of elements. This set does not defined a -- This type represent a set of elements. This set does not defined a
...@@ -120,8 +120,7 @@ package GNAT.Array_Split is ...@@ -120,8 +120,7 @@ package GNAT.Array_Split is
function Slice function Slice
(S : Slice_Set; (S : Slice_Set;
Index : Slice_Number) Index : Slice_Number) return Element_Sequence;
return Element_Sequence;
pragma Inline (Slice); pragma Inline (Slice);
-- Returns the slice at position Index. First slice is 1. If Index is 0 -- Returns the slice at position Index. First slice is 1. If Index is 0
-- the whole array is returned including the separators (this is the -- the whole array is returned including the separators (this is the
...@@ -138,8 +137,7 @@ package GNAT.Array_Split is ...@@ -138,8 +137,7 @@ package GNAT.Array_Split is
function Separators function Separators
(S : Slice_Set; (S : Slice_Set;
Index : Slice_Number) Index : Slice_Number) return Slice_Separators;
return Slice_Separators;
-- Returns the separators used to slice (front and back) the slice at -- Returns the separators used to slice (front and back) the slice at
-- position Index. For slices at start and end of the original array, the -- position Index. For slices at start and end of the original array, the
-- Array_End value is returned for the corresponding outer bound. In -- Array_End value is returned for the corresponding outer bound. In
...@@ -165,7 +163,7 @@ private ...@@ -165,7 +163,7 @@ private
Start : Positive; Start : Positive;
Stop : Natural; Stop : Natural;
end record; end record;
-- Starting/Ending position of a slice. This does not include separators. -- Starting/Ending position of a slice. This does not include separators
type Slices_Indexes is array (Slice_Number range <>) of Slice_Info; type Slices_Indexes is array (Slice_Number range <>) of Slice_Info;
type Slices_Access is access Slices_Indexes; type Slices_Access is access Slices_Indexes;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2000-2003 Ada Core Technologies, Inc. -- -- Copyright (C) 2000-2005 Ada Core Technologies, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -65,7 +65,7 @@ package body GNAT.AWK is ...@@ -65,7 +65,7 @@ package body GNAT.AWK is
procedure Current_Line (S : Mode; Session : Session_Type) procedure Current_Line (S : Mode; Session : Session_Type)
is abstract; is abstract;
-- Split Session's current line using split mode. -- Split current line of Session using split mode S
------------------------ ------------------------
-- Split on separator -- -- Split on separator --
...@@ -102,7 +102,7 @@ package body GNAT.AWK is ...@@ -102,7 +102,7 @@ package body GNAT.AWK is
package File_Table is package File_Table is
new Dynamic_Tables (AWK_File, Natural, 1, 5, 50); new Dynamic_Tables (AWK_File, Natural, 1, 5, 50);
-- List of filename associated with a Session. -- List of file names associated with a Session
procedure Free is new Unchecked_Deallocation (String, AWK_File); procedure Free is new Unchecked_Deallocation (String, AWK_File);
...@@ -114,17 +114,17 @@ package body GNAT.AWK is ...@@ -114,17 +114,17 @@ package body GNAT.AWK is
First : Positive; First : Positive;
Last : Natural; Last : Natural;
end record; end record;
-- This is a field slice (First .. Last) in session's current line. -- This is a field slice (First .. Last) in session's current line
package Field_Table is package Field_Table is
new Dynamic_Tables (Field_Slice, Natural, 1, 10, 100); new Dynamic_Tables (Field_Slice, Natural, 1, 10, 100);
-- List of fields for the current line. -- List of fields for the current line
-------------- --------------
-- Patterns -- -- Patterns --
-------------- --------------
-- Define all patterns style : exact string, regular expression, boolean -- Define all patterns style: exact string, regular expression, boolean
-- function. -- function.
package Patterns is package Patterns is
...@@ -137,13 +137,12 @@ package body GNAT.AWK is ...@@ -137,13 +137,12 @@ package body GNAT.AWK is
function Match function Match
(P : Pattern; (P : Pattern;
Session : Session_Type) Session : Session_Type) return Boolean
return Boolean
is abstract; is abstract;
-- Returns True if P match for the current session and False otherwise. -- Returns True if P match for the current session and False otherwise
procedure Release (P : in out Pattern); procedure Release (P : in out Pattern);
-- Release memory used by the pattern structure. -- Release memory used by the pattern structure
-------------------------- --------------------------
-- Exact string pattern -- -- Exact string pattern --
...@@ -156,8 +155,7 @@ package body GNAT.AWK is ...@@ -156,8 +155,7 @@ package body GNAT.AWK is
function Match function Match
(P : String_Pattern; (P : String_Pattern;
Session : Session_Type) Session : Session_Type) return Boolean;
return Boolean;
-------------------------------- --------------------------------
-- Regular expression pattern -- -- Regular expression pattern --
...@@ -172,8 +170,7 @@ package body GNAT.AWK is ...@@ -172,8 +170,7 @@ package body GNAT.AWK is
function Match function Match
(P : Regexp_Pattern; (P : Regexp_Pattern;
Session : Session_Type) Session : Session_Type) return Boolean;
return Boolean;
procedure Release (P : in out Regexp_Pattern); procedure Release (P : in out Regexp_Pattern);
...@@ -187,8 +184,7 @@ package body GNAT.AWK is ...@@ -187,8 +184,7 @@ package body GNAT.AWK is
function Match function Match
(P : Callback_Pattern; (P : Callback_Pattern;
Session : Session_Type) Session : Session_Type) return Boolean;
return Boolean;
end Patterns; end Patterns;
...@@ -211,9 +207,8 @@ package body GNAT.AWK is ...@@ -211,9 +207,8 @@ package body GNAT.AWK is
procedure Call procedure Call
(A : Action; (A : Action;
Session : Session_Type) Session : Session_Type) is abstract;
is abstract; -- Call action A as required
-- Call action A as required.
------------------- -------------------
-- Simple action -- -- Simple action --
...@@ -317,13 +312,13 @@ package body GNAT.AWK is ...@@ -317,13 +312,13 @@ package body GNAT.AWK is
procedure Finalize (Session : in out Session_Type) is procedure Finalize (Session : in out Session_Type) is
begin begin
-- We release the session data only if it is not the default session. -- We release the session data only if it is not the default session
if Session.Data /= Def_Session.Data then if Session.Data /= Def_Session.Data then
Free (Session.Data); Free (Session.Data);
-- Since we have closed the current session, set it to point -- Since we have closed the current session, set it to point now to
-- now to the default session. -- the default session.
Cur_Session.Data := Def_Session.Data; Cur_Session.Data := Def_Session.Data;
end if; end if;
...@@ -334,11 +329,10 @@ package body GNAT.AWK is ...@@ -334,11 +329,10 @@ package body GNAT.AWK is
---------------------- ----------------------
function Always_True return Boolean; function Always_True return Boolean;
-- A function that always returns True. -- A function that always returns True
function Apply_Filters function Apply_Filters
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Boolean;
return Boolean;
-- Apply any filters for which the Pattern is True for Session. It returns -- Apply any filters for which the Pattern is True for Session. It returns
-- True if a least one filters has been applied (i.e. associated action -- True if a least one filters has been applied (i.e. associated action
-- callback has been called). -- callback has been called).
...@@ -358,7 +352,7 @@ package body GNAT.AWK is ...@@ -358,7 +352,7 @@ package body GNAT.AWK is
-- number and the filename if possible. -- number and the filename if possible.
procedure Read_Line (Session : Session_Type); procedure Read_Line (Session : Session_Type);
-- Read a line for the Session and set Current_Line. -- Read a line for the Session and set Current_Line
procedure Split_Line (Session : Session_Type); procedure Split_Line (Session : Session_Type);
-- Split session's Current_Line according to the session separators and -- Split session's Current_Line according to the session separators and
...@@ -414,8 +408,7 @@ package body GNAT.AWK is ...@@ -414,8 +408,7 @@ package body GNAT.AWK is
function Match function Match
(P : String_Pattern; (P : String_Pattern;
Session : Session_Type) Session : Session_Type) return Boolean
return Boolean
is is
begin begin
return P.Str = Field (P.Rank, Session); return P.Str = Field (P.Rank, Session);
...@@ -427,8 +420,7 @@ package body GNAT.AWK is ...@@ -427,8 +420,7 @@ package body GNAT.AWK is
function Match function Match
(P : Regexp_Pattern; (P : Regexp_Pattern;
Session : Session_Type) Session : Session_Type) return Boolean
return Boolean
is is
use type Regpat.Match_Location; use type Regpat.Match_Location;
...@@ -444,8 +436,7 @@ package body GNAT.AWK is ...@@ -444,8 +436,7 @@ package body GNAT.AWK is
function Match function Match
(P : Callback_Pattern; (P : Callback_Pattern;
Session : Session_Type) Session : Session_Type) return Boolean
return Boolean
is is
pragma Unreferenced (Session); pragma Unreferenced (Session);
...@@ -664,14 +655,13 @@ package body GNAT.AWK is ...@@ -664,14 +655,13 @@ package body GNAT.AWK is
------------------- -------------------
function Apply_Filters function Apply_Filters
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Boolean
return Boolean
is is
Filters : Pattern_Action_Table.Instance renames Session.Data.Filters; Filters : Pattern_Action_Table.Instance renames Session.Data.Filters;
Results : Boolean := False; Results : Boolean := False;
begin begin
-- Iterate through the filters table, if pattern match call action. -- Iterate through the filters table, if pattern match call action
for F in 1 .. Pattern_Action_Table.Last (Filters) loop for F in 1 .. Pattern_Action_Table.Last (Filters) loop
if Patterns.Match (Filters.Table (F).Pattern.all, Session) then if Patterns.Match (Filters.Table (F).Pattern.all, Session) then
...@@ -748,8 +738,7 @@ package body GNAT.AWK is ...@@ -748,8 +738,7 @@ package body GNAT.AWK is
function Discrete_Field function Discrete_Field
(Rank : Count; (Rank : Count;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session) return Discrete
return Discrete
is is
begin begin
return Discrete'Value (Field (Rank, Session)); return Discrete'Value (Field (Rank, Session));
...@@ -760,8 +749,7 @@ package body GNAT.AWK is ...@@ -760,8 +749,7 @@ package body GNAT.AWK is
----------------- -----------------
function End_Of_Data function End_Of_Data
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Boolean
return Boolean
is is
begin begin
return Session.Data.File_Index = File_Table.Last (Session.Data.Files) return Session.Data.File_Index = File_Table.Last (Session.Data.Files)
...@@ -773,8 +761,7 @@ package body GNAT.AWK is ...@@ -773,8 +761,7 @@ package body GNAT.AWK is
----------------- -----------------
function End_Of_File function End_Of_File
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Boolean
return Boolean
is is
begin begin
return Text_IO.End_Of_File (Session.Data.Current_File); return Text_IO.End_Of_File (Session.Data.Current_File);
...@@ -786,8 +773,7 @@ package body GNAT.AWK is ...@@ -786,8 +773,7 @@ package body GNAT.AWK is
function Field function Field
(Rank : Count; (Rank : Count;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session) return String
return String
is is
Fields : Field_Table.Instance renames Session.Data.Fields; Fields : Field_Table.Instance renames Session.Data.Fields;
...@@ -800,7 +786,7 @@ package body GNAT.AWK is ...@@ -800,7 +786,7 @@ package body GNAT.AWK is
elsif Rank = 0 then elsif Rank = 0 then
-- Returns the whole line, this is what $0 does under Session_Type. -- Returns the whole line, this is what $0 does under Session_Type
return To_String (Session.Data.Current_Line); return To_String (Session.Data.Current_Line);
...@@ -813,8 +799,7 @@ package body GNAT.AWK is ...@@ -813,8 +799,7 @@ package body GNAT.AWK is
function Field function Field
(Rank : Count; (Rank : Count;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session) return Integer
return Integer
is is
begin begin
return Integer'Value (Field (Rank, Session)); return Integer'Value (Field (Rank, Session));
...@@ -830,8 +815,7 @@ package body GNAT.AWK is ...@@ -830,8 +815,7 @@ package body GNAT.AWK is
function Field function Field
(Rank : Count; (Rank : Count;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session) return Float
return Float
is is
begin begin
return Float'Value (Field (Rank, Session)); return Float'Value (Field (Rank, Session));
...@@ -850,8 +834,7 @@ package body GNAT.AWK is ...@@ -850,8 +834,7 @@ package body GNAT.AWK is
---------- ----------
function File function File
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return String
return String
is is
Files : File_Table.Instance renames Session.Data.Files; Files : File_Table.Instance renames Session.Data.Files;
...@@ -942,8 +925,7 @@ package body GNAT.AWK is ...@@ -942,8 +925,7 @@ package body GNAT.AWK is
---------------------- ----------------------
function Number_Of_Fields function Number_Of_Fields
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Count
return Count
is is
begin begin
return Count (Field_Table.Last (Session.Data.Fields)); return Count (Field_Table.Last (Session.Data.Fields));
...@@ -954,8 +936,7 @@ package body GNAT.AWK is ...@@ -954,8 +936,7 @@ package body GNAT.AWK is
-------------------------- --------------------------
function Number_Of_File_Lines function Number_Of_File_Lines
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Count
return Count
is is
begin begin
return Count (Session.Data.FNR); return Count (Session.Data.FNR);
...@@ -966,8 +947,7 @@ package body GNAT.AWK is ...@@ -966,8 +947,7 @@ package body GNAT.AWK is
--------------------- ---------------------
function Number_Of_Files function Number_Of_Files
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Natural
return Natural
is is
Files : File_Table.Instance renames Session.Data.Files; Files : File_Table.Instance renames Session.Data.Files;
...@@ -980,8 +960,7 @@ package body GNAT.AWK is ...@@ -980,8 +960,7 @@ package body GNAT.AWK is
--------------------- ---------------------
function Number_Of_Lines function Number_Of_Lines
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Count
return Count
is is
begin begin
return Count (Session.Data.NR); return Count (Session.Data.NR);
...@@ -1078,7 +1057,7 @@ package body GNAT.AWK is ...@@ -1078,7 +1057,7 @@ package body GNAT.AWK is
Session : Session_Type) Session : Session_Type)
is is
function Filename return String; function Filename return String;
-- Returns current filename and "??" if the informations is not -- Returns current filename and "??" if this information is not
-- available. -- available.
function Line return String; function Line return String;
...@@ -1090,7 +1069,6 @@ package body GNAT.AWK is ...@@ -1090,7 +1069,6 @@ package body GNAT.AWK is
function Filename return String is function Filename return String is
File : constant String := AWK.File (Session); File : constant String := AWK.File (Session);
begin begin
if File = "" then if File = "" then
return "??"; return "??";
...@@ -1105,7 +1083,6 @@ package body GNAT.AWK is ...@@ -1105,7 +1083,6 @@ package body GNAT.AWK is
function Line return String is function Line return String is
L : constant String := Natural'Image (Session.Data.FNR); L : constant String := Natural'Image (Session.Data.FNR);
begin begin
return L (2 .. L'Last); return L (2 .. L'Last);
end Line; end Line;
...@@ -1132,6 +1109,10 @@ package body GNAT.AWK is ...@@ -1132,6 +1109,10 @@ package body GNAT.AWK is
NR : Natural renames Session.Data.NR; NR : Natural renames Session.Data.NR;
FNR : Natural renames Session.Data.FNR; FNR : Natural renames Session.Data.FNR;
---------------
-- Read_Line --
---------------
function Read_Line return String is function Read_Line return String is
Buffer : String (1 .. 1_024); Buffer : String (1 .. 1_024);
Last : Natural; Last : Natural;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2000-2003 Ada Core Technologies, Inc. -- -- Copyright (C) 2000-2005 Ada Core Technologies, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -187,31 +187,30 @@ with GNAT.Regpat; ...@@ -187,31 +187,30 @@ with GNAT.Regpat;
package GNAT.AWK is package GNAT.AWK is
Session_Error : exception; Session_Error : exception;
-- Raised when a Session is reused but is not closed. -- Raised when a Session is reused but is not closed
File_Error : exception; File_Error : exception;
-- Raised when there is a file problem (see below). -- Raised when there is a file problem (see below)
End_Error : exception; End_Error : exception;
-- Raised when an attempt is made to read beyond the end of the last -- Raised when an attempt is made to read beyond the end of the last
-- file of a session. -- file of a session.
Field_Error : exception; Field_Error : exception;
-- Raised when accessing a field value which does not exist. -- Raised when accessing a field value which does not exist
Data_Error : exception; Data_Error : exception;
-- Raised when it is not possible to convert a field value to a specific -- Raised when it is impossible to convert a field value to a specific type
-- type.
type Count is new Natural; type Count is new Natural;
type Widths_Set is array (Positive range <>) of Positive; type Widths_Set is array (Positive range <>) of Positive;
-- Used to store a set of columns widths. -- Used to store a set of columns widths
Default_Separators : constant String := " " & ASCII.HT; Default_Separators : constant String := " " & ASCII.HT;
Use_Current : constant String := ""; Use_Current : constant String := "";
-- Value used when no separator or filename is specified in iterators. -- Value used when no separator or filename is specified in iterators
type Session_Type is limited private; type Session_Type is limited private;
-- This is the main exported type. A session is used to keep the state of -- This is the main exported type. A session is used to keep the state of
...@@ -256,7 +255,7 @@ package GNAT.AWK is ...@@ -256,7 +255,7 @@ package GNAT.AWK is
(Separators : String := Default_Separators; (Separators : String := Default_Separators;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session)
renames Set_Field_Separators; renames Set_Field_Separators;
-- FS is the AWK abbreviation for above service. -- FS is the AWK abbreviation for above service
procedure Set_Field_Widths procedure Set_Field_Widths
(Field_Widths : Widths_Set; (Field_Widths : Widths_Set;
...@@ -294,54 +293,44 @@ package GNAT.AWK is ...@@ -294,54 +293,44 @@ package GNAT.AWK is
------------------------------------- -------------------------------------
function Number_Of_Fields function Number_Of_Fields
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Count;
return Count;
pragma Inline (Number_Of_Fields); pragma Inline (Number_Of_Fields);
-- Returns the number of fields in the current record. It returns 0 when -- Returns the number of fields in the current record. It returns 0 when
-- no file is being processed. -- no file is being processed.
function NF function NF
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Count
return Count
renames Number_Of_Fields; renames Number_Of_Fields;
-- AWK abbreviation for above service. -- AWK abbreviation for above service
function Number_Of_File_Lines function Number_Of_File_Lines
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Count;
return Count;
pragma Inline (Number_Of_File_Lines); pragma Inline (Number_Of_File_Lines);
-- Returns the current line number in the processed file. It returns 0 when -- Returns the current line number in the processed file. It returns 0 when
-- no file is being processed. -- no file is being processed.
function FNR function FNR (Session : Session_Type := Current_Session) return Count
(Session : Session_Type := Current_Session) renames Number_Of_File_Lines;
return Count renames Number_Of_File_Lines; -- AWK abbreviation for above service
-- AWK abbreviation for above service.
function Number_Of_Lines function Number_Of_Lines
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Count;
return Count;
pragma Inline (Number_Of_Lines); pragma Inline (Number_Of_Lines);
-- Returns the number of line processed until now. This is equal to number -- Returns the number of line processed until now. This is equal to number
-- of line in each already processed file plus FNR. It returns 0 when -- of line in each already processed file plus FNR. It returns 0 when
-- no file is being processed. -- no file is being processed.
function NR function NR (Session : Session_Type := Current_Session) return Count
(Session : Session_Type := Current_Session)
return Count
renames Number_Of_Lines; renames Number_Of_Lines;
-- AWK abbreviation for above service. -- AWK abbreviation for above service
function Number_Of_Files function Number_Of_Files
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Natural;
return Natural;
pragma Inline (Number_Of_Files); pragma Inline (Number_Of_Files);
-- Returns the number of files associated with Session. This is the total -- Returns the number of files associated with Session. This is the total
-- number of files added with Add_File and Add_Files services. -- number of files added with Add_File and Add_Files services.
function File function File (Session : Session_Type := Current_Session) return String;
(Session : Session_Type := Current_Session)
return String;
-- Returns the name of the file being processed. It returns the empty -- Returns the name of the file being processed. It returns the empty
-- string when no file is being processed. -- string when no file is being processed.
...@@ -351,24 +340,21 @@ package GNAT.AWK is ...@@ -351,24 +340,21 @@ package GNAT.AWK is
function Field function Field
(Rank : Count; (Rank : Count;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session) return String;
return String;
-- Returns field number Rank value of the current record. If Rank = 0 it -- Returns field number Rank value of the current record. If Rank = 0 it
-- returns the current record (i.e. the line as read in the file). It -- returns the current record (i.e. the line as read in the file). It
-- raises Field_Error if Rank > NF or if Session is not open. -- raises Field_Error if Rank > NF or if Session is not open.
function Field function Field
(Rank : Count; (Rank : Count;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session) return Integer;
return Integer;
-- Returns field number Rank value of the current record as an integer. It -- Returns field number Rank value of the current record as an integer. It
-- raises Field_Error if Rank > NF or if Session is not open. It -- raises Field_Error if Rank > NF or if Session is not open. It
-- raises Data_Error if the field value cannot be converted to an integer. -- raises Data_Error if the field value cannot be converted to an integer.
function Field function Field
(Rank : Count; (Rank : Count;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session) return Float;
return Float;
-- Returns field number Rank value of the current record as a float. It -- Returns field number Rank value of the current record as a float. It
-- raises Field_Error if Rank > NF or if Session is not open. It -- raises Field_Error if Rank > NF or if Session is not open. It
-- raises Data_Error if the field value cannot be converted to a float. -- raises Data_Error if the field value cannot be converted to a float.
...@@ -377,8 +363,7 @@ package GNAT.AWK is ...@@ -377,8 +363,7 @@ package GNAT.AWK is
type Discrete is (<>); type Discrete is (<>);
function Discrete_Field function Discrete_Field
(Rank : Count; (Rank : Count;
Session : Session_Type := Current_Session) Session : Session_Type := Current_Session) return Discrete;
return Discrete;
-- Returns field number Rank value of the current record as a type -- Returns field number Rank value of the current record as a type
-- Discrete. It raises Field_Error if Rank > NF. It raises Data_Error if -- Discrete. It raises Field_Error if Rank > NF. It raises Data_Error if
-- the field value cannot be converted to type Discrete. -- the field value cannot be converted to type Discrete.
...@@ -527,16 +512,14 @@ package GNAT.AWK is ...@@ -527,16 +512,14 @@ package GNAT.AWK is
-- or by an instantiation of For_Every_Line (see below). -- or by an instantiation of For_Every_Line (see below).
function End_Of_Data function End_Of_Data
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Boolean;
return Boolean;
pragma Inline (End_Of_Data); pragma Inline (End_Of_Data);
-- Returns True if there is no more data to be processed in Session. It -- Returns True if there is no more data to be processed in Session. It
-- means that the latest session's file is being processed and that -- means that the latest session's file is being processed and that
-- there is no more data to be read in this file (End_Of_File is True). -- there is no more data to be read in this file (End_Of_File is True).
function End_Of_File function End_Of_File
(Session : Session_Type := Current_Session) (Session : Session_Type := Current_Session) return Boolean;
return Boolean;
pragma Inline (End_Of_File); pragma Inline (End_Of_File);
-- Returns True when there is no more data to be processed on the current -- Returns True when there is no more data to be processed on the current
-- session's file. -- session's file.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2003 Ada Core Technologies, Inc. -- -- Copyright (C) 2003-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -44,35 +44,34 @@ with System; ...@@ -44,35 +44,34 @@ with System;
generic generic
type Element is private; type Element is private;
-- The type of the values contained within buffer objects -- The type of the values contained within buffer objects
package GNAT.Bounded_Buffers is package GNAT.Bounded_Buffers is
pragma Pure; pragma Pure;
type Content is array (Positive range <>) of Element; type Content is array (Positive range <>) of Element;
-- Content is an internal artefact that cannot be hidden -- Content is an internal artefact that cannot be hidden because protected
-- because protected types cannot contain type declarations. -- types cannot contain type declarations.
Default_Ceiling : constant System.Priority := System.Default_Priority; Default_Ceiling : constant System.Priority := System.Default_Priority;
-- A convenience value for the Ceiling discriminant. -- A convenience value for the Ceiling discriminant
protected type Bounded_Buffer protected type Bounded_Buffer
(Capacity : Positive; (Capacity : Positive;
-- Objects of type Bounded_Buffer specify the maximum -- Objects of type Bounded_Buffer specify the maximum number of Element
-- number of Element values they can hold via the -- values they can hold via the discriminant Capacity.
-- discriminant Capacity.
Ceiling : System.Priority) Ceiling : System.Priority)
-- Users must specify the ceiling priority for the object. -- Users must specify the ceiling priority for the object. If the
-- If the Real-Time Systems Annex is not in use this value -- Real-Time Systems Annex is not in use this value is not important.
-- is not important.
is is
pragma Priority (Ceiling); pragma Priority (Ceiling);
entry Insert (Item : in Element); entry Insert (Item : in Element);
-- Insert Item into the buffer. Blocks caller -- Insert Item into the buffer, blocks caller until space is available
-- until space is available.
entry Remove (Item : out Element); entry Remove (Item : out Element);
-- Remove next available Element from buffer. -- Remove next available Element from buffer. Blocks caller until an
-- Blocks caller until an Element is available. -- Element is available.
function Empty return Boolean; function Empty return Boolean;
-- Returns whether the instance contains any Elements. -- Returns whether the instance contains any Elements.
...@@ -89,13 +88,16 @@ package GNAT.Bounded_Buffers is ...@@ -89,13 +88,16 @@ package GNAT.Bounded_Buffers is
private private
Values : Content (1 .. Capacity); Values : Content (1 .. Capacity);
-- The container for the values held by the buffer instance. -- The container for the values held by the buffer instance
Next_In : Positive := 1; Next_In : Positive := 1;
-- The index of the next Element inserted. Wraps around. -- The index of the next Element inserted. Wraps around
Next_Out : Positive := 1; Next_Out : Positive := 1;
-- The index of the next Element removed. Wraps around. -- The index of the next Element removed. Wraps around
Count : Natural := 0; Count : Natural := 0;
-- The number of Elements currently held. -- The number of Elements currently held
end Bounded_Buffer; end Bounded_Buffer;
end GNAT.Bounded_Buffers; end GNAT.Bounded_Buffers;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
-- has the advantage of being Pure, while this unit can only be Preelaborate. -- has the advantage of being Pure, while this unit can only be Preelaborate.
package GNAT.Bubble_Sort is package GNAT.Bubble_Sort is
pragma Preelaborate (Bubble_Sort); pragma Preelaborate;
-- The data to be sorted is assumed to be indexed by integer values from -- The data to be sorted is assumed to be indexed by integer values from
-- 1 to N, where N is the number of items to be sorted. -- 1 to N, where N is the number of items to be sorted.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
-- offers a similar routine with a more convenient interface. -- offers a similar routine with a more convenient interface.
package GNAT.Bubble_Sort_A is package GNAT.Bubble_Sort_A is
pragma Preelaborate (Bubble_Sort_A); pragma Preelaborate;
-- The data to be sorted is assumed to be indexed by integer values from -- The data to be sorted is assumed to be indexed by integer values from
-- 1 to N, where N is the number of items to be sorted. In addition, the -- 1 to N, where N is the number of items to be sorted. In addition, the
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -63,7 +63,7 @@ generic ...@@ -63,7 +63,7 @@ generic
-- item is greater than or equal to the Op1 item. -- item is greater than or equal to the Op1 item.
package GNAT.Bubble_Sort_G is package GNAT.Bubble_Sort_G is
pragma Pure (Bubble_Sort_G); pragma Pure;
procedure Sort (N : Natural); procedure Sort (N : Natural);
-- This procedures sorts items in the range from 1 to N into ascending -- This procedures sorts items in the range from 1 to N into ascending
......
...@@ -96,8 +96,7 @@ package body GNAT.Calendar is ...@@ -96,8 +96,7 @@ package body GNAT.Calendar is
function Julian_Day function Julian_Day
(Year : Year_Number; (Year : Year_Number;
Month : Month_Number; Month : Month_Number;
Day : Day_Number) Day : Day_Number) return Integer
return Integer
is is
Internal_Year : Integer; Internal_Year : Integer;
Internal_Month : Integer; Internal_Month : Integer;
...@@ -227,8 +226,7 @@ package body GNAT.Calendar is ...@@ -227,8 +226,7 @@ package body GNAT.Calendar is
Hour : Hour_Number; Hour : Hour_Number;
Minute : Minute_Number; Minute : Minute_Number;
Second : Second_Number; Second : Second_Number;
Sub_Second : Second_Duration := 0.0) Sub_Second : Second_Duration := 0.0) return Time
return Time
is is
Dsecs : constant Day_Duration := Dsecs : constant Day_Duration :=
Day_Duration (Hour * 3600 + Minute * 60 + Second) + Day_Duration (Hour * 3600 + Minute * 60 + Second) +
...@@ -291,8 +289,7 @@ package body GNAT.Calendar is ...@@ -291,8 +289,7 @@ package body GNAT.Calendar is
------------------ ------------------
function Week_In_Year function Week_In_Year
(Date : Ada.Calendar.Time) (Date : Ada.Calendar.Time) return Week_In_Year_Number
return Week_In_Year_Number
is is
Year : Year_Number; Year : Year_Number;
Month : Month_Number; Month : Month_Number;
...@@ -306,7 +303,7 @@ package body GNAT.Calendar is ...@@ -306,7 +303,7 @@ package body GNAT.Calendar is
begin begin
Split (Date, Year, Month, Day, Hour, Minute, Second, Sub_Second); Split (Date, Year, Month, Day, Hour, Minute, Second, Sub_Second);
-- Day offset number for the first week of the year. -- Day offset number for the first week of the year
Offset := Julian_Day (Year, 1, 1) mod 7; Offset := Julian_Day (Year, 1, 1) mod 7;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1999-2001 Free Software Foundation, Inc. -- -- Copyright (C) 1999-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -65,7 +65,7 @@ package GNAT.Calendar is ...@@ -65,7 +65,7 @@ package GNAT.Calendar is
-- Second_Duration precision depends on the target clock precision. -- Second_Duration precision depends on the target clock precision.
function Day_Of_Week (Date : Ada.Calendar.Time) return Day_Name; function Day_Of_Week (Date : Ada.Calendar.Time) return Day_Name;
-- Return the day name. -- Return the day name
function Day_In_Year (Date : Ada.Calendar.Time) return Day_In_Year_Number; function Day_In_Year (Date : Ada.Calendar.Time) return Day_In_Year_Number;
-- Returns the day number in the year. (1st January is day 1 and 31st -- Returns the day number in the year. (1st January is day 1 and 31st
...@@ -93,9 +93,8 @@ package GNAT.Calendar is ...@@ -93,9 +93,8 @@ package GNAT.Calendar is
Hour : Hour_Number; Hour : Hour_Number;
Minute : Minute_Number; Minute : Minute_Number;
Second : Second_Number; Second : Second_Number;
Sub_Second : Second_Duration := 0.0) Sub_Second : Second_Duration := 0.0) return Ada.Calendar.Time;
return Ada.Calendar.Time; -- Returns an Ada.Calendar.Time data built from the date and time values
-- Returns an Ada.Calendar.Time data built from the date and time values.
-- C timeval conversion -- C timeval conversion
...@@ -119,11 +118,11 @@ private ...@@ -119,11 +118,11 @@ private
function Julian_Day function Julian_Day
(Year : Ada.Calendar.Year_Number; (Year : Ada.Calendar.Year_Number;
Month : Ada.Calendar.Month_Number; Month : Ada.Calendar.Month_Number;
Day : Ada.Calendar.Day_Number) Day : Ada.Calendar.Day_Number) return Integer;
return Integer; -- Compute Julian day number
-- Compute Julian day number.
-- --
-- The code of this function is a modified version of algorithm -- The code of this function is a modified version of algorithm 199 from
-- 199 from the Collected Algorithms of the ACM. -- the Collected Algorithms of the ACM. The author of algorithm 199 is
-- The author of algorithm 199 is Robert G. Tantzen. -- Robert G. Tantzen.
end GNAT.Calendar; end GNAT.Calendar;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -43,13 +43,12 @@ ...@@ -43,13 +43,12 @@
with System.Case_Util; with System.Case_Util;
package GNAT.Case_Util is package GNAT.Case_Util is
pragma Pure (Case_Util); pragma Pure;
pragma Elaborate_Body;
pragma Elaborate_Body; -- The elaborate body is because we have a dummy body to deal with
-- The elaborate body is because we have a dummy body to deal with bootstrap -- bootstrap path problems (we used to have a real body, and now we don't
-- path problems (we used to have a real body, and now we don't need it any -- need it any more, but the bootstrap requires that we have a dummy body,
-- more, but the bootstrap requires that we have a dummy body, since otherwise -- since otherwise the old body gets picked up.
-- the old body gets picked up.
-- Note: all the following functions handle the full Latin-1 set -- Note: all the following functions handle the full Latin-1 set
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1999-2003 Ada Core Technologies, Inc. -- -- Copyright (C) 1999-2005 Ada Core Technologies, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -63,10 +63,10 @@ package body GNAT.Calendar.Time_IO is ...@@ -63,10 +63,10 @@ package body GNAT.Calendar.Time_IO is
----------------------- -----------------------
function Am_Pm (H : Natural) return String; function Am_Pm (H : Natural) return String;
-- return AM or PM depending on the hour H -- Return AM or PM depending on the hour H
function Hour_12 (H : Natural) return Positive; function Hour_12 (H : Natural) return Positive;
-- Convert a 1-24h format to a 0-12 hour format. -- Convert a 1-24h format to a 0-12 hour format
function Image (Str : String; Length : Natural := 0) return String; function Image (Str : String; Length : Natural := 0) return String;
-- Return Str capitalized and cut to length number of characters. If -- Return Str capitalized and cut to length number of characters. If
...@@ -75,18 +75,15 @@ package body GNAT.Calendar.Time_IO is ...@@ -75,18 +75,15 @@ package body GNAT.Calendar.Time_IO is
function Image function Image
(N : Long_Integer; (N : Long_Integer;
Padding : Padding_Mode := Zero; Padding : Padding_Mode := Zero;
Length : Natural := 0) Length : Natural := 0) return String;
return String; -- Return image of N. This number is eventually padded with zeros or spaces
-- Return image of N. This number is eventually padded with zeros or -- depending of the length required. If length is 0 then no padding occurs.
-- spaces depending of the length required. If length is 0 then no padding
-- occurs.
function Image function Image
(N : Integer; (N : Integer;
Padding : Padding_Mode := Zero; Padding : Padding_Mode := Zero;
Length : Natural := 0) Length : Natural := 0) return String;
return String; -- As above with N provided in Integer format
-- As above with N provided in Integer format.
----------- -----------
-- Am_Pm -- -- Am_Pm --
...@@ -122,8 +119,7 @@ package body GNAT.Calendar.Time_IO is ...@@ -122,8 +119,7 @@ package body GNAT.Calendar.Time_IO is
function Image function Image
(Str : String; (Str : String;
Length : Natural := 0) Length : Natural := 0) return String
return String
is is
use Ada.Characters.Handling; use Ada.Characters.Handling;
Local : constant String := Local : constant String :=
...@@ -144,8 +140,7 @@ package body GNAT.Calendar.Time_IO is ...@@ -144,8 +140,7 @@ package body GNAT.Calendar.Time_IO is
function Image function Image
(N : Integer; (N : Integer;
Padding : Padding_Mode := Zero; Padding : Padding_Mode := Zero;
Length : Natural := 0) Length : Natural := 0) return String
return String
is is
begin begin
return Image (Long_Integer (N), Padding, Length); return Image (Long_Integer (N), Padding, Length);
...@@ -154,8 +149,7 @@ package body GNAT.Calendar.Time_IO is ...@@ -154,8 +149,7 @@ package body GNAT.Calendar.Time_IO is
function Image function Image
(N : Long_Integer; (N : Long_Integer;
Padding : Padding_Mode := Zero; Padding : Padding_Mode := Zero;
Length : Natural := 0) Length : Natural := 0) return String
return String
is is
function Pad_Char return String; function Pad_Char return String;
...@@ -192,13 +186,12 @@ package body GNAT.Calendar.Time_IO is ...@@ -192,13 +186,12 @@ package body GNAT.Calendar.Time_IO is
function Image function Image
(Date : Ada.Calendar.Time; (Date : Ada.Calendar.Time;
Picture : Picture_String) Picture : Picture_String) return String
return String
is is
Padding : Padding_Mode := Zero; Padding : Padding_Mode := Zero;
-- Padding is set for one directive -- Padding is set for one directive
Result : Unbounded_String; Result : Unbounded_String;
Year : Year_Number; Year : Year_Number;
Month : Month_Number; Month : Month_Number;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1999-2003 Ada Core Technologies, Inc. -- -- Copyright (C) 1999-2005, AdaCore --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -116,16 +116,15 @@ package GNAT.Calendar.Time_IO is ...@@ -116,16 +116,15 @@ package GNAT.Calendar.Time_IO is
function Image function Image
(Date : Ada.Calendar.Time; (Date : Ada.Calendar.Time;
Picture : Picture_String) Picture : Picture_String) return String;
return String; -- Return Date as a string with format Picture. Raise Picture_Error if
-- Return Date as a string with format Picture. -- picture string is wrong.
-- raise Picture_Error if picture string is wrong
procedure Put_Time procedure Put_Time
(Date : Ada.Calendar.Time; (Date : Ada.Calendar.Time;
Picture : Picture_String); Picture : Picture_String);
-- Put Date with format Picture. -- Put Date with format Picture. Raise Picture_Error if picture string is
-- raise Picture_Error if picture string is wrong -- wrong
private private
ISO_Date : constant Picture_String := "%Y-%m-%d"; ISO_Date : constant Picture_String := "%Y-%m-%d";
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001 Ada Core Technologies, Inc. -- -- Copyright (C) 2001-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -50,10 +50,10 @@ package body GNAT.CGI is ...@@ -50,10 +50,10 @@ package body GNAT.CGI is
-- services exported by this unit. -- services exported by this unit.
Current_Method : Method_Type; Current_Method : Method_Type;
-- This is the current method used to pass CGI parameters. -- This is the current method used to pass CGI parameters
Header_Sent : Boolean := False; Header_Sent : Boolean := False;
-- Will be set to True when the header will be sent. -- Will be set to True when the header will be sent
-- Key/Value table declaration -- Key/Value table declaration
...@@ -72,7 +72,7 @@ package body GNAT.CGI is ...@@ -72,7 +72,7 @@ package body GNAT.CGI is
procedure Check_Environment; procedure Check_Environment;
pragma Inline (Check_Environment); pragma Inline (Check_Environment);
-- This procedure will raise Data_Error if Valid_Environment is False. -- This procedure will raise Data_Error if Valid_Environment is False
procedure Initialize; procedure Initialize;
-- Initialize CGI package by reading the runtime environment. This -- Initialize CGI package by reading the runtime environment. This
...@@ -178,7 +178,7 @@ package body GNAT.CGI is ...@@ -178,7 +178,7 @@ package body GNAT.CGI is
-- for the data is passed in CONTENT_LENGTH environment variable. -- for the data is passed in CONTENT_LENGTH environment variable.
procedure Set_Parameter_Table (Data : String); procedure Set_Parameter_Table (Data : String);
-- Parse the parameter data and set the parameter table. -- Parse the parameter data and set the parameter table
-------------------- --------------------
-- Initialize_GET -- -- Initialize_GET --
...@@ -328,7 +328,7 @@ package body GNAT.CGI is ...@@ -328,7 +328,7 @@ package body GNAT.CGI is
Required : Boolean := False) return String Required : Boolean := False) return String
is is
function Get_Environment (Variable_Name : String) return String; function Get_Environment (Variable_Name : String) return String;
-- Returns the environment variable content. -- Returns the environment variable content
--------------------- ---------------------
-- Get_Environment -- -- Get_Environment --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2000-2003 Ada Core Technologies, Inc. -- -- Copyright (C) 2000-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -115,7 +115,7 @@ package GNAT.CGI is ...@@ -115,7 +115,7 @@ package GNAT.CGI is
-- and will be raised when calling any services below (except for Ok). -- and will be raised when calling any services below (except for Ok).
Parameter_Not_Found : exception; Parameter_Not_Found : exception;
-- This exception is raised when a specific parameter is not found. -- This exception is raised when a specific parameter is not found
Default_Header : constant String := "Content-type: text/html"; Default_Header : constant String := "Content-type: text/html";
-- This is the default header returned by Put_Header. If the CGI program -- This is the default header returned by Put_Header. If the CGI program
...@@ -186,12 +186,11 @@ package GNAT.CGI is ...@@ -186,12 +186,11 @@ package GNAT.CGI is
-- the exception Data_Error. -- the exception Data_Error.
function Method return Method_Type; function Method return Method_Type;
-- Returns the method used to call the CGI. -- Returns the method used to call the CGI
function Metavariable function Metavariable
(Name : Metavariable_Name; (Name : Metavariable_Name;
Required : Boolean := False) Required : Boolean := False) return String;
return String;
-- Returns parameter Name value. Returns the null string if Name -- Returns parameter Name value. Returns the null string if Name
-- environment variable is not defined or raises Data_Error if -- environment variable is not defined or raises Data_Error if
-- Required is set to True. -- Required is set to True.
...@@ -215,8 +214,7 @@ package GNAT.CGI is ...@@ -215,8 +214,7 @@ package GNAT.CGI is
function Value function Value
(Key : String; (Key : String;
Required : Boolean := False) Required : Boolean := False) return String;
return String;
-- Returns the parameter value associated to the parameter named Key. -- Returns the parameter value associated to the parameter named Key.
-- If parameter does not exist, returns an empty string if Required -- If parameter does not exist, returns an empty string if Required
-- is False and raises the exception Parameter_Not_Found otherwise. -- is False and raises the exception Parameter_Not_Found otherwise.
...@@ -227,7 +225,7 @@ package GNAT.CGI is ...@@ -227,7 +225,7 @@ package GNAT.CGI is
-- (i.e. Position > Argument_Count) -- (i.e. Position > Argument_Count)
function Key_Exists (Key : String) return Boolean; function Key_Exists (Key : String) return Boolean;
-- Returns True if the parameter named Key existx and False otherwise. -- Returns True if the parameter named Key exists and False otherwise
function Key (Position : Positive) return String; function Key (Position : Positive) return String;
-- Returns the parameter key associated with the CGI parameter number -- Returns the parameter key associated with the CGI parameter number
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2000-2003 Ada Core Technologies, Inc. -- -- Copyright (C) 2000-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -43,12 +43,12 @@ package body GNAT.CGI.Cookie is ...@@ -43,12 +43,12 @@ package body GNAT.CGI.Cookie is
use Ada; use Ada;
Valid_Environment : Boolean := False; Valid_Environment : Boolean := False;
-- This boolean will be set to True if the initialization was fine. -- This boolean will be set to True if the initialization was fine
Header_Sent : Boolean := False; Header_Sent : Boolean := False;
-- Will be set to True when the header will be sent. -- Will be set to True when the header will be sent
-- Cookie data that have been added. -- Cookie data that has been added
type String_Access is access String; type String_Access is access String;
...@@ -67,14 +67,14 @@ package body GNAT.CGI.Cookie is ...@@ -67,14 +67,14 @@ package body GNAT.CGI.Cookie is
end record; end record;
package Cookie_Table is new Table (Cookie_Data, Positive, 1, 5, 50); package Cookie_Table is new Table (Cookie_Data, Positive, 1, 5, 50);
-- This is the table to keep all cookies to be sent back to the server. -- This is the table to keep all cookies to be sent back to the server
package Key_Value_Table is new Table (Key_Value, Positive, 1, 1, 50); package Key_Value_Table is new Table (Key_Value, Positive, 1, 1, 50);
-- This is the table to keep all cookies received from the server. -- This is the table to keep all cookies received from the server
procedure Check_Environment; procedure Check_Environment;
pragma Inline (Check_Environment); pragma Inline (Check_Environment);
-- This procedure will raise Data_Error if Valid_Environment is False. -- This procedure will raise Data_Error if Valid_Environment is False
procedure Initialize; procedure Initialize;
-- Initialize CGI package by reading the runtime environment. This -- Initialize CGI package by reading the runtime environment. This
...@@ -149,7 +149,7 @@ package body GNAT.CGI.Cookie is ...@@ -149,7 +149,7 @@ package body GNAT.CGI.Cookie is
HTTP_COOKIE : constant String := Metavariable (CGI.HTTP_Cookie); HTTP_COOKIE : constant String := Metavariable (CGI.HTTP_Cookie);
procedure Set_Parameter_Table (Data : String); procedure Set_Parameter_Table (Data : String);
-- Parse Data and insert information in Key_Value_Table. -- Parse Data and insert information in Key_Value_Table
------------------------- -------------------------
-- Set_Parameter_Table -- -- Set_Parameter_Table --
...@@ -161,8 +161,8 @@ package body GNAT.CGI.Cookie is ...@@ -161,8 +161,8 @@ package body GNAT.CGI.Cookie is
-- Add a single parameter into the table at index K. The parameter -- Add a single parameter into the table at index K. The parameter
-- format is "key=value". -- format is "key=value".
Count : constant Positive Count : constant Positive :=
:= 1 + Strings.Fixed.Count (Data, Strings.Maps.To_Set (";")); 1 + Strings.Fixed.Count (Data, Strings.Maps.To_Set (";"));
-- Count is the number of parameters in the string. Parameters are -- Count is the number of parameters in the string. Parameters are
-- separated by ampersand character. -- separated by ampersand character.
...@@ -185,6 +185,8 @@ package body GNAT.CGI.Cookie is ...@@ -185,6 +185,8 @@ package body GNAT.CGI.Cookie is
end if; end if;
end Add_Parameter; end Add_Parameter;
-- Start of processing for Set_Parameter_Table
begin begin
Key_Value_Table.Set_Last (Count); Key_Value_Table.Set_Last (Count);
...@@ -196,11 +198,13 @@ package body GNAT.CGI.Cookie is ...@@ -196,11 +198,13 @@ package body GNAT.CGI.Cookie is
Index := Sep + 2; Index := Sep + 2;
end loop; end loop;
-- add last parameter -- Add last parameter
Add_Parameter (Count, Data (Index .. Data'Last)); Add_Parameter (Count, Data (Index .. Data'Last));
end Set_Parameter_Table; end Set_Parameter_Table;
-- Start of processing for Initialize
begin begin
if HTTP_COOKIE /= "" then if HTTP_COOKIE /= "" then
Set_Parameter_Table (HTTP_COOKIE); Set_Parameter_Table (HTTP_COOKIE);
...@@ -245,7 +249,6 @@ package body GNAT.CGI.Cookie is ...@@ -245,7 +249,6 @@ package body GNAT.CGI.Cookie is
(Header : String := Default_Header; (Header : String := Default_Header;
Force : Boolean := False) Force : Boolean := False)
is is
procedure Output_Cookies; procedure Output_Cookies;
-- Iterate through the list of cookies to be sent to the server -- Iterate through the list of cookies to be sent to the server
-- and output them. -- and output them.
...@@ -264,7 +267,7 @@ package body GNAT.CGI.Cookie is ...@@ -264,7 +267,7 @@ package body GNAT.CGI.Cookie is
Max_Age : Natural; Max_Age : Natural;
Path : String; Path : String;
Secure : Boolean); Secure : Boolean);
-- Output one cookie in the CGI header. -- Output one cookie in the CGI header
----------------------- -----------------------
-- Output_One_Cookie -- -- Output_One_Cookie --
...@@ -344,7 +347,8 @@ package body GNAT.CGI.Cookie is ...@@ -344,7 +347,8 @@ package body GNAT.CGI.Cookie is
Domain : String := ""; Domain : String := "";
Max_Age : Natural := Natural'Last; Max_Age : Natural := Natural'Last;
Path : String := "/"; Path : String := "/";
Secure : Boolean := False) is Secure : Boolean := False)
is
begin begin
Cookie_Table.Increment_Last; Cookie_Table.Increment_Last;
...@@ -364,8 +368,7 @@ package body GNAT.CGI.Cookie is ...@@ -364,8 +368,7 @@ package body GNAT.CGI.Cookie is
function Value function Value
(Key : String; (Key : String;
Required : Boolean := False) Required : Boolean := False) return String
return String
is is
begin begin
Check_Environment; Check_Environment;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2000-2001 Ada Core Technologies, Inc. -- -- Copyright (C) 2000-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
-- The complete CGI Cookie specification can be found in the RFC2109 at: -- The complete CGI Cookie specification can be found in the RFC2109 at:
-- http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt -- http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt
-- This package builds up data tables whose memory is not released. -- This package builds up data tables whose memory is not released. A CGI
-- A CGI program is expected to be a short lived program and so it -- program is expected to be a short lived program and so it is adequate to
-- is adequate to have the underlying OS free the program on exit. -- have the underlying OS free the program on exit.
package GNAT.CGI.Cookie is package GNAT.CGI.Cookie is
...@@ -50,7 +50,7 @@ package GNAT.CGI.Cookie is ...@@ -50,7 +50,7 @@ package GNAT.CGI.Cookie is
-- will be raised when calling any services below (except for Ok). -- will be raised when calling any services below (except for Ok).
Cookie_Not_Found : exception; Cookie_Not_Found : exception;
-- This exception is raised when a specific parameter is not found. -- This exception is raised when a specific parameter is not found
procedure Put_Header procedure Put_Header
(Header : String := Default_Header; (Header : String := Default_Header;
...@@ -67,33 +67,32 @@ package GNAT.CGI.Cookie is ...@@ -67,33 +67,32 @@ package GNAT.CGI.Cookie is
-- max_age=<max_age>; path=<path>[; secured] -- max_age=<max_age>; path=<path>[; secured]
function Ok return Boolean; function Ok return Boolean;
-- Returns True if the CGI cookie environment is valid and False -- Returns True if the CGI cookie environment is valid and False otherwise.
-- otherwise. Every service used when the CGI environment is not valid -- Every service used when the CGI environment is not valid will raise the
-- will raise the exception Data_Error. -- exception Data_Error.
function Count return Natural; function Count return Natural;
-- Returns the number of cookies received by the CGI. -- Returns the number of cookies received by the CGI
function Value function Value
(Key : String; (Key : String;
Required : Boolean := False) Required : Boolean := False) return String;
return String; -- Returns the cookie value associated with the cookie named Key. If cookie
-- Returns the cookie value associated with the cookie named Key. If -- does not exist, returns an empty string if Required is False and raises
-- cookie does not exist, returns an empty string if Required is -- the exception Cookie_Not_Found otherwise.
-- False and raises the exception Cookie_Not_Found otherwise.
function Value (Position : Positive) return String; function Value (Position : Positive) return String;
-- Returns the value associated with the cookie number Position -- Returns the value associated with the cookie number Position of the CGI.
-- of the CGI. It raises Cookie_Not_Found if there is no such -- It raises Cookie_Not_Found if there is no such cookie (i.e. Position >
-- cookie (i.e. Position > Count) -- Count)
function Exists (Key : String) return Boolean; function Exists (Key : String) return Boolean;
-- Returns True if the cookie named Key exist and False otherwise. -- Returns True if the cookie named Key exist and False otherwise
function Key (Position : Positive) return String; function Key (Position : Positive) return String;
-- Returns the key associated with the cookie number Position of -- Returns the key associated with the cookie number Position of the CGI.
-- the CGI. It raises Cookie_Not_Found if there is no such cookie -- It raises Cookie_Not_Found if there is no such cookie (i.e. Position >
-- (i.e. Position > Count) -- Count)
procedure Set procedure Set
(Key : String; (Key : String;
...@@ -103,8 +102,8 @@ package GNAT.CGI.Cookie is ...@@ -103,8 +102,8 @@ package GNAT.CGI.Cookie is
Max_Age : Natural := Natural'Last; Max_Age : Natural := Natural'Last;
Path : String := "/"; Path : String := "/";
Secure : Boolean := False); Secure : Boolean := False);
-- Add a cookie to the list of cookies. This will be sent back -- Add a cookie to the list of cookies. This will be sent back to the
-- to the server by the Put_Header service above. -- server by the Put_Header service above.
generic generic
with procedure with procedure
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2000-2001 Ada Core Technologies, Inc. -- -- Copyright (C) 2000-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -37,13 +37,11 @@ package body GNAT.CGI.Debug is ...@@ -37,13 +37,11 @@ package body GNAT.CGI.Debug is
use Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
-- -- Define the abstract type which act as a template for all debug IO modes.
-- Define the abstract type which act as a template for all debug IO mode.
-- To create a new IO mode you must: -- To create a new IO mode you must:
-- 1. create a new package spec -- 1. create a new package spec
-- 2. create a new type derived from IO.Format -- 2. create a new type derived from IO.Format
-- 3. implement all the abstract rountines in IO -- 3. implement all the abstract rountines in IO
--
package IO is package IO is
...@@ -54,51 +52,39 @@ package body GNAT.CGI.Debug is ...@@ -54,51 +52,39 @@ package body GNAT.CGI.Debug is
function Variable function Variable
(Mode : Format; (Mode : Format;
Name : String; Name : String;
Value : String) Value : String) return String is abstract;
return String -- Returns variable Name and its associated value
is abstract;
-- Returns variable Name and its associated value. function New_Line (Mode : Format) return String is abstract;
function New_Line
(Mode : Format)
return String
is abstract;
-- Returns a new line such as this concatenated between two strings -- Returns a new line such as this concatenated between two strings
-- will display the strings on two lines. -- will display the strings on two lines.
function Title function Title (Mode : Format; Str : String) return String is abstract;
(Mode : Format;
Str : String)
return String
is abstract;
-- Returns Str as a Title. A title must be alone and centered on a -- Returns Str as a Title. A title must be alone and centered on a
-- line. Next output will be on the following line. -- line. Next output will be on the following line.
function Header function Header
(Mode : Format; (Mode : Format;
Str : String) Str : String) return String is abstract;
return String
is abstract;
-- Returns Str as an Header. An header must be alone on its line. Next -- Returns Str as an Header. An header must be alone on its line. Next
-- output will be on the following line. -- output will be on the following line.
end IO; end IO;
-- ----------------------
-- IO for HTML mode -- IO for HTML Mode --
-- ----------------------
package HTML_IO is package HTML_IO is
-- see IO for comments about these routines. -- See IO for comments about these routines
type Format is new IO.Format with null record; type Format is new IO.Format with null record;
function Variable function Variable
(IO : Format; (IO : Format;
Name : String; Name : String;
Value : String) Value : String) return String;
return String;
function New_Line (IO : in Format) return String; function New_Line (IO : in Format) return String;
...@@ -108,9 +94,9 @@ package body GNAT.CGI.Debug is ...@@ -108,9 +94,9 @@ package body GNAT.CGI.Debug is
end HTML_IO; end HTML_IO;
-- ----------------------------
-- IO for plain text mode -- IO for Plain Text Mode --
-- ----------------------------
package Text_IO is package Text_IO is
...@@ -121,8 +107,7 @@ package body GNAT.CGI.Debug is ...@@ -121,8 +107,7 @@ package body GNAT.CGI.Debug is
function Variable function Variable
(IO : Format; (IO : Format;
Name : String; Name : String;
Value : String) Value : String) return String;
return String;
function New_Line (IO : in Format) return String; function New_Line (IO : in Format) return String;
...@@ -188,10 +173,10 @@ package body GNAT.CGI.Debug is ...@@ -188,10 +173,10 @@ package body GNAT.CGI.Debug is
NL : constant String := (1 => ASCII.LF); NL : constant String := (1 => ASCII.LF);
function Bold (S : in String) return String; function Bold (S : in String) return String;
-- Returns S as an HTML bold string. -- Returns S as an HTML bold string
function Italic (S : in String) return String; function Italic (S : in String) return String;
-- Returns S as an HTML italic string. -- Returns S as an HTML italic string
---------- ----------
-- Bold -- -- Bold --
...@@ -207,8 +192,7 @@ package body GNAT.CGI.Debug is ...@@ -207,8 +192,7 @@ package body GNAT.CGI.Debug is
------------ ------------
function Header (IO : in Format; Str : in String) return String is function Header (IO : in Format; Str : in String) return String is
pragma Warnings (Off, IO); pragma Unreferenced (IO);
begin begin
return "<h2>" & Str & "</h2>" & NL; return "<h2>" & Str & "</h2>" & NL;
end Header; end Header;
...@@ -227,8 +211,7 @@ package body GNAT.CGI.Debug is ...@@ -227,8 +211,7 @@ package body GNAT.CGI.Debug is
-------------- --------------
function New_Line (IO : in Format) return String is function New_Line (IO : in Format) return String is
pragma Warnings (Off, IO); pragma Unreferenced (IO);
begin begin
return "<br>" & NL; return "<br>" & NL;
end New_Line; end New_Line;
...@@ -238,8 +221,7 @@ package body GNAT.CGI.Debug is ...@@ -238,8 +221,7 @@ package body GNAT.CGI.Debug is
----------- -----------
function Title (IO : in Format; Str : in String) return String is function Title (IO : in Format; Str : in String) return String is
pragma Warnings (Off, IO); pragma Unreferenced (IO);
begin begin
return "<p align=center><font size=+2>" & Str & "</font></p>" & NL; return "<p align=center><font size=+2>" & Str & "</font></p>" & NL;
end Title; end Title;
...@@ -251,11 +233,9 @@ package body GNAT.CGI.Debug is ...@@ -251,11 +233,9 @@ package body GNAT.CGI.Debug is
function Variable function Variable
(IO : Format; (IO : Format;
Name : String; Name : String;
Value : String) Value : String) return String
return String
is is
pragma Warnings (Off, IO); pragma Unreferenced (IO);
begin begin
return Bold (Name) & " = " & Italic (Value); return Bold (Name) & " = " & Italic (Value);
end Variable; end Variable;
...@@ -282,8 +262,7 @@ package body GNAT.CGI.Debug is ...@@ -282,8 +262,7 @@ package body GNAT.CGI.Debug is
-------------- --------------
function New_Line (IO : in Format) return String is function New_Line (IO : in Format) return String is
pragma Warnings (Off, IO); pragma Unreferenced (IO);
begin begin
return String'(1 => ASCII.LF); return String'(1 => ASCII.LF);
end New_Line; end New_Line;
...@@ -295,7 +274,6 @@ package body GNAT.CGI.Debug is ...@@ -295,7 +274,6 @@ package body GNAT.CGI.Debug is
function Title (IO : in Format; Str : in String) return String is function Title (IO : in Format; Str : in String) return String is
Spaces : constant Natural := (80 - Str'Length) / 2; Spaces : constant Natural := (80 - Str'Length) / 2;
Indent : constant String (1 .. Spaces) := (others => ' '); Indent : constant String (1 .. Spaces) := (others => ' ');
begin begin
return Indent & Str & New_Line (IO); return Indent & Str & New_Line (IO);
end Title; end Title;
...@@ -307,11 +285,9 @@ package body GNAT.CGI.Debug is ...@@ -307,11 +285,9 @@ package body GNAT.CGI.Debug is
function Variable function Variable
(IO : Format; (IO : Format;
Name : String; Name : String;
Value : String) Value : String) return String
return String
is is
pragma Warnings (Off, IO); pragma Unreferenced (IO);
begin begin
return " " & Name & " = " & Value; return " " & Name & " = " & Value;
end Variable; end Variable;
...@@ -324,7 +300,6 @@ package body GNAT.CGI.Debug is ...@@ -324,7 +300,6 @@ package body GNAT.CGI.Debug is
function HTML_Output return String is function HTML_Output return String is
HTML : HTML_IO.Format; HTML : HTML_IO.Format;
begin begin
return IO.Output (Mode => HTML); return IO.Output (Mode => HTML);
end HTML_Output; end HTML_Output;
...@@ -335,7 +310,6 @@ package body GNAT.CGI.Debug is ...@@ -335,7 +310,6 @@ package body GNAT.CGI.Debug is
function Text_Output return String is function Text_Output return String is
Text : Text_IO.Format; Text : Text_IO.Format;
begin begin
return IO.Output (Mode => Text); return IO.Output (Mode => Text);
end Text_Output; end Text_Output;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2000 Ada Core Technologies, Inc. -- -- Copyright (C) 2000-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
package GNAT.CGI.Debug is package GNAT.CGI.Debug is
-- Both functions below output all possible CGI parameters set. These -- Both functions below output all possible CGI parameters set. These are
-- are the form field and all CGI environment variables which make the -- the form field and all CGI environment variables which make the CGI
-- CGI environment at runtime. -- environment at runtime.
function Text_Output return String; function Text_Output return String;
-- Returns a plain text version of the CGI runtime environment -- Returns a plain text version of the CGI runtime environment
......
...@@ -49,23 +49,22 @@ package body GNAT.Command_Line is ...@@ -49,23 +49,22 @@ package body GNAT.Command_Line is
The_Parameter : Parameter_Type; The_Parameter : Parameter_Type;
The_Switch : Parameter_Type; The_Switch : Parameter_Type;
-- This type and this variable are provided to store the current switch -- This type and this variable are provided to store the current switch
-- and parameter -- and parameter.
type Is_Switch_Type is array (1 .. CL.Argument_Count) of Boolean; type Is_Switch_Type is array (1 .. CL.Argument_Count) of Boolean;
pragma Pack (Is_Switch_Type); pragma Pack (Is_Switch_Type);
Is_Switch : Is_Switch_Type := (others => False); Is_Switch : Is_Switch_Type := (others => False);
-- Indicates wich arguments on the command line are considered not be -- Indicates wich arguments on the command line are considered not be
-- switches or parameters to switches (this leaves e.g. the filenames...) -- switches or parameters to switches (this leaves e.g. the filenames...).
type Section_Type is array (1 .. CL.Argument_Count + 1) of Section_Number; type Section_Type is array (1 .. CL.Argument_Count + 1) of Section_Number;
pragma Pack (Section_Type); pragma Pack (Section_Type);
Section : Section_Type := (others => 1); Section : Section_Type := (others => 1);
-- Contains the number of the section associated with the current -- Contains the number of the section associated with the current switch.
-- switch. If this number is 0, then it is a section delimiter, which -- If this number is 0, then it is a section delimiter, which is never
-- is never returns by GetOpt. -- returns by GetOpt. The last element of this array is set to 0 to avoid
-- The last element of this array is set to 0 to avoid the need to test for -- the need to test for reaching the end of the command line in loops.
-- if we have reached the end of the command line in loops.
Current_Argument : Natural := 1; Current_Argument : Natural := 1;
-- Number of the current argument parsed on the command line -- Number of the current argument parsed on the command line
...@@ -82,8 +81,8 @@ package body GNAT.Command_Line is ...@@ -82,8 +81,8 @@ package body GNAT.Command_Line is
-- True if we are expanding a file -- True if we are expanding a file
Switch_Character : Character := '-'; Switch_Character : Character := '-';
-- The character at the beginning of the command line arguments, -- The character at the beginning of the command line arguments, indicating
-- indicating the beginning of a switch -- the beginning of a switch.
Stop_At_First : Boolean := False; Stop_At_First : Boolean := False;
-- If it is True then Getopt stops at the first non-switch argument -- If it is True then Getopt stops at the first non-switch argument
...@@ -97,24 +96,25 @@ package body GNAT.Command_Line is ...@@ -97,24 +96,25 @@ package body GNAT.Command_Line is
-- Set the parameter that will be returned by Parameter below -- Set the parameter that will be returned by Parameter below
function Goto_Next_Argument_In_Section return Boolean; function Goto_Next_Argument_In_Section return Boolean;
-- Go to the next argument on the command line. If we are at the end -- Go to the next argument on the command line. If we are at the end of the
-- of the current section, we want to make sure there is no other -- current section, we want to make sure there is no other identical
-- identical section on the command line (there might be multiple -- section on the command line (there might be multiple instances of
-- instances of -largs). Returns True iff there is another argument. -- -largs). Returns True iff there is another argument.
function Get_File_Names_Case_Sensitive return Integer; function Get_File_Names_Case_Sensitive return Integer;
pragma Import (C, Get_File_Names_Case_Sensitive, pragma Import (C, Get_File_Names_Case_Sensitive,
"__gnat_get_file_names_case_sensitive"); "__gnat_get_file_names_case_sensitive");
File_Names_Case_Sensitive : constant Boolean := File_Names_Case_Sensitive : constant Boolean :=
Get_File_Names_Case_Sensitive /= 0; Get_File_Names_Case_Sensitive /= 0;
procedure Canonical_Case_File_Name (S : in out String); procedure Canonical_Case_File_Name (S : in out String);
-- Given a file name, converts it to canonical case form. For systems -- Given a file name, converts it to canonical case form. For systems where
-- where file names are case sensitive, this procedure has no effect. -- file names are case sensitive, this procedure has no effect. If file
-- If file names are not case sensitive (i.e. for example if you have -- names are not case sensitive (i.e. for example if you have the file
-- the file "xyz.adb", you can refer to it as XYZ.adb or XyZ.AdB), then -- "xyz.adb", you can refer to it as XYZ.adb or XyZ.AdB), then this call
-- this call converts the given string to canonical all lower case form, -- converts the given string to canonical all lower case form, so that two
-- so that two file names compare equal if they refer to the same file. -- file names compare equal if they refer to the same file.
------------------------------ ------------------------------
-- Canonical_Case_File_Name -- -- Canonical_Case_File_Name --
...@@ -150,8 +150,8 @@ package body GNAT.Command_Line is ...@@ -150,8 +150,8 @@ package body GNAT.Command_Line is
NL : Positive; NL : Positive;
begin begin
-- It is assumed that a directory is opened at the current level; -- It is assumed that a directory is opened at the current level.
-- otherwise, GNAT.Directory_Operations.Directory_Error will be raised -- Otherwise GNAT.Directory_Operations.Directory_Error will be raised
-- at the first call to Read. -- at the first call to Read.
loop loop
...@@ -162,7 +162,7 @@ package body GNAT.Command_Line is ...@@ -162,7 +162,7 @@ package body GNAT.Command_Line is
if Last = 0 then if Last = 0 then
Close (It.Levels (Current).Dir); Close (It.Levels (Current).Dir);
-- If we are at level 1, we are finished; return an empty string. -- If we are at level 1, we are finished; return an empty string
if Current = 1 then if Current = 1 then
return String'(1 .. 0 => ' '); return String'(1 .. 0 => ' ');
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2002 Ada Core Technologies -- -- Copyright (C) 2002-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
-- GNAT compiler used to compile the program. It relies on the generated -- GNAT compiler used to compile the program. It relies on the generated
-- constant in the binder generated package that records this information. -- constant in the binder generated package that records this information.
-- Note: to use this package you must first instantiate it, e.g. -- Note: to use this package you must first instantiate it, for example:
-- package CVer is new GNAT.Compiler_Version; -- package CVer is new GNAT.Compiler_Version;
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
-- to import the necessary variable from the binder file causes trouble when -- to import the necessary variable from the binder file causes trouble when
-- building a shared library, since the symbol is not available. -- building a shared library, since the symbol is not available.
-- Note: this unit is only useable if the main program is written -- Note: this unit is only useable if the main program is written in Ada.
-- in Ada. It cannot be used if the main program is written in a -- It cannot be used if the main program is written in foreign language.
-- foreign language.
generic generic
package GNAT.Compiler_Version is package GNAT.Compiler_Version is
pragma Pure (Compiler_Version); pragma Pure;
function Version return String; function Version return String;
-- This function returns the version in the form "v.vvx (yyyyddmm)". -- This function returns the version in the form "v.vvx (yyyyddmm)".
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
with System; with System;
package GNAT.Debug_Utilities is package GNAT.Debug_Utilities is
pragma Pure (Debug_Utilities); pragma Pure;
Address_64 : constant Boolean := Standard'Address_Size = 64; Address_64 : constant Boolean := Standard'Address_Size = 64;
-- Set true if 64 bit addresses (assumes only 32 and 64 are possible) -- Set true if 64 bit addresses (assumes only 32 and 64 are possible)
......
...@@ -105,11 +105,11 @@ package body GNAT.Directory_Operations is ...@@ -105,11 +105,11 @@ package body GNAT.Directory_Operations is
Cut_Start := Cut_Start + 1; Cut_Start := Cut_Start + 1;
end if; end if;
-- Cut_End point to the last basename character. -- Cut_End point to the last basename character
Cut_End := Path'Last; Cut_End := Path'Last;
-- If basename ends with Suffix, adjust Cut_End. -- If basename ends with Suffix, adjust Cut_End
if Suffix /= "" if Suffix /= ""
and then Path (Path'Last - Suffix'Length + 1 .. Cut_End) = Suffix and then Path (Path'Last - Suffix'Length + 1 .. Cut_End) = Suffix
...@@ -279,8 +279,7 @@ package body GNAT.Directory_Operations is ...@@ -279,8 +279,7 @@ package body GNAT.Directory_Operations is
procedure Double_Result_Size is procedure Double_Result_Size is
New_Result : constant OS_Lib.String_Access := New_Result : constant OS_Lib.String_Access :=
new String (1 .. 2 * Result'Last); new String (1 .. 2 * Result'Last);
begin begin
New_Result (1 .. Result_Last) := Result (1 .. Result_Last); New_Result (1 .. Result_Last) := Result (1 .. Result_Last);
OS_Lib.Free (Result); OS_Lib.Free (Result);
...@@ -306,6 +305,7 @@ package body GNAT.Directory_Operations is ...@@ -306,6 +305,7 @@ package body GNAT.Directory_Operations is
procedure Read (K : in out Positive) is procedure Read (K : in out Positive) is
P : Character; P : Character;
begin begin
For_All_Characters : loop For_All_Characters : loop
if Is_Var_Prefix (Path (K)) then if Is_Var_Prefix (Path (K)) then
...@@ -314,7 +314,6 @@ package body GNAT.Directory_Operations is ...@@ -314,7 +314,6 @@ package body GNAT.Directory_Operations is
-- Could be a variable -- Could be a variable
if K < Path'Last then if K < Path'Last then
if Path (K + 1) = P then if Path (K + 1) = P then
-- Not a variable after all, this is a double $ or %, -- Not a variable after all, this is a double $ or %,
...@@ -566,7 +565,6 @@ package body GNAT.Directory_Operations is ...@@ -566,7 +565,6 @@ package body GNAT.Directory_Operations is
function Get_Current_Dir return Dir_Name_Str is function Get_Current_Dir return Dir_Name_Str is
Current_Dir : String (1 .. Max_Path + 1); Current_Dir : String (1 .. Max_Path + 1);
Last : Natural; Last : Natural;
begin begin
Get_Current_Dir (Current_Dir, Last); Get_Current_Dir (Current_Dir, Last);
return Current_Dir (1 .. Last); return Current_Dir (1 .. Last);
...@@ -708,11 +706,9 @@ package body GNAT.Directory_Operations is ...@@ -708,11 +706,9 @@ package body GNAT.Directory_Operations is
------------------------- -------------------------
function Read_Is_Thread_Safe return Boolean is function Read_Is_Thread_Safe return Boolean is
function readdir_is_thread_safe return Integer; function readdir_is_thread_safe return Integer;
pragma Import pragma Import
(C, readdir_is_thread_safe, "__gnat_readdir_is_thread_safe"); (C, readdir_is_thread_safe, "__gnat_readdir_is_thread_safe");
begin begin
return (readdir_is_thread_safe /= 0); return (readdir_is_thread_safe /= 0);
end Read_Is_Thread_Safe; end Read_Is_Thread_Safe;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2002-2005 AdaCore -- -- Copyright (C) 2002-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -75,7 +75,7 @@ package GNAT.Dynamic_HTables is ...@@ -75,7 +75,7 @@ package GNAT.Dynamic_HTables is
generic generic
type Header_Num is range <>; type Header_Num is range <>;
-- An integer type indicating the number and range of hash headers. -- An integer type indicating the number and range of hash headers
type Element (<>) is limited private; type Element (<>) is limited private;
-- The type of element to be stored -- The type of element to be stored
...@@ -85,7 +85,7 @@ package GNAT.Dynamic_HTables is ...@@ -85,7 +85,7 @@ package GNAT.Dynamic_HTables is
-- type, but could be some other form of type such as an integer type). -- type, but could be some other form of type such as an integer type).
Null_Ptr : Elmt_Ptr; Null_Ptr : Elmt_Ptr;
-- The null value of the Elmt_Ptr type. -- The null value of the Elmt_Ptr type
with procedure Set_Next (E : Elmt_Ptr; Next : Elmt_Ptr); with procedure Set_Next (E : Elmt_Ptr; Next : Elmt_Ptr);
with function Next (E : Elmt_Ptr) return Elmt_Ptr; with function Next (E : Elmt_Ptr) return Elmt_Ptr;
...@@ -154,7 +154,7 @@ package GNAT.Dynamic_HTables is ...@@ -154,7 +154,7 @@ package GNAT.Dynamic_HTables is
generic generic
type Header_Num is range <>; type Header_Num is range <>;
-- An integer type indicating the number and range of hash headers. -- An integer type indicating the number and range of hash headers
type Element is private; type Element is private;
-- The type of element to be stored -- The type of element to be stored
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
-- the body for exact details of the algorithm used. -- the body for exact details of the algorithm used.
package GNAT.Heap_Sort is package GNAT.Heap_Sort is
pragma Preelaborate (Heap_Sort); pragma Preelaborate;
-- The data to be sorted is assumed to be indexed by integer values -- The data to be sorted is assumed to be indexed by integer values
-- from 1 to N, where N is the number of items to be sorted. -- from 1 to N, where N is the number of items to be sorted.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
-- the body for exact details of the algorithm used. -- the body for exact details of the algorithm used.
package GNAT.Heap_Sort_A is package GNAT.Heap_Sort_A is
pragma Preelaborate (Heap_Sort_A); pragma Preelaborate;
-- The data to be sorted is assumed to be indexed by integer values from -- The data to be sorted is assumed to be indexed by integer values from
-- 1 to N, where N is the number of items to be sorted. In addition, the -- 1 to N, where N is the number of items to be sorted. In addition, the
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -77,7 +77,7 @@ generic ...@@ -77,7 +77,7 @@ generic
-- zero will in this case be resolved at instantiation time. -- zero will in this case be resolved at instantiation time.
package GNAT.Heap_Sort_G is package GNAT.Heap_Sort_G is
pragma Pure (Heap_Sort_G); pragma Pure;
procedure Sort (N : Natural); procedure Sort (N : Natural);
-- This procedures sorts items in the range from 1 to N into ascending -- This procedures sorts items in the range from 1 to N into ascending
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -46,13 +46,12 @@ ...@@ -46,13 +46,12 @@
with System.HTable; with System.HTable;
package GNAT.HTable is package GNAT.HTable is
pragma Preelaborate (HTable); pragma Preelaborate;
pragma Elaborate_Body;
pragma Elaborate_Body; -- The elaborate body is because we have a dummy body to deal with
-- The elaborate body is because we have a dummy body to deal with bootstrap -- bootstrap path problems (we used to have a real body, and now we don't
-- path problems (we used to have a real body, and now we don't need it any -- need it any more, but the bootstrap requires that we have a dummy body,
-- more, but the bootstrap requires that we have a dummy body, since otherwise -- since otherwise the old body gets picked up.
-- the old body gets picked up.
------------------- -------------------
-- Simple_HTable -- -- Simple_HTable --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
-- If such checks are needed then the regular Text_IO package must be used. -- If such checks are needed then the regular Text_IO package must be used.
package GNAT.IO is package GNAT.IO is
pragma Preelaborate (IO); pragma Preelaborate;
type File_Type is limited private; type File_Type is limited private;
-- Specifies file to be used (the only possibilities are Standard_Output -- Specifies file to be used (the only possibilities are Standard_Output
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2005 AdaCore -- -- Copyright (C) 1995-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2001 Ada Core Technologies, Inc. -- -- Copyright (C) 1995-2005 Ada Core Technologies, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
-- purpose of providing realiable system wide locking capability. -- purpose of providing realiable system wide locking capability.
package GNAT.Lock_Files is package GNAT.Lock_Files is
pragma Preelaborate; pragma Preelaborate;
Lock_Error : exception; Lock_Error : exception;
-- Exception raised if file cannot be locked -- Exception raised if file cannot be locked
...@@ -62,7 +62,7 @@ pragma Preelaborate; ...@@ -62,7 +62,7 @@ pragma Preelaborate;
(Lock_File_Name : Path_Name; (Lock_File_Name : Path_Name;
Wait : Duration := 1.0; Wait : Duration := 1.0;
Retries : Natural := Natural'Last); Retries : Natural := Natural'Last);
-- See above. The full lock file path is given as one string. -- See above. The full lock file path is given as one string
procedure Unlock_File (Directory : Path_Name; Lock_File_Name : Path_Name); procedure Unlock_File (Directory : Path_Name; Lock_File_Name : Path_Name);
-- Unlock a file. Directory can optionally terminate with a directory -- Unlock a file. Directory can optionally terminate with a directory
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2003-2005 AdaCore -- -- Copyright (C) 2003-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2003-2005 AdaCore -- -- Copyright (C) 2003-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
with System; with System;
package GNAT.Memory_Dump is package GNAT.Memory_Dump is
pragma Preelaborate (Memory_Dump); pragma Preelaborate;
procedure Dump (Addr : System.Address; Count : Natural); procedure Dump (Addr : System.Address; Count : Natural);
-- Dumps indicated number (Count) of bytes, starting at the address given -- Dumps indicated number (Count) of bytes, starting at the address given
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2003 Ada Core Technologies, Inc. -- -- Copyright (C) 2003-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -40,7 +40,7 @@ with System; ...@@ -40,7 +40,7 @@ with System;
package GNAT.Semaphores is package GNAT.Semaphores is
Default_Ceiling : constant System.Priority := System.Default_Priority; Default_Ceiling : constant System.Priority := System.Default_Priority;
-- A convenient value for the priority discriminants that follow. -- A convenient value for the priority discriminants that follow
------------------------ ------------------------
-- Counting_Semaphore -- -- Counting_Semaphore --
...@@ -52,19 +52,18 @@ package GNAT.Semaphores is ...@@ -52,19 +52,18 @@ package GNAT.Semaphores is
-- value of this counter is set by clients via the discriminant. -- value of this counter is set by clients via the discriminant.
Ceiling : System.Priority) Ceiling : System.Priority)
-- Users must specify the ceiling priority for the object. -- Users must specify the ceiling priority for the object. If the
-- If the Real-Time Systems Annex is not in use this value -- Real-Time Systems Annex is not in use this value is not important.
-- is not important.
is is
pragma Priority (Ceiling); pragma Priority (Ceiling);
entry Seize; entry Seize;
-- Blocks caller until/unless the semaphore's internal counter -- Blocks caller until/unless the semaphore's internal counter is
-- is greater than zero. -- greater than zero. Decrements the semaphore's internal counter when
-- Decrements the semaphore's internal counter when executed. -- executed.
procedure Release; procedure Release;
-- Increments the semaphore's internal counter. -- Increments the semaphore's internal counter
private private
Count : Natural := Initial_Value; Count : Natural := Initial_Value;
...@@ -75,23 +74,23 @@ package GNAT.Semaphores is ...@@ -75,23 +74,23 @@ package GNAT.Semaphores is
---------------------- ----------------------
protected type Binary_Semaphore protected type Binary_Semaphore
(Initially_Available : Boolean; (Initially_Available : Boolean;
-- Binary semaphores are either available or not; there is no -- Binary semaphores are either available or not; there is no internal
-- internal count involved. The discriminant value determines -- count involved. The discriminant value determines whether the
-- whether the individual object is initially available. -- individual object is initially available.
Ceiling : System.Priority) Ceiling : System.Priority)
-- Users must specify the ceiling priority for the object. -- Users must specify the ceiling priority for the object. If the
-- If the Real-Time Systems Annex is not in use -- Real-Time Systems Annex is not in use this value is not important.
-- this value is not important.
is is
pragma Priority (Ceiling); pragma Priority (Ceiling);
entry Seize; entry Seize;
-- Blocks the caller unless/until semaphore is available. -- Blocks the caller unless/until semaphore is available. After
-- After execution the semaphore is no longer available. -- execution the semaphore is no longer available.
procedure Release; procedure Release;
-- Makes the semaphore available. -- Makes the semaphore available
private private
Available : Boolean := Initially_Available; Available : Boolean := Initially_Available;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
-- layer for use by the GNAT.Sockets package (g-socket.ads). This package -- layer for use by the GNAT.Sockets package (g-socket.ads). This package
-- should not be directly with'ed by an applications program. -- should not be directly with'ed by an applications program.
-- This version is for NT. -- This version is for NT
with GNAT.Sockets.Constants; use GNAT.Sockets.Constants; with GNAT.Sockets.Constants; use GNAT.Sockets.Constants;
with Interfaces.C.Strings; use Interfaces.C.Strings; with Interfaces.C.Strings; use Interfaces.C.Strings;
......
...@@ -49,16 +49,16 @@ package GNAT.Sockets.Thin is ...@@ -49,16 +49,16 @@ package GNAT.Sockets.Thin is
package C renames Interfaces.C; package C renames Interfaces.C;
use type C.int; use type C.int;
-- So that we can declare the Failure constant below. -- So that we can declare the Failure constant below
Success : constant C.int := 0; Success : constant C.int := 0;
Failure : constant C.int := -1; Failure : constant C.int := -1;
function Socket_Errno return Integer; function Socket_Errno return Integer;
-- Returns last socket error number. -- Returns last socket error number
procedure Set_Socket_Errno (Errno : Integer); procedure Set_Socket_Errno (Errno : Integer);
-- Set last socket error number. -- Set last socket error number
function Socket_Error_Message function Socket_Error_Message
(Errno : Integer) (Errno : Integer)
...@@ -335,7 +335,7 @@ package GNAT.Sockets.Thin is ...@@ -335,7 +335,7 @@ package GNAT.Sockets.Thin is
procedure Free_Socket_Set procedure Free_Socket_Set
(Set : Fd_Set_Access); (Set : Fd_Set_Access);
-- Free system-dependent socket set. -- Free system-dependent socket set
procedure Get_Socket_From_Set procedure Get_Socket_From_Set
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2004 Ada Core Technologies, Inc. -- -- Copyright (C) 2001-2005 Ada Core Technologies, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Temporary version for Alpha/VMS. -- Temporary version for Alpha/VMS
with GNAT.OS_Lib; use GNAT.OS_Lib; with GNAT.OS_Lib; use GNAT.OS_Lib;
with GNAT.Task_Lock; with GNAT.Task_Lock;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2002-2004 Ada Core Technologies, Inc. -- -- Copyright (C) 2002-2005 Ada Core Technologies, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
-- layer for use by the GNAT.Sockets package (g-socket.ads). This package -- layer for use by the GNAT.Sockets package (g-socket.ads). This package
-- should not be directly with'ed by an applications program. -- should not be directly with'ed by an applications program.
-- This is the Alpha/VMS version. -- This is the Alpha/VMS version
with Interfaces.C.Pointers; with Interfaces.C.Pointers;
...@@ -58,7 +58,7 @@ package GNAT.Sockets.Thin is ...@@ -58,7 +58,7 @@ package GNAT.Sockets.Thin is
Failure : constant C.int := -1; Failure : constant C.int := -1;
function Socket_Errno return Integer renames GNAT.OS_Lib.Errno; function Socket_Errno return Integer renames GNAT.OS_Lib.Errno;
-- Returns last socket error number. -- Returns last socket error number
function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr; function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr;
-- Returns the error message string for the error number Errno. If -- Returns the error message string for the error number Errno. If
...@@ -354,7 +354,7 @@ package GNAT.Sockets.Thin is ...@@ -354,7 +354,7 @@ package GNAT.Sockets.Thin is
procedure Free_Socket_Set procedure Free_Socket_Set
(Set : Fd_Set_Access); (Set : Fd_Set_Access);
-- Free system-dependent socket set. -- Free system-dependent socket set
procedure Get_Socket_From_Set procedure Get_Socket_From_Set
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
...@@ -369,7 +369,7 @@ package GNAT.Sockets.Thin is ...@@ -369,7 +369,7 @@ package GNAT.Sockets.Thin is
procedure Insert_Socket_In_Set procedure Insert_Socket_In_Set
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
Socket : C.int); Socket : C.int);
-- Insert socket in the socket set. -- Insert socket in the socket set
function Is_Socket_In_Set function Is_Socket_In_Set
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
...@@ -396,7 +396,7 @@ package GNAT.Sockets.Thin is ...@@ -396,7 +396,7 @@ package GNAT.Sockets.Thin is
procedure Remove_Socket_From_Set procedure Remove_Socket_From_Set
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
Socket : C.int); Socket : C.int);
-- Remove socket from the socket set. -- Remove socket from the socket set
procedure Finalize; procedure Finalize;
procedure Initialize (Process_Blocking_IO : Boolean); procedure Initialize (Process_Blocking_IO : Boolean);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2002-2004 Ada Core Technologies, Inc. -- -- Copyright (C) 2002-2005 Ada Core Technologies, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -57,11 +57,11 @@ package GNAT.Sockets.Thin is ...@@ -57,11 +57,11 @@ package GNAT.Sockets.Thin is
Failure : constant C.int := -1; Failure : constant C.int := -1;
function Socket_Errno return Integer renames GNAT.OS_Lib.Errno; function Socket_Errno return Integer renames GNAT.OS_Lib.Errno;
-- Returns last socket error number. -- Returns last socket error number
function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr; function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr;
-- Returns the error message string for the error number Errno. If -- Returns the error message string for the error number Errno. If Errno is
-- Errno is not known it returns "Unknown system error". -- not known it returns "Unknown system error".
subtype Fd_Set_Access is System.Address; subtype Fd_Set_Access is System.Address;
No_Fd_Set : constant Fd_Set_Access := System.Null_Address; No_Fd_Set : constant Fd_Set_Access := System.Null_Address;
...@@ -145,25 +145,25 @@ package GNAT.Sockets.Thin is ...@@ -145,25 +145,25 @@ package GNAT.Sockets.Thin is
(Sin : Sockaddr_In_Access; (Sin : Sockaddr_In_Access;
Len : C.int); Len : C.int);
pragma Inline (Set_Length); pragma Inline (Set_Length);
-- Set Sin.Sin_Length to Len. -- Set Sin.Sin_Length to Len
procedure Set_Family procedure Set_Family
(Sin : Sockaddr_In_Access; (Sin : Sockaddr_In_Access;
Family : C.int); Family : C.int);
pragma Inline (Set_Family); pragma Inline (Set_Family);
-- Set Sin.Sin_Family to Family. -- Set Sin.Sin_Family to Family
procedure Set_Port procedure Set_Port
(Sin : Sockaddr_In_Access; (Sin : Sockaddr_In_Access;
Port : C.unsigned_short); Port : C.unsigned_short);
pragma Inline (Set_Port); pragma Inline (Set_Port);
-- Set Sin.Sin_Port to Port. -- Set Sin.Sin_Port to Port
procedure Set_Address procedure Set_Address
(Sin : Sockaddr_In_Access; (Sin : Sockaddr_In_Access;
Address : In_Addr); Address : In_Addr);
pragma Inline (Set_Address); pragma Inline (Set_Address);
-- Set Sin.Sin_Addr to Address. -- Set Sin.Sin_Addr to Address
type Hostent is record type Hostent is record
H_Name : C.Strings.chars_ptr; H_Name : C.Strings.chars_ptr;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2004 Ada Core Technologies, Inc. -- -- Copyright (C) 2001-2005 Ada Core Technologies, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -59,11 +59,11 @@ package GNAT.Sockets.Thin is ...@@ -59,11 +59,11 @@ package GNAT.Sockets.Thin is
Failure : constant C.int := -1; Failure : constant C.int := -1;
function Socket_Errno return Integer renames GNAT.OS_Lib.Errno; function Socket_Errno return Integer renames GNAT.OS_Lib.Errno;
-- Returns last socket error number. -- Returns last socket error number
function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr; function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr;
-- Returns the error message string for the error number Errno. If -- Returns the error message string for the error number Errno. If Errno is
-- Errno is not known it returns "Unknown system error". -- not known it returns "Unknown system error".
subtype Fd_Set_Access is System.Address; subtype Fd_Set_Access is System.Address;
No_Fd_Set : constant Fd_Set_Access := System.Null_Address; No_Fd_Set : constant Fd_Set_Access := System.Null_Address;
...@@ -357,17 +357,17 @@ package GNAT.Sockets.Thin is ...@@ -357,17 +357,17 @@ package GNAT.Sockets.Thin is
procedure Last_Socket_In_Set procedure Last_Socket_In_Set
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
Last : Int_Access); Last : Int_Access);
-- Find the largest socket in the socket set. This is needed for -- Find the largest socket in the socket set. This is needed for select().
-- select(). When Last_Socket_In_Set is called, parameter Last is -- When Last_Socket_In_Set is called, parameter Last is a maximum value of
-- a maximum value of the largest socket. This hint is used to -- the largest socket. This hint is used to avoid scanning very large
-- avoid scanning very large socket sets. After the call, Last is -- socket sets. After the call, Last is set back to the real largest socket
-- set back to the real largest socket in the socket set. -- in the socket set.
function New_Socket_Set function New_Socket_Set
(Set : Fd_Set_Access) return Fd_Set_Access; (Set : Fd_Set_Access) return Fd_Set_Access;
-- Allocate a new socket set which is a system-dependent structure -- Allocate a new socket set which is a system-dependent structure and
-- and initialize by copying Set if it is non-null, by making it -- initialize by copying Set if it is non-null, by making it empty
-- empty otherwise. -- otherwise.
procedure Remove_Socket_From_Set procedure Remove_Socket_From_Set
(Set : Fd_Set_Access; (Set : Fd_Set_Access;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1998-2005 AdaCore -- -- Copyright (C) 1998-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -49,7 +49,7 @@ package body GNAT.Table is ...@@ -49,7 +49,7 @@ package body GNAT.Table is
-- ensures that we initially allocate the table. -- ensures that we initially allocate the table.
Last_Val : Integer; Last_Val : Integer;
-- Current value of Last. -- Current value of Last
----------------------- -----------------------
-- Local Subprograms -- -- Local Subprograms --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1999-2000 Ada Core Technologies, Inc. -- -- Copyright (C) 1999-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1999-2004 Ada Core Technologies, Inc. -- -- Copyright (C) 1999-2005, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -78,7 +78,7 @@ package GNAT.Traceback is ...@@ -78,7 +78,7 @@ package GNAT.Traceback is
-- Code location used in building tracebacks -- Code location used in building tracebacks
subtype Tracebacks_Array is Ada.Exceptions.Traceback.Tracebacks_Array; subtype Tracebacks_Array is Ada.Exceptions.Traceback.Tracebacks_Array;
-- Traceback array used to hold a generated traceback list. -- Traceback array used to hold a generated traceback list
---------------- ----------------
-- Call_Chain -- -- Call_Chain --
......
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- The body of Interfaces.COBOL is implementation independent (i.e. the -- The body of Interfaces.COBOL is implementation independent (i.e. the same
-- same version is used with all versions of GNAT). The specialization -- version is used with all versions of GNAT). The specialization to a
-- to a particular COBOL format is completely contained in the private -- particular COBOL format is completely contained in the private part of
-- part ot the spec. -- the spec.
with Interfaces; use Interfaces; with Interfaces; use Interfaces;
with System; use System; with System; use System;
...@@ -76,8 +76,7 @@ package body Interfaces.COBOL is ...@@ -76,8 +76,7 @@ package body Interfaces.COBOL is
function Binary_To_Decimal function Binary_To_Decimal
(Item : Byte_Array; (Item : Byte_Array;
Format : Binary_Format) Format : Binary_Format) return Integer_64;
return Integer_64;
-- This function converts a numeric value in the given format to its -- This function converts a numeric value in the given format to its
-- corresponding integer value. This is the non-generic implementation -- corresponding integer value. This is the non-generic implementation
-- of Decimal_Conversions.To_Decimal. The generic routine does the -- of Decimal_Conversions.To_Decimal. The generic routine does the
...@@ -85,8 +84,7 @@ package body Interfaces.COBOL is ...@@ -85,8 +84,7 @@ package body Interfaces.COBOL is
function Numeric_To_Decimal function Numeric_To_Decimal
(Item : Numeric; (Item : Numeric;
Format : Display_Format) Format : Display_Format) return Integer_64;
return Integer_64;
-- This function converts a numeric value in the given format to its -- This function converts a numeric value in the given format to its
-- corresponding integer value. This is the non-generic implementation -- corresponding integer value. This is the non-generic implementation
-- of Decimal_Conversions.To_Decimal. The generic routine does the -- of Decimal_Conversions.To_Decimal. The generic routine does the
...@@ -94,8 +92,7 @@ package body Interfaces.COBOL is ...@@ -94,8 +92,7 @@ package body Interfaces.COBOL is
function Packed_To_Decimal function Packed_To_Decimal
(Item : Packed_Decimal; (Item : Packed_Decimal;
Format : Packed_Format) Format : Packed_Format) return Integer_64;
return Integer_64;
-- This function converts a packed value in the given format to its -- This function converts a packed value in the given format to its
-- corresponding integer value. This is the non-generic implementation -- corresponding integer value. This is the non-generic implementation
-- of Decimal_Conversions.To_Decimal. The generic routine does the -- of Decimal_Conversions.To_Decimal. The generic routine does the
...@@ -207,7 +204,7 @@ package body Interfaces.COBOL is ...@@ -207,7 +204,7 @@ package body Interfaces.COBOL is
-- Numeric_To_Decimal -- -- Numeric_To_Decimal --
------------------------ ------------------------
-- The following assumptions are made in the coding of this routine -- The following assumptions are made in the coding of this routine:
-- The range of COBOL_Digits is compact and the ten values -- The range of COBOL_Digits is compact and the ten values
-- represent the digits 0-9 in sequence -- represent the digits 0-9 in sequence
...@@ -220,7 +217,7 @@ package body Interfaces.COBOL is ...@@ -220,7 +217,7 @@ package body Interfaces.COBOL is
-- The COBOL_Minus_Digits set is disjoint from COBOL_Digits -- The COBOL_Minus_Digits set is disjoint from COBOL_Digits
-- These assumptions are true for all COBOL representations we know of. -- These assumptions are true for all COBOL representations we know of
function Numeric_To_Decimal function Numeric_To_Decimal
(Item : Numeric; (Item : Numeric;
...@@ -708,7 +705,7 @@ package body Interfaces.COBOL is ...@@ -708,7 +705,7 @@ package body Interfaces.COBOL is
-- Note that the tests here are all compile time tests -- Note that the tests here are all compile time tests
function Length (Format : Binary_Format) return Natural is function Length (Format : Binary_Format) return Natural is
pragma Warnings (Off, Format); pragma Unreferenced (Format);
begin begin
if Num'Digits <= 2 then if Num'Digits <= 2 then
return 1; return 1;
...@@ -743,8 +740,7 @@ package body Interfaces.COBOL is ...@@ -743,8 +740,7 @@ package body Interfaces.COBOL is
function Length function Length
(Format : Packed_Format) return Natural (Format : Packed_Format) return Natural
is is
pragma Warnings (Off, Format); pragma Unreferenced (Format);
begin begin
case Packed_Representation is case Packed_Representation is
when IBM => when IBM =>
...@@ -847,14 +843,12 @@ package body Interfaces.COBOL is ...@@ -847,14 +843,12 @@ package body Interfaces.COBOL is
function To_Decimal function To_Decimal
(Item : Numeric; (Item : Numeric;
Format : Display_Format) Format : Display_Format) return Num
return Num
is is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return Num'Fixed_Value (Numeric_To_Decimal (Item, Format)); return Num'Fixed_Value (Numeric_To_Decimal (Item, Format));
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- S p e c -- -- S p e c --
-- (ASCII Version) -- -- (ASCII Version) --
-- -- -- --
-- Copyright (C) 1993-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1993-2005 Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -386,12 +386,10 @@ package Interfaces.COBOL is ...@@ -386,12 +386,10 @@ package Interfaces.COBOL is
function Valid function Valid
(Item : Numeric; (Item : Numeric;
Format : Display_Format) Format : Display_Format) return Boolean;
return Boolean;
function Length function Length
(Format : Display_Format) (Format : Display_Format) return Natural;
return Natural;
function To_Decimal function To_Decimal
(Item : Numeric; (Item : Numeric;
...@@ -400,36 +398,30 @@ package Interfaces.COBOL is ...@@ -400,36 +398,30 @@ package Interfaces.COBOL is
function To_Display function To_Display
(Item : Num; (Item : Num;
Format : Display_Format) Format : Display_Format) return Numeric;
return Numeric;
-- Packed Formats: data values are represented as Packed_Decimal -- Packed Formats: data values are represented as Packed_Decimal
function Valid function Valid
(Item : Packed_Decimal; (Item : Packed_Decimal;
Format : Packed_Format) Format : Packed_Format) return Boolean;
return Boolean;
function Length function Length
(Format : Packed_Format) (Format : Packed_Format) return Natural;
return Natural;
function To_Decimal function To_Decimal
(Item : Packed_Decimal; (Item : Packed_Decimal;
Format : Packed_Format) Format : Packed_Format) return Num;
return Num;
function To_Packed function To_Packed
(Item : Num; (Item : Num;
Format : Packed_Format) Format : Packed_Format) return Packed_Decimal;
return Packed_Decimal;
-- Binary Formats: external data values are represented as Byte_Array -- Binary Formats: external data values are represented as Byte_Array
function Valid function Valid
(Item : Byte_Array; (Item : Byte_Array;
Format : Binary_Format) Format : Binary_Format) return Boolean;
return Boolean;
function Length function Length
(Format : Binary_Format) (Format : Binary_Format)
...@@ -441,8 +433,7 @@ package Interfaces.COBOL is ...@@ -441,8 +433,7 @@ package Interfaces.COBOL is
function To_Binary function To_Binary
(Item : Num; (Item : Num;
Format : Binary_Format) Format : Binary_Format) return Byte_Array;
return Byte_Array;
-- Internal Binary formats: data values are of type Binary/Long_Binary -- Internal Binary formats: data values are of type Binary/Long_Binary
...@@ -517,14 +508,14 @@ private ...@@ -517,14 +508,14 @@ private
type Packed_Format is (U, S); type Packed_Format is (U, S);
Packed_Unsigned : constant Packed_Format := U; Packed_Unsigned : constant Packed_Format := U;
Packed_Signed : constant Packed_Format := S; Packed_Signed : constant Packed_Format := S;
type Packed_Representation_Type is (IBM); type Packed_Representation_Type is (IBM);
-- Indicator for format used for packed decimal -- Indicator for format used for packed decimal
Packed_Representation : constant Packed_Representation_Type := IBM; Packed_Representation : constant Packed_Representation_Type := IBM;
-- This version of the spec uses IBM internal format, as described above. -- This version of the spec uses IBM internal format, as described above
----------------------------- -----------------------------
-- Display Decimal Formats -- -- Display Decimal Formats --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1996-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1996-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This is the Alpha/VMS version. -- This is the Alpha/VMS version
with Unchecked_Conversion; with Unchecked_Conversion;
package body Interfaces.C_Streams is package body Interfaces.C_Streams is
...@@ -87,8 +87,8 @@ package body Interfaces.C_Streams is ...@@ -87,8 +87,8 @@ package body Interfaces.C_Streams is
Ch : int; Ch : int;
begin begin
-- This Fread goes with the Fwrite below. -- This Fread goes with the Fwrite below. The C library fread sometimes
-- The C library fread sometimes can't read fputc generated files. -- can't read fputc generated files.
for C in 1 .. count loop for C in 1 .. count loop
for S in 1 .. size loop for S in 1 .. size loop
...@@ -125,8 +125,8 @@ package body Interfaces.C_Streams is ...@@ -125,8 +125,8 @@ package body Interfaces.C_Streams is
Ch : int; Ch : int;
begin begin
-- This Fread goes with the Fwrite below. -- This Fread goes with the Fwrite below. The C library fread sometimes
-- The C library fread sometimes can't read fputc generated files. -- can't read fputc generated files.
for C in 1 + index .. count + index loop for C in 1 + index .. count + index loop
for S in 1 .. size loop for S in 1 .. size loop
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1995-2003 Free Software Foundation, Inc. -- -- Copyright (C) 1995-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -123,16 +123,14 @@ package Interfaces.C_Streams is ...@@ -123,16 +123,14 @@ package Interfaces.C_Streams is
(buffer : voids; (buffer : voids;
size : size_t; size : size_t;
count : size_t; count : size_t;
stream : FILEs) stream : FILEs) return size_t;
return size_t;
function fread function fread
(buffer : voids; (buffer : voids;
index : size_t; index : size_t;
size : size_t; size : size_t;
count : size_t; count : size_t;
stream : FILEs) stream : FILEs) return size_t;
return size_t;
-- Same as normal fread, but has a parameter 'index' that indicates -- Same as normal fread, but has a parameter 'index' that indicates
-- the starting index for the read within 'buffer' (which must be the -- the starting index for the read within 'buffer' (which must be the
-- address of the beginning of a whole array object with an assumed -- address of the beginning of a whole array object with an assumed
...@@ -198,11 +196,11 @@ package Interfaces.C_Streams is ...@@ -198,11 +196,11 @@ package Interfaces.C_Streams is
-- functions. -- functions.
function file_exists (name : chars) return int; function file_exists (name : chars) return int;
-- Tests if given name corresponds to an existing file. -- Tests if given name corresponds to an existing file
function is_regular_file (handle : int) return int; function is_regular_file (handle : int) return int;
-- Tests if given handle is for a regular file (result 1) or for -- Tests if given handle is for a regular file (result 1) or for a
-- a non-regular file (pipe or device, result 0). -- non-regular file (pipe or device, result 0).
--------------------------------- ---------------------------------
-- Control of Text/Binary Mode -- -- Control of Text/Binary Mode --
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -38,11 +38,10 @@ with Unchecked_Conversion; ...@@ -38,11 +38,10 @@ with Unchecked_Conversion;
package body Interfaces.C.Strings is package body Interfaces.C.Strings is
-- Note that the type chars_ptr has a pragma No_Strict_Aliasing in -- Note that the type chars_ptr has a pragma No_Strict_Aliasing in the
-- the spec, to prevent any assumptions about aliasing for values -- spec, to prevent any assumptions about aliasing for values of this type,
-- of this type, since arbitrary addresses can be converted, and it -- since arbitrary addresses can be converted, and it is quite likely that
-- is quite likely that this type will in fact be used for aliasing -- this type will in fact be used for aliasing values of other types.
-- values of other types.
function To_chars_ptr is function To_chars_ptr is
new Unchecked_Conversion (Address, chars_ptr); new Unchecked_Conversion (Address, chars_ptr);
...@@ -116,7 +115,7 @@ package body Interfaces.C.Strings is ...@@ -116,7 +115,7 @@ package body Interfaces.C.Strings is
Index := Position_Of_Nul (Into => Chars); Index := Position_Of_Nul (Into => Chars);
Pointer := Memory_Alloc ((Index - Chars'First + 1)); Pointer := Memory_Alloc ((Index - Chars'First + 1));
-- If nul is present, transfer string up to and including it. -- If nul is present, transfer string up to and including nul
if Index <= Chars'Last then if Index <= Chars'Last then
Update (Item => Pointer, Update (Item => Pointer,
...@@ -322,8 +321,9 @@ package body Interfaces.C.Strings is ...@@ -322,8 +321,9 @@ package body Interfaces.C.Strings is
Result : char_array (0 .. Length); Result : char_array (0 .. Length);
begin begin
-- As per AI-00177, this is equivalent to -- As per AI-00177, this is equivalent to:
-- To_Ada (Value (Item, Length) & nul);
-- To_Ada (Value (Item, Length) & nul);
if Item = Null_Ptr then if Item = Null_Ptr then
raise Dereference_Error; raise Dereference_Error;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -43,10 +43,10 @@ procedure Sort (Tbl : in out Unit_Ref_Table) is ...@@ -43,10 +43,10 @@ procedure Sort (Tbl : in out Unit_Ref_Table) is
-- even though we have to copy Tbl back and forth. -- even though we have to copy Tbl back and forth.
function Lt_Uname (C1, C2 : Natural) return Boolean; function Lt_Uname (C1, C2 : Natural) return Boolean;
-- Comparison routine for comparing Unames. Needed by the sorting routine. -- Comparison routine for comparing Unames. Needed by the sorting routine
procedure Move_Uname (From : Natural; To : Natural); procedure Move_Uname (From : Natural; To : Natural);
-- Move routine needed by the sorting routine below. -- Move routine needed by the sorting routine below
-------------- --------------
-- Lt_Uname -- -- Lt_Uname --
......
...@@ -1939,7 +1939,7 @@ package body Sem_Ch7 is ...@@ -1939,7 +1939,7 @@ package body Sem_Ch7 is
Next_Elmt (Priv_Elmt); Next_Elmt (Priv_Elmt);
end loop; end loop;
-- Now restore the type itself to its private view. -- Now restore the type itself to its private view
Exchange_Declarations (Id); Exchange_Declarations (Id);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1996-2002 Free Software Foundation, Inc. -- -- Copyright (C) 1996-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -48,7 +48,7 @@ package body Sem_Maps is ...@@ -48,7 +48,7 @@ package body Sem_Maps is
procedure Write_Map (E : Entity_Id); procedure Write_Map (E : Entity_Id);
pragma Warnings (Off, Write_Map); pragma Warnings (Off, Write_Map);
-- For debugging purposes. -- For debugging purposes
--------------------- ---------------------
-- Add_Association -- -- Add_Association --
...@@ -72,7 +72,7 @@ package body Sem_Maps is ...@@ -72,7 +72,7 @@ package body Sem_Maps is
if Headers_Table.Table (Offh + J) /= No_Assoc then if Headers_Table.Table (Offh + J) /= No_Assoc then
-- Place new association at head of chain. -- Place new association at head of chain
Associations_Table.Table (K).Next := Headers_Table.Table (Offh + J); Associations_Table.Table (K).Next := Headers_Table.Table (Offh + J);
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment