xfail scan-tree-dump-not throw in g++.dg/pr99966.C on hppa*64*-*-*
[official-gcc.git] / gcc / m2 / gm2-libs-iso / wraptime.def
blob6422365e1e188564976ce9782e5240469621c1dc
1 (* wraptime.def provides access to time primitives.
3 Copyright (C) 2009-2024 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6 This file is part of GNU Modula-2.
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. *)
27 DEFINITION MODULE wraptime ;
30 Title : wraptime
31 Author : Gaius Mulley
32 System : GNU Modula-2
33 Date : Sun Mar 1 21:41:29 2009
34 Revision : $Version$
35 Description: provides an interface to various time related
36 entities on the underlying host operating system.
37 It provides access to the glibc/libc functions:
38 gettimeofday, settimeofday and localtime_r.
41 FROM SYSTEM IMPORT ADDRESS ;
43 TYPE
44 timeval = ADDRESS ;
45 timezone = ADDRESS ;
46 tm = ADDRESS ;
50 InitTimeval - returns a newly created opaque type.
53 PROCEDURE InitTimeval () : timeval ;
57 KillTimeval - deallocates the memory associated with an
58 opaque type.
61 PROCEDURE KillTimeval (tv: timeval) : timeval ;
65 InitTimezone - returns a newly created opaque type.
68 PROCEDURE InitTimezone () : timezone ;
72 KillTimezone - deallocates the memory associated with an
73 opaque type.
76 PROCEDURE KillTimezone (tv: timezone) : timezone ;
80 InitTM - returns a newly created opaque type.
83 PROCEDURE InitTM () : tm ;
87 KillTM - deallocates the memory associated with an
88 opaque type.
91 PROCEDURE KillTM (tv: tm) : tm ;
95 gettimeofday - calls gettimeofday(2) with the same parameters, tv,
96 and, tz. It returns 0 on success.
99 PROCEDURE gettimeofday (tv: timeval; tz: timezone) : INTEGER ;
103 settimeofday - calls settimeofday(2) with the same parameters, tv,
104 and, tz. It returns 0 on success.
107 PROCEDURE settimeofday (tv: timeval; tz: timezone) : INTEGER ;
111 GetFractions - returns the tv_usec field inside the timeval structure
112 as a CARDINAL.
115 PROCEDURE GetFractions (tv: timeval) : CARDINAL ;
119 localtime_r - returns the tm parameter, m, after it has been assigned with
120 appropriate contents determined by, tv. Notice that
121 this procedure function expects, timeval, as its first
122 parameter and not a time_t (as expected by the posix
123 equivalent). This avoids having to expose a time_t
124 system dependant definition.
127 PROCEDURE localtime_r (tv: timeval; m: tm) : tm ;
131 GetYear - returns the year from the structure, m.
134 PROCEDURE GetYear (m: tm) : CARDINAL ;
138 GetMonth - returns the month from the structure, m.
141 PROCEDURE GetMonth (m: tm) : CARDINAL ;
145 GetDay - returns the day of the month from the structure, m.
148 PROCEDURE GetDay (m: tm) : CARDINAL ;
152 GetHour - returns the hour of the day from the structure, m.
155 PROCEDURE GetHour (m: tm) : CARDINAL ;
159 GetMinute - returns the minute within the hour from the structure, m.
162 PROCEDURE GetMinute (m: tm) : CARDINAL ;
166 GetSecond - returns the seconds in the minute from the structure, m.
167 The return value will always be in the range 0..59.
168 A leap minute of value 60 will be truncated to 59.
171 PROCEDURE GetSecond (m: tm) : CARDINAL ;
175 GetSummerTime - returns a boolean indicating whether summer time is
176 set.
179 PROCEDURE GetSummerTime (tz: timezone) : BOOLEAN ;
183 GetDST - returns the number of minutes west of GMT.
186 PROCEDURE GetDST (tz: timezone) : INTEGER ;
190 SetTimeval - sets the fields in timeval, tv, with:
191 second, minute, hour, day, month, year, fractions.
194 PROCEDURE SetTimeval (tv: timeval;
195 second, minute, hour, day,
196 month, year, yday, wday, isdst: CARDINAL) ;
200 SetTimezone - set the timezone field inside timeval, tv.
203 PROCEDURE SetTimezone (tv: timeval;
204 zone: CARDINAL; minuteswest: INTEGER) ;
207 END wraptime.