Daily bump.
[official-gcc.git] / gcc / ada / 4vcalend.ads
blob15869e8279fce2e7a0abefdc7e86c27d9a43f1d5
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUNTIME COMPONENTS --
4 -- --
5 -- A D A . C A L E N D A R --
6 -- --
7 -- S p e c --
8 -- --
9 -- $Revision: 1.1 $
10 -- --
11 -- This specification is adapted from the Ada Reference Manual for use with --
12 -- GNAT. In accordance with the copyright of that document, you can freely --
13 -- copy and modify this specification, provided that if you redistribute a --
14 -- modified version, any changes that you have made are clearly indicated. --
15 -- --
16 ------------------------------------------------------------------------------
18 -- This is the Alpha/VMS version.
20 with System.OS_Primitives;
21 package Ada.Calendar is
23 package OSP renames System.OS_Primitives;
25 type Time is private;
27 -- Declarations representing limits of allowed local time values. Note that
28 -- these do NOT constrain the possible stored values of time which may well
29 -- permit a larger range of times (this is explicitly allowed in Ada 95).
31 subtype Year_Number is Integer range 1901 .. 2099;
32 subtype Month_Number is Integer range 1 .. 12;
33 subtype Day_Number is Integer range 1 .. 31;
35 subtype Day_Duration is Duration range 0.0 .. 86_400.0;
37 function Clock return Time;
39 function Year (Date : Time) return Year_Number;
40 function Month (Date : Time) return Month_Number;
41 function Day (Date : Time) return Day_Number;
42 function Seconds (Date : Time) return Day_Duration;
44 procedure Split
45 (Date : Time;
46 Year : out Year_Number;
47 Month : out Month_Number;
48 Day : out Day_Number;
49 Seconds : out Day_Duration);
51 function Time_Of
52 (Year : Year_Number;
53 Month : Month_Number;
54 Day : Day_Number;
55 Seconds : Day_Duration := 0.0)
56 return Time;
58 function "+" (Left : Time; Right : Duration) return Time;
59 function "+" (Left : Duration; Right : Time) return Time;
60 function "-" (Left : Time; Right : Duration) return Time;
61 function "-" (Left : Time; Right : Time) return Duration;
63 function "<" (Left, Right : Time) return Boolean;
64 function "<=" (Left, Right : Time) return Boolean;
65 function ">" (Left, Right : Time) return Boolean;
66 function ">=" (Left, Right : Time) return Boolean;
68 Time_Error : exception;
70 private
72 pragma Inline (Clock);
74 pragma Inline (Year);
75 pragma Inline (Month);
76 pragma Inline (Day);
78 pragma Inline ("+");
79 pragma Inline ("-");
81 pragma Inline ("<");
82 pragma Inline ("<=");
83 pragma Inline (">");
84 pragma Inline (">=");
86 -- Time is represented as the number of 100-nanosecond (ns) units offset
87 -- from the system base date and time, which is 00:00 o'clock,
88 -- November 17, 1858 (the Smithsonian base date and time for the
89 -- astronomic calendar).
91 -- The time value stored is typically a GMT value, as provided in standard
92 -- Unix environments. If this is the case then Split and Time_Of perform
93 -- required conversions to and from local times.
95 type Time is new OSP.OS_Time;
97 -- Notwithstanding this definition, Time is not quite the same as OS_Time.
98 -- Relative Time is positive, whereas relative OS_Time is negative,
99 -- but this declaration makes for easier conversion.
101 end Ada.Calendar;