summaryrefslogtreecommitdiff
path: root/gcc/ada/a-calari.ads
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/ada/a-calari.ads
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/ada/a-calari.ads')
-rw-r--r--gcc/ada/a-calari.ads65
1 files changed, 65 insertions, 0 deletions
diff --git a/gcc/ada/a-calari.ads b/gcc/ada/a-calari.ads
new file mode 100644
index 000000000..64ebc623b
--- /dev/null
+++ b/gcc/ada/a-calari.ads
@@ -0,0 +1,65 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- A D A . C A L E N D A R . A R I T H M E T I C --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2005-2008, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. In accordance with the copyright of that document, you can freely --
+-- copy and modify this specification, provided that if you redistribute a --
+-- modified version, any changes that you have made are clearly indicated. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package provides arithmetic operations of time values using days
+-- and leap seconds. Ada.Calendar.Arithmetic is defined in the Ada 2005
+-- RM (9.6.1).
+
+package Ada.Calendar.Arithmetic is
+
+ -- Arithmetic on days:
+
+ -- Rough estimate on the number of days over the range of Ada time
+
+ type Day_Count is range
+ -(366 * (1 + Year_Number'Last - Year_Number'First))
+ ..
+ +(366 * (1 + Year_Number'Last - Year_Number'First));
+
+ subtype Leap_Seconds_Count is Integer range -2047 .. 2047;
+ -- Count of leap seconds. Negative leap seconds occur whenever the
+ -- astronomical time is faster than the atomic time or as a result of
+ -- Difference when Left < Right.
+
+ procedure Difference
+ (Left : Time;
+ Right : Time;
+ Days : out Day_Count;
+ Seconds : out Duration;
+ Leap_Seconds : out Leap_Seconds_Count);
+ -- Returns the difference between Left and Right. Days is the number of
+ -- days of difference, Seconds is the remainder seconds of difference
+ -- excluding leap seconds, and Leap_Seconds is the number of leap seconds.
+ -- If Left < Right, then Seconds <= 0.0, Days <= 0, and Leap_Seconds <= 0,
+ -- otherwise all values are nonnegative. The absolute value of Seconds is
+ -- always less than 86_400.0. For the returned values, if Days = 0, then
+ -- Seconds + Duration (Leap_Seconds) = Calendar."-" (Left, Right)
+
+ function "+" (Left : Time; Right : Day_Count) return Time;
+ function "+" (Left : Day_Count; Right : Time) return Time;
+ -- Adds a number of days to a time value. Time_Error is raised if the
+ -- result is not representable as a value of type Time.
+
+ function "-" (Left : Time; Right : Day_Count) return Time;
+ -- Subtracts a number of days from a time value. Time_Error is raised if
+ -- the result is not representable as a value of type Time.
+
+ function "-" (Left : Time; Right : Time) return Day_Count;
+ -- Subtracts two time values, and returns the number of days between them.
+ -- This is the same value that Difference would return in Days.
+
+end Ada.Calendar.Arithmetic;