2
Copyright (c) 1990-1999 Info-ZIP. All rights reserved.
4
See the accompanying file LICENSE, version 1999-Oct-05 or later
5
(the contents of which are also included in zip.h) for terms of use.
6
If, for some reason, both of these files are missing, the Info-ZIP license
7
also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html
11
/* -----------------------------------------------------------------------------
13
The original functions (Metrowerks Codewarrior pro 3.0) gmtime, localtime,
14
mktime and time do not work correctly. The supplied link library mactime.c
15
contains replacement functions for them.
17
* Caveat: On a Mac, we only know the GMT and DST offsets for
18
* the current time, not for the time in question.
19
* Mac has no support for DST handling.
20
* DST changeover is all manually set by the user.
23
------------------------------------------------------------------------------*/
28
/*****************************************************************************/
29
/* Macros, typedefs */
30
/*****************************************************************************/
34
* ARGH. Mac times are based on 1904 Jan 1 00:00, not 1970 Jan 1 00:00.
35
* So we have to diddle time_t's appropriately: add or subtract 66 years'
36
* worth of seconds == number of days times 86400 == (66*365 regular days +
37
* 17 leap days ) * 86400 == (24090 + 17) * 86400 == 2082844800L seconds.
38
* We hope time_t is an unsigned long (ulg) on the Macintosh...
41
This Offset is only used by MacFileDate_to_UTime()
44
#define MACOS_TO_UNIX(x) (x) -= (unsigned long)MacOS_2_Unix
45
#define UNIX_TO_MACOS(x) (x) += (unsigned long)MacOS_2_Unix
48
The MacOS function GetDateTime returns the
49
number of seconds elapsed since midnight, January 1, 1904.
51
extern const unsigned long MacOS_2_Unix;
54
/* prototypes for public utility functions */
55
time_t MacFtime2UnixFtime(unsigned long macftime);
56
unsigned long UnixFtime2MacFtime(time_t unxftime);
57
time_t AdjustForTZmoveMac(unsigned long macloctim, long s_gmtoffs);
58
Boolean GetGMToffsetMac(unsigned long macftime, long *UTCoffset);