1------------------------------------------------------------------------------- 2-- 3-- THIS FILE AND ANY ASSOCIATED DOCUMENTATION IS PROVIDED WITHOUT CHARGE 4-- "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING 5-- BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR 6-- FITNESS FOR A PARTICULAR PURPOSE. The user assumes the entire risk as to 7-- the accuracy and the use of this file. This file may be used, copied, 8-- modified and distributed only by licensees of Microsoft Corporation's 9-- WIN32 Software Development Kit in accordance with the terms of the 10-- licensee's End-User License Agreement for Microsoft Software for the 11-- WIN32 Development Kit. 12-- 13-- Copyright (c) Intermetrics, Inc. 1995 14-- Portions (c) 1985-1994 Microsoft Corporation with permission. 15-- Microsoft is a registered trademark and Windows and Windows NT are 16-- trademarks of Microsoft Corporation. 17-- 18------------------------------------------------------------------------------- 19 20with Win32.crt.Types; 21 22package Win32.crt.Time is 23 24 CLOCKS_PER_SEC : constant := 1000; 25 -- time.h:92 26 27 type clock_t is new Win32.LONG; -- time.h:53 28 29 type tm; -- time.h:75 30 31 type ac_time_t is access constant Win32.crt.Types.time_t; 32 type ac_tm_t is access constant tm; -- time.h:137 33 type a_tm_t is access all tm; -- time.h:141 34 35 type tm is -- time.h:75 36 record 37 tm_sec : Win32.INT; -- time.h:76 38 tm_min : Win32.INT; -- time.h:77 39 tm_hour : Win32.INT; -- time.h:78 40 tm_mday : Win32.INT; -- time.h:79 41 tm_mon : Win32.INT; -- time.h:80 42 tm_year : Win32.INT; -- time.h:81 43 tm_wday : Win32.INT; -- time.h:82 44 tm_yday : Win32.INT; -- time.h:83 45 tm_isdst : Win32.INT; -- time.h:84 46 end record; 47 48 type TZ_Array is array (0 .. 1) of Win32.PSTR; 49 50 -- auxiliary declarations 51 type AI is access Win32.INT; 52 function daylight_Addr return AI; 53 pragma Import (C, daylight_Addr, "__p__daylight"); 54 55 type AL is access Win32.LONG; 56 function timezone_Addr return AL; 57 pragma Import (C, timezone_Addr, "__p__timezone"); 58 59 type ATZ is access all TZ_Array; 60 function tzname_Addr return ATZ; 61 pragma Import (C, tzname_Addr, "__p__tzname"); 62 -- end of auxiliary declarations 63 64 daylight : Win32.INT renames daylight_Addr.all; -- time.h:101 65 -- non-zero if daylight savings time is used 66 67 timezone : Win32.LONG renames timezone_Addr.all; -- time.h:102 68 -- difference in seconds between GMT and local time 69 70 tzname : TZ_Array renames tzname_Addr.all; -- time.h:111 71 -- standard/daylight savings time zone names 72 73 function asctime (timeptr : ac_tm_t) return Win32.PSTR; -- time.h:137 74 75 function ctime (timer : ac_time_t) return Win32.PSTR; -- time.h:138 76 77 function clock return clock_t; -- time.h:139 78 79 function difftime (timer1 : Win32.crt.Types.time_t; 80 timer0 : Win32.crt.Types.time_t) 81 return Win32.DOUBLE; -- time.h:140 82 83 function gmtime (timer : ac_time_t) return a_tm_t; -- time.h:141 84 85 function localtime (timer : ac_time_t) return a_tm_t; -- time.h:142 86 87 function mktime (timeptr : access tm) return Win32.crt.Types.time_t; 88 -- time.h:143 89 90 function strftime (string1 : Win32.PSTR; 91 maxsize : Win32.Size_T; 92 format : Win32.PCSTR; 93 timeptr : ac_tm_t) 94 return Win32.Size_T; -- time.h:144 95 96 function strdate (datestr : Win32.PSTR) return Win32.PSTR; 97 -- time.h:145 98 99 function strtime (timestr : Win32.PSTR) return Win32.PSTR; 100 -- time.h:146 101 102 function time (timer : access Win32.crt.Types.time_t) 103 return Win32.crt.Types.time_t; -- time.h:147 104 105 procedure tzset; -- time.h:151 106 107 function getsystime (p1 : access tm) return Win32.UINT; 108 -- time.h:153 109 110 function setsystime (p1 : access tm; 111 p2 : Win32.UINT) 112 return Win32.UINT; -- time.h:154 113 114private 115 116 pragma Convention (C, tm); -- time.h:75 117 118 pragma Import (C, asctime, "asctime"); -- time.h:137 119 pragma Import (C, ctime, "ctime"); -- time.h:138 120 pragma Import (C, clock, "clock"); -- time.h:139 121 pragma Import (C, difftime, "difftime"); -- time.h:140 122 pragma Import (C, gmtime, "gmtime"); -- time.h:141 123 pragma Import (C, localtime, "localtime"); -- time.h:142 124 pragma Import (C, mktime, "mktime"); -- time.h:143 125 pragma Import (C, strftime, "strftime"); -- time.h:144 126 pragma Import (C, strdate, "_strdate"); -- time.h:145 127 pragma Import (C, strtime, "_strtime"); -- time.h:146 128 pragma Import (C, time, "time"); -- time.h:147 129 pragma Import (C, tzset, "_tzset"); -- time.h:151 130 pragma Import (C, getsystime, "_getsystime"); -- time.h:153 131 pragma Import (C, setsystime, "_setsystime"); -- time.h:154 132 133end Win32.crt.Time; 134