]>
git.saurik.com Git - apple/system_cmds.git/blob - zic.tproj/tzfile.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
24 /* $OpenBSD: tzfile.h,v 1.4 1997/01/14 03:16:52 millert Exp $ */
31 ** This file is in the public domain, so clarified as of
32 ** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
36 ** This header is for use ONLY with the time conversion code.
37 ** There is no guarantee that it will remain unchanged,
38 ** or that it will remain at all.
39 ** Do NOT copy it to any system include directory.
50 static char tzfilehid
[] = "@(#)tzfile.h 7.9";
51 #endif /* !defined NOID */
52 #endif /* !defined lint */
56 ** Information about time zone files.
60 #define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */
61 #endif /* !defined TZDIR */
64 #define TZDEFAULT "/etc/localtime"
65 #endif /* !defined TZDEFAULT */
68 #define TZDEFRULES "posixrules"
69 #endif /* !defined TZDEFRULES */
72 ** Each file begins with. . .
76 char tzh_reserved
[20]; /* reserved for future use */
77 char tzh_ttisgmtcnt
[4]; /* coded number of trans. time flags */
78 char tzh_ttisstdcnt
[4]; /* coded number of trans. time flags */
79 char tzh_leapcnt
[4]; /* coded number of leap seconds */
80 char tzh_timecnt
[4]; /* coded number of transition times */
81 char tzh_typecnt
[4]; /* coded number of local time types */
82 char tzh_charcnt
[4]; /* coded number of abbr. chars */
86 ** . . .followed by. . .
88 ** tzh_timecnt (char [4])s coded transition times a la time(2)
89 ** tzh_timecnt (unsigned char)s types of local time starting at above
90 ** tzh_typecnt repetitions of
91 ** one (char [4]) coded GMT offset in seconds
92 ** one (unsigned char) used to set tm_isdst
93 ** one (unsigned char) that's an abbreviation list index
94 ** tzh_charcnt (char)s '\0'-terminated zone abbreviations
95 ** tzh_leapcnt repetitions of
96 ** one (char [4]) coded leap second transition times
97 ** one (char [4]) total correction after above
98 ** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
99 ** time is standard time, if FALSE,
100 ** transition time is wall clock time
101 ** if absent, transition times are
102 ** assumed to be wall clock time
103 ** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition
104 ** time is GMT, if FALSE,
105 ** transition time is local time
106 ** if absent, transition times are
107 ** assumed to be local time
111 ** In the current implementation, "tzset()" refuses to deal with files that
112 ** exceed any of the limits below.
117 ** The TZ_MAX_TIMES value below is enough to handle a bit more than a
118 ** year's worth of solar time (corrected daily to the nearest second) or
119 ** 138 years of Pacific Presidential Election time
120 ** (where there are three time zone transitions every fourth year).
122 #define TZ_MAX_TIMES 370
123 #endif /* !defined TZ_MAX_TIMES */
127 #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
128 #endif /* !defined NOSOLAR */
131 ** Must be at least 14 for Europe/Riga as of Jan 12 1995,
132 ** as noted by Earl Chew <earl@hpato.aus.hp.com>.
134 #define TZ_MAX_TYPES 20 /* Maximum number of local time types */
135 #endif /* !defined NOSOLAR */
136 #endif /* !defined TZ_MAX_TYPES */
139 #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
140 /* (limited by what unsigned chars can hold) */
141 #endif /* !defined TZ_MAX_CHARS */
144 #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
145 #endif /* !defined TZ_MAX_LEAPS */
147 #define SECSPERMIN 60
148 #define MINSPERHOUR 60
149 #define HOURSPERDAY 24
150 #define DAYSPERWEEK 7
151 #define DAYSPERNYEAR 365
152 #define DAYSPERLYEAR 366
153 #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
154 #define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY)
155 #define MONSPERYEAR 12
160 #define TM_WEDNESDAY 3
161 #define TM_THURSDAY 4
163 #define TM_SATURDAY 6
166 #define TM_FEBRUARY 1
173 #define TM_SEPTEMBER 8
175 #define TM_NOVEMBER 10
176 #define TM_DECEMBER 11
178 #define TM_YEAR_BASE 1900
180 #define EPOCH_YEAR 1970
181 #define EPOCH_WDAY TM_THURSDAY
184 ** Accurate only for the past couple of centuries;
185 ** that will probably do.
188 #define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
193 ** Use of the underscored variants may cause problems if you move your code to
194 ** certain System-V-based systems; for maximum portability, use the
195 ** underscore-free variants. The underscored variants are provided for
196 ** backward compatibility only; they may disappear from future versions of
200 #define SECS_PER_MIN SECSPERMIN
201 #define MINS_PER_HOUR MINSPERHOUR
202 #define HOURS_PER_DAY HOURSPERDAY
203 #define DAYS_PER_WEEK DAYSPERWEEK
204 #define DAYS_PER_NYEAR DAYSPERNYEAR
205 #define DAYS_PER_LYEAR DAYSPERLYEAR
206 #define SECS_PER_HOUR SECSPERHOUR
207 #define SECS_PER_DAY SECSPERDAY
208 #define MONS_PER_YEAR MONSPERYEAR
210 #endif /* !defined USG */
212 #endif /* !defined TZFILE_H */