* gcc.c (getenv_spec_function): New function.
[official-gcc.git] / gcc / ada / a-calfor.ads
blob89e704bb64b69310823261c0f820c129e1e3535c
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- A D A . C A L E N D A R . F O R M A T T I N G --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2005 - 2006, Free Software Foundation, Inc. --
10 -- --
11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. The copyright notice above, and the license provisions that follow --
13 -- apply solely to the contents of the part following the private keyword. --
14 -- --
15 -- GNAT is free software; you can redistribute it and/or modify it under --
16 -- terms of the GNU General Public License as published by the Free Soft- --
17 -- ware Foundation; either version 2, or (at your option) any later ver- --
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
20 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
21 -- for more details. You should have received a copy of the GNU General --
22 -- Public License distributed with GNAT; see file COPYING. If not, write --
23 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
24 -- MA 02111-1307, USA. --
25 -- --
26 -- As a special exception, if other files instantiate generics from this --
27 -- unit, or you link this unit with other files to produce an executable, --
28 -- this unit does not by itself cause the resulting executable to be --
29 -- covered by the GNU General Public License. This exception does not --
30 -- however invalidate any other reasons why the executable file might be --
31 -- covered by the GNU Public License. --
32 -- --
33 -- GNAT was originally developed by the GNAT team at New York University. --
34 -- Extensive contributions were provided by Ada Core Technologies Inc. --
35 -- --
36 ------------------------------------------------------------------------------
38 with Ada.Calendar.Time_Zones;
40 package Ada.Calendar.Formatting is
42 -- Day of the week
44 type Day_Name is
45 (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday);
47 function Day_Of_Week (Date : Time) return Day_Name;
49 -- Hours:Minutes:Seconds access
51 subtype Hour_Number is Natural range 0 .. 23;
52 subtype Minute_Number is Natural range 0 .. 59;
53 subtype Second_Number is Natural range 0 .. 59;
54 subtype Second_Duration is Day_Duration range 0.0 .. 1.0;
56 function Year
57 (Date : Time;
58 Time_Zone : Time_Zones.Time_Offset := 0) return Year_Number;
60 function Month
61 (Date : Time;
62 Time_Zone : Time_Zones.Time_Offset := 0) return Month_Number;
64 function Day
65 (Date : Time;
66 Time_Zone : Time_Zones.Time_Offset := 0) return Day_Number;
68 function Hour
69 (Date : Time;
70 Time_Zone : Time_Zones.Time_Offset := 0) return Hour_Number;
72 function Minute
73 (Date : Time;
74 Time_Zone : Time_Zones.Time_Offset := 0) return Minute_Number;
76 function Second
77 (Date : Time) return Second_Number;
79 function Sub_Second
80 (Date : Time) return Second_Duration;
82 function Seconds_Of
83 (Hour : Hour_Number;
84 Minute : Minute_Number;
85 Second : Second_Number := 0;
86 Sub_Second : Second_Duration := 0.0) return Day_Duration;
88 procedure Split
89 (Seconds : Day_Duration;
90 Hour : out Hour_Number;
91 Minute : out Minute_Number;
92 Second : out Second_Number;
93 Sub_Second : out Second_Duration);
95 procedure Split
96 (Date : Time;
97 Year : out Year_Number;
98 Month : out Month_Number;
99 Day : out Day_Number;
100 Hour : out Hour_Number;
101 Minute : out Minute_Number;
102 Second : out Second_Number;
103 Sub_Second : out Second_Duration;
104 Time_Zone : Time_Zones.Time_Offset := 0);
106 function Time_Of
107 (Year : Year_Number;
108 Month : Month_Number;
109 Day : Day_Number;
110 Hour : Hour_Number;
111 Minute : Minute_Number;
112 Second : Second_Number;
113 Sub_Second : Second_Duration := 0.0;
114 Leap_Second : Boolean := False;
115 Time_Zone : Time_Zones.Time_Offset := 0) return Time;
117 function Time_Of
118 (Year : Year_Number;
119 Month : Month_Number;
120 Day : Day_Number;
121 Seconds : Day_Duration := 0.0;
122 Leap_Second : Boolean := False;
123 Time_Zone : Time_Zones.Time_Offset := 0) return Time;
125 procedure Split
126 (Date : Time;
127 Year : out Year_Number;
128 Month : out Month_Number;
129 Day : out Day_Number;
130 Hour : out Hour_Number;
131 Minute : out Minute_Number;
132 Second : out Second_Number;
133 Sub_Second : out Second_Duration;
134 Leap_Second : out Boolean;
135 Time_Zone : Time_Zones.Time_Offset := 0);
137 procedure Split
138 (Date : Time;
139 Year : out Year_Number;
140 Month : out Month_Number;
141 Day : out Day_Number;
142 Seconds : out Day_Duration;
143 Leap_Second : out Boolean;
144 Time_Zone : Time_Zones.Time_Offset := 0);
146 -- Simple image and value
148 function Image
149 (Date : Time;
150 Include_Time_Fraction : Boolean := False;
151 Time_Zone : Time_Zones.Time_Offset := 0) return String;
153 function Value
154 (Date : String;
155 Time_Zone : Time_Zones.Time_Offset := 0) return Time;
157 function Image
158 (Elapsed_Time : Duration;
159 Include_Time_Fraction : Boolean := False) return String;
161 function Value (Elapsed_Time : String) return Duration;
163 end Ada.Calendar.Formatting;